@gusto/embedded-react-sdk 0.16.0 → 0.18.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 +54 -0
- package/dist/components/Base/Base.js +50 -65
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -5
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -10
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +41 -33
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +32 -18
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +12 -12
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +14 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
- package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
- package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
- package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
- package/dist/components/Common/UI/Modal/Modal.js +90 -0
- package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
- package/dist/components/Common/UI/Modal/index.d.ts +3 -0
- package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
- package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
- package/dist/components/Common/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -9
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -11
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -11
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -6
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +39 -41
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +18 -19
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -8
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +15 -16
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +2 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +4 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +10 -9
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +6 -6
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -5
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +9 -10
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +2 -3
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -6
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Head.js +6 -6
- package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -4
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +12 -13
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
- package/dist/components/Employee/Profile/HomeAddress.js +63 -44
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +150 -143
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/useProfile.js +4 -6
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -7
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -6
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +6 -6
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +5 -5
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -6
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -10
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -10
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +101 -90
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +135 -133
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +127 -119
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +4 -4
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +117 -128
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +89 -78
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +195 -214
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +49 -45
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/apiErrorToList.d.ts +7 -0
- package/dist/helpers/apiErrorToList.js +23 -0
- package/dist/helpers/apiErrorToList.js.map +1 -0
- package/dist/helpers/breadcrumbHelpers.js +30 -30
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +18 -6
- package/dist/helpers/dateFormatting.js +93 -24
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useAsyncError.js.map +1 -0
- package/dist/hooks/useDateFormatter.d.ts +19 -0
- package/dist/hooks/useDateFormatter.js +24 -0
- package/dist/hooks/useDateFormatter.js.map +1 -0
- package/dist/hooks/useMenu.js.map +1 -0
- package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
- package/dist/hooks/useNumberFormatter.js.map +1 -0
- package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
- package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +15 -15
- package/dist/i18n/en/Employee.Deductions.json.js +131 -105
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
- package/dist/i18n/en/Employee.HomeAddress.json.js +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +25 -27
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +17 -17
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +23 -23
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +20 -1
- package/package.json +10 -10
- package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
- package/dist/components/Common/hooks/useMenu.js.map +0 -1
- package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollOverviewPresentation.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type {\n EmployeeCompensations,\n PayrollShow,\n} from '@gusto/embedded-api/models/components/payrollshow'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { useState } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { calculateTotalPayroll } from '../helpers'\nimport { DataView, Flex, FlexItem } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { parseDateStringToLocal } from '@/helpers/dateFormatting'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { compensationTypeLabels, FlsaStatus, PAYMENT_METHODS } from '@/shared/constants'\nimport DownloadIcon from '@/assets/icons/download-cloud.svg?react'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\ninterface PayrollOverviewProps {\n payrollData: PayrollShow\n bankAccount?: CompanyBankAccount\n employeeDetails: Employee[]\n taxes: Record<string, { employee: number; employer: number }>\n isSubmitting?: boolean\n isProcessed: boolean\n alerts?: PayrollFlowAlert[]\n onEdit: () => void\n onSubmit: () => void\n onCancel: () => void\n onPayrollReceipt: () => void\n onPaystubDownload: (employeeId: string) => void\n}\n\nconst getPayrollOverviewTitle = ({\n payPeriod,\n locale,\n}: {\n payPeriod?: PayrollPayPeriodType\n locale: string\n}) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n const startDate = parseDateStringToLocal(payPeriod.startDate)\n const endDate = parseDateStringToLocal(payPeriod.endDate)\n\n if (startDate && endDate) {\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n })\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n return { startDate: startFormatted, endDate: endFormatted }\n }\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollOverviewPresentation = ({\n onEdit,\n onSubmit,\n onCancel,\n onPayrollReceipt,\n onPaystubDownload,\n employeeDetails,\n payrollData,\n bankAccount,\n taxes,\n isSubmitting = false,\n isProcessed,\n alerts,\n}: PayrollOverviewProps) => {\n const { Alert, Button, ButtonIcon, Dialog, Heading, Text, Tabs, LoadingSpinner } =\n useComponentContext()\n useI18n('Payroll.PayrollOverview')\n const { locale } = useLocale()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const formatCurrency = useNumberFormatter('currency')\n const [selectedTab, setSelectedTab] = useState('companyPays')\n const [isCancelDialogOpen, setIsCancelDialogOpen] = useState(false)\n const { LoadingIndicator } = useLoadingIndicator()\n\n const totalPayroll = calculateTotalPayroll(payrollData)\n\n const expectedDebitDate = payrollData.payrollStatusMeta?.expectedDebitTime\n ? parseDateStringToLocal(payrollData.payrollStatusMeta.expectedDebitTime)\n : payrollData.payrollDeadline!\n\n const getCompanyTaxes = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.taxes?.reduce(\n (acc, tax) => (tax.employer ? acc + tax.amount : acc),\n 0,\n ) ?? 0\n )\n }\n const getCompanyBenefits = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.benefits?.reduce(\n (acc, benefit) => (benefit.companyContribution ? acc + benefit.companyContribution : acc),\n 0,\n ) ?? 0\n )\n }\n const getReimbursements = (employeeCompensation: EmployeeCompensations) => {\n return employeeCompensation.fixedCompensations?.length\n ? Number(\n employeeCompensation.fixedCompensations.find(\n c => c.name?.toLowerCase() === compensationTypeLabels.REIMBURSEMENT_NAME.toLowerCase(),\n )?.amount || 0,\n )\n : 0\n }\n\n const getCompanyCost = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.grossPay! +\n getReimbursements(employeeCompensation) +\n getCompanyTaxes(employeeCompensation) +\n getCompanyBenefits(employeeCompensation)\n )\n }\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeHours = (\n employeeCompensations: EmployeeCompensations,\n ): Record<string, number> => {\n return (\n employeeCompensations.hourlyCompensations?.reduce(\n (acc, hourlyCompensation) => {\n if (typeof hourlyCompensation.name === 'undefined') {\n return acc\n }\n const name = hourlyCompensation.name.toLowerCase()\n const currentHours = acc[name] ?? 0\n acc[name] = currentHours + Number(hourlyCompensation.hours || 0)\n return acc\n },\n {} as Record<string, number>,\n ) || {}\n )\n }\n const getEmployeePtoHours = (employeeCompensations: EmployeeCompensations) => {\n return (\n employeeCompensations.paidTimeOff?.reduce((acc, paidTimeOff) => {\n return acc + Number(paidTimeOff.hours || 0)\n }, 0) ?? 0\n )\n }\n\n const checkPaymentsCount =\n payrollData.employeeCompensations?.reduce(\n (acc, comp) =>\n !comp.excluded && comp.paymentMethod === PAYMENT_METHODS.check ? acc + 1 : acc,\n 0,\n ) ?? 0\n const companyPaysColumns = [\n {\n key: 'employeeName',\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n key: 'grossPay',\n title: t('tableHeaders.grossPay'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.grossPay!)}</Text>\n ),\n },\n {\n key: 'reimbursements',\n title: t('tableHeaders.reimbursements'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getReimbursements(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyTaxes',\n title: t('tableHeaders.companyTaxes'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyTaxes(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyBenefits',\n title: t('tableHeaders.companyBenefits'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyBenefits(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyPays',\n title: t('tableHeaders.companyPays'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyCost(employeeCompensation))}</Text>\n ),\n },\n ]\n if (isProcessed) {\n companyPaysColumns.push({\n key: 'paystubs',\n title: t('tableHeaders.paystub'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <ButtonIcon\n aria-label={t('downloadPaystubLabel')}\n variant=\"tertiary\"\n onClick={() => {\n if (employeeCompensations.employeeUuid) {\n onPaystubDownload(employeeCompensations.employeeUuid)\n }\n }}\n >\n <DownloadIcon />\n </ButtonIcon>\n ),\n })\n }\n const tabs = [\n {\n id: 'companyPays',\n label: t('dataViews.companyPaysTab'),\n content: (\n <DataView\n label={t('dataViews.companyPaysTable')}\n columns={companyPaysColumns}\n data={payrollData.employeeCompensations!}\n footer={() => ({\n employeeName: (\n <>\n <Text>{t('tableHeaders.footerTotalsLabel')}</Text>\n <Text>{t('tableHeaders.footerTotalsDescription')}</Text>\n </>\n ),\n grossPay: <Text>{formatCurrency(Number(payrollData.totals?.grossPay ?? 0))}</Text>,\n reimbursements: (\n <Text>{formatCurrency(Number(payrollData.totals?.reimbursements ?? 0))}</Text>\n ),\n companyTaxes: (\n <Text>{formatCurrency(Number(payrollData.totals?.employerTaxes ?? 0))}</Text>\n ),\n companyBenefits: (\n <Text>{formatCurrency(Number(payrollData.totals?.benefits ?? 0))}</Text>\n ),\n companyPays: <Text>{formatCurrency(totalPayroll)}</Text>,\n })}\n />\n ),\n },\n {\n id: 'hoursWorked',\n label: t('dataViews.hoursWorkedTab'),\n content: (\n <DataView\n label={t('dataViews.hoursWorkedTable')}\n columns={[\n {\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.compensationType'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {employeeMap\n .get(employeeCompensations.employeeUuid!)\n ?.jobs?.reduce((acc, job) => {\n if (job.primary) {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n\n switch (flsaStatus) {\n case FlsaStatus.EXEMPT:\n return t('compensationTypeLabels.exempt')\n case FlsaStatus.NONEXEMPT:\n return t('compensationTypeLabels.nonexempt')\n default:\n return flsaStatus ?? ''\n }\n }\n return acc\n }, '')}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.regular'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[\n compensationTypeLabels.REGULAR_HOURS_NAME\n ] || 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.overtime'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[compensationTypeLabels.OVERTIME_NAME] ||\n 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.doubleOT'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[\n compensationTypeLabels.DOUBLE_OVERTIME_NAME\n ] || 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.timeOff'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{getEmployeePtoHours(employeeCompensations)}</Text>\n ),\n },\n {\n title: t('tableHeaders.totalHours'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {Object.values(getEmployeeHours(employeeCompensations)).reduce(\n (acc, hours) => acc + hours,\n 0,\n ) + getEmployeePtoHours(employeeCompensations)}\n </Text>\n ),\n },\n ]}\n data={payrollData.employeeCompensations!}\n />\n ),\n },\n {\n id: 'employeeTakeHome',\n label: t('dataViews.employeeTakeHomeTab'),\n content: (\n <DataView\n label={t('dataViews.employeeTakeHomeTable')}\n columns={[\n {\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.paymentType'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{employeeCompensations.paymentMethod ?? ''}</Text>\n ),\n },\n {\n title: t('tableHeaders.grossPay'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.grossPay ?? 0)}</Text>\n ),\n },\n {\n title: t('tableHeaders.deductions'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.deductions?.reduce(\n (acc, deduction) => acc + deduction.amount!,\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(getReimbursements(employeeCompensations))}</Text>\n ),\n },\n {\n title: t('tableHeaders.employeeTaxes'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.taxes?.reduce(\n (acc, tax) => (tax.employer ? acc : acc + tax.amount),\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.employeeBenefits'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.benefits?.reduce(\n (acc, benefit) => acc + (benefit.employeeDeduction ?? 0),\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.payment'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.netPay ?? 0)}</Text>\n ),\n },\n ]}\n data={payrollData.employeeCompensations!}\n />\n ),\n },\n {\n id: 'taxes',\n label: t('dataViews.taxesTab'),\n content: (\n <Flex flexDirection=\"column\" gap={32}>\n <DataView\n label={t('dataViews.taxesTable')}\n columns={[\n {\n key: 'taxDescription',\n title: t('tableHeaders.taxDescription'),\n render: taxKey => <Text>{taxKey}</Text>,\n },\n {\n key: 'byYourEmployees',\n title: t('tableHeaders.byYourEmployees'),\n render: taxKey => <Text>{formatCurrency(taxes[taxKey]?.employee ?? 0)}</Text>,\n },\n {\n key: 'byYourCompany',\n title: t('tableHeaders.byYourCompany'),\n render: taxKey => <Text>{formatCurrency(taxes[taxKey]?.employer ?? 0)}</Text>,\n },\n ]}\n footer={() => ({\n taxDescription: <Text>{t('totalsLabel')}</Text>,\n byYourEmployees: (\n <Text>{formatCurrency(Number(payrollData.totals?.employeeTaxes ?? 0))}</Text>\n ),\n byYourCompany: (\n <Text>{formatCurrency(Number(payrollData.totals?.employerTaxes ?? 0))}</Text>\n ),\n })}\n data={Object.keys(taxes)}\n />\n\n <DataView\n label={t('dataViews.debitedTable')}\n columns={[\n {\n title: t('tableHeaders.debitedByGusto'),\n render: ({ label }) => <Text>{label}</Text>,\n },\n {\n title: t('tableHeaders.taxesTotal'),\n render: ({ value }) => <Text>{formatCurrency(Number(value))}</Text>,\n },\n ]}\n data={[\n { label: t('directDepositLabel'), value: payrollData.totals?.netPayDebit || '0' },\n {\n label: t('reimbursementLabel'),\n value: payrollData.totals?.reimbursementDebit || '0',\n },\n {\n label: t('garnishmentsLabel'),\n value: payrollData.totals?.childSupportDebit || '0',\n },\n { label: t('taxesLabel'), value: payrollData.totals?.taxDebit || '0' },\n ]}\n />\n </Flex>\n ),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"stretch\">\n <Flex justifyContent=\"space-between\">\n <FlexItem flexGrow={1}>\n <Heading as=\"h1\">{isProcessed ? t('summaryTitle') : t('overviewTitle')}</Heading>\n <Text>\n <Trans\n i18nKey=\"pageSubtitle\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={getPayrollOverviewTitle({ payPeriod: payrollData.payPeriod, locale })}\n />\n </Text>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Flex justifyContent=\"flex-end\">\n {isProcessed ? (\n <>\n <Button onClick={onPayrollReceipt} variant=\"secondary\" isDisabled={isSubmitting}>\n {t('payrollReceiptCta')}\n </Button>\n <Button\n onClick={() => {\n setIsCancelDialogOpen(true)\n }}\n variant=\"error\"\n isDisabled={isSubmitting}\n >\n {t('cancelCta')}\n </Button>\n </>\n ) : (\n <>\n <Button onClick={onEdit} variant=\"secondary\" isDisabled={isSubmitting}>\n {t('editCta')}\n </Button>\n <Button onClick={onSubmit} isDisabled={isSubmitting}>\n {t('submitCta')}\n </Button>\n </>\n )}\n </Flex>\n </FlexItem>\n </Flex>\n {isSubmitting ? (\n <LoadingIndicator>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={4}>\n <LoadingSpinner size=\"lg\" />\n <Heading as=\"h4\">{t('loadingTitle')}</Heading>\n <Text>{t('loadingDescription')}</Text>\n </Flex>\n </LoadingIndicator>\n ) : (\n <>\n {alerts?.length && alerts.length > 0 && (\n <Flex flexDirection={'column'} gap={16}>\n {alerts.map((alert, index) => (\n <Alert key={`${alert.type}-${alert.title}`} label={alert.title} status={alert.type}>\n {alert.content ?? null}\n </Alert>\n ))}\n </Flex>\n )}\n <Heading as=\"h3\">{t('payrollSummaryTitle')}</Heading>\n <DataView\n label={t('payrollSummaryLabel')}\n columns={[\n {\n title: t('tableHeaders.totalPayroll'),\n render: () => <Text>{formatCurrency(totalPayroll)}</Text>,\n },\n {\n title: t('tableHeaders.debitAmount'),\n render: () => (\n <Text>{formatCurrency(Number(payrollData.totals?.companyDebit ?? 0))}</Text>\n ),\n },\n {\n title: t('tableHeaders.debitAccount'),\n render: () => <Text>{bankAccount?.hiddenAccountNumber ?? ''}</Text>,\n },\n {\n title: t('tableHeaders.debitDate'),\n render: () => (\n <Text>\n {expectedDebitDate?.toLocaleString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.employeesPayDate'),\n render: () => (\n <Text>\n {parseDateStringToLocal(payrollData.checkDate!)?.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })}\n </Text>\n ),\n },\n ]}\n data={[{}]}\n />\n {checkPaymentsCount > 0 && (\n <Alert\n status=\"warning\"\n label={t('alerts.checkPaymentWarning', { count: checkPaymentsCount })}\n >\n <Text>{t('alerts.checkPaymentWarningDescription')}</Text>\n </Alert>\n )}\n <Tabs\n onSelectionChange={setSelectedTab}\n selectedId={selectedTab}\n aria-label={t('dataViews.label')}\n tabs={tabs}\n />\n {isCancelDialogOpen && (\n <Dialog\n isOpen={isCancelDialogOpen}\n onClose={() => {\n setIsCancelDialogOpen(false)\n }}\n onPrimaryActionClick={onCancel}\n shouldCloseOnBackdropClick={true}\n primaryActionLabel={t('confirmCancelCta')}\n isDestructive={true}\n closeActionLabel={t('declineCancelCta')}\n title={t('cancelDialogTitle', {\n startDate: parseDateStringToLocal(\n payrollData.payPeriod?.startDate ?? '',\n )?.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n }),\n endDate: parseDateStringToLocal(\n payrollData.payPeriod?.endDate ?? '',\n )?.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }),\n })}\n >\n <Flex gap={14} flexDirection=\"column\">\n <Text>{t('cancelDialogDescription')}</Text>\n <Text>\n {t('cancelDialogDescriptionDeadline', {\n deadline: (payrollData.payrollDeadline ?? '').toLocaleString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n timeZoneName: 'short',\n }),\n })}\n </Text>\n </Flex>\n </Dialog>\n )}\n </>\n )}\n </Flex>\n )\n}\n"],"names":["getPayrollOverviewTitle","payPeriod","locale","startDate","parseDateStringToLocal","endDate","startFormatted","endFormatted","PayrollOverviewPresentation","onEdit","onSubmit","onCancel","onPayrollReceipt","onPaystubDownload","employeeDetails","payrollData","bankAccount","taxes","isSubmitting","isProcessed","alerts","Alert","Button","ButtonIcon","Dialog","Heading","Text","Tabs","LoadingSpinner","useComponentContext","useI18n","useLocale","t","useTranslation","formatCurrency","useNumberFormatter","selectedTab","setSelectedTab","useState","isCancelDialogOpen","setIsCancelDialogOpen","LoadingIndicator","useLoadingIndicator","totalPayroll","calculateTotalPayroll","expectedDebitDate","getCompanyTaxes","employeeCompensation","acc","tax","getCompanyBenefits","benefit","getReimbursements","c","compensationTypeLabels","getCompanyCost","employeeMap","employee","getEmployeeHours","employeeCompensations","hourlyCompensation","name","currentHours","getEmployeePtoHours","paidTimeOff","checkPaymentsCount","comp","PAYMENT_METHODS","companyPaysColumns","jsx","firstLastName","DownloadIcon","tabs","DataView","jsxs","Fragment","job","flsaStatus","FlsaStatus","hours","deduction","Flex","taxKey","label","value","FlexItem","Trans","al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A,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollOverviewPresentation.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type {\n EmployeeCompensations,\n PayrollShow,\n} from '@gusto/embedded-api/models/components/payrollshow'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { useState, useRef } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { calculateTotalPayroll } from '../helpers'\nimport styles from './PayrollOverviewPresentation.module.scss'\nimport { DataView, Flex, FlexItem } from '@/components/Common'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { compensationTypeLabels, FlsaStatus, PAYMENT_METHODS } from '@/shared/constants'\nimport DownloadIcon from '@/assets/icons/download-cloud.svg?react'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\ninterface PayrollOverviewProps {\n payrollData: PayrollShow\n bankAccount?: CompanyBankAccount\n employeeDetails: Employee[]\n taxes: Record<string, { employee: number; employer: number }>\n isSubmitting?: boolean\n isProcessed: boolean\n alerts?: PayrollFlowAlert[]\n onEdit: () => void\n onSubmit: () => void\n onCancel: () => void\n onPayrollReceipt: () => void\n onPaystubDownload: (employeeId: string) => void\n}\n\nconst getPayrollOverviewTitle = (\n payPeriod: PayrollPayPeriodType | undefined,\n dateFormatter: ReturnType<typeof useDateFormatter>,\n) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n return dateFormatter.formatPayPeriod(payPeriod.startDate, payPeriod.endDate)\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollOverviewPresentation = ({\n onEdit,\n onSubmit,\n onCancel,\n onPayrollReceipt,\n onPaystubDownload,\n employeeDetails,\n payrollData,\n bankAccount,\n taxes,\n isSubmitting = false,\n isProcessed,\n alerts = [],\n}: PayrollOverviewProps) => {\n const { Alert, Button, ButtonIcon, Dialog, Heading, Text, Tabs, LoadingSpinner } =\n useComponentContext()\n useI18n('Payroll.PayrollOverview')\n const dateFormatter = useDateFormatter()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const formatCurrency = useNumberFormatter('currency')\n const [selectedTab, setSelectedTab] = useState('companyPays')\n const [isCancelDialogOpen, setIsCancelDialogOpen] = useState(false)\n const { LoadingIndicator } = useLoadingIndicator()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n\n const totalPayroll = calculateTotalPayroll(payrollData)\n\n const expectedDebitDate =\n payrollData.payrollStatusMeta?.expectedDebitTime ?? payrollData.payrollDeadline\n\n const getCompanyTaxes = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.taxes?.reduce(\n (acc, tax) => (tax.employer ? acc + tax.amount : acc),\n 0,\n ) ?? 0\n )\n }\n const getCompanyBenefits = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.benefits?.reduce(\n (acc, benefit) => (benefit.companyContribution ? acc + benefit.companyContribution : acc),\n 0,\n ) ?? 0\n )\n }\n const getReimbursements = (employeeCompensation: EmployeeCompensations) => {\n return employeeCompensation.fixedCompensations?.length\n ? Number(\n employeeCompensation.fixedCompensations.find(\n c => c.name?.toLowerCase() === compensationTypeLabels.REIMBURSEMENT_NAME.toLowerCase(),\n )?.amount || 0,\n )\n : 0\n }\n\n const getCompanyCost = (employeeCompensation: EmployeeCompensations) => {\n return (\n employeeCompensation.grossPay! +\n getReimbursements(employeeCompensation) +\n getCompanyTaxes(employeeCompensation) +\n getCompanyBenefits(employeeCompensation)\n )\n }\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeHours = (\n employeeCompensations: EmployeeCompensations,\n ): Record<string, number> => {\n return (\n employeeCompensations.hourlyCompensations?.reduce(\n (acc, hourlyCompensation) => {\n if (typeof hourlyCompensation.name === 'undefined') {\n return acc\n }\n const name = hourlyCompensation.name.toLowerCase()\n const currentHours = acc[name] ?? 0\n acc[name] = currentHours + Number(hourlyCompensation.hours || 0)\n return acc\n },\n {} as Record<string, number>,\n ) || {}\n )\n }\n const getEmployeePtoHours = (employeeCompensations: EmployeeCompensations) => {\n return (\n employeeCompensations.paidTimeOff?.reduce((acc, paidTimeOff) => {\n return acc + Number(paidTimeOff.hours || 0)\n }, 0) ?? 0\n )\n }\n\n const checkPaymentsCount =\n payrollData.employeeCompensations?.reduce(\n (acc, comp) =>\n !comp.excluded && comp.paymentMethod === PAYMENT_METHODS.check ? acc + 1 : acc,\n 0,\n ) ?? 0\n const companyPaysColumns = [\n {\n key: 'employeeName',\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n key: 'grossPay',\n title: t('tableHeaders.grossPay'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.grossPay!)}</Text>\n ),\n },\n {\n key: 'reimbursements',\n title: t('tableHeaders.reimbursements'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getReimbursements(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyTaxes',\n title: t('tableHeaders.companyTaxes'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyTaxes(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyBenefits',\n title: t('tableHeaders.companyBenefits'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyBenefits(employeeCompensation))}</Text>\n ),\n },\n {\n key: 'companyPays',\n title: t('tableHeaders.companyPays'),\n render: (employeeCompensation: EmployeeCompensations) => (\n <Text>{formatCurrency(getCompanyCost(employeeCompensation))}</Text>\n ),\n },\n ]\n if (isProcessed) {\n companyPaysColumns.push({\n key: 'paystubs',\n title: t('tableHeaders.paystub'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <ButtonIcon\n aria-label={t('downloadPaystubLabel')}\n variant=\"tertiary\"\n onClick={() => {\n if (employeeCompensations.employeeUuid) {\n onPaystubDownload(employeeCompensations.employeeUuid)\n }\n }}\n >\n <DownloadIcon />\n </ButtonIcon>\n ),\n })\n }\n const tabs = [\n {\n id: 'companyPays',\n label: t('dataViews.companyPaysTab'),\n content: (\n <DataView\n label={t('dataViews.companyPaysTable')}\n columns={companyPaysColumns}\n data={payrollData.employeeCompensations!}\n footer={() => ({\n employeeName: (\n <>\n <Text>{t('tableHeaders.footerTotalsLabel')}</Text>\n <Text>{t('tableHeaders.footerTotalsDescription')}</Text>\n </>\n ),\n grossPay: <Text>{formatCurrency(Number(payrollData.totals?.grossPay ?? 0))}</Text>,\n reimbursements: (\n <Text>{formatCurrency(Number(payrollData.totals?.reimbursements ?? 0))}</Text>\n ),\n companyTaxes: (\n <Text>{formatCurrency(Number(payrollData.totals?.employerTaxes ?? 0))}</Text>\n ),\n companyBenefits: (\n <Text>{formatCurrency(Number(payrollData.totals?.benefits ?? 0))}</Text>\n ),\n companyPays: <Text>{formatCurrency(totalPayroll)}</Text>,\n })}\n />\n ),\n },\n {\n id: 'hoursWorked',\n label: t('dataViews.hoursWorkedTab'),\n content: (\n <DataView\n label={t('dataViews.hoursWorkedTable')}\n columns={[\n {\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.compensationType'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {employeeMap\n .get(employeeCompensations.employeeUuid!)\n ?.jobs?.reduce((acc, job) => {\n if (job.primary) {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n\n switch (flsaStatus) {\n case FlsaStatus.EXEMPT:\n return t('compensationTypeLabels.exempt')\n case FlsaStatus.NONEXEMPT:\n return t('compensationTypeLabels.nonexempt')\n default:\n return flsaStatus ?? ''\n }\n }\n return acc\n }, '')}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.regular'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[\n compensationTypeLabels.REGULAR_HOURS_NAME\n ] || 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.overtime'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[compensationTypeLabels.OVERTIME_NAME] ||\n 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.doubleOT'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {getEmployeeHours(employeeCompensations)[\n compensationTypeLabels.DOUBLE_OVERTIME_NAME\n ] || 0}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.timeOff'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{getEmployeePtoHours(employeeCompensations)}</Text>\n ),\n },\n {\n title: t('tableHeaders.totalHours'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {Object.values(getEmployeeHours(employeeCompensations)).reduce(\n (acc, hours) => acc + hours,\n 0,\n ) + getEmployeePtoHours(employeeCompensations)}\n </Text>\n ),\n },\n ]}\n data={payrollData.employeeCompensations!}\n />\n ),\n },\n {\n id: 'employeeTakeHome',\n label: t('dataViews.employeeTakeHomeTab'),\n content: (\n <DataView\n label={t('dataViews.employeeTakeHomeTable')}\n columns={[\n {\n title: t('tableHeaders.employees'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {firstLastName({\n first_name: employeeMap.get(employeeCompensations.employeeUuid!)?.firstName,\n last_name: employeeMap.get(employeeCompensations.employeeUuid!)?.lastName,\n })}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.paymentType'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{employeeCompensations.paymentMethod ?? ''}</Text>\n ),\n },\n {\n title: t('tableHeaders.grossPay'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.grossPay ?? 0)}</Text>\n ),\n },\n {\n title: t('tableHeaders.deductions'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.deductions?.reduce(\n (acc, deduction) => acc + deduction.amount!,\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(getReimbursements(employeeCompensations))}</Text>\n ),\n },\n {\n title: t('tableHeaders.employeeTaxes'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.taxes?.reduce(\n (acc, tax) => (tax.employer ? acc : acc + tax.amount),\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.employeeBenefits'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>\n {formatCurrency(\n employeeCompensations.benefits?.reduce(\n (acc, benefit) => acc + (benefit.employeeDeduction ?? 0),\n 0,\n ) ?? 0,\n )}\n </Text>\n ),\n },\n {\n title: t('tableHeaders.payment'),\n render: (employeeCompensations: EmployeeCompensations) => (\n <Text>{formatCurrency(employeeCompensations.netPay ?? 0)}</Text>\n ),\n },\n ]}\n data={payrollData.employeeCompensations!}\n />\n ),\n },\n {\n id: 'taxes',\n label: t('dataViews.taxesTab'),\n content: (\n <Flex flexDirection=\"column\" gap={32}>\n <DataView\n label={t('dataViews.taxesTable')}\n columns={[\n {\n key: 'taxDescription',\n title: t('tableHeaders.taxDescription'),\n render: taxKey => <Text>{taxKey}</Text>,\n },\n {\n key: 'byYourEmployees',\n title: t('tableHeaders.byYourEmployees'),\n render: taxKey => <Text>{formatCurrency(taxes[taxKey]?.employee ?? 0)}</Text>,\n },\n {\n key: 'byYourCompany',\n title: t('tableHeaders.byYourCompany'),\n render: taxKey => <Text>{formatCurrency(taxes[taxKey]?.employer ?? 0)}</Text>,\n },\n ]}\n footer={() => ({\n taxDescription: <Text>{t('totalsLabel')}</Text>,\n byYourEmployees: (\n <Text>{formatCurrency(Number(payrollData.totals?.employeeTaxes ?? 0))}</Text>\n ),\n byYourCompany: (\n <Text>{formatCurrency(Number(payrollData.totals?.employerTaxes ?? 0))}</Text>\n ),\n })}\n data={Object.keys(taxes)}\n />\n\n <DataView\n label={t('dataViews.debitedTable')}\n columns={[\n {\n title: t('tableHeaders.debitedByGusto'),\n render: ({ label }) => <Text>{label}</Text>,\n },\n {\n title: t('tableHeaders.taxesTotal'),\n render: ({ value }) => <Text>{formatCurrency(Number(value))}</Text>,\n },\n ]}\n data={[\n { label: t('directDepositLabel'), value: payrollData.totals?.netPayDebit || '0' },\n {\n label: t('reimbursementLabel'),\n value: payrollData.totals?.reimbursementDebit || '0',\n },\n {\n label: t('garnishmentsLabel'),\n value: payrollData.totals?.childSupportDebit || '0',\n },\n { label: t('taxesLabel'), value: payrollData.totals?.taxDebit || '0' },\n ]}\n />\n </Flex>\n ),\n },\n ]\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" alignItems=\"stretch\">\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'space-between' : 'normal'}\n alignItems={isDesktop ? 'flex-start' : 'stretch'}\n gap={isDesktop ? 0 : 16}\n >\n <FlexItem flexGrow={1}>\n <Heading as=\"h1\">{isProcessed ? t('summaryTitle') : t('overviewTitle')}</Heading>\n <Text>\n <Trans\n i18nKey=\"pageSubtitle\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={getPayrollOverviewTitle(payrollData.payPeriod, dateFormatter)}\n />\n </Text>\n </FlexItem>\n <FlexItem flexGrow={isDesktop ? 1 : 0}>\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'flex-end' : 'normal'}\n alignItems={isDesktop ? 'flex-start' : 'stretch'}\n gap={12}\n >\n {isProcessed ? (\n <>\n <Button onClick={onPayrollReceipt} variant=\"secondary\" isDisabled={isSubmitting}>\n {t('payrollReceiptCta')}\n </Button>\n <Button\n onClick={() => {\n setIsCancelDialogOpen(true)\n }}\n variant=\"error\"\n isDisabled={isSubmitting}\n >\n {t('cancelCta')}\n </Button>\n </>\n ) : (\n <>\n <Button onClick={onEdit} variant=\"secondary\" isDisabled={isSubmitting}>\n {t('editCta')}\n </Button>\n <Button onClick={onSubmit} isDisabled={isSubmitting}>\n {t('submitCta')}\n </Button>\n </>\n )}\n </Flex>\n </FlexItem>\n </Flex>\n {isSubmitting ? (\n <LoadingIndicator>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={4}>\n <LoadingSpinner size=\"lg\" />\n <Heading as=\"h4\">{t('loadingTitle')}</Heading>\n <Text>{t('loadingDescription')}</Text>\n </Flex>\n </LoadingIndicator>\n ) : (\n <>\n {alerts.length > 0 && (\n <Flex flexDirection={'column'} gap={16}>\n {alerts.map((alert, index) => (\n <Alert\n key={`${alert.type}-${alert.title}`}\n label={alert.title}\n status={alert.type}\n >\n {alert.content ?? null}\n </Alert>\n ))}\n </Flex>\n )}\n <Heading as=\"h3\">{t('payrollSummaryTitle')}</Heading>\n <DataView\n label={t('payrollSummaryLabel')}\n columns={[\n {\n title: t('tableHeaders.totalPayroll'),\n render: () => <Text>{formatCurrency(totalPayroll)}</Text>,\n },\n {\n title: t('tableHeaders.debitAmount'),\n render: () => (\n <Text>{formatCurrency(Number(payrollData.totals?.companyDebit ?? 0))}</Text>\n ),\n },\n {\n title: t('tableHeaders.debitAccount'),\n render: () => <Text>{bankAccount?.hiddenAccountNumber ?? ''}</Text>,\n },\n {\n title: t('tableHeaders.debitDate'),\n render: () => <Text>{dateFormatter.formatShortWithYear(expectedDebitDate)}</Text>,\n },\n {\n title: t('tableHeaders.employeesPayDate'),\n render: () => (\n <Text>{dateFormatter.formatShortWithYear(payrollData.checkDate)}</Text>\n ),\n },\n ]}\n data={[{}]}\n />\n {checkPaymentsCount > 0 && (\n <Alert\n status=\"warning\"\n label={t('alerts.checkPaymentWarning', { count: checkPaymentsCount })}\n >\n <Text>{t('alerts.checkPaymentWarningDescription')}</Text>\n </Alert>\n )}\n <Tabs\n onSelectionChange={setSelectedTab}\n selectedId={selectedTab}\n aria-label={t('dataViews.label')}\n tabs={tabs}\n />\n {isCancelDialogOpen && (\n <Dialog\n isOpen={isCancelDialogOpen}\n onClose={() => {\n setIsCancelDialogOpen(false)\n }}\n onPrimaryActionClick={onCancel}\n shouldCloseOnBackdropClick={true}\n primaryActionLabel={t('confirmCancelCta')}\n isDestructive={true}\n closeActionLabel={t('declineCancelCta')}\n title={t('cancelDialogTitle', {\n startDate: dateFormatter.formatLong(payrollData.payPeriod?.startDate),\n endDate: dateFormatter.formatLongWithYear(payrollData.payPeriod?.endDate),\n })}\n >\n <Flex gap={14} flexDirection=\"column\">\n <Text>{t('cancelDialogDescription')}</Text>\n <Text>\n {t('cancelDialogDescriptionDeadline', {\n deadline: dateFormatter.formatWithTime(payrollData.payrollDeadline).time,\n })}\n </Text>\n </Flex>\n </Dialog>\n )}\n </>\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["getPayrollOverviewTitle","payPeriod","dateFormatter","PayrollOverviewPresentation","onEdit","onSubmit","onCancel","onPayrollReceipt","onPaystubDownload","employeeDetails","payrollData","bankAccount","taxes","isSubmitting","isProcessed","alerts","Alert","Button","ButtonIcon","Dialog","Heading","Text","Tabs","LoadingSpinner","useComponentContext","useI18n","useDateFormatter","t","useTranslation","formatCurrency","useNumberFormatter","selectedTab","setSelectedTab","useState","isCancelDialogOpen","setIsCancelDialogOpen","LoadingIndicator","useLoadingIndicator","containerRef","useRef","isDesktop","useContainerBreakpoints","totalPayroll","calculateTotalPayroll","expectedDebitDate","getCompanyTaxes","employeeCompensation","acc","tax","getCompanyBenefits","benefit","getReimbursements","c","compensationTypeLabels","getCompanyCost","employeeMap","employee","getEmployeeHours","employeeCompensations","hourlyCompensation","name","currentHours","getEmployeePtoHours","paidTimeOff","checkPaymentsCount","comp","PAYMENT_METHODS","companyPaysColumns","jsx","firstLastName","DownloadIcon","tabs","DataView","jsxs","Fragment","job","flsaStatus","FlsaStatus","hours","deduction","Flex","taxKey","label","value","styles","FlexItem","Trans","alert","index"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAMA,KAA0B,CAC9BC,GACAC,MAEID,GAAW,aAAaA,EAAU,UAC7BC,EAAc,gBAAgBD,EAAU,WAAWA,EAAU,OAAO,IAEtE,EAAE,WAAW,IAAI,SAAS,GAAA,GAGtBE,KAA8B,CAAC;AAAA,EAC1C,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,aAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AACX,MAA4B;AAC1B,QAAM,EAAE,OAAAC,GAAO,QAAAC,GAAQ,YAAAC,GAAY,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,MAAAC,GAAM,gBAAAC,EAAA,IAC9DC,GAAA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,UAAA;AAAA,YAAA,gBAAAZ,EAAC/C,GAAA,EAAM,UAAAM,EAAE,yBAAyB,EAAA,CAAE;AAAA,YACpC,gBAAAyC,EAAC/C,GAAA,EACE,UAAAM,EAAE,mCAAmC;AAAA,cACpC,UAAUzB,EAAc,eAAeQ,EAAY,eAAe,EAAE;AAAA,YAAA,CACrE,EAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CAEJ;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayrollOverviewPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as y, useCallback as m, useEffect as S } from "react";
|
|
2
2
|
import { usePayrollsPrepareMutation as h } from "@gusto/embedded-api/react-query/payrollsPrepare";
|
|
3
3
|
import { usePaySchedulesGet as f } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
4
4
|
import "react/jsx-runtime";
|
|
@@ -10,17 +10,15 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import { useBase as b } from "../Base/useBase.js";
|
|
12
12
|
import "../../shared/constants.js";
|
|
13
|
-
import "classnames";
|
|
14
|
-
import "dompurify";
|
|
15
|
-
import "../../contexts/LocaleProvider/useLocale.js";
|
|
16
13
|
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
|
-
|
|
14
|
+
import "dompurify";
|
|
15
|
+
const H = ({
|
|
18
16
|
companyId: e,
|
|
19
17
|
payrollId: t,
|
|
20
18
|
employeeUuids: o,
|
|
21
19
|
sortBy: s
|
|
22
20
|
}) => {
|
|
23
|
-
const { mutateAsync: i, isPending: l } = h(), [r, d] =
|
|
21
|
+
const { mutateAsync: i, isPending: l } = h(), [r, d] = y(), { baseSubmitHandler: p } = b(), { data: u, isLoading: n } = f(
|
|
24
22
|
{
|
|
25
23
|
companyId: e,
|
|
26
24
|
payScheduleId: r?.payPeriod?.payScheduleUuid || ""
|
|
@@ -28,9 +26,9 @@ const O = ({
|
|
|
28
26
|
{
|
|
29
27
|
enabled: !!r?.payPeriod?.payScheduleUuid
|
|
30
28
|
}
|
|
31
|
-
), a =
|
|
29
|
+
), a = m(async () => {
|
|
32
30
|
await p(null, async () => {
|
|
33
|
-
const
|
|
31
|
+
const P = await i({
|
|
34
32
|
request: {
|
|
35
33
|
companyId: e,
|
|
36
34
|
payrollId: t,
|
|
@@ -40,7 +38,7 @@ const O = ({
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
|
-
d(
|
|
41
|
+
d(P.payrollPrepared);
|
|
44
42
|
});
|
|
45
43
|
}, [e, t, i, o, p]);
|
|
46
44
|
S(() => {
|
|
@@ -55,6 +53,6 @@ const O = ({
|
|
|
55
53
|
};
|
|
56
54
|
};
|
|
57
55
|
export {
|
|
58
|
-
|
|
56
|
+
H as usePreparedPayrollData
|
|
59
57
|
};
|
|
60
58
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;AAsBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAd;AAAA,MACA,eAAeO,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAJ;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAM,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACjB,GAAWC,GAAWG,GAAgBF,GAAeQ,CAAiB,CAAC;AAE3E,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { TextInput as m } from "../../../components/Common/UI/TextInput/TextInput.js";
|
|
3
3
|
import { NumberInput as t } from "../../../components/Common/UI/NumberInput/NumberInput.js";
|
|
4
4
|
import { CheckboxGroup as i } from "../../../components/Common/UI/CheckboxGroup/CheckboxGroup.js";
|
|
@@ -8,56 +8,60 @@ import { DatePicker as f } from "../../../components/Common/UI/DatePicker/DatePi
|
|
|
8
8
|
import { Radio as a } from "../../../components/Common/UI/Radio/Radio.js";
|
|
9
9
|
import { RadioGroup as n } from "../../../components/Common/UI/RadioGroup/RadioGroup.js";
|
|
10
10
|
import { Select as d } from "../../../components/Common/UI/Select/Select.js";
|
|
11
|
-
import { Switch as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { ButtonIcon as
|
|
11
|
+
import { Switch as s } from "../../../components/Common/UI/Switch/Switch.js";
|
|
12
|
+
import { Button as u } from "../../../components/Common/UI/Button/Button.js";
|
|
13
|
+
import { ButtonIcon as c } from "../../../components/Common/UI/Button/ButtonIcon.js";
|
|
14
14
|
import { Alert as b } from "../../../components/Common/UI/Alert/Alert.js";
|
|
15
|
-
import { Card as
|
|
16
|
-
import { Badge as
|
|
17
|
-
import { Link as
|
|
15
|
+
import { Card as l } from "../../../components/Common/UI/Card/Card.js";
|
|
16
|
+
import { Badge as x } from "../../../components/Common/UI/Badge/Badge.js";
|
|
17
|
+
import { Link as B } from "../../../components/Common/UI/Link/Link.js";
|
|
18
18
|
import { Menu as C } from "../../../components/Common/UI/Menu/Menu.js";
|
|
19
19
|
import { Table as g } from "../../../components/Common/UI/Table/Table.js";
|
|
20
|
-
import { OrderedList as
|
|
21
|
-
import { UnorderedList as
|
|
20
|
+
import { OrderedList as L } from "../../../components/Common/UI/List/OrderedList.js";
|
|
21
|
+
import { UnorderedList as k } from "../../../components/Common/UI/List/UnorderedList.js";
|
|
22
22
|
import { Heading as T } from "../../../components/Common/UI/Heading/Heading.js";
|
|
23
23
|
import { Text as h } from "../../../components/Common/UI/Text/Text.js";
|
|
24
|
-
import { CalendarPreview as
|
|
25
|
-
import { ProgressBar as
|
|
26
|
-
import { Breadcrumbs as
|
|
27
|
-
import { Tabs as
|
|
28
|
-
import { Dialog as
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
24
|
+
import { CalendarPreview as D } from "../../../components/Common/UI/CalendarPreview/CalendarPreview.js";
|
|
25
|
+
import { ProgressBar as I } from "../../../components/Common/UI/ProgressBar/ProgressBar.js";
|
|
26
|
+
import { Breadcrumbs as P } from "../../../components/Common/UI/Breadcrumbs/Breadcrumbs.js";
|
|
27
|
+
import { Tabs as S } from "../../../components/Common/UI/Tabs/Tabs.js";
|
|
28
|
+
import { Dialog as w } from "../../../components/Common/UI/Dialog/Dialog.js";
|
|
29
|
+
import { Modal as G } from "../../../components/Common/UI/Modal/Modal.js";
|
|
30
|
+
import { LoadingSpinner as M } from "../../../components/Common/UI/LoadingSpinner/LoadingSpinner.js";
|
|
31
|
+
import { DescriptionList as R } from "../../../components/Common/UI/DescriptionList/DescriptionList.js";
|
|
32
|
+
const no = {
|
|
33
|
+
Alert: (o) => /* @__PURE__ */ r(b, { ...o }),
|
|
34
|
+
Badge: (o) => /* @__PURE__ */ r(x, { ...o }),
|
|
35
|
+
Button: (o) => /* @__PURE__ */ r(u, { ...o }),
|
|
36
|
+
ButtonIcon: (o) => /* @__PURE__ */ r(c, { ...o }),
|
|
37
|
+
Card: (o) => /* @__PURE__ */ r(l, { ...o }),
|
|
38
|
+
TextInput: (o) => /* @__PURE__ */ r(m, { ...o }),
|
|
39
|
+
Checkbox: (o) => /* @__PURE__ */ r(p, { ...o }),
|
|
40
|
+
CheckboxGroup: (o) => /* @__PURE__ */ r(i, { ...o }),
|
|
41
|
+
ComboBox: (o) => /* @__PURE__ */ r(e, { ...o }),
|
|
42
|
+
DatePicker: (o) => /* @__PURE__ */ r(f, { ...o }),
|
|
43
|
+
OrderedList: (o) => /* @__PURE__ */ r(L, { ...o }),
|
|
44
|
+
UnorderedList: (o) => /* @__PURE__ */ r(k, { ...o }),
|
|
45
|
+
NumberInput: (o) => /* @__PURE__ */ r(t, { ...o }),
|
|
46
|
+
Radio: (o) => /* @__PURE__ */ r(a, { ...o }),
|
|
47
|
+
RadioGroup: (o) => /* @__PURE__ */ r(n, { ...o }),
|
|
48
|
+
Select: (o) => /* @__PURE__ */ r(d, { ...o }),
|
|
49
|
+
Switch: (o) => /* @__PURE__ */ r(s, { ...o }),
|
|
50
|
+
Link: (o) => /* @__PURE__ */ r(B, { ...o }),
|
|
51
|
+
Menu: (o) => /* @__PURE__ */ r(C, { ...o }),
|
|
52
|
+
Table: (o) => /* @__PURE__ */ r(g, { ...o }),
|
|
53
|
+
Heading: (o) => /* @__PURE__ */ r(T, { ...o }),
|
|
54
|
+
Text: (o) => /* @__PURE__ */ r(h, { ...o }),
|
|
55
|
+
CalendarPreview: (o) => /* @__PURE__ */ r(D, { ...o }),
|
|
56
|
+
ProgressBar: (o) => /* @__PURE__ */ r(I, { ...o }),
|
|
57
|
+
Breadcrumbs: (o) => /* @__PURE__ */ r(P, { ...o }),
|
|
58
|
+
Tabs: (o) => /* @__PURE__ */ r(S, { ...o }),
|
|
59
|
+
Dialog: (o) => /* @__PURE__ */ r(w, { ...o }),
|
|
60
|
+
Modal: (o) => /* @__PURE__ */ r(G, { ...o }),
|
|
61
|
+
LoadingSpinner: (o) => /* @__PURE__ */ r(M, { ...o }),
|
|
62
|
+
DescriptionList: (o) => /* @__PURE__ */ r(R, { ...o })
|
|
59
63
|
};
|
|
60
64
|
export {
|
|
61
|
-
|
|
65
|
+
no as defaultComponents
|
|
62
66
|
};
|
|
63
67
|
//# sourceMappingURL=defaultComponentAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs'\nimport { Breadcrumbs } from '@/components/Common/UI/Breadcrumbs'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinner } from '@/components/Common/UI/LoadingSpinner'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Breadcrumbs: (props: BreadcrumbsProps) => <Breadcrumbs {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n LoadingSpinner: (props: LoadingSpinnerProps) => <LoadingSpinner {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Breadcrumbs","Tabs","Dialog","LoadingSpinner"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs'\nimport { Breadcrumbs } from '@/components/Common/UI/Breadcrumbs'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\nimport type { ModalProps } from '@/components/Common/UI/Modal/ModalTypes'\nimport { Modal } from '@/components/Common/UI/Modal'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinner } from '@/components/Common/UI/LoadingSpinner'\nimport type { DescriptionListProps } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\nimport { DescriptionList } from '@/components/Common/UI/DescriptionList'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Breadcrumbs: (props: BreadcrumbsProps) => <Breadcrumbs {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n Modal: (props: ModalProps) => <Modal {...props} />,\n LoadingSpinner: (props: LoadingSpinnerProps) => <LoadingSpinner {...props} />,\n DescriptionList: (props: DescriptionListProps) => <DescriptionList {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Breadcrumbs","Tabs","Dialog","Modal","LoadingSpinner","DescriptionList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DO,MAAMA,KAA2C;AAAA,EACtD,OAAO,CAACC,MAAsB,gBAAAC,EAACC,GAAA,EAAO,GAAGF,GAAO;AAAA,EAChD,OAAO,CAACA,MAAsB,gBAAAC,EAACE,GAAA,EAAO,GAAGH,GAAO;AAAA,EAChD,QAAQ,CAACA,MAAuB,gBAAAC,EAACG,GAAA,EAAQ,GAAGJ,GAAO;AAAA,EACnD,YAAY,CAACA,MAA2B,gBAAAC,EAACI,GAAA,EAAY,GAAGL,GAAO;AAAA,EAC/D,MAAM,CAACA,MAAqB,gBAAAC,EAACK,GAAA,EAAM,GAAGN,GAAO;AAAA,EAC7C,WAAW,CAACA,MAA0B,gBAAAC,EAACM,GAAA,EAAW,GAAGP,GAAO;AAAA,EAC5D,UAAU,CAACA,MAAyB,gBAAAC,EAACO,GAAA,EAAU,GAAGR,GAAO;AAAA,EACzD,eAAe,CAACA,MAA8B,gBAAAC,EAACQ,GAAA,EAAe,GAAGT,GAAO;AAAA,EACxE,UAAU,CAACA,MAAyB,gBAAAC,EAACS,GAAA,EAAU,GAAGV,GAAO;AAAA,EACzD,YAAY,CAACA,MAA2B,gBAA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AQ,CAACA,MAAuB,gBAAAC,EAAC2B,GAAA,EAAQ,GAAG5B,GAAO;AAAA,EACnD,OAAO,CAACA,MAAsB,gBAAAC,EAAC4B,GAAA,EAAO,GAAG7B,GAAO;AAAA,EAChD,gBAAgB,CAACA,MAA+B,gBAAAC,EAAC6B,GAAA,EAAgB,GAAG9B,GAAO;AAAA,EAC3E,iBAAiB,CAACA,MAAgC,gBAAAC,EAAC8B,GAAA,EAAiB,GAAG/B,EAAA,CAAO;AAChF;"}
|
|
@@ -23,3 +23,5 @@ export type { PaginationControlProps } from '../../components/Common/PaginationC
|
|
|
23
23
|
export type { TextProps } from '../../components/Common/UI/Text/TextTypes';
|
|
24
24
|
export type { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview/CalendarPreviewTypes';
|
|
25
25
|
export type { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
26
|
+
export type { ModalProps } from '../../components/Common/UI/Modal/ModalTypes';
|
|
27
|
+
export type { DescriptionListProps } from '../../components/Common/UI/DescriptionList/DescriptionListTypes';
|
|
@@ -25,7 +25,9 @@ import { ProgressBarProps } from '../../components/Common/UI/ProgressBar/Progres
|
|
|
25
25
|
import { BreadcrumbsProps } from '../../components/Common/UI/Breadcrumbs/BreadcrumbsTypes';
|
|
26
26
|
import { TabsProps } from '../../components/Common/UI/Tabs/TabsTypes';
|
|
27
27
|
import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
28
|
+
import { ModalProps } from '../../components/Common/UI/Modal/ModalTypes';
|
|
28
29
|
import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
|
|
30
|
+
import { DescriptionListProps } from '../../components/Common/UI/DescriptionList/DescriptionListTypes';
|
|
29
31
|
export interface ComponentsContextType {
|
|
30
32
|
Alert: (props: AlertProps) => JSX.Element | null;
|
|
31
33
|
Badge: (props: BadgeProps) => JSX.Element | null;
|
|
@@ -55,7 +57,9 @@ export interface ComponentsContextType {
|
|
|
55
57
|
Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element | null;
|
|
56
58
|
Tabs: (props: TabsProps) => JSX.Element | null;
|
|
57
59
|
Dialog: (props: DialogProps) => JSX.Element | null;
|
|
60
|
+
Modal: (props: ModalProps) => JSX.Element | null;
|
|
58
61
|
LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null;
|
|
62
|
+
DescriptionList: (props: DescriptionListProps) => JSX.Element | null;
|
|
59
63
|
}
|
|
60
64
|
export declare const ComponentsContext: import('react').Context<ComponentsContextType | null>;
|
|
61
65
|
export declare const useComponentContext: () => ComponentsContextType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs/BreadcrumbsTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs/BreadcrumbsTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { ModalProps } from '@/components/Common/UI/Modal/ModalTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport type { DescriptionListProps } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n Modal: (props: ModalProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n DescriptionList: (props: DescriptionListProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";AAkEO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
|
|
@@ -7,20 +7,18 @@ import { createComponents as C } from "../ComponentAdapter/createComponentsWithD
|
|
|
7
7
|
import { ApiProvider as I } from "../ApiProvider/ApiProvider.js";
|
|
8
8
|
import { LoadingIndicatorProvider as x } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
|
|
9
9
|
import { SDKI18next as t } from "./SDKI18next.js";
|
|
10
|
-
import "classnames";
|
|
11
10
|
import { InternalError as y } from "../../components/Common/InternalError/InternalError.js";
|
|
12
11
|
import { LocaleProvider as L } from "../LocaleProvider/LocaleProvider.js";
|
|
13
|
-
import "../LocaleProvider/useLocale.js";
|
|
14
12
|
import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
|
|
15
|
-
const
|
|
13
|
+
const R = (a) => {
|
|
16
14
|
const {
|
|
17
15
|
children: c,
|
|
18
16
|
config: e,
|
|
19
17
|
dictionary: o,
|
|
20
18
|
lng: n = "en",
|
|
21
19
|
locale: d = "en-US",
|
|
22
|
-
currency:
|
|
23
|
-
theme:
|
|
20
|
+
currency: l = "USD",
|
|
21
|
+
theme: p,
|
|
24
22
|
components: s,
|
|
25
23
|
LoaderComponent: f
|
|
26
24
|
} = a;
|
|
@@ -38,9 +36,9 @@ const q = (a) => {
|
|
|
38
36
|
}
|
|
39
37
|
return g(() => {
|
|
40
38
|
(async () => await t.changeLanguage(n))();
|
|
41
|
-
}, [n]), /* @__PURE__ */ r(P, { value: C(s), children: /* @__PURE__ */ r(x, { value: f, children: /* @__PURE__ */ r(h, { FallbackComponent: y, children: /* @__PURE__ */ r(U, { theme:
|
|
39
|
+
}, [n]), /* @__PURE__ */ r(P, { value: C(s), children: /* @__PURE__ */ r(x, { value: f, children: /* @__PURE__ */ r(h, { FallbackComponent: y, children: /* @__PURE__ */ r(U, { theme: p, children: /* @__PURE__ */ r(L, { locale: d, currency: l, children: /* @__PURE__ */ r(v, { i18n: t, children: /* @__PURE__ */ r(I, { url: e.baseUrl, headers: e.headers, hooks: e.hooks, children: c }) }, n) }) }) }) }) });
|
|
42
40
|
};
|
|
43
41
|
export {
|
|
44
|
-
|
|
42
|
+
R as GustoProviderCustomUIAdapter
|
|
45
43
|
};
|
|
46
44
|
//# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={createComponents(components)}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider url={config.baseUrl} headers={config.headers} hooks={config.hooks}>\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={createComponents(components)}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider url={config.baseUrl} headers={config.headers} hooks={config.hooks}>\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;AA4CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACb,iBAAWE,KAAMT,EAAWQ,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeT,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,qBAGLW,GAAA,EAAmB,OAAOC,EAAiBR,CAAU,GACpD,4BAACS,GAAA,EAAyB,OAAOR,GAC/B,UAAA,gBAAAS,EAACC,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAF,EAACG,KAAc,OAAAd,GACb,UAAA,gBAAAW,EAACI,KAAe,QAAAjB,GAAgB,UAAAC,GAC9B,4BAACiB,GAAA,EAAgB,MAAMV,GACrB,UAAA,gBAAAK,EAACM,GAAA,EAAY,KAAKtB,EAAO,SAAS,SAASA,EAAO,SAAS,OAAOA,EAAO,OACtE,UAAAD,GACH,EAAA,GAHsCG,CAIxC,GACF,EAAA,CACF,GACF,GACF,EAAA,CACF;AAEJ;"}
|