@remoteoss/remote-flows 0.25.0 → 0.27.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/dist/{ZendeskTriggerButton-FSCvhzTG.d.ts → ZendeskTriggerButton-DIV8pCPo.d.ts} +2 -1
- package/dist/{chunk-I3PGODII.js → chunk-4ZGIL6OE.js} +2 -2
- package/dist/{chunk-22JG4IMF.js → chunk-5NPET4ZO.js} +2 -2
- package/dist/chunk-6IL4TB7S.js +2 -0
- package/dist/chunk-6IL4TB7S.js.map +1 -0
- package/dist/chunk-746ELT2W.js +2 -0
- package/dist/chunk-746ELT2W.js.map +1 -0
- package/dist/chunk-7VOQAVM4.js +2 -0
- package/dist/chunk-7VOQAVM4.js.map +1 -0
- package/dist/{chunk-VVF4IZES.js → chunk-7Y46DL2U.js} +2 -2
- package/dist/{chunk-NWEXPORY.js → chunk-A2SWQS2N.js} +2 -2
- package/dist/chunk-ANQ4HVVK.js +2 -0
- package/dist/chunk-ANQ4HVVK.js.map +1 -0
- package/dist/{chunk-I52UTPHD.js → chunk-AYLYOLVG.js} +2 -2
- package/dist/{chunk-YU3JIZ7J.js → chunk-BO6OKTIG.js} +2 -2
- package/dist/{chunk-PHBQMNG3.js → chunk-CVIWZYO3.js} +2 -2
- package/dist/chunk-CYPGWEOO.js +2 -0
- package/dist/chunk-CYPGWEOO.js.map +1 -0
- package/dist/{chunk-2M7EBC4K.js → chunk-DZ67OJVF.js} +2 -2
- package/dist/{chunk-VUP76ZMQ.js → chunk-E3JFQ7PH.js} +2 -2
- package/dist/{chunk-W5BJQRNM.js → chunk-E6OBNWMU.js} +2 -2
- package/dist/chunk-EHAZWZ3O.js +2 -0
- package/dist/chunk-EHAZWZ3O.js.map +1 -0
- package/dist/{chunk-M6G27EJN.js → chunk-FEHSJUZJ.js} +2 -2
- package/dist/{chunk-4JVXDB5G.js → chunk-GD5556B2.js} +2 -2
- package/dist/chunk-IWA5B4U6.js +2 -0
- package/dist/chunk-IWA5B4U6.js.map +1 -0
- package/dist/chunk-JTOLQCOG.js +2 -0
- package/dist/chunk-JTOLQCOG.js.map +1 -0
- package/dist/chunk-KDUM4EZJ.js +2 -0
- package/dist/chunk-KDUM4EZJ.js.map +1 -0
- package/dist/{chunk-Q3A4A2HL.js → chunk-KOIHMAAP.js} +2 -2
- package/dist/{chunk-EJ4COVQQ.js → chunk-L6FZRTSN.js} +2 -2
- package/dist/{chunk-4IXRU67S.js → chunk-LDJT7TII.js} +2 -2
- package/dist/chunk-LMYJ6V44.js +2 -0
- package/dist/chunk-LMYJ6V44.js.map +1 -0
- package/dist/{chunk-S2KE2JLJ.js → chunk-LRNSFLHR.js} +2 -2
- package/dist/{chunk-AU6AILO2.js → chunk-N3EIN72T.js} +2 -2
- package/dist/{chunk-CT2ROVBF.js → chunk-NRW33IP5.js} +2 -2
- package/dist/{chunk-QEWB24WT.js → chunk-OXCEJQFC.js} +2 -2
- package/dist/{chunk-OCNL6L4L.js → chunk-PFT7KJ65.js} +2 -2
- package/dist/{chunk-RNJWBKLA.js → chunk-QLNFHOLH.js} +2 -2
- package/dist/{chunk-RDGF4PBB.js → chunk-R3LY6TV5.js} +2 -2
- package/dist/chunk-R645TMO5.js +2 -0
- package/dist/{chunk-2TADRH4W.js.map → chunk-R645TMO5.js.map} +1 -1
- package/dist/{chunk-BGXVK7HL.js → chunk-R64X3EJF.js} +2 -2
- package/dist/{chunk-JHPCP2ZX.js → chunk-RAHCZTQ3.js} +2 -2
- package/dist/{chunk-BLZW25OE.js → chunk-SA74WAVS.js} +2 -2
- package/dist/{chunk-P4ZSYIA4.js → chunk-SB3IYODL.js} +2 -2
- package/dist/chunk-SGE4DLC3.js +2 -0
- package/dist/chunk-SGE4DLC3.js.map +1 -0
- package/dist/chunk-SLMJEZJ7.js +2 -0
- package/dist/chunk-SLMJEZJ7.js.map +1 -0
- package/dist/{chunk-7KNNJBO6.js → chunk-TUFTB5UD.js} +2 -2
- package/dist/chunk-UFBTCHEI.js +2 -0
- package/dist/{chunk-IUZ7DEXC.js.map → chunk-UFBTCHEI.js.map} +1 -1
- package/dist/{chunk-UUZ353RX.js → chunk-VLLLNIMN.js} +2 -2
- package/dist/chunk-VM2DQCZO.js +2 -0
- package/dist/chunk-VM2DQCZO.js.map +1 -0
- package/dist/chunk-W55MUSAS.js +2 -0
- package/dist/{chunk-NVYMAOQ7.js.map → chunk-W55MUSAS.js.map} +1 -1
- package/dist/chunk-WLBRCGTG.js +2 -0
- package/dist/{chunk-QKLIYOMA.js.map → chunk-WLBRCGTG.js.map} +1 -1
- package/dist/{chunk-HCZWP44I.js → chunk-WNTOQYRY.js} +2 -2
- package/dist/{chunk-T5LZSTW3.js → chunk-WZAWPSKS.js} +2 -2
- package/dist/{chunk-46JFDBPC.js → chunk-XP7UEI56.js} +2 -2
- package/dist/{chunk-LHSNAVGR.js → chunk-YXWBSRKS.js} +2 -2
- package/dist/{chunk-KH5SAWNH.js → chunk-ZIPHLBX4.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +2 -2
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +3 -3
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +3 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +4 -4
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.d.ts +4 -4
- package/dist/flows/Onboarding/index.d.ts +4 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +4 -4
- package/dist/flows/Onboarding/utils.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.d.ts +10 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.d.ts +11 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.d.ts +18 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.d.ts +12 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.d.ts +11 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.js +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.js.map +1 -0
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +16 -3
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +16 -3
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +16 -2
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +4 -4
- package/dist/flows/Termination/hooks.d.ts +4 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +15 -5
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +17 -0
- package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +17 -0
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +4 -4
- package/dist/flows/api.d.ts +4 -4
- package/dist/flows/api.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +60 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +1 -1
- package/dist/{mutations-DaNL3KJH.d.ts → mutations-C0KsEf83.d.ts} +1 -1
- package/dist/{remoteFlows-R6i-5uxZ.d.ts → remoteFlows-DJcvCgN2.d.ts} +19 -2
- package/dist/{types-CUuFeuNj.d.ts → types-1tGveWWg.d.ts} +3 -3
- package/dist/{types-ClV6M7ry.d.ts → types-CwUhT-vz.d.ts} +37 -18
- package/dist/{types-D_DohAP5.d.ts → types-Dad_rgYV.d.ts} +2 -2
- package/dist/{types-BSmXaqyP.d.ts → types-DegHPy8Q.d.ts} +4 -4
- package/dist/{types.gen-BMxrLsCq.d.ts → types.gen-B73oMrmZ.d.ts} +1 -14
- package/package.json +1 -1
- package/dist/chunk-2TADRH4W.js +0 -2
- package/dist/chunk-32GSS4UM.js +0 -2
- package/dist/chunk-32GSS4UM.js.map +0 -1
- package/dist/chunk-347YWDTK.js +0 -2
- package/dist/chunk-347YWDTK.js.map +0 -1
- package/dist/chunk-3AEKPMIN.js +0 -2
- package/dist/chunk-3AEKPMIN.js.map +0 -1
- package/dist/chunk-4O4VBGMD.js +0 -2
- package/dist/chunk-4O4VBGMD.js.map +0 -1
- package/dist/chunk-EZWZMPD2.js +0 -2
- package/dist/chunk-EZWZMPD2.js.map +0 -1
- package/dist/chunk-IUZ7DEXC.js +0 -2
- package/dist/chunk-MP2T74PU.js +0 -2
- package/dist/chunk-MP2T74PU.js.map +0 -1
- package/dist/chunk-NVYMAOQ7.js +0 -2
- package/dist/chunk-O7REUCKR.js +0 -2
- package/dist/chunk-O7REUCKR.js.map +0 -1
- package/dist/chunk-QKLIYOMA.js +0 -2
- package/dist/chunk-REDYWUCC.js +0 -2
- package/dist/chunk-REDYWUCC.js.map +0 -1
- package/dist/chunk-XSHHMBMT.js +0 -2
- package/dist/chunk-XSHHMBMT.js.map +0 -1
- /package/dist/{chunk-I3PGODII.js.map → chunk-4ZGIL6OE.js.map} +0 -0
- /package/dist/{chunk-22JG4IMF.js.map → chunk-5NPET4ZO.js.map} +0 -0
- /package/dist/{chunk-VVF4IZES.js.map → chunk-7Y46DL2U.js.map} +0 -0
- /package/dist/{chunk-NWEXPORY.js.map → chunk-A2SWQS2N.js.map} +0 -0
- /package/dist/{chunk-I52UTPHD.js.map → chunk-AYLYOLVG.js.map} +0 -0
- /package/dist/{chunk-YU3JIZ7J.js.map → chunk-BO6OKTIG.js.map} +0 -0
- /package/dist/{chunk-PHBQMNG3.js.map → chunk-CVIWZYO3.js.map} +0 -0
- /package/dist/{chunk-2M7EBC4K.js.map → chunk-DZ67OJVF.js.map} +0 -0
- /package/dist/{chunk-VUP76ZMQ.js.map → chunk-E3JFQ7PH.js.map} +0 -0
- /package/dist/{chunk-W5BJQRNM.js.map → chunk-E6OBNWMU.js.map} +0 -0
- /package/dist/{chunk-M6G27EJN.js.map → chunk-FEHSJUZJ.js.map} +0 -0
- /package/dist/{chunk-4JVXDB5G.js.map → chunk-GD5556B2.js.map} +0 -0
- /package/dist/{chunk-Q3A4A2HL.js.map → chunk-KOIHMAAP.js.map} +0 -0
- /package/dist/{chunk-EJ4COVQQ.js.map → chunk-L6FZRTSN.js.map} +0 -0
- /package/dist/{chunk-4IXRU67S.js.map → chunk-LDJT7TII.js.map} +0 -0
- /package/dist/{chunk-S2KE2JLJ.js.map → chunk-LRNSFLHR.js.map} +0 -0
- /package/dist/{chunk-AU6AILO2.js.map → chunk-N3EIN72T.js.map} +0 -0
- /package/dist/{chunk-CT2ROVBF.js.map → chunk-NRW33IP5.js.map} +0 -0
- /package/dist/{chunk-QEWB24WT.js.map → chunk-OXCEJQFC.js.map} +0 -0
- /package/dist/{chunk-OCNL6L4L.js.map → chunk-PFT7KJ65.js.map} +0 -0
- /package/dist/{chunk-RNJWBKLA.js.map → chunk-QLNFHOLH.js.map} +0 -0
- /package/dist/{chunk-RDGF4PBB.js.map → chunk-R3LY6TV5.js.map} +0 -0
- /package/dist/{chunk-BGXVK7HL.js.map → chunk-R64X3EJF.js.map} +0 -0
- /package/dist/{chunk-JHPCP2ZX.js.map → chunk-RAHCZTQ3.js.map} +0 -0
- /package/dist/{chunk-BLZW25OE.js.map → chunk-SA74WAVS.js.map} +0 -0
- /package/dist/{chunk-P4ZSYIA4.js.map → chunk-SB3IYODL.js.map} +0 -0
- /package/dist/{chunk-7KNNJBO6.js.map → chunk-TUFTB5UD.js.map} +0 -0
- /package/dist/{chunk-UUZ353RX.js.map → chunk-VLLLNIMN.js.map} +0 -0
- /package/dist/{chunk-HCZWP44I.js.map → chunk-WNTOQYRY.js.map} +0 -0
- /package/dist/{chunk-T5LZSTW3.js.map → chunk-WZAWPSKS.js.map} +0 -0
- /package/dist/{chunk-46JFDBPC.js.map → chunk-XP7UEI56.js.map} +0 -0
- /package/dist/{chunk-LHSNAVGR.js.map → chunk-YXWBSRKS.js.map} +0 -0
- /package/dist/{chunk-KH5SAWNH.js.map → chunk-ZIPHLBX4.js.map} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"uuHAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,CAJS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,EAACW,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQF,EAAgB,OAAQ,EAClE,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,GAAA,4BAsBF,SAASU,GAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
1
|
+
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresI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B,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Z as ZendeskTriggerButton, c as cn } from './ZendeskTriggerButton-
|
|
1
|
+
export { Z as ZendeskTriggerButton, c as cn } from './ZendeskTriggerButton-DIV8pCPo.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
package/dist/internals.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as j,b as m,c as n,d as o,f as p,g as q,h as r,i as s,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E}from"./chunk-D6X2WCEG.js";import{a as t,b as u}from"./chunk-HPHWQU34.js";import{
|
|
1
|
+
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as j,b as m,c as n,d as o,f as p,g as q,h as r,i as s,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E}from"./chunk-D6X2WCEG.js";import{a as t,b as u}from"./chunk-HPHWQU34.js";import{b as i}from"./chunk-ANQ4HVVK.js";import{a as c}from"./chunk-PD24XKD6.js";import{a as d,b as e,d as f,e as g,f as h}from"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-3O3Q24JL.js";import{a as k,b as l}from"./chunk-WVDTHFGS.js";import"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-MQ6F5LE4.js";import{a}from"./chunk-43WMZDDH.js";import"./chunk-P37U34EQ.js";export{C as Alert,E as AlertDescription,D as AlertTitle,u as Badge,l as Button,G as Card,K as CardContent,J as CardDescription,L as CardFooter,H as CardHeader,I as CardTitle,j as Checkbox,Q as Collapsible,S as CollapsibleContent,R as CollapsibleTrigger,v as Dialog,x as DialogContent,B as DialogDescription,z as DialogFooter,y as DialogHeader,A as DialogTitle,w as DialogTrigger,d as Drawer,f as DrawerContent,g as DrawerHeader,h as DrawerTitle,e as DrawerTrigger,c as Input,b as Label,m as RadioGroup,n as RadioGroupItem,F as ScrollArea,o as Select,r as SelectContent,s as SelectItem,q as SelectTrigger,p as SelectValue,M as Tabs,P as TabsContent,N as TabsList,O as TabsTrigger,i as ZendeskTriggerButton,t as badgeVariants,k as buttonVariants,a as cn};
|
|
2
2
|
//# sourceMappingURL=internals.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
2
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import React__default, { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { AnySchema } from 'yup';
|
|
4
|
-
import {
|
|
4
|
+
import { Z as HelpCenterArticle } from './types.gen-B73oMrmZ.js';
|
|
5
5
|
import { S as SupportedTypes } from './types-Zg1n_9wh.js';
|
|
6
6
|
|
|
7
7
|
type ThemeProviderProps = PropsWithChildren<{
|
|
@@ -40,6 +40,14 @@ declare const ENVIRONMENTS: {
|
|
|
40
40
|
staging: string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type ColumnDef<T = $TSFixMe> = {
|
|
44
|
+
id: keyof T;
|
|
45
|
+
label: React__default.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
cellClassName?: string;
|
|
48
|
+
render?: (value: $TSFixMe, row: T, index: number) => React__default.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
43
51
|
type AuthResponse = {
|
|
44
52
|
accessToken: string;
|
|
45
53
|
expiresIn: number;
|
|
@@ -75,6 +83,13 @@ type JSFField = {
|
|
|
75
83
|
multiple?: boolean;
|
|
76
84
|
meta?: Record<string, unknown>;
|
|
77
85
|
};
|
|
86
|
+
type TableComponentProps<T = $TSFixMe> = {
|
|
87
|
+
data: T[] | undefined;
|
|
88
|
+
columns: ColumnDef<T>[];
|
|
89
|
+
className?: string;
|
|
90
|
+
headerRowClassName?: string;
|
|
91
|
+
bodyRowClassName?: string | ((row: T, index: number) => string);
|
|
92
|
+
};
|
|
78
93
|
/**
|
|
79
94
|
* Props for custom field components.
|
|
80
95
|
* All custom field components receive these three props from React Hook Form's Controller.
|
|
@@ -135,6 +150,7 @@ type DrawerComponentProps = {
|
|
|
135
150
|
title: React.ReactNode;
|
|
136
151
|
trigger: React.ReactElement;
|
|
137
152
|
children?: React.ReactNode;
|
|
153
|
+
direction?: 'left' | 'right';
|
|
138
154
|
};
|
|
139
155
|
type FieldSetToggleComponentProps = {
|
|
140
156
|
isExpanded: boolean;
|
|
@@ -153,6 +169,7 @@ type Components = {
|
|
|
153
169
|
fieldsetToggle?: React.ComponentType<FieldSetToggleComponentProps>;
|
|
154
170
|
zendeskDrawer?: React.ComponentType<ZendeskDrawerComponentProps>;
|
|
155
171
|
drawer?: React.ComponentType<DrawerComponentProps>;
|
|
172
|
+
table?: React.ComponentType<TableComponentProps>;
|
|
156
173
|
};
|
|
157
174
|
type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
158
175
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as EmploymentCreationResponse, z as EmploymentResponse, S as SuccessResponse, x as PostCreateEmployment2Error, A as PatchUpdateEmployment2Error, D as PutUpdateBenefitOfferError, E as Employment$1, y as EmploymentCreateParams } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { OnboardingBack } from './flows/Onboarding/components/OnboardingBack.js';
|
|
4
4
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
5
|
-
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-C0KsEf83.js';
|
|
6
6
|
import { OnboardingSubmit } from './flows/Onboarding/components/OnboardingSubmit.js';
|
|
7
|
-
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-
|
|
7
|
+
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-DJcvCgN2.js';
|
|
8
8
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
9
9
|
import * as React$1 from 'react';
|
|
10
10
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { E as
|
|
1
|
+
import { E as Employment, T as ListTimeoffResponse, W as TimeoffStatus, X as TimeoffType, Y as ListLeavePoliciesSummaryResponse } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
4
4
|
import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
|
|
5
|
+
import { E as Employment$1 } from './types-1tGveWWg.js';
|
|
6
|
+
|
|
7
|
+
type DaysAndHours = {
|
|
8
|
+
hours: number;
|
|
9
|
+
days: number;
|
|
10
|
+
};
|
|
5
11
|
|
|
6
12
|
type UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;
|
|
7
13
|
/**
|
|
@@ -11,7 +17,9 @@ type UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;
|
|
|
11
17
|
* @param {string} params.employmentId - The ID of the employment to fetch details for.
|
|
12
18
|
* @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.
|
|
13
19
|
*/
|
|
14
|
-
declare const useEmploymentQuery: ({ employmentId }: UseEmployment) => _tanstack_react_query.UseQueryResult<
|
|
20
|
+
declare const useEmploymentQuery: ({ employmentId }: UseEmployment) => _tanstack_react_query.UseQueryResult<(Employment & {
|
|
21
|
+
termination_date?: string | null;
|
|
22
|
+
}) | undefined, Error>;
|
|
15
23
|
/**
|
|
16
24
|
* Hook to retrieve time off data for a specific employment.
|
|
17
25
|
*
|
|
@@ -55,8 +63,8 @@ declare const usePaidTimeoffBreakdownQuery: ({ employmentId, options, }: {
|
|
|
55
63
|
};
|
|
56
64
|
}) => _tanstack_react_query.UseQueryResult<PaidTimeoffBreakdownResponse, Error>;
|
|
57
65
|
type BookedTimeoffBeforeDateResponse = {
|
|
58
|
-
bookedDaysBeforeTermination:
|
|
59
|
-
bookedDaysAfterTermination:
|
|
66
|
+
bookedDaysBeforeTermination: DaysAndHours;
|
|
67
|
+
bookedDaysAfterTermination: DaysAndHours;
|
|
60
68
|
};
|
|
61
69
|
/**
|
|
62
70
|
* Hook to retrieve booked time off data before and after a specific date for a specific employment.
|
|
@@ -66,7 +74,7 @@ type BookedTimeoffBeforeDateResponse = {
|
|
|
66
74
|
* @param {string} [params.date] - The date to fetch booked time off data for.
|
|
67
75
|
* @returns {BookedTimeoffBeforeDateResponse} - The booked time off data before and after the specific date.
|
|
68
76
|
*
|
|
69
|
-
* This
|
|
77
|
+
* This hook accounts for partial days and multiple timeoff_days per request.
|
|
70
78
|
*/
|
|
71
79
|
declare const useBookedTimeoffBeforeAndAfterTerminationQuery: ({ employmentId, date, options, }: {
|
|
72
80
|
employmentId: string;
|
|
@@ -76,12 +84,14 @@ declare const useBookedTimeoffBeforeAndAfterTerminationQuery: ({ employmentId, d
|
|
|
76
84
|
};
|
|
77
85
|
}) => _tanstack_react_query.UseQueryResult<BookedTimeoffBeforeDateResponse, Error>;
|
|
78
86
|
type SummaryTimeOffDataResponse = {
|
|
79
|
-
entitledDays:
|
|
80
|
-
bookedDays:
|
|
81
|
-
usedDays:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
entitledDays: string;
|
|
88
|
+
bookedDays: string;
|
|
89
|
+
usedDays: string;
|
|
90
|
+
currentEntitlementDays: string;
|
|
91
|
+
approvedDaysBeforeTermination: string;
|
|
92
|
+
approvedDaysAfterTermination: string;
|
|
93
|
+
remainingDays: string;
|
|
94
|
+
isUnlimitedPto: boolean;
|
|
85
95
|
};
|
|
86
96
|
/**
|
|
87
97
|
* Hook to retrieve summary time off data for a specific employment.
|
|
@@ -94,17 +104,20 @@ type SummaryTimeOffDataResponse = {
|
|
|
94
104
|
* This hook doesn't take into account unlimited time off or half days yet.
|
|
95
105
|
*
|
|
96
106
|
*/
|
|
97
|
-
declare const useSummaryTimeOffDataQuery: ({ employmentId, proposedTerminationDate, }: {
|
|
107
|
+
declare const useSummaryTimeOffDataQuery: ({ employmentId, proposedTerminationDate, employment, }: {
|
|
98
108
|
employmentId: string;
|
|
99
109
|
proposedTerminationDate: string;
|
|
110
|
+
employment?: Employment$1;
|
|
100
111
|
}) => {
|
|
101
112
|
data: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
isUnlimitedPto: boolean;
|
|
114
|
+
entitledDays: string;
|
|
115
|
+
bookedDays: string;
|
|
116
|
+
usedDays: string;
|
|
117
|
+
currentEntitlementDays: string;
|
|
118
|
+
approvedDaysBeforeTermination: string;
|
|
119
|
+
approvedDaysAfterTermination: string;
|
|
120
|
+
remainingDays: string;
|
|
108
121
|
};
|
|
109
122
|
isLoading: boolean;
|
|
110
123
|
isError: boolean;
|
|
@@ -168,8 +181,14 @@ type PaidTimeOffRenderProps = {
|
|
|
168
181
|
isError: boolean;
|
|
169
182
|
error: Error | null;
|
|
170
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* The employment data.
|
|
186
|
+
* @see {@link Employment}
|
|
187
|
+
*/
|
|
188
|
+
employment?: Employment;
|
|
171
189
|
};
|
|
172
190
|
type PaidTimeOffContainerProps = {
|
|
191
|
+
employment?: Employment;
|
|
173
192
|
employmentId: string;
|
|
174
193
|
proposedTerminationDate: string;
|
|
175
194
|
employeeName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OffboardingResponse, P as PostCreateOffboardingError,
|
|
1
|
+
import { O as OffboardingResponse, P as PostCreateOffboardingError, _ as TerminationDetailsParams } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { E as ErrorResponse, S as SuccessResponse } from './mutations-
|
|
3
|
+
import { E as ErrorResponse, S as SuccessResponse } from './mutations-C0KsEf83.js';
|
|
4
4
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
5
5
|
import { $TSFixMe } from '@remoteoss/json-schema-form';
|
|
6
6
|
import { Step } from './flows/useStepState.js';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as Employment, F as File, g as CreateContractDocumentResponse, f as SignContractDocument, S as SuccessResponse } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import { OnboardingBack } from './flows/ContractorOnboarding/components/OnboardingBack.js';
|
|
3
3
|
import { OnboardingSubmit } from './flows/ContractorOnboarding/components/OnboardingSubmit.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { N as NormalizedFieldError } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError } from './mutations-C0KsEf83.js';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
8
8
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
9
9
|
import * as React$1 from 'react';
|
|
10
10
|
import { STEPS } from './flows/ContractorOnboarding/utils.js';
|
|
11
11
|
import { Step } from './flows/useStepState.js';
|
|
12
|
-
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-
|
|
12
|
+
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-DJcvCgN2.js';
|
|
13
13
|
import { FieldValues } from 'react-hook-form';
|
|
14
14
|
import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
|
|
15
|
-
import { g as SelectCountryStep } from './types-
|
|
15
|
+
import { g as SelectCountryStep } from './types-1tGveWWg.js';
|
|
16
16
|
import { FlowOptions, JSFModify } from './flows/types.js';
|
|
17
17
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
18
18
|
|
|
@@ -200,19 +200,6 @@ type ActionError = {
|
|
|
200
200
|
*/
|
|
201
201
|
message: string;
|
|
202
202
|
};
|
|
203
|
-
/**
|
|
204
|
-
* Complete information of an employment
|
|
205
|
-
*/
|
|
206
|
-
type EmploymentShowResponse = {
|
|
207
|
-
data: {
|
|
208
|
-
employment?: Employment & {
|
|
209
|
-
/**
|
|
210
|
-
* Most updated termination date for the offboarding. This date is subject to change through the offboarding process even after it is finalized.
|
|
211
|
-
*/
|
|
212
|
-
termination_date?: string | null;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
203
|
type CostCalculatorDiscountResponse = {
|
|
217
204
|
annual_amount: number;
|
|
218
205
|
monthly_amount: number;
|
|
@@ -1589,4 +1576,4 @@ type PostSignContractDocumentErrors = {
|
|
|
1589
1576
|
};
|
|
1590
1577
|
type PostSignContractDocumentError = PostSignContractDocumentErrors[keyof PostSignContractDocumentErrors];
|
|
1591
1578
|
|
|
1592
|
-
export type {
|
|
1579
|
+
export type { PatchUpdateEmployment2Error as A, EmploymentFullParams as B, CreateOffboardingParams as C, PutUpdateBenefitOfferError as D, Employment as E, File as F, MagicLinkResponse as G, UnprocessableEntityResponse as H, MagicLinkParams as I, ConvertCurrencyResponse as J, PostConvertRawCurrencyConverterError as K, ConvertCurrencyParams as L, MinimalRegion as M, PostCreateContractEligibilityError as N, OffboardingResponse as O, PostCreateOffboardingError as P, CreateContractEligibilityParams as Q, Currency as R, SuccessResponse as S, ListTimeoffResponse as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, TimeoffStatus as W, TimeoffType as X, ListLeavePoliciesSummaryResponse as Y, HelpCenterArticle as Z, TerminationDetailsParams as _, ContractAmendmentAutomatableResponse as a, PostAutomatableContractAmendmentError as b, ContractAmendmentResponse as c, PostCreateContractAmendmentError as d, PostSignContractDocumentError as e, SignContractDocument as f, CreateContractDocumentResponse as g, PostCreateContractDocumentError as h, CreateContractDocument as i, CostCalculatorEstimateResponse as j, PostCreateEstimationError as k, CostCalculatorEstimatePdfResponse as l, PostCreateEstimationPdfError as m, CostCalculatorEstimateParams as n, CostCalculatorEstimateCsvResponse as o, PostCreateEstimationCsvError as p, MinimalCountry as q, EmploymentTermType as r, CostCalculatorEmployment as s, EmploymentCreationResponse as t, Company as u, PostInviteEmploymentInvitationError as v, PostCreateRiskReserveError as w, PostCreateEmployment2Error as x, EmploymentCreateParams as y, EmploymentResponse as z };
|
package/package.json
CHANGED
package/dist/chunk-2TADRH4W.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-MP2T74PU.js";import{b as n}from"./chunk-WVDTHFGS.js";import{b as s}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2TADRH4W.js.map
|
package/dist/chunk-32GSS4UM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={disclaimerCostCalculator:4668194326797,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-32GSS4UM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/zendesk-drawer/utils.ts"],"sourcesContent":["export const zendeskArticles = {\n disclaimerCostCalculator: 4668194326797,\n employeeOnboardingTimeline: 4411262104589,\n extraPayments: 4466822781709,\n internationalPricing: 4410698586893,\n remoteFxRate: 33271144977421,\n terminationEmployeeCommunication: 4411585179661,\n terminationNoticePeriods: 5831900985613,\n};\n"],"mappings":"AAAO,IAAMA,EAAkB,CAC7B,yBAA0B,cAC1B,2BAA4B,cAC5B,cAAe,cACf,qBAAsB,cACtB,aAAc,eACd,iCAAkC,cAClC,yBAA0B,aAC5B","names":["zendeskArticles"]}
|
package/dist/chunk-347YWDTK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as g,b as h,d as C,e as L,f as M}from"./chunk-TWIUL2P3.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as H}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-43WMZDDH.js";import{a as b}from"./chunk-P37U34EQ.js";import{jsx as c,jsxs as P}from"react/jsx-runtime";var S=b(({open:e,onOpenChange:t,title:a,trigger:m,children:i,className:s="",direction:u="right"})=>{let{components:f}=H(),D=f?.drawer;return D?c(D,{open:e,onOpenChange:t,title:a,trigger:m,children:i}):P(g,{open:e,onOpenChange:t,direction:u,children:[c(h,{asChild:!0,children:m}),c(C,{className:l(s,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:P("div",{className:"h-full flex flex-col",children:[c(L,{children:c(M,{children:a})}),c("div",{className:"flex-1 overflow-y-auto",children:i})]})})]})},"Drawer");import*as d from"react";import{jsx as n}from"react/jsx-runtime";var N=d.forwardRef(({className:e,...t},a)=>n("div",{className:"relative w-full overflow-auto",children:n("table",{ref:a,className:l("w-full caption-bottom text-sm",e),...t})}));N.displayName="Table";var v=d.forwardRef(({className:e,...t},a)=>n("thead",{ref:a,className:l("[&_tr]:border-b",e),...t}));v.displayName="TableHeader";var x=d.forwardRef(({className:e,...t},a)=>n("tbody",{ref:a,className:l("[&_tr:last-child]:border-0",e),...t}));x.displayName="TableBody";var A=d.forwardRef(({className:e,...t},a)=>n("tfoot",{ref:a,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));A.displayName="TableFooter";var R=d.forwardRef(({className:e,...t},a)=>n("tr",{ref:a,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));R.displayName="TableRow";var y=d.forwardRef(({className:e,...t},a)=>n("th",{ref:a,className:l("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));y.displayName="TableHead";var w=d.forwardRef(({className:e,...t},a)=>n("td",{ref:a,className:l("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));w.displayName="TableCell";var F=d.forwardRef(({className:e,...t},a)=>n("caption",{ref:a,className:l("mt-4 text-sm text-muted-foreground",e),...t}));F.displayName="TableCaption";import{jsx as o,jsxs as r}from"react/jsx-runtime";var p=b(e=>`${e} ${e===1?"day":"days"}`,"pluralizeDays"),$="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",Q="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",T=b(({children:e,withBorder:t=!1,className:a=""})=>o("div",{className:l($,t&&Q,a),children:e}),"SummaryRow"),U=b(({entitledDays:e,usedDays:t,bookedDays:a,approvedDaysBeforeTermination:m,approvedDaysAfterTermination:i,remainingDays:s,proposedTerminationDate:u})=>{let f=new Date(u).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return r("div",{children:[r(T,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:p(e)})]}),r(T,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:p(a)})]}),r(T,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:p(t)})]}),r(T,{children:[r("label",{children:["Approved for use before ",f]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:p(m)})]}),r(T,{withBorder:!0,children:[r("label",{children:["Approved for use after ",f]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:p(i)})]}),r(T,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:p(s)})]}),o(T,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Expiration date of unused days: ",f]})})]})},"SummaryTimeOff"),z=b(({employeeName:e,timeoffQuery:t,onOpenChange:a,open:m})=>{let{data:i}=t||{};return r(S,{open:m,onOpenChange:a,title:`${e} paid time off breakdown`,trigger:o(E,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:[o("div",{className:"mb-2",children:r(N,{children:[o(v,{children:r(R,{children:[o(y,{className:"w-[250px]",children:"Dates"}),o(y,{children:"Duration"}),o(y,{children:"Status"})]})}),o(x,{children:i?.timeoffs.map(s=>r(R,{children:[o(w,{className:"font-medium w-[250px]",children:s.formattedDate}),o(w,{children:p(s.duration)}),o(w,{children:s.status})]},`${s.startDate}-${s.endDate}`))})]})}),r("p",{className:"text-xs",children:["Total of ",p(i?.bookedDays||0)," booked"]})]})},"DrawerTimeOff"),te=b(({employeeName:e,proposedTerminationDate:t,summaryData:a,formattedProposedTerminationDate:m,timeoffQuery:i,onOpenChange:s,open:u})=>{let{entitledDays:f,bookedDays:D,usedDays:_,approvedDaysBeforeTermination:B,approvedDaysAfterTermination:k,remainingDays:O}=a?.data||{entitledDays:0,bookedDays:0,usedDays:0,approvedDaysBeforeTermination:0,approvedDaysAfterTermination:0,remainingDays:0};return r("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",m,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[!a?.isLoading&&!a?.isError&&a?.data&&o(U,{entitledDays:f,usedDays:_,bookedDays:D,approvedDaysBeforeTermination:B,approvedDaysAfterTermination:k,remainingDays:O,proposedTerminationDate:t}),o(z,{employeeName:e,timeoffQuery:i,onOpenChange:s,open:u})]})]})},"PaidTimeOff");export{te as a};
|
|
2
|
-
//# sourceMappingURL=chunk-347YWDTK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/drawer/Drawer.tsx","../src/components/ui/table.tsx","../src/flows/Termination/components/PaidTimeOff/PaidTimeOff.tsx"],"sourcesContent":["import { useFormFields } from '@/src/context';\nimport { DrawerComponentProps } from '@/src/types/remoteFlows';\nimport {\n Drawer as DrawerPrimitive,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { cn } from '@/src/lib/utils';\n\nexport type DrawerProps = DrawerComponentProps & {\n className?: string;\n direction?: 'left' | 'right';\n};\n\nexport const Drawer = ({\n open,\n onOpenChange,\n title,\n trigger,\n children,\n className = '',\n direction = 'right',\n}: DrawerProps) => {\n const { components } = useFormFields();\n const CustomDrawer = components?.drawer;\n\n if (CustomDrawer) {\n return (\n <CustomDrawer\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n trigger={trigger}\n >\n {children}\n </CustomDrawer>\n );\n }\n\n return (\n <DrawerPrimitive\n open={open}\n onOpenChange={onOpenChange}\n direction={direction}\n >\n <DrawerTrigger asChild>{trigger}</DrawerTrigger>\n <DrawerContent\n className={cn(\n className,\n 'RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4',\n )}\n >\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{title}</DrawerTitle>\n </DrawerHeader>\n <div className='flex-1 overflow-y-auto'>{children}</div>\n </div>\n </DrawerContent>\n </DrawerPrimitive>\n );\n};\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className='relative w-full overflow-auto'>\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t bg-muted/50 font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import { PaidTimeoffBreakdownResponse } from '@/src/common/api';\nimport { Button } from '@/src/components/ui/button';\nimport { cn } from '@/src/lib/utils';\nimport { Drawer } from '@/src/components/shared/drawer/Drawer';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/src/components/ui/table';\nimport { UseQueryResult } from '@tanstack/react-query';\nimport { PaidTimeOffRenderProps } from '@/src/flows/Termination/components/PaidTimeOff/types';\n\nconst pluralizeDays = (count: number) =>\n `${count} ${count === 1 ? 'day' : 'days'}`;\n\nconst rowBase =\n 'RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs';\nconst rowBorder =\n 'RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]';\n\nconst SummaryRow = ({\n children,\n withBorder = false,\n className = '',\n}: {\n children: React.ReactNode;\n withBorder?: boolean;\n className?: string;\n}) => {\n return (\n <div className={cn(rowBase, withBorder && rowBorder, className)}>\n {children}\n </div>\n );\n};\n\nconst SummaryTimeOff = ({\n entitledDays,\n usedDays,\n bookedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n proposedTerminationDate,\n}: {\n entitledDays: number;\n usedDays: number;\n bookedDays: number;\n approvedDaysBeforeTermination: number;\n approvedDaysAfterTermination: number;\n remainingDays: number;\n proposedTerminationDate: string;\n}) => {\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n return (\n <div>\n <SummaryRow withBorder>\n <label>Number of days entitled to per year</label>\n <p data-testid='entitled-days' className='font-bold'>\n {pluralizeDays(entitledDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days booked</label>\n <p data-testid='booked-days' className='font-bold'>\n {pluralizeDays(bookedDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Number of days already used</label>\n <p data-testid='used-days' className='font-bold'>\n {pluralizeDays(usedDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>\n Approved for use before {formattedProposedTerminationDate}\n </label>\n <p data-testid='approved-days-before-termination' className='font-bold'>\n {pluralizeDays(approvedDaysBeforeTermination)}\n </p>\n </SummaryRow>\n <SummaryRow withBorder>\n <label>Approved for use after {formattedProposedTerminationDate}</label>\n <p data-testid='approved-days-after-termination' className='font-bold'>\n {pluralizeDays(approvedDaysAfterTermination)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days remaining unused</label>\n <p data-testid='remaining-days' className='font-bold'>\n {pluralizeDays(remainingDays)}\n </p>\n </SummaryRow>\n <SummaryRow className='mb-2 py-0'>\n <p className='text-xs text-[#222E39]'>\n Expiration date of unused days: {formattedProposedTerminationDate}\n </p>\n </SummaryRow>\n </div>\n );\n};\n\nconst DrawerTimeOff = ({\n employeeName,\n timeoffQuery,\n onOpenChange,\n open,\n}: {\n employeeName: string;\n timeoffQuery: UseQueryResult<PaidTimeoffBreakdownResponse | undefined, Error>;\n onOpenChange: () => void;\n open: boolean;\n}) => {\n const { data: timeoff } = timeoffQuery || {};\n return (\n <Drawer\n open={open}\n onOpenChange={onOpenChange}\n title={`${employeeName} paid time off breakdown`}\n trigger={\n <Button variant='link' className='text-xs text-[#3B82F6] font-bold p-0'>\n See detailed time off breakdown ↗\n </Button>\n }\n className='h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff'\n >\n <div className='mb-2'>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className='w-[250px]'>Dates</TableHead>\n <TableHead>Duration</TableHead>\n <TableHead>Status</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {timeoff?.timeoffs.map((timeoff) => (\n <TableRow key={`${timeoff.startDate}-${timeoff.endDate}`}>\n <TableCell className='font-medium w-[250px]'>\n {timeoff.formattedDate}\n </TableCell>\n <TableCell>{pluralizeDays(timeoff.duration)}</TableCell>\n <TableCell>{timeoff.status}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n <p className='text-xs'>\n Total of {pluralizeDays(timeoff?.bookedDays || 0)} booked\n </p>\n </Drawer>\n );\n};\n\nexport type PaidTimeOffProps = PaidTimeOffRenderProps;\n\n/**\n * PaidTimeOff component\n *\n * This component is used to display the paid time off summary and details.\n * It displays the summary data and a button to open the details drawer.\n * When the details drawer is open, it displays the paid time off breakdown.\n */\nexport const PaidTimeOff = ({\n employeeName,\n proposedTerminationDate,\n summaryData,\n formattedProposedTerminationDate,\n timeoffQuery,\n onOpenChange,\n open,\n}: PaidTimeOffProps) => {\n const {\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n } = summaryData?.data || {\n entitledDays: 0,\n bookedDays: 0,\n usedDays: 0,\n approvedDaysBeforeTermination: 0,\n approvedDaysAfterTermination: 0,\n remainingDays: 0,\n };\n return (\n <div className='RemoteFlows__PaidTimeOff__Container py-3'>\n <h3 className='RemoteFlows__PaidTimeOff__Title mb-2'>Paid time off</h3>\n <p className='RemoteFlows__PaidTimeOff__Description text-sm mb-2'>\n The proposed termination date for {employeeName} is{' '}\n {formattedProposedTerminationDate}. You will need to pay them for any\n unused accrued days. Below is a breakdown of their time off entitlement\n and usage for the current annual leave period:\n </p>\n <div className='mb-2'>\n {!summaryData?.isLoading &&\n !summaryData?.isError &&\n summaryData?.data && (\n <SummaryTimeOff\n entitledDays={entitledDays}\n usedDays={usedDays}\n bookedDays={bookedDays}\n approvedDaysBeforeTermination={approvedDaysBeforeTermination}\n approvedDaysAfterTermination={approvedDaysAfterTermination}\n remainingDays={remainingDays}\n proposedTerminationDate={proposedTerminationDate}\n />\n )}\n <DrawerTimeOff\n employeeName={employeeName}\n timeoffQuery={timeoffQuery}\n onOpenChange={onOpenChange}\n open={open}\n />\n </div>\n </div>\n );\n};\n"],"mappings":"oOA8BM,cAAAA,EAwBE,QAAAC,MAxBF,oBAdC,IAAMC,EAASC,EAAA,CAAC,CACrB,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,UAAAC,EAAY,OACd,IAAmB,CACjB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/BC,EAAeF,GAAY,OAEjC,OAAIE,EAEAb,EAACa,EAAA,CACC,KAAMT,EACN,aAAcC,EACd,MAAOC,EACP,QAASC,EAER,SAAAC,EACH,EAKFP,EAACC,EAAA,CACC,KAAME,EACN,aAAcC,EACd,UAAWK,EAEX,UAAAV,EAACc,EAAA,CAAc,QAAO,GAAE,SAAAP,EAAQ,EAChCP,EAACe,EAAA,CACC,UAAWC,EACTP,EACA,wDACF,EAEA,SAAAR,EAAC,OAAI,UAAU,uBACb,UAAAD,EAACiB,EAAA,CACC,SAAAjB,EAACkB,EAAA,CAAa,SAAAZ,EAAM,EACtB,EACAN,EAAC,OAAI,UAAU,yBAA0B,SAAAQ,EAAS,GACpD,EACF,GACF,CAEJ,EA/CsB,UChBtB,UAAYW,MAAW,QASnB,cAAAC,MAAA,oBALJ,IAAMC,EAAc,aAGlB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AW,SAAAR,EAAQ,OAAO,IALd,GAAGA,EAAQ,SAAS,IAAIA,EAAQ,OAAO,EAMtD,CACD,EACH,GACF,EACF,EACAzB,EAAC,KAAE,UAAU,UAAU,sBACXC,EAAcwB,GAAS,YAAc,CAAC,EAAE,WACpD,GACF,CAEJ,EAnDsB,iBA8DTS,GAAchC,EAAA,CAAC,CAC1B,aAAAmB,EACA,wBAAAH,EACA,YAAAiB,EACA,iCAAAhB,EACA,aAAAG,EACA,aAAAC,EACA,KAAAC,CACF,IAAwB,CACtB,GAAM,CACJ,aAAAZ,EACA,WAAAE,EACA,SAAAD,EACA,8BAAAE,EACA,6BAAAC,EACA,cAAAC,CACF,EAAIkB,GAAa,MAAQ,CACvB,aAAc,EACd,WAAY,EACZ,SAAU,EACV,8BAA+B,EAC/B,6BAA8B,EAC9B,cAAe,CACjB,EACA,OACEnC,EAAC,OAAI,UAAU,2CACb,UAAAD,EAAC,MAAG,UAAU,uCAAuC,yBAAa,EAClEC,EAAC,KAAE,UAAU,qDAAqD,+CAC7BqB,EAAa,MAAI,IACnDF,EAAiC,8JAGpC,EACAnB,EAAC,OAAI,UAAU,OACZ,WAACmC,GAAa,WACb,CAACA,GAAa,SACdA,GAAa,MACXpC,EAACY,EAAA,CACC,aAAcC,EACd,SAAUC,EACV,WAAYC,EACZ,8BAA+BC,EAC/B,6BAA8BC,EAC9B,cAAeC,EACf,wBAAyBC,EAC3B,EAEJnB,EAACqB,EAAA,CACC,aAAcC,EACd,aAAcC,EACd,aAAcC,EACd,KAAMC,EACR,GACF,GACF,CAEJ,EAxD2B","names":["jsx","jsxs","Drawer","__name","open","onOpenChange","title","trigger","children","className","direction","components","useFormFields","CustomDrawer","DrawerTrigger","DrawerContent","cn","DrawerHeader","DrawerTitle","React","jsx","Table","className","props","ref","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","jsx","jsxs","pluralizeDays","__name","count","rowBase","rowBorder","SummaryRow","children","withBorder","className","cn","SummaryTimeOff","entitledDays","usedDays","bookedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","proposedTerminationDate","formattedProposedTerminationDate","DrawerTimeOff","employeeName","timeoffQuery","onOpenChange","open","timeoff","Drawer","Button","Table","TableHeader","TableRow","TableHead","TableBody","TableCell","PaidTimeOff","summaryData"]}
|
package/dist/chunk-3AEKPMIN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-P37U34EQ.js";var m={form:{index:0,name:"form"},confirmation_form:{index:1,name:"confirmation_form"}};function _(t,o){if(!t)return{};if(!o)return{...t.data.employment?.contract_details,effective_date:"",reason_for_change:"",job_title:t.data.employment?.job_title,additional_comments:"",annual_gross_salary:a(t.data.employment?.contract_details?.annual_gross_salary)};let s=o.map(n=>n.name),i=Object.keys(t?.data?.employment?.contract_details||{});return{...s.reduce((n,e)=>{if(i.includes(e)){let c=t?.data?.employment?.contract_details;n[e]=c[e]}return n},{}),effective_date:"",reason_for_change:"",job_title:t.data.employment?.job_title,additional_comments:"",annual_gross_salary:a(t.data.employment?.contract_details?.annual_gross_salary),additional_comments_toggle:!1}}r(_,"buildInitialValues");export{m as a,_ as b};
|
|
2
|
-
//# sourceMappingURL=chunk-3AEKPMIN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/ContractAmendment/utils.ts"],"sourcesContent":["import { EmploymentShowResponse } from '@/src/client';\nimport { convertFromCents } from '@/src/components/form/utils';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { Step } from '../useStepState';\n\ntype StepKeys = 'form' | 'confirmation_form';\n\nexport const STEPS: Record<StepKeys, Step<StepKeys>> = {\n form: { index: 0, name: 'form' },\n confirmation_form: { index: 1, name: 'confirmation_form' },\n} as const;\n\nexport function buildInitialValues(\n employment: EmploymentShowResponse | undefined,\n fields?: Fields | undefined,\n) {\n if (!employment) {\n return {};\n }\n\n if (!fields) {\n return {\n ...employment.data.employment?.contract_details,\n effective_date: '',\n reason_for_change: '',\n job_title: employment.data.employment?.job_title,\n additional_comments: '',\n annual_gross_salary: convertFromCents(\n employment.data.employment?.contract_details\n ?.annual_gross_salary as string,\n ),\n };\n }\n\n const allFields = fields.map((field) => field.name);\n const employmentFields = Object.keys(\n employment?.data?.employment?.contract_details || {},\n );\n const initialValues = allFields.reduce<Record<string, unknown>>(\n (initialValuesAcc, field) => {\n // @ts-expect-error error\n if (employmentFields.includes(field)) {\n const contractDetails = employment?.data?.employment\n ?.contract_details as Record<string, unknown>;\n // @ts-expect-error error\n initialValuesAcc[field] = contractDetails[field];\n }\n return initialValuesAcc;\n },\n {} as Record<string, unknown>,\n );\n\n return {\n ...initialValues,\n effective_date: '',\n reason_for_change: '',\n job_title: employment.data.employment?.job_title,\n additional_comments: '',\n annual_gross_salary: convertFromCents(\n employment.data.employment?.contract_details\n ?.annual_gross_salary as string,\n ),\n additional_comments_toggle: false,\n };\n}\n"],"mappings":"gFAOO,IAAMA,EAA0C,CACrD,KAAM,CAAE,MAAO,EAAG,KAAM,MAAO,EAC/B,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,CAC3D,EAEO,SAASC,EACdC,EACAC,EACA,CACA,GAAI,CAACD,EACH,MAAO,CAAC,EAGV,GAAI,CAACC,EACH,MAAO,CACL,GAAGD,EAAW,KAAK,YAAY,iBAC/B,eAAgB,GAChB,kBAAmB,GACnB,UAAWA,EAAW,KAAK,YAAY,UACvC,oBAAqB,GACrB,oBAAqBE,EACnBF,EAAW,KAAK,YAAY,kBACxB,mBACN,CACF,EAGF,IAAMG,EAAYF,EAAO,IAAKG,GAAUA,EAAM,IAAI,EAC5CC,EAAmB,OAAO,KAC9BL,GAAY,MAAM,YAAY,kBAAoB,CAAC,CACrD,EAeA,MAAO,CACL,GAfoBG,EAAU,OAC9B,CAACG,EAAkBF,IAAU,CAE3B,GAAIC,EAAiB,SAASD,CAAK,EAAG,CACpC,IAAMG,EAAkBP,GAAY,MAAM,YACtC,iBAEJM,EAAiBF,CAAK,EAAIG,EAAgBH,CAAK,CACjD,CACA,OAAOE,CACT,EACA,CAAC,CACH,EAIE,eAAgB,GAChB,kBAAmB,GACnB,UAAWN,EAAW,KAAK,YAAY,UACvC,oBAAqB,GACrB,oBAAqBE,EACnBF,EAAW,KAAK,YAAY,kBACxB,mBACN,EACA,2BAA4B,EAC9B,CACF,CApDgBQ,EAAAT,EAAA","names":["STEPS","buildInitialValues","employment","fields","convertFromCents","allFields","field","employmentFields","initialValuesAcc","contractDetails","__name"]}
|
package/dist/chunk-4O4VBGMD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-347YWDTK.js";import{a as C}from"./chunk-EZWZMPD2.js";import{a as x}from"./chunk-VUP76ZMQ.js";import{a as P}from"./chunk-S4XU4SE7.js";import{a as V}from"./chunk-32GSS4UM.js";import{a as S}from"./chunk-LRGEEPGK.js";import{a as M}from"./chunk-2YTBWEC7.js";import{a as g}from"./chunk-MP2T74PU.js";import{a as j,b as k}from"./chunk-2M7EBC4K.js";import{a as h}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as m}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-43WMZDDH.js";import{a as i}from"./chunk-P37U34EQ.js";import{createHeadlessForm as Z}from"@remoteoss/json-schema-form";import U from"lodash.omitby";import W from"lodash.isnull";import{format as G}from"date-fns";import{useMemo as b}from"react";import Q from"lodash.omit";import{jsx as N,jsxs as K}from"react/jsx-runtime";function u(t,e,d){return{"x-jsf-presentation":{inputType:"hidden",Component:i(()=>K("div",{className:r("RemoteFlows__InformationStatement",d?.className),children:[N("h3",{className:r("RemoteFlows__InformationStatement__Title"),children:t}),N("p",{className:r("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(u,"createInformationField");import{Fragment as Y,jsx as f,jsxs as ee}from"react/jsx-runtime";function X(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}i(X,"buildInitialValues");var ke=i(({employmentId:t,options:e,initialValues:d})=>{let{fieldValues:c,setFieldValues:v,stepState:n,previousStep:$,nextStep:R}=h(P),{data:y}=S(t),p=X({...n.values?.employee_communication,...n.values?.termination_details,...n.values?.paid_time_off,...n.values?.additional_information,...d}),_=b(()=>({...n.values?.[n.currentStep.name],...p,...c}),[n.values,n.currentStep.name,c,p]),D=b(()=>({fields:{risk_assesment_info:u("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:u("Proposed termination date",ee(Y,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",f(g,{zendeskId:V.terminationNoticePeriods,className:r("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:G(new Date,"yyyy-MM-dd")}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:i(()=>{let a=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return f(C,{employeeName:y?.basic_information?.name,proposedTerminationDate:_.proposed_termination_date,employmentId:t,render:o=>a?f(a,{...o}):f(w,{...o})})},"Component")}}}}),[y?.basic_information?.name,_.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,t]),{data:s,isLoading:E}=k({formValues:_,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...D?.fields}},step:n.currentStep.name}),l=Z(x.data.schema),T=j(),{mutateAsync:O}=M(T);async function I(a){if(!t)throw new Error("Employment id is missing");if(s){let o=m(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:B}=o,H=B==="yes"?{employee_awareness:{date:o.customer_informed_employee_date,note:o.customer_informed_employee_description}}:void 0,L=F(o,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),A=Q(L,"customer_informed_employee_date","customer_informed_employee_description"),q=U({...A,...H},W);return O({employment_id:t,termination_details:q,type:"termination"})}}i(I,"onSubmit");function J(){$()}i(J,"back");function z(){R()}return i(z,"next"),{employmentId:t,stepState:n,fields:s?.fields||[],isLoading:E,isSubmitting:T.isPending,initialValues:p,handleValidation:i(a=>{if(s){let o=m(a,s?.fields);return s?.handleValidation(o)}return null},"handleValidation"),checkFieldUpdates:i(a=>{if(l){let o=m(a,l?.fields,{isPartialValidation:!0});v(o)}},"checkFieldUpdates"),parseFormValues:i(a=>m(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:I,back:J,next:z}},"useTermination");export{ke as a};
|
|
2
|
-
//# sourceMappingURL=chunk-4O4VBGMD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { useEmployment } from '@/src/flows/Onboarding/api';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmployment(employmentId);\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: format(new Date(), 'yyyy-MM-dd'),\n },\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n },\n };\n }, [\n employment?.basic_information?.name,\n formValues.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n employmentId,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n 'x-jsf-presentation': {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"ujBAAA,OAAmB,sBAAAA,MAA0B,8BAC7C,OAAOC,MAAY,gBACnB,OAAOC,MAAY,gBACnB,OAAS,UAAAC,MAAc,WACvB,OAAS,WAAAC,MAAe,QAWxB,OAAOC,MAAU,cCcT,OAME,OAAAC,EANF,QAAAC,MAAA,oBAXD,SAASC,EACdC,EACAC,EACAC,EAGgB,CAChB,MAAO,CACL,qBAAsB,CACpB,UAAW,SACX,UAAWC,EAAA,IACTL,EAAC,OACC,UAAWM,EACT,oCACAF,GAAS,SACX,EAEA,UAAAL,EAAC,MAAG,UAAWO,EAAG,0CAA0C,EACzD,SAAAJ,EACH,EACAH,EAAC,KAAE,UAAWO,EAAG,gDAAgD,EAC9D,SAAAH,EACH,GACF,EAbS,YAeb,CACF,CACF,CA3BgBE,EAAAJ,EAAA,0BDgFN,mBAAAM,EAKE,OAAAC,EALF,QAAAC,OAAA,oBAtEV,SAASC,EACPC,EACuB,CAsBvB,MArB6C,CAC3C,aAAc,GACd,2BAA4B,GAC5B,gCAAiC,GACjC,uCAAwC,GACxC,eAAgB,G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EACJD,IAA6B,MACzB,CACE,mBAAoB,CAClB,KAAMF,EAAa,gCACnB,KAAMA,EAAa,sCACrB,CACF,EACA,OASAI,EAAoBC,EACxBL,EARqB,CACrB,uBACA,eACA,6BACA,4BACF,CAKA,EAEMM,EAAmBC,EACvBH,EACA,kCACA,wCACF,EAEMI,EAA+CC,EACnD,CACE,GAAGH,EACH,GAAGH,CACL,EACAO,CACF,EAQA,OAAOd,EAN6C,CAClD,cAAejC,EACf,oBAAqB6C,EACrB,KAAM,aACR,CAEqC,CACvC,CAGF,CA9De/C,EAAAqC,EAAA,YAgEf,SAASa,GAAO,CACd1C,EAAa,CACf,CAFSR,EAAAkD,EAAA,QAIT,SAASC,GAAO,CACd1C,EAAS,CACX,CAFS,OAAAT,EAAAmD,EAAA,QAIF,CAIL,aAAAjD,EAIA,UAAAK,EAIA,OAAQoB,GAAyB,QAAU,CAAC,EAI5C,UAAWC,EAIX,aAAcK,EAAkB,UAIhC,cAAenB,EAMf,iBAAkBd,EAACsC,GAAkC,CACnD,GAAIX,EAAyB,CAC3B,IAAMY,EAAeC,EACnBF,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBvC,EAACsC,GAA2C,CAC7D,GAAIR,EAAyB,CAC3B,IAAMS,EAAeC,EACnBF,EACAR,GAAyB,OACzB,CAAE,oBAAqB,EAAK,CAC9B,EACAxB,EAAeiC,CAAqC,CACtD,CACF,EATmB,qBAenB,gBAAiBvC,EAACsC,GACTE,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAHc,mBAUjB,SAAAO,EAMA,KAAAa,EAMA,KAAAC,CACF,CACF,EA/R8B","names":["createHeadlessForm","omitBy","isNull","format","useMemo","omit","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmployment","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","format","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
|
package/dist/chunk-EZWZMPD2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t,d as m,e as a,f as i}from"./chunk-REDYWUCC.js";import{a as n}from"./chunk-P37U34EQ.js";import{useState as T}from"react";var C=n(({proposedTerminationDate:e,employeeName:f,employmentId:o,render:s})=>{let[r,u]=T(!1),y=i({employmentId:o}),c=new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),d=t({employmentId:o,options:{enabled:r}}),P=m({employmentId:o,date:e}),l=a({employmentId:o,proposedTerminationDate:e});return s({leavePoliciesSummaryQuery:y,timeoffQuery:d,bookedTimeBeforeAndAfterTerminationQuery:P,formattedProposedTerminationDate:c,employeeName:f,proposedTerminationDate:e,summaryData:l,open:r,onOpenChange:n(()=>{u(O=>!O)},"onOpenChange")})},"PaidTimeOffContainer");export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-EZWZMPD2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.tsx"],"sourcesContent":["import {\n useBookedTimeoffBeforeAndAfterTerminationQuery,\n usePaidTimeoffBreakdownQuery,\n useSummaryTimeOffDataQuery,\n useTimeOffLeavePoliciesSummaryQuery,\n} from '@/src/common/api';\nimport { PaidTimeOffContainerProps } from '@/src/flows/Termination/components/PaidTimeOff/types';\nimport { useState } from 'react';\n\n/**\n * PaidTimeOffContainer component\n *\n * This is a container component that manages paid time off (PTO) data retrieval and state\n * for the termination flow. It aggregates multiple time off-related queries and formats\n * the termination date for display.\n *\n */\nexport const PaidTimeOffContainer = ({\n proposedTerminationDate,\n employeeName,\n employmentId,\n render,\n}: PaidTimeOffContainerProps) => {\n const [open, setOpen] = useState(false);\n\n const leavePoliciesSummaryQuery = useTimeOffLeavePoliciesSummaryQuery({\n employmentId: employmentId,\n });\n\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n\n const timeoffQuery = usePaidTimeoffBreakdownQuery({\n employmentId: employmentId,\n options: {\n enabled: open,\n },\n });\n\n const bookedTimeBeforeAndAfterTerminationQuery =\n useBookedTimeoffBeforeAndAfterTerminationQuery({\n employmentId: employmentId,\n date: proposedTerminationDate,\n });\n\n const summaryData = useSummaryTimeOffDataQuery({\n employmentId: employmentId,\n proposedTerminationDate,\n });\n\n const onOpenChange = () => {\n setOpen((open) => !open);\n };\n\n return render({\n leavePoliciesSummaryQuery,\n timeoffQuery,\n bookedTimeBeforeAndAfterTerminationQuery,\n formattedProposedTerminationDate,\n employeeName,\n proposedTerminationDate,\n summaryData,\n open,\n onOpenChange,\n });\n};\n"],"mappings":"qGAOA,OAAS,YAAAA,MAAgB,QAUlB,IAAMC,EAAuBC,EAAA,CAAC,CACnC,wBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,OAAAC,CACF,IAAiC,CAC/B,GAAM,CAACC,EAAMC,CAAO,EAAIC,EAAS,EAAK,EAEhCC,EAA4BC,EAAoC,CACpE,aAAcN,CAChB,CAAC,EAEKO,EAAmC,IAAI,KAC3CT,CACF,EAAE,mBAAmB,QAAS,CAC5B,MAAO,OACP,IAAK,UACL,KAAM,SACR,CAAC,EAEKU,EAAeC,EAA6B,CAChD,aAAcT,EACd,QAAS,CACP,QAASE,CACX,CACF,CAAC,EAEKQ,EACJC,EAA+C,CAC7C,aAAcX,EACd,KAAMF,CACR,CAAC,EAEGc,EAAcC,EAA2B,CAC7C,aAAcb,EACd,wBAAAF,CACF,CAAC,EAMD,OAAOG,EAAO,CACZ,0BAAAI,EACA,aAAAG,EACA,yCAAAE,EACA,iCAAAH,EACA,aAAAR,EACA,wBAAAD,EACA,YAAAc,EACA,KAAAV,EACA,aAbmBL,EAAA,IAAM,CACzBM,EAASD,GAAS,CAACA,CAAI,CACzB,EAFqB,eAcrB,CAAC,CACH,EArDoC","names":["useState","PaidTimeOffContainer","__name","proposedTerminationDate","employeeName","employmentId","render","open","setOpen","useState","leavePoliciesSummaryQuery","useTimeOffLeavePoliciesSummaryQuery","formattedProposedTerminationDate","timeoffQuery","usePaidTimeoffBreakdownQuery","bookedTimeBeforeAndAfterTerminationQuery","useBookedTimeoffBeforeAndAfterTerminationQuery","summaryData","useSummaryTimeOffDataQuery"]}
|
package/dist/chunk-IUZ7DEXC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-32GSS4UM.js";import{a as l}from"./chunk-HFI2MD3H.js";import{a as m}from"./chunk-MP2T74PU.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(m,{className:"text-sm",zendeskId:y.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
|
|
2
|
-
//# sourceMappingURL=chunk-IUZ7DEXC.js.map
|
package/dist/chunk-MP2T74PU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,b as h,d as C,e as Z,f as v,g as y}from"./chunk-TWIUL2P3.js";import{g}from"./chunk-3O3Q24JL.js";import{b as w,d as f}from"./chunk-3ZWDIEEM.js";import{a as k,f as D}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{useQuery as F}from"@tanstack/react-query";var x=e((r,a)=>{let{client:s}=f();return F({queryKey:["zendesk-article",r],queryFn:e(async()=>{let t=await g({client:s,path:{id:Number(r)}});if(t.error)throw new Error(t.error.message||"Failed to fetch article");return t},"queryFn"),select:e(t=>{let o=t.data?.data.help_center_article;return o&&{...o,body:D(o.body||"")}},"select"),retry:!1,...a})},"useZendeskArticle");import{jsx as n,jsxs as l}from"react/jsx-runtime";var N=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL"),T=e(({Trigger:r,zendeskId:a,open:s,onClose:t})=>{let{components:o}=w(),i=N(a),d=e(()=>{t?.()},"handleClose"),{data:c,isLoading:m,error:p}=x(a,{enabled:s}),u=o?.zendeskDrawer;return u?n(u,{open:s,onClose:d,data:c,isLoading:m,error:p,zendeskURL:i,Trigger:r}):l(b,{open:s,onOpenChange:R=>!R&&d(),direction:"right",children:[n(h,{asChild:!0,children:r}),n(C,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:l("div",{className:"h-full flex flex-col",children:[l(Z,{children:[n(v,{children:c?.title}),l(y,{children:["For more details see our"," ",n("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),m&&n("div",{children:"Loading..."}),p&&n("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),n("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:c?.body||""}})]})})]})},"ZendeskDrawer");import{useState as L}from"react";import{jsx as _}from"react/jsx-runtime";function $({zendeskId:r,className:a,onClick:s,children:t}){let[o,i]=L(!1);return _(T,{zendeskId:r,open:o,onClose:()=>i(!1),Trigger:_("button",{onClick:e(()=>{i(!0),s?.(r)},"handleClick"),className:k("RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",a),children:t})})}e($,"ZendeskTriggerButton");export{$ as a};
|
|
2
|
-
//# sourceMappingURL=chunk-MP2T74PU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/zendesk-drawer/api.ts","../src/components/shared/zendesk-drawer/ZendeskDrawer.tsx","../src/components/shared/zendesk-drawer/ZendeskTriggerButton.tsx"],"sourcesContent":["import { getShowHelpCenterArticle } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { sanitizeHtmlWithImageErrorHandling } from '@/src/lib/utils';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useZendeskArticle = (\n zendeskId: number | null,\n queryOptions?: { enabled?: boolean },\n) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['zendesk-article', zendeskId],\n queryFn: async () => {\n const response = await getShowHelpCenterArticle({\n client: client as Client,\n path: {\n id: Number(zendeskId),\n },\n });\n\n if (response.error) {\n throw new Error(response.error.message || 'Failed to fetch article');\n }\n\n return response;\n },\n select: (data) => {\n const article = data.data?.data.help_center_article;\n if (article) {\n return {\n ...article,\n body: sanitizeHtmlWithImageErrorHandling(article.body || ''),\n };\n }\n return article;\n },\n retry: false,\n ...queryOptions,\n });\n};\n","import { useZendeskArticle } from '@/src/components/shared/zendesk-drawer/api';\nimport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerDescription,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { useFormFields } from '@/src/context';\n\nexport type ZendeskDrawerProps = {\n Trigger: React.ReactElement;\n zendeskId: number;\n open: boolean;\n onClose: () => void;\n};\n\nconst buildZendeskURL = (zendeskId: number) => {\n return `https://support.remote.com/hc/en-us/articles/${zendeskId}`;\n};\n\nexport const ZendeskDrawer = ({\n Trigger,\n zendeskId,\n open,\n onClose,\n}: ZendeskDrawerProps) => {\n const { components } = useFormFields();\n const zendeskURL = buildZendeskURL(zendeskId);\n\n const handleClose = () => {\n onClose?.();\n };\n\n const { data, isLoading, error } = useZendeskArticle(zendeskId, {\n enabled: open,\n });\n\n const CustomZendeskDrawer = components?.zendeskDrawer;\n\n if (CustomZendeskDrawer) {\n return (\n <CustomZendeskDrawer\n open={open}\n onClose={handleClose}\n data={data}\n isLoading={isLoading}\n error={error}\n zendeskURL={zendeskURL}\n Trigger={Trigger}\n />\n );\n }\n\n return (\n <Drawer\n open={open}\n onOpenChange={(open) => !open && handleClose()}\n direction='right'\n >\n <DrawerTrigger asChild>{Trigger}</DrawerTrigger>\n <DrawerContent className='h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer'>\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{data?.title}</DrawerTitle>\n <DrawerDescription>\n For more details see our{' '}\n <a href={zendeskURL} target='_blank' rel='noopener noreferrer'>\n help article\n </a>{' '}\n </DrawerDescription>\n </DrawerHeader>\n {isLoading && <div>Loading...</div>}\n {error && (\n <div className='text-sm p-4 text-red-500'>\n Error loading article\n </div>\n )}\n <div\n className='flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content'\n dangerouslySetInnerHTML={{\n __html: data?.body || '',\n }}\n ></div>\n </div>\n </DrawerContent>\n </Drawer>\n );\n};\n","import { cn } from '@/src/lib/utils';\nimport { ZendeskDrawer } from './ZendeskDrawer';\nimport { useState } from 'react';\n\ninterface ZendeskTriggerButtonProps {\n zendeskId: number;\n className?: string;\n onClick?: (zendeskId: number) => void;\n children?: React.ReactNode;\n}\n\nexport function ZendeskTriggerButton({\n zendeskId,\n className,\n onClick,\n children,\n}: ZendeskTriggerButtonProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleClick = () => {\n setIsOpen(true);\n onClick?.(zendeskId);\n };\n\n return (\n <ZendeskDrawer\n zendeskId={zendeskId}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n Trigger={\n <button\n onClick={handleClick}\n className={cn(\n 'RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0',\n className,\n )}\n >\n {children}\n </button>\n }\n />\n );\n}\n"],"mappings":"oPAIA,OAAS,YAAAA,MAAgB,wBAElB,IAAMC,EAAoBC,EAAA,CAC/BC,EACAC,IACG,CACH,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBJ,CAAS,EACvC,QAASD,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAyB,CAC9C,OAAQJ,EACR,KAAM,CACJ,GAAI,OAAOF,CAAS,CACtB,CACF,CAAC,EAED,GAAIK,EAAS,MACX,MAAM,IAAI,MAAMA,EAAS,MAAM,SAAW,yBAAyB,EAGrE,OAAOA,CACT,EAbS,WAcT,OAAQN,EAACQ,GAAS,CAChB,IAAMC,EAAUD,EAAK,MAAM,KAAK,oBAChC,OAAIC,GACK,CACL,GAAGA,EACH,KAAMC,EAAmCD,EAAQ,MAAQ,EAAE,CAC7D,CAGJ,EATQ,UAUR,MAAO,GACP,GAAGP,CACL,CAAC,CACH,EAlCiC,qBCqC3B,cAAAS,EAuBM,QAAAC,MAvBN,oBAzBN,IAAMC,EAAkBC,EAACC,GAChB,gDAAgDA,CAAS,GAD1C,mBAIXC,EAAgBF,EAAA,CAAC,CA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,EAAA,CACC,UAAWP,EACX,KAAMI,EACN,QAAS,IAAMC,EAAU,EAAK,EAC9B,QACEP,EAAC,UACC,QAZYU,EAAA,IAAM,CACxBH,EAAU,EAAI,EACdH,IAAUF,CAAS,CACrB,EAHoB,eAaZ,UAAWS,EACT,0IACAR,CACF,EAEC,SAAAE,EACH,EAEJ,CAEJ,CA/BgBK,EAAAT,EAAA","names":["useQuery","useZendeskArticle","__name","zendeskId","queryOptions","client","useClient","useQuery","response","getShowHelpCenterArticle","data","article","sanitizeHtmlWithImageErrorHandling","jsx","jsxs","buildZendeskURL","__name","zendeskId","ZendeskDrawer","Trigger","open","onClose","components","useFormFields","zendeskURL","handleClose","data","isLoading","error","useZendeskArticle","CustomZendeskDrawer","Drawer","DrawerTrigger","DrawerContent","DrawerHeader","DrawerTitle","DrawerDescription","useState","jsx","ZendeskTriggerButton","zendeskId","className","onClick","children","isOpen","setIsOpen","useState","ZendeskDrawer","__name","cn"]}
|