@gusto/embedded-react-sdk 0.21.0 → 0.22.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.
- package/CHANGELOG.md +31 -0
- package/README.md +32 -17
- package/dist/assets/icons/icon-file-outline.svg.js +10 -0
- package/dist/assets/icons/icon-file-outline.svg.js.map +1 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js +10 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js.map +1 -0
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +14 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -0
- package/dist/components/Common/FlowBreadcrumbs/index.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +7 -7
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +17 -16
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +3 -5
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +24 -23
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +8 -7
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -7
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +7 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +48 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +109 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.d.ts +7 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.js +34 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.js.map +1 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.d.ts +6 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js +84 -0
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/Overview/Overview.d.ts +7 -0
- package/dist/components/Contractor/Payments/Overview/Overview.js +72 -0
- package/dist/components/Contractor/Payments/Overview/Overview.js.map +1 -0
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js +131 -0
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +26 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +15 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +30 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/index.d.ts +3 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +158 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +7 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +29 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +18 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +108 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +10 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +26 -26
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +1 -0
- package/dist/components/Contractor/index.js +4 -2
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +83 -50
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +56 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +158 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -5
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/FederalTaxes/FederalForm.js +86 -32
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +62 -46
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +10 -9
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +11 -10
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +3 -5
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/Taxes/FederalForm.js +86 -32
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +97 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -5
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +12 -13
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +46 -39
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js +8 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +78 -79
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +21 -22
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +19 -19
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +17 -16
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +57 -56
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +32 -40
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +53 -53
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +127 -103
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +254 -185
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +7 -9
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +8 -8
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +34 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.EditPayment.json.js +36 -0
- package/dist/i18n/en/Contractor.Payments.EditPayment.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.Overview.json.js +34 -0
- package/dist/i18n/en/Contractor.Payments.Overview.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +34 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -0
- package/dist/i18n/en/Employee.Deductions.json.js +58 -46
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +49 -41
- package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +53 -45
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +34 -30
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/shared/constants.d.ts +12 -0
- package/dist/shared/constants.js +66 -58
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +141 -95
- package/package.json +13 -13
- package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +0 -6
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +0 -18
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +0 -1
|
@@ -9,15 +9,13 @@ 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
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [L, a] = t(
|
|
17
15
|
"CompanyDocumentListContext"
|
|
18
16
|
);
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
a as DocumentListProvider,
|
|
19
|
+
L as useDocumentList
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -12,11 +12,11 @@ import { BaseComponent as x } from "../../../Base/Base.js";
|
|
|
12
12
|
import { useBase as A } from "../../../Base/useBase.js";
|
|
13
13
|
import { SignatureForm as v } from "../../../Common/SignatureForm/SignatureForm.js";
|
|
14
14
|
import { Flex as G } from "../../../Common/Flex/Flex.js";
|
|
15
|
-
import "classnames";
|
|
16
|
-
import { companyEvents as t } from "../../../../shared/constants.js";
|
|
17
15
|
import "react-i18next";
|
|
16
|
+
import "classnames";
|
|
18
17
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
18
|
import "react";
|
|
19
|
+
import { companyEvents as t } from "../../../../shared/constants.js";
|
|
20
20
|
function oo(r) {
|
|
21
21
|
return /* @__PURE__ */ o(x, { ...r, children: /* @__PURE__ */ o(R, { ...r, children: r.children }) });
|
|
22
22
|
}
|
|
@@ -9,15 +9,13 @@ 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
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [S, c] = o(
|
|
17
15
|
"CompanySignatureFormContext"
|
|
18
16
|
);
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
c as SignatureFormProvider,
|
|
19
|
+
S as useSignatureForm
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=useSignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -12,11 +12,11 @@ import { useI18n as R, useComponentDictionary as M } from "../../../i18n/I18n.js
|
|
|
12
12
|
import { BaseComponent as B } from "../../Base/Base.js";
|
|
13
13
|
import { useBase as O } from "../../Base/useBase.js";
|
|
14
14
|
import { Flex as j } from "../../Common/Flex/Flex.js";
|
|
15
|
-
import "classnames";
|
|
16
|
-
import { companyEvents as l } from "../../../shared/constants.js";
|
|
17
15
|
import "react-i18next";
|
|
16
|
+
import "classnames";
|
|
18
17
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
18
|
import "react";
|
|
19
|
+
import { companyEvents as l } from "../../../shared/constants.js";
|
|
20
20
|
function oe(o) {
|
|
21
21
|
return /* @__PURE__ */ e(B, { ...o, children: /* @__PURE__ */ e(q, { ...o, children: o.children }) });
|
|
22
22
|
}
|
|
@@ -5,12 +5,11 @@ import { TaxPayerType as y, FilingForm as u } from "@gusto/embedded-api/models/o
|
|
|
5
5
|
import { useFederalTaxes as b } from "./useFederalTaxes.js";
|
|
6
6
|
import { Flex as g } from "../../Common/Flex/Flex.js";
|
|
7
7
|
import "classnames";
|
|
8
|
-
import "../../../shared/constants.js";
|
|
9
|
-
import { TextInputField as a } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
8
|
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
9
|
import { usePlaceholderEin as F, normalizeEin as T } from "../../../helpers/federalEin.js";
|
|
10
|
+
import { TextInputField as a } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
11
|
import { SelectField as l } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
-
function
|
|
12
|
+
function O() {
|
|
14
13
|
const { t: e } = d("Company.FederalTaxes"), { federalTaxDetails: s } = b(), i = x(), m = F(s?.hasEin), p = n(
|
|
15
14
|
() => Object.values(y).map((o) => ({
|
|
16
15
|
value: o,
|
|
@@ -101,6 +100,6 @@ function R() {
|
|
|
101
100
|
] });
|
|
102
101
|
}
|
|
103
102
|
export {
|
|
104
|
-
|
|
103
|
+
O as Form
|
|
105
104
|
};
|
|
106
105
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federalEinLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"federalEinDescription\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayerTypeLabel')}\n description={t('taxpayerTypeDescription')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federalFilingFormLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"federalFilingFormDescription\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legalEntityNameLabel')}\n description={t('legalEntityNameDescription')}\n isRequired\n errorMessage={t('legalEntityNameError')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federalEinLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"federalEinDescription\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayerTypeLabel')}\n description={t('taxpayerTypeDescription')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federalFilingFormLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"federalFilingFormDescription\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legalEntityNameLabel')}\n description={t('legalEntityNameDescription')}\n isRequired\n errorMessage={t('legalEntityNameError')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC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,YAAU;AAAA,QACV,cAAcA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACxC,GACF;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
|
-
import { FilingForm as
|
|
2
|
+
import { FilingForm as e, TaxPayerType as r } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-error-boundary";
|
|
@@ -11,21 +11,19 @@ import "../../Base/useBase.js";
|
|
|
11
11
|
import "../../../shared/constants.js";
|
|
12
12
|
import "classnames";
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
14
|
import "dompurify";
|
|
16
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
17
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const
|
|
16
|
+
const y = o.object({
|
|
19
17
|
federalEin: o.string().optional(),
|
|
20
|
-
taxPayerType: o.enum(Object.values(
|
|
21
|
-
filingForm: o.enum(Object.values(
|
|
18
|
+
taxPayerType: o.enum(Object.values(r)).optional(),
|
|
19
|
+
filingForm: o.enum(Object.values(e)).optional(),
|
|
22
20
|
legalName: o.string().min(1)
|
|
23
|
-
}), [
|
|
21
|
+
}), [C, b] = t(
|
|
24
22
|
"CompanyFederalTaxesContext"
|
|
25
23
|
);
|
|
26
24
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
y as FederalTaxFormSchema,
|
|
26
|
+
b as FederalTaxesProvider,
|
|
27
|
+
C as useFederalTaxes
|
|
30
28
|
};
|
|
31
29
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -9,19 +9,17 @@ 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
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [c, A] = t("IndustryItems", {
|
|
17
15
|
items: []
|
|
18
|
-
}), [
|
|
16
|
+
}), [P, f] = t("IndustryApi", {
|
|
19
17
|
isPending: !1
|
|
20
18
|
});
|
|
21
19
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
f as IndustryApiStateProvider,
|
|
21
|
+
A as IndustryItemsProvider,
|
|
22
|
+
P as useIndustryApiState,
|
|
23
|
+
c as useIndustryItems
|
|
26
24
|
};
|
|
27
25
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
|
|
@@ -4,14 +4,15 @@ import { useTranslation as l } from "react-i18next";
|
|
|
4
4
|
import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { Grid as p } from "../../../Common/Grid/Grid.js";
|
|
7
|
-
import
|
|
7
|
+
import "classnames";
|
|
8
8
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
9
|
import "react";
|
|
10
10
|
import { STATES_ABBR as c } from "../../../../shared/constants.js";
|
|
11
11
|
import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
|
|
12
|
+
import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
13
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
13
14
|
import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
|
|
14
|
-
const
|
|
15
|
+
const j = i.object({
|
|
15
16
|
phoneNumber: m,
|
|
16
17
|
street1: i.string().min(1),
|
|
17
18
|
street2: i.string().optional(),
|
|
@@ -20,7 +21,7 @@ const S = i.object({
|
|
|
20
21
|
zip: n,
|
|
21
22
|
addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
|
|
22
23
|
});
|
|
23
|
-
function
|
|
24
|
+
function C() {
|
|
24
25
|
const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
|
|
25
26
|
return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
|
|
26
27
|
/* @__PURE__ */ t(
|
|
@@ -106,7 +107,7 @@ function j() {
|
|
|
106
107
|
] });
|
|
107
108
|
}
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
C as Form,
|
|
111
|
+
j as LocationFormSchema
|
|
111
112
|
};
|
|
112
113
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAA;AACpE,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,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AA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -10,14 +10,14 @@ import { Actions as I } from "./Actions.js";
|
|
|
10
10
|
import { LocationsFormProvider as M } from "./useLocationForm.js";
|
|
11
11
|
import { Form as _ } from "../../../Common/Form/Form.js";
|
|
12
12
|
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
13
|
-
import "classnames";
|
|
14
|
-
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
15
13
|
import "react-i18next";
|
|
14
|
+
import "classnames";
|
|
16
15
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
16
|
import "react";
|
|
18
17
|
import { BaseComponent as z } from "../../../Base/Base.js";
|
|
19
18
|
import { useBase as U } from "../../../Base/useBase.js";
|
|
20
19
|
import { useI18n as j } from "../../../../i18n/I18n.js";
|
|
20
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
21
21
|
function H(t) {
|
|
22
22
|
const {
|
|
23
23
|
data: { location: e }
|
|
@@ -9,15 +9,13 @@ 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
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [F, d] = o(
|
|
17
15
|
"CompanyDocumentFormContext"
|
|
18
16
|
);
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
d as LocationsFormProvider,
|
|
19
|
+
F as useLocationsForm
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=useLocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -9,10 +9,10 @@ import { useI18n as O } from "../../../../i18n/I18n.js";
|
|
|
9
9
|
import { BaseComponent as x } from "../../../Base/Base.js";
|
|
10
10
|
import { useBase as E } from "../../../Base/useBase.js";
|
|
11
11
|
import { Flex as I } from "../../../Common/Flex/Flex.js";
|
|
12
|
-
import "classnames";
|
|
13
|
-
import { companyEvents as i } from "../../../../shared/constants.js";
|
|
14
12
|
import "react-i18next";
|
|
13
|
+
import "classnames";
|
|
15
14
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import { companyEvents as i } from "../../../../shared/constants.js";
|
|
16
16
|
function W(o) {
|
|
17
17
|
return /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
|
|
18
18
|
}
|
|
@@ -9,15 +9,13 @@ 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
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [x, d] = o(
|
|
17
15
|
"CompanyDocumentListContext"
|
|
18
16
|
);
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
d as LocationsListProvider,
|
|
19
|
+
x as useLocationsList
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAmBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -3,10 +3,9 @@ import { useTranslation as m } from "react-i18next";
|
|
|
3
3
|
import { useOnboardingOverview as l } from "./context.js";
|
|
4
4
|
import { Flex as p } from "../../Common/Flex/Flex.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import "../../../shared/constants.js";
|
|
7
6
|
import { useComponentContext as a } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
9
|
-
const
|
|
8
|
+
const x = () => {
|
|
10
9
|
const e = a(), { onboardingCompleted: t, handleDone: r } = l(), { t: o } = m("Company.OnboardingOverview");
|
|
11
10
|
return t ? /* @__PURE__ */ i(p, { alignItems: "center", flexDirection: "column", gap: 8, children: [
|
|
12
11
|
/* @__PURE__ */ n(e.Heading, { as: "h2", textAlign: "center", children: o("onboardingCompletedTitle") }),
|
|
@@ -15,6 +14,6 @@ const b = () => {
|
|
|
15
14
|
] }) : null;
|
|
16
15
|
};
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
x as Completed
|
|
19
18
|
};
|
|
20
19
|
//# sourceMappingURL=Completed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAA,GACb,EAAE,qBAAAC,GAAqB,YAAAC,EAAA,IAAeC,EAAA,GACtC,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAA,EAAK,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAAK,EAAE,0BAA0B,EAAA,CAC/B;AAAA,IACA,gBAAAG,EAAC,KAAA,EAAG,UAAAH,EAAE,gCAAgC,EAAA,CAAE;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAAE,EAAE,wBAAwB,EAAA,CAC7B;AAAA,EAAA,GACF,IAXO;AAaX;"}
|
|
@@ -3,12 +3,11 @@ import { useTranslation as l } from "react-i18next";
|
|
|
3
3
|
import { useOnboardingOverview as a } from "./context.js";
|
|
4
4
|
import { Flex as c } from "../../Common/Flex/Flex.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import "../../../shared/constants.js";
|
|
7
6
|
import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
7
|
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
8
|
import "react";
|
|
10
9
|
import { RequirementsList as g } from "../../Common/RequirementsList/RequirementsList.js";
|
|
11
|
-
const
|
|
10
|
+
const D = () => {
|
|
12
11
|
const r = d(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = l("Company.OnboardingOverview");
|
|
13
12
|
if (s)
|
|
14
13
|
return null;
|
|
@@ -30,6 +29,6 @@ const O = () => {
|
|
|
30
29
|
] });
|
|
31
30
|
};
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
D as MissingRequirements
|
|
34
33
|
};
|
|
35
34
|
//# sourceMappingURL=MissingRequirements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAA,GACb,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAA,GAC3D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACF,WAAO;AAGT,QAAMK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAA,gBAAAC,EAACX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAM,EAAEE,IAAiB,sBAAsB,0BAA0B,EAAA,CACtE;AAAA,sBACC,KAAA,EAAG,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAAAO,OAAS;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,IAGN,gBAAAE,EAACE,GAAA,EACC,UAAA,gBAAAF,EAACX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAAE,EAAEE,IAAiB,oBAAoB,wBAAwB,GAClE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -7,11 +7,11 @@ import { BaseComponent as f } from "../../Base/Base.js";
|
|
|
7
7
|
import { useBase as v } from "../../Base/useBase.js";
|
|
8
8
|
import { useI18n as C, useComponentDictionary as g } from "../../../i18n/I18n.js";
|
|
9
9
|
import { Flex as h } from "../../Common/Flex/Flex.js";
|
|
10
|
-
import "classnames";
|
|
11
|
-
import { componentEvents as i } from "../../../shared/constants.js";
|
|
12
10
|
import "react-i18next";
|
|
11
|
+
import "classnames";
|
|
13
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
13
|
import "react";
|
|
14
|
+
import { componentEvents as i } from "../../../shared/constants.js";
|
|
15
15
|
function F(o) {
|
|
16
16
|
return C("Company.OnboardingOverview"), g("Company.OnboardingOverview", o.dictionary), /* @__PURE__ */ n(f, { ...o, children: /* @__PURE__ */ n(b, { ...o, children: o.children }) });
|
|
17
17
|
}
|
|
@@ -9,13 +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
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [w, x] = o("OnboardingOverviewContext");
|
|
17
15
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
x as OnboardingOverviewProvider,
|
|
17
|
+
w as useOnboardingOverview
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
|
|
@@ -11,11 +11,11 @@ import { Form as Z } from "../../Common/Form/Form.js";
|
|
|
11
11
|
import { BaseComponent as $ } from "../../Base/Base.js";
|
|
12
12
|
import { useBase as V } from "../../Base/useBase.js";
|
|
13
13
|
import { Flex as ee } from "../../Common/Flex/Flex.js";
|
|
14
|
-
import "classnames";
|
|
15
|
-
import { componentEvents as S } from "../../../shared/constants.js";
|
|
16
14
|
import "react-i18next";
|
|
15
|
+
import "classnames";
|
|
17
16
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
18
17
|
import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
|
|
18
|
+
import { componentEvents as S } from "../../../shared/constants.js";
|
|
19
19
|
import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
|
|
20
20
|
import { Head as te } from "./_parts/Head.js";
|
|
21
21
|
import { List as ae } from "./_parts/List.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.errorKey as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,EAAA,IAAiBC,EAAA,GAEtE,EAAE,MAAMC,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAAhB;AAAA,EAAA,CACD,GAEK,CAACiB,GAAMC,CAAO,IAAIC;AAAA,IACtBJ,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACK,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWrB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IACzC,qBAAqB;AAAA,EAAA,GAGjBsB,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAE5BC,IA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edule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.errorKey as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,EAAA,IAAiBC,EAAA,GAEtE,EAAE,MAAMC,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAAhB;AAAA,EAAA,CACD,GAEK,CAACiB,GAAMC,CAAO,IAAIC;AAAA,IACtBJ,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACK,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWrB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QA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