@remoteoss/remote-flows 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SHF5L3PW.js → chunk-22JG4IMF.js} +2 -2
- package/dist/{chunk-WNXB2Y65.js → chunk-2TADRH4W.js} +2 -2
- package/dist/{chunk-BJOF6IEZ.js → chunk-3VYNEJMC.js} +2 -2
- package/dist/{chunk-DYWOG7Q2.js → chunk-46JFDBPC.js} +2 -2
- package/dist/{chunk-KYSKA2UK.js → chunk-4IXRU67S.js} +2 -2
- package/dist/{chunk-4DCENNLW.js → chunk-4JVXDB5G.js} +2 -2
- package/dist/chunk-6IL4TB7S.js +2 -0
- package/dist/chunk-6IL4TB7S.js.map +1 -0
- package/dist/{chunk-C2BBQDCU.js → chunk-74DRB7Z5.js} +2 -2
- package/dist/{chunk-BGU3LZ2S.js → chunk-7KNNJBO6.js} +2 -2
- package/dist/{chunk-OEAHDUWE.js → chunk-AU6AILO2.js} +2 -2
- package/dist/{chunk-IUJXAZHK.js → chunk-BGXVK7HL.js} +2 -2
- package/dist/{chunk-WFMQ2IDE.js → chunk-BLZW25OE.js} +2 -2
- package/dist/{chunk-4M4OJPUA.js → chunk-CT2ROVBF.js} +2 -2
- package/dist/chunk-CYPGWEOO.js +2 -0
- package/dist/chunk-CYPGWEOO.js.map +1 -0
- package/dist/{chunk-KPTF6LPP.js → chunk-EJ4COVQQ.js} +2 -2
- package/dist/{chunk-HLPKGITX.js → chunk-HCZWP44I.js} +2 -2
- package/dist/chunk-HHWIJGDR.js +2 -0
- package/dist/chunk-HHWIJGDR.js.map +1 -0
- package/dist/{chunk-EZV6DOVQ.js → chunk-I3PGODII.js} +2 -2
- package/dist/{chunk-BVN2DKO5.js → chunk-I52UTPHD.js} +2 -2
- package/dist/{chunk-O5MKPE6I.js → chunk-JHPCP2ZX.js} +2 -2
- package/dist/chunk-JTOLQCOG.js +2 -0
- package/dist/chunk-JTOLQCOG.js.map +1 -0
- package/dist/chunk-KDUM4EZJ.js +2 -0
- package/dist/chunk-KDUM4EZJ.js.map +1 -0
- package/dist/{chunk-4URY37KB.js → chunk-KH5SAWNH.js} +2 -2
- package/dist/{chunk-L2BJK3K5.js → chunk-L3C4AHZJ.js} +2 -2
- package/dist/{chunk-GGXK727I.js → chunk-LHSNAVGR.js} +2 -2
- package/dist/{chunk-A7HJICVX.js → chunk-M6G27EJN.js} +2 -2
- package/dist/{chunk-EFPZOIQ2.js → chunk-NWEXPORY.js} +2 -2
- package/dist/{chunk-UIO6B4GN.js → chunk-OCNL6L4L.js} +2 -2
- package/dist/{chunk-ISZQNKMD.js → chunk-P4ZSYIA4.js} +2 -2
- package/dist/{chunk-5XHKOMX5.js → chunk-PHBQMNG3.js} +2 -2
- package/dist/chunk-QEWB24WT.js +2 -0
- package/dist/chunk-QEWB24WT.js.map +1 -0
- package/dist/{chunk-RQXKQTRD.js → chunk-RDGF4PBB.js} +2 -2
- package/dist/{chunk-A7T27JCJ.js → chunk-RNJWBKLA.js} +2 -2
- package/dist/{chunk-NYM7QGN2.js → chunk-S2KE2JLJ.js} +2 -2
- package/dist/chunk-SGE4DLC3.js +2 -0
- package/dist/chunk-SGE4DLC3.js.map +1 -0
- package/dist/chunk-SLMJEZJ7.js +2 -0
- package/dist/chunk-SLMJEZJ7.js.map +1 -0
- package/dist/{chunk-NYEZAOUI.js → chunk-T5LZSTW3.js} +2 -2
- package/dist/{chunk-VYDVPM5S.js → chunk-VVF4IZES.js} +2 -2
- package/dist/{chunk-D5RCRFJM.js → chunk-W5BJQRNM.js} +2 -2
- package/dist/{chunk-YPHOFQ5O.js → chunk-ZY5U2UNT.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +2 -2
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +3 -3
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +3 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +6 -6
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +4 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +4 -4
- package/dist/flows/Onboarding/utils.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +16 -3
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +16 -3
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +16 -2
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +4 -4
- package/dist/flows/Termination/hooks.d.ts +4 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +11 -5
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/types.d.ts +4 -4
- package/dist/flows/api.d.ts +4 -4
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/{mutations-CAhYrKGA.d.ts → mutations-C0KsEf83.d.ts} +1 -1
- package/dist/{remoteFlows-HxRw2Djx.d.ts → remoteFlows-DJcvCgN2.d.ts} +19 -2
- package/dist/{types-BsT_1de7.d.ts → types-1tGveWWg.d.ts} +3 -3
- package/dist/{types-1R2vg9SL.d.ts → types-CwUhT-vz.d.ts} +37 -18
- package/dist/{types-r1cKZ-RE.d.ts → types-Dad_rgYV.d.ts} +2 -2
- package/dist/{types-DU4HZ7C6.d.ts → types-DegHPy8Q.d.ts} +4 -4
- package/dist/{types.gen-oeDSqezz.d.ts → types.gen-B73oMrmZ.d.ts} +1 -14
- package/package.json +1 -1
- package/dist/chunk-347YWDTK.js +0 -2
- package/dist/chunk-347YWDTK.js.map +0 -1
- package/dist/chunk-3AEKPMIN.js +0 -2
- package/dist/chunk-3AEKPMIN.js.map +0 -1
- package/dist/chunk-4SIGN3ZP.js +0 -2
- package/dist/chunk-4SIGN3ZP.js.map +0 -1
- package/dist/chunk-6U2UCWVR.js +0 -2
- package/dist/chunk-6U2UCWVR.js.map +0 -1
- package/dist/chunk-EZWZMPD2.js +0 -2
- package/dist/chunk-EZWZMPD2.js.map +0 -1
- package/dist/chunk-O7REUCKR.js +0 -2
- package/dist/chunk-O7REUCKR.js.map +0 -1
- package/dist/chunk-REDYWUCC.js +0 -2
- package/dist/chunk-REDYWUCC.js.map +0 -1
- /package/dist/{chunk-SHF5L3PW.js.map → chunk-22JG4IMF.js.map} +0 -0
- /package/dist/{chunk-WNXB2Y65.js.map → chunk-2TADRH4W.js.map} +0 -0
- /package/dist/{chunk-BJOF6IEZ.js.map → chunk-3VYNEJMC.js.map} +0 -0
- /package/dist/{chunk-DYWOG7Q2.js.map → chunk-46JFDBPC.js.map} +0 -0
- /package/dist/{chunk-KYSKA2UK.js.map → chunk-4IXRU67S.js.map} +0 -0
- /package/dist/{chunk-4DCENNLW.js.map → chunk-4JVXDB5G.js.map} +0 -0
- /package/dist/{chunk-C2BBQDCU.js.map → chunk-74DRB7Z5.js.map} +0 -0
- /package/dist/{chunk-BGU3LZ2S.js.map → chunk-7KNNJBO6.js.map} +0 -0
- /package/dist/{chunk-OEAHDUWE.js.map → chunk-AU6AILO2.js.map} +0 -0
- /package/dist/{chunk-IUJXAZHK.js.map → chunk-BGXVK7HL.js.map} +0 -0
- /package/dist/{chunk-WFMQ2IDE.js.map → chunk-BLZW25OE.js.map} +0 -0
- /package/dist/{chunk-4M4OJPUA.js.map → chunk-CT2ROVBF.js.map} +0 -0
- /package/dist/{chunk-KPTF6LPP.js.map → chunk-EJ4COVQQ.js.map} +0 -0
- /package/dist/{chunk-HLPKGITX.js.map → chunk-HCZWP44I.js.map} +0 -0
- /package/dist/{chunk-EZV6DOVQ.js.map → chunk-I3PGODII.js.map} +0 -0
- /package/dist/{chunk-BVN2DKO5.js.map → chunk-I52UTPHD.js.map} +0 -0
- /package/dist/{chunk-O5MKPE6I.js.map → chunk-JHPCP2ZX.js.map} +0 -0
- /package/dist/{chunk-4URY37KB.js.map → chunk-KH5SAWNH.js.map} +0 -0
- /package/dist/{chunk-L2BJK3K5.js.map → chunk-L3C4AHZJ.js.map} +0 -0
- /package/dist/{chunk-GGXK727I.js.map → chunk-LHSNAVGR.js.map} +0 -0
- /package/dist/{chunk-A7HJICVX.js.map → chunk-M6G27EJN.js.map} +0 -0
- /package/dist/{chunk-EFPZOIQ2.js.map → chunk-NWEXPORY.js.map} +0 -0
- /package/dist/{chunk-UIO6B4GN.js.map → chunk-OCNL6L4L.js.map} +0 -0
- /package/dist/{chunk-ISZQNKMD.js.map → chunk-P4ZSYIA4.js.map} +0 -0
- /package/dist/{chunk-5XHKOMX5.js.map → chunk-PHBQMNG3.js.map} +0 -0
- /package/dist/{chunk-RQXKQTRD.js.map → chunk-RDGF4PBB.js.map} +0 -0
- /package/dist/{chunk-A7T27JCJ.js.map → chunk-RNJWBKLA.js.map} +0 -0
- /package/dist/{chunk-NYM7QGN2.js.map → chunk-S2KE2JLJ.js.map} +0 -0
- /package/dist/{chunk-NYEZAOUI.js.map → chunk-T5LZSTW3.js.map} +0 -0
- /package/dist/{chunk-VYDVPM5S.js.map → chunk-VVF4IZES.js.map} +0 -0
- /package/dist/{chunk-D5RCRFJM.js.map → chunk-W5BJQRNM.js.map} +0 -0
- /package/dist/{chunk-YPHOFQ5O.js.map → chunk-ZY5U2UNT.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-FZ7FWFJX.js";import{a as ft}from"./chunk-QKLIYOMA.js";import{a as mt}from"./chunk-QIQTM4HB.js";import{a as ht}from"./chunk-
|
|
1
|
+
import"./chunk-FZ7FWFJX.js";import{a as ft}from"./chunk-QKLIYOMA.js";import{a as mt}from"./chunk-QIQTM4HB.js";import{a as ht}from"./chunk-3VYNEJMC.js";import"./chunk-RDGF4PBB.js";import"./chunk-P5WUODPR.js";import"./chunk-HHWIJGDR.js";import"./chunk-SLMJEZJ7.js";import"./chunk-6IL4TB7S.js";import"./chunk-VUP76ZMQ.js";import"./chunk-S4XU4SE7.js";import"./chunk-GULCZWSK.js";import"./chunk-T5LZSTW3.js";import"./chunk-AU6AILO2.js";import"./chunk-KH5SAWNH.js";import"./chunk-VVF4IZES.js";import"./chunk-6VRUYYUV.js";import"./chunk-MRYRNB7Y.js";import"./chunk-Z3BMF4BO.js";import{a as O}from"./chunk-JHPCP2ZX.js";import"./chunk-BCXRPHWY.js";import"./chunk-MQWVZSGH.js";import{a as I}from"./chunk-H425RKFI.js";import{a as D}from"./chunk-NVYMAOQ7.js";import"./chunk-DTHBG6BD.js";import"./chunk-PHBQMNG3.js";import"./chunk-W5BJQRNM.js";import"./chunk-22JG4IMF.js";import"./chunk-2TADRH4W.js";import"./chunk-ZSCKSEAA.js";import"./chunk-ZE3YT3Q6.js";import{a as wt}from"./chunk-4JVXDB5G.js";import"./chunk-5KHLOGTR.js";import"./chunk-7KNNJBO6.js";import"./chunk-I52UTPHD.js";import"./chunk-NWEXPORY.js";import"./chunk-ZQ6MG635.js";import"./chunk-RINDVT6U.js";import"./chunk-OIN3HGOQ.js";import"./chunk-Z7WBY27D.js";import"./chunk-P4ZSYIA4.js";import"./chunk-46JFDBPC.js";import"./chunk-L3C4AHZJ.js";import"./chunk-VAIBLWOY.js";import"./chunk-UTBVLDKY.js";import"./chunk-PGWKJ6FK.js";import{a as R}from"./chunk-OCNL6L4L.js";import{b as L,d as P}from"./chunk-HCZWP44I.js";import"./chunk-IUZ7DEXC.js";import{a as T}from"./chunk-32GSS4UM.js";import"./chunk-VFRHMNLJ.js";import"./chunk-HFI2MD3H.js";import{a as W}from"./chunk-BLZW25OE.js";import{a as E}from"./chunk-ANGJCT4I.js";import{a as _}from"./chunk-UPXJJBXZ.js";import{d as A,e as z}from"./chunk-RC3XP5WU.js";import"./chunk-HN5HLFTB.js";import"./chunk-KSHK3ZPX.js";import"./chunk-DKFUZO5P.js";import{a as xt}from"./chunk-LHSNAVGR.js";import"./chunk-EJ4COVQQ.js";import"./chunk-4IXRU67S.js";import"./chunk-S2KE2JLJ.js";import"./chunk-M6G27EJN.js";import"./chunk-BGXVK7HL.js";import"./chunk-CT2ROVBF.js";import"./chunk-5ZR7EFPY.js";import"./chunk-BMDZJNJV.js";import"./chunk-DPY77ASH.js";import"./chunk-TOA3JILU.js";import"./chunk-ZY5U2UNT.js";import"./chunk-FB2QGVI2.js";import"./chunk-LRGEEPGK.js";import"./chunk-WVJDCDGZ.js";import"./chunk-BDPCUDJB.js";import"./chunk-R2MHAPWD.js";import"./chunk-U6RM2N4A.js";import{a as j}from"./chunk-Q4BKFSTW.js";import{a as S}from"./chunk-DYB3RWP7.js";import"./chunk-A7ZJQCNU.js";import{a as ut}from"./chunk-74DRB7Z5.js";import{a as nt}from"./chunk-I3PGODII.js";import"./chunk-CFIJKJXD.js";import"./chunk-RNJWBKLA.js";import"./chunk-QEWB24WT.js";import"./chunk-BV3PGYSH.js";import{a as it}from"./chunk-OW5QGJD4.js";import{a as vt}from"./chunk-CYPGWEOO.js";import{a as ct,b as st,c as lt,d as dt,e as pt,f as gt}from"./chunk-KDUM4EZJ.js";import"./chunk-SGE4DLC3.js";import"./chunk-2YTBWEC7.js";import"./chunk-JTOLQCOG.js";import"./chunk-JBUNDNKJ.js";import"./chunk-7R347KBY.js";import"./chunk-AFRA4BIW.js";import"./chunk-3A47R5RQ.js";import"./chunk-D6X2WCEG.js";import"./chunk-HPHWQU34.js";import{a as F}from"./chunk-MP2T74PU.js";import"./chunk-PD24XKD6.js";import"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-2M7EBC4K.js";import"./chunk-Q3A4A2HL.js";import"./chunk-XFD3ULUF.js";import"./chunk-GC23RRCI.js";import"./chunk-XSHHMBMT.js";import"./chunk-N6G4VZXF.js";import"./chunk-4T6PRR6R.js";import{a as v}from"./chunk-3O3Q24JL.js";import"./chunk-PJBAQZ6G.js";import"./chunk-Z5WMKCRJ.js";import"./chunk-EKKRQI6B.js";import"./chunk-WVDTHFGS.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import{a as ot}from"./chunk-LWGVLLBH.js";import"./chunk-CNDSIADP.js";import{b as C}from"./chunk-PAQW5BFW.js";import"./chunk-MQ6F5LE4.js";import"./chunk-TVZAFTPT.js";import{c as B,d as m}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as J}from"@tanstack/react-query";function d(t){let a=document.documentElement;Object.keys(t).forEach(e=>{let o=t[e];o&&a.style.setProperty(e,o)})}r(d,"setCssProperties");function N(t){let a={};return Object.keys(t).forEach(e=>{a[`--${e}`]=t[e]}),a}r(N,"mapThemeColors");function q(t){return{"--spacing":t}}r(q,"mapThemeSpacing");function K(t){return{"--radius":t}}r(K,"mapThemeBorderRadius");function U(t){return{"--fontSizeBase":t.fontSizeBase}}r(U,"mapThemeFont");function f(t){t?.colors&&d(N(t.colors)),t?.spacing&&d(q(t.spacing)),t?.borderRadius&&d(K(t.borderRadius)),t?.font&&d(U(t.font))}r(f,"applyTheme");import{createContext as V,useEffect as M,useMemo as Y}from"react";import{jsx as Q}from"react/jsx-runtime";var H=V({theme:{}});function w(t){M(()=>{t.theme&&Object.keys(t.theme).length>0&&f(t.theme)},[t.theme]);let a=Y(()=>({theme:t.theme}),[t.theme]);return Q(H.Provider,{value:a,children:t.children})}r(w,"ThemeProvider");var x={local:"http://localhost:4000/api/eor",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as X}from"@hey-api/client-fetch";import{useQuery as Z}from"@tanstack/react-query";import{useRef as b}from"react";function G(t){try{return new URL(t),!0}catch{return!1}}r(G,"isValidUrl");var y=r(({auth:t,options:a,authId:e="default"})=>{let o=b(null),{refetch:c}=Z({queryKey:["auth",e],queryFn:t,enabled:!1}),s=a?.environment?x[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.26.0";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&G(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),b(X({...l,headers:{...l.headers,...p?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:p?a.proxy?.url:s,auth:r(async()=>{function k(n){return!n||Date.now()+6e4>n}if(r(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:n}=await c();n&&(o.current={accessToken:n.accessToken,expiresAt:Date.now()+n.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as i}from"react/jsx-runtime";var tt=new $;function at({children:t,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return i(h.Provider,{value:{client:s.current},children:t})}r(at,"RemoteFlowContextWrapper");function rt({children:t,components:a}){return i(u.Provider,{value:a?{components:a}:{components:{}},children:t})}r(rt,"FormFieldsProvider");function et({auth:t,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return i(J,{client:tt,children:i(rt,{components:o,children:i(at,{auth:t,authId:a,proxy:s,environment:l,children:i(w,{theme:c,children:e})})})})}r(et,"RemoteFlows");export{ot as ContractAmendmentConfirmationForm,ut as ContractAmendmentFlow,nt as ContractAmendmentForm,it as ContractAmendmentSubmit,xt as ContractorOnboardingFlow,j as CostCalculatorDisclaimer,R as CostCalculatorFlow,W as CostCalculatorForm,E as CostCalculatorResetButton,O as CostCalculatorResults,_ as CostCalculatorSubmitButton,D as EstimationResults,wt as OnboardingFlow,et as RemoteFlows,I as SummaryResults,ft as TerminationDialogInfoContent,ht as TerminationFlow,mt as TerminationReasonsDetailContent,F as ZendeskTriggerButton,L as buildCostCalculatorEstimationPayload,C as convertFromCents,S as disclaimerData,B as transformYupErrorsIntoObject,dt as useBookedTimeoffBeforeAndAfterTerminationQuery,vt as useContractAmendment,P as useCostCalculator,z as useCostCalculatorEstimationCsv,A as useCostCalculatorEstimationPdf,ct as useEmploymentQuery,lt as usePaidTimeoffBreakdownQuery,pt as useSummaryTimeOffDataQuery,gt as useTimeOffLeavePoliciesSummaryQuery,st as useTimeOffQuery,T as zendeskArticles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"uuHAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,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,EAGvDA,GAAO,MACTjB,EAAiBc,EAAaG,EAAM,IAAI,CAAC,CAE7C,CAhBgBZ,EAAAW,EAAA,cC9ChB,OAAS,iBAAAE,EAAe,aAAAC,EAAW,WAAAC,MAAe,QAmB9C,cAAAC,MAAA,oB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WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
1
|
+
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"mwHAAA,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,CAA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,YAClB,UAAW,KAAK,IAAI,EAAIA,EAAK,UAAY,GAC3C,EAEJ,CACA,OAAOd,EAAQ,SAAS,WAC1B,EAdM,OAeR,CAAC,CACH,CACF,EA9DuB,WJQnB,cAAAe,MAAA,oBA1BJ,IAAMC,GAAc,IAAIC,EAUxB,SAASC,GAAyB,CAChC,SAAAC,EACA,KAAAC,EACA,OAAAC,EACA,MAAAC,EACA,YAAAC,CACF,EAAkC,CAChC,IAAMC,EAAkBC,EAAQ,CAC9B,KAAAL,EACA,OAAAC,EACA,QAAS,CACP,MAAAC,EACA,YAAAC,CACF,CACF,CAAC,EACD,OACER,EAACW,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQF,EAAgB,OAAQ,EAClE,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,GAAA,4BAsBF,SAASU,GAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
package/dist/internals.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as
|
|
1
|
+
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as j,b as m,c as n,d as o,f as p,g as q,h as r,i as s,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E}from"./chunk-D6X2WCEG.js";import{a as t,b as u}from"./chunk-HPHWQU34.js";import{a as i}from"./chunk-MP2T74PU.js";import{a as c}from"./chunk-PD24XKD6.js";import{a as d,b as e,d as f,e as g,f as h}from"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-3O3Q24JL.js";import{a as k,b as l}from"./chunk-WVDTHFGS.js";import"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-MQ6F5LE4.js";import{a}from"./chunk-43WMZDDH.js";import"./chunk-P37U34EQ.js";export{C as Alert,E as AlertDescription,D as AlertTitle,u as Badge,l as Button,G as Card,K as CardContent,J as CardDescription,L as CardFooter,H as CardHeader,I as CardTitle,j as Checkbox,Q as Collapsible,S as CollapsibleContent,R as CollapsibleTrigger,v as Dialog,x as DialogContent,B as DialogDescription,z as DialogFooter,y as DialogHeader,A as DialogTitle,w as DialogTrigger,d as Drawer,f as DrawerContent,g as DrawerHeader,h as DrawerTitle,e as DrawerTrigger,c as Input,b as Label,m as RadioGroup,n as RadioGroupItem,F as ScrollArea,o as Select,r as SelectContent,s as SelectItem,q as SelectTrigger,p as SelectValue,M as Tabs,P as TabsContent,N as TabsList,O as TabsTrigger,i as ZendeskTriggerButton,t as badgeVariants,k as buttonVariants,a as cn};
|
|
2
2
|
//# sourceMappingURL=internals.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
2
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import React__default, { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { AnySchema } from 'yup';
|
|
4
|
-
import {
|
|
4
|
+
import { Z as HelpCenterArticle } from './types.gen-B73oMrmZ.js';
|
|
5
5
|
import { S as SupportedTypes } from './types-Zg1n_9wh.js';
|
|
6
6
|
|
|
7
7
|
type ThemeProviderProps = PropsWithChildren<{
|
|
@@ -40,6 +40,14 @@ declare const ENVIRONMENTS: {
|
|
|
40
40
|
staging: string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type ColumnDef<T = $TSFixMe> = {
|
|
44
|
+
id: keyof T;
|
|
45
|
+
label: React__default.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
cellClassName?: string;
|
|
48
|
+
render?: (value: $TSFixMe, row: T, index: number) => React__default.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
43
51
|
type AuthResponse = {
|
|
44
52
|
accessToken: string;
|
|
45
53
|
expiresIn: number;
|
|
@@ -75,6 +83,13 @@ type JSFField = {
|
|
|
75
83
|
multiple?: boolean;
|
|
76
84
|
meta?: Record<string, unknown>;
|
|
77
85
|
};
|
|
86
|
+
type TableComponentProps<T = $TSFixMe> = {
|
|
87
|
+
data: T[] | undefined;
|
|
88
|
+
columns: ColumnDef<T>[];
|
|
89
|
+
className?: string;
|
|
90
|
+
headerRowClassName?: string;
|
|
91
|
+
bodyRowClassName?: string | ((row: T, index: number) => string);
|
|
92
|
+
};
|
|
78
93
|
/**
|
|
79
94
|
* Props for custom field components.
|
|
80
95
|
* All custom field components receive these three props from React Hook Form's Controller.
|
|
@@ -135,6 +150,7 @@ type DrawerComponentProps = {
|
|
|
135
150
|
title: React.ReactNode;
|
|
136
151
|
trigger: React.ReactElement;
|
|
137
152
|
children?: React.ReactNode;
|
|
153
|
+
direction?: 'left' | 'right';
|
|
138
154
|
};
|
|
139
155
|
type FieldSetToggleComponentProps = {
|
|
140
156
|
isExpanded: boolean;
|
|
@@ -153,6 +169,7 @@ type Components = {
|
|
|
153
169
|
fieldsetToggle?: React.ComponentType<FieldSetToggleComponentProps>;
|
|
154
170
|
zendeskDrawer?: React.ComponentType<ZendeskDrawerComponentProps>;
|
|
155
171
|
drawer?: React.ComponentType<DrawerComponentProps>;
|
|
172
|
+
table?: React.ComponentType<TableComponentProps>;
|
|
156
173
|
};
|
|
157
174
|
type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
158
175
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as EmploymentCreationResponse, z as EmploymentResponse, S as SuccessResponse, x as PostCreateEmployment2Error, A as PatchUpdateEmployment2Error, D as PutUpdateBenefitOfferError, E as Employment$1, y as EmploymentCreateParams } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { OnboardingBack } from './flows/Onboarding/components/OnboardingBack.js';
|
|
4
4
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
5
|
-
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError, S as SuccessResponse$1, E as ErrorResponse } from './mutations-C0KsEf83.js';
|
|
6
6
|
import { OnboardingSubmit } from './flows/Onboarding/components/OnboardingSubmit.js';
|
|
7
|
-
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-
|
|
7
|
+
import { C as Components, M as Meta, J as JSFFieldset } from './remoteFlows-DJcvCgN2.js';
|
|
8
8
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
9
9
|
import * as React$1 from 'react';
|
|
10
10
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { E as
|
|
1
|
+
import { E as Employment, T as ListTimeoffResponse, W as TimeoffStatus, X as TimeoffType, Y as ListLeavePoliciesSummaryResponse } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
4
4
|
import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
|
|
5
|
+
import { E as Employment$1 } from './types-1tGveWWg.js';
|
|
6
|
+
|
|
7
|
+
type DaysAndHours = {
|
|
8
|
+
hours: number;
|
|
9
|
+
days: number;
|
|
10
|
+
};
|
|
5
11
|
|
|
6
12
|
type UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;
|
|
7
13
|
/**
|
|
@@ -11,7 +17,9 @@ type UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;
|
|
|
11
17
|
* @param {string} params.employmentId - The ID of the employment to fetch details for.
|
|
12
18
|
* @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.
|
|
13
19
|
*/
|
|
14
|
-
declare const useEmploymentQuery: ({ employmentId }: UseEmployment) => _tanstack_react_query.UseQueryResult<
|
|
20
|
+
declare const useEmploymentQuery: ({ employmentId }: UseEmployment) => _tanstack_react_query.UseQueryResult<(Employment & {
|
|
21
|
+
termination_date?: string | null;
|
|
22
|
+
}) | undefined, Error>;
|
|
15
23
|
/**
|
|
16
24
|
* Hook to retrieve time off data for a specific employment.
|
|
17
25
|
*
|
|
@@ -55,8 +63,8 @@ declare const usePaidTimeoffBreakdownQuery: ({ employmentId, options, }: {
|
|
|
55
63
|
};
|
|
56
64
|
}) => _tanstack_react_query.UseQueryResult<PaidTimeoffBreakdownResponse, Error>;
|
|
57
65
|
type BookedTimeoffBeforeDateResponse = {
|
|
58
|
-
bookedDaysBeforeTermination:
|
|
59
|
-
bookedDaysAfterTermination:
|
|
66
|
+
bookedDaysBeforeTermination: DaysAndHours;
|
|
67
|
+
bookedDaysAfterTermination: DaysAndHours;
|
|
60
68
|
};
|
|
61
69
|
/**
|
|
62
70
|
* Hook to retrieve booked time off data before and after a specific date for a specific employment.
|
|
@@ -66,7 +74,7 @@ type BookedTimeoffBeforeDateResponse = {
|
|
|
66
74
|
* @param {string} [params.date] - The date to fetch booked time off data for.
|
|
67
75
|
* @returns {BookedTimeoffBeforeDateResponse} - The booked time off data before and after the specific date.
|
|
68
76
|
*
|
|
69
|
-
* This
|
|
77
|
+
* This hook accounts for partial days and multiple timeoff_days per request.
|
|
70
78
|
*/
|
|
71
79
|
declare const useBookedTimeoffBeforeAndAfterTerminationQuery: ({ employmentId, date, options, }: {
|
|
72
80
|
employmentId: string;
|
|
@@ -76,12 +84,14 @@ declare const useBookedTimeoffBeforeAndAfterTerminationQuery: ({ employmentId, d
|
|
|
76
84
|
};
|
|
77
85
|
}) => _tanstack_react_query.UseQueryResult<BookedTimeoffBeforeDateResponse, Error>;
|
|
78
86
|
type SummaryTimeOffDataResponse = {
|
|
79
|
-
entitledDays:
|
|
80
|
-
bookedDays:
|
|
81
|
-
usedDays:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
entitledDays: string;
|
|
88
|
+
bookedDays: string;
|
|
89
|
+
usedDays: string;
|
|
90
|
+
currentEntitlementDays: string;
|
|
91
|
+
approvedDaysBeforeTermination: string;
|
|
92
|
+
approvedDaysAfterTermination: string;
|
|
93
|
+
remainingDays: string;
|
|
94
|
+
isUnlimitedPto: boolean;
|
|
85
95
|
};
|
|
86
96
|
/**
|
|
87
97
|
* Hook to retrieve summary time off data for a specific employment.
|
|
@@ -94,17 +104,20 @@ type SummaryTimeOffDataResponse = {
|
|
|
94
104
|
* This hook doesn't take into account unlimited time off or half days yet.
|
|
95
105
|
*
|
|
96
106
|
*/
|
|
97
|
-
declare const useSummaryTimeOffDataQuery: ({ employmentId, proposedTerminationDate, }: {
|
|
107
|
+
declare const useSummaryTimeOffDataQuery: ({ employmentId, proposedTerminationDate, employment, }: {
|
|
98
108
|
employmentId: string;
|
|
99
109
|
proposedTerminationDate: string;
|
|
110
|
+
employment?: Employment$1;
|
|
100
111
|
}) => {
|
|
101
112
|
data: {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
isUnlimitedPto: boolean;
|
|
114
|
+
entitledDays: string;
|
|
115
|
+
bookedDays: string;
|
|
116
|
+
usedDays: string;
|
|
117
|
+
currentEntitlementDays: string;
|
|
118
|
+
approvedDaysBeforeTermination: string;
|
|
119
|
+
approvedDaysAfterTermination: string;
|
|
120
|
+
remainingDays: string;
|
|
108
121
|
};
|
|
109
122
|
isLoading: boolean;
|
|
110
123
|
isError: boolean;
|
|
@@ -168,8 +181,14 @@ type PaidTimeOffRenderProps = {
|
|
|
168
181
|
isError: boolean;
|
|
169
182
|
error: Error | null;
|
|
170
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* The employment data.
|
|
186
|
+
* @see {@link Employment}
|
|
187
|
+
*/
|
|
188
|
+
employment?: Employment;
|
|
171
189
|
};
|
|
172
190
|
type PaidTimeOffContainerProps = {
|
|
191
|
+
employment?: Employment;
|
|
173
192
|
employmentId: string;
|
|
174
193
|
proposedTerminationDate: string;
|
|
175
194
|
employeeName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as OffboardingResponse, P as PostCreateOffboardingError,
|
|
1
|
+
import { O as OffboardingResponse, P as PostCreateOffboardingError, _ as TerminationDetailsParams } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { E as ErrorResponse, S as SuccessResponse } from './mutations-
|
|
3
|
+
import { E as ErrorResponse, S as SuccessResponse } from './mutations-C0KsEf83.js';
|
|
4
4
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
5
5
|
import { $TSFixMe } from '@remoteoss/json-schema-form';
|
|
6
6
|
import { Step } from './flows/useStepState.js';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as Employment, F as File, g as CreateContractDocumentResponse, f as SignContractDocument, S as SuccessResponse } from './types.gen-B73oMrmZ.js';
|
|
2
2
|
import { OnboardingBack } from './flows/ContractorOnboarding/components/OnboardingBack.js';
|
|
3
3
|
import { OnboardingSubmit } from './flows/ContractorOnboarding/components/OnboardingSubmit.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { N as NormalizedFieldError } from './mutations-
|
|
5
|
+
import { N as NormalizedFieldError } from './mutations-C0KsEf83.js';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
8
8
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
9
9
|
import * as React$1 from 'react';
|
|
10
10
|
import { STEPS } from './flows/ContractorOnboarding/utils.js';
|
|
11
11
|
import { Step } from './flows/useStepState.js';
|
|
12
|
-
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-
|
|
12
|
+
import { M as Meta, J as JSFFieldset, $ as $TSFixMe } from './remoteFlows-DJcvCgN2.js';
|
|
13
13
|
import { FieldValues } from 'react-hook-form';
|
|
14
14
|
import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
|
|
15
|
-
import { g as SelectCountryStep } from './types-
|
|
15
|
+
import { g as SelectCountryStep } from './types-1tGveWWg.js';
|
|
16
16
|
import { FlowOptions, JSFModify } from './flows/types.js';
|
|
17
17
|
import { OnboardingInvite } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
18
18
|
|
|
@@ -200,19 +200,6 @@ type ActionError = {
|
|
|
200
200
|
*/
|
|
201
201
|
message: string;
|
|
202
202
|
};
|
|
203
|
-
/**
|
|
204
|
-
* Complete information of an employment
|
|
205
|
-
*/
|
|
206
|
-
type EmploymentShowResponse = {
|
|
207
|
-
data: {
|
|
208
|
-
employment?: Employment & {
|
|
209
|
-
/**
|
|
210
|
-
* Most updated termination date for the offboarding. This date is subject to change through the offboarding process even after it is finalized.
|
|
211
|
-
*/
|
|
212
|
-
termination_date?: string | null;
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
203
|
type CostCalculatorDiscountResponse = {
|
|
217
204
|
annual_amount: number;
|
|
218
205
|
monthly_amount: number;
|
|
@@ -1589,4 +1576,4 @@ type PostSignContractDocumentErrors = {
|
|
|
1589
1576
|
};
|
|
1590
1577
|
type PostSignContractDocumentError = PostSignContractDocumentErrors[keyof PostSignContractDocumentErrors];
|
|
1591
1578
|
|
|
1592
|
-
export type {
|
|
1579
|
+
export type { PatchUpdateEmployment2Error as A, EmploymentFullParams as B, CreateOffboardingParams as C, PutUpdateBenefitOfferError as D, Employment as E, File as F, MagicLinkResponse as G, UnprocessableEntityResponse as H, MagicLinkParams as I, ConvertCurrencyResponse as J, PostConvertRawCurrencyConverterError as K, ConvertCurrencyParams as L, MinimalRegion as M, PostCreateContractEligibilityError as N, OffboardingResponse as O, PostCreateOffboardingError as P, CreateContractEligibilityParams as Q, Currency as R, SuccessResponse as S, ListTimeoffResponse as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, TimeoffStatus as W, TimeoffType as X, ListLeavePoliciesSummaryResponse as Y, HelpCenterArticle as Z, TerminationDetailsParams as _, ContractAmendmentAutomatableResponse as a, PostAutomatableContractAmendmentError as b, ContractAmendmentResponse as c, PostCreateContractAmendmentError as d, PostSignContractDocumentError as e, SignContractDocument as f, CreateContractDocumentResponse as g, PostCreateContractDocumentError as h, CreateContractDocument as i, CostCalculatorEstimateResponse as j, PostCreateEstimationError as k, CostCalculatorEstimatePdfResponse as l, PostCreateEstimationPdfError as m, CostCalculatorEstimateParams as n, CostCalculatorEstimateCsvResponse as o, PostCreateEstimationCsvError as p, MinimalCountry as q, EmploymentTermType as r, CostCalculatorEmployment as s, EmploymentCreationResponse as t, Company as u, PostInviteEmploymentInvitationError as v, PostCreateRiskReserveError as w, PostCreateEmployment2Error as x, EmploymentCreateParams as y, EmploymentResponse as z };
|
package/package.json
CHANGED
package/dist/chunk-347YWDTK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as g,b as h,d as C,e as L,f as M}from"./chunk-TWIUL2P3.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as H}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-43WMZDDH.js";import{a as b}from"./chunk-P37U34EQ.js";import{jsx as c,jsxs as P}from"react/jsx-runtime";var S=b(({open:e,onOpenChange:t,title:a,trigger:m,children:i,className:s="",direction:u="right"})=>{let{components:f}=H(),D=f?.drawer;return D?c(D,{open:e,onOpenChange:t,title:a,trigger:m,children:i}):P(g,{open:e,onOpenChange:t,direction:u,children:[c(h,{asChild:!0,children:m}),c(C,{className:l(s,"RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4"),children:P("div",{className:"h-full flex flex-col",children:[c(L,{children:c(M,{children:a})}),c("div",{className:"flex-1 overflow-y-auto",children:i})]})})]})},"Drawer");import*as d from"react";import{jsx as n}from"react/jsx-runtime";var N=d.forwardRef(({className:e,...t},a)=>n("div",{className:"relative w-full overflow-auto",children:n("table",{ref:a,className:l("w-full caption-bottom text-sm",e),...t})}));N.displayName="Table";var v=d.forwardRef(({className:e,...t},a)=>n("thead",{ref:a,className:l("[&_tr]:border-b",e),...t}));v.displayName="TableHeader";var x=d.forwardRef(({className:e,...t},a)=>n("tbody",{ref:a,className:l("[&_tr:last-child]:border-0",e),...t}));x.displayName="TableBody";var A=d.forwardRef(({className:e,...t},a)=>n("tfoot",{ref:a,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));A.displayName="TableFooter";var R=d.forwardRef(({className:e,...t},a)=>n("tr",{ref:a,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));R.displayName="TableRow";var y=d.forwardRef(({className:e,...t},a)=>n("th",{ref:a,className:l("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));y.displayName="TableHead";var w=d.forwardRef(({className:e,...t},a)=>n("td",{ref:a,className:l("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));w.displayName="TableCell";var F=d.forwardRef(({className:e,...t},a)=>n("caption",{ref:a,className:l("mt-4 text-sm text-muted-foreground",e),...t}));F.displayName="TableCaption";import{jsx as o,jsxs as r}from"react/jsx-runtime";var p=b(e=>`${e} ${e===1?"day":"days"}`,"pluralizeDays"),$="RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs",Q="RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]",T=b(({children:e,withBorder:t=!1,className:a=""})=>o("div",{className:l($,t&&Q,a),children:e}),"SummaryRow"),U=b(({entitledDays:e,usedDays:t,bookedDays:a,approvedDaysBeforeTermination:m,approvedDaysAfterTermination:i,remainingDays:s,proposedTerminationDate:u})=>{let f=new Date(u).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return r("div",{children:[r(T,{withBorder:!0,children:[o("label",{children:"Number of days entitled to per year"}),o("p",{"data-testid":"entitled-days",className:"font-bold",children:p(e)})]}),r(T,{children:[o("label",{children:"Total days booked"}),o("p",{"data-testid":"booked-days",className:"font-bold",children:p(a)})]}),r(T,{children:[o("label",{children:"Number of days already used"}),o("p",{"data-testid":"used-days",className:"font-bold",children:p(t)})]}),r(T,{children:[r("label",{children:["Approved for use before ",f]}),o("p",{"data-testid":"approved-days-before-termination",className:"font-bold",children:p(m)})]}),r(T,{withBorder:!0,children:[r("label",{children:["Approved for use after ",f]}),o("p",{"data-testid":"approved-days-after-termination",className:"font-bold",children:p(i)})]}),r(T,{children:[o("label",{children:"Total days remaining unused"}),o("p",{"data-testid":"remaining-days",className:"font-bold",children:p(s)})]}),o(T,{className:"mb-2 py-0",children:r("p",{className:"text-xs text-[#222E39]",children:["Expiration date of unused days: ",f]})})]})},"SummaryTimeOff"),z=b(({employeeName:e,timeoffQuery:t,onOpenChange:a,open:m})=>{let{data:i}=t||{};return r(S,{open:m,onOpenChange:a,title:`${e} paid time off breakdown`,trigger:o(E,{variant:"link",className:"text-xs text-[#3B82F6] font-bold p-0",children:"See detailed time off breakdown \u2197"}),className:"h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff",children:[o("div",{className:"mb-2",children:r(N,{children:[o(v,{children:r(R,{children:[o(y,{className:"w-[250px]",children:"Dates"}),o(y,{children:"Duration"}),o(y,{children:"Status"})]})}),o(x,{children:i?.timeoffs.map(s=>r(R,{children:[o(w,{className:"font-medium w-[250px]",children:s.formattedDate}),o(w,{children:p(s.duration)}),o(w,{children:s.status})]},`${s.startDate}-${s.endDate}`))})]})}),r("p",{className:"text-xs",children:["Total of ",p(i?.bookedDays||0)," booked"]})]})},"DrawerTimeOff"),te=b(({employeeName:e,proposedTerminationDate:t,summaryData:a,formattedProposedTerminationDate:m,timeoffQuery:i,onOpenChange:s,open:u})=>{let{entitledDays:f,bookedDays:D,usedDays:_,approvedDaysBeforeTermination:B,approvedDaysAfterTermination:k,remainingDays:O}=a?.data||{entitledDays:0,bookedDays:0,usedDays:0,approvedDaysBeforeTermination:0,approvedDaysAfterTermination:0,remainingDays:0};return r("div",{className:"RemoteFlows__PaidTimeOff__Container py-3",children:[o("h3",{className:"RemoteFlows__PaidTimeOff__Title mb-2",children:"Paid time off"}),r("p",{className:"RemoteFlows__PaidTimeOff__Description text-sm mb-2",children:["The proposed termination date for ",e," is"," ",m,". You will need to pay them for any unused accrued days. Below is a breakdown of their time off entitlement and usage for the current annual leave period:"]}),r("div",{className:"mb-2",children:[!a?.isLoading&&!a?.isError&&a?.data&&o(U,{entitledDays:f,usedDays:_,bookedDays:D,approvedDaysBeforeTermination:B,approvedDaysAfterTermination:k,remainingDays:O,proposedTerminationDate:t}),o(z,{employeeName:e,timeoffQuery:i,onOpenChange:s,open:u})]})]})},"PaidTimeOff");export{te as a};
|
|
2
|
-
//# sourceMappingURL=chunk-347YWDTK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/drawer/Drawer.tsx","../src/components/ui/table.tsx","../src/flows/Termination/components/PaidTimeOff/PaidTimeOff.tsx"],"sourcesContent":["import { useFormFields } from '@/src/context';\nimport { DrawerComponentProps } from '@/src/types/remoteFlows';\nimport {\n Drawer as DrawerPrimitive,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { cn } from '@/src/lib/utils';\n\nexport type DrawerProps = DrawerComponentProps & {\n className?: string;\n direction?: 'left' | 'right';\n};\n\nexport const Drawer = ({\n open,\n onOpenChange,\n title,\n trigger,\n children,\n className = '',\n direction = 'right',\n}: DrawerProps) => {\n const { components } = useFormFields();\n const CustomDrawer = components?.drawer;\n\n if (CustomDrawer) {\n return (\n <CustomDrawer\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n trigger={trigger}\n >\n {children}\n </CustomDrawer>\n );\n }\n\n return (\n <DrawerPrimitive\n open={open}\n onOpenChange={onOpenChange}\n direction={direction}\n >\n <DrawerTrigger asChild>{trigger}</DrawerTrigger>\n <DrawerContent\n className={cn(\n className,\n 'RemoteFlows__Drawer h-full w-[540px] mt-0 ml-auto px-4',\n )}\n >\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{title}</DrawerTitle>\n </DrawerHeader>\n <div className='flex-1 overflow-y-auto'>{children}</div>\n </div>\n </DrawerContent>\n </DrawerPrimitive>\n );\n};\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className='relative w-full overflow-auto'>\n <table\n ref={ref}\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t bg-muted/50 font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import { PaidTimeoffBreakdownResponse } from '@/src/common/api';\nimport { Button } from '@/src/components/ui/button';\nimport { cn } from '@/src/lib/utils';\nimport { Drawer } from '@/src/components/shared/drawer/Drawer';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/src/components/ui/table';\nimport { UseQueryResult } from '@tanstack/react-query';\nimport { PaidTimeOffRenderProps } from '@/src/flows/Termination/components/PaidTimeOff/types';\n\nconst pluralizeDays = (count: number) =>\n `${count} ${count === 1 ? 'day' : 'days'}`;\n\nconst rowBase =\n 'RemoteFlows__SummaryRow flex justify-between items-center py-2 text-xs';\nconst rowBorder =\n 'RemoteFlows__SummaryRowBorder border-b border-b-1 border-b-[#E4E4E7]';\n\nconst SummaryRow = ({\n children,\n withBorder = false,\n className = '',\n}: {\n children: React.ReactNode;\n withBorder?: boolean;\n className?: string;\n}) => {\n return (\n <div className={cn(rowBase, withBorder && rowBorder, className)}>\n {children}\n </div>\n );\n};\n\nconst SummaryTimeOff = ({\n entitledDays,\n usedDays,\n bookedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n proposedTerminationDate,\n}: {\n entitledDays: number;\n usedDays: number;\n bookedDays: number;\n approvedDaysBeforeTermination: number;\n approvedDaysAfterTermination: number;\n remainingDays: number;\n proposedTerminationDate: string;\n}) => {\n const formattedProposedTerminationDate = new Date(\n proposedTerminationDate,\n ).toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n return (\n <div>\n <SummaryRow withBorder>\n <label>Number of days entitled to per year</label>\n <p data-testid='entitled-days' className='font-bold'>\n {pluralizeDays(entitledDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days booked</label>\n <p data-testid='booked-days' className='font-bold'>\n {pluralizeDays(bookedDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Number of days already used</label>\n <p data-testid='used-days' className='font-bold'>\n {pluralizeDays(usedDays)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>\n Approved for use before {formattedProposedTerminationDate}\n </label>\n <p data-testid='approved-days-before-termination' className='font-bold'>\n {pluralizeDays(approvedDaysBeforeTermination)}\n </p>\n </SummaryRow>\n <SummaryRow withBorder>\n <label>Approved for use after {formattedProposedTerminationDate}</label>\n <p data-testid='approved-days-after-termination' className='font-bold'>\n {pluralizeDays(approvedDaysAfterTermination)}\n </p>\n </SummaryRow>\n <SummaryRow>\n <label>Total days remaining unused</label>\n <p data-testid='remaining-days' className='font-bold'>\n {pluralizeDays(remainingDays)}\n </p>\n </SummaryRow>\n <SummaryRow className='mb-2 py-0'>\n <p className='text-xs text-[#222E39]'>\n Expiration date of unused days: {formattedProposedTerminationDate}\n </p>\n </SummaryRow>\n </div>\n );\n};\n\nconst DrawerTimeOff = ({\n employeeName,\n timeoffQuery,\n onOpenChange,\n open,\n}: {\n employeeName: string;\n timeoffQuery: UseQueryResult<PaidTimeoffBreakdownResponse | undefined, Error>;\n onOpenChange: () => void;\n open: boolean;\n}) => {\n const { data: timeoff } = timeoffQuery || {};\n return (\n <Drawer\n open={open}\n onOpenChange={onOpenChange}\n title={`${employeeName} paid time off breakdown`}\n trigger={\n <Button variant='link' className='text-xs text-[#3B82F6] font-bold p-0'>\n See detailed time off breakdown ↗\n </Button>\n }\n className='h-full w-[540px] mt-0 ml-auto px-4 RemoteFlows_DrawerTimeOff'\n >\n <div className='mb-2'>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className='w-[250px]'>Dates</TableHead>\n <TableHead>Duration</TableHead>\n <TableHead>Status</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {timeoff?.timeoffs.map((timeoff) => (\n <TableRow key={`${timeoff.startDate}-${timeoff.endDate}`}>\n <TableCell className='font-medium w-[250px]'>\n {timeoff.formattedDate}\n </TableCell>\n <TableCell>{pluralizeDays(timeoff.duration)}</TableCell>\n <TableCell>{timeoff.status}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n <p className='text-xs'>\n Total of {pluralizeDays(timeoff?.bookedDays || 0)} booked\n </p>\n </Drawer>\n );\n};\n\nexport type PaidTimeOffProps = PaidTimeOffRenderProps;\n\n/**\n * PaidTimeOff component\n *\n * This component is used to display the paid time off summary and details.\n * It displays the summary data and a button to open the details drawer.\n * When the details drawer is open, it displays the paid time off breakdown.\n */\nexport const PaidTimeOff = ({\n employeeName,\n proposedTerminationDate,\n summaryData,\n formattedProposedTerminationDate,\n timeoffQuery,\n onOpenChange,\n open,\n}: PaidTimeOffProps) => {\n const {\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n } = summaryData?.data || {\n entitledDays: 0,\n bookedDays: 0,\n usedDays: 0,\n approvedDaysBeforeTermination: 0,\n approvedDaysAfterTermination: 0,\n remainingDays: 0,\n };\n return (\n <div className='RemoteFlows__PaidTimeOff__Container py-3'>\n <h3 className='RemoteFlows__PaidTimeOff__Title mb-2'>Paid time off</h3>\n <p className='RemoteFlows__PaidTimeOff__Description text-sm mb-2'>\n The proposed termination date for {employeeName} is{' '}\n {formattedProposedTerminationDate}. You will need to pay them for any\n unused accrued days. Below is a breakdown of their time off entitlement\n and usage for the current annual leave period:\n </p>\n <div className='mb-2'>\n {!summaryData?.isLoading &&\n !summaryData?.isError &&\n summaryData?.data && (\n <SummaryTimeOff\n entitledDays={entitledDays}\n usedDays={usedDays}\n bookedDays={bookedDays}\n approvedDaysBeforeTermination={approvedDaysBeforeTermination}\n approvedDaysAfterTermination={approvedDaysAfterTermination}\n remainingDays={remainingDays}\n proposedTerminationDate={proposedTerminationDate}\n />\n )}\n <DrawerTimeOff\n employeeName={employeeName}\n timeoffQuery={timeoffQuery}\n onOpenChange={onOpenChange}\n open={open}\n />\n </div>\n </div>\n );\n};\n"],"mappings":"oOA8BM,cAAAA,EAwBE,QAAAC,MAxBF,oBAdC,IAAMC,EAASC,EAAA,CAAC,CACrB,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,GACZ,UAAAC,EAAY,OACd,IAAmB,CACjB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/BC,EAAeF,GAAY,OAEjC,OAAIE,EAEAb,EAACa,EAAA,CACC,KAAMT,EACN,aAAcC,EACd,MAAOC,EACP,QAASC,EAER,SAAAC,EACH,EAKFP,EAACC,EAAA,CACC,KAAME,EACN,aAAcC,EACd,UAAWK,EAEX,UAAAV,EAACc,EAAA,CAAc,QAAO,GAAE,SAAAP,EAAQ,EAChCP,EAACe,EAAA,CACC,UAAWC,EACTP,EACA,wDACF,EAEA,SAAAR,EAAC,OAAI,UAAU,uBACb,UAAAD,EAACiB,EAAA,CACC,SAAAjB,EAACkB,EAAA,CAAa,SAA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,EAAA,CACC,UAAA/B,EAACkC,EAAA,CAAU,UAAU,wBAClB,SAAAR,EAAQ,cACX,EACA1B,EAACkC,EAAA,CAAW,SAAAhC,EAAcwB,EAAQ,QAAQ,EAAE,EAC5C1B,EAACkC,EAAA,CAAW,SAAAR,EAAQ,OAAO,IALd,GAAGA,EAAQ,SAAS,IAAIA,EAAQ,OAAO,EAMtD,CACD,EACH,GACF,EACF,EACAzB,EAAC,KAAE,UAAU,UAAU,sBACXC,EAAcwB,GAAS,YAAc,CAAC,EAAE,WACpD,GACF,CAEJ,EAnDsB,iBA8DTS,GAAchC,EAAA,CAAC,CAC1B,aAAAmB,EACA,wBAAAH,EACA,YAAAiB,EACA,iCAAAhB,EACA,aAAAG,EACA,aAAAC,EACA,KAAAC,CACF,IAAwB,CACtB,GAAM,CACJ,aAAAZ,EACA,WAAAE,EACA,SAAAD,EACA,8BAAAE,EACA,6BAAAC,EACA,cAAAC,CACF,EAAIkB,GAAa,MAAQ,CACvB,aAAc,EACd,WAAY,EACZ,SAAU,EACV,8BAA+B,EAC/B,6BAA8B,EAC9B,cAAe,CACjB,EACA,OACEnC,EAAC,OAAI,UAAU,2CACb,UAAAD,EAAC,MAAG,UAAU,uCAAuC,yBAAa,EAClEC,EAAC,KAAE,UAAU,qDAAqD,+CAC7BqB,EAAa,MAAI,IACnDF,EAAiC,8JAGpC,EACAnB,EAAC,OAAI,UAAU,OACZ,WAACmC,GAAa,WACb,CAACA,GAAa,SACdA,GAAa,MACXpC,EAACY,EAAA,CACC,aAAcC,EACd,SAAUC,EACV,WAAYC,EACZ,8BAA+BC,EAC/B,6BAA8BC,EAC9B,cAAeC,EACf,wBAAyBC,EAC3B,EAEJnB,EAACqB,EAAA,CACC,aAAcC,EACd,aAAcC,EACd,aAAcC,EACd,KAAMC,EACR,GACF,GACF,CAEJ,EAxD2B","names":["jsx","jsxs","Drawer","__name","open","onOpenChange","title","trigger","children","className","direction","components","useFormFields","CustomDrawer","DrawerTrigger","DrawerContent","cn","DrawerHeader","DrawerTitle","React","jsx","Table","className","props","ref","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","jsx","jsxs","pluralizeDays","__name","count","rowBase","rowBorder","SummaryRow","children","withBorder","className","cn","SummaryTimeOff","entitledDays","usedDays","bookedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","proposedTerminationDate","formattedProposedTerminationDate","DrawerTimeOff","employeeName","timeoffQuery","onOpenChange","open","timeoff","Drawer","Button","Table","TableHeader","TableRow","TableHead","TableBody","TableCell","PaidTimeOff","summaryData"]}
|
package/dist/chunk-3AEKPMIN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-P37U34EQ.js";var m={form:{index:0,name:"form"},confirmation_form:{index:1,name:"confirmation_form"}};function _(t,o){if(!t)return{};if(!o)return{...t.data.employment?.contract_details,effective_date:"",reason_for_change:"",job_title:t.data.employment?.job_title,additional_comments:"",annual_gross_salary:a(t.data.employment?.contract_details?.annual_gross_salary)};let s=o.map(n=>n.name),i=Object.keys(t?.data?.employment?.contract_details||{});return{...s.reduce((n,e)=>{if(i.includes(e)){let c=t?.data?.employment?.contract_details;n[e]=c[e]}return n},{}),effective_date:"",reason_for_change:"",job_title:t.data.employment?.job_title,additional_comments:"",annual_gross_salary:a(t.data.employment?.contract_details?.annual_gross_salary),additional_comments_toggle:!1}}r(_,"buildInitialValues");export{m as a,_ as b};
|
|
2
|
-
//# sourceMappingURL=chunk-3AEKPMIN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/ContractAmendment/utils.ts"],"sourcesContent":["import { EmploymentShowResponse } from '@/src/client';\nimport { convertFromCents } from '@/src/components/form/utils';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { Step } from '../useStepState';\n\ntype StepKeys = 'form' | 'confirmation_form';\n\nexport const STEPS: Record<StepKeys, Step<StepKeys>> = {\n form: { index: 0, name: 'form' },\n confirmation_form: { index: 1, name: 'confirmation_form' },\n} as const;\n\nexport function buildInitialValues(\n employment: EmploymentShowResponse | undefined,\n fields?: Fields | undefined,\n) {\n if (!employment) {\n return {};\n }\n\n if (!fields) {\n return {\n ...employment.data.employment?.contract_details,\n effective_date: '',\n reason_for_change: '',\n job_title: employment.data.employment?.job_title,\n additional_comments: '',\n annual_gross_salary: convertFromCents(\n employment.data.employment?.contract_details\n ?.annual_gross_salary as string,\n ),\n };\n }\n\n const allFields = fields.map((field) => field.name);\n const employmentFields = Object.keys(\n employment?.data?.employment?.contract_details || {},\n );\n const initialValues = allFields.reduce<Record<string, unknown>>(\n (initialValuesAcc, field) => {\n // @ts-expect-error error\n if (employmentFields.includes(field)) {\n const contractDetails = employment?.data?.employment\n ?.contract_details as Record<string, unknown>;\n // @ts-expect-error error\n initialValuesAcc[field] = contractDetails[field];\n }\n return initialValuesAcc;\n },\n {} as Record<string, unknown>,\n );\n\n return {\n ...initialValues,\n effective_date: '',\n reason_for_change: '',\n job_title: employment.data.employment?.job_title,\n additional_comments: '',\n annual_gross_salary: convertFromCents(\n employment.data.employment?.contract_details\n ?.annual_gross_salary as string,\n ),\n additional_comments_toggle: false,\n };\n}\n"],"mappings":"gFAOO,IAAMA,EAA0C,CACrD,KAAM,CAAE,MAAO,EAAG,KAAM,MAAO,EAC/B,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,CAC3D,EAEO,SAASC,EACdC,EACAC,EACA,CACA,GAAI,CAACD,EACH,MAAO,CAAC,EAGV,GAAI,CAACC,EACH,MAAO,CACL,GAAGD,EAAW,KAAK,YAAY,iBAC/B,eAAgB,GAChB,kBAAmB,GACnB,UAAWA,EAAW,KAAK,YAAY,UACvC,oBAAqB,GACrB,oBAAqBE,EACnBF,EAAW,KAAK,YAAY,kBACxB,mBACN,CACF,EAGF,IAAMG,EAAYF,EAAO,IAAKG,GAAUA,EAAM,IAAI,EAC5CC,EAAmB,OAAO,KAC9BL,GAAY,MAAM,YAAY,kBAAoB,CAAC,CACrD,EAeA,MAAO,CACL,GAfoBG,EAAU,OAC9B,CAACG,EAAkBF,IAAU,CAE3B,GAAIC,EAAiB,SAASD,CAAK,EAAG,CACpC,IAAMG,EAAkBP,GAAY,MAAM,YACtC,iBAEJM,EAAiBF,CAAK,EAAIG,EAAgBH,CAAK,CACjD,CACA,OAAOE,CACT,EACA,CAAC,CACH,EAIE,eAAgB,GAChB,kBAAmB,GACnB,UAAWN,EAAW,KAAK,YAAY,UACvC,oBAAqB,GACrB,oBAAqBE,EACnBF,EAAW,KAAK,YAAY,kBACxB,mBACN,EACA,2BAA4B,EAC9B,CACF,CApDgBQ,EAAAT,EAAA","names":["STEPS","buildInitialValues","employment","fields","convertFromCents","allFields","field","employmentFields","initialValuesAcc","contractDetails","__name"]}
|
package/dist/chunk-4SIGN3ZP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as B}from"./chunk-BV3PGYSH.js";import{a as he,b as Ue,c as Ve,d as ze,e as Ge,f as Je,g as qe,h as Ke,i as Ye,j as ye,k as Xe,l as ve,m as Ce,o as xe,q as Qe,r as Ze,s as et}from"./chunk-D6X2WCEG.js";import{b as je}from"./chunk-HPHWQU34.js";import{a as _e,b as $}from"./chunk-WVDTHFGS.js";import{b}from"./chunk-3ZWDIEEM.js";import{a as re,b as ae,c as x,d as Le,e as He,f as Be,g as Ae,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-CNDSIADP.js";import{g as Oe}from"./chunk-PAQW5BFW.js";import{a as _,e as ee}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Ht,jsx as O,jsxs as ne}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:a,label:o,onChange:l,multiple:d,options:c,component:F,...f}){let{components:i}=b(),{control:n}=x(),u=r((m,s,g)=>{let p=g.value?[...g.value]:[];s?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:n,name:e,defaultValue:t,render:({field:m,fieldState:s})=>{let g=F||i?.checkbox;if(g){let p={name:e,description:a,label:o,defaultValue:t,multiple:d,options:c,...f};return O(g,{field:{...m,onChange:r(h=>{if(d){let{checked:S,value:C}=h.target;u(C,S,m),l?.(S);return}m.onChange(h),l?.(h)},"onChange")},fieldState:s,fieldData:p})}return ne(w,{"data-field":e,className:_(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(P,{children:ne(Ht,{children:[c&&d?O(N,{children:o}):null,c&&d?c.map(p=>ne("div",{className:"flex space-x-2",children:[O(he,{id:p.value,onCheckedChange:h=>{u(p.value,h===!0,m),l?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):ne("div",{className:"flex space-x-2",children:[O(he,{id:e,onCheckedChange:p=>{m.onChange(p),l?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),a&&O(R,{children:a}),s.error&&O(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Ut}from"lucide-react";import{PopoverClose as Vt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as Ot}from"lucide-react";import{DayPicker as At}from"react-day-picker";import{jsx as be}from"react/jsx-runtime";function tt({className:e,classNames:t,showOutsideDays:a=!0,...o}){return be(At,{showOutsideDays:a,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(_e({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(_e({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:l,...d})=>be(Bt,{className:_("size-4",l),...d}),"IconLeft"),IconRight:r(({className:l,...d})=>be(Ot,{className:_("size-4",l),...d}),"IconRight")},...o})}r(tt,"Calendar");import*as A from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function ie({...e}){return le(A.Root,{"data-slot":"popover",...e})}r(ie,"Popover");function me({...e}){return le(A.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:a=4,...o}){return le(A.Portal,{children:le(A.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}r(de,"PopoverContent");import{format as ot}from"date-fns";import{Fragment as zt,jsx as E,jsxs as Se}from"react/jsx-runtime";function rt({description:e,label:t,name:a,minDate:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x(),i;return c.meta?.mot&&typeof c.meta.mot=="number"?i=Oe(c.meta.mot):o&&(i=new Date(o)),E(k,{control:f,name:a,render:({field:n,fieldState:u})=>{let m=d||F?.date;if(m){let s={description:e,label:t,name:a,onChange:l,...i&&{minDate:i.toISOString()},...c};return E(m,{field:{...n,onChange:r(g=>{n.onChange(g),l?.(g)},"onChange")},fieldState:u,fieldData:s})}return Se(w,{"data-field":a,className:`flex flex-col RemoteFlows__DatePickerField__Item__${a}`,children:[E(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Se(ie,{children:[E(me,{asChild:!0,children:E(P,{children:E("div",{children:Se($,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!n.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${a}`,children:[n.value&&E(zt,{children:ot(n.value,"yyyy-MM-dd")}),E(Ut,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),E(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:E(tt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:n.value?new Date(n.value):void 0,onSelect:s=>{n.onChange(s?ot(s,"yyyy-MM-dd"):null),l?.(s)},defaultMonth:i,components:{DayContent:r(s=>E(Vt,{children:s.date.getDate()}),"DayContent")},...i&&{disabled:r(s=>s<i,"disabled")}})})]}),e?E(R,{children:e}):null,u.error&&E(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(rt,"DatePickerField");import{useState as Gt,useRef as Jt}from"react";import{Upload as qt,X as Kt}from"lucide-react";import{jsx as U,jsxs as ke}from"react/jsx-runtime";function at({onChange:e,className:t,multiple:a}){let[o,l]=Gt([]),d=Jt(null),c=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),F=r(i=>{if(i.target.files&&i.target.files.length>0){let n=Array.from(i.target.files);l(n),e(i)}},"handleChange"),f=r(i=>{l(n=>n.filter(u=>u!==i))},"onRemoveFile");return ke("div",{className:_("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:a}),ke($,{type:"button",onClick:c,className:"gap-2",children:[U(qt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&U("div",{className:"text-sm",children:a?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((i,n)=>ke("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",U($,{variant:"ghost",onClick:()=>f(i),children:U(Kt,{})})]},n))]})}r(at,"FileUploader");import{jsx as V,jsxs as jt}from"react/jsx-runtime";var Yt=r(e=>new Promise((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=l=>a(l)}),"toBase64"),nt=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let l=await Yt(o);return{name:o.name,content:l.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:a,multiple:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return V(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:a,multiple:o,...c};return V(u,{field:{...i,value:null,onChange:r(async s=>{let g=await nt(s);i.onChange(g),l?.(g)},"onChange")},fieldState:n,fieldData:m})}return jt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:a}),V(P,{children:V(at,{onChange:async m=>{let s=await nt(m);i.onChange(s),l?.(s)},multiple:o,className:_("RemoteFlows__FileUpload__Input")})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),n.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.number;return o?Ne(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>Ne(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as Xt}from"react";import{jsx as W,jsxs as we}from"react/jsx-runtime";function lt({name:e,defaultValue:t,description:a,label:o,options:l,onChange:d,component:c,...F}){let{components:f}=b(),{control:i}=x();return W(k,{control:i,name:e,defaultValue:t,render:({field:n,fieldState:u})=>{let m=c||f?.radio;if(m){let s={name:e,defaultValue:t,description:a,label:o,options:l,...F};return W(m,{field:{...n,onChange:r(g=>{n.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:s})}return we(w,{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(P,{children:W(Ue,{"aria-label":o||e,onValueChange:s=>{n.onChange(s),d?.(s)},value:n.value,className:"flex flex-col space-y-3",children:l?.map(s=>W(Xt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(P,{children:W(Ve,{value:s.value,className:"RemoteFlows__RadioField__Input",disabled:s.disabled})}),we("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:s.label}),s.description&&W(R,{className:"mt-2",children:s.description})]})]})},s.value))})}),a&&W(R,{children:a}),u.error&&W(D,{})]})}})}r(lt,"RadioGroupField");import{jsx as M,jsxs as it}from"react/jsx-runtime";function mt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b();return M(k,{defaultValue:o,control:f,name:t,render:({field:n,fieldState:u})=>{let m=c||i?.select;if(m){let s={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return M(m,{field:{...n,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;n.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:s})}return it(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[M(N,{className:"RemoteFlows__SelectField__Label",children:e}),M(P,{children:M("div",{className:"relative",children:it(ze,{value:n.value||"",onValueChange:s=>{let g=F.jsonType==="number"?Number(s):s;n.onChange(g),d?.(g)},children:[M(qe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:M("span",{className:"absolute",children:M(Je,{placeholder:e})})}),M(Ke,{className:"RemoteFlows__SelectField__Content",children:M(Ge,{className:"RemoteFlows__SelectField__Group",children:a.map(s=>M(Ye,{value:s.value,className:"RemoteFlows__SelectField__SelectItem",disabled:s.disabled,children:s.label},s.value))})})]})})}),l&&M(R,{children:l}),u.error&&M(D,{})]})}})}r(mt,"SelectField");import{useState as ro}from"react";import{Fragment as Qt,useState as Zt}from"react";import{Check as eo,ChevronDownIcon as to,X as oo}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as jr}from"lucide-react";import{jsx as j,jsxs as ea}from"react/jsx-runtime";function dt({className:e,...t}){return j(Y,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function ft({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...t})}r(ft,"CommandSeparator");function Ft({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(Ft,"CommandItem");import{jsx as L,jsxs as X}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:a,placeholder:o,...l}){let[d,c]=Zt(!1),F=r(n=>{a(t.filter(u=>u.value!==n.value))},"handleUnselect"),f=e.some(n=>n.category),i=e.reduce((n,u)=>{let m=u.category||"Uncategorized";return n[m]||(n[m]=[]),n[m].push(u),n},{});return X(ie,{open:d,onOpenChange:c,...l,children:[L(me,{children:X($,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(n=>X(je,{variant:"secondary",className:"mr-1 mb-1",children:[n.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${n.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&F(n)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(n),children:L(oo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},n.label)):L("span",{className:"text-foreground",children:o})}),L(to,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(dt,{children:X(ct,{children:[L(ut,{children:"No item found."}),Object.entries(i).map(([n,u],m)=>X(Qt,{children:[m>0&&L(ft,{}),L(pt,{heading:f?n:void 0,children:u.map(s=>{let g=t.some(p=>p.value===s.value);return X(Ft,{onSelect:()=>{a(g?t.filter(p=>p.value!==s.value):[...t,s])},children:[L(eo,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),s.label]},s.label)})})]},n))]})})})]})}r(ue,"MultiSelect");import{jsx as J,jsxs as ao}from"react/jsx-runtime";function gt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,component:F,...f}){let{control:i}=x(),{components:n}=b(),[u,m]=ro([]);return J(k,{defaultValue:o,control:i,name:t,render:({field:s,fieldState:g})=>{let p=F||n?.countries;if(p){let C={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,...f};return J(p,{field:{...s,onChange:r(T=>{s.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(c?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...a.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],S=r(C=>{let T=C.map(({value:G})=>G);s.onChange(T),d?.(T),m(C)},"handleChange");return ao(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(N,{className:"RemoteFlows__CountryField__Label",children:e}),J(P,{children:J(ue,{options:h,selected:u,onChange:S,...f})}),l&&J(R,{children:l}),g.error&&J(D,{})]})}})}r(gt,"CountryField");import*as ht from"react";import{jsx as no}from"react/jsx-runtime";var Pe=ht.forwardRef(({className:e,...t},a)=>no("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));Pe.displayName="Textarea";import{jsx as q,jsxs as Re}from"react/jsx-runtime";function _t({name:e,description:t,label:a,onChange:o,maxLength:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return q(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.textarea;if(u){let s={name:e,description:t,label:a,maxLength:l,...c};return q(u,{field:{...i,onChange:r(g=>{i.onChange(g),o?.(g)},"onChange")},fieldState:n,fieldData:s})}let m=i.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(N,{className:"RemoteFlows__TextArea__Label",children:a}),q(P,{children:q(Pe,{...i,value:i.value??"",onChange:s=>{i.onChange(s),o?.(s)},className:_(n.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:a})}),(t||l)&&Re("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),l&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",l]})]}),n.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(_t,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.email;return o?De(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>De(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=x();return vt(k,{control:t,name:e.name,render:({field:a})=>vt("input",{...a,type:"hidden"})})}r(Ct,"HiddenField");import po,{useEffect as fo,useState as Dt}from"react";var xt=r((e,t,a)=>{if(e&&"reportValidity"in e){let o=re(a,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let a in t.fields){let o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?xt(o.ref,a,e):o&&o.refs&&o.refs.forEach(l=>xt(l,a,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let a={};for(let o in e){let l=re(t.fields,o),d=Object.assign(e[o]||{},{ref:l&&l.ref});if(so(t.names||Object.keys(e),o)){let c=Object.assign({},re(a,o));ae(c,"root",d),ae(a,o,c)}else ae(a,o,d)}return a},"s"),so=r((e,t)=>{let a=bt(t);return e.some(o=>bt(o).match(`^${a}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),function(o,l,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[a.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:l}))).then(function(i){return d.shouldUseNativeValidation&&Te({},d),{values:a.raw?Object.assign({},o):i,errors:{}}}))}catch(i){return F(i)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:St((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(i,n){if(i[n.path]||(i[n.path]={message:n.message,type:n.type}),f){var u=i[n.path].types,m=u&&u[n.type];i[n.path]=Le(n.path,f,i,n.type,m?[].concat(m,n.message):n.message)}return i},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(kt,"o");import*as I from"yup";import Nt from"lodash.groupby";import Q from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function lo(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),a=e%wt;return a>0?`${t}h${a}m`:`${t}h`}r(lo,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((a,o)=>o.hours+a,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function io(e,t){let a=t.map(({day:d})=>d.toLowerCase()),o=a.indexOf(e),l=null;for(;o<a.length&&!l;){let d=a[o],c=a[o+1],F=pe.indexOf(d)+1;pe[F]===c||(l=d),o+=1}return l}r(io,"findLastConsecutiveDay");function mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(mo,"shouldSummarizeSchedule");function co(e){return Number.parseInt(e.break_duration_minutes)>0}r(co,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(mo),a=Nt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(co),l=Nt(o,"break_duration_minutes"),d=Object.keys(a).map(F=>{let f=a[F],i=f[0].day,[n,u]=F.split("|"),m=`from <span>${n.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,s=io(i,f),p=(s?f.findIndex(h=>h.day===s):-1)===f.length-1;return f.length===1?`${Q(i)}, ${m}`:!p||!s?f.reduce((h,S,C)=>{let T=Q(S.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${Q(i)}</span> to <span>${Q(s)}</span>, ${m}`}),c=Object.keys(l).reverse().map((F,f)=>{let i=f===0,n=l[F],u=lo(parseInt(F,10));if(Object.keys(l).length===1)return`With ${u} daily breaks`;if(n.length===1){let m=`${u} break on ${Q(n[0].day)}.`;return i?`With ${m}`:m}return n.reduce((m,s,g)=>{let p=Q(s.day);return g===0?`${m} ${p}`:g===n.length-1?`${m}, and ${p}.`:`${m}, ${p}`},i?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(Rt,"buildWorkScheduleSummary");function Ie(e){let{checked:t,start_time:a,end_time:o,break_duration_minutes:l}=e;if(!t)return 0;let[d,c]=a.split(":").map(Number),[F,f]=o.split(":").map(Number),i=d*60+c,m=(F*60+f-i-Number.parseInt(l||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Ie,"calculateHours");var uo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function fe(e){return uo[e]}r(fe,"getShortWeekday");import{jsx as y,jsxs as H}from"react/jsx-runtime";var Fo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:I.number().default(0),break_duration_minutes:I.string().default("0")}),go=I.object({schedule:I.array(Fo)});function ho({defaultSchedule:e,onSubmit:t}){let[a,o]=Dt(!1),l=pe.map(p=>{let h=e.find(S=>S.day.toLowerCase()===fe(p).toLowerCase()||S.day.toLowerCase()===p.toLowerCase());return h?{...h,day:fe(p),checked:!0}:{...e[0],checked:!1,day:fe(p)}}),d=Be({defaultValues:{schedule:l},resolver:kt(go)}),{handleSubmit:c,watch:F,reset:f,control:i,formState:n}=d,{fields:u}=He({name:"schedule",control:i}),m=F("schedule");function s(p){let h=p.schedule.filter(({checked:S})=>S).map(S=>({...S,hours:Ie(S)}));t(h),o(!1)}r(s,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:H(ye,{open:a,onOpenChange:o,children:[y(Xe,{asChild:!0,children:y($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(ve,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Ce,{children:y(xe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(Ae,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,h)=>{let S=m[h],C=Ie(S);return H(po.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:p.day,name:`schedule.${h}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(n.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[y($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y($,{type:"button",className:"submit-button",onClick:c(s),children:"Save Schedule"})]})]})})]})]})})}r(ho,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=b(),{setValue:a,control:o,watch:l}=x(),d=l(e.name),[c,F]=Dt(d),{workHoursSummary:f,breakSummary:i}=Rt(c),n=Pt(c);fo(()=>{a(e.name,c)},[c,e.name,a]);function u(s){F(s)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?y(k,{control:o,name:e.name,render:({field:s,fieldState:g})=>y(m,{field:{...s,onChange:r(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:i,totalWorkHours:n}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:n})," hours per week"]}),y(ho,{defaultSchedule:c,onSubmit:u})]})]})}r(Tt,"WorkScheduleField");import{useState as _o}from"react";import{jsx as K,jsxs as yo}from"react/jsx-runtime";function It({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b(),[n,u]=_o();return K(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:s})=>{let g=c||i?.["multi-select"];if(g){let h={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return K(g,{field:{...m,onChange:r(S=>{m.onChange(S),d?.(S)},"onChange")},fieldState:s,fieldData:h})}let p=n||a.filter(h=>m.value.includes(h.value));return yo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(P,{children:K(ue,{options:a,selected:p,onChange:h=>{let S=h.map(({value:C})=>C);m.onChange(S),d?.(S),u(h)},...F})}),l&&K(R,{children:l}),s.error&&K(D,{})]})}})}r(It,"MultiSelectField");import{jsx as vo}from"react/jsx-runtime";var $t=r(e=>vo(ce,{maxLength:15,...e}),"MoneyField");var $e={checkbox:se,text:B,email:yt,money:$t,select:mt,"multi-select":It,radio:lt,number:ce,file:st,date:rt,textarea:_t,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as Co}from"lucide-react";import{jsx as Fe,jsxs as xo}from"react/jsx-runtime";function Et({title:e,description:t,severity:a}){let{components:o}=b();if(o?.statement){let l=o?.statement;return Fe(l,{data:{title:e,description:ee(t),severity:a}})}return xo(Qe,{variant:"warning",children:[Fe(Co,{className:"h-4 w-4"}),e&&Fe(Ze,{children:e}),t&&Fe(et,{dangerouslySetInnerHTML:{__html:ee(t)}})]})}r(Et,"Statement");import{Fragment as bo,useEffect as So,useRef as Mt}from"react";import{jsx as z,jsxs as te}from"react/jsx-runtime";var ko=r(({isExpanded:e,onToggle:t,className:a,...o})=>z($,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",a),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function ss({label:e,name:t,fields:a,description:o,components:l,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:i}){let{watch:n,setValue:u,trigger:m,formState:s}=x(),{components:g}=b(),p=i?.toggle?.stateField,h=p?n(p):i?.toggle?.defaultExpanded??!0,S=a.map(({name:v})=>`${t}.${v}`),C=n(S),T=Mt(C),G=Mt(null),Wt=r(()=>{p&&u(p,!h)},"toggleExpanded");So(()=>{let v=C,oe=T.current,ge=s.isSubmitted||s.submitCount>0,We=!1;for(let Z=0;Z<v.length;Z++)if(v[Z]!==void 0&&oe[Z]!==v[Z]){We=!0;break}return We&&ge&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{m()},50)),T.current=[...v],()=>{G.current&&clearTimeout(G.current)}},[C,m,s.isSubmitted,s.submitCount]);let Lt=g?.fieldsetToggle||ko,Ee=`${t}-content`,Me=`${t}-header`;return te("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[z("legend",{className:_("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),f==="inset"&&te("div",{className:"RemoteFlows__FieldSetField__Header",id:Me,"data-state":h?"expanded":"collapsed","aria-expanded":h,children:[z("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),i?.toggle?.enabled&&z(Lt,{isExpanded:h,onToggle:Wt,"aria-expanded":h,"aria-controls":Ee,"aria-label":`${h?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",i.toggle?.className),children:h?i.toggle.labels?.collapse??"Remove":i.toggle.labels?.expand??"Define"})]}),h&&te("div",{id:Ee,"aria-labelledby":Me,role:"region",children:[o?z("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:ee(o)}}):null,te("div",{className:"grid gap-4",children:[a.map(v=>{v.calculateDynamicProperties&&(v={...v,...v.calculateDynamicProperties(C,v)||{}});let oe=$e[v.type];if(v.isVisible===!1||v.deprecated)return null;if(v.Component){let{Component:ge}=v;return z(ge,{...v},v.name)}return v.type==="select"&&v.multiple&&(oe=$e["multi-select"]),te(bo,{children:[z(oe,{...v,name:`${c?v.name:`${t}.${v.name}`}`,component:l?.[v.type]}),v.extra?v.extra:null]},`${c?v.name:`${t}.${v.name}`}`)}),F||null,d?z(Et,{...d}):null]})]})]})}r(ss,"FieldSetField");export{$e as a,Et as b,ss as c};
|
|
2
|
-
//# sourceMappingURL=chunk-4SIGN3ZP.js.map
|