@remoteoss/remote-flows 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/{chunk-F6FS5DBQ.js → chunk-3CUVTXRN.js} +2 -2
- package/dist/chunk-3LOVCTCN.js +2 -0
- package/dist/chunk-3LOVCTCN.js.map +1 -0
- package/dist/{chunk-Y6FMG3PD.js → chunk-3Z5ZZUO4.js} +2 -2
- package/dist/{chunk-Y6FMG3PD.js.map → chunk-3Z5ZZUO4.js.map} +1 -1
- package/dist/chunk-47VYBPE2.js +2 -0
- package/dist/chunk-47VYBPE2.js.map +1 -0
- package/dist/{chunk-R6OW77R6.js → chunk-4OEBYZLZ.js} +2 -2
- package/dist/chunk-5E44DBDD.js +2 -0
- package/dist/chunk-5E44DBDD.js.map +1 -0
- package/dist/{chunk-5CCAARDB.js → chunk-5GUK7MEN.js} +2 -2
- package/dist/chunk-5I6VWJSC.js +2 -0
- package/dist/chunk-5I6VWJSC.js.map +1 -0
- package/dist/chunk-5KKDB7Q7.js +2 -0
- package/dist/chunk-5KKDB7Q7.js.map +1 -0
- package/dist/chunk-77AF2QOD.js +2 -0
- package/dist/chunk-77AF2QOD.js.map +1 -0
- package/dist/chunk-7TIIT23F.js +2 -0
- package/dist/chunk-7TIIT23F.js.map +1 -0
- package/dist/chunk-AIB34WOA.js +2 -0
- package/dist/chunk-AIB34WOA.js.map +1 -0
- package/dist/{chunk-D27IFECQ.js → chunk-AJVD3O4D.js} +2 -2
- package/dist/chunk-ANCX2TZH.js +2 -0
- package/dist/{chunk-DEGMU7EO.js.map → chunk-ANCX2TZH.js.map} +1 -1
- package/dist/chunk-AVA4MEFP.js +2 -0
- package/dist/chunk-AVA4MEFP.js.map +1 -0
- package/dist/{chunk-WFET4MKU.js → chunk-BDZEPXIS.js} +2 -2
- package/dist/{chunk-FKV6J4FL.js → chunk-BY5S6EQJ.js} +2 -2
- package/dist/chunk-CHSULXMN.js +2 -0
- package/dist/chunk-CHSULXMN.js.map +1 -0
- package/dist/{chunk-SHFIZENN.js → chunk-CSK44J23.js} +2 -2
- package/dist/{chunk-UPRUP24B.js → chunk-D25W2VVQ.js} +2 -2
- package/dist/chunk-D25W2VVQ.js.map +1 -0
- package/dist/{chunk-2UPDFZ7P.js → chunk-DHT7HDHC.js} +2 -2
- package/dist/chunk-DR7VGNO2.js +2 -0
- package/dist/chunk-DY5CSCPI.js +2 -0
- package/dist/chunk-DY5CSCPI.js.map +1 -0
- package/dist/{chunk-3LGFQNYW.js → chunk-EE54SK65.js} +2 -2
- package/dist/chunk-EGQJ7UBR.js +2 -0
- package/dist/chunk-EGQJ7UBR.js.map +1 -0
- package/dist/chunk-EW24LQRE.js +2 -0
- package/dist/chunk-EW24LQRE.js.map +1 -0
- package/dist/chunk-F6U6WDMP.js +2 -0
- package/dist/chunk-F6U6WDMP.js.map +1 -0
- package/dist/{chunk-GXAX4KMX.js → chunk-FBYLX5NA.js} +2 -2
- package/dist/{chunk-A27ASO7K.js → chunk-G7WJUXZU.js} +2 -2
- package/dist/chunk-GAOBYAJE.js +2 -0
- package/dist/chunk-GAOBYAJE.js.map +1 -0
- package/dist/{chunk-OGAVWGSY.js → chunk-GBD3OCAW.js} +2 -2
- package/dist/chunk-GCVZ4AY2.js +2 -0
- package/dist/chunk-GCVZ4AY2.js.map +1 -0
- package/dist/{chunk-UNTCBVHB.js → chunk-GGBEM452.js} +2 -2
- package/dist/chunk-GJQ33XQ4.js +2 -0
- package/dist/chunk-GJQ33XQ4.js.map +1 -0
- package/dist/{chunk-Q5ZUVH3U.js → chunk-GK3OO5SX.js} +2 -2
- package/dist/chunk-GMA7VTFX.js +2 -0
- package/dist/chunk-GMA7VTFX.js.map +1 -0
- package/dist/{chunk-UIAPHRJJ.js → chunk-H2SFR2GL.js} +2 -2
- package/dist/chunk-ILMVHOL2.js +2 -0
- package/dist/chunk-ILMVHOL2.js.map +1 -0
- package/dist/{chunk-LWJQO625.js → chunk-KG72IMCX.js} +2 -2
- package/dist/{chunk-FBA3PMRV.js → chunk-KHVEYIMF.js} +2 -2
- package/dist/{chunk-6P4XGSZ6.js → chunk-LIGRV2J5.js} +2 -2
- package/dist/chunk-LT4ALDRM.js +2 -0
- package/dist/chunk-LT4ALDRM.js.map +1 -0
- package/dist/{chunk-G4NBJTHB.js → chunk-MDSGLUUB.js} +2 -2
- package/dist/{chunk-T6TIHUBQ.js → chunk-N7PSO5ZD.js} +2 -2
- package/dist/chunk-NBCZF2FO.js +2 -0
- package/dist/chunk-NBCZF2FO.js.map +1 -0
- package/dist/{chunk-YYNQTHEX.js → chunk-NC3VBBHC.js} +2 -2
- package/dist/chunk-NVJYAX22.js +2 -0
- package/dist/chunk-NVJYAX22.js.map +1 -0
- package/dist/chunk-QI6LLU2N.js +2 -0
- package/dist/chunk-QI6LLU2N.js.map +1 -0
- package/dist/{chunk-OTTIURMN.js → chunk-QQ7KPOLK.js} +2 -2
- package/dist/{chunk-5O4S4YZN.js → chunk-QVN32YBL.js} +2 -2
- package/dist/chunk-R2SDR47E.js +2 -0
- package/dist/chunk-R2SDR47E.js.map +1 -0
- package/dist/{chunk-HQMY3X2R.js → chunk-R7L6CI5J.js} +2 -2
- package/dist/{chunk-A4ROBLPX.js → chunk-RMVG6YBI.js} +2 -2
- package/dist/{chunk-D23KLJQM.js → chunk-RUVKAPO5.js} +2 -2
- package/dist/{chunk-76UIUPEL.js → chunk-S7ZMHO5I.js} +2 -2
- package/dist/{chunk-S62STPBT.js → chunk-SQICIS7B.js} +2 -2
- package/dist/{chunk-7CDCXJSI.js → chunk-SZOOX2KY.js} +2 -2
- package/dist/chunk-T3L72MV6.js +2 -0
- package/dist/chunk-T3L72MV6.js.map +1 -0
- package/dist/{chunk-HQKBSMGN.js → chunk-TJK6MTGG.js} +2 -2
- package/dist/chunk-TPSZDGQJ.js +2 -0
- package/dist/chunk-TPSZDGQJ.js.map +1 -0
- package/dist/{chunk-4F4I7F2P.js → chunk-VD65AUOI.js} +2 -2
- package/dist/{chunk-WJA7PQ2J.js → chunk-WYXN7WW6.js} +2 -2
- package/dist/chunk-XI3AQ3RM.js +2 -0
- package/dist/chunk-XI3AQ3RM.js.map +1 -0
- package/dist/chunk-Y4VNFI7K.js +2 -0
- package/dist/chunk-Y4VNFI7K.js.map +1 -0
- package/dist/{chunk-7F3TBWYV.js → chunk-YRLBMLSA.js} +2 -2
- package/dist/chunk-Z3BMF4BO.js +1 -0
- package/dist/chunk-ZHL2SULA.js +2 -0
- package/dist/chunk-ZHL2SULA.js.map +1 -0
- package/dist/{chunk-IXVV7KPW.js → chunk-ZSBWDLBS.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +4 -4
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +6 -8
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +2 -4
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +42 -0
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +2 -0
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js.map +1 -0
- 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/CostCalculatorIndirectTax.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/Results/CostCalculatorResultsChart.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +9 -0
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js +2 -0
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js.map +1 -0
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +5 -5
- package/dist/flows/CostCalculator/hooks.d.ts +10 -9
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +6 -4
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/jsonSchema.d.ts +8 -0
- package/dist/flows/CostCalculator/jsonSchema.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +11 -2
- package/dist/flows/CostCalculator/utils.d.ts +2 -2
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +3 -3
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +5 -3
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +5 -5
- package/dist/flows/Onboarding/hooks.d.ts +3 -3
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +1 -1
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +1 -1
- package/dist/flows/Onboarding/utils.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationBack.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +3 -3
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TerminationSubmit.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +4 -4
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +3 -3
- package/dist/flows/Termination/hooks.d.ts +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/flows/types.d.ts +1 -1
- package/dist/flows/useStepState.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +17 -22
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +103 -0
- package/dist/internals.js +2 -0
- package/dist/internals.js.map +1 -0
- package/dist/{types.gen-BqCe1GRY.d.ts → types.gen-CVPKMCVh.d.ts} +34 -17
- package/dist/utils-CjDMg_Yr.d.ts +22 -0
- package/package.json +16 -2
- package/dist/chunk-2Y22JKVE.js +0 -2
- package/dist/chunk-466M4PK7.js +0 -2
- package/dist/chunk-466M4PK7.js.map +0 -1
- package/dist/chunk-5PVQUO5Q.js +0 -2
- package/dist/chunk-5PVQUO5Q.js.map +0 -1
- package/dist/chunk-7LZQJ5CL.js +0 -2
- package/dist/chunk-7LZQJ5CL.js.map +0 -1
- package/dist/chunk-7WDALAC7.js +0 -2
- package/dist/chunk-7WDALAC7.js.map +0 -1
- package/dist/chunk-AEVZ7GEK.js +0 -2
- package/dist/chunk-AEVZ7GEK.js.map +0 -1
- package/dist/chunk-C3KZEPUZ.js +0 -2
- package/dist/chunk-C3KZEPUZ.js.map +0 -1
- package/dist/chunk-COHLMZEO.js +0 -2
- package/dist/chunk-COHLMZEO.js.map +0 -1
- package/dist/chunk-DEGMU7EO.js +0 -2
- package/dist/chunk-DPLXEXMO.js +0 -2
- package/dist/chunk-DPLXEXMO.js.map +0 -1
- package/dist/chunk-DTTK5OBT.js +0 -2
- package/dist/chunk-DTTK5OBT.js.map +0 -1
- package/dist/chunk-E6DC4DXP.js +0 -2
- package/dist/chunk-E6DC4DXP.js.map +0 -1
- package/dist/chunk-FQNVKX3N.js +0 -2
- package/dist/chunk-FQNVKX3N.js.map +0 -1
- package/dist/chunk-HGLI6PUM.js +0 -2
- package/dist/chunk-HGLI6PUM.js.map +0 -1
- package/dist/chunk-IXZAHZ7B.js +0 -2
- package/dist/chunk-IXZAHZ7B.js.map +0 -1
- package/dist/chunk-K5BC2TNP.js +0 -2
- package/dist/chunk-K5BC2TNP.js.map +0 -1
- package/dist/chunk-RX5GTE5Z.js +0 -2
- package/dist/chunk-RX5GTE5Z.js.map +0 -1
- package/dist/chunk-SRZGBJVA.js +0 -2
- package/dist/chunk-SRZGBJVA.js.map +0 -1
- package/dist/chunk-UPRUP24B.js.map +0 -1
- package/dist/chunk-XFY4VAAJ.js +0 -2
- package/dist/chunk-XFY4VAAJ.js.map +0 -1
- package/dist/chunk-YHSNK7WB.js +0 -2
- package/dist/chunk-YHSNK7WB.js.map +0 -1
- package/dist/chunk-YJXRJTOH.js +0 -1
- package/dist/chunk-YKIFMONL.js +0 -2
- package/dist/chunk-YKIFMONL.js.map +0 -1
- package/dist/chunk-ZPUELAQZ.js +0 -2
- package/dist/chunk-ZPUELAQZ.js.map +0 -1
- /package/dist/{chunk-F6FS5DBQ.js.map → chunk-3CUVTXRN.js.map} +0 -0
- /package/dist/{chunk-R6OW77R6.js.map → chunk-4OEBYZLZ.js.map} +0 -0
- /package/dist/{chunk-5CCAARDB.js.map → chunk-5GUK7MEN.js.map} +0 -0
- /package/dist/{chunk-D27IFECQ.js.map → chunk-AJVD3O4D.js.map} +0 -0
- /package/dist/{chunk-WFET4MKU.js.map → chunk-BDZEPXIS.js.map} +0 -0
- /package/dist/{chunk-FKV6J4FL.js.map → chunk-BY5S6EQJ.js.map} +0 -0
- /package/dist/{chunk-SHFIZENN.js.map → chunk-CSK44J23.js.map} +0 -0
- /package/dist/{chunk-2UPDFZ7P.js.map → chunk-DHT7HDHC.js.map} +0 -0
- /package/dist/{chunk-2Y22JKVE.js.map → chunk-DR7VGNO2.js.map} +0 -0
- /package/dist/{chunk-3LGFQNYW.js.map → chunk-EE54SK65.js.map} +0 -0
- /package/dist/{chunk-GXAX4KMX.js.map → chunk-FBYLX5NA.js.map} +0 -0
- /package/dist/{chunk-A27ASO7K.js.map → chunk-G7WJUXZU.js.map} +0 -0
- /package/dist/{chunk-OGAVWGSY.js.map → chunk-GBD3OCAW.js.map} +0 -0
- /package/dist/{chunk-UNTCBVHB.js.map → chunk-GGBEM452.js.map} +0 -0
- /package/dist/{chunk-Q5ZUVH3U.js.map → chunk-GK3OO5SX.js.map} +0 -0
- /package/dist/{chunk-UIAPHRJJ.js.map → chunk-H2SFR2GL.js.map} +0 -0
- /package/dist/{chunk-LWJQO625.js.map → chunk-KG72IMCX.js.map} +0 -0
- /package/dist/{chunk-FBA3PMRV.js.map → chunk-KHVEYIMF.js.map} +0 -0
- /package/dist/{chunk-6P4XGSZ6.js.map → chunk-LIGRV2J5.js.map} +0 -0
- /package/dist/{chunk-G4NBJTHB.js.map → chunk-MDSGLUUB.js.map} +0 -0
- /package/dist/{chunk-T6TIHUBQ.js.map → chunk-N7PSO5ZD.js.map} +0 -0
- /package/dist/{chunk-YYNQTHEX.js.map → chunk-NC3VBBHC.js.map} +0 -0
- /package/dist/{chunk-OTTIURMN.js.map → chunk-QQ7KPOLK.js.map} +0 -0
- /package/dist/{chunk-5O4S4YZN.js.map → chunk-QVN32YBL.js.map} +0 -0
- /package/dist/{chunk-HQMY3X2R.js.map → chunk-R7L6CI5J.js.map} +0 -0
- /package/dist/{chunk-A4ROBLPX.js.map → chunk-RMVG6YBI.js.map} +0 -0
- /package/dist/{chunk-D23KLJQM.js.map → chunk-RUVKAPO5.js.map} +0 -0
- /package/dist/{chunk-76UIUPEL.js.map → chunk-S7ZMHO5I.js.map} +0 -0
- /package/dist/{chunk-S62STPBT.js.map → chunk-SQICIS7B.js.map} +0 -0
- /package/dist/{chunk-7CDCXJSI.js.map → chunk-SZOOX2KY.js.map} +0 -0
- /package/dist/{chunk-HQKBSMGN.js.map → chunk-TJK6MTGG.js.map} +0 -0
- /package/dist/{chunk-4F4I7F2P.js.map → chunk-VD65AUOI.js.map} +0 -0
- /package/dist/{chunk-WJA7PQ2J.js.map → chunk-WYXN7WW6.js.map} +0 -0
- /package/dist/{chunk-7F3TBWYV.js.map → chunk-YRLBMLSA.js.map} +0 -0
- /package/dist/{chunk-YJXRJTOH.js.map → chunk-Z3BMF4BO.js.map} +0 -0
- /package/dist/{chunk-IXVV7KPW.js.map → chunk-ZSBWDLBS.js.map} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export { c as cn } from './utils-CjDMg_Yr.js';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as React$1 from 'react';
|
|
6
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
7
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
8
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
10
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
11
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
12
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
13
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
14
|
+
import 'clsx';
|
|
15
|
+
import 'yup';
|
|
16
|
+
|
|
17
|
+
declare const buttonVariants: (props?: ({
|
|
18
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
19
|
+
size?: "link" | "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
20
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
+
declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
interface CardProps extends React$1.ComponentProps<'div'> {
|
|
26
|
+
direction?: 'row' | 'col';
|
|
27
|
+
}
|
|
28
|
+
declare function Card({ className, direction, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
32
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
33
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
declare const Collapsible: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const CollapsibleTrigger: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
declare const CollapsibleContent: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
|
|
39
|
+
declare const Drawer: {
|
|
40
|
+
({ shouldScaleBackground, ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
declare const DrawerTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
declare const DrawerContent: React$1.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
45
|
+
showHandle?: boolean;
|
|
46
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
declare const DrawerHeader: {
|
|
48
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
declare const DrawerTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
52
|
+
|
|
53
|
+
declare function Dialog({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare function DialogTrigger({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare function DialogContent({ className, children, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare function DialogFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
declare function Tabs({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
62
|
+
declare function TabsList({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.List>): react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare function TabsTrigger({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare function TabsContent({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare const alertVariants: (props?: ({
|
|
67
|
+
variant?: "default" | "destructive" | "warning" | null | undefined;
|
|
68
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
69
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<'div'> & VariantProps<typeof alertVariants>): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
71
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
declare const badgeVariants: (props?: ({
|
|
74
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
75
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
76
|
+
declare function Badge({ className, variant, asChild, ...props }: React$1.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
77
|
+
asChild?: boolean;
|
|
78
|
+
}): react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
declare function Input({ className, type, ...props }: React$1.ComponentProps<'input'>): react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
declare function Label({ className, ...props }: React$1.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
83
|
+
|
|
84
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
85
|
+
|
|
86
|
+
declare function RadioGroup({ className, ...props }: React$1.ComponentProps<typeof RadioGroupPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
87
|
+
declare function RadioGroupItem({ className, ...props }: React$1.ComponentProps<typeof RadioGroupPrimitive.Item>): react_jsx_runtime.JSX.Element;
|
|
88
|
+
|
|
89
|
+
declare function Select({ ...props }: React$1.ComponentProps<typeof SelectPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
90
|
+
declare function SelectValue({ ...props }: React$1.ComponentProps<typeof SelectPrimitive.Value>): react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare function SelectTrigger({ className, children, ...props }: React$1.ComponentProps<typeof SelectPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
92
|
+
declare function SelectContent({ className, children, position, ...props }: React$1.ComponentProps<typeof SelectPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
93
|
+
declare function SelectItem({ className, children, ...props }: React$1.ComponentProps<typeof SelectPrimitive.Item>): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
interface ZendeskTriggerButtonProps {
|
|
96
|
+
zendeskId: number;
|
|
97
|
+
className?: string;
|
|
98
|
+
onClick?: (zendeskId: number) => void;
|
|
99
|
+
children?: React.ReactNode;
|
|
100
|
+
}
|
|
101
|
+
declare function ZendeskTriggerButton({ zendeskId, className, onClick, children, }: ZendeskTriggerButtonProps): react_jsx_runtime.JSX.Element;
|
|
102
|
+
|
|
103
|
+
export { Alert, AlertDescription, AlertTitle, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger, Input, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Tabs, TabsContent, TabsList, TabsTrigger, ZendeskTriggerButton, badgeVariants, buttonVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as q,b as y,c as z,d as E}from"./chunk-GCVZ4AY2.js";import{a as F,b as G,c as L,d as h,e as k,f as j}from"./chunk-5I6VWJSC.js";import{a as N}from"./chunk-Y4VNFI7K.js";import{a as l,b as i,d as a,e as p,f as n}from"./chunk-77AF2QOD.js";import{a as C,b as m,c as b,d as x,e as f,f as D,g as T,i as c,j as d,k as u,l as w,m as P,n as A,o as H,p as I,q as R,r as V,s as B}from"./chunk-XI3AQ3RM.js";import{a as S,b as v}from"./chunk-G7WJUXZU.js";import{a as t}from"./chunk-CHSULXMN.js";import"./chunk-EGQJ7UBR.js";import"./chunk-3ZWDIEEM.js";import{a as s,b as g}from"./chunk-CSK44J23.js";import{a as o}from"./chunk-EW24LQRE.js";import{a as r}from"./chunk-3LOVCTCN.js";import"./chunk-P37U34EQ.js";import*as e from"@radix-ui/react-collapsible";var J=e.Root,K=e.CollapsibleTrigger,M=e.CollapsibleContent;export{m as Alert,x as AlertDescription,b as AlertTitle,v as Badge,g as Button,F as Card,k as CardContent,h as CardDescription,j as CardFooter,G as CardHeader,L as CardTitle,C as Checkbox,J as Collapsible,M as CollapsibleContent,K as CollapsibleTrigger,P as Dialog,H as DialogContent,B as DialogDescription,R as DialogFooter,I as DialogHeader,V as DialogTitle,A as DialogTrigger,l as Drawer,a as DrawerContent,p as DrawerHeader,n as DrawerTitle,i as DrawerTrigger,t as Input,o as Label,f as RadioGroup,D as RadioGroupItem,T as Select,u as SelectContent,w as SelectItem,d as SelectTrigger,c as SelectValue,q as Tabs,E as TabsContent,y as TabsList,z as TabsTrigger,N as ZendeskTriggerButton,S as badgeVariants,s as buttonVariants,r as cn};
|
|
2
|
+
//# sourceMappingURL=internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/collapsible.tsx"],"sourcesContent":["import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"mappings":"6rBAAA,UAAYA,MAA0B,8BAEtC,IAAMC,EAAmC,OAEnCC,EAA0C,qBAE1CC,EAA0C","names":["CollapsiblePrimitive","Collapsible","CollapsibleTrigger","CollapsibleContent"]}
|
|
@@ -110,6 +110,12 @@ type Employment = {
|
|
|
110
110
|
[key: string]: unknown;
|
|
111
111
|
};
|
|
112
112
|
company_id: string;
|
|
113
|
+
/**
|
|
114
|
+
* Work address information. Its properties may vary depending on the country.
|
|
115
|
+
*/
|
|
116
|
+
work_address_details: {
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
};
|
|
113
119
|
work_email: string;
|
|
114
120
|
status: EmploymentStatus;
|
|
115
121
|
updated_at: string;
|
|
@@ -132,6 +138,12 @@ type Employment = {
|
|
|
132
138
|
* A unique reference code for the employment record in a non-Remote system. While uniqueness is recommended, it is not strictly enforced within Remote's system.
|
|
133
139
|
*/
|
|
134
140
|
external_id?: string;
|
|
141
|
+
/**
|
|
142
|
+
* For the employment models `peo` and `global_payroll`, only [List employments](#operation/get_index_employment) and
|
|
143
|
+
* [Show employment](#operation/get_show_employment) operations are available.
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
employment_model: 'global_payroll' | 'peo' | 'eor';
|
|
135
147
|
personal_email: string;
|
|
136
148
|
country: Country;
|
|
137
149
|
user_status?: UserStatus;
|
|
@@ -307,7 +319,7 @@ type ResignationOffboarding = {
|
|
|
307
319
|
proposed_last_working_day: string;
|
|
308
320
|
reason_description?: string;
|
|
309
321
|
requested_by: string;
|
|
310
|
-
resignation_reason: 'cancellation_before_start_date' | 'company_culture_or_values' | 'conversion_to_contractor' | 'conversion_to_global_payroll' | 'dissatisfaction_with_remote_service' | 'incapacity_to_perform_inherent_duties' | 'infrastructure_challenges' | 'lack_of_recognition' | 'leadership' | 'mutual_agreement' | 'other' | 'other_job_opportunity' | 'personal_reasons' | 'position_does_not_meet_expectations' | 'relationship_with_coworkers' | 'relocation_from_entity_to_entity_by_employee' | 'relocation_leaving_remote' | 'remuneration_and_benefits' | 'retirement' | 'transfer_and_relocation_new_customer_and_new_country' | 'transfer_between_remote_customer' | 'transfer_from_remote_to_customer' | 'transfer_from_remote_to_other_eor';
|
|
322
|
+
resignation_reason: 'cancellation_before_start_date' | 'company_culture_or_values' | 'conversion_to_contractor' | 'conversion_to_global_payroll' | 'conversion_to_peo' | 'dissatisfaction_with_remote_service' | 'incapacity_to_perform_inherent_duties' | 'infrastructure_challenges' | 'lack_of_recognition' | 'leadership' | 'mutual_agreement' | 'other' | 'other_job_opportunity' | 'personal_reasons' | 'position_does_not_meet_expectations' | 'relationship_with_coworkers' | 'relocation_from_entity_to_entity_by_employee' | 'relocation_leaving_remote' | 'remuneration_and_benefits' | 'retirement' | 'transfer_and_relocation_new_customer_and_new_country' | 'transfer_between_remote_customer' | 'transfer_from_remote_to_customer' | 'transfer_from_remote_to_other_eor';
|
|
311
323
|
status: 'submitted' | 'in_review' | 'done' | 'canceled';
|
|
312
324
|
submitted_at: string;
|
|
313
325
|
/**
|
|
@@ -676,6 +688,11 @@ type MagicLinkResponse = {
|
|
|
676
688
|
* The stage of employment lifecycle. When it's `onboarded` means the employee is ready to commence or has already commenced.
|
|
677
689
|
*/
|
|
678
690
|
type EmploymentLifecycleStage = 'employment_creation' | 'employee_self_enrollment' | 'right_to_work_check' | 'contract_signing' | 'remote_enrollment' | 'onboarded' | 'offboarded';
|
|
691
|
+
type ValidationError = {
|
|
692
|
+
errors: {
|
|
693
|
+
[key: string]: unknown;
|
|
694
|
+
};
|
|
695
|
+
};
|
|
679
696
|
/**
|
|
680
697
|
* Contract Amendment Automatable response
|
|
681
698
|
*/
|
|
@@ -1160,6 +1177,21 @@ type PostCreateOffboardingErrors = {
|
|
|
1160
1177
|
500: RequestError;
|
|
1161
1178
|
};
|
|
1162
1179
|
type PostCreateOffboardingError = PostCreateOffboardingErrors[keyof PostCreateOffboardingErrors];
|
|
1180
|
+
type PostConvertRawCurrencyConverterErrors = {
|
|
1181
|
+
/**
|
|
1182
|
+
* Unauthorized
|
|
1183
|
+
*/
|
|
1184
|
+
401: UnauthorizedResponse;
|
|
1185
|
+
/**
|
|
1186
|
+
* Not Found
|
|
1187
|
+
*/
|
|
1188
|
+
404: NotFoundResponse;
|
|
1189
|
+
/**
|
|
1190
|
+
* Unprocessable Entity
|
|
1191
|
+
*/
|
|
1192
|
+
422: UnprocessableEntityResponse;
|
|
1193
|
+
};
|
|
1194
|
+
type PostConvertRawCurrencyConverterError = PostConvertRawCurrencyConverterErrors[keyof PostConvertRawCurrencyConverterErrors];
|
|
1163
1195
|
type PostCreateEmployment2Errors = {
|
|
1164
1196
|
/**
|
|
1165
1197
|
* Bad Request
|
|
@@ -1330,20 +1362,5 @@ type PostInviteEmploymentInvitationErrors = {
|
|
|
1330
1362
|
429: TooManyRequestsResponse;
|
|
1331
1363
|
};
|
|
1332
1364
|
type PostInviteEmploymentInvitationError = PostInviteEmploymentInvitationErrors[keyof PostInviteEmploymentInvitationErrors];
|
|
1333
|
-
type PostConvertCurrencyConverterErrors = {
|
|
1334
|
-
/**
|
|
1335
|
-
* Unauthorized
|
|
1336
|
-
*/
|
|
1337
|
-
401: UnauthorizedResponse;
|
|
1338
|
-
/**
|
|
1339
|
-
* Not Found
|
|
1340
|
-
*/
|
|
1341
|
-
404: NotFoundResponse;
|
|
1342
|
-
/**
|
|
1343
|
-
* Unprocessable Entity
|
|
1344
|
-
*/
|
|
1345
|
-
422: UnprocessableEntityResponse;
|
|
1346
|
-
};
|
|
1347
|
-
type PostConvertCurrencyConverterError = PostConvertCurrencyConverterErrors[keyof PostConvertCurrencyConverterErrors];
|
|
1348
1365
|
|
|
1349
|
-
export type { CreateContractEligibilityParams as A,
|
|
1366
|
+
export type { CreateContractEligibilityParams as A, CostCalculatorEmployment as B, ContractAmendmentAutomatableResponse as C, MinimalCountry as D, EmploymentShowResponse as E, PostCreateOffboardingError as F, TimeoffStatus as G, Currency as H, ListTimeoffResponse as L, MinimalRegion as M, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ValidationError as V, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, CostCalculatorEstimatePdfResponse as d, PostCreateEstimationPdfError as e, CostCalculatorEstimateParams as f, PostCreateEstimationError as g, EmploymentTermType as h, Employment as i, Company as j, PostInviteEmploymentInvitationError as k, PostCreateRiskReserveError as l, EmploymentCreationResponse as m, PostCreateEmployment2Error as n, EmploymentCreateParams as o, EmploymentResponse as p, PatchUpdateEmployment2Error as q, EmploymentFullParams as r, PutUpdateBenefitOfferError as s, MagicLinkResponse as t, UnprocessableEntityResponse as u, MagicLinkParams as v, ConvertCurrencyResponse as w, PostConvertRawCurrencyConverterError as x, ConvertCurrencyParams as y, PostCreateContractEligibilityError as z };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { ValidationError } from 'yup';
|
|
3
|
+
|
|
4
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
5
|
+
type YupError = Pick<ValidationError, 'type' | 'errors'> & {
|
|
6
|
+
inner: Record<string, YupError>[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Transforms a Yup ValidationError object into a more readable object. The format is as follows:
|
|
10
|
+
* {
|
|
11
|
+
* [fieldName]: {
|
|
12
|
+
* type: string,
|
|
13
|
+
* errors: string[],
|
|
14
|
+
* inner: YupError[],
|
|
15
|
+
* },
|
|
16
|
+
* }
|
|
17
|
+
* @param errors
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
declare const transformYupErrorsIntoObject: (errors: ValidationError) => Record<string, YupError>;
|
|
21
|
+
|
|
22
|
+
export { cn as c, transformYupErrorsIntoObject as t };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remoteoss/remote-flows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "NODE_ENV=production tsup",
|
|
6
6
|
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
|
|
7
|
-
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm --exclude-entrypoints index.css",
|
|
7
|
+
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm --exclude-entrypoints index.css --profile node16",
|
|
8
8
|
"check-format": "prettier --check .",
|
|
9
9
|
"dev": "NODE_ENV=development tsup --watch",
|
|
10
10
|
"build:reset": "postcss src/styles/reset.css -o ./example/src/css/reset.css",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"release": "changeset publish",
|
|
21
21
|
"type-check": "tsc --noEmit"
|
|
22
22
|
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=16"
|
|
25
|
+
},
|
|
23
26
|
"type": "module",
|
|
24
27
|
"main": "dist/index.js",
|
|
25
28
|
"exports": {
|
|
@@ -30,6 +33,13 @@
|
|
|
30
33
|
},
|
|
31
34
|
"default": "./dist/index.js"
|
|
32
35
|
},
|
|
36
|
+
"./internals": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/internals.d.ts",
|
|
39
|
+
"default": "./dist/internals.js"
|
|
40
|
+
},
|
|
41
|
+
"default": "./dist/internals.js"
|
|
42
|
+
},
|
|
33
43
|
"./flows/*": {
|
|
34
44
|
"import": {
|
|
35
45
|
"types": "./dist/flows/*.d.ts",
|
|
@@ -54,8 +64,11 @@
|
|
|
54
64
|
"dependencies": {
|
|
55
65
|
"@hey-api/client-fetch": "^0.8.1",
|
|
56
66
|
"@hookform/resolvers": "^4.1.3",
|
|
67
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
57
68
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
69
|
+
"@radix-ui/react-collapsible": "1.1.2",
|
|
58
70
|
"@radix-ui/react-dialog": "^1.1.13",
|
|
71
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
59
72
|
"@radix-ui/react-label": "^2.1.2",
|
|
60
73
|
"@radix-ui/react-popover": "^1.1.6",
|
|
61
74
|
"@radix-ui/react-radio-group": "^1.2.3",
|
|
@@ -84,6 +97,7 @@
|
|
|
84
97
|
"lucide-react": "0.477.0",
|
|
85
98
|
"postcss": "^8.5.3",
|
|
86
99
|
"react-day-picker": "^8.10.1",
|
|
100
|
+
"react-flagpack": "^2.0.6",
|
|
87
101
|
"react-hook-form": "^7.54.2",
|
|
88
102
|
"recharts": "^2.15.1",
|
|
89
103
|
"tailwind-merge": "^3.0.2",
|
package/dist/chunk-2Y22JKVE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-JODJFARP.js";import{a as m}from"./chunk-W5DG5WWJ.js";import{a as e}from"./chunk-VX2UC3HG.js";import{a as i}from"./chunk-XSHHMBMT.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2Y22JKVE.js.map
|
package/dist/chunk-466M4PK7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m,b as d,c as p}from"./chunk-SRZGBJVA.js";import{a as l}from"./chunk-G4NBJTHB.js";import{b as i}from"./chunk-SHFIZENN.js";import{b as r}from"./chunk-HGLI6PUM.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as v}from"lucide-react";import{Fragment as c,jsx as e,jsxs as t}from"react/jsx-runtime";function w({contributionsTotal:u,currency:a,contributionsBreakdown:n}){let f=d();return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:r(u,a)})]}),n?t(c,{children:[e(l,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:n.map((s,g)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(m,{content:t(c,{children:[e("span",{children:s.description}),s.zendesk_article_url&&e(p,{zendeskId:s.zendesk_article_id,zendeskURL:s.zendesk_article_url,Trigger:e("button",{onClick:()=>{let k=s.zendesk_article_id;f.setSearchParams({articleId:k||""})},className:"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",children:"Learn more"})})]}),children:t(i,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(v,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:r(s.amount,a)})]},g))})]}):null]})}o(w,"CostCalculatorContributionsBreakdown");export{w as a};
|
|
2
|
-
//# sourceMappingURL=chunk-466M4PK7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { ZendeskDrawer } from '@/src/components/shared/zendesk-drawer/ZendeskDrawer';\nimport { useRouter } from '@/src/lib/router';\n\ntype CostCalculatorContributionsBreakdownProps = {\n contributionsTotal: number;\n currency: string;\n contributionsBreakdown:\n | {\n name: string;\n description: string | null;\n amount: number;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n }[]\n | undefined;\n};\n\nexport function CostCalculatorContributionsBreakdown({\n contributionsTotal,\n currency,\n contributionsBreakdown,\n}: CostCalculatorContributionsBreakdownProps) {\n const router = useRouter();\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground\">\n Employer Contributions\n </h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(contributionsTotal, currency)}\n </span>\n </div>\n {contributionsBreakdown ? (\n <>\n <Separator className=\"mb-3\" />\n <div className=\"space-y-3 pl-2\">\n {contributionsBreakdown.map((contribution, index) => (\n <div\n key={index}\n className=\"flex justify-between items-start text-sm\"\n >\n <div className=\"flex items-start gap-2\">\n <span>{contribution.name}</span>\n {contribution.description && (\n <BasicTooltip\n content={\n <>\n <span>{contribution.description}</span>\n {contribution.zendesk_article_url && (\n <ZendeskDrawer\n zendeskId={\n contribution.zendesk_article_id as string\n }\n zendeskURL={\n contribution.zendesk_article_url as string\n }\n Trigger={\n <button\n onClick={() => {\n const articleId =\n contribution.zendesk_article_id;\n\n router.setSearchParams({\n articleId: articleId || '',\n });\n }}\n className=\"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0\"\n >\n Learn more\n </button>\n }\n />\n )}\n </>\n }\n >\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-4 w-4 p-0\"\n >\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(contribution.amount, currency)}</span>\n </div>\n ))}\n </div>\n </>\n ) : null}\n </div>\n );\n}\n"],"mappings":"sNAAA,OAAS,QAAAA,MAAY,eAgCf,OAsBkB,YAAAC,EArBhB,OAAAC,EADF,QAAAC,MAAA,oBARC,SAASC,EAAqC,CACnD,mBAAAC,EACA,SAAAC,EACA,uBAAAC,CACF,EAA8C,CAC5C,IAAMC,EAASC,EAAU,EACzB,OACEN,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,sCAAsC,kCAEpD,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAQ,EAAeL,EAAoBC,CAAQ,EAC9C,GACF,EACCC,EACCJ,EAAAF,EAAA,CACE,UAAAC,EAACS,EAAA,CAAU,UAAU,OAAO,EAC5BT,EAAC,OAAI,UAAU,iBACZ,SAAAK,EAAuB,IAAI,CAACK,EAAcC,IACzCV,EAAC,OAEC,UAAU,2CAEV,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAU,EAAa,KAAK,EACxBA,EAAa,aACZV,EAACY,EAAA,CACC,QACEX,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAU,EAAa,YAAY,EAC/BA,EAAa,qBACZV,EAACa,EAAA,CACC,UACEH,EAAa,mBAEf,WACEA,EAAa,oBAEf,QACEV,EAAC,UACC,QAAS,IAAM,CACb,IAAMc,EACJJ,EAAa,mBAEfJ,EAAO,gBAAgB,CACrB,UAAWQ,GAAa,EAC1B,CAAC,CACH,EACA,UAAU,iGACX,sBAED,EAEJ,GAEJ,EAGF,SAAAb,EAACc,EAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAU,cAEV,UAAAf,EAACgB,EAAA,CAAK,UAAU,wBAAwB,EACxChB,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAQ,EAAeE,EAAa,OAAQN,CAAQ,EAAE,IAjDhDO,CAkDP,CACD,EACH,GACF,EACE,MACN,CAEJ,CA/EgBM,EAAAf,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorContributionsBreakdown","contributionsTotal","currency","contributionsBreakdown","router","useRouter","formatCurrency","Separator","contribution","index","BasicTooltip","ZendeskDrawer","articleId","Button","Info","__name"]}
|
package/dist/chunk-5PVQUO5Q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,b as m,c}from"./chunk-SRZGBJVA.js";import{a as i}from"./chunk-G4NBJTHB.js";import{b as o}from"./chunk-SHFIZENN.js";import{b as a}from"./chunk-HGLI6PUM.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as x}from"lucide-react";import{Fragment as g,jsx as t,jsxs as r}from"react/jsx-runtime";function P({extraStatutoryPaymentsTotal:d,extraStatutoryPaymentsBreakdown:u,currency:s}){let p=m();return r("div",{children:[r("div",{className:"flex justify-between items-center mb-2",children:[t("h3",{className:"font-medium text-primary-foreground-800",children:"Extra Statutory Payments"}),t("span",{className:"font-semibold text-lg",children:a(d,s)})]}),t(i,{className:"mb-3"}),t("div",{className:"space-y-3 pl-2",children:u.map((e,f)=>r("div",{className:"flex justify-between items-start text-sm",children:[r("div",{className:"flex items-start gap-2",children:[t("span",{children:e.name}),e.description&&t(l,{content:r(g,{children:[t("span",{children:e.description}),e.zendesk_article_url&&t(c,{zendeskId:e.zendesk_article_id,zendeskURL:e.zendesk_article_url,Trigger:t("button",{onClick:()=>{let k=e.zendesk_article_id;p.setSearchParams({articleId:k||""})},className:"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",children:"Learn more"})})]}),children:r(o,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[t(x,{className:"h-3 w-3 text-gray-400"}),t("span",{className:"sr-only",children:"Info"})]})})]}),t("span",{children:a(e.amount,s)})]},f))})]})}n(P,"CostCalculatorExtraStatutoryPaymentsBreakdown");export{P as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5PVQUO5Q.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\nimport { ZendeskDrawer } from '@/src/components/shared/zendesk-drawer/ZendeskDrawer';\nimport { useRouter } from '@/src/lib/router';\n\ntype CostCalculatorExtraStatutoryPaymentsBreakdownProps = {\n extraStatutoryPaymentsTotal: number | null;\n extraStatutoryPaymentsBreakdown: {\n name: string;\n description: string | null;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n amount: number;\n }[];\n currency: string;\n};\n\nexport function CostCalculatorExtraStatutoryPaymentsBreakdown({\n extraStatutoryPaymentsTotal,\n extraStatutoryPaymentsBreakdown,\n currency,\n}: CostCalculatorExtraStatutoryPaymentsBreakdownProps) {\n const router = useRouter();\n\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground-800\">\n Extra Statutory Payments\n </h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(extraStatutoryPaymentsTotal, currency)}\n </span>\n </div>\n <Separator className=\"mb-3\" />\n\n <div className=\"space-y-3 pl-2\">\n {extraStatutoryPaymentsBreakdown.map((payment, index) => (\n <div key={index} className=\"flex justify-between items-start text-sm\">\n <div className=\"flex items-start gap-2\">\n <span>{payment.name}</span>\n {payment.description && (\n <BasicTooltip\n content={\n <>\n <span>{payment.description}</span>\n {payment.zendesk_article_url && (\n <ZendeskDrawer\n zendeskId={payment.zendesk_article_id as string}\n zendeskURL={payment.zendesk_article_url as string}\n Trigger={\n <button\n onClick={() => {\n const articleId = payment.zendesk_article_id;\n router.setSearchParams({\n articleId: articleId || '',\n });\n }}\n className=\"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0\"\n >\n Learn more\n </button>\n }\n />\n )}\n </>\n }\n >\n <Button variant=\"ghost\" size=\"icon\" className=\"h-4 w-4 p-0\">\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(payment.amount, currency)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":"iNAAA,OAAS,QAAAA,MAAY,eA8Bf,OAkBc,YAAAC,EAjBZ,OAAAC,EADF,QAAAC,MAAA,oBATC,SAASC,EAA8C,CAC5D,4BAAAC,EACA,gCAAAC,EACA,SAAAC,CACF,EAAuD,CACrD,IAAMC,EAASC,EAAU,EAEzB,OACEN,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,0CAA0C,oCAExD,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAQ,EAAeL,EAA6BE,CAAQ,EACvD,GACF,EACAL,EAACS,EAAA,CAAU,UAAU,OAAO,EAE5BT,EAAC,OAAI,UAAU,iBACZ,SAAAI,EAAgC,IAAI,CAACM,EAASC,IAC7CV,EAAC,OAAgB,UAAU,2CACzB,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAU,EAAQ,KAAK,EACnBA,EAAQ,aACPV,EAACY,EAAA,CACC,QACEX,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAU,EAAQ,YAAY,EAC1BA,EAAQ,qBACPV,EAACa,EAAA,CACC,UAAWH,EAAQ,mBACnB,WAAYA,EAAQ,oBACpB,QACEV,EAAC,UACC,QAAS,IAAM,CACb,IAAMc,EAAYJ,EAAQ,mBAC1BJ,EAAO,gBAAgB,CACrB,UAAWQ,GAAa,EAC1B,CAAC,CACH,EACA,UAAU,iGACX,sBAED,EAEJ,GAEJ,EAGF,SAAAb,EAACc,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,cAC5C,UAAAf,EAACgB,EAAA,CAAK,UAAU,wBAAwB,EACxChB,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAQ,EAAeE,EAAQ,OAAQL,CAAQ,EAAE,IArCxCM,CAsCV,CACD,EACH,GACF,CAEJ,CAhEgBM,EAAAf,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorExtraStatutoryPaymentsBreakdown","extraStatutoryPaymentsTotal","extraStatutoryPaymentsBreakdown","currency","router","useRouter","formatCurrency","Separator","payment","index","BasicTooltip","ZendeskDrawer","articleId","Button","Info","__name"]}
|
package/dist/chunk-7LZQJ5CL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-HGLI6PUM.js";import{a as s}from"./chunk-P37U34EQ.js";import*as n from"react";import{Drawer as r}from"vaul";import{jsx as a,jsxs as l}from"react/jsx-runtime";var p=s(({shouldScaleBackground:e=!0,...t})=>a(r.Root,{shouldScaleBackground:e,...t}),"Drawer");p.displayName="Drawer";var v=r.Trigger,d=r.Portal,N=r.Close,m=n.forwardRef(({className:e,...t},o)=>a(r.Overlay,{ref:o,className:i("fixed inset-0 z-50 bg-black/80",e),...t}));m.displayName=r.Overlay.displayName;var f=n.forwardRef(({className:e,children:t,...o},c)=>l(d,{children:[a(m,{}),l(r.Content,{ref:c,className:i("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...o,children:[a("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));f.displayName="DrawerContent";var D=s(({className:e,...t})=>a("div",{className:i("grid gap-1.5 p-4 text-center sm:text-left",e),...t}),"DrawerHeader");D.displayName="DrawerHeader";var w=s(({className:e,...t})=>a("div",{className:i("mt-auto flex flex-col gap-2 p-4",e),...t}),"DrawerFooter");w.displayName="DrawerFooter";var R=n.forwardRef(({className:e,...t},o)=>a(r.Title,{ref:o,className:i("text-lg font-semibold leading-none tracking-tight",e),...t}));R.displayName=r.Title.displayName;var g=n.forwardRef(({className:e,...t},o)=>a(r.Description,{ref:o,className:i("text-sm text-muted-foreground",e),...t}));g.displayName=r.Description.displayName;export{p as a,v as b,N as c,f as d,D as e,R as f,g};
|
|
2
|
-
//# sourceMappingURL=chunk-7LZQJ5CL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/80', className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}\n {...props}\n />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":"gFAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAQxC,cAAAC,EA+BE,QAAAC,MA/BF,oBAJF,IAAMC,EAASC,EAAA,CAAC,CACd,sBAAAC,EAAwB,GACxB,GAAGC,CACL,IACEL,EAACM,EAAgB,KAAhB,CACC,sBAAuBF,EACtB,GAAGC,EACN,EAPa,UASfH,EAAO,YAAc,SAErB,IAAMK,EAAgBD,EAAgB,QAEhCE,EAAeF,EAAgB,OAE/BG,EAAcH,EAAgB,MAE9BI,EAAsB,aAG1B,CAAC,CAAE,UAAAC,EAAW,GAAGN,CAAM,EAAGO,IAC1BZ,EAACM,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,iCAAkCF,CAAS,EACxD,GAAGN,EACN,CACD,EACDK,EAAc,YAAcJ,EAAgB,QAAQ,YAEpD,IAAMQ,EAAsB,aAG1B,CAAC,CAAE,UAAAH,EAAW,SAAAI,EAAU,GAAGV,CAAM,EAAGO,IACpCX,EAACO,EAAA,CACC,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACK,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EACT,iGACAF,CACF,EACC,GAAGN,EAEJ,UAAAL,EAAC,OAAI,UAAU,mDAAmD,EACjEe,GACH,GACF,CACD,EACDD,EAAc,YAAc,gBAE5B,IAAME,EAAeb,EAAA,CAAC,CACpB,UAAAQ,EACA,GAAGN,CACL,IACEL,EAAC,OACC,UAAWa,EAAG,4CAA6CF,CAAS,EACnE,GAAGN,EACN,EAPmB,gBASrBW,EAAa,YAAc,eAE3B,IAAMC,EAAed,EAAA,CAAC,CACpB,UAAAQ,EACA,GAAGN,CACL,IACEL,EAAC,OACC,UAAWa,EAAG,kCAAmCF,CAAS,EACzD,GAAGN,EACN,EAPmB,gBASrBY,EAAa,YAAc,eAE3B,IAAMC,EAAoB,aAGxB,CAAC,CAAE,UAAAP,EAAW,GAAGN,CAAM,EAAGO,IAC1BZ,EAACM,EAAgB,MAAhB,CACC,IAAKM,EACL,UAAWC,EACT,oDACAF,CACF,EACC,GAAGN,EACN,CACD,EACDa,EAAY,YAAcZ,EAAgB,MAAM,YAEhD,IAAMa,EAA0B,aAG9B,CAAC,CAAE,UAAAR,EAAW,GAAGN,CAAM,EAAGO,IAC1BZ,EAACM,EAAgB,YAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,gCAAiCF,CAAS,EACvD,GAAGN,EACN,CACD,EACDc,EAAkB,YAAcb,EAAgB,YAAY","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","__name","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","className","ref","cn","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"]}
|
package/dist/chunk-7WDALAC7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-KSHK3ZPX.js";import{c as n,d as e}from"./chunk-COHLMZEO.js";import{b as a}from"./chunk-CFIJKJXD.js";import{f as l}from"./chunk-DPLXEXMO.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var h=r(({estimationOptions:i=n,defaultValues:o={countryRegionSlug:"",currencySlug:"",salary:""},options:u,render:c,version:C="standard"})=>{let m=y(),t=e({defaultRegion:o.countryRegionSlug,estimationOptions:i,version:C,options:u}),g=a(t.handleValidation),p=l({resolver:g,defaultValues:{country:o?.countryRegionSlug,currency:o?.currencySlug,region:"",salary:o?.salary},shouldUnregister:!1,mode:"onBlur"});return d(s.Provider,{value:{form:p,formId:m,costCalculatorBag:t},children:c(t)})},"CostCalculatorFlow");export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7WDALAC7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorFlow.tsx"],"sourcesContent":["import { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { CostCalculatorContext } from '@/src/flows/CostCalculator/context';\nimport {\n CostCalculatorVersion,\n defaultEstimationOptions,\n useCostCalculator,\n} from '@/src/flows/CostCalculator/hooks';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport { JSFModify } from '@/src/flows/types';\nimport React, { useId } from 'react';\nimport { useForm } from 'react-hook-form';\n\nexport type CostCalculatorFlowProps = {\n /**\n * Estimation params allows you to customize the parameters sent to the /cost-calculator/estimation endpoint.\n */\n estimationOptions?: CostCalculatorEstimationOptions;\n /**\n * Default values for the form fields.\n */\n defaultValues?: Partial<{\n /**\n * Default value for the country field.\n */\n countryRegionSlug: string;\n /**\n * Default value for the currency field.\n */\n currencySlug: string;\n /**\n * Default value for the salary field.\n */\n salary: string;\n }>;\n options?: {\n jsfModify?: JSFModify;\n };\n render: (\n costCalculatorBag: ReturnType<typeof useCostCalculator>,\n ) => React.ReactNode;\n /**\n * Whether to include annual_gross_salary in the estimation payload\n */\n version?: CostCalculatorVersion;\n};\n\nexport const CostCalculatorFlow = ({\n estimationOptions = defaultEstimationOptions,\n defaultValues = {\n countryRegionSlug: '',\n currencySlug: '',\n salary: '',\n },\n options,\n render,\n version = 'standard',\n}: CostCalculatorFlowProps) => {\n const formId = useId();\n const costCalculatorBag = useCostCalculator({\n defaultRegion: defaultValues.countryRegionSlug,\n estimationOptions,\n version,\n options,\n });\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n costCalculatorBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: {\n country: defaultValues?.countryRegionSlug,\n currency: defaultValues?.currencySlug,\n region: '',\n salary: defaultValues?.salary,\n },\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n return (\n <CostCalculatorContext.Provider\n value={{\n form,\n formId: formId,\n costCalculatorBag,\n }}\n >\n {render(costCalculatorBag)}\n </CostCalculatorContext.Provider>\n );\n};\n"],"mappings":"+MASA,OAAgB,SAAAA,MAAa,QAyEzB,cAAAC,MAAA,oBApCG,IAAMC,EAAqBC,EAAA,CAAC,CACjC,kBAAAC,EAAoBC,EACpB,cAAAC,EAAgB,CACd,kBAAmB,GACnB,aAAc,GACd,OAAQ,EACV,EACA,QAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,UACZ,IAA+B,CAC7B,IAAMC,EAASC,EAAM,EACfC,EAAoBC,EAAkB,CAC1C,cAAeP,EAAc,kBAC7B,kBAAAF,EACA,QAAAK,EACA,QAAAF,CACF,CAAC,EACKO,EAAWC,EAEfH,EAAkB,gBACpB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAe,CACb,QAASR,GAAe,kBACxB,SAAUA,GAAe,aACzB,OAAQ,GACR,OAAQA,GAAe,MACzB,EACA,iBAAkB,GAClB,KAAM,QACR,CAAC,EAED,OACEL,EAACiB,EAAsB,SAAtB,CACC,MAAO,CACL,KAAAF,EACA,OAAQN,EACR,kBAAAE,CACF,EAEC,SAAAJ,EAAOI,CAAiB,EAC3B,CAEJ,EA9CkC","names":["useId","jsx","CostCalculatorFlow","__name","estimationOptions","defaultEstimationOptions","defaultValues","options","render","version","formId","useId","costCalculatorBag","useCostCalculator","resolver","useJsonSchemasValidationFormResolver","form","useForm","CostCalculatorContext"]}
|
package/dist/chunk-AEVZ7GEK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,b as m,c as d}from"./chunk-SRZGBJVA.js";import{a as i}from"./chunk-G4NBJTHB.js";import{b as o}from"./chunk-SHFIZENN.js";import{b as r}from"./chunk-HGLI6PUM.js";import{a as n}from"./chunk-P37U34EQ.js";import{Info as g}from"lucide-react";import{Fragment as v,jsx as e,jsxs as t}from"react/jsx-runtime";function b({benefitsTotal:c,benefitsBreakdown:p,currency:a}){let u=m();return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground-800",children:"Benefits"}),e("span",{className:"font-semibold text-lg",children:r(c,a)})]}),e(i,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:p.map((s,f)=>t("div",{className:"flex justify-between items-start text-sm",children:[t("div",{className:"flex items-start gap-2",children:[e("span",{children:s.name}),s.description&&e(l,{content:t(v,{children:[e("span",{children:s.description}),s.zendesk_article_url&&e(d,{zendeskId:s.zendesk_article_id,zendeskURL:s.zendesk_article_url,Trigger:e("button",{onClick:()=>{let k=s.zendesk_article_id;u.setSearchParams({articleId:k||""})},className:"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",children:"Learn more"})})]}),children:t(o,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(g,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:r(s.amount,a)})]},f))})]})}n(b,"CostCalculatorBenefitsBreakdown");export{b as a};
|
|
2
|
-
//# sourceMappingURL=chunk-AEVZ7GEK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\nimport { useRouter } from '@/src/lib/router';\nimport { ZendeskDrawer } from '@/src/components/shared/zendesk-drawer/ZendeskDrawer';\n\ntype CostCalculatorBenefitsBreakdownProps = {\n benefitsTotal: number | undefined;\n benefitsBreakdown: {\n name: string;\n description: string | null;\n amount: number;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n }[];\n currency: string;\n};\n\nexport function CostCalculatorBenefitsBreakdown({\n benefitsTotal,\n benefitsBreakdown,\n currency,\n}: CostCalculatorBenefitsBreakdownProps) {\n const router = useRouter();\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground-800\">Benefits</h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(benefitsTotal, currency)}\n </span>\n </div>\n <Separator className=\"mb-3\" />\n\n <div className=\"space-y-3 pl-2\">\n {benefitsBreakdown.map((benefit, index) => (\n <div key={index} className=\"flex justify-between items-start text-sm\">\n <div className=\"flex items-start gap-2\">\n <span>{benefit.name}</span>\n {benefit.description && (\n <BasicTooltip\n content={\n <>\n <span>{benefit.description}</span>\n {benefit.zendesk_article_url && (\n <ZendeskDrawer\n zendeskId={benefit.zendesk_article_id as string}\n zendeskURL={benefit.zendesk_article_url as string}\n Trigger={\n <button\n onClick={() => {\n const articleId = benefit.zendesk_article_id;\n router.setSearchParams({\n articleId: articleId || '',\n });\n }}\n className=\"text-blue-500 hover:underline block mt-1 text-xs bg-transparent border-none cursor-pointer p-0\"\n >\n Learn more\n </button>\n }\n />\n )}\n </>\n }\n >\n <Button variant=\"ghost\" size=\"icon\" className=\"h-4 w-4 p-0\">\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(benefit.amount, currency)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":"sNAAA,OAAS,QAAAA,MAAY,eA6Bf,OAgBc,YAAAC,EAfZ,OAAAC,EADF,QAAAC,MAAA,oBARC,SAASC,EAAgC,CAC9C,cAAAC,EACA,kBAAAC,EACA,SAAAC,CACF,EAAyC,CACvC,IAAMC,EAASC,EAAU,EACzB,OACEN,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,0CAA0C,oBAAQ,EAChEA,EAAC,QAAK,UAAU,wBACb,SAAAQ,EAAeL,EAAeE,CAAQ,EACzC,GACF,EACAL,EAACS,EAAA,CAAU,UAAU,OAAO,EAE5BT,EAAC,OAAI,UAAU,iBACZ,SAAAI,EAAkB,IAAI,CAACM,EAASC,IAC/BV,EAAC,OAAgB,UAAU,2CACzB,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAU,EAAQ,KAAK,EACnBA,EAAQ,aACPV,EAACY,EAAA,CACC,QACEX,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAU,EAAQ,YAAY,EAC1BA,EAAQ,qBACPV,EAACa,EAAA,CACC,UAAWH,EAAQ,mBACnB,WAAYA,EAAQ,oBACpB,QACEV,EAAC,UACC,QAAS,IAAM,CACb,IAAMc,EAAYJ,EAAQ,mBAC1BJ,EAAO,gBAAgB,CACrB,UAAWQ,GAAa,EAC1B,CAAC,CACH,EACA,UAAU,iGACX,sBAED,EAEJ,GAEJ,EAGF,SAAAb,EAACc,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,cAC5C,UAAAf,EAACgB,EAAA,CAAK,UAAU,wBAAwB,EACxChB,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAQ,EAAeE,EAAQ,OAAQL,CAAQ,EAAE,IArCxCM,CAsCV,CACD,EACH,GACF,CAEJ,CA7DgBM,EAAAf,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorBenefitsBreakdown","benefitsTotal","benefitsBreakdown","currency","router","useRouter","formatCurrency","Separator","benefit","index","BasicTooltip","ZendeskDrawer","articleId","Button","Info","__name"]}
|
package/dist/chunk-C3KZEPUZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as l,j as u,o as c,s as m,w as d}from"./chunk-FQNVKX3N.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{useMutation as C,useQuery as s}from"@tanstack/react-query";import{createHeadlessForm as y,modify as h}from"@remoteoss/json-schema-form";var b=e(({includePremiumBenefits:t})=>{let{client:i}=a();return s({queryKey:["cost-calculator-countries",t],queryFn:e(()=>c({client:i,headers:{Authorization:""},query:{include_premium_benefits:t}}),"queryFn"),select:e(o=>o.data?.data.map(r=>({value:r.region_slug,label:r.name,childRegions:r.child_regions,hasAdditionalFields:r.has_additional_fields,regionSlug:r.region_slug,currency:r.currency.code})),"select")})},"useCostCalculatorCountries"),x=e(()=>{let{client:t}=a();return s({queryKey:["company-currencies"],queryFn:e(()=>d({client:t,headers:{Authorization:""}}),"queryFn"),select:e(i=>i.data?.data?.company_currencies.map(o=>({value:o.slug,label:o.code})),"select")})},"useCompanyCurrencies"),P=e(()=>{let{client:t}=a();return C({mutationFn:e(i=>l({client:t,headers:{Authorization:""},body:i}),"mutationFn")})},"useCostCalculatorEstimation"),A=e(()=>{let{client:t}=a();return C({mutationFn:e(i=>u({client:t,headers:{Authorization:""},body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),M=e((t,{includePremiumBenefits:i,options:o})=>{let{client:r}=a();return s({queryKey:["cost-calculator-region-fields",t,i],queryFn:e(()=>m({client:r,headers:{Authorization:""},path:{slug:t},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!t,select:e(({data:f})=>{let n=f?.data?.schema||{};if(o&&o.jsfModify){let{schema:p}=h(n,o.jsfModify);n=p}return y(n)},"select")})},"useRegionFields");export{b as a,x as b,P as c,A as d,M as e};
|
|
2
|
-
//# sourceMappingURL=chunk-C3KZEPUZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/api.ts"],"sourcesContent":["import {\n CostCalculatorEstimateParams,\n getIndexCompanyCurrency,\n getIndexCountry,\n getShowRegionField,\n postCreateEstimation,\n postCreateEstimationPdf,\n} from '@/src/client';\nimport { Client } from '@hey-api/client-fetch';\nimport { useClient } from '@/src/context';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport { JSFModify } from '@/src/flows/types';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\n\n/**\n * Hook to fetch the countries for the cost calculator.\n * @returns\n */\nexport const useCostCalculatorCountries = ({\n includePremiumBenefits,\n}: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['cost-calculator-countries', includePremiumBenefits],\n queryFn: () => {\n return getIndexCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n select: (data) =>\n data.data?.data.map((country) => ({\n value: country.region_slug,\n label: country.name,\n childRegions: country.child_regions,\n hasAdditionalFields: country.has_additional_fields,\n regionSlug: country.region_slug,\n currency: country.currency.code,\n })),\n });\n};\n\n/**\n * Hook to fetch the company currencies.\n * @returns\n */\nexport const useCompanyCurrencies = () => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['company-currencies'],\n queryFn: () => {\n return getIndexCompanyCurrency({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n });\n },\n select: (data) =>\n data.data?.data?.company_currencies.map((currency) => ({\n value: currency.slug,\n label: currency.code,\n })),\n });\n};\n\n/**\n * Hook to create an estimation.\n * @returns\n */\nexport const useCostCalculatorEstimation = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a PDF estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationPdf = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationPdf({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n });\n },\n });\n};\n\n/**\n * Hook to fetch the region fields.\n * @param region\n * @returns\n */\nexport const useRegionFields = (\n region: string | undefined,\n {\n includePremiumBenefits,\n options,\n }: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n options?: {\n jsfModify?: JSFModify;\n };\n },\n) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['cost-calculator-region-fields', region, includePremiumBenefits],\n queryFn: () => {\n return getShowRegionField({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { slug: region as string },\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n enabled: !!region,\n select: ({ data }) => {\n let jsfSchema = data?.data?.schema || {};\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n return createHeadlessForm(jsfSchema);\n },\n });\n};\n"],"mappings":"oJAUA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,wBAGtC,OAAS,sBAAAC,EAAoB,UAAAC,MAAc,8BAMpC,IAAMC,EAA6BC,EAAA,CAAC,CACzC,uBAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,4BAA6BH,CAAsB,EAC9D,QAASD,EAAA,IACAK,EAAgB,CACrB,OAAQH,EACR,QAAS,CACP,cAAe,EACjB,EACA,MAAO,CACL,yBAA0BD,CAC5B,CACF,CAAC,EATM,WAWT,OAAQD,EAACM,GACPA,EAAK,MAAM,KAAK,IAAKC,IAAa,CAChC,MAAOA,EAAQ,YACf,MAAOA,EAAQ,KACf,aAAcA,EAAQ,cACtB,oBAAqBA,EAAQ,sBAC7B,WAAYA,EAAQ,YACpB,SAAUA,EAAQ,SAAS,IAC7B,EAAE,EARI,SASV,CAAC,CACH,EA7B0C,8BAmC7BC,EAAuBR,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,oBAAoB,EAC/B,QAASJ,EAAA,IACAS,EAAwB,CAC7B,OAAQP,EACR,QAAS,CACP,cAAe,EACjB,CACF,CAAC,EANM,WAQT,OAAQF,EAACM,GACPA,EAAK,MAAM,MAAM,mBAAmB,IAAKI,IAAc,CACrD,MAAOA,EAAS,KAChB,MAAOA,EAAS,IAClB,EAAE,EAJI,SAKV,CAAC,CACH,EAnBoC,wBAyBvBC,EAA8BX,EAAA,IAAM,CAC/C,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJC,EAAqB,CAC1B,OAAQZ,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAMW,CACR,CAAC,EAPS,aASd,CAAC,CACH,EAd2C,+BAqB9BE,EAAiCf,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJG,EAAwB,CAC7B,OAAQd,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAMW,CACR,CAAC,EAPS,aASd,CAAC,CACH,EAd8C,kCAqBjCI,EAAkBjB,EAAA,CAC7BkB,EACA,CACE,uBAAAjB,EACA,QAAAkB,CACF,IAMG,CACH,GAAM,CAAE,OAAAjB,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,gCAAiCc,EAAQjB,CAAsB,EAC1E,QAASD,EAAA,IACAoB,EAAmB,CACxB,OAAQlB,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,KAAMgB,CAAiB,EAC/B,MAAO,CACL,yBAA0BjB,CAC5B,CACF,CAAC,EAVM,WAYT,QAAS,CAAC,CAACiB,EACX,OAAQlB,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAM,CACpB,IAAIe,EAAYf,GAAM,MAAM,QAAU,CAAC,EACvC,GAAIa,GAAWA,EAAQ,UAAW,CAChC,GAAM,CAAE,OAAAG,CAAO,EAAIC,EAAOF,EAAWF,EAAQ,SAAS,EACtDE,EAAYC,CACd,CACA,OAAOE,EAAmBH,CAAS,CACrC,EAPQ,SAQV,CAAC,CACH,EAtC+B","names":["useMutation","useQuery","createHeadlessForm","modify","useCostCalculatorCountries","__name","includePremiumBenefits","client","useClient","useQuery","getIndexCountry","data","country","useCompanyCurrencies","getIndexCompanyCurrency","currency","useCostCalculatorEstimation","useMutation","payload","postCreateEstimation","useCostCalculatorEstimationPdf","postCreateEstimationPdf","useRegionFields","region","options","getShowRegionField","jsfSchema","schema","modify","createHeadlessForm"]}
|
package/dist/chunk-COHLMZEO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as q}from"./chunk-YKIFMONL.js";import{a as L}from"./chunk-UPRUP24B.js";import{a as A,b as v,c as k,e as T}from"./chunk-C3KZEPUZ.js";import{a as x}from"./chunk-CFIJKJXD.js";import{c as g}from"./chunk-MXFDOIUA.js";import{a as o}from"./chunk-P37U34EQ.js";import{object as ce}from"yup";import{createHeadlessForm as ie,modify as ne}from"@remoteoss/json-schema-form";import{useMemo as se,useState as P}from"react";import{string as G,ValidationError as U}from"yup";import{jsx as le}from"react/jsx-runtime";var j={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1},ae=o(t=>{let{schema:i}=ne(L.data.schema,t?.jsfModify||{});return ie(i)},"useStaticSchema"),be=o(({defaultRegion:t,estimationOptions:i,options:n,version:l}={estimationOptions:j})=>{let[p,m]=P(t),[f,M]=P(),[B,I]=P(),{data:C,isLoading:N}=A({includePremiumBenefits:i.includePremiumBenefits}),{data:E,isLoading:z}=v(),D=p||f?.value,{data:S,isLoading:K}=T(D,{includePremiumBenefits:i.includePremiumBenefits,options:n}),w=k(),O=f?.currency,c=n?.jsfModify?.fields?.salary,y=c&&typeof c=="object"&&"presentation"in c?c.presentation:void 0,Q=se(()=>({fields:{salary:{...c,presentation:{salary_conversion_properties:{label:y?.salary_conversion_properties?.label,description:y?.salary_conversion_properties?.description},currencies:{from:O,to:B},Component:o(e=>le(q,{...e}),"Component")}}}}),[O,B,c,y?.salary_conversion_properties?.description,y?.salary_conversion_properties?.label]),u=ae({jsfModify:{fields:{...n?.jsfModify?.fields,...Q?.fields}}});async function W(e){try{await b.validate(e,{abortEarly:!1})}catch(r){return{data:null,error:r}}return new Promise((r,s)=>{w.mutate(H(e,i,l),{onSuccess:o(a=>{a.data?r({data:a.data,error:null}):r({data:null,error:new Error("Something went wrong. Please try again later.")})},"onSuccess"),onError:o(a=>{s({data:null,error:a})},"onError")})})}o(W,"onSubmit");function X(e){let r=C?.find(({value:s})=>s===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?m(r.regionSlug):m(void 0),M(r)}o(X,"onCountryChange");function Y(e){m(e)}o(Y,"onRegionChange");function Z(e){let r=E?.find(s=>s.value===e)?.label;I(r)}o(Z,"onChangeCurrency");let d=u.fields.find(e=>e.name==="region");if(d){let e=f?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];d.options=e,d.isVisible=e.length>0,d.required=e.length>0,d.onChange=Y,d.schema=e.length>0?G().transform(r=>typeof r=="string"?r:"").required("Region is required"):G()}if(E){let e=u.fields.find(r=>r.name==="currency");e&&(e.options=E,e.onChange=Z)}if(C){let e=u.fields.find(r=>r.name==="country");e&&(e.options=C,e.onChange=X)}let ee=o(()=>{M(void 0),m(t)},"resetForm"),J=[...u.fields,...S?.fields||[]],b=$(u.fields);async function re(e){let r=null,s=g(e,J);try{await b.validate(s,{abortEarly:!1}),r={formErrors:{},yupError:new U([],e)}}catch(F){let V=x(F);r={formErrors:Object.entries(V).reduce((R,[te,oe])=>({...R,[te]:oe.message}),{}),yupError:F}}let a=S?.handleValidation(s),h=[...r?.yupError.inner||[],...a?.yupError?.inner||[]],_={...r?.yupError?.value||{},...a?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...a?.formErrors||{}},yupError:new U(h,_)}}return o(re,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:J,validationSchema:b,parseFormValues:o(e=>{let{country:r,region:s,salary:a,currency:h,..._}=e,V=g({country:r,region:s,salary:a,currency:h},u.fields),R=g(_,S?.fields||[]);return{...V,...R}},"parseFormValues"),handleValidation:re,isSubmitting:w.isPending,isLoading:N&&z&&K,onSubmit:W,resetForm:ee}},"useCostCalculator");function $(t){let i=t.reduce((n,l)=>(n[l.name]=l.schema,n),{});return ce(i)}o($,"buildValidationSchema");function ue(t){let i="benefit-";return Object.keys(t).reduce((n,l)=>{let p=t[l];if(p==="none")return n;let f={benefit_group_slug:l.replace(i,""),benefit_tier_slug:p};return[...n,f]},[])}o(ue,"formatBenefits");function H(t,i=j,n="standard"){return{employer_currency_slug:t.currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,employments:[{region_slug:t.region||t.country,annual_gross_salary_in_employer_currency:t.salary,employment_term:t.contract_duration_type??"fixed",title:i.title,age:t.age??void 0,...t.benefits&&{benefits:ue(t.benefits)},...n==="standard"&&{annual_gross_salary:t.salary}}]}}o(H,"buildPayload");export{$ as a,H as b,j as c,be as d};
|
|
2
|
-
//# sourceMappingURL=chunk-COHLMZEO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/utils.ts","../src/flows/CostCalculator/hooks.tsx"],"sourcesContent":["import type { CostCalculatorEstimateParams } from '@/src/client';\n\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { AnyObjectSchema, object } from 'yup';\nimport { CostCalculatorVersion, defaultEstimationOptions } from './hooks';\nimport type {\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n} from './types';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(fields: $TSFixMe[]) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\n/**\n * Format the benefits to the expected format by the API.\n * @param benefits\n * @returns\n */\nfunction formatBenefits(benefits: Record<string, string>) {\n const needle = 'benefit-';\n return Object.keys(benefits).reduce<\n Array<{ benefit_group_slug: string; benefit_tier_slug: string }>\n >((acc, key) => {\n const benefitTierSlug = benefits[key];\n if (benefitTierSlug === 'none') {\n return acc;\n }\n const benefitGroupSlug = key.replace(needle, '');\n const benefitEntry = {\n benefit_group_slug: benefitGroupSlug,\n benefit_tier_slug: benefitTierSlug,\n };\n return [...acc, benefitEntry];\n }, []);\n}\n\n/**\n * Build the payload for the cost calculator estimation.\n * @param values\n * @param estimationOptions\n * @returns\n */\nexport function buildPayload(\n values: CostCalculatorEstimationSubmitValues,\n estimationOptions: CostCalculatorEstimationOptions = defaultEstimationOptions,\n version: CostCalculatorVersion = 'standard',\n): CostCalculatorEstimateParams {\n return {\n employer_currency_slug: values.currency,\n include_benefits: estimationOptions.includeBenefits,\n include_cost_breakdowns: estimationOptions.includeCostBreakdowns,\n include_premium_benefits: estimationOptions.includePremiumBenefits,\n employments: [\n {\n region_slug: values.region || values.country,\n annual_gross_salary_in_employer_currency: values.salary,\n employment_term: values.contract_duration_type ?? 'fixed',\n title: estimationOptions.title,\n age: values.age ?? undefined,\n ...(values.benefits && { benefits: formatBenefits(values.benefits) }),\n ...(version === 'standard' && {\n annual_gross_salary: values.salary,\n }),\n },\n ],\n };\n}\n","import {\n CostCalculatorEstimateResponse,\n MinimalRegion,\n PostCreateEstimationError,\n} from '@/src/client';\nimport { jsonSchema } from '@/src/flows/CostCalculator/jsonSchema';\nimport type {\n CostCalculatorEstimationFormValues,\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n} from '@/src/flows/CostCalculator/types';\nimport type { JSFModify, Result } from '@/src/flows/types';\n\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { iterateErrors } from '@/src/components/form/yupValidationResolver';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMemo, useState } from 'react';\nimport { string, ValidationError } from 'yup';\nimport { buildPayload, buildValidationSchema } from './utils';\nimport {\n useCompanyCurrencies,\n useCostCalculatorCountries,\n useCostCalculatorEstimation,\n useRegionFields,\n} from '@/src/flows/CostCalculator/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { SalaryField } from '@/src/flows/CostCalculator/components/SalaryField';\n\nexport type CostCalculatorVersion = 'standard' | 'marketing';\n\ntype CostCalculatorCountry = {\n value: string;\n label: string;\n childRegions: MinimalRegion[];\n hasAdditionalFields: boolean | undefined;\n regionSlug: string;\n currency: string;\n};\n\ntype JSFValidationError = {\n formErrors: Record<\n string,\n {\n type: string;\n message: string;\n }\n >;\n yupError: ValidationError;\n};\n\nexport const defaultEstimationOptions: CostCalculatorEstimationOptions = {\n title: 'Estimation',\n includeBenefits: false,\n includeCostBreakdowns: false,\n includePremiumBenefits: false,\n enableCurrencyConversion: false,\n};\n\ntype UseCostCalculatorParams = {\n /**\n * The default region slug to preselect a country and a region.\n */\n defaultRegion?: string;\n /**\n * The estimation options.\n */\n estimationOptions: CostCalculatorEstimationOptions;\n options?: {\n jsfModify?: JSFModify;\n };\n version?: CostCalculatorVersion;\n};\n\nexport type EstimationError = PostCreateEstimationError | ValidationError;\n\nconst useStaticSchema = (options?: { jsfModify?: JSFModify }) => {\n const { schema: jsonSchemaModified } = modify(\n jsonSchema.data.schema,\n options?.jsfModify || {},\n );\n\n return createHeadlessForm(jsonSchemaModified);\n};\n\n/**\n * Hook to use the cost calculator.\n */\nexport const useCostCalculator = (\n {\n defaultRegion,\n estimationOptions,\n options,\n version,\n }: UseCostCalculatorParams = {\n estimationOptions: defaultEstimationOptions,\n },\n) => {\n const [selectedRegion, setSelectedRegion] = useState<string | undefined>(\n defaultRegion,\n );\n const [selectedCountry, setSelectedCountry] =\n useState<CostCalculatorCountry>();\n const [employerBillingCurrency, setEmployerBillingCurrency] = useState<\n string | undefined\n >();\n const { data: countries, isLoading: isLoadingCountries } =\n useCostCalculatorCountries({\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n });\n const { data: currencies, isLoading: isLoadingCurrencies } =\n useCompanyCurrencies();\n\n const jsonSchemaRegionSlug = selectedRegion || selectedCountry?.value;\n\n const { data: jsonSchemaRegionFields, isLoading: isLoadingRegionFields } =\n useRegionFields(jsonSchemaRegionSlug, {\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n options,\n });\n const costCalculatorEstimationMutation = useCostCalculatorEstimation();\n const employeeBillingCurrency = selectedCountry?.currency;\n\n const salaryField = options?.jsfModify?.fields?.salary;\n const salaryFieldPresentation =\n salaryField &&\n typeof salaryField === 'object' &&\n 'presentation' in salaryField\n ? (\n salaryField as {\n presentation?: {\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const customFields = useMemo(() => {\n return {\n fields: {\n salary: {\n ...salaryField,\n presentation: {\n salary_conversion_properties: {\n label:\n salaryFieldPresentation?.salary_conversion_properties?.label,\n description:\n salaryFieldPresentation?.salary_conversion_properties\n ?.description,\n },\n currencies: {\n from: employeeBillingCurrency,\n to: employerBillingCurrency,\n },\n Component: (\n props: JSFField & { currencies: { from: string; to: string } },\n ) => {\n return <SalaryField {...props} />;\n },\n },\n },\n },\n };\n }, [\n employeeBillingCurrency,\n employerBillingCurrency,\n salaryField,\n salaryFieldPresentation?.salary_conversion_properties?.description,\n salaryFieldPresentation?.salary_conversion_properties?.label,\n ]);\n\n const fieldsJSONSchema = useStaticSchema({\n jsfModify: {\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n });\n\n /**\n * Submit the estimation form with the given values.\n * @param values\n */\n async function onSubmit(\n values: CostCalculatorEstimationSubmitValues,\n ): Promise<Result<CostCalculatorEstimateResponse, EstimationError>> {\n try {\n await validationSchema.validate(values, { abortEarly: false });\n } catch (err) {\n return {\n data: null,\n error: err as ValidationError,\n };\n }\n\n return new Promise((resolve, reject) => {\n costCalculatorEstimationMutation.mutate(\n buildPayload(values, estimationOptions, version),\n {\n onSuccess: (response) => {\n if (response.data) {\n resolve({\n data: response.data,\n error: null,\n });\n } else {\n resolve({\n data: null,\n error: new Error(\n 'Something went wrong. Please try again later.',\n ),\n });\n }\n },\n onError: (error) => {\n reject({\n data: null,\n error: error as PostCreateEstimationError,\n });\n },\n },\n );\n });\n }\n\n /**\n * If the selected country has no child regions and has additional fields,\n * set the current region to the country's region slug and fetch the region fields.\n * @param country\n */\n function onCountryChange(country: string) {\n const currentCountry = countries?.find(({ value }) => value === country);\n\n if (\n currentCountry &&\n currentCountry.childRegions.length === 0 &&\n currentCountry.hasAdditionalFields\n ) {\n setSelectedRegion(currentCountry.regionSlug);\n } else {\n setSelectedRegion(undefined);\n }\n setSelectedCountry(currentCountry);\n }\n\n /**\n * Update the selected region and fetch the region fields.\n * @param region\n */\n function onRegionChange(region: string) {\n setSelectedRegion(region);\n }\n\n function onChangeCurrency(currency: string) {\n const selectedCurrency = currencies?.find(\n (c) => c.value === currency,\n )?.label;\n setEmployerBillingCurrency(selectedCurrency);\n }\n\n const regionField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'region',\n );\n\n if (regionField) {\n const regions =\n selectedCountry?.childRegions.map((region) => ({\n value: region.slug,\n label: region.name,\n })) ?? [];\n regionField.options = regions;\n regionField.isVisible = regions.length > 0;\n regionField.required = regions.length > 0;\n regionField.onChange = onRegionChange;\n regionField.schema =\n regions.length > 0\n ? string()\n .transform((value) => (typeof value === 'string' ? value : ''))\n .required('Region is required')\n : string();\n }\n\n if (currencies) {\n const currencyField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'currency',\n );\n if (currencyField) {\n currencyField.options = currencies;\n currencyField.onChange = onChangeCurrency;\n }\n }\n\n if (countries) {\n const countryField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n countryField.onChange = onCountryChange;\n }\n }\n\n const resetForm = () => {\n setSelectedCountry(undefined);\n setSelectedRegion(defaultRegion);\n };\n\n const allFields = [\n ...fieldsJSONSchema.fields,\n ...(jsonSchemaRegionFields?.fields || []),\n ];\n\n const validationSchema = buildValidationSchema(fieldsJSONSchema.fields);\n\n async function handleValidation(values: CostCalculatorEstimationFormValues) {\n let errors: JSFValidationError | null = null;\n\n const parsedValues = parseJSFToValidate(values, allFields);\n\n // 1. validate static fields first using Yup validate function\n try {\n await validationSchema.validate(parsedValues, {\n abortEarly: false,\n });\n errors = {\n formErrors: {},\n yupError: new ValidationError([], values),\n };\n } catch (error) {\n const iterateResult = iterateErrors(error as ValidationError);\n\n errors = {\n // convert the errors to a format that can be used in the form\n formErrors: Object.entries(iterateResult).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.message }),\n {},\n ),\n yupError: error as ValidationError,\n };\n }\n\n // 2. validate json schema fields using the handleValidation (from json-schema-form)\n const handleValidationResult =\n jsonSchemaRegionFields?.handleValidation(parsedValues);\n\n // 3. combine the errors from both validations\n const combinedInnerErrors = [\n ...(errors?.yupError.inner || []),\n ...(handleValidationResult?.yupError?.inner || []),\n ];\n const combinedValues = {\n ...(errors?.yupError?.value || {}),\n ...(handleValidationResult?.yupError?.value || {}),\n };\n\n return {\n formErrors: {\n ...(errors?.formErrors || {}),\n ...(handleValidationResult?.formErrors || {}),\n },\n yupError: new ValidationError(combinedInnerErrors, combinedValues),\n };\n }\n\n return {\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n fields: allFields,\n validationSchema,\n parseFormValues: (\n values: CostCalculatorEstimationFormValues,\n ): CostCalculatorEstimationSubmitValues => {\n const { country, region, salary, currency, ...rest } = values;\n const jsonSchemaStaticFieldValues = {\n country,\n region,\n salary,\n currency,\n };\n const parsedStaticFields = parseJSFToValidate(\n jsonSchemaStaticFieldValues,\n fieldsJSONSchema.fields,\n );\n\n const parsedRegionFields = parseJSFToValidate(\n rest,\n jsonSchemaRegionFields?.fields || [],\n );\n\n return {\n ...parsedStaticFields,\n ...parsedRegionFields,\n } as CostCalculatorEstimationSubmitValues;\n },\n handleValidation,\n isSubmitting: costCalculatorEstimationMutation.isPending,\n isLoading:\n isLoadingCountries && isLoadingCurrencies && isLoadingRegionFields,\n onSubmit,\n resetForm,\n };\n};\n"],"mappings":"qQAGA,OAA0B,UAAAA,OAAc,MCYxC,OAAS,sBAAAC,GAAoB,UAAAC,OAAc,8BAC3C,OAAS,WAAAC,GAAS,YAAAC,MAAgB,QAClC,OAAS,UAAAC,EAAQ,mBAAAC,MAAuB,MA8InB,cAAAC,OAAA,oBA7Gd,IAAMC,EAA4D,CACvE,MAAO,aACP,gBAAiB,GACjB,sBAAuB,GACvB,uBAAwB,GACxB,yBAA0B,EAC5B,EAmBMC,GAAkBC,EAACC,GAAwC,CAC/D,GAAM,CAAE,OAAQC,CAAmB,EAAIC,GACrCC,EAAW,KAAK,OAChBH,GAAS,WAAa,CAAC,CACzB,EAEA,OAAOI,GAAmBH,CAAkB,CAC9C,EAPwB,mBAYXI,GAAoBN,EAAA,CAC/B,CACE,cAAAO,EACA,kBAAAC,EACA,QAAAP,EACA,QAAAQ,CACF,EAA6B,CAC3B,kBAAmBX,CACrB,IACG,CACH,GAAM,CAACY,EAAgBC,CAAiB,EAAIC,EAC1CL,CACF,EACM,CAACM,EAAiBC,CAAkB,EACxCF,EAAgC,EAC5B,CAACG,EAAyBC,CAA0B,EAAIJ,EAE5D,EACI,CAAE,KAAMK,EAAW,UAAWC,CAAmB,EACrDC,EAA2B,CACzB,uBAAwBX,EAAkB,sBAC5C,CAAC,EACG,CAAE,KAAMY,EAAY,UAAWC,CAAoB,EACvDC,EAAqB,EAEjBC,EAAuBb,GAAkBG,GAAiB,MAE1D,CAAE,KAAMW,EAAwB,UAAWC,CAAsB,EACrEC,EAAgBH,EAAsB,CACpC,uBAAwBf,EAAkB,uBAC1C,QAAAP,CACF,CAAC,EACG0B,EAAmCC,EAA4B,EAC/DC,EAA0BhB,GAAiB,SAE3CiB,EAAc7B,GAAS,WAAW,QAAQ,OAC1C8B,EACJD,GACA,OAAOA,GAAgB,UACvB,iBAAkBA,EAEZA,EAQA,aACF,OAEAE,EAAeC,GAAQ,KACpB,CACL,OAAQ,CACN,OAAQ,CACN,GAAGH,EACH,aAAc,CACZ,6BAA8B,CAC5B,MACEC,GAAyB,8BAA8B,MACzD,YACEA,GAAyB,8BACrB,WACR,EACA,WAAY,CACV,KAAMF,EACN,GAAId,CACN,EACA,UAAWf,EACTkC,GAEOrC,GAACsC,EAAA,CAAa,GAAGD,EAAO,EAHtB,YAKb,CACF,CACF,CACF,GACC,CACDL,EACAd,EACAe,EACAC,GAAyB,8BAA8B,YACvDA,GAAyB,8BAA8B,KACzD,CAAC,EAEKK,EAAmBrC,GAAgB,CACvC,UAAW,CACT,OAAQ,CACN,GAAGE,GAAS,WAAW,OACvB,GAAG+B,GAAc,MACnB,CACF,CACF,CAAC,EAMD,eAAeK,EACbC,EACkE,CAClE,GAAI,CACF,MAAMC,EAAiB,SAASD,EAAQ,CAAE,WAAY,EAAM,CAAC,CAC/D,OAASE,EAAK,CACZ,MAAO,CACL,KAAM,KACN,MAAOA,CACT,CACF,CAEA,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACtCf,EAAiC,OAC/BgB,EAAaL,EAAQ9B,EAAmBC,CAAO,EAC/C,CACE,UAAWT,EAAC4C,GAAa,CACnBA,EAAS,KACXH,EAAQ,CACN,KAAMG,EAAS,KACf,MAAO,IACT,CAAC,EAEDH,EAAQ,CACN,KAAM,KACN,MAAO,IAAI,MACT,+CACF,CACF,CAAC,CAEL,EAdW,aAeX,QAASzC,EAAC6C,GAAU,CAClBH,EAAO,CACL,KAAM,KACN,MAAOG,CACT,CAAC,CACH,EALS,UAMX,CACF,CACF,CAAC,CACH,CAxCe7C,EAAAqC,EAAA,YA+Cf,SAASS,EAAgBC,EAAiB,CACxC,IAAMC,EAAiB/B,GAAW,KAAK,CAAC,CAAE,MAAAgC,CAAM,IAAMA,IAAUF,CAAO,EAGrEC,GACAA,EAAe,aAAa,SAAW,GACvCA,EAAe,oBAEfrC,EAAkBqC,EAAe,UAAU,EAE3CrC,EAAkB,MAAS,EAE7BG,EAAmBkC,CAAc,CACnC,CAbShD,EAAA8C,EAAA,mBAmBT,SAASI,EAAeC,EAAgB,CACtCxC,EAAkBwC,CAAM,CAC1B,CAFSnD,EAAAkD,EAAA,kBAIT,SAASE,EAAiBC,EAAkB,CAC1C,IAAMC,EAAmBlC,GAAY,KAClCmC,GAAMA,EAAE,QAAUF,CACrB,GAAG,MACHrC,EAA2BsC,CAAgB,CAC7C,CALStD,EAAAoD,EAAA,oBAOT,IAAMI,EAAcpB,EAAiB,OAAO,KACzCqB,GAAUA,EAAM,OAAS,QAC5B,EAEA,GAAID,EAAa,CACf,IAAME,EACJ7C,GAAiB,aAAa,IAAKsC,IAAY,CAC7C,MAAOA,EAAO,KACd,MAAOA,EAAO,IAChB,EAAE,GAAK,CAAC,EACVK,EAAY,QAAUE,EACtBF,EAAY,UAAYE,EAAQ,OAAS,EACzCF,EAAY,SAAWE,EAAQ,OAAS,EACxCF,EAAY,SAAWN,EACvBM,EAAY,OACVE,EAAQ,OAAS,EACbC,EAAO,EACJ,UAAWV,GAAW,OAAOA,GAAU,SAAWA,EAAQ,EAAG,EAC7D,SAAS,oBAAoB,EAChCU,EAAO,CACf,CAEA,GAAIvC,EAAY,CACd,IAAMwC,EAAgBxB,EAAiB,OAAO,KAC3CqB,GAAUA,EAAM,OAAS,UAC5B,EACIG,IACFA,EAAc,QAAUxC,EACxBwC,EAAc,SAAWR,EAE7B,CAEA,GAAInC,EAAW,CACb,IAAM4C,EAAezB,EAAiB,OAAO,KAC1CqB,GAAUA,EAAM,OAAS,SAC5B,EACII,IACFA,EAAa,QAAU5C,EACvB4C,EAAa,SAAWf,EAE5B,CAEA,IAAMgB,GAAY9D,EAAA,IAAM,CACtBc,EAAmB,MAAS,EAC5BH,EAAkBJ,CAAa,CACjC,EAHkB,aAKZwD,EAAY,CAChB,GAAG3B,EAAiB,OACpB,GAAIZ,GAAwB,QAAU,CAAC,CACzC,EAEMe,EAAmByB,EAAsB5B,EAAiB,MAAM,EAEtE,eAAe6B,GAAiB3B,EAA4C,CAC1E,IAAI4B,EAAoC,KAElCC,EAAeC,EAAmB9B,EAAQyB,CAAS,EAGzD,GAAI,CACF,MAAMxB,EAAiB,SAAS4B,EAAc,CAC5C,WAAY,EACd,CAAC,EACDD,EAAS,CACP,WAAY,CAAC,EACb,SAAU,IAAIG,EAAgB,CAAC,EAAG/B,CAAM,CAC1C,CACF,OAASO,EAAO,CACd,IAAMyB,EAAgBC,EAAc1B,CAAwB,EAE5DqB,EAAS,CAEP,WAAY,OAAO,QAAQI,CAAa,EAAE,OACxC,CAACE,EAAK,CAACC,GAAKxB,EAAK,KAAO,CAAE,GAAGuB,EAAK,CAACC,EAAG,EAAGxB,GAAM,OAAQ,GACvD,CAAC,CACH,EACA,SAAUJ,CACZ,CACF,CAGA,IAAM6B,EACJlD,GAAwB,iBAAiB2C,CAAY,EAGjDQ,EAAsB,CAC1B,GAAIT,GAAQ,SAAS,OAAS,CAAC,EAC/B,GAAIQ,GAAwB,UAAU,OAAS,CAAC,CAClD,EACME,EAAiB,CACrB,GAAIV,GAAQ,UAAU,OAAS,CAAC,EAChC,GAAIQ,GAAwB,UAAU,OAAS,CAAC,CAClD,EAEA,MAAO,CACL,WAAY,CACV,GAAIR,GAAQ,YAAc,CAAC,EAC3B,GAAIQ,GAAwB,YAAc,CAAC,CAC7C,EACA,SAAU,IAAIL,EAAgBM,EAAqBC,CAAc,CACnE,CACF,CAhDe,OAAA5E,EAAAiE,GAAA,oBAkDR,CACL,UAAW,CACT,QAAS,EACT,MAAO,EACP,WAAY,EACd,EACA,OAAQF,EACR,iBAAAxB,EACA,gBAAiBvC,EACfsC,GACyC,CACzC,GAAM,CAAE,QAAAS,EAAS,OAAAI,EAAQ,OAAA0B,EAAQ,SAAAxB,EAAU,GAAGyB,CAAK,EAAIxC,EAOjDyC,EAAqBX,EANS,CAClC,QAAArB,EACA,OAAAI,EACA,OAAA0B,EACA,SAAAxB,CACF,EAGEjB,EAAiB,MACnB,EAEM4C,EAAqBZ,EACzBU,EACAtD,GAAwB,QAAU,CAAC,CACrC,EAEA,MAAO,CACL,GAAGuD,EACH,GAAGC,CACL,CACF,EAxBiB,mBAyBjB,iBAAAf,GACA,aAActC,EAAiC,UAC/C,UACET,GAAsBG,GAAuBI,EAC/C,SAAAY,EACA,UAAAyB,EACF,CACF,EAhUiC,qBDzE1B,SAASmB,EAAsBC,EAAoB,CACxD,IAAMC,EAAeD,EAAO,OAC1B,CAACE,EAAiBC,KAChBD,EAAgBC,EAAM,IAAI,EAAIA,EAAM,OAC7BD,GAET,CAAC,CACH,EACA,OAAOE,GAAOH,CAAY,CAC5B,CATgBI,EAAAN,EAAA,yBAgBhB,SAASO,GAAeC,EAAkC,CACxD,IAAMC,EAAS,WACf,OAAO,OAAO,KAAKD,CAAQ,EAAE,OAE3B,CAACE,EAAKC,IAAQ,CACd,IAAMC,EAAkBJ,EAASG,CAAG,EACpC,GAAIC,IAAoB,OACtB,OAAOF,EAGT,IAAMG,EAAe,CACnB,mBAFuBF,EAAI,QAAQF,EAAQ,EAAE,EAG7C,kBAAmBG,CACrB,EACA,MAAO,CAAC,GAAGF,EAAKG,CAAY,CAC9B,EAAG,CAAC,CAAC,CACP,CAhBSP,EAAAC,GAAA,kBAwBF,SAASO,EACdC,EACAC,EAAqDC,EACrDC,EAAiC,WACH,CAC9B,MAAO,CACL,uBAAwBH,EAAO,SAC/B,iBAAkBC,EAAkB,gBACpC,wBAAyBA,EAAkB,sBAC3C,yBAA0BA,EAAkB,uBAC5C,YAAa,CACX,CACE,YAAaD,EAAO,QAAUA,EAAO,QACrC,yCAA0CA,EAAO,OACjD,gBAAiBA,EAAO,wBAA0B,QAClD,MAAOC,EAAkB,MACzB,IAAKD,EAAO,KAAO,OACnB,GAAIA,EAAO,UAAY,CAAE,SAAUR,GAAeQ,EAAO,QAAQ,CAAE,EACnE,GAAIG,IAAY,YAAc,CAC5B,oBAAqBH,EAAO,MAC9B,CACF,CACF,CACF,CACF,CAxBgBT,EAAAQ,EAAA","names":["object","createHeadlessForm","modify","useMemo","useState","string","ValidationError","jsx","defaultEstimationOptions","useStaticSchema","__name","options","jsonSchemaModified","modify","jsonSchema","createHeadlessForm","useCostCalculator","defaultRegion","estimationOptions","version","selectedRegion","setSelectedRegion","useState","selectedCountry","setSelectedCountry","employerBillingCurrency","setEmployerBillingCurrency","countries","isLoadingCountries","useCostCalculatorCountries","currencies","isLoadingCurrencies","useCompanyCurrencies","jsonSchemaRegionSlug","jsonSchemaRegionFields","isLoadingRegionFields","useRegionFields","costCalculatorEstimationMutation","useCostCalculatorEstimation","employeeBillingCurrency","salaryField","salaryFieldPresentation","customFields","useMemo","props","SalaryField","fieldsJSONSchema","onSubmit","values","validationSchema","err","resolve","reject","buildPayload","response","error","onCountryChange","country","currentCountry","value","onRegionChange","region","onChangeCurrency","currency","selectedCurrency","c","regionField","field","regions","string","currencyField","countryField","resetForm","allFields","buildValidationSchema","handleValidation","errors","parsedValues","parseJSFToValidate","ValidationError","iterateResult","iterateErrors","acc","key","handleValidationResult","combinedInnerErrors","combinedValues","salary","rest","parsedStaticFields","parsedRegionFields","buildValidationSchema","fields","fieldsSchema","fieldsSchemaAcc","field","object","__name","formatBenefits","benefits","needle","acc","key","benefitTierSlug","benefitEntry","buildPayload","values","estimationOptions","defaultEstimationOptions","version"]}
|
package/dist/chunk-DEGMU7EO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as H}from"./chunk-E6DC4DXP.js";import{a as M}from"./chunk-IXZAHZ7B.js";import{b as D}from"./chunk-3ZWDIEEM.js";import{c as B}from"./chunk-DPLXEXMO.js";import{a as t,b as u,c as qe}from"./chunk-P37U34EQ.js";var P=u((St,G)=>{"use strict";function Re(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(Re,"isObject");G.exports=Re});var K=u((Ot,J)=>{"use strict";var $e=typeof global=="object"&&global&&global.Object===Object&&global;J.exports=$e});var k=u((Et,U)=>{"use strict";var Fe=K(),Ie=typeof self=="object"&&self&&self.Object===Object&&self,Me=Fe||Ie||Function("return this")();U.exports=Me});var X=u((qt,V)=>{"use strict";var Pe=k(),ke=t(function(){return Pe.Date.now()},"now");V.exports=ke});var Q=u(($t,z)=>{"use strict";var we=/\s/;function Le(e){for(var n=e.length;n--&&we.test(e.charAt(n)););return n}t(Le,"trimmedEndIndex");z.exports=Le});var Z=u((It,Y)=>{"use strict";var _e=Q(),Ne=/^\s+/;function Ae(e){return e&&e.slice(0,_e(e)+1).replace(Ne,"")}t(Ae,"baseTrim");Y.exports=Ae});var w=u((Pt,ee)=>{"use strict";var We=k(),De=We.Symbol;ee.exports=De});var oe=u((kt,re)=>{"use strict";var te=w(),ne=Object.prototype,Be=ne.hasOwnProperty,He=ne.toString,C=te?te.toStringTag:void 0;function Ge(e){var n=Be.call(e,C),o=e[C];try{e[C]=void 0;var a=!0}catch{}var c=He.call(e);return a&&(n?e[C]=o:delete e[C]),c}t(Ge,"getRawTag");re.exports=Ge});var se=u((Lt,ie)=>{"use strict";var Je=Object.prototype,Ke=Je.toString;function Ue(e){return Ke.call(e)}t(Ue,"objectToString");ie.exports=Ue});var fe=u((Nt,ue)=>{"use strict";var ae=w(),Ve=oe(),Xe=se(),ze="[object Null]",Qe="[object Undefined]",ce=ae?ae.toStringTag:void 0;function Ye(e){return e==null?e===void 0?Qe:ze:ce&&ce in Object(e)?Ve(e):Xe(e)}t(Ye,"baseGetTag");ue.exports=Ye});var de=u((Wt,le)=>{"use strict";function Ze(e){return e!=null&&typeof e=="object"}t(Ze,"isObjectLike");le.exports=Ze});var ge=u((Bt,me)=>{"use strict";var et=fe(),tt=de(),nt="[object Symbol]";function rt(e){return typeof e=="symbol"||tt(e)&&et(e)==nt}t(rt,"isSymbol");me.exports=rt});var ye=u((Gt,ve)=>{"use strict";var ot=Z(),pe=P(),it=ge(),be=NaN,st=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,ct=/^0o[0-7]+$/i,ut=parseInt;function ft(e){if(typeof e=="number")return e;if(it(e))return be;if(pe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=pe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ot(e);var o=at.test(e);return o||ct.test(e)?ut(e.slice(2),o?2:8):st.test(e)?be:+e}t(ft,"toNumber");ve.exports=ft});var Te=u((Kt,xe)=>{"use strict";var lt=P(),L=X(),he=ye(),dt="Expected a function",mt=Math.max,gt=Math.min;function pt(e,n,o){var a,c,m,f,s,g,l=0,j=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(dt);n=he(n)||0,lt(o)&&(j=!!o.leading,p="maxWait"in o,m=p?mt(he(o.maxWait)||0,n):m,y="trailing"in o?!!o.trailing:y);function b(i){var r=a,d=c;return a=c=void 0,l=i,f=e.apply(d,r),f}t(b,"invokeFunc");function $(i){return l=i,s=setTimeout(v,n),j?b(i):f}t($,"leadingEdge");function O(i){var r=i-g,d=i-l,h=n-r;return p?gt(h,m-d):h}t(O,"remainingWait");function x(i){var r=i-g,d=i-l;return g===void 0||r>=n||r<0||p&&d>=m}t(x,"shouldInvoke");function v(){var i=L();if(x(i))return E(i);s=setTimeout(v,O(i))}t(v,"timerExpired");function E(i){return s=void 0,y&&a?b(i):(a=c=void 0,f)}t(E,"trailingEdge");function F(){s!==void 0&&clearTimeout(s),l=0,a=g=c=s=void 0}t(F,"cancel");function I(){return s===void 0?f:E(L())}t(I,"flush");function T(){var i=L(),r=x(i);if(a=arguments,c=this,g=i,r){if(s===void 0)return $(g);if(p)return clearTimeout(s),s=setTimeout(v,n),b(g)}return s===void 0&&(s=setTimeout(v,n)),f}return t(T,"debounced"),T.cancel=F,T.flush=I,T}t(pt,"debounce");xe.exports=pt});import{useState as yt,useCallback as ht,useEffect as xt,useRef as je}from"react";var Se=qe(Te(),1);import{useCallback as bt,useEffect as vt,useRef as Ce}from"react";function _(e,n){let o=Ce(e);vt(()=>{o.current=e},[e]);let a=Ce((0,Se.default)(c=>{o.current(c)},n)).current;return bt(c=>{a(c)},[a])}t(_,"useDebounce");import{Fragment as Ct,jsx as S,jsxs as Oe}from"react/jsx-runtime";var Tt=t(({description:e,showConversion:n,targetCurrency:o,className:a,onClick:c})=>{let{components:m}=D(),f=n?`Hide ${o} conversion`:`Show ${o} conversion`,s=m?.button;return Oe("span",{className:a,children:[e," ",s?S(s,{className:`${a.replace("-description","-button")}`,"data-type":"inline",onClick:c,children:f}):S("button",{className:`${a.replace("-description","-button")}`,onClick:c,children:f})]})},"DescriptionWithConversion"),on=t(({sourceCurrency:e,targetCurrency:n,conversionFieldName:o,conversionProperties:a,classNamePrefix:c,description:m,...f})=>{let[s,g]=yt(!1),{setValue:l,watch:j}=B(),p=j(f.name),y=je(!0),b=je(new Map),$=e&&n&&e!==n,{mutateAsync:O}=H();xt(()=>{if(y.current){y.current=!1;return}l(o,"")},[e,o,l]);let x=ht(async(r,d,h,N)=>{if(!r)return;let A=`${d}_${h}_${r}`,W=b.current.get(A);if(W){l(N,W.targetAmount);return}try{let q=await O({source_currency:d,target_currency:h,amount:Number(r)});if(q.data?.data?.conversion_data?.target_amount){let R=q.data.data.conversion_data.target_amount;if(R){l(N,R?.toString()),b.current.set(A,{targetAmount:R.toString()});let Ee=`${h}_${d}_${R}`;b.current.set(Ee,{targetAmount:r.toString()})}}}catch(q){console.error("Error converting currency:",q)}},[O,l]),v=_(r=>x(r,e,n,o),500),E=_(r=>x(r,n,e,f.name),500),F=t(r=>{s&&v(r.target.value)},"handleMainFieldChange"),I=t(r=>{E(r.target.value)},"handleConversionFieldChange"),T=t(r=>{r.preventDefault(),g(d=>!d),!s&&p&&v(p)},"toggleConversion"),i=$?S(Tt,{targetCurrency:n,description:m,showConversion:s,className:`${c}-description`,onClick:T}):m;return Oe(Ct,{children:[S(M,{...f,additionalProps:{currency:e},description:i,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:F}),s&&S(M,{additionalProps:{currency:n},name:o,label:a?.label||"Conversion",description:a?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:I})]})},"CurrencyConversionField");export{on as a};
|
|
2
|
-
//# sourceMappingURL=chunk-DEGMU7EO.js.map
|