@remoteoss/remote-flows 0.31.0 → 1.0.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/README.md +45 -8
- package/dist/chunk-2CBUBDUV.js +2 -0
- package/dist/chunk-2CBUBDUV.js.map +1 -0
- package/dist/chunk-2EJ4BAUK.js +2 -0
- package/dist/chunk-2EJ4BAUK.js.map +1 -0
- package/dist/{chunk-E76DWINZ.js → chunk-2Q4L4WH7.js} +2 -2
- package/dist/chunk-2QOLV5T5.js +2 -0
- package/dist/chunk-2QOLV5T5.js.map +1 -0
- package/dist/{chunk-BWJAHRV6.js → chunk-2S376WY7.js} +2 -2
- package/dist/{chunk-PNAZ6US5.js → chunk-34TXLVDI.js} +2 -2
- package/dist/chunk-3UM34N4C.js +2 -0
- package/dist/chunk-3UM34N4C.js.map +1 -0
- package/dist/{chunk-FQYK5BJV.js → chunk-3XOHQ7Y7.js} +2 -2
- package/dist/chunk-3XOHQ7Y7.js.map +1 -0
- package/dist/chunk-4A2UD4KX.js +2 -0
- package/dist/chunk-4A2UD4KX.js.map +1 -0
- package/dist/{chunk-OUSDXTNH.js → chunk-5BY7HOJB.js} +2 -2
- package/dist/chunk-5BY7HOJB.js.map +1 -0
- package/dist/{chunk-ID3ZF7QT.js → chunk-62HGJVHQ.js} +2 -2
- package/dist/{chunk-P5WUODPR.js → chunk-65H2G43I.js} +2 -2
- package/dist/{chunk-DPY77ASH.js → chunk-66L7BKYM.js} +2 -2
- package/dist/{chunk-OIN3HGOQ.js → chunk-677KTHPH.js} +2 -2
- package/dist/{chunk-SQENUVY5.js → chunk-6PT55OGW.js} +2 -2
- package/dist/chunk-6PT55OGW.js.map +1 -0
- package/dist/{chunk-FJPQPOK3.js → chunk-7CLHPFPZ.js} +2 -2
- package/dist/{chunk-CYDWBHAA.js → chunk-7HSSHSYK.js} +2 -2
- package/dist/chunk-7JQFGVWI.js +2 -0
- package/dist/chunk-7JQFGVWI.js.map +1 -0
- package/dist/{chunk-SXN63FPH.js → chunk-7LRY5QTK.js} +2 -2
- package/dist/{chunk-PEHK6NHL.js → chunk-A477TZFC.js} +2 -2
- package/dist/{chunk-GWICTLVR.js → chunk-A7BBVCMY.js} +2 -2
- package/dist/{chunk-HWEJIPSK.js → chunk-AA7QB3QQ.js} +1 -1
- package/dist/chunk-BTUON37L.js +2 -0
- package/dist/chunk-BTUON37L.js.map +1 -0
- package/dist/chunk-CN3GXYLK.js +2 -0
- package/dist/{chunk-OOCCLRPH.js.map → chunk-CN3GXYLK.js.map} +1 -1
- package/dist/chunk-D3ZE5TO6.js +2 -0
- package/dist/chunk-D3ZE5TO6.js.map +1 -0
- package/dist/{chunk-WBN4ZSGC.js → chunk-DBGYYVFL.js} +2 -2
- package/dist/{chunk-2MG7YOPU.js → chunk-EAJ7JLBL.js} +2 -2
- package/dist/chunk-EAJ7JLBL.js.map +1 -0
- package/dist/{chunk-UPXJJBXZ.js → chunk-ED6E3V2E.js} +2 -2
- package/dist/{chunk-ZQ6MG635.js → chunk-FEB3W622.js} +2 -2
- package/dist/chunk-FGBEOUQK.js +1 -0
- package/dist/{chunk-OQJWLV7V.js → chunk-FIXHXJGN.js} +2 -2
- package/dist/{chunk-EKKRQI6B.js → chunk-GGQFBP37.js} +2 -2
- package/dist/chunk-HBYHRMST.js +2 -0
- package/dist/chunk-HBYHRMST.js.map +1 -0
- package/dist/{chunk-JTOLQCOG.js → chunk-HKCDMC3H.js} +2 -2
- package/dist/{chunk-IJR44ISO.js → chunk-I4XJ764Y.js} +2 -2
- package/dist/{chunk-QW322WRX.js → chunk-IHYMZJ4W.js} +2 -2
- package/dist/chunk-IHYMZJ4W.js.map +1 -0
- package/dist/{chunk-T2FGDQSU.js → chunk-ISQ6I4HJ.js} +2 -2
- package/dist/chunk-KSNOQWVU.js +2 -0
- package/dist/chunk-KSNOQWVU.js.map +1 -0
- package/dist/chunk-L2GTD44Y.js +2 -0
- package/dist/chunk-L2GTD44Y.js.map +1 -0
- package/dist/{chunk-H7L735T7.js → chunk-LDZWM4VX.js} +2 -2
- package/dist/{chunk-QFOYD5Q4.js → chunk-LIF7X2AH.js} +2 -2
- package/dist/chunk-LIF7X2AH.js.map +1 -0
- package/dist/{chunk-ACQ3OEOE.js → chunk-LLJWEHDJ.js} +2 -2
- package/dist/{chunk-NBFJOIV2.js → chunk-M37LWACT.js} +2 -2
- package/dist/{chunk-NBFJOIV2.js.map → chunk-M37LWACT.js.map} +1 -1
- package/dist/{chunk-4X77DTSW.js → chunk-M3EBUSNT.js} +2 -2
- package/dist/chunk-M5WQNNAT.js +2 -0
- package/dist/{chunk-4OAWZYH7.js.map → chunk-M5WQNNAT.js.map} +1 -1
- package/dist/{chunk-TWIUL2P3.js → chunk-MOG7GUQB.js} +2 -2
- package/dist/{chunk-ANGJCT4I.js → chunk-MPV22ALR.js} +2 -2
- package/dist/chunk-ORIJ6E2J.js +2 -0
- package/dist/chunk-ORIJ6E2J.js.map +1 -0
- package/dist/chunk-OVTCRVTZ.js +2 -0
- package/dist/{chunk-5PPUPDYP.js.map → chunk-OVTCRVTZ.js.map} +1 -1
- package/dist/{chunk-UZXTPQ47.js → chunk-PABPITPH.js} +2 -2
- package/dist/{chunk-H3ZR4EW5.js → chunk-RD27ZSYF.js} +2 -2
- package/dist/chunk-RD27ZSYF.js.map +1 -0
- package/dist/chunk-RIA5Z6I3.js +2 -0
- package/dist/chunk-RIA5Z6I3.js.map +1 -0
- package/dist/{chunk-OIVWGY5Z.js → chunk-RSH5MZY3.js} +2 -2
- package/dist/{chunk-OW5QGJD4.js → chunk-S2BJGON2.js} +2 -2
- package/dist/{chunk-5ZR7EFPY.js → chunk-SHK2UKLD.js} +2 -2
- package/dist/chunk-SS6RX52D.js +2 -0
- package/dist/chunk-SS6RX52D.js.map +1 -0
- package/dist/chunk-STSTF3AT.js +2 -0
- package/dist/chunk-STSTF3AT.js.map +1 -0
- package/dist/{chunk-6VRUYYUV.js → chunk-U5WVXSGT.js} +2 -2
- package/dist/chunk-UK5HHMPM.js +2 -0
- package/dist/chunk-UK5HHMPM.js.map +1 -0
- package/dist/chunk-UQMGBXCI.js +2 -0
- package/dist/chunk-UQMGBXCI.js.map +1 -0
- package/dist/chunk-W5M5HLWF.js +2 -0
- package/dist/chunk-W5M5HLWF.js.map +1 -0
- package/dist/{chunk-EGSRN2CQ.js → chunk-WRNHET4F.js} +2 -2
- package/dist/chunk-XOA7GG4P.js +2 -0
- package/dist/{chunk-26ZOPH2I.js → chunk-XPOLXRYT.js} +2 -2
- package/dist/{chunk-R7W3BT6P.js → chunk-YCILXVJU.js} +2 -2
- package/dist/chunk-YHR7BPYU.js +2 -0
- package/dist/chunk-YHR7BPYU.js.map +1 -0
- package/dist/chunk-ZJSWK3Y7.js +2 -0
- package/dist/chunk-ZJSWK3Y7.js.map +1 -0
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +4 -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/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +6 -5
- package/dist/flows/ContractAmendment/hooks.d.ts +6 -5
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +4 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +1 -0
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +3 -2
- package/dist/flows/ContractorOnboarding/api.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +5 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +5 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +9 -8
- package/dist/flows/ContractorOnboarding/hooks.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +6 -5
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +4 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +4 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -1
- package/dist/flows/CostCalculator/api.d.ts +2 -1
- package/dist/flows/CostCalculator/api.js +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 +5 -4
- package/dist/flows/CostCalculator/hooks.d.ts +5 -4
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +4 -6
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +2 -1
- package/dist/flows/CostCalculator/utils.d.ts +4 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +5 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +7 -6
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +5 -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/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +8 -7
- package/dist/flows/Onboarding/hooks.d.ts +5 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +5 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +5 -4
- package/dist/flows/Onboarding/utils.d.ts +5 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +5 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +5 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +5 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationBack.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +5 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +5 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +5 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TerminationSubmit.js +1 -1
- package/dist/flows/Termination/api.d.ts +26 -7
- package/dist/flows/Termination/api.js +1 -1
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +9 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +9 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +9 -5
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +8 -7
- package/dist/flows/Termination/hooks.d.ts +5 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +7 -6
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.d.ts +5 -4
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +5 -4
- package/dist/flows/Termination/utils.d.ts +5 -4
- package/dist/flows/types.d.ts +3 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +36 -14
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +11 -2
- package/dist/internals.js +1 -1
- package/dist/{mutations-poZZkLvk.d.ts → mutations-Dj5OTaG_.d.ts} +1 -1
- package/dist/{remoteFlows-DzRZRhQq.d.ts → remoteFlows-CJkEwDeI.d.ts} +38 -10
- package/dist/{types-CpgnTLWW.d.ts → types-CrBx80W2.d.ts} +6 -6
- package/dist/{types-CTSYWNx-.d.ts → types-CzuydJIU.d.ts} +5 -5
- package/dist/{types-BNjv7eD0.d.ts → types-OcTc56P-.d.ts} +1 -1
- package/dist/{types-6uSA0-an.d.ts → types-o2Z9IpsO.d.ts} +7 -7
- package/dist/{types.gen-B2u-cOXI.d.ts → types.gen-D0ZCnKWv.d.ts} +1 -1
- package/dist/utils-CjDMg_Yr.d.ts +22 -0
- package/package.json +2 -2
- package/dist/ZendeskTriggerButton-Dditzyfj.d.ts +0 -47
- package/dist/chunk-2L3ISQJL.js +0 -2
- package/dist/chunk-2L3ISQJL.js.map +0 -1
- package/dist/chunk-2MG7YOPU.js.map +0 -1
- package/dist/chunk-3A47R5RQ.js +0 -2
- package/dist/chunk-3A47R5RQ.js.map +0 -1
- package/dist/chunk-4OAWZYH7.js +0 -2
- package/dist/chunk-5ENAY65Y.js +0 -2
- package/dist/chunk-5ENAY65Y.js.map +0 -1
- package/dist/chunk-5PPUPDYP.js +0 -2
- package/dist/chunk-6TY7IKSG.js +0 -2
- package/dist/chunk-6TY7IKSG.js.map +0 -1
- package/dist/chunk-7FAT6WCC.js +0 -2
- package/dist/chunk-7FAT6WCC.js.map +0 -1
- package/dist/chunk-7R347KBY.js +0 -2
- package/dist/chunk-7R347KBY.js.map +0 -1
- package/dist/chunk-7WDO47KQ.js +0 -2
- package/dist/chunk-7WDO47KQ.js.map +0 -1
- package/dist/chunk-7XDJV7LA.js +0 -2
- package/dist/chunk-7XDJV7LA.js.map +0 -1
- package/dist/chunk-A2KMKSSC.js +0 -2
- package/dist/chunk-A2KMKSSC.js.map +0 -1
- package/dist/chunk-ANHUECRI.js +0 -2
- package/dist/chunk-ANHUECRI.js.map +0 -1
- package/dist/chunk-AVX6IOGC.js +0 -2
- package/dist/chunk-AVX6IOGC.js.map +0 -1
- package/dist/chunk-BCXRPHWY.js +0 -2
- package/dist/chunk-BCXRPHWY.js.map +0 -1
- package/dist/chunk-CFIJKJXD.js +0 -2
- package/dist/chunk-CFIJKJXD.js.map +0 -1
- package/dist/chunk-D6X2WCEG.js +0 -2
- package/dist/chunk-D6X2WCEG.js.map +0 -1
- package/dist/chunk-DYB3RWP7.js +0 -20
- package/dist/chunk-DYB3RWP7.js.map +0 -1
- package/dist/chunk-FPJLWY23.js +0 -2
- package/dist/chunk-FPJLWY23.js.map +0 -1
- package/dist/chunk-FQYK5BJV.js.map +0 -1
- package/dist/chunk-GD425MMM.js +0 -2
- package/dist/chunk-GD425MMM.js.map +0 -1
- package/dist/chunk-GHV4Q4MB.js +0 -2
- package/dist/chunk-GHV4Q4MB.js.map +0 -1
- package/dist/chunk-H3ZR4EW5.js.map +0 -1
- package/dist/chunk-HPHWQU34.js +0 -2
- package/dist/chunk-HPHWQU34.js.map +0 -1
- package/dist/chunk-HS4VEURD.js +0 -2
- package/dist/chunk-HS4VEURD.js.map +0 -1
- package/dist/chunk-JBUNDNKJ.js +0 -2
- package/dist/chunk-JBUNDNKJ.js.map +0 -1
- package/dist/chunk-JCKQQFA4.js +0 -2
- package/dist/chunk-LGJYIUSH.js +0 -2
- package/dist/chunk-LGJYIUSH.js.map +0 -1
- package/dist/chunk-LWGVLLBH.js +0 -2
- package/dist/chunk-LWGVLLBH.js.map +0 -1
- package/dist/chunk-LYK6PNAY.js +0 -2
- package/dist/chunk-LYK6PNAY.js.map +0 -1
- package/dist/chunk-MQWVZSGH.js +0 -2
- package/dist/chunk-MQWVZSGH.js.map +0 -1
- package/dist/chunk-NCNXUNBB.js +0 -2
- package/dist/chunk-NCNXUNBB.js.map +0 -1
- package/dist/chunk-OLRZ3U4A.js +0 -2
- package/dist/chunk-OLRZ3U4A.js.map +0 -1
- package/dist/chunk-OOCCLRPH.js +0 -2
- package/dist/chunk-OUSDXTNH.js.map +0 -1
- package/dist/chunk-PAQW5BFW.js +0 -2
- package/dist/chunk-PAQW5BFW.js.map +0 -1
- package/dist/chunk-Q4BKFSTW.js +0 -2
- package/dist/chunk-Q4BKFSTW.js.map +0 -1
- package/dist/chunk-QFOYD5Q4.js.map +0 -1
- package/dist/chunk-QW322WRX.js.map +0 -1
- package/dist/chunk-SQENUVY5.js.map +0 -1
- package/dist/chunk-UBN6O7B5.js +0 -2
- package/dist/chunk-UBN6O7B5.js.map +0 -1
- package/dist/chunk-VSMVVIBA.js +0 -2
- package/dist/chunk-VSMVVIBA.js.map +0 -1
- package/dist/chunk-XDNUJY3V.js +0 -2
- package/dist/chunk-XDNUJY3V.js.map +0 -1
- package/dist/chunk-YXXCHMX3.js +0 -2
- package/dist/chunk-YXXCHMX3.js.map +0 -1
- package/dist/chunk-Z3BMF4BO.js +0 -1
- package/dist/chunk-ZE3YT3Q6.js +0 -2
- package/dist/chunk-ZE3YT3Q6.js.map +0 -1
- package/dist/chunk-ZSCKSEAA.js +0 -2
- package/dist/chunk-ZSCKSEAA.js.map +0 -1
- package/dist/chunk-ZX5OIIJX.js +0 -1
- package/dist/chunk-ZX5OIIJX.js.map +0 -1
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.d.ts +0 -8
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +0 -2
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +0 -16
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +0 -16
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.d.ts +0 -16
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +0 -10
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.d.ts +0 -9
- package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +0 -19
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.d.ts +0 -13
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js.map +0 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.d.ts +0 -9
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +0 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js.map +0 -1
- package/dist/flows/CostCalculator/disclaimerUtils.d.ts +0 -10
- package/dist/flows/CostCalculator/disclaimerUtils.js +0 -2
- package/dist/flows/CostCalculator/disclaimerUtils.js.map +0 -1
- package/dist/flows/api.d.ts +0 -33
- package/dist/flows/api.js +0 -2
- package/dist/flows/api.js.map +0 -1
- /package/dist/{chunk-E76DWINZ.js.map → chunk-2Q4L4WH7.js.map} +0 -0
- /package/dist/{chunk-BWJAHRV6.js.map → chunk-2S376WY7.js.map} +0 -0
- /package/dist/{chunk-PNAZ6US5.js.map → chunk-34TXLVDI.js.map} +0 -0
- /package/dist/{chunk-ID3ZF7QT.js.map → chunk-62HGJVHQ.js.map} +0 -0
- /package/dist/{chunk-P5WUODPR.js.map → chunk-65H2G43I.js.map} +0 -0
- /package/dist/{chunk-DPY77ASH.js.map → chunk-66L7BKYM.js.map} +0 -0
- /package/dist/{chunk-OIN3HGOQ.js.map → chunk-677KTHPH.js.map} +0 -0
- /package/dist/{chunk-FJPQPOK3.js.map → chunk-7CLHPFPZ.js.map} +0 -0
- /package/dist/{chunk-CYDWBHAA.js.map → chunk-7HSSHSYK.js.map} +0 -0
- /package/dist/{chunk-SXN63FPH.js.map → chunk-7LRY5QTK.js.map} +0 -0
- /package/dist/{chunk-PEHK6NHL.js.map → chunk-A477TZFC.js.map} +0 -0
- /package/dist/{chunk-GWICTLVR.js.map → chunk-A7BBVCMY.js.map} +0 -0
- /package/dist/{chunk-HWEJIPSK.js.map → chunk-AA7QB3QQ.js.map} +0 -0
- /package/dist/{chunk-WBN4ZSGC.js.map → chunk-DBGYYVFL.js.map} +0 -0
- /package/dist/{chunk-UPXJJBXZ.js.map → chunk-ED6E3V2E.js.map} +0 -0
- /package/dist/{chunk-ZQ6MG635.js.map → chunk-FEB3W622.js.map} +0 -0
- /package/dist/{chunk-Z3BMF4BO.js.map → chunk-FGBEOUQK.js.map} +0 -0
- /package/dist/{chunk-OQJWLV7V.js.map → chunk-FIXHXJGN.js.map} +0 -0
- /package/dist/{chunk-EKKRQI6B.js.map → chunk-GGQFBP37.js.map} +0 -0
- /package/dist/{chunk-JTOLQCOG.js.map → chunk-HKCDMC3H.js.map} +0 -0
- /package/dist/{chunk-IJR44ISO.js.map → chunk-I4XJ764Y.js.map} +0 -0
- /package/dist/{chunk-T2FGDQSU.js.map → chunk-ISQ6I4HJ.js.map} +0 -0
- /package/dist/{chunk-H7L735T7.js.map → chunk-LDZWM4VX.js.map} +0 -0
- /package/dist/{chunk-ACQ3OEOE.js.map → chunk-LLJWEHDJ.js.map} +0 -0
- /package/dist/{chunk-4X77DTSW.js.map → chunk-M3EBUSNT.js.map} +0 -0
- /package/dist/{chunk-TWIUL2P3.js.map → chunk-MOG7GUQB.js.map} +0 -0
- /package/dist/{chunk-ANGJCT4I.js.map → chunk-MPV22ALR.js.map} +0 -0
- /package/dist/{chunk-UZXTPQ47.js.map → chunk-PABPITPH.js.map} +0 -0
- /package/dist/{chunk-OIVWGY5Z.js.map → chunk-RSH5MZY3.js.map} +0 -0
- /package/dist/{chunk-OW5QGJD4.js.map → chunk-S2BJGON2.js.map} +0 -0
- /package/dist/{chunk-5ZR7EFPY.js.map → chunk-SHK2UKLD.js.map} +0 -0
- /package/dist/{chunk-6VRUYYUV.js.map → chunk-U5WVXSGT.js.map} +0 -0
- /package/dist/{chunk-EGSRN2CQ.js.map → chunk-WRNHET4F.js.map} +0 -0
- /package/dist/{chunk-JCKQQFA4.js.map → chunk-XOA7GG4P.js.map} +0 -0
- /package/dist/{chunk-26ZOPH2I.js.map → chunk-XPOLXRYT.js.map} +0 -0
- /package/dist/{chunk-R7W3BT6P.js.map → chunk-YCILXVJU.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":"s9HAAA,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,CAJSV,EAAAS,EAAA,gBAMF,SAASE,EAAWC,EAAoC,CACzDA,GAAO,QACTjB,EAAiBM,EAAeW,EAAM,MAAM,CAAC,EAG3CA,GAAO,SACTjB,EAAiBU,EAAgBO,EAAM,OAAO,CAAC,EAG7CA,GAAO,cACTjB,EAAiBY,EAAqBK,EAAM,YAAY,CAAC,EAGv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,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/auth/createClient.ts","../src/environments.ts","../src/lib/version.ts","../src/components/error-handling/RemoteFlowsErrorBoundary.tsx"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React, { useMemo } from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { createClient } from '@/src/auth/createClient';\nimport { Client } from '@hey-api/client-fetch';\nimport { RemoteFlowsErrorBoundary } from '@/src/components/error-handling/RemoteFlowsErrorBoundary';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n children: React.ReactNode;\n client: Client;\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n client,\n}: RemoteFlowContextWrapperProps) {\n return (\n <RemoteFlowContext.Provider value={{ client }}>\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 children,\n components,\n theme,\n proxy,\n environment,\n errorBoundary = { useParentErrorBoundary: true },\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n const client = useMemo(\n () => createClient(auth, { environment, proxy }),\n [auth, environment, proxy],\n );\n return (\n <RemoteFlowsErrorBoundary errorBoundary={errorBoundary}>\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper client={client}>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n </RemoteFlowsErrorBoundary>\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","import { createClient as createHeyApiClient } from '@hey-api/client-fetch';\nimport { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { npmPackageVersion } from '@/src/lib/version';\nimport { RemoteFlowsSDKProps } from '@/src/types/remoteFlows';\nimport { debug } from '@/src/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 function createClient(\n auth: () => Promise<AuthResponse>,\n options?: Options,\n) {\n const sessionRef = {\n current: null as { accessToken: string; expiresAt: number } | null,\n };\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\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 createHeyApiClient({\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\n if (\n !sessionRef.current ||\n hasTokenExpired(sessionRef.current.expiresAt)\n ) {\n try {\n const data = await auth();\n sessionRef.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n } catch (error) {\n console.error('Failed to fetch auth token:', error);\n return undefined;\n }\n }\n return sessionRef.current?.accessToken;\n },\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","/**\n * SDK version constant\n * Retrieved from package.json at build time\n * Falls back to 'unknown' if VERSION env var is not set\n */\nexport const npmPackageVersion = process.env.VERSION || 'unknown';\n","import { Component, ErrorInfo, ReactNode } from 'react';\n\ntype ErrorBoundaryState = {\n hasError: boolean;\n error: Error | null;\n};\n\ninterface RemoteFlowsErrorBoundaryProps {\n children: ReactNode;\n /**\n * Error boundary configuration.\n */\n errorBoundary?: {\n /**\n * If true, re-throws errors to parent error boundary.\n * If false, shows fallback UI to prevent crashes.\n * @default false\n */\n useParentErrorBoundary?: boolean;\n /**\n * Custom fallback UI to show when an error occurs.\n * fallback only works when rethrow is false.\n * If not provided, shows default error message.\n */\n fallback?: ReactNode | ((error: Error) => ReactNode);\n };\n}\n\nexport const FallbackErrorBoundary = () => {\n return (\n <div\n style={{\n padding: '20px',\n border: '1px solid #dc2626',\n borderRadius: '4px',\n backgroundColor: '#fef2f2',\n color: '#991b1b',\n }}\n >\n Something went wrong in RemoteFlows. Please refresh the page.\n </div>\n );\n};\n\nexport class RemoteFlowsErrorBoundary extends Component<\n RemoteFlowsErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: RemoteFlowsErrorBoundaryProps) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n };\n }\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return {\n hasError: true,\n error,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error('[RemoteFlows] Error caught:', error, errorInfo);\n\n if (this.props.errorBoundary?.useParentErrorBoundary) {\n throw error;\n }\n }\n\n render(): ReactNode {\n if (this.state.hasError && this.state.error) {\n // If custom fallback provided, use it\n if (this.props.errorBoundary?.fallback) {\n return typeof this.props.errorBoundary?.fallback === 'function'\n ? this.props.errorBoundary?.fallback(this.state.error)\n : this.props.errorBoundary?.fallback;\n }\n\n // Default fallback\n return <FallbackErrorBoundary />;\n }\n\n return this.props.children;\n }\n}\n"],"mappings":"6+GAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBAEjD,OAAgB,WAAAC,MAAe,QCQ/B,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC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CAAC,CAAE,EAErD,SAAAL,EACH,CAEJ,CAbgBG,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAC,EACA,SAAAR,EACA,WAAAK,EACA,MAAAI,EACA,MAAAC,EACA,YAAAC,EACA,cAAAC,EAAgB,CAAE,uBAAwB,EAAK,CACjD,EAA2C,CACzC,IAAMX,EAASY,EACb,IAAMC,EAAaN,EAAM,CAAE,YAAAG,EAAa,MAAAD,CAAM,CAAC,EAC/C,CAACF,EAAMG,EAAaD,CAAK,CAC3B,EACA,OACEd,EAACmB,EAAA,CAAyB,cAAeH,EACvC,SAAAhB,EAACoB,EAAA,CAAoB,OAAQnB,EAC3B,SAAAD,EAACQ,GAAA,CAAmB,WAAYC,EAC9B,SAAAT,EAACG,EAAA,CAAyB,OAAQE,EAChC,SAAAL,EAACqB,EAAA,CAAc,MAAOR,EAAQ,SAAAT,EAAS,EACzC,EACF,EACF,EACF,CAEJ,CAxBgBG,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","useMemo","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","createHeyApiClient","ENVIRONMENTS","npmPackageVersion","isValidUrl","url","__name","createClient","auth","options","sessionRef","baseUrl","ENVIRONMENTS","clientConfig","client","debug","npmPackageVersion","isValidProxy","createHeyApiClient","hasTokenExpired","expiresAt","data","error","Component","jsx","FallbackErrorBoundary","__name","RemoteFlowsErrorBoundary","Component","props","error","errorInfo","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","client","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","auth","theme","proxy","environment","errorBoundary","useMemo","createClient","RemoteFlowsErrorBoundary","QueryClientProvider","ThemeProvider"]}
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as cn } from './utils-CjDMg_Yr.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';
|
|
@@ -78,6 +78,15 @@ declare function Badge({ className, variant, asChild, ...props }: React.Componen
|
|
|
78
78
|
asChild?: boolean;
|
|
79
79
|
}): react_jsx_runtime.JSX.Element;
|
|
80
80
|
|
|
81
|
+
type FileUploaderProps = {
|
|
82
|
+
onChange: (files: File[]) => void;
|
|
83
|
+
className?: string;
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
accept?: string;
|
|
86
|
+
files?: File[];
|
|
87
|
+
};
|
|
88
|
+
declare function FileUploader({ onChange, className, multiple, accept, files: externalFiles, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
81
90
|
declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): react_jsx_runtime.JSX.Element;
|
|
82
91
|
|
|
83
92
|
declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
@@ -95,4 +104,4 @@ declare function SelectItem({ className, children, ...props }: React.ComponentPr
|
|
|
95
104
|
|
|
96
105
|
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
97
106
|
|
|
98
|
-
export { Alert, AlertDescription, AlertTitle, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger, Input, Label, RadioGroup, RadioGroupItem, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Tabs, TabsContent, TabsList, TabsTrigger, badgeVariants, buttonVariants };
|
|
107
|
+
export { Alert, AlertDescription, AlertTitle, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger, FileUploader, Input, Label, RadioGroup, RadioGroupItem, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Tabs, TabsContent, TabsList, TabsTrigger, badgeVariants, buttonVariants };
|
package/dist/internals.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as L,b as M,c as N,d as O,e as P,f as Q,g as R,h as S}from"./chunk-UK5HHMPM.js";import{a as F,b as G,c as H,d as I,e as J,f as K}from"./chunk-AFRA4BIW.js";import{a as i,b as l,c as m,d as n,e as o,g as p,h as q,i as r,j as s,k as t,l as u,m as v,n as w,o as x,p as y,q as z,r as A,s as B,t as C,u as D,v as E}from"./chunk-W5M5HLWF.js";import{a as d,b as e,c as f,d as g,e as h}from"./chunk-MOG7GUQB.js";import{a as c}from"./chunk-PD24XKD6.js";import{a as j,b as k}from"./chunk-WVDTHFGS.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,k as Button,F as Card,J as CardContent,I as CardDescription,K as CardFooter,G as CardHeader,H as CardTitle,i as Checkbox,L as Collapsible,N as CollapsibleContent,M 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,l as FileUploader,c as Input,b as Label,m as RadioGroup,n as RadioGroupItem,S as ScrollArea,o as Select,r as SelectContent,s as SelectItem,q as SelectTrigger,p as SelectValue,O as Tabs,R as TabsContent,P as TabsList,Q as TabsTrigger,t as badgeVariants,j 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
2
|
import React__default, { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { AnySchema } from 'yup';
|
|
4
|
-
import {
|
|
4
|
+
import { a2 as HelpCenterArticle } from './types.gen-D0ZCnKWv.js';
|
|
5
5
|
import { S as SupportedTypes } from './types-Zg1n_9wh.js';
|
|
6
6
|
|
|
7
7
|
type ThemeProviderProps = PropsWithChildren<{
|
|
@@ -48,6 +48,20 @@ type ColumnDef<T = $TSFixMe> = {
|
|
|
48
48
|
render?: (value: $TSFixMe, row: T, index: number) => React__default.ReactNode;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Base type for field metadata passed to custom field components.
|
|
53
|
+
* Extends JSFField with optional metadata for extensibility.
|
|
54
|
+
*/
|
|
55
|
+
type FieldDataProps = Partial<JSFField> & {
|
|
56
|
+
metadata?: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
type FieldFileDataProps = FieldDataProps & {
|
|
60
|
+
accept?: string;
|
|
61
|
+
multiple?: boolean;
|
|
62
|
+
maxFileSize?: number;
|
|
63
|
+
};
|
|
64
|
+
|
|
51
65
|
type AuthResponse = {
|
|
52
66
|
accessToken: string;
|
|
53
67
|
expiresIn: number;
|
|
@@ -113,9 +127,7 @@ type FieldComponentProps = {
|
|
|
113
127
|
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
114
128
|
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
115
129
|
*/
|
|
116
|
-
fieldData:
|
|
117
|
-
metadata?: Record<string, unknown>;
|
|
118
|
-
};
|
|
130
|
+
fieldData: FieldDataProps;
|
|
119
131
|
};
|
|
120
132
|
/**
|
|
121
133
|
* Props for custom button components.
|
|
@@ -162,9 +174,14 @@ type FieldSetToggleComponentProps = {
|
|
|
162
174
|
className?: string;
|
|
163
175
|
children?: React.ReactNode;
|
|
164
176
|
};
|
|
177
|
+
type TypesWithoutFile = Exclude<SupportedTypes, 'file'>;
|
|
178
|
+
type FileComponentProps = FieldComponentProps & {
|
|
179
|
+
fieldData: FieldFileDataProps;
|
|
180
|
+
};
|
|
165
181
|
type Components = {
|
|
166
|
-
[K in
|
|
182
|
+
[K in TypesWithoutFile]?: React.ComponentType<FieldComponentProps>;
|
|
167
183
|
} & {
|
|
184
|
+
file?: React.ComponentType<FileComponentProps>;
|
|
168
185
|
statement?: React.ComponentType<StatementComponentProps>;
|
|
169
186
|
button?: React.ComponentType<ButtonComponentProps>;
|
|
170
187
|
fieldsetToggle?: React.ComponentType<FieldSetToggleComponentProps>;
|
|
@@ -200,11 +217,22 @@ type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
|
200
217
|
};
|
|
201
218
|
};
|
|
202
219
|
/**
|
|
203
|
-
*
|
|
204
|
-
* If we navigate from one page to another with a different authentication method,
|
|
205
|
-
* we need to use a different authId.
|
|
220
|
+
* Error boundary configuration.
|
|
206
221
|
*/
|
|
207
|
-
|
|
222
|
+
errorBoundary?: {
|
|
223
|
+
/**
|
|
224
|
+
* If true, re-throws errors to parent error boundary.
|
|
225
|
+
* If false, shows fallback UI to prevent crashes.
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
228
|
+
useParentErrorBoundary?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Custom fallback UI to show when an error occurs.
|
|
231
|
+
* fallback only works when rethrow is false.
|
|
232
|
+
* If not provided, shows default error message.
|
|
233
|
+
*/
|
|
234
|
+
fallback?: ReactNode | ((error: Error) => ReactNode);
|
|
235
|
+
};
|
|
208
236
|
};
|
|
209
237
|
type $TSFixMe = any;
|
|
210
238
|
declare global {
|
|
@@ -222,4 +250,4 @@ type MetaValues = {
|
|
|
222
250
|
};
|
|
223
251
|
type Meta = Record<string, MetaValues>;
|
|
224
252
|
|
|
225
|
-
export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, DrawerComponentProps as D, FieldComponentProps as F, JSFFieldset as J, Meta as M, RemoteFlowsSDKProps as R, StatementComponentProps as S, ZendeskDrawerComponentProps as Z, JSFField as a, FieldSetToggleComponentProps as b };
|
|
253
|
+
export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, DrawerComponentProps as D, FieldComponentProps as F, JSFFieldset as J, Meta as M, RemoteFlowsSDKProps as R, StatementComponentProps as S, ZendeskDrawerComponentProps as Z, JSFField as a, FieldSetToggleComponentProps as b, FileComponentProps as c };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as EmploymentCreationResponse, A as EmploymentResponse, S as SuccessResponse, y as PostCreateEmployment2Error, B as PatchUpdateEmployment2Error, G as PutUpdateBenefitOfferError, E as Employment$1, z as EmploymentCreateParams } from './types.gen-D0ZCnKWv.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-Dj5OTaG_.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-CJkEwDeI.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';
|
|
@@ -141,10 +141,10 @@ declare const useOnboarding: ({ employmentId, companyId, countryCode, type, opti
|
|
|
141
141
|
* @param values - Form values to validate
|
|
142
142
|
* @returns Validation result or null if no schema is available
|
|
143
143
|
*/
|
|
144
|
-
handleValidation: (values: FieldValues) => {
|
|
144
|
+
handleValidation: (values: FieldValues) => Promise<{
|
|
145
145
|
yupError: _remoteoss_json_schema_form.$TSFixMe;
|
|
146
146
|
formErrors: _remoteoss_json_schema_form.$TSFixMe;
|
|
147
|
-
} | null
|
|
147
|
+
} | null>;
|
|
148
148
|
/**
|
|
149
149
|
* Function to update the current form field values
|
|
150
150
|
* @param values - New form values to set
|
|
@@ -155,7 +155,7 @@ declare const useOnboarding: ({ employmentId, companyId, countryCode, type, opti
|
|
|
155
155
|
* @param values - Form values to parse
|
|
156
156
|
* @returns Parsed form values
|
|
157
157
|
*/
|
|
158
|
-
parseFormValues: (values: FieldValues) => FieldValues
|
|
158
|
+
parseFormValues: (values: FieldValues) => Promise<FieldValues>;
|
|
159
159
|
/**
|
|
160
160
|
* Function to handle form submission
|
|
161
161
|
* @param values - Form values to submit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, a1 as PayrollCalendarEor, E as Employment, T as TerminationDetailsParams, N as PostCreateOffboardingError } from './types.gen-D0ZCnKWv.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-Dj5OTaG_.js';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
6
6
|
import { $TSFixMe } from '@remoteoss/json-schema-form';
|
|
@@ -109,10 +109,10 @@ declare const useTermination: ({ employmentId, options, initialValues: terminati
|
|
|
109
109
|
* @param values - Form values to validate
|
|
110
110
|
* @returns Validation result or null if no schema is available
|
|
111
111
|
*/
|
|
112
|
-
handleValidation: (values: TerminationFormValues) => {
|
|
112
|
+
handleValidation: (values: TerminationFormValues) => Promise<{
|
|
113
113
|
yupError: $TSFixMe;
|
|
114
114
|
formErrors: $TSFixMe;
|
|
115
|
-
} | null
|
|
115
|
+
} | null>;
|
|
116
116
|
/**
|
|
117
117
|
* Function to update the current form field values
|
|
118
118
|
* @param values - New form values to set
|
|
@@ -123,7 +123,7 @@ declare const useTermination: ({ employmentId, options, initialValues: terminati
|
|
|
123
123
|
* @param values - Form values to parse
|
|
124
124
|
* @returns Parsed form values
|
|
125
125
|
*/
|
|
126
|
-
parseFormValues: (values: TerminationFormValues, includeAllFields?: boolean) => EmployeeCommunicationFormValues | TerminationDetailsFormValues | PaidTimeOffFormValues | TerminationFormValues
|
|
126
|
+
parseFormValues: (values: TerminationFormValues, includeAllFields?: boolean) => Promise<EmployeeCommunicationFormValues | TerminationDetailsFormValues | PaidTimeOffFormValues | TerminationFormValues>;
|
|
127
127
|
/**
|
|
128
128
|
* Function to handle form submission
|
|
129
129
|
* @param values - Form values to submit
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Employment,
|
|
1
|
+
import { E as Employment, Q as ListTimeoffResponse, R as TimeoffStatus, W as TimeoffType, X as ListLeavePoliciesSummaryResponse, Y as MagicLinkResponse, Z as UnprocessableEntityResponse, _ as MagicLinkParams } from './types.gen-D0ZCnKWv.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';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { E as Employment, F as File,
|
|
1
|
+
import { E as Employment, F as File, g as CreateContractDocumentResponse, d as SignContractDocument, S as SuccessResponse } from './types.gen-D0ZCnKWv.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-Dj5OTaG_.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-CJkEwDeI.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-CrBx80W2.js';
|
|
16
16
|
import { FlowOptions, JSFModify } from './flows/types.js';
|
|
17
17
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
18
18
|
|
|
@@ -101,16 +101,16 @@ declare const useContractorOnboarding: ({ countryCode, externalId, employmentId,
|
|
|
101
101
|
* @param values - Form values to parse
|
|
102
102
|
* @returns Parsed form values
|
|
103
103
|
*/
|
|
104
|
-
parseFormValues: (values: FieldValues) => FieldValues
|
|
104
|
+
parseFormValues: (values: FieldValues) => Promise<FieldValues>;
|
|
105
105
|
/**
|
|
106
106
|
* Function to validate form values against the onboarding schema
|
|
107
107
|
* @param values - Form values to validate
|
|
108
108
|
* @returns Validation result or null if no schema is available
|
|
109
109
|
*/
|
|
110
|
-
handleValidation: (values: FieldValues) => {
|
|
110
|
+
handleValidation: (values: FieldValues) => Promise<{
|
|
111
111
|
yupError: _remoteoss_json_schema_form.$TSFixMe;
|
|
112
112
|
formErrors: _remoteoss_json_schema_form.$TSFixMe;
|
|
113
|
-
} | null
|
|
113
|
+
} | null>;
|
|
114
114
|
/**
|
|
115
115
|
* Initial form values
|
|
116
116
|
*/
|
|
@@ -1639,4 +1639,4 @@ type PostManageContractorPlusSubscriptionSubscriptionErrors = {
|
|
|
1639
1639
|
};
|
|
1640
1640
|
type PostManageContractorPlusSubscriptionSubscriptionError = PostManageContractorPlusSubscriptionSubscriptionErrors[keyof PostManageContractorPlusSubscriptionSubscriptionErrors];
|
|
1641
1641
|
|
|
1642
|
-
export type {
|
|
1642
|
+
export type { CreateOffboardingParams as $, EmploymentResponse as A, PatchUpdateEmployment2Error as B, ContractAmendmentAutomatableResponse as C, EmploymentFullParams as D, Employment as E, File as F, PutUpdateBenefitOfferError as G, ConvertCurrencyResponse as H, PostConvertRawCurrencyConverterError as I, ConvertCurrencyParams as J, PostCreateContractEligibilityError as K, CreateContractEligibilityParams as L, ManageContractorPlusSubscriptionOperationsParams as M, PostCreateOffboardingError as N, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, ListTimeoffResponse as Q, TimeoffStatus as R, SuccessResponse as S, TerminationDetailsParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, TimeoffType as W, ListLeavePoliciesSummaryResponse as X, MagicLinkResponse as Y, UnprocessableEntityResponse as Z, MagicLinkParams as _, ContractAmendmentResponse as a, Currency as a0, PayrollCalendarEor as a1, HelpCenterArticle as a2, PostCreateContractAmendmentError as b, PostSignContractDocumentError as c, SignContractDocument as d, ContractorSubscriptionsSummary as e, PostManageContractorPlusSubscriptionSubscriptionError 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, MinimalRegion as q, MinimalCountry as r, EmploymentTermType as s, CostCalculatorEmployment as t, EmploymentCreationResponse as u, Company as v, PostInviteEmploymentInvitationError as w, PostCreateRiskReserveError as x, PostCreateEmployment2Error as y, EmploymentCreateParams as z };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { ValidationError } from 'yup';
|
|
3
|
+
|
|
4
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
5
|
+
type YupError = Pick<ValidationError, 'type' | 'errors'> & {
|
|
6
|
+
inner: Record<string, YupError>[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Transforms a Yup ValidationError object into a more readable object. The format is as follows:
|
|
10
|
+
* {
|
|
11
|
+
* [fieldName]: {
|
|
12
|
+
* type: string,
|
|
13
|
+
* errors: string[],
|
|
14
|
+
* inner: YupError[],
|
|
15
|
+
* },
|
|
16
|
+
* }
|
|
17
|
+
* @param errors
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
declare const transformYupErrorsIntoObject: (errors: ValidationError) => Record<string, YupError>;
|
|
21
|
+
|
|
22
|
+
export { cn as c, transformYupErrorsIntoObject as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remoteoss/remote-flows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "NODE_ENV=production tsup",
|
|
6
6
|
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run type-check && npm run test",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"@radix-ui/react-tabs": "^1.1.3",
|
|
77
77
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
78
78
|
"@remoteoss/json-schema-form": "0.11.10-beta.0",
|
|
79
|
+
"@remoteoss/json-schema-form-next": "npm:@remoteoss/json-schema-form@1.2.7",
|
|
79
80
|
"@tailwindcss/cli": "^4.0.9",
|
|
80
81
|
"@tailwindcss/postcss": "^4.0.9",
|
|
81
82
|
"@tanstack/react-query": "^5.67.2",
|
|
@@ -98,7 +99,6 @@
|
|
|
98
99
|
"react-flagpack": "^2.0.6",
|
|
99
100
|
"react-hook-form": "^7.54.2",
|
|
100
101
|
"react-pdf": "^10.2.0",
|
|
101
|
-
"recharts": "^2.15.1",
|
|
102
102
|
"tailwind-merge": "^3.0.2",
|
|
103
103
|
"tailwindcss": "^4.0.9",
|
|
104
104
|
"tailwindcss-animate": "^1.0.7",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from 'clsx';
|
|
2
|
-
import { ValidationError } from 'yup';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
6
|
-
type YupError = Pick<ValidationError, 'type' | 'errors'> & {
|
|
7
|
-
inner: Record<string, YupError>[];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Transforms a Yup ValidationError object into a more readable object. The format is as follows:
|
|
11
|
-
* {
|
|
12
|
-
* [fieldName]: {
|
|
13
|
-
* type: string,
|
|
14
|
-
* errors: string[],
|
|
15
|
-
* inner: YupError[],
|
|
16
|
-
* },
|
|
17
|
-
* }
|
|
18
|
-
* @param errors
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
declare const transformYupErrorsIntoObject: (errors: ValidationError) => Record<string, YupError>;
|
|
22
|
-
|
|
23
|
-
interface ZendeskTriggerButtonProps {
|
|
24
|
-
/**
|
|
25
|
-
* The Zendesk ID for the help article
|
|
26
|
-
*/
|
|
27
|
-
zendeskId: number;
|
|
28
|
-
/**
|
|
29
|
-
* The class name for the button
|
|
30
|
-
*/
|
|
31
|
-
className?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The callback function to be called when the button is clicked
|
|
34
|
-
*/
|
|
35
|
-
onClick?: (zendeskId: number) => void;
|
|
36
|
-
/**
|
|
37
|
-
* The children to be rendered inside the button
|
|
38
|
-
*/
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to open the help article in a new tab
|
|
42
|
-
*/
|
|
43
|
-
external?: boolean;
|
|
44
|
-
}
|
|
45
|
-
declare function ZendeskTriggerButton({ zendeskId, className, onClick, children, external, }: ZendeskTriggerButtonProps): react_jsx_runtime.JSX.Element;
|
|
46
|
-
|
|
47
|
-
export { ZendeskTriggerButton as Z, cn as c, transformYupErrorsIntoObject as t };
|
package/dist/chunk-2L3ISQJL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-JCKQQFA4.js";import{a as n}from"./chunk-XFD3ULUF.js";import{b as i}from"./chunk-HWEJIPSK.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as r}from"./chunk-P37U34EQ.js";import{modify as c}from"@remoteoss/json-schema-form";import{useMutation as l,useQuery as p}from"@tanstack/react-query";import{createHeadlessForm as y}from"@remoteoss/json-schema-form";var V=r(()=>{let{client:o}=a();return l({mutationFn:r(e=>i({client:o,body:e}),"mutationFn")})},"useCreateTermination"),M=r(({formValues:o,jsfModify:e,step:m})=>p({queryKey:["rmt-flows-termination-schema",m],queryFn:r(()=>s[m]??n,"queryFn"),select:r(({data:f})=>{let t=f?.schema||{};if(e){let{schema:u}=c(t,e);t=u}return y(t||{},{initialValues:o||{}})},"select")}),"useTerminationSchema");export{V as a,M as b};
|
|
2
|
-
//# sourceMappingURL=chunk-2L3ISQJL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/api.ts"],"sourcesContent":["import { postCreateOffboarding } from '@/src/client/sdk.gen';\nimport { CreateOffboardingParams } from '@/src/client/types.gen';\nimport { useClient } from '@/src/context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { JSFModify } from '@/src/flows/types';\nimport { Client } from '@hey-api/client-fetch';\nimport { modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { createHeadlessForm } from '@remoteoss/json-schema-form';\nimport { defaultSchema } from '@/src/flows/Termination/json-schemas/defaultSchema';\nimport { schema } from '@/src/flows/Termination/json-schemas/schema';\n\nexport const useCreateTermination = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CreateOffboardingParams) => {\n return postCreateOffboarding({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useTerminationSchema = ({\n formValues,\n jsfModify,\n step,\n}: {\n formValues?: TerminationFormValues;\n jsfModify?: JSFModify;\n step?: string;\n}) => {\n return useQuery({\n queryKey: ['rmt-flows-termination-schema', step],\n queryFn: () => {\n return schema[step as keyof typeof schema] ?? defaultSchema;\n },\n select: ({ data }) => {\n let jsfSchema = data?.schema || {};\n if (jsfModify) {\n const { schema } = modify(jsfSchema, jsfModify);\n jsfSchema = schema;\n }\n const form = createHeadlessForm(jsfSchema || {}, {\n initialValues: formValues || {},\n });\n return form;\n },\n });\n};\n"],"mappings":"wMAMA,OAAS,UAAAA,MAAc,8BACvB,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBACtC,OAAS,sBAAAC,MAA0B,8BAI5B,IAAMC,EAAuBC,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYH,EAACI,GACJC,EAAsB,CAC3B,OAAQJ,EACR,KAAMG,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAVoC,wBAYvBE,EAAuBN,EAAA,CAAC,CACnC,WAAAO,EACA,UAAAC,EACA,KAAAC,CACF,IAKSC,EAAS,CACd,SAAU,CAAC,+BAAgCD,CAAI,EAC/C,QAAST,EAAA,IACAW,EAAOF,CAA2B,GAAKG,EADvC,WAGT,OAAQZ,EAAA,CAAC,CAAE,KAAAa,CAAK,IAAM,CACpB,IAAIC,EAAYD,GAAM,QAAU,CAAC,EACjC,GAAIL,EAAW,CACb,GAAM,CAAE,OAAAG,CAAO,EAAII,EAAOD,EAAWN,CAAS,EAC9CM,EAAYH,CACd,CAIA,OAHaK,EAAmBF,GAAa,CAAC,EAAG,CAC/C,cAAeP,GAAc,CAAC,CAChC,CAAC,CAEH,EAVQ,SAWV,CAAC,EAzBiC","names":["modify","useMutation","useQuery","createHeadlessForm","useCreateTermination","__name","client","useClient","useMutation","payload","postCreateOffboarding","useTerminationSchema","formValues","jsfModify","step","useQuery","schema","defaultSchema","data","jsfSchema","modify","createHeadlessForm"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/common/api/payroll-calendars.ts","../src/common/employment.ts"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format, isFuture, parseISO, subDays } 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 EmployeeCommunicationFormValues,\n PaidTimeOffFormValues,\n TerminationDetailsFormValues,\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 {\n buildInitialValues,\n calculateMinTerminationDate,\n calculateProposedTerminationDateStatement,\n STEPS,\n} from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { terminationDetailsSchema } from '@/src/flows/Termination/json-schemas/terminationDetails';\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 { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\nimport { usePayrollCalendars } from '@/src/common/api/payroll-calendars';\nimport { isInProbationPeriod } from '@/src/common/employment';\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 } = useEmploymentQuery({ employmentId });\n\n const { data: payrollCalendars } = usePayrollCalendars({\n query: {\n year: new Date().getFullYear().toString(),\n countryCode: employment?.country?.code,\n },\n options: {\n enabled: Boolean(employment?.country?.code),\n },\n });\n\n const isEmployeeInProbationPeriod = isInProbationPeriod(\n employment?.probation_period_end_date,\n );\n\n const minTerminationDate = calculateMinTerminationDate(payrollCalendars);\n const minDate = useMemo(\n () =>\n isEmployeeInProbationPeriod\n ? format(new Date(), 'yyyy-MM-dd')\n : format(minTerminationDate, 'yyyy-MM-dd'),\n [isEmployeeInProbationPeriod, minTerminationDate],\n );\n\n const hasFutureStartDate = Boolean(\n employment?.provisional_start_date &&\n isFuture(parseISO(employment.provisional_start_date)),\n );\n\n const initialValues = buildInitialValues(\n {\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 hasFutureStartDate,\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 proposedTerminationDateStatement =\n calculateProposedTerminationDateStatement({\n minTerminationDate,\n isEmployeeInProbationPeriod,\n selectedDate: parseISO(formValues.proposed_termination_date),\n });\n\n const customFields = useMemo(() => {\n const originalTerminationReasonOptions =\n terminationDetailsSchema.data.schema.properties.termination_reason.oneOf;\n\n const terminationReasonOptions = hasFutureStartDate\n ? originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const === 'cancellation_before_start_date',\n )\n : originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const !== 'cancellation_before_start_date',\n );\n\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 termination_reason: {\n ...(options?.jsfModify?.fields?.termination_reason as $TSFixMe),\n oneOf: terminationReasonOptions,\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 external\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: minDate,\n ...(formValues.termination_reason ===\n 'cancellation_before_start_date' &&\n employment?.provisional_start_date\n ? {\n maxDate: format(\n subDays(parseISO(employment.provisional_start_date), 1),\n 'yyyy-MM-dd',\n ),\n }\n : {}),\n ...proposedTerminationDateStatement,\n },\n ...(formValues.termination_reason === 'cancellation_before_start_date'\n ? {\n 'x-jsf-errorMessage': {\n maximum:\n \"The proposed termination date must be before the employee's start date.\",\n },\n }\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 employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n employment,\n employmentId,\n formValues.proposed_termination_date,\n formValues.termination_reason,\n hasFutureStartDate,\n minDate,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.termination_reason,\n proposedTerminationDateStatement,\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 const isDirty = Boolean(Object.keys(fieldValues).length > 0);\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Employment data\n */\n employment,\n\n /**\n * Current form field values, we use formValues to let the user know about all the current form values\n */\n fieldValues: formValues,\n\n /**\n * Indicates if the form is dirty\n */\n isDirty,\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: setFieldValues,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (\n values: TerminationFormValues,\n includeAllFields: boolean = false,\n ):\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues\n | TerminationFormValues => {\n if (includeAllFields) {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n }) as TerminationFormValues;\n }\n\n if (terminationHeadlessForm) {\n return parseJSFToValidate(values, terminationHeadlessForm?.fields, {\n isPartialValidation: true,\n }) as\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues;\n }\n return {} as $TSFixMe;\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 { useQuery } from '@tanstack/react-query';\nimport { getIndexEorPayrollCalendar } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@hey-api/client-fetch';\n\nexport const usePayrollCalendars = ({\n query,\n options,\n}: {\n query?: {\n year?: string;\n countryCode?: string;\n };\n options?: {\n enabled?: boolean;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['payroll-calendars'],\n queryFn: () =>\n getIndexEorPayrollCalendar({\n client: client as Client,\n query: {\n year: query?.year,\n country_code: query?.countryCode,\n },\n }),\n enabled: options?.enabled,\n select: (data) => data.data?.data?.payroll_calendars?.[0],\n });\n};\n","import { isFuture, isToday, parseISO } from 'date-fns';\n\nexport const isInProbationPeriod = (probationEndDate: string | undefined) => {\n if (!probationEndDate) return false;\n\n const parsedProbationEndDate = parseISO(probationEndDate);\n\n return isFuture(parsedProbationEndDate) || isToday(parsedProbationEndDate);\n};\n"],"mappings":"kyBAAA,OAAmB,sBAAAA,OAA0B,8BAC7C,OAAOC,OAAY,gBACnB,OAAOC,OAAY,gBACnB,OAAS,UAAAC,EAAQ,YAAAC,GAAU,YAAAC,EAAU,WAAAC,OAAe,WACpD,OAAS,WAAAC,MAAe,QAcxB,OAAOC,OAAU,cClBjB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,EAAsBC,EAAA,CAAC,CAClC,MAAAC,EACA,QAAAC,CACF,IAQM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,mBAAmB,EAC9B,QAASL,EAAA,IACPM,EAA2B,CACzB,OAAQH,EACR,MAAO,CACL,KAAMF,GAAO,KACb,aAAcA,GAAO,WACvB,CACF,CAAC,EAPM,WAQT,QAASC,GAAS,QAClB,OAAQF,EAACO,GAASA,EAAK,MAAM,MAAM,oBAAoB,CAAC,EAAhD,SACV,CAAC,CACH,EA1BmC,uBCLnC,OAAS,YAAAC,GAAU,WAAAC,GAAS,YAAAC,OAAgB,WAErC,IAAMC,EAAsBC,EAACC,GAAyC,CAC3E,GAAI,CAACA,EAAkB,MAAO,GAE9B,IAAMC,EAAyBC,GAASF,CAAgB,EAExD,OAAOG,GAASF,CAAsB,GAAKG,GAAQH,CAAsB,CAC3E,EANmC,uBF0IzB,mBAAAI,GAKE,OAAAC,EALF,QAAAC,OAAA,oBAhGH,IAAMC,GAAiBC,EAAA,CAAC,CAC7B,aAAAC,EACA,QAAAC,EACA,cAAeC,CACjB,IAA4B,CAC1B,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,UAAAC,EAAW,aAAAC,EAAc,SAAAC,CAAS,EACrEC,EAAwDC,CAAK,EAEzD,CAAE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CAAC,EAGCH,EACKa,EAAmBF,EAAQX,GAAyB,OAAQ,CACjE,oBAAqB,EACvB,CAAC,EAKI,CAAC,EAtBO,mBA6BjB,SAAAU,GAMA,KAAAa,GAMA,KAAAC,EACF,CACF,EArc8B","names":["createHeadlessForm","omitBy","isNull","format","isFuture","parseISO","subDays","useMemo","omit","useQuery","usePayrollCalendars","__name","query","options","client","useClient","useQuery","getIndexEorPayrollCalendar","data","isFuture","isToday","parseISO","isInProbationPeriod","__name","probationEndDate","parsedProbationEndDate","parseISO","isFuture","isToday","Fragment","jsx","jsxs","useTermination","__name","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","payrollCalendars","usePayrollCalendars","isEmployeeInProbationPeriod","isInProbationPeriod","minTerminationDate","calculateMinTerminationDate","minDate","useMemo","format","hasFutureStartDate","isFuture","parseISO","initialValues","buildInitialValues","formValues","proposedTerminationDateStatement","calculateProposedTerminationDateStatement","customFields","originalTerminationReasonOptions","terminationDetailsSchema","terminationReasonOptions","option","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","subDays","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","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","isDirty","includeAllFields"]}
|
package/dist/chunk-3A47R5RQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-43WMZDDH.js";import*as c from"react";import*as r from"@radix-ui/react-scroll-area";import{jsx as l,jsxs as n}from"react/jsx-runtime";var S=c.forwardRef(({className:o,children:e,...i},a)=>n(r.Root,{ref:a,className:t("relative overflow-hidden",o),...i,children:[l(r.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),l(m,{}),l(r.Corner,{})]}));S.displayName=r.Root.displayName;var m=c.forwardRef(({className:o,orientation:e="vertical",...i},a)=>l(r.ScrollAreaScrollbar,{ref:a,orientation:e,className:t("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",o),...i,children:l(r.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));m.displayName=r.ScrollAreaScrollbar.displayName;export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3A47R5RQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/scroll-area.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nimport { cn } from '@/src/lib/utils';\n\nconst ScrollArea = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className='h-full w-full rounded-[inherit]'>\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors',\n orientation === 'vertical' &&\n 'h-full w-2.5 border-l border-l-transparent p-[1px]',\n orientation === 'horizontal' &&\n 'h-2.5 flex-col border-t border-t-transparent p-[1px]',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className='relative flex-1 rounded-full bg-border' />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n"],"mappings":"wCAAA,UAAYA,MAAW,QACvB,UAAYC,MAAyB,8BAQnC,OAKE,OAAAC,EALF,QAAAC,MAAA,oBAJF,IAAMC,EAAmB,aAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IACpCL,EAAqB,OAApB,CACC,IAAKK,EACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EAEJ,UAAAL,EAAqB,WAApB,CAA6B,UAAU,kCACrC,SAAAI,EACH,EACAJ,EAACQ,EAAA,EAAU,EACXR,EAAqB,SAApB,EAA2B,GAC9B,CACD,EACDE,EAAW,YAAkC,OAAK,YAElD,IAAMM,EAAkB,aAGtB,CAAC,CAAE,UAAAL,EAAW,YAAAM,EAAc,WAAY,GAAGJ,CAAM,EAAGC,IACpDN,EAAqB,sBAApB,CACC,IAAKM,EACL,YAAaG,EACb,UAAWF,EACT,gDACAE,IAAgB,YACd,qDACFA,IAAgB,cACd,uDACFN,CACF,EACC,GAAGE,EAEJ,SAAAL,EAAqB,kBAApB,CAAoC,UAAU,yCAAyC,EAC1F,CACD,EACDQ,EAAU,YAAkC,sBAAoB","names":["React","ScrollAreaPrimitive","jsx","jsxs","ScrollArea","className","children","props","ref","cn","ScrollBar","orientation"]}
|
package/dist/chunk-4OAWZYH7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-FQYK5BJV.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function u({onSubmit:a}){let{terminationBag:i}=n();return e(t,{onSubmit:o(async r=>{await a?.(i?.parseFormValues(r)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
|
|
2
|
-
//# sourceMappingURL=chunk-4OAWZYH7.js.map
|
package/dist/chunk-5ENAY65Y.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,b as e}from"./chunk-OQJWLV7V.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(e,{zendeskId:a.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-5ENAY65Y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorGrossSalary.tsx"],"sourcesContent":["import { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\nimport { Button } from '@/src/components/ui/button';\nimport { Info } from 'lucide-react';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype CostCalculatorGrossSalaryProps = {\n grossSalary: number;\n currency: string;\n hasExtraStatutoryPayment?: boolean;\n};\n\nexport function CostCalculatorGrossSalary({\n grossSalary,\n currency,\n hasExtraStatutoryPayment = false,\n}: CostCalculatorGrossSalaryProps) {\n return (\n <div>\n <div className='flex justify-between items-center mb-2'>\n <div className='flex items-center gap-2'>\n <h3 className='font-medium text-primary-foreground'>Gross Salary</h3>\n {hasExtraStatutoryPayment && (\n <BasicTooltip\n content={\n <>\n <span>\n This country respects extra payments on top of the gross\n salary.\n </span>{' '}\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.extraPayments}\n >\n Learn more\n </ZendeskTriggerButton>\n </>\n }\n >\n <Button variant='ghost' size='icon' className='h-4 w-4 p-0 mt-2'>\n <Info className='h-3 w-3 text-gray-400' />\n <span className='sr-only'>Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span className='font-semibold text-lg'>\n {formatCurrency(grossSalary, currency)}\n </span>\n </div>\n <Separator />\n </div>\n );\n}\n"],"mappings":"kPAIA,OAAS,QAAAA,MAAY,eAmBX,OAIM,YAAAC,EAJN,OAAAC,EAIM,QAAAC,MAJN,oBATH,SAASC,EAA0B,CACxC,YAAAC,EACA,SAAAC,EACA,yBAAAC,EAA2B,EAC7B,EAAmC,CACjC,OACEJ,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAAC,MAAG,UAAU,sCAAsC,wBAAY,EAC/DK,GACCL,EAACM,EAAA,CACC,QACEL,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAK,4EAGN,EAAQ,IACRA,EAACO,EAAA,CACC,UAAWC,EAAgB,cAC5B,sBAED,GACF,EAGF,SAAAP,EAACQ,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,mBAC5C,UAAAT,EAACU,EAAA,CAAK,UAAU,wBAAwB,EACxCV,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAW,EAAeR,EAAaC,CAAQ,EACvC,GACF,EACAJ,EAACY,EAAA,EAAU,GACb,CAEJ,CAxCgBC,EAAAX,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorGrossSalary","grossSalary","currency","hasExtraStatutoryPayment","BasicTooltip","ZendeskTriggerButton","zendeskArticles","Button","Info","formatCurrency","Separator","__name"]}
|
package/dist/chunk-5PPUPDYP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-FQYK5BJV.js";import{b as i}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:m}=i();return a(n,{onSubmit:o(async t=>{await e?.(m?.parseFormValues(t)),m?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5PPUPDYP.js.map
|
package/dist/chunk-6TY7IKSG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{b as o}from"./chunk-OQJWLV7V.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Info as u}from"lucide-react";import{Fragment as f,jsx as e,jsxs as t}from"react/jsx-runtime";function w({benefitsTotal:d,benefitsBreakdown:p,currency:n}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:a(d,n)})]}),e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,c)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(f,{children:[e("span",{children:s.description})," ",s.zendesk_article_url&&e(o,{zendeskId:Number(s.zendesk_article_id),children:"Learn more"})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(u,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(s.amount,n)})]},c))})]})}r(w,"CostCalculatorBenefitsBreakdown");export{w as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6TY7IKSG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype CostCalculatorBenefitsBreakdownProps = {\n benefitsTotal: number | undefined;\n benefitsBreakdown: {\n name: string;\n description: string | null;\n amount: number;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n }[];\n currency: string;\n};\n\nexport function CostCalculatorBenefitsBreakdown({\n benefitsTotal,\n benefitsBreakdown,\n currency,\n}: CostCalculatorBenefitsBreakdownProps) {\n return (\n <div>\n <div className='flex justify-between items-center mb-2'>\n <h3 className='font-medium text-primary-foreground-800'>Benefits</h3>\n <span className='font-semibold text-lg'>\n {formatCurrency(benefitsTotal, currency)}\n </span>\n </div>\n <Separator className='mb-3' />\n\n <div className='space-y-3 pl-2'>\n {benefitsBreakdown.map((benefit, index) => (\n <div key={index} className='flex justify-between items-start text-sm'>\n <div className='flex items-start gap-2'>\n <span>{benefit.name}</span>\n {benefit.description && (\n <BasicTooltip\n content={\n <>\n <span>{benefit.description}</span>{' '}\n {benefit.zendesk_article_url && (\n <ZendeskTriggerButton\n zendeskId={Number(benefit.zendesk_article_id)}\n >\n Learn more\n </ZendeskTriggerButton>\n )}\n </>\n }\n >\n <Button variant='ghost' size='icon' className='h-4 w-4 p-0'>\n <Info className='h-3 w-3 text-gray-400' />\n <span className='sr-only'>Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(benefit.amount, currency)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":"gPAAA,OAAS,QAAAA,MAAY,eA2Bf,OAgBc,YAAAC,EAfZ,OAAAC,EADF,QAAAC,MAAA,oBAPC,SAASC,EAAgC,CAC9C,cAAAC,EACA,kBAAAC,EACA,SAAAC,CACF,EAAyC,CACvC,OACEJ,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,0CAA0C,oBAAQ,EAChEA,EAAC,QAAK,UAAU,wBACb,SAAAM,EAAeH,EAAeE,CAAQ,EACzC,GACF,EACAL,EAACO,EAAA,CAAU,UAAU,OAAO,EAE5BP,EAAC,OAAI,UAAU,iBACZ,SAAAI,EAAkB,IAAI,CAACI,EAASC,IAC/BR,EAAC,OAAgB,UAAU,2CACzB,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAQ,EAAQ,KAAK,EACnBA,EAAQ,aACPR,EAACU,EAAA,CACC,QACET,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAQ,EAAQ,YAAY,EAAQ,IAClCA,EAAQ,qBACPR,EAACW,EAAA,CACC,UAAW,OAAOH,EAAQ,kBAAkB,EAC7C,sBAED,GAEJ,EAGF,SAAAP,EAACW,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,cAC5C,UAAAZ,EAACa,EAAA,CAAK,UAAU,wBAAwB,EACxCb,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAM,EAAeE,EAAQ,OAAQH,CAAQ,EAAE,IAzBxCI,CA0BV,CACD,EACH,GACF,CAEJ,CAhDgBK,EAAAZ,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorBenefitsBreakdown","benefitsTotal","benefitsBreakdown","currency","formatCurrency","Separator","benefit","index","BasicTooltip","ZendeskTriggerButton","Button","Info","__name"]}
|
package/dist/chunk-7FAT6WCC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as z,f as Q,h as X,k as Z}from"./chunk-BWJAHRV6.js";import{c as et,d as nt}from"./chunk-XNOLBKZC.js";import{a as at,b as it,c as ct,e as st,f as lt,g as mt,h as ut}from"./chunk-UZXTPQ47.js";import{a as ot,b as rt}from"./chunk-3UDG4IJO.js";import{a as dt,b as pt}from"./chunk-ZOTFS35J.js";import{a as v}from"./chunk-2YTBWEC7.js";import{a as tt}from"./chunk-PJBAQZ6G.js";import{c as f,d as C}from"./chunk-PAQW5BFW.js";import{g as P}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Kt,useMemo as c,useRef as Yt,useState as k}from"react";var zt={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},Qt={employment_basic_information:"basic_information"},me=p(({countryCode:ft,externalId:yt,employmentId:y,skipSteps:_t,options:u,initialValues:i})=>{let[a,A]=k(ft||null),[o,St]=k(y),[T,gt]=k(void 0),O=Yt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),bt=_t?.includes("select_country")?pt:dt,{fieldValues:h,stepState:e,setFieldValues:Ct,previousStep:ht,nextStep:Ft,goToStep:D,setStepValues:B}=tt(bt),{data:s,isLoading:I,refetch:Vt}=z(o),{status:_}=s||{},j=_&&et.includes(_),Et=_&&!nt.includes(_),wt=c(()=>_==="invited"?"invited":"not_invited",[_]),J=X(u),q=lt(),N=it(),Pt=st(),{mutateAsync:vt}=v(J),{mutateAsync:Ot}=v(q),{mutateAsync:Mt}=v(N),{mutateAsync:x}=v(Pt);y&&s?.country?.code&&!a&&A(s.country.code);let{selectCountryForm:M,isLoading:Tt}=Z({jsfModify:u?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),{form:U,isLoading:Dt}=ut(o,{jsonSchemaVersion:u?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="pricing_plan"}}),It=zt[e.currentStep.name]||"contractor_basic_information",jt=Qt[It],Lt=s?.[jt]||{},Rt=p(({form:t,options:r={},query:g={}})=>{let b=Object.keys(h).length>0?{...i,...e.values?.[e.currentStep.name],...h}:{...i,...Lt};return Q({countryCode:a,form:t,fieldValues:b,query:g,options:{...r,queryOptions:{enabled:r.queryOptions?.enabled??!0}}})},"useJSONSchema"),kt=!!(a&&(e.currentStep.name==="basic_information"||y)),At=!!(a&&(e.currentStep.name==="contract_details"||y)),{data:l,isLoading:Bt}=Rt({form:"contractor_basic_information",options:{jsfModify:u?.jsfModify?.basic_information,queryOptions:{enabled:kt},jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:m,isLoading:Jt}=mt({countryCode:a,fieldValues:h,options:{queryOptions:{enabled:At},jsfModify:u?.jsfModify?.contract_details,jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:d}=at({fieldValues:h,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:qt,isLoading:Nt}=ct({employmentId:o,contractDocumentId:T,options:{queryOptions:{enabled:!!T}}}),n=c(()=>({select_country:M?.fields||[],basic_information:l?.fields||[],pricing_plan:U?.fields||[],contract_details:m?.fields||[],contract_preview:d?.fields||[],review:[]}),[M?.fields,l?.fields,U?.fields,m?.fields,d?.fields]),xt={select_country:null,basic_information:l?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:m?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Ut,basic_information:H={},contract_details:S={}}=s||{},G=Ut?.code,F=c(()=>C(n.select_country,{country:a||G||""}),[n.select_country,a,G]),V=c(()=>{let t={...i,...H};return C(n.basic_information,t)},[n.basic_information,H,i]),E=c(()=>{let t={...i,...S};return C(n.contract_details,t)},[n.contract_details,S,i]),W=c(()=>{let t={...i,...S};return C(n.contract_preview,t)},[n.contract_preview,S,i]),$=c(()=>{let t={...i,...S};return C(n.pricing_plan,t?.pricing_plan??{})},[n.pricing_plan,S,i]),Ht=c(()=>({select_country:F,basic_information:V,contract_details:E,contract_preview:W,pricing_plan:$}),[F,V,E,W,$]),K=c(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Kt(()=>{K&&(O.current={select_country:P(F,n.select_country),basic_information:P(V,n.basic_information),contract_details:P(E,n.contract_details),contract_preview:{},pricing_plan:{}},B({select_country:F,basic_information:V,contract_details:E,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[K,D,F,V,E,B,n.select_country,n.basic_information,n.contract_details]);let Gt=p(t=>{D(t)},"goTo"),Y=p(t=>M&&e.currentStep.name==="select_country"?t:l&&e.currentStep.name==="basic_information"?f(t,l?.fields,{isPartialValidation:!1}):m&&e.currentStep.name==="contract_details"?f(t,m?.fields,{isPartialValidation:!1}):d&&e.currentStep.name==="contract_preview"?f(t,d?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Wt(t){let r=e.currentStep.name;r in O.current&&(O.current[r]=P(t,n[r]));let g=Y(t);switch(e.currentStep.name){case"select_country":return A(g.country),Promise.resolve({data:{countryCode:g.country}});case"basic_information":{let L=!o&&a,b=o&&a&&s?.country&&s?.country.code!==a;if(L||b){let R={basic_information:g,type:"contractor",country_code:a,external_id:yt};try{let w=await vt(R),$t=w.data?.data?.employment?.id;return St($t),w}catch(w){throw console.error("Error creating onboarding:",w),w}}else if(o)return Promise.resolve({data:{employmentId:o}});return}case"contract_details":{let b=await Ot({employmentId:o,payload:{contract_document:g}}),R=b.data?.data?.contract_document?.id;return gt(R),b}case"contract_preview":return Mt({employmentId:o,contractDocumentId:T,payload:{signature:t.signature}});case"pricing_plan":return t.subscription==ot?x({employmentId:o,payload:{operation:"downgrade"}}):t.subscription==rt?x({employmentId:o,payload:{operation:"upgrade"}}):Promise.reject({error:"invalid selection"});default:throw new Error("Invalid step state")}}return p(Wt,"onSubmit"),{isLoading:Tt||Bt||I||Jt||Dt||Nt,fieldValues:h,stepState:e,checkFieldUpdates:Ct,back:ht,next:Ft,goTo:Gt,onSubmit:Wt,fields:n[e.currentStep.name],meta:{fields:O.current,fieldsets:xt[e.currentStep.name]},parseFormValues:Y,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return M.handleValidation(t);if(l&&e.currentStep.name==="basic_information"){let r=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(r)}if(m&&e.currentStep.name==="contract_details"){let r=f(t,m?.fields,{isPartialValidation:!1});return m?.handleValidation(r)}if(d&&e.currentStep.name==="contract_preview"){let r=f(t,d?.fields,{isPartialValidation:!1});return d?.handleValidation(r)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Ht,employmentId:o,refetchEmployment:Vt,isSubmitting:J.isPending||q.isPending||N.isPending,documentPreviewPdf:qt,canInvite:Et,isEmploymentReadOnly:j,invitedStatus:wt,employment:s}},"useContractorOnboarding");export{me as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7FAT6WCC.js.map
|