@gusto/embedded-react-sdk 0.48.3 → 0.50.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 +71 -0
- package/README.md +8 -8
- package/dist/components/Base/Base.d.ts +11 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/createCompoundContext.d.ts +1 -1
- package/dist/components/Base/createCompoundContext.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +21 -21
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +16 -15
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +1 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +9 -8
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +104 -102
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarLegend.d.ts +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarLegend.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +87 -80
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +4 -0
- package/dist/components/Common/UI/Select/Select.js +28 -28
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +3 -2
- package/dist/components/Common/UI/Tabs/Tabs.js +9 -8
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +4 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +9 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +3 -2
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +3 -3
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +3 -3
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +3 -3
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -2
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/index.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +6 -5
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js +4 -6
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
- package/dist/components/Company/DocumentSigner/index.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -1
- package/dist/components/Company/DocumentSigner/stateMachine.js +12 -18
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +15 -6
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +23 -21
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/index.d.ts +2 -0
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +10 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +5 -7
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +11 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +1 -0
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +20 -20
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.module.scss.js +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +2 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/Locations/stateMachine.js +4 -6
- package/dist/components/Company/Locations/stateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.d.ts +38 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +14 -3
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +30 -23
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +10 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +4 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +6 -4
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +10 -14
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +1 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +29 -25
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +11 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +55 -54
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.d.ts +10 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js +11 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.test.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +7 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +5 -7
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +11 -11
- package/dist/components/Contractor/Address/Address.d.ts +14 -8
- package/dist/components/Contractor/Address/Address.js +83 -64
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Address.module.scss.js +8 -0
- package/dist/components/Contractor/Address/Address.module.scss.js.map +1 -0
- package/dist/components/Contractor/Address/index.d.ts +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +60 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.js +32 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.js.map +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.d.ts +111 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.js +26 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.js.map +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/index.d.ts +6 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +150 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js +133 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -0
- package/dist/components/Contractor/Address/types.d.ts +8 -0
- package/dist/components/Contractor/ContractorList/index.d.ts +4 -4
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.d.ts +29 -0
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +71 -0
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentsList/index.d.ts +3 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/index.d.ts +2 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.d.ts +60 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js +20 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -0
- package/dist/components/Contractor/Landing/Landing.d.ts +19 -0
- package/dist/components/Contractor/Landing/Landing.js +73 -0
- package/dist/components/Contractor/Landing/Landing.js.map +1 -0
- package/dist/components/Contractor/Landing/index.d.ts +2 -0
- package/dist/components/Contractor/NewHireReport/NewHireReport.d.ts +1 -0
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +7 -7
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +22 -10
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +4 -4
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.d.ts +23 -0
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +36 -0
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -0
- package/dist/components/Contractor/OnboardingSummary/index.d.ts +2 -0
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +6 -6
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +105 -108
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.module.scss.js +8 -0
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.module.scss.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/index.d.ts +2 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.d.ts +93 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +22 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/index.d.ts +5 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +127 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +109 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.d.ts +83 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.js +42 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.d.ts +58 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js +21 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.d.ts +20 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.js +9 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/index.d.ts +5 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +117 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js +91 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/types.d.ts +0 -5
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +11 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +59 -53
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +70 -91
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +62 -56
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +13 -4
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +7 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +54 -51
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +20 -22
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +109 -102
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +86 -65
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.d.ts +8 -0
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +79 -0
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +52 -10
- package/dist/components/Contractor/Profile/ContractorProfile.js +205 -31
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.module.scss.js +8 -0
- package/dist/components/Contractor/Profile/ContractorProfile.module.scss.js.map +1 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.d.ts +8 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +96 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.d.ts +22 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +40 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/index.d.ts +1 -1
- package/dist/components/Contractor/Profile/shared/index.d.ts +2 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +126 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +73 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.test.d.ts +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +312 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +87 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js.map +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/index.d.ts +6 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +196 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +188 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -0
- package/dist/components/Contractor/Submit/Submit.d.ts +4 -4
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +6 -3
- package/dist/components/Contractor/exports/contractorOnboarding.js +14 -8
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +4 -7
- package/dist/components/Employee/Compensation/management/Compensation.js +1 -5
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +13 -10
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js +23 -31
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +3 -3
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +20 -28
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +13 -10
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +29 -4
- package/dist/components/Employee/Dashboard/Dashboard.js +1 -4
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +20 -14
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +78 -108
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +4 -7
- package/dist/components/Employee/Deductions/management/Deductions.js +1 -5
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +1 -0
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +4 -3
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +1 -4
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js +17 -23
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -0
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js +25 -35
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +40 -37
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +19 -4
- package/dist/components/Employee/Documents/management/DocumentManager.js +4 -1
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.d.ts +4 -7
- package/dist/components/Employee/Documents/management/Documents.js +1 -5
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/documentsStateMachine.js +5 -7
- package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +2 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +8 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +3 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +1 -4
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +3 -2
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +5 -8
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +18 -3
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +21 -18
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +2 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +47 -46
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +10 -4
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +5 -7
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +4 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +1 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +4 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +1 -4
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js +14 -20
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +4 -3
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +1 -4
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +7 -11
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +1 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +7 -9
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js +1 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +2 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js +8 -12
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +10 -4
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +20 -6
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +34 -14
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +19 -17
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +23 -16
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +11 -15
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +10 -4
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +3 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +1 -5
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +15 -21
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +4 -7
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +1 -5
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +24 -36
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +7 -6
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.d.ts +5 -8
- package/dist/components/Employee/Profile/management/Profile.js +1 -5
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +1 -0
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +5 -6
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +1 -4
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/profileStateMachine.js +14 -20
- package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +55 -54
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.module.scss.js +3 -5
- package/dist/components/Employee/Profile/onboarding/AdminProfile.module.scss.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.d.ts +11 -12
- package/dist/components/Employee/Profile/onboarding/Profile.js +1 -5
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +3 -2
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +11 -12
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +2 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +36 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +31 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +20 -6
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +12 -18
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +4 -9
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +1 -5
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +1 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +1 -4
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js +14 -20
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +1 -4
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +29 -29
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +37 -19
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +113 -13
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/index.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +2 -7
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +16 -5
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +5 -7
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +7 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +1 -5
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +1 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +7 -9
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js +1 -4
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +97 -95
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js +8 -12
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +1 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +27 -2
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/informationRequestsStateMachine.js +10 -14
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +3 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +2 -11
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +11 -17
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +1 -3
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +25 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +18 -4
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +21 -20
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +28 -3
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -46
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +25 -24
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +13 -3
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +2 -2
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +34 -44
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +1 -0
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +12 -2
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +8 -10
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +112 -112
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +4 -6
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +2 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +5 -9
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +10 -14
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +27 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +2 -2
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +2 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +2 -2
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +2 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +1 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +28 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +128 -174
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +9 -7
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +2 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +2 -1
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +2 -2
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +2 -2
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/contexts/ThemeProvider/types.d.ts +19 -0
- package/dist/helpers/validations.d.ts +12 -0
- package/dist/helpers/validations.js +6 -4
- package/dist/helpers/validations.js.map +1 -1
- package/dist/i18n/I18n.js +5 -2
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.AssignSignatory.json.js +1 -1
- package/dist/i18n/en/Company.FederalTaxes.json.js +27 -23
- package/dist/i18n/en/Company.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +1 -1
- package/dist/i18n/en/Contractor.Address.json.js +13 -13
- package/dist/i18n/en/Contractor.DocumentsList.json.js +28 -0
- package/dist/i18n/en/Contractor.DocumentsList.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Landing.json.js +18 -0
- package/dist/i18n/en/Contractor.Landing.json.js.map +1 -0
- package/dist/i18n/en/Contractor.NewHireReport.json.js +12 -10
- package/dist/i18n/en/Contractor.NewHireReport.json.js.map +1 -1
- package/dist/i18n/en/Contractor.OnboardingSummary.json.js +12 -0
- package/dist/i18n/en/Contractor.OnboardingSummary.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +13 -13
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +10 -6
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +8 -6
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
- package/dist/i18n/en/Employee.Compensation.json.js +56 -50
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.DeductionsForm.json.js +8 -8
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js +1 -1
- package/dist/i18n/en/Employee.Management.Compensation.json.js +48 -42
- package/dist/i18n/en/Employee.Management.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Management.HomeAddress.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +40 -38
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +34 -32
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +23 -3
- package/dist/index.js +250 -206
- package/dist/index.js.map +1 -1
- package/dist/models/external.d.ts +299 -0
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js +3 -3
- package/dist/partner-hook-utils/form/buildFormSchema.d.ts +14 -1
- package/dist/partner-hook-utils/form/buildFormSchema.js +41 -40
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +5 -2
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +10 -1
- package/dist/shared/constants.js +9 -5
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +19 -2
- package/dist/types/i18next.d.ts +66 -5
- package/dist/types/sdkError.js +13 -6
- package/dist/types/sdkError.js.map +1 -1
- package/docs/{reference → guides}/endpoint-inventory.json +27 -0
- package/package.json +21 -22
- package/dist/components/Contractor/Address/Actions.d.ts +0 -2
- package/dist/components/Contractor/Address/Actions.js +0 -13
- package/dist/components/Contractor/Address/Actions.js.map +0 -1
- package/dist/components/Contractor/Address/Form.d.ts +0 -2
- package/dist/components/Contractor/Address/Form.js +0 -51
- package/dist/components/Contractor/Address/Form.js.map +0 -1
- package/dist/components/Contractor/Address/Head.d.ts +0 -2
- package/dist/components/Contractor/Address/Head.js +0 -17
- package/dist/components/Contractor/Address/Head.js.map +0 -1
- package/dist/components/Contractor/Address/useAddress.d.ts +0 -28
- package/dist/components/Contractor/Address/useAddress.js +0 -31
- package/dist/components/Contractor/Address/useAddress.js.map +0 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.d.ts +0 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +0 -56
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +0 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +0 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +0 -33
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +0 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +0 -9
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +0 -143
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +0 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +0 -205
- package/dist/components/Contractor/Profile/useContractorProfile.js +0 -237
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +0 -1
package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link EditCompensation}.\n *\n * @public\n */\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire date field is hidden.\n * When absent, the hire date field is rendered so it can be set explicitly.\n */\n startDate?: string\n /** Existing job to edit. When omitted, a new job is created on submit. */\n currentJobId?: string | null\n /** Heading text shown above the form. */\n title: string\n /** Label for the primary submit button. */\n submitCtaLabel: string\n /** Optional handler invoked when the secondary cancel button is clicked. */\n onCancel?: () => void\n /** Initial values for the job title and compensation fields. */\n partnerDefaultValues?: CompensationDefaultValues\n /** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders a form for creating or editing one of an employee's jobs together with its compensation.\n *\n * @remarks\n * The submit chain saves the job first, then the compensation. The `employee/job_created` or\n * `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`\n * fires once the compensation is saved and signals the full save is complete.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the \"save complete\" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |\n *\n * @param props - See {@link EditCompensationProps}.\n * @returns The rendered edit-compensation form.\n * @public\n */\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AA4DO,SAASA,EAAiB,EAAE,YAAAC,GAAY,GAAGC,KAAgC;AAChF,SAAAC,EAAuB,yBAAyBF,CAAU,GAExD,gBAAAG,EAACC,KAAe,eAAc,yBAC5B,4BAACC,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASI,EAAK;AAAA,EACZ,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;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UC,KAAa;AAAA,IAAA,CACxB;AACD,QAAI,CAACuB,EAAW;AAEhB,IAAAhB;AAAA,MACEgB,EAAU,SAAS,WACfC,EAAgB,uBAChBA,EAAgB;AAAA,MACpBD,EAAU;AAAA,IAAA;AAMZ,UAAME,IAAmBF,EAAU,KAAK,eAAe;AAAA,MACrD,CAAAG,MAAKA,EAAE,SAASH,EAAU,KAAK;AAAA,IAAA,GAG3BI,IAAqB,MAAMX,EAAiB,QAAQ,SAAS;AAAA,MACjE,OAAOO,EAAU,KAAK;AAAA,MACtB,gBAAgBA,EAAU,KAAK,2BAA2B;AAAA,MAC1D,qBAAqBE,GAAkB,WAAW;AAAA,IAAA,CACnD;AACD,QAAI,CAACE,GAAoB;AACvB,MAAK1B,KAAcU,EAAiBY,EAAU,KAAK,IAAI;AACvD;AAAA,IACF;AAEA,IAAAhB,EAAQiB,EAAgB,+BAA+BG,EAAmB,IAAI;AAAA,EAChF,CAAC,GAEKC,IAAgBT,EAAoB,CAACE,CAAY,CAAC,GAElDQ,IAAYhB,EAAQ,OAAO,aAAaG,EAAiB,OAAO;AAEtE,2BACG,WAAA,EAAQ,WAAWc,EAAWC,EAAO,WAAWzB,CAAS,GACxD,UAAA,gBAAAV,EAACwB,GAAA,EAAW,OAAOQ,EAAc,QAC/B,4BAACI,GAAA,EAAK,UAAUX,EAAa,cAC3B,UAAA,gBAAAzB;AAAA,IAACqC;AAAA,IAAA;AAAA,MACC,SAAApB;AAAA,MACA,kBAAAG;AAAA,MACA,OAAAd;AAAA,MACA,gBAAAC;AAAA,MACA,WAAA0B;AAAA,MACA,UAAAzB;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link EditCompensation}.\n *\n * @public\n */\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire date field is hidden.\n * When absent, the hire date field is rendered so it can be set explicitly.\n */\n startDate?: string\n /** Existing job to edit. When omitted, a new job is created on submit. */\n currentJobId?: string | null\n /** Heading text shown above the form. */\n title: string\n /** Label for the primary submit button. */\n submitCtaLabel: string\n /** Optional handler invoked when the secondary cancel button is clicked. */\n onCancel?: () => void\n /** Initial values for the job title and compensation fields. */\n partnerDefaultValues?: CompensationDefaultValues\n /** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders a form for creating or editing one of an employee's jobs together with its compensation.\n *\n * @remarks\n * The submit chain saves the job first, then the compensation. The `employee/job_created` or\n * `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`\n * fires once the compensation is saved and signals the full save is complete.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the \"save complete\" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |\n *\n * @param props - See {@link EditCompensationProps}.\n * @returns The rendered edit-compensation form.\n * @public\n */\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AA6DO,SAASA,EAAiB,EAAE,YAAAC,GAAY,GAAGC,KAAgC;AAChF,SAAAC,EAAuB,yBAAyBF,CAAU,GAExD,gBAAAG,EAACC,KAAe,eAAc,yBAC5B,4BAACC,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASI,EAAK;AAAA,EACZ,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAA0B;AACxB,EAAAC,EAAQ,uBAAuB;AAK/B,QAAMC,IAAoB,CAACT,GAMrB,CAACU,GAAeC,CAAgB,IAAIC,EAA6BX,KAAgB,MAAS,GAE1FY,IAAUC,EAAW;AAAA,IACzB,YAAAf;AAAA,IACA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MAAKA,EAAE,SAASH,EAAU,KAAK;AAAA,IAAA,GAG3BI,IAAqB,MAAMX,EAAiB,QAAQ,SAAS;AAAA,MACjE,OAAOO,EAAU,KAAK;AAAA,MACtB,gBAAgBA,EAAU,KAAK,2BAA2B;AAAA,MAC1D,qBAAqBE,GAAkB,WAAW;AAAA,IAAA,CACnD;AACD,QAAI,CAACE,GAAoB;AACvB,MAAK1B,KAAcU,EAAiBY,EAAU,KAAK,IAAI;AACvD;AAAA,IACF;AAEA,IAAAhB,EAAQiB,EAAgB,+BAA+BG,EAAmB,IAAI;AAAA,EAChF,CAAC,GAEKC,IAAgBT,EAAoB,CAACE,CAAY,CAAC,GAElDQ,IAAYhB,EAAQ,OAAO,aAAaG,EAAiB,OAAO;AAEtE,2BACG,WAAA,EAAQ,WAAWc,EAAWC,EAAO,WAAWzB,CAAS,GACxD,UAAA,gBAAAV,EAACwB,GAAA,EAAW,OAAOQ,EAAc,QAC/B,4BAACI,GAAA,EAAK,UAAUX,EAAa,cAC3B,UAAA,gBAAAzB;AAAA,IAACqC;AAAA,IAAA;AAAA,MACC,SAAApB;AAAA,MACA,kBAAAG;AAAA,MACA,OAAAd;AAAA,MACA,gBAAAC;AAAA,MACA,WAAA0B;AAAA,MACA,UAAAzB;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseComponentInterface
|
|
1
|
+
import { BaseComponentInterface } from '../../../../Base';
|
|
2
2
|
/** @public */
|
|
3
|
-
export interface JobsListProps extends
|
|
3
|
+
export interface JobsListProps extends BaseComponentInterface<'Employee.Compensation'> {
|
|
4
4
|
/** The associated employee identifier. */
|
|
5
5
|
employeeId: string;
|
|
6
6
|
}
|
|
7
7
|
/** @public */
|
|
8
|
-
export declare function JobsList(props: JobsListProps
|
|
8
|
+
export declare function JobsList(props: JobsListProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsList.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsDeleteMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDelete'\nimport { derivePrimaryFlsaStatus } from '../../shared/derivePrimaryFlsaStatus'\nimport { JobsListPresentation } from './JobsListPresentation'\nimport {
|
|
1
|
+
{"version":3,"file":"JobsList.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsDeleteMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDelete'\nimport { derivePrimaryFlsaStatus } from '../../shared/derivePrimaryFlsaStatus'\nimport { JobsListPresentation } from './JobsListPresentation'\nimport { BaseComponent, type BaseComponentInterface, useBase } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/** @public */\nexport interface JobsListProps extends BaseComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/** @public */\nexport function JobsList(props: JobsListProps) {\n useComponentDictionary('Employee.Compensation', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className }: JobsListProps) {\n useI18n('Employee.Compensation')\n const { onEvent } = useBase()\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n const employeeJobs = useMemo(() => jobsData.jobs ?? [], [jobsData.jobs])\n\n const { mutateAsync: deleteEmployeeJob, isPending: isDeleting } =\n useJobsAndCompensationsDeleteMutation()\n\n const primaryFlsaStatus = useMemo(() => derivePrimaryFlsaStatus(employeeJobs), [employeeJobs])\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_JOB_ADD)\n }\n\n const handleEdit = (jobId: string) => {\n onEvent(componentEvents.EMPLOYEE_JOB_EDIT, { uuid: jobId })\n }\n\n const handleDelete = async (jobId: string) => {\n await deleteEmployeeJob({ request: { jobId } })\n onEvent(componentEvents.EMPLOYEE_JOB_DELETED)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n }\n\n return (\n <section className={className}>\n <JobsListPresentation\n jobs={employeeJobs}\n primaryFlsaStatus={primaryFlsaStatus}\n isPending={isDeleting}\n onAdd={handleAdd}\n onEdit={handleEdit}\n onDelete={(jobId: string) => {\n void handleDelete(jobId)\n }}\n onContinue={handleContinue}\n />\n </section>\n )\n}\n"],"names":["JobsList","props","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","useI18n","onEvent","useBase","jobsData","useJobsAndCompensationsGetJobsSuspense","employeeJobs","useMemo","deleteEmployeeJob","isDeleting","useJobsAndCompensationsDeleteMutation","primaryFlsaStatus","derivePrimaryFlsaStatus","handleAdd","componentEvents","handleEdit","jobId","handleDelete","JobsListPresentation"],"mappings":";;;;;;;;;;AAgBO,SAASA,EAASC,GAAsB;AAC7C,SAAAC,EAAuB,yBAAyBD,EAAM,UAAU,GAE9D,gBAAAE,EAACC,KAAe,GAAGH,GACjB,4BAACI,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASI,EAAK,EAAE,YAAAC,GAAY,WAAAC,KAA4B;AACtD,EAAAC,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAMC,EAAA,IAAaC,EAAuC,EAAE,YAAAN,GAAY,GAC1EO,IAAeC,EAAQ,MAAMH,EAAS,QAAQ,IAAI,CAACA,EAAS,IAAI,CAAC,GAEjE,EAAE,aAA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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
)
|
|
21
|
+
E((o) => ({
|
|
22
|
+
...o,
|
|
23
|
+
component: i,
|
|
24
|
+
currentJobId: null
|
|
25
|
+
}))
|
|
30
26
|
),
|
|
31
27
|
n(
|
|
32
28
|
t.EMPLOYEE_JOB_EDIT,
|
|
@@ -45,24 +41,20 @@ const c = {
|
|
|
45
41
|
n(
|
|
46
42
|
t.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,
|
|
47
43
|
"viewJobs",
|
|
48
|
-
E(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
)
|
|
44
|
+
E((o) => ({
|
|
45
|
+
...o,
|
|
46
|
+
component: O,
|
|
47
|
+
currentJobId: null
|
|
48
|
+
}))
|
|
55
49
|
),
|
|
56
50
|
n(
|
|
57
51
|
t.EMPLOYEE_COMPENSATION_CANCEL,
|
|
58
52
|
"viewJobs",
|
|
59
|
-
E(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
65
|
-
)
|
|
53
|
+
E((o) => ({
|
|
54
|
+
...o,
|
|
55
|
+
component: O,
|
|
56
|
+
currentJobId: null
|
|
57
|
+
}))
|
|
66
58
|
)
|
|
67
59
|
),
|
|
68
60
|
done: e()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport const compensationStateMachine = {\n initialEditJob: state<MachineTransition>(\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce(
|
|
1
|
+
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport const compensationStateMachine = {\n initialEditJob: state<MachineTransition>(\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n ),\n viewJobs: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_JOB_ADD,\n 'editJob',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_JOB_EDIT,\n 'editJob',\n reduce(\n (\n ctx: CompensationFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_JOB_EDIT>,\n ): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: ev.payload.uuid,\n }),\n ),\n ),\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n ),\n editJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_CANCEL,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n ),\n done: final(),\n}\n"],"names":["compensationStateMachine","state","transition","componentEvents","reduce","ctx","JobsListContextual","EditCompensationContextual","ev","final"],"mappings":";;;AAWO,MAAMA,IAA2B;AAAA,EACtC,gBAAgBC;AAAA,IACdC,EAAWC,EAAgB,4BAA4B,MAAM;AAAA,IAC7DD;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,UAAUL;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWE;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACsC;AAAA,UACtC,GAAGH;AAAA,UACH,WAAWE;AAAA,UACX,cAAcC,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC3B;AAAA,IACF;AAAA,IAEFN,EAAWC,EAAgB,4BAA4B,MAAM;AAAA,EAAA;AAAA,EAE/D,SAASF;AAAA,IACPC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,MAAMG,EAAA;AACR;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as r, jsx as t, Fragment as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as r, jsx as t, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as R, Trans as d } from "react-i18next";
|
|
3
3
|
import { Flex as c } from "../../../Common/Flex/Flex.js";
|
|
4
4
|
import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
5
|
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -10,16 +10,16 @@ import { useI18n as D, useComponentDictionary as M } from "../../../../i18n/I18n
|
|
|
10
10
|
function U({
|
|
11
11
|
jobForm: n,
|
|
12
12
|
compensationForm: i,
|
|
13
|
-
title:
|
|
14
|
-
submitCtaLabel:
|
|
13
|
+
title: g,
|
|
14
|
+
submitCtaLabel: h,
|
|
15
15
|
isPending: u,
|
|
16
16
|
onCancel: f,
|
|
17
|
-
dictionary:
|
|
17
|
+
dictionary: b
|
|
18
18
|
}) {
|
|
19
|
-
D("Employee.Compensation"), M("Employee.Compensation",
|
|
20
|
-
const { t: e } =
|
|
19
|
+
D("Employee.Compensation"), M("Employee.Compensation", b);
|
|
20
|
+
const { t: e } = R("Employee.Compensation"), s = C(), m = y("currency"), o = n.form.Fields, a = i.form.Fields;
|
|
21
21
|
return /* @__PURE__ */ r(c, { flexDirection: "column", gap: 32, children: [
|
|
22
|
-
/* @__PURE__ */ t(s.Heading, { as: "h2", children:
|
|
22
|
+
/* @__PURE__ */ t(s.Heading, { as: "h2", children: g }),
|
|
23
23
|
/* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: [
|
|
24
24
|
o.Title && /* @__PURE__ */ t(
|
|
25
25
|
o.Title,
|
|
@@ -37,11 +37,12 @@ function U({
|
|
|
37
37
|
formHookResult: n
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
a.FlsaStatus && /* @__PURE__ */ r(
|
|
40
|
+
a.FlsaStatus && /* @__PURE__ */ r(E, { children: [
|
|
41
41
|
/* @__PURE__ */ t(
|
|
42
42
|
a.FlsaStatus,
|
|
43
43
|
{
|
|
44
44
|
label: e("employeeClassification"),
|
|
45
|
+
placeholder: e("flsaStatusPlaceholder"),
|
|
45
46
|
description: /* @__PURE__ */ t(
|
|
46
47
|
d,
|
|
47
48
|
{
|
|
@@ -130,6 +131,7 @@ function U({
|
|
|
130
131
|
a.PaymentUnit,
|
|
131
132
|
{
|
|
132
133
|
label: e("wageFrequencyLabel"),
|
|
134
|
+
placeholder: e("paymentUnitPlaceholder"),
|
|
133
135
|
description: e("paymentUnitDescription"),
|
|
134
136
|
validationMessages: { REQUIRED: e("validations.paymentUnit") },
|
|
135
137
|
getOptionLabel: (l) => e(`paymentUnitOptions.${l}`),
|
|
@@ -148,6 +150,7 @@ function U({
|
|
|
148
150
|
a.MinimumWageId,
|
|
149
151
|
{
|
|
150
152
|
label: e("minimumWageLabel"),
|
|
153
|
+
placeholder: e("minimumWagePlaceholder"),
|
|
151
154
|
description: e("minimumWageDescription"),
|
|
152
155
|
validationMessages: { REQUIRED: e("validations.minimumWage") },
|
|
153
156
|
getOptionLabel: (l) => `${m(Number(l.wage))} - ${l.authority}: ${l.notes ?? ""}`,
|
|
@@ -211,7 +214,7 @@ function U({
|
|
|
211
214
|
] }),
|
|
212
215
|
/* @__PURE__ */ r(v, { children: [
|
|
213
216
|
f && /* @__PURE__ */ t(s.Button, { variant: "secondary", onClick: f, isDisabled: u, children: e("cancelNewJobCta") }),
|
|
214
|
-
/* @__PURE__ */ t(s.Button, { type: "submit", isLoading: u, children:
|
|
217
|
+
/* @__PURE__ */ t(s.Button, { type: "submit", isLoading: u, children: h })
|
|
215
218
|
] })
|
|
216
219
|
] });
|
|
217
220
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYf,EAAQ,KAAK,QACzBgB,IAAaf,EAAiB,KAAK;AAEzC,SACE,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAT,GAAM;AAAA,IAEnC,gBAAAe,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,MAAAH,EAAU,SACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,UAAU;AAAA,UACnB,oBAAoB,EAAE,UAAUA,EAAE,mBAAmB,EAAA;AAAA,UACrD,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,MAInBe,EAAU,YACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,UAAU;AAAA,UACnB,oBAAoB,EAAE,UAAUA,EAAE,sBAAsB,EAAA;AAAA,UACxD,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,MAInBgB,EAAW,cACV,gBAAAC,EAAAG,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAD;AAAA,UAACH,EAAW;AAAA,UAAX;AAAA,YACC,OAAOP,EAAE,wBAAwB;AA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BAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,uBAAuB;AAAA,UAChC,aAAaA,EAAE,6BAA6B;AAAA,UAC5C,aAAaA,EAAE,uBAAuB;AAAA,UACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,UAChE,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GAEJ;AAAA,sBAEC2B,GAAA,EACE,UAAA;AAAA,MAAAtB,KACC,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYf,EAAQ,KAAK,QACzBgB,IAAaf,EAAiB,KAAK;AAEzC,SACE,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,I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AX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n/**\n * Validation error codes produced by the {@link useCompensationForm} schema.\n *\n * @remarks\n * Use these constants as the keys in a field's `validationMessages` prop to\n * map an error code to a user-facing message.\n *\n * | Code | When it triggers |\n * | ---- | ---------------- |\n * | `REQUIRED` | A required field is empty (per mode and `optionalFieldsToRequire`). |\n * | `RATE_MINIMUM` | `rate` is less than `$1.00` for non-commission FLSA statuses. |\n * | `RATE_EXEMPT_THRESHOLD` | FLSA `Exempt` employees must clear the federal salary threshold (annualized). |\n * | `PAYMENT_UNIT_OWNER` | `Owner` FLSA status requires `paymentUnit === 'Paycheck'`. |\n * | `PAYMENT_UNIT_COMMISSION` | Commission-only FLSA statuses require `paymentUnit === 'Year'`. |\n * | `RATE_COMMISSION_ZERO` | Commission-only FLSA statuses require `rate === 0`. |\n * | `EFFECTIVE_DATE_BEFORE_HIRE` | `effectiveDate` precedes the parent job's `hireDate`. |\n * | `EFFECTIVE_DATE_BEFORE_MIN` | `effectiveDate` precedes the caller-supplied minimum (typically tomorrow). |\n *\n * @public\n *\n * @example\n * ```tsx\n * import { CompensationErrorCodes } from '@gusto/embedded-react-sdk'\n *\n * <Fields.Rate\n * label=\"Compensation amount\"\n * validationMessages={{\n * [CompensationErrorCodes.REQUIRED]: 'Amount is required',\n * [CompensationErrorCodes.RATE_MINIMUM]: 'Amount must be at least $1.00',\n * [CompensationErrorCodes.RATE_EXEMPT_THRESHOLD]: 'Exempt employees must meet the salary threshold',\n * }}\n * />\n * ```\n */\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n EFFECTIVE_DATE_BEFORE_MIN: 'EFFECTIVE_DATE_BEFORE_MIN',\n} as const\n\n/**\n * Union of every error code produced by the {@link useCompensationForm} schema.\n *\n * @public\n */\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\n/**\n * Shape of the form values managed by {@link useCompensationForm}.\n *\n * @remarks\n * Accepted as `defaultValues` on `useCompensationForm` and returned by\n * `form.getFormSubmissionValues()` once the form has validated. `effectiveDate`\n * is an ISO date string (`YYYY-MM-DD`) or `null`; `flsaStatus` is optional so\n * the field can render an empty placeholder when nothing is preselected\n * (requiredness is enforced on submit per mode).\n *\n * @public\n */\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\n/**\n * Override which fields are required on a given submission mode of {@link useCompensationForm}.\n *\n * @remarks\n * Each mode key lists the fields that are optional by default for that mode\n * but should be promoted to required. `adjustForMinimumWage` is always\n * required and `minimumWageId` is automatically required when\n * `adjustForMinimumWage` is `true` — neither is configurable here.\n *\n * | Field | Required on create | Required on update | Configurable? |\n * | ----- | ------------------ | ------------------ | ------------- |\n * | `flsaStatus` | Yes | No | Yes (on update) |\n * | `paymentUnit` | Yes | No | Yes (on update) |\n * | `rate` | Yes | No | Yes (on update) |\n * | `effectiveDate` | Yes | No | Yes (on update) |\n * | `title` | No | No | Yes (either mode) |\n * | `adjustForMinimumWage` | Yes | Yes | No |\n * | `minimumWageId` | When toggle is on | When toggle is on | No |\n *\n * @public\n *\n * @example\n * ```tsx\n * const compensation = useCompensationForm({\n * employeeId,\n * jobId,\n * compensationId,\n * optionalFieldsToRequire: {\n * update: ['title', 'rate'],\n * },\n * })\n * ```\n */\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/**\n * Validated submission shape produced by the {@link useCompensationForm} schema.\n *\n * @remarks\n * Identical to {@link CompensationFormData} — exposed as a separate alias so\n * the input vs. output sides of the schema remain distinguishable in advanced\n * usages.\n *\n * @public\n */\nexport type CompensationFormOutputs = CompensationFormData\n\n/** @internal */\nexport interface CompensationSchemaOptions {\n /** Selects required-field rules: `'create'` (POST) or `'update'` (PUT). Defaults to `'create'`. */\n mode?: 'create' | 'update'\n /** Promote default-optional fields to required for the selected mode. See {@link CompensationOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n /**\n * Absolute lower bound for `effectiveDate`, enforced in both create and\n * update modes whenever provided. Typically `addDays(today, 1)` (tomorrow)\n * for management screens where effective dates must be in the future, or\n * `max(tomorrow, hireDate)` for secondary new jobs. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_MIN` issue when violated.\n *\n * **Callers must only pass this when the carve-out cannot fire.** The\n * carve-out (`willDeleteSecondaryJobs` in update mode) forces `effectiveDate`\n * to today on a disabled field — passing `minEffectiveDate` for a primary\n * job in update mode would cause a spurious validation failure on submit.\n * Secondary jobs are safe because their FLSA field is hidden, preventing the\n * carve-out from activating.\n */\n minEffectiveDate?: string | null\n /**\n * When `false`, drops `effectiveDate` from the validated shape — the field\n * becomes hook-managed (e.g. seeded from the parent job's `hireDate` during\n * onboarding). Partners may still supply the value at submit time via\n * `CompensationSubmitOptions.effectiveDate`. Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\n/** @internal */\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const {\n mode = 'create',\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate,\n withEffectiveDateField = true,\n } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withEffectiveDateField ? [] : ['effectiveDate'],\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Enforce the hire-date lower bound in create mode always, and in\n // update mode when `minEffectiveDate` is also set (management screens\n // where the user is actively picking a new date). On plain update\n // without `minEffectiveDate`, the loaded effectiveDate can legitimately\n // predate the hire date (stub or out-of-order data) and the API\n // accepts the unchanged value — blocking the submit would trap\n // partners whose flow doesn't render Fields.EffectiveDate.\n // When `withEffectiveDateField` is false the field is excluded from\n // the shape and `data.effectiveDate` is undefined — this check\n // naturally short-circuits.\n if (\n hireDate &&\n data.effectiveDate &&\n data.effectiveDate < hireDate &&\n (mode === 'create' || minEffectiveDate)\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n // Enforce the caller-supplied minimum effective date in both modes.\n // Callers must only pass this when the carve-out cannot fire (see\n // CompensationSchemaOptions.minEffectiveDate for details).\n if (minEffectiveDate && data.effectiveDate && data.effectiveDate < minEffectiveDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_MIN,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","minEffectiveDate","withEffectiveDateField","buildFormSchema"],"mappings":";;;;;AA4CO,MAAMA,IAAyB;AAAA,EACpC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,2BAA2B;AAC7B,GAUMC,IAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStB,OAAOC,EAAE,OAAA;AAAA;AAAA;AAAA;AAAA,EAIT,YAAYA,EACT,KAAK;AAAA,IACJC,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,EAAA,CACZ,EACA,SAAA;AAAA,EACH,aAAaD,EAAE,KAAK;AAAA,IAClBE,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,EAAA,CACb;AAAA,EACD,MAAMF,EAAE,WAAWG,EAAU,CAAC,GAAGH,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa3C,eAAeA,EAAE,WAAWI,GAAiBJ,EAAE,IAAI,OAAO,UAAU;AAAA,EACpE,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA;AACnB,GAkBMK,IAAuB;AAAA,EAC3B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,MAAM;AAAA,EACN,eAAe;AAAA,E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P,yBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,wBAAAC,IAAyB;AAAA,EAAA,IACvBL;AAEJ,SAAOM,EAAgBtB,GAAiB;AAAA,IACtC,sBAAAM;AAAA,IACA,mBAAmBP,EAAuB;AAAA,IAC1C,MAAAkB;AAAA,IACA,yBAAAC;AAAA,IACA,eAAeG,IAAyB,KAAK,CAAC,eAAe;AAAA,IAC7D,aAAa,CAACd,GAAME,MAAQ;AAC1B,MAAAD,EAAkBD,GAAME,CAAG,GAYzBU,KACAZ,EAAK,iBACLA,EAAK,gBAAgBY,MACpBF,MAAS,YAAYG,MAEtBX,EAAI,SAAS;AAAA,QACX,MAAMR,EAAE,aAAa;AAAA,QACrB,MAAM,CAAC,eAAe;AAAA,QACtB,SAASF,EAAuB;AAAA,MAAA,CACjC,GAKCqB,KAAoBb,EAAK,iBAAiBA,EAAK,gBAAgBa,KACjEX,EAAI,SAAS;AAAA,QACX,MAAMR,EAAE,aAAa;AAAA,QACrB,MAAM,CAAC,eAAe;AAAA,QACtB,SAASF,EAAuB;AAAA,MAAA,CACjC;AAAA,IAEL;AAAA,EAAA,CACD;AACH;"}
|
|
1
|
+
{"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n/**\n * Validation error codes produced by the {@link useCompensationForm} schema.\n *\n * @remarks\n * Use these constants as the keys in a field's `validationMessages` prop to\n * map an error code to a user-facing message.\n *\n * | Code | When it triggers |\n * | ---- | ---------------- |\n * | `REQUIRED` | A required field is empty (per mode and `optionalFieldsToRequire`). |\n * | `RATE_MINIMUM` | `rate` is less than `$1.00` for non-commission FLSA statuses. |\n * | `RATE_EXEMPT_THRESHOLD` | FLSA `Exempt` employees must clear the federal salary threshold (annualized). |\n * | `PAYMENT_UNIT_OWNER` | `Owner` FLSA status requires `paymentUnit === 'Paycheck'`. |\n * | `PAYMENT_UNIT_COMMISSION` | Commission-only FLSA statuses require `paymentUnit === 'Year'`. |\n * | `RATE_COMMISSION_ZERO` | Commission-only FLSA statuses require `rate === 0`. |\n * | `EFFECTIVE_DATE_BEFORE_HIRE` | `effectiveDate` precedes the parent job's `hireDate`. |\n * | `EFFECTIVE_DATE_BEFORE_MIN` | `effectiveDate` precedes the caller-supplied minimum (typically tomorrow). |\n *\n * @public\n *\n * @example\n * ```tsx\n * import { CompensationErrorCodes } from '@gusto/embedded-react-sdk'\n *\n * <Fields.Rate\n * label=\"Compensation amount\"\n * validationMessages={{\n * [CompensationErrorCodes.REQUIRED]: 'Amount is required',\n * [CompensationErrorCodes.RATE_MINIMUM]: 'Amount must be at least $1.00',\n * [CompensationErrorCodes.RATE_EXEMPT_THRESHOLD]: 'Exempt employees must meet the salary threshold',\n * }}\n * />\n * ```\n */\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n EFFECTIVE_DATE_BEFORE_MIN: 'EFFECTIVE_DATE_BEFORE_MIN',\n} as const\n\n/**\n * Union of every error code produced by the {@link useCompensationForm} schema.\n *\n * @public\n */\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\n/**\n * Shape of the form values managed by {@link useCompensationForm}.\n *\n * @remarks\n * Accepted as `defaultValues` on `useCompensationForm` and returned by\n * `form.getFormSubmissionValues()` once the form has validated. `effectiveDate`\n * is an ISO date string (`YYYY-MM-DD`) or `null`; `flsaStatus` is optional so\n * the field can render an empty placeholder when nothing is preselected\n * (requiredness is enforced on submit per mode).\n *\n * @public\n * @interface\n */\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\n/**\n * Override which fields are required on a given submission mode of {@link useCompensationForm}.\n *\n * @remarks\n * Each mode key lists the fields that are optional by default for that mode\n * but should be promoted to required. `adjustForMinimumWage` is always\n * required and `minimumWageId` is automatically required when\n * `adjustForMinimumWage` is `true` — neither is configurable here.\n *\n * | Field | Required on create | Required on update | Configurable? |\n * | ----- | ------------------ | ------------------ | ------------- |\n * | `flsaStatus` | Yes | No | Yes (on update) |\n * | `paymentUnit` | Yes | No | Yes (on update) |\n * | `rate` | Yes | No | Yes (on update) |\n * | `effectiveDate` | Yes | No | Yes (on update) |\n * | `title` | No | No | Yes (either mode) |\n * | `adjustForMinimumWage` | Yes | Yes | No |\n * | `minimumWageId` | When toggle is on | When toggle is on | No |\n *\n * @public\n *\n * @example\n * ```tsx\n * const compensation = useCompensationForm({\n * employeeId,\n * jobId,\n * compensationId,\n * optionalFieldsToRequire: {\n * update: ['title', 'rate'],\n * },\n * })\n * ```\n */\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/**\n * Validated submission shape produced by the {@link useCompensationForm} schema.\n *\n * @remarks\n * Identical to {@link CompensationFormData} — exposed as a separate alias so\n * the input vs. output sides of the schema remain distinguishable in advanced\n * usages.\n *\n * @public\n */\nexport type CompensationFormOutputs = CompensationFormData\n\n/** @internal */\nexport interface CompensationSchemaOptions {\n /** Selects required-field rules: `'create'` (POST) or `'update'` (PUT). Defaults to `'create'`. */\n mode?: 'create' | 'update'\n /** Promote default-optional fields to required for the selected mode. See {@link CompensationOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n /**\n * Absolute lower bound for `effectiveDate`, enforced in both create and\n * update modes whenever provided. Typically `addDays(today, 1)` (tomorrow)\n * for management screens where effective dates must be in the future, or\n * `max(tomorrow, hireDate)` for secondary new jobs. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_MIN` issue when violated.\n *\n * **Callers must only pass this when the carve-out cannot fire.** The\n * carve-out (`willDeleteSecondaryJobs` in update mode) forces `effectiveDate`\n * to today on a disabled field — passing `minEffectiveDate` for a primary\n * job in update mode would cause a spurious validation failure on submit.\n * Secondary jobs are safe because their FLSA field is hidden, preventing the\n * carve-out from activating.\n */\n minEffectiveDate?: string | null\n /**\n * When `false`, drops `effectiveDate` from the validated shape — the field\n * becomes hook-managed (e.g. seeded from the parent job's `hireDate` during\n * onboarding). Partners may still supply the value at submit time via\n * `CompensationSubmitOptions.effectiveDate`. Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\n/** @internal */\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const {\n mode = 'create',\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate,\n withEffectiveDateField = true,\n } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withEffectiveDateField ? [] : ['effectiveDate'],\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Enforce the hire-date lower bound in create mode always, and in\n // update mode when `minEffectiveDate` is also set (management screens\n // where the user is actively picking a new date). On plain update\n // without `minEffectiveDate`, the loaded effectiveDate can legitimately\n // predate the hire date (stub or out-of-order data) and the API\n // accepts the unchanged value — blocking the submit would trap\n // partners whose flow doesn't render Fields.EffectiveDate.\n // When `withEffectiveDateField` is false the field is excluded from\n // the shape and `data.effectiveDate` is undefined — this check\n // naturally short-circuits.\n if (\n hireDate &&\n data.effectiveDate &&\n data.effectiveDate < hireDate &&\n (mode === 'create' || minEffectiveDate)\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n // Enforce the caller-supplied minimum effective date in both modes.\n // Callers must only pass this when the carve-out cannot fire (see\n // CompensationSchemaOptions.minEffectiveDate for details).\n if (minEffectiveDate && data.effectiveDate && data.effectiveDate < minEffectiveDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_MIN,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","minEffectiveDate","withEffectiveDateField","buildFormSchema"],"mappings":";;;;;AA4CO,MAAMA,IAAyB;AAAA,EACpC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,2BAA2B;AAC7B,GAUMC,IAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStB,OAAOC,EAAE,OAAA;AAAA;AAAA;AAAA;AAAA,EAIT,YAAYA,EACT,KAAK;AAAA,IACJC,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EA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A,MAAA,CACjC;AAAA,IAEL;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/fields.tsx"],"sourcesContent":["import type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { CompensationErrorCodes } from './compensationSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { CheckboxHookFieldProps } from '@/partner-hook-utils/form/fields/CheckboxHookField'\nimport type { DatePickerHookFieldProps } from '@/partner-hook-utils/form/fields/DatePickerHookField'\nimport {\n TextInputHookField,\n SelectHookField,\n NumberInputHookField,\n CheckboxHookField,\n DatePickerHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\n/**\n * The required-field error code produced by {@link useCompensationForm} fields that only emit `REQUIRED`.\n *\n * @remarks\n * Used as the `validationMessages` key for the title, FLSA status, payment\n * unit, and minimum-wage selection fields. See {@link CompensationErrorCodes}.\n *\n * @public\n */\nexport type RequiredValidation = typeof CompensationErrorCodes.REQUIRED\n\n/**\n * Validation error codes emitted by the `rate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.Rate`. See\n * {@link CompensationErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type RateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'RATE_MINIMUM'\n | 'RATE_EXEMPT_THRESHOLD']\n\n/**\n * Validation error codes emitted by the `effectiveDate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.EffectiveDate`. See\n * {@link CompensationErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type EffectiveDateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'EFFECTIVE_DATE_BEFORE_HIRE'\n | 'EFFECTIVE_DATE_BEFORE_MIN']\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.Title` component.\n *\n * @public\n */\nexport type TitleFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/**\n * Text input bound to the `title` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Title`. Optional in both\n * create and update modes — use this when a title change should take effect\n * on this compensation's `effectiveDate` (for example, a future-dated\n * promotion that bundles a new title with a raise). Otherwise bind the title\n * via `useJobForm.Fields.Title` instead and avoid rendering both on the same\n * screen.\n *\n * @param props - {@link TitleFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered text input bound to `title`.\n * @public\n */\nexport function TitleField(props: TitleFieldProps) {\n return <TextInputHookField {...props} name=\"title\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.FlsaStatus` component.\n *\n * @public\n */\nexport type FlsaStatusFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, FlsaStatusType>\n>\n\n/**\n * Select bound to the `flsaStatus` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.FlsaStatus` when the FLSA\n * status is editable. The field is `undefined` when the user has no\n * meaningful choice — for example, on a secondary job whose status must\n * match the primary's. Always null-check before rendering. Options:\n * `Exempt`, `Salaried Nonexempt`, `Nonexempt`, `Owner`,\n * `Commission Only Exempt`, `Commission Only Nonexempt`.\n *\n * @param props - {@link FlsaStatusFieldProps} — accepts the standard hook field props plus `getOptionLabel` for FLSA status display.\n * @returns The rendered select bound to `flsaStatus`.\n * @public\n */\nexport function FlsaStatusField(props: FlsaStatusFieldProps) {\n return <SelectHookField {...props} name=\"flsaStatus\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.Rate` component.\n *\n * @public\n */\nexport type RateFieldProps = HookFieldProps<NumberInputHookFieldProps<RateValidation>>\n\n/**\n * Currency-formatted number input bound to the `rate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Rate` when the rate is\n * partner-editable. The field is `undefined` for commission-only FLSA\n * statuses (`Commission Only Exempt`, `Commission Only Nonexempt`) — those\n * statuses don't accept a partner-supplied rate, so the hook removes the\n * field and forces `rate=0` on the form values. Always null-check before\n * rendering.\n *\n * @param props - {@link RateFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered currency-formatted number input bound to `rate`.\n * @public\n */\nexport function RateField(props: RateFieldProps) {\n return <NumberInputHookField {...props} name=\"rate\" format=\"currency\" min={0} />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.PaymentUnit` component.\n *\n * @public\n */\nexport type PaymentUnitFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentUnit>\n>\n\n/**\n * Select bound to the `paymentUnit` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.PaymentUnit` when the\n * payment unit is partner-editable. The field is `undefined` for\n * commission-only FLSA statuses (the hook forces `paymentUnit=Year`),\n * and automatically rendered disabled when `flsaStatus === Owner`\n * (locked to `Paycheck`). Options: `Hour`, `Week`, `Month`, `Year`,\n * `Paycheck`.\n *\n * @param props - {@link PaymentUnitFieldProps} — accepts the standard hook field props plus `getOptionLabel` for payment-unit display.\n * @returns The rendered select bound to `paymentUnit`.\n * @public\n */\nexport function PaymentUnitField(props: PaymentUnitFieldProps) {\n return <SelectHookField {...props} name=\"paymentUnit\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.AdjustForMinimumWage` component.\n *\n * @public\n */\nexport type AdjustForMinimumWageFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\n/**\n * Checkbox bound to the `adjustForMinimumWage` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.AdjustForMinimumWage` when\n * minimum-wage adjustment applies — `Nonexempt` FLSA status, minimum wages\n * are available at the employee's work location, and the work state\n * supports tip credits. Always null-check before rendering.\n *\n * @param props - {@link AdjustForMinimumWageFieldProps} — accepts the standard hook field props (label, description, FieldComponent override).\n * @returns The rendered checkbox bound to `adjustForMinimumWage`.\n * @public\n */\nexport function AdjustForMinimumWageField(props: AdjustForMinimumWageFieldProps) {\n return <CheckboxHookField {...props} name=\"adjustForMinimumWage\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.MinimumWageId` component.\n *\n * @public\n */\nexport type MinimumWageIdFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, MinimumWage>\n>\n\n/**\n * Select bound to the `minimumWageId` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.MinimumWageId` when\n * `Fields.AdjustForMinimumWage` is rendered and the user has checked it.\n * Options are dynamically populated from the minimum wages available at the\n * employee's work location.\n *\n * @param props - {@link MinimumWageIdFieldProps} — accepts the standard hook field props plus `getOptionLabel` for minimum-wage display.\n * @returns The rendered select bound to `minimumWageId`.\n * @public\n */\nexport function MinimumWageIdField(props: MinimumWageIdFieldProps) {\n return <SelectHookField {...props} name=\"minimumWageId\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.EffectiveDate` component.\n *\n * @public\n */\nexport type EffectiveDateFieldProps = HookFieldProps<\n DatePickerHookFieldProps<EffectiveDateValidation>\n>\n\n/**\n * Date picker bound to the `effectiveDate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.EffectiveDate` when\n * `withEffectiveDateField` is `true` (the default). Required on create;\n * optional on update unless `optionalFieldsToRequire.update` includes\n * `'effectiveDate'`. The picker's min/max bounds are exposed on\n * `data.minimumEffectiveDate` / `data.maximumEffectiveDate`. The field is\n * automatically disabled (and the form value forced to today) while\n * `status.willDeleteSecondaryJobs` is `true` in update mode.\n *\n * When `withEffectiveDateField: false`, the field is `undefined` — supply\n * the value at submit time via `CompensationSubmitOptions.effectiveDate`\n * instead.\n *\n * @param props - {@link EffectiveDateFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered date picker bound to `effectiveDate`.\n * @public\n */\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["TitleField","props","jsx","TextInputHookField","FlsaStatusField","SelectHookField","RateField","NumberInputHookField","PaymentUnitField","AdjustForMinimumWageField","CheckboxHookField","MinimumWageIdField","EffectiveDateField","DatePickerHookField"],"mappings":";;;;;;AA+EO,SAASA,EAAWC,GAAwB;AACjD,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,SAAQ;AACrD;AA0BO,SAASG,EAAgBH,GAA6B;AAC3D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,cAAa;AACvD;AAwBO,SAASK,EAAUL,GAAuB;AAC/C,SAAO,gBAAAC,EAACK,KAAsB,GAAGN,GAAO,MAAK,QAAO,QAAO,YAAW,KAAK,EAAA,CAAG;AAChF;AA0BO,SAASO,EAAiBP,GAA8B;AAC7D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,eAAc;AACxD;AAsBO,SAASQ,EAA0BR,GAAuC;AAC/E,SAAO,gBAAAC,EAACQ,GAAA,EAAmB,GAAGT,GAAO,MAAK,wBAAuB;AACnE;AAwBO,SAASU,EAAmBV,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,iBAAgB;AAC1D;AA+BO,SAASW,EAAmBX,GAAgC;AACjE,SAAO,gBAAAC,EAACW,GAAA,EAAqB,GAAGZ,GAAO,MAAK,iBAAgB;AAC9D;"}
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/fields.tsx"],"sourcesContent":["import type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { CompensationErrorCodes } from './compensationSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { CheckboxHookFieldProps } from '@/partner-hook-utils/form/fields/CheckboxHookField'\nimport type { DatePickerHookFieldProps } from '@/partner-hook-utils/form/fields/DatePickerHookField'\nimport {\n TextInputHookField,\n SelectHookField,\n NumberInputHookField,\n CheckboxHookField,\n DatePickerHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\n/**\n * The required-field error code produced by {@link useCompensationForm} fields that only emit `REQUIRED`.\n *\n * @remarks\n * Used as the `validationMessages` key for the title, FLSA status, payment\n * unit, and minimum-wage selection fields. See {@link CompensationErrorCodes}.\n *\n * @public\n */\nexport type RequiredValidation = typeof CompensationErrorCodes.REQUIRED\n\n/**\n * Validation error codes emitted by the `rate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.Rate`. See\n * {@link CompensationErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type RateValidation = (typeof CompensationErrorCodes)[\n 'REQUIRED' | 'RATE_MINIMUM' | 'RATE_EXEMPT_THRESHOLD']\n\n/**\n * Validation error codes emitted by the `effectiveDate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.EffectiveDate`. See\n * {@link CompensationErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type EffectiveDateValidation = (typeof CompensationErrorCodes)[\n 'REQUIRED' | 'EFFECTIVE_DATE_BEFORE_HIRE' | 'EFFECTIVE_DATE_BEFORE_MIN']\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.Title` component.\n *\n * @public\n */\nexport type TitleFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/**\n * Text input bound to the `title` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Title`. Optional in both\n * create and update modes — use this when a title change should take effect\n * on this compensation's `effectiveDate` (for example, a future-dated\n * promotion that bundles a new title with a raise). Otherwise bind the title\n * via `useJobForm.Fields.Title` instead and avoid rendering both on the same\n * screen.\n *\n * @param props - {@link TitleFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered text input bound to `title`.\n * @public\n */\nexport function TitleField(props: TitleFieldProps) {\n return <TextInputHookField {...props} name=\"title\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.FlsaStatus` component.\n *\n * @public\n */\nexport type FlsaStatusFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, FlsaStatusType>\n>\n\n/**\n * Select bound to the `flsaStatus` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.FlsaStatus` when the FLSA\n * status is editable. The field is `undefined` when the user has no\n * meaningful choice — for example, on a secondary job whose status must\n * match the primary's. Always null-check before rendering. Options:\n * `Exempt`, `Salaried Nonexempt`, `Nonexempt`, `Owner`,\n * `Commission Only Exempt`, `Commission Only Nonexempt`.\n *\n * @param props - {@link FlsaStatusFieldProps} — accepts the standard hook field props plus `getOptionLabel` for FLSA status display.\n * @returns The rendered select bound to `flsaStatus`.\n * @public\n */\nexport function FlsaStatusField(props: FlsaStatusFieldProps) {\n return <SelectHookField {...props} name=\"flsaStatus\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.Rate` component.\n *\n * @public\n */\nexport type RateFieldProps = HookFieldProps<NumberInputHookFieldProps<RateValidation>>\n\n/**\n * Currency-formatted number input bound to the `rate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Rate` when the rate is\n * partner-editable. The field is `undefined` for commission-only FLSA\n * statuses (`Commission Only Exempt`, `Commission Only Nonexempt`) — those\n * statuses don't accept a partner-supplied rate, so the hook removes the\n * field and forces `rate=0` on the form values. Always null-check before\n * rendering.\n *\n * @param props - {@link RateFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered currency-formatted number input bound to `rate`.\n * @public\n */\nexport function RateField(props: RateFieldProps) {\n return <NumberInputHookField {...props} name=\"rate\" format=\"currency\" min={0} />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.PaymentUnit` component.\n *\n * @public\n */\nexport type PaymentUnitFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentUnit>\n>\n\n/**\n * Select bound to the `paymentUnit` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.PaymentUnit` when the\n * payment unit is partner-editable. The field is `undefined` for\n * commission-only FLSA statuses (the hook forces `paymentUnit=Year`),\n * and automatically rendered disabled when `flsaStatus === Owner`\n * (locked to `Paycheck`). Options: `Hour`, `Week`, `Month`, `Year`,\n * `Paycheck`.\n *\n * @param props - {@link PaymentUnitFieldProps} — accepts the standard hook field props plus `getOptionLabel` for payment-unit display.\n * @returns The rendered select bound to `paymentUnit`.\n * @public\n */\nexport function PaymentUnitField(props: PaymentUnitFieldProps) {\n return <SelectHookField {...props} name=\"paymentUnit\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.AdjustForMinimumWage` component.\n *\n * @public\n */\nexport type AdjustForMinimumWageFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\n/**\n * Checkbox bound to the `adjustForMinimumWage` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.AdjustForMinimumWage` when\n * minimum-wage adjustment applies — `Nonexempt` FLSA status, minimum wages\n * are available at the employee's work location, and the work state\n * supports tip credits. Always null-check before rendering.\n *\n * @param props - {@link AdjustForMinimumWageFieldProps} — accepts the standard hook field props (label, description, FieldComponent override).\n * @returns The rendered checkbox bound to `adjustForMinimumWage`.\n * @public\n */\nexport function AdjustForMinimumWageField(props: AdjustForMinimumWageFieldProps) {\n return <CheckboxHookField {...props} name=\"adjustForMinimumWage\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.MinimumWageId` component.\n *\n * @public\n */\nexport type MinimumWageIdFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, MinimumWage>\n>\n\n/**\n * Select bound to the `minimumWageId` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.MinimumWageId` when\n * `Fields.AdjustForMinimumWage` is rendered and the user has checked it.\n * Options are dynamically populated from the minimum wages available at the\n * employee's work location.\n *\n * @param props - {@link MinimumWageIdFieldProps} — accepts the standard hook field props plus `getOptionLabel` for minimum-wage display.\n * @returns The rendered select bound to `minimumWageId`.\n * @public\n */\nexport function MinimumWageIdField(props: MinimumWageIdFieldProps) {\n return <SelectHookField {...props} name=\"minimumWageId\" />\n}\n\n/**\n * Props accepted by {@link useCompensationForm}'s `Fields.EffectiveDate` component.\n *\n * @public\n */\nexport type EffectiveDateFieldProps = HookFieldProps<\n DatePickerHookFieldProps<EffectiveDateValidation>\n>\n\n/**\n * Date picker bound to the `effectiveDate` field of {@link useCompensationForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.EffectiveDate` when\n * `withEffectiveDateField` is `true` (the default). Required on create;\n * optional on update unless `optionalFieldsToRequire.update` includes\n * `'effectiveDate'`. The picker's min/max bounds are exposed on\n * `data.minimumEffectiveDate` / `data.maximumEffectiveDate`. The field is\n * automatically disabled (and the form value forced to today) while\n * `status.willDeleteSecondaryJobs` is `true` in update mode.\n *\n * When `withEffectiveDateField: false`, the field is `undefined` — supply\n * the value at submit time via `CompensationSubmitOptions.effectiveDate`\n * instead.\n *\n * @param props - {@link EffectiveDateFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered date picker bound to `effectiveDate`.\n * @public\n */\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["TitleField","props","jsx","TextInputHookField","FlsaStatusField","SelectHookField","RateField","NumberInputHookField","PaymentUnitField","AdjustForMinimumWageField","CheckboxHookField","MinimumWageIdField","EffectiveDateField","DatePickerHookField"],"mappings":";;;;;;AA2EO,SAASA,EAAWC,GAAwB;AACjD,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,SAAQ;AACrD;AA0BO,SAASG,EAAgBH,GAA6B;AAC3D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,cAAa;AACvD;AAwBO,SAASK,EAAUL,GAAuB;AAC/C,SAAO,gBAAAC,EAACK,KAAsB,GAAGN,GAAO,MAAK,QAAO,QAAO,YAAW,KAAK,EAAA,CAAG;AAChF;AA0BO,SAASO,EAAiBP,GAA8B;AAC7D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,eAAc;AACxD;AAsBO,SAASQ,EAA0BR,GAAuC;AAC/E,SAAO,gBAAAC,EAACQ,GAAA,EAAmB,GAAGT,GAAO,MAAK,wBAAuB;AACnE;AAwBO,SAASU,EAAmBV,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,iBAAgB;AAC1D;AA+BO,SAASW,EAAmBX,GAAgC;AACjE,SAAO,gBAAAC,EAACW,GAAA,EAAqB,GAAGZ,GAAO,MAAK,iBAAgB;AAC9D;"}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../../Base/Base';
|
|
2
|
-
/** @
|
|
2
|
+
/** @public */
|
|
3
3
|
export type DashboardTab = 'basicDetails' | 'jobAndPay' | 'taxes' | 'documents';
|
|
4
|
-
/** @
|
|
4
|
+
/** @public */
|
|
5
5
|
export interface DashboardProps extends BaseComponentInterface<'Employee.Dashboard'> {
|
|
6
|
+
/** The associated employee identifier. */
|
|
6
7
|
employeeId: string;
|
|
8
|
+
/** The currently active tab. Defaults to `'basicDetails'` when uncontrolled. */
|
|
7
9
|
selectedTab?: DashboardTab;
|
|
8
10
|
}
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Employee self-service dashboard summarizing a single employee's basic details, job and pay, taxes, and documents.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Renders a tabbed overview of the employee, wrapped in the SDK's standard error and suspense
|
|
16
|
+
* boundaries. The active tab may be controlled via `selectedTab` or left uncontrolled, in which
|
|
17
|
+
* case it defaults to basic details. Each tab composes the read-only section cards listed below.
|
|
18
|
+
*
|
|
19
|
+
* @components
|
|
20
|
+
* - {@link ProfileCard}
|
|
21
|
+
* - {@link HomeAddressCard}
|
|
22
|
+
* - {@link WorkAddressCard}
|
|
23
|
+
* - {@link CompensationCard}
|
|
24
|
+
* - {@link PaymentMethodCard}
|
|
25
|
+
* - {@link DeductionsCard}
|
|
26
|
+
* - {@link PaystubsCard}
|
|
27
|
+
* - {@link FederalTaxesCard}
|
|
28
|
+
* - {@link StateTaxesCard}
|
|
29
|
+
* - {@link DocumentsCard}
|
|
30
|
+
*
|
|
31
|
+
* @param props - Component props. See {@link DashboardProps}.
|
|
32
|
+
* @returns A React element rendering the employee dashboard.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare function Dashboard({ FallbackComponent, ...props }: DashboardProps): import("react").JSX.Element;
|
|
@@ -74,10 +74,7 @@ function _({ employeeId: t }) {
|
|
|
74
74
|
/* @__PURE__ */ e(o.Text, { variant: "supporting", children: a("employeeRoleLabel") })
|
|
75
75
|
] });
|
|
76
76
|
}
|
|
77
|
-
function z({
|
|
78
|
-
FallbackComponent: t,
|
|
79
|
-
...a
|
|
80
|
-
}) {
|
|
77
|
+
function z({ FallbackComponent: t, ...a }) {
|
|
81
78
|
return /* @__PURE__ */ e(g, { componentName: "Employee.Dashboard", FallbackComponent: t, children: /* @__PURE__ */ e(S, { ...a }) });
|
|
82
79
|
}
|
|
83
80
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","sources":["../../../../src/components/Employee/Dashboard/Dashboard.tsx"],"sourcesContent":["import { Suspense, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { BasicDetailsView } from './BasicDetailsView'\nimport { JobAndPayView } from './JobAndPayView'\nimport { TaxesViewWithData } from './TaxesView'\nimport { DocumentsCard } from '@/components/Employee/Documents/management/DocumentsCard'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/** @
|
|
1
|
+
{"version":3,"file":"Dashboard.js","sources":["../../../../src/components/Employee/Dashboard/Dashboard.tsx"],"sourcesContent":["import { Suspense, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { BasicDetailsView } from './BasicDetailsView'\nimport { JobAndPayView } from './JobAndPayView'\nimport { TaxesViewWithData } from './TaxesView'\nimport { DocumentsCard } from '@/components/Employee/Documents/management/DocumentsCard'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/** @public */\nexport type DashboardTab = 'basicDetails' | 'jobAndPay' | 'taxes' | 'documents'\n\n/** @public */\nexport interface DashboardProps extends BaseComponentInterface<'Employee.Dashboard'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The currently active tab. Defaults to `'basicDetails'` when uncontrolled. */\n selectedTab?: DashboardTab\n}\n\nfunction DashboardRoot({\n employeeId,\n dictionary,\n onEvent,\n selectedTab: controlledTab,\n}: DashboardProps) {\n useI18n('Employee.Dashboard')\n useComponentDictionary('Employee.Dashboard', dictionary)\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const [internalTab, setInternalTab] = useState<DashboardTab>('basicDetails')\n const selectedTab = controlledTab ?? internalTab\n\n const tabs = [\n {\n id: 'basicDetails' as const,\n label: t('tabs.basicDetails'),\n content: null,\n },\n {\n id: 'jobAndPay' as const,\n label: t('tabs.jobAndPay'),\n content: null,\n },\n {\n id: 'taxes' as const,\n label: t('tabs.taxes'),\n content: null,\n },\n {\n id: 'documents' as const,\n label: t('tabs.documents'),\n content: null,\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={null}>\n <DashboardHeader employeeId={employeeId} />\n </Suspense>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Tabs\n tabs={tabs}\n selectedId={selectedTab}\n onSelectionChange={id => {\n const next = id as DashboardTab\n setInternalTab(next)\n onEvent(componentEvents.EMPLOYEE_DASHBOARD_TAB_CHANGE, { tab: next })\n }}\n aria-label={t('tabsLabel')}\n />\n\n <Flex flexDirection=\"column\" gap={24}>\n {selectedTab === 'basicDetails' && (\n <BasicDetailsView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'jobAndPay' && (\n <JobAndPayView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'taxes' && (\n <TaxesViewWithData employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'documents' && (\n <DocumentsCard employeeId={employeeId} onEvent={onEvent} />\n )}\n </Flex>\n </Flex>\n </Flex>\n )\n}\n\nfunction DashboardHeader({ employeeId }: { employeeId: string }) {\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {firstLastName({ first_name: employee?.firstName, last_name: employee?.lastName })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('employeeRoleLabel')}</Components.Text>\n </Flex>\n )\n}\n\n/**\n * Employee self-service dashboard summarizing a single employee's basic details, job and pay, taxes, and documents.\n *\n * @remarks\n * Renders a tabbed overview of the employee, wrapped in the SDK's standard error and suspense\n * boundaries. The active tab may be controlled via `selectedTab` or left uncontrolled, in which\n * case it defaults to basic details. Each tab composes the read-only section cards listed below.\n *\n * @components\n * - {@link ProfileCard}\n * - {@link HomeAddressCard}\n * - {@link WorkAddressCard}\n * - {@link CompensationCard}\n * - {@link PaymentMethodCard}\n * - {@link DeductionsCard}\n * - {@link PaystubsCard}\n * - {@link FederalTaxesCard}\n * - {@link StateTaxesCard}\n * - {@link DocumentsCard}\n *\n * @param props - Component props. See {@link DashboardProps}.\n * @returns A React element rendering the employee dashboard.\n * @public\n */\nexport function Dashboard({ FallbackComponent, ...props }: DashboardProps) {\n return (\n <BaseBoundaries componentName=\"Employee.Dashboard\" FallbackComponent={FallbackComponent}>\n <DashboardRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DashboardRoot","employeeId","dictionary","onEvent","controlledTab","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","internalTab","setInternalTab","useState","selectedTab","tabs","jsxs","Flex","jsx","Suspense","DashboardHeader","id","next","componentEvents","BasicDetailsView","JobAndPayView","TaxesViewWithData","DocumentsCard","employee","useEmployeesGetSuspense","firstLastName","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