@gusto/embedded-react-sdk 0.23.1 → 0.24.1

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 (213) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
  3. package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
  4. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
  5. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
  6. package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
  7. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  8. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
  11. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  12. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  13. package/dist/components/Common/index.d.ts +1 -0
  14. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  15. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  21. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  25. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  27. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  30. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  31. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  33. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  34. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  35. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  36. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  37. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  38. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  39. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  40. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  41. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  42. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  43. package/dist/components/Company/Industry/Context.js +6 -7
  44. package/dist/components/Company/Industry/Context.js.map +1 -1
  45. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  46. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  48. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  49. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
  50. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  51. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  52. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  53. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  54. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  55. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  56. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  57. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  58. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  59. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  60. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  61. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  62. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  63. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  64. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  65. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  66. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  67. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  68. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  70. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  71. package/dist/components/Contractor/Address/Address.js +2 -2
  72. package/dist/components/Contractor/Address/Form.js +1 -1
  73. package/dist/components/Contractor/Address/useAddress.js +5 -6
  74. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  75. package/dist/components/Contractor/ContractorList/index.js +17 -17
  76. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
  77. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  78. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
  79. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  80. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  81. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
  82. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  83. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  84. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  85. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
  86. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  87. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  88. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  89. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  90. package/dist/components/Contractor/Submit/Submit.js +1 -1
  91. package/dist/components/Employee/Compensation/Edit.js +14 -14
  92. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  93. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  94. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
  95. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  96. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
  97. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  98. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  99. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  100. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  101. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  102. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  103. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  104. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  105. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  106. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  107. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  108. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  109. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  110. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  111. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  112. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  113. package/dist/components/Employee/FederalTaxes/FederalForm.js +9 -7
  114. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  115. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  116. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  117. package/dist/components/Employee/Landing/Landing.js +8 -8
  118. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  119. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
  120. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  121. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  122. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  123. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  124. package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
  125. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  126. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  127. package/dist/components/Employee/Profile/useProfile.js +3 -4
  128. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  129. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  130. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  131. package/dist/components/Employee/Taxes/FederalForm.js +8 -6
  132. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  133. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  134. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  135. package/dist/components/Flow/Flow.js +2 -3
  136. package/dist/components/Flow/Flow.js.map +1 -1
  137. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
  138. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
  139. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  140. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  141. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
  142. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
  143. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
  144. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  145. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
  146. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  147. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
  148. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
  149. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  150. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
  151. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
  152. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  153. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
  154. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
  155. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  156. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
  157. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +72 -71
  158. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  159. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  160. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  161. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  162. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
  163. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  164. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
  165. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
  166. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  167. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
  168. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  169. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
  170. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
  171. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  172. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
  173. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
  174. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  175. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
  176. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  177. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
  178. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
  179. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  180. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  181. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +237 -232
  182. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  183. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  184. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  185. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  186. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +25 -15
  187. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  188. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  189. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +152 -138
  190. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  191. package/dist/components/Payroll/index.d.ts +1 -0
  192. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  193. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  194. package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
  195. package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
  196. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  197. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  198. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  199. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  200. package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
  201. package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
  202. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  203. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
  204. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  205. package/dist/i18n/en/common.json.d.ts +1 -0
  206. package/dist/i18n/en/common.json.js +1 -1
  207. package/dist/index.d.ts +1 -0
  208. package/dist/shared/constants.d.ts +1 -1
  209. package/dist/shared/constants.js +6 -5
  210. package/dist/shared/constants.js.map +1 -1
  211. package/dist/style.css +1 -1
  212. package/dist/types/i18next.d.ts +1 -0
  213. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField","TextInputField"],"mappings":";;;;;;;;;;;;AAMA,MAAMA,IAAgBC,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,kBAAkBA,EAAE,SAAS,UAAU,MAAM;AAAA,EAC7C,aAAaA,EAAE,SAAS,UAAU,MAAM;AAAA,EACxC,YAAYA,EAAE,SAAS,UAAU,MAAM;AAAA,EACvC,kBAAkBA,EAAE,OAAA,EAAS,UAAU,MAAM;AAC/C,CAAC,GAEKC,IAAgBD,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,6BAA6BA,EAAE,OAAA,EAAS,IAAA;AAAA,EACxC,uBAAuBA,EAAE,OAAA;AAC3B,CAAC,GAEYE,IAAoBF,EAAE,mBAAmB,cAAc,CAACD,GAAeE,CAAa,CAAC;AAK3F,SAASE,IAAc;AAC5B,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAGlB,SAFmBD,EAAM,YAAY,MAElB,kCACTE,GAAA,EAAY,sBAGdC,GAAA,EAAY;AACtB;AAEA,SAASD,IAAc;AACrB,QAAM,EAAE,GAAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvCC,IAAaC,EAAA,GAEbC,IAAsB;AAAA,IAC1B,EAAE,OAAO,UAA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;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnC,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,gCAAgC;AAAA,QAC/C,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAASI;AAAA,QACT,YAAU;AAAA,QACV,cAAcJ,EAAE,iCAAiC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnD,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOZ,EAAE,uBAAuB;AAAA,QAChC,MAAK;AAAA,QACL,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EACnC,GACF;AAEJ;"}
1
+ {"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField","TextInputField"],"mappings":";;;;;;;;;;;;AAMA,MAAMA,IAAgBC,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,kBAAkBA,EAAE,SAAS,UAAU,MAAM;AAAA,EAC7C,aAAaA,EAAE,SAAS,UAAU,MAAM;AAAA,EACxC,YAAYA,EAAE,SAAS,UAAU,MAAM;AAAA,EACvC,kBAAkBA,EAAE,OAAA,EAAS,UAAU,MAAM;AAC/C,CAAC,GAEKC,IAAgBD,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,6BAA6BA,EAAE,OAAA,EAAS,IAAA;AAAA,EACxC,uBAAuBA,EAAE,OAAA;AAC3B,CAAC,GAEYE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A6B,EAAA;AAAA,IACpE,EAAE,OAAO,2BAA2B,OAAOA,EAAE,mCAAmC,EAAA;AAAA,IAChF,EAAE,OAAO,mCAAmC,OAAOA,EAAE,qCAAqC,EAAA;AAAA,EAAE;AAG9F,SACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOX,EAAE,6BAA6B;AAAA,QACtC,KAAK;AAAA,QACL,uBAAuB;AAAA,QACvB,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnC,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,gCAAgC;AAAA,QAC/C,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAASI;AAAA,QACT,YAAU;AAAA,QACV,cAAcJ,EAAE,iCAAiC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnD,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOZ,EAAE,uBAAuB;AAAA,QAChC,MAAK;AAAA,QACL,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EACnC,GACF;AAEJ;"}
@@ -9,12 +9,11 @@ import "../../Base/useBase.js";
9
9
  import "../../../shared/constants.js";
10
10
  import "classnames";
11
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
12
  import "dompurify";
14
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
- const [u, f] = o("TaxesContext");
14
+ const [d, u] = o("TaxesContext");
16
15
  export {
17
- f as TaxesProvider,
18
- u as useTaxes
16
+ u as TaxesProvider,
17
+ d as useTaxes
19
18
  };
20
19
  //# sourceMappingURL=useTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}
1
+ {"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}
@@ -4,11 +4,10 @@ import { useTranslation as w } from "react-i18next";
4
4
  import { FlowBreadcrumbs as F } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
5
5
  import { Flex as s, FlexItem as d } from "../Common/Flex/Flex.js";
6
6
  import "classnames";
7
- import "../../shared/constants.js";
8
7
  import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
9
8
  import "react";
10
9
  import { FlowContext as E } from "./useFlow.js";
11
- const q = ({
10
+ const k = ({
12
11
  onEvent: x,
13
12
  machine: f
14
13
  }) => {
@@ -60,6 +59,6 @@ const q = ({
60
59
  ) });
61
60
  };
62
61
  export {
63
- q as Flow
62
+ k as Flow
64
63
  };
65
64
  //# sourceMappingURL=Flow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,EAAC,IACbT,EAAQ;AAEZ,WAASI,EAAYM,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASZ;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BU,CAAK,IAEnDC,EAAOD,CAAK,GAGdlB,EAAQgB,GAAMC,CAAI;AAAA,EACpB;AAEA,2BACGG,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGhB,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAiB,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAT,MAAoB,cAAcE,KAAeD,KAChD,gBAAAS;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,YAAAU;AAAA,YACA,aAAAC;AAAA,YACA,OAAOT,EAAE,oBAAoB,EAAE,YAAAQ,GAAY,aAAAC,GAAa;AAAA,YACxD,KAAKP,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxBK,MAAoB,iBACnB,gBAAAY,EAACH,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,UAAA,gBAAAC,EAACG,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,aAAaX,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,cAC9E,qBAAAA;AAAA,cACA,SAASJ;AAAA,YAAA;AAAA,UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,EAAC,IACbT,EAAQ;AAEZ,WAASI,EAAYM,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASZ;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BU,CAAK,IAEnDC,EAAOD,CAAK,GAGdlB,EAAQgB,GAAMC,CAAI;AAAA,EACpB;AAEA,2BACGG,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGhB,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAiB,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAT,MAAoB,cAAcE,KAAeD,KAChD,gBAAAS;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,YAAAU;AAAA,YACA,aAAAC;AAAA,YACA,OAAOT,EAAE,oBAAoB,EAAE,YAAAQ,GAAY,aAAAC,GAAa;AAAA,YACxD,KAAKP,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxBK,MAAoB,iBACnB,gBAAAY,EAACH,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,UAAA,gBAAAC,EAACG,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,aAAaX,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,cAC9E,qBAAAA;AAAA,cACA,SAASJ;AAAA,YAAA;AAAA,UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,6 +1,6 @@
1
+ import { ConfirmWireDetailsProps } from './types';
1
2
  import { BaseComponentInterface } from '../../Base';
2
- export interface ConfirmWireDetailsProps extends BaseComponentInterface {
3
- companyId: string;
4
- wireInId?: string;
3
+ export type { ConfirmWireDetailsComponentType } from './types';
4
+ interface ConfirmWireDetailsInternalProps extends Omit<BaseComponentInterface, 'onEvent'>, ConfirmWireDetailsProps {
5
5
  }
6
- export declare function ConfirmWireDetails(props: ConfirmWireDetailsProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ConfirmWireDetails({ onEvent, ...props }: ConfirmWireDetailsInternalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as M } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as M } from "react/jsx-runtime";
2
2
  import { createMachine as S } from "robot3";
3
3
  import { useMachine as T } from "react-robot";
4
4
  import { useState as v, useRef as x, useMemo as d } from "react";
@@ -11,31 +11,36 @@ import { useComponentContext as q } from "../../../contexts/ComponentAdapter/use
11
11
  import { FlowContext as B } from "../../Flow/useFlow.js";
12
12
  import { payrollWireEvents as r } from "../../../shared/constants.js";
13
13
  import { ConfirmWireDetailsBanner as g } from "./ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js";
14
- function $(n) {
15
- return /* @__PURE__ */ e(P, { ...n, children: /* @__PURE__ */ e(j, { ...n }) });
14
+ function $({
15
+ onEvent: t = () => {
16
+ },
17
+ ...e
18
+ }) {
19
+ return /* @__PURE__ */ o(P, { ...e, onEvent: t, children: /* @__PURE__ */ o(j, { ...e, onEvent: t }) });
16
20
  }
17
- function j({ companyId: n, wireInId: t, onEvent: c }) {
21
+ function j({ companyId: t, wireInId: e, onEvent: c = () => {
22
+ } }) {
18
23
  const { Modal: p, LoadingSpinner: C } = q(), [L, s] = v(!1), l = x(null), { data: _ } = N({
19
- companyUuid: n
24
+ companyUuid: t
20
25
  }), f = (_.wireInRequestList || []).filter(
21
- (o) => o.status === "awaiting_funds"
22
- ), W = d(() => t || f[0]?.uuid, [t, f[0]?.uuid]), E = d(
26
+ (n) => n.status === "awaiting_funds"
27
+ ), W = d(() => e || f[0]?.uuid, [e, f[0]?.uuid]), A = d(
23
28
  () => S(
24
29
  "banner",
25
30
  F,
26
31
  () => ({
27
32
  component: null,
28
- companyId: n,
29
- wireInId: t,
33
+ companyId: t,
34
+ wireInId: e,
30
35
  selectedWireInId: W,
31
36
  onEvent: i,
32
37
  modalContainerRef: l
33
38
  })
34
39
  ),
35
- [n, t]
36
- ), [a, A] = T(E);
37
- function i(o, R) {
38
- A({ type: o, payload: R }), o === r.PAYROLL_WIRE_START_TRANSFER && s(!0), (o === r.PAYROLL_WIRE_INSTRUCTIONS_CANCEL || o === r.PAYROLL_WIRE_FORM_CANCEL || o === r.PAYROLL_WIRE_FORM_DONE) && s(!1), c(o, R);
40
+ [t, e]
41
+ ), [a, E] = T(A);
42
+ function i(n, R) {
43
+ E({ type: n, payload: R }), n === r.PAYROLL_WIRE_START_TRANSFER && s(!0), (n === r.PAYROLL_WIRE_INSTRUCTIONS_CANCEL || n === r.PAYROLL_WIRE_FORM_CANCEL || n === r.PAYROLL_WIRE_FORM_DONE) && s(!1), c(n, R);
39
44
  }
40
45
  const h = () => {
41
46
  i(r.PAYROLL_WIRE_START_TRANSFER);
@@ -50,30 +55,30 @@ function j({ companyId: n, wireInId: t, onEvent: c }) {
50
55
  onEvent: i
51
56
  },
52
57
  children: [
53
- /* @__PURE__ */ e(
58
+ /* @__PURE__ */ o(
54
59
  g,
55
60
  {
56
- companyId: n,
57
- wireInId: t,
61
+ companyId: t,
62
+ wireInId: e,
58
63
  onStartWireTransfer: h,
59
64
  onEvent: c,
60
65
  confirmationAlert: a.context.confirmationAlert
61
66
  }
62
67
  ),
63
- /* @__PURE__ */ e(
68
+ /* @__PURE__ */ o(
64
69
  p,
65
70
  {
66
71
  isOpen: L,
67
72
  onClose: O,
68
73
  containerRef: l,
69
- footer: u && /* @__PURE__ */ e(
74
+ footer: u && /* @__PURE__ */ o(
70
75
  Y,
71
76
  {
72
- LoaderComponent: () => /* @__PURE__ */ e("div", { className: D.footer, children: /* @__PURE__ */ e(C, { size: "sm" }) }),
73
- children: /* @__PURE__ */ e(u, { onEvent: i })
77
+ LoaderComponent: () => /* @__PURE__ */ o("div", { className: D.footer, children: /* @__PURE__ */ o(C, { size: "sm" }) }),
78
+ children: /* @__PURE__ */ o(u, { onEvent: i })
74
79
  }
75
80
  ),
76
- children: m && /* @__PURE__ */ e(m, {})
81
+ children: m && /* @__PURE__ */ o(m, {})
77
82
  }
78
83
  )
79
84
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\nexport interface ConfirmWireDetailsProps extends BaseComponentInterface {\n companyId: string\n wireInId?: string\n}\n\nexport function ConfirmWireDetails(props: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries\n LoaderComponent={() => (\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n )}\n >\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","props","jsx","BaseComponent","Root","companyId","wireInId","onEvent","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","styles"],"mappings":";;;;;;;;;;;;;AAkBO,SAASA,EAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,WA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,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAvB;AAAA,UAACoC;AAAA,UAAA;AAAA,YACC,WAAAjC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqB0B;AAAA,YACrB,SAAAzB;AAAA,YACA,mBAAmBmB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAxB;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAjC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,iBAAiB,MACf,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACO,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAP,EAACiC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA;AAAA,YAKnC,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\ninterface ConfirmWireDetailsInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, ConfirmWireDetailsProps {}\n\nexport function ConfirmWireDetails({\n onEvent = () => {},\n ...props\n}: ConfirmWireDetailsInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent = () => {} }: ConfirmWireDetailsInternalProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries\n LoaderComponent={() => (\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n )}\n >\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","styles"],"mappings":";;;;;;;;;;;;;AAkBO,SAASA,EAAmB;AAAA,EACjC,SAAAC,IAAU,MAAM;AAAA,EAAC;AAAA,EACjB,GAAGC;AACL,GAAoC;AAClC,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAA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EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAtB;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,WAAAhC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqByB;AAAA,YACrB,SAAA/B;AAAA,YACA,mBAAmByB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAvB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC;AAAA,cAACoC;AAAA,cAAA;AAAA,gBACC,iBAAiB,MACf,gBAAApC,EAAC,OAAA,EAAI,WAAWqC,EAAO,QACrB,UAAA,gBAAArC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA;AAAA,YAKnC,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -16,12 +16,12 @@ import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n
16
16
  import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
17
17
  import { payrollWireEvents as N } from "../../../../shared/constants.js";
18
18
  import "classnames";
19
- import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
20
- import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
21
- import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
22
19
  import "react";
23
- import { TextAreaField as X } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
24
- import { useDateFormatter as Z } from "../../../../hooks/useDateFormatter.js";
20
+ import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
21
+ import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
22
+ import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
23
+ import { TextInputField as X } from "../../../Common/Fields/TextInputField/TextInputField.js";
24
+ import { DatePickerField as Z } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
25
25
  const $ = r.object({
26
26
  amountSent: r.number().positive(),
27
27
  dateSent: r.date(),
@@ -43,7 +43,7 @@ const oe = ({
43
43
  modalContainerRef: y
44
44
  }) => {
45
45
  z("Payroll.ConfirmWireDetailsForm", i), g("Payroll.ConfirmWireDetailsForm");
46
- const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = Z(), { data: P } = U({
46
+ const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = J(), { data: P } = U({
47
47
  wireInRequestUuid: o
48
48
  }), W = P.wireInRequest, { data: q } = G({
49
49
  companyId: n,
@@ -95,7 +95,7 @@ const oe = ({
95
95
  }
96
96
  ),
97
97
  /* @__PURE__ */ e(
98
- J,
98
+ Z,
99
99
  {
100
100
  name: "dateSent",
101
101
  label: t("dateLabel"),
@@ -105,7 +105,7 @@ const oe = ({
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ e(
108
- V,
108
+ X,
109
109
  {
110
110
  name: "bankName",
111
111
  label: t("bankNameLabel"),
@@ -115,7 +115,7 @@ const oe = ({
115
115
  errorMessage: t("validations.bankName")
116
116
  }
117
117
  ),
118
- /* @__PURE__ */ e(X, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
118
+ /* @__PURE__ */ e(V, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
119
119
  ] })
120
120
  }
121
121
  ) })
@@ -1,4 +1,4 @@
1
1
  import "./types/i18next.d.ts"
2
2
  export { ConfirmWireDetails } from './ConfirmWireDetails';
3
3
  export type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents';
4
- export type { ConfirmationAlert } from './types';
4
+ export type { ConfirmationAlert, ConfirmWireDetailsProps, ConfirmWireDetailsComponentType, } from './types';
@@ -1,5 +1,12 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { BaseComponentInterface } from '../../Base';
2
3
  export interface ConfirmationAlert {
3
4
  title: string;
4
5
  content?: ReactNode;
5
6
  }
7
+ export interface ConfirmWireDetailsProps {
8
+ companyId: string;
9
+ wireInId?: string;
10
+ onEvent?: BaseComponentInterface['onEvent'];
11
+ }
12
+ export type ConfirmWireDetailsComponentType = ComponentType<ConfirmWireDetailsProps>;
@@ -1,13 +1,12 @@
1
- import { jsx as l, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as d } from "react/jsx-runtime";
2
2
  import { useTranslation as P } from "react-i18next";
3
3
  import { getBlockerTranslationKeys as v } from "../payrollHelpers.js";
4
4
  import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
5
- import { Flex as d } from "../../../Common/Flex/Flex.js";
5
+ import { Flex as m } from "../../../Common/Flex/Flex.js";
6
6
  import "classnames";
7
- import "../../../../shared/constants.js";
8
7
  import "react";
9
8
  import { useI18n as C } from "../../../../i18n/I18n.js";
10
- function H({
9
+ function F({
11
10
  blockers: o,
12
11
  onMultipleViewClick: i,
13
12
  multipleViewLabel: h,
@@ -31,7 +30,7 @@ function H({
31
30
  };
32
31
  }), t = p[0];
33
32
  if (!y && t)
34
- return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 8, children: [
33
+ return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 8, children: [
35
34
  /* @__PURE__ */ l(c, { children: t.description }),
36
35
  t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(c, { variant: "supporting", size: "sm", children: t.helpText })
37
36
  ] }) });
@@ -42,7 +41,7 @@ function H({
42
41
  status: "error",
43
42
  label: e("multipleIssuesTitle", { count: o.length }),
44
43
  className: s,
45
- children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 16, children: [
44
+ children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 16, children: [
46
45
  /* @__PURE__ */ l(x, { items: g }),
47
46
  i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, { variant: "secondary", onClick: i, title: u, children: u }) })
48
47
  ] })
@@ -50,6 +49,6 @@ function H({
50
49
  );
51
50
  }
52
51
  export {
53
- H as PayrollBlockerAlerts
52
+ F as PayrollBlockerAlerts
54
53
  };
55
54
  //# sourceMappingURL=PayrollBlockerAlerts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":";;;;;;;;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MAAK,MAC7B,YAAc,SAAA,CACjB;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAIJ,QAAMgB,IAAYZ,EAAiB,IAAI,CAAAC,MAAWA,EAAQ,KAAK,GACzDY,IAAuBxB,KAAqBG,EAAE,iBAAiB;AAErE,SACE,gBAAAiB;AAAA,IAACf;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACZ,GAAA,EAAc,OAAOe,EAAA,CAAW;AAAA,QAChCxB,KACC,gBAAAqB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACd,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOyB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listIt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EAACb,GAAA,EAAK,SAAQ,cAAa,MAAK,MAC7B,YAAc,SAAA,CACjB;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAIJ,QAAMgB,IAAYZ,EAAiB,IAAI,CAAAC,MAAWA,EAAQ,KAAK,GACzDY,IAAuBxB,KAAqBG,EAAE,iBAAiB;AAErE,SACE,gBAAAiB;AAAA,IAACf;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACZ,GAAA,EAAc,OAAOe,EAAA,CAAW;AAAA,QAChCxB,KACC,gBAAAqB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACd,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOyB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -4,12 +4,11 @@ import f from "classnames";
4
4
  import u from "./PayrollBlockerList.module.scss.js";
5
5
  import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
6
  import { FlexItem as x, Flex as o } from "../../../Common/Flex/Flex.js";
7
- import "../../../../shared/constants.js";
8
7
  import "react";
9
8
  import { DataView as y } from "../../../Common/DataView/DataView.js";
10
9
  import { useDataView as g } from "../../../Common/DataView/useDataView.js";
11
10
  import { useI18n as b } from "../../../../i18n/I18n.js";
12
- function V({ blockers: i, className: s }) {
11
+ function I({ blockers: i, className: s }) {
13
12
  b("Payroll.PayrollBlocker");
14
13
  const { t: l } = p("Payroll.PayrollBlocker"), { Button: c, Text: n, Heading: m } = h(), d = g({
15
14
  data: i,
@@ -36,6 +35,6 @@ function V({ blockers: i, className: s }) {
36
35
  ] }) });
37
36
  }
38
37
  export {
39
- V as PayrollBlockerList
38
+ I as PayrollBlockerList
40
39
  };
41
40
  //# sourceMappingURL=PayrollBlockerList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":";;;;;;;;;;;AA4BO,SAASA,EAAmB,EAAE,UAAAC,GAAU,WAAAC,KAAsC;AACnF,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GAE5BC,IAAgBC,EAAY;AAAA,IAChC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAOG,EAAE,qBAAqB;AAAA,QAC9B,QAAQ,CAAAQ,MACN,gBAAAC,EAACC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAH,EAACN,GAAA,EAAK,QAAO,YAAY,UAAAK,EAAQ,OAAM;AAAA,UACvC,gBAAAC,EAACN,GAAA,EAAK,SAAQ,cAAc,YAAQ,YAAA,CAAY;AAAA,QAAA,EAAA,CAClD,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,OAAO;AAAA,QACP,QAAQ,CAAAK,MAAW;AAEjB,gBAAMK,IAASL,EAAQ;AAEvB,iBAAKK,sBAKFD,GAAA,EAAK,gBAAe,YAAW,YAAW,UACzC,4BAACV,GAAA,EAAO,SAAQ,aAAY,SAASW,EAAO,SAAS,OAAOA,EAAO,OAChE,UAAAA,EAAO,OACV,EAAA,CACF,IARO;AAAA,QAUX;AAAA,MAAA;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAIhB,EAAS,WAAW,IACf,OAIP,gBAAAY,EAAC,OAAA,EAAI,WAAWK,EAAWC,EAAO,MAAMjB,CAAS,GAC/C,UAAA,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACL,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,sBAECgB,GAAA,EAAU,GAAGV,GAAe,OAAON,EAAE,mBAAmB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":";;;;;;;;;;AA4BO,SAASA,EAAmB,EAAE,UAAAC,GAAU,WAAAC,KAAsC;AACnF,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GAE5BC,IAAgBC,EAAY;AAAA,IAChC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAOG,EAAE,qBAAqB;AAAA,QAC9B,QAAQ,CAAAQ,MACN,gBAAAC,EAACC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAH,EAACN,GAAA,EAAK,QAAO,YAAY,UAAAK,EAAQ,OAAM;AAAA,UACvC,gBAAAC,EAACN,GAAA,EAAK,SAAQ,cAAc,YAAQ,YAAA,CAAY;AAAA,QAAA,EAAA,CAClD,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,OAAO;AAAA,QACP,QAAQ,CAAAK,MAAW;AAEjB,gBAAMK,IAASL,EAAQ;AAEvB,iBAAKK,sBAKFD,GAAA,EAAK,gBAAe,YAAW,YAAW,UACzC,4BAACV,GAAA,EAAO,SAAQ,aAAY,SAASW,EAAO,SAAS,OAAOA,EAAO,OAChE,UAAAA,EAAO,OACV,EAAA,CACF,IARO;AAAA,QAUX;AAAA,MAAA;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAIhB,EAAS,WAAW,IACf,OAIP,gBAAAY,EAAC,OAAA,EAAI,WAAWK,EAAWC,EAAO,MAAMjB,CAAS,GAC/C,UAAA,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACL,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,sBAECgB,GAAA,EAAU,GAAGV,GAAe,OAAON,EAAE,mBAAmB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,EAAA,CACF;AAEJ;"}
@@ -4,7 +4,8 @@ interface PayrollConfigurationProps extends BaseComponentInterface<'Payroll.Payr
4
4
  companyId: string;
5
5
  payrollId: string;
6
6
  alerts?: ReactNode;
7
+ withReimbursements?: boolean;
7
8
  }
8
9
  export declare function PayrollConfiguration(props: PayrollConfigurationProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
9
- export declare const Root: ({ onEvent, companyId, payrollId, dictionary, alerts, }: PayrollConfigurationProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Root: ({ onEvent, companyId, payrollId, dictionary, alerts, withReimbursements, }: PayrollConfigurationProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export {};