@remoteoss/remote-flows 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ZendeskTriggerButton-FSCvhzTG.d.ts → ZendeskTriggerButton-DIV8pCPo.d.ts} +2 -1
- package/dist/{chunk-I3PGODII.js → chunk-4ZGIL6OE.js} +2 -2
- package/dist/{chunk-22JG4IMF.js → chunk-5NPET4ZO.js} +2 -2
- package/dist/chunk-746ELT2W.js +2 -0
- package/dist/chunk-746ELT2W.js.map +1 -0
- package/dist/chunk-7VOQAVM4.js +2 -0
- package/dist/chunk-7VOQAVM4.js.map +1 -0
- package/dist/{chunk-VVF4IZES.js → chunk-7Y46DL2U.js} +2 -2
- package/dist/{chunk-NWEXPORY.js → chunk-A2SWQS2N.js} +2 -2
- package/dist/chunk-ANQ4HVVK.js +2 -0
- package/dist/chunk-ANQ4HVVK.js.map +1 -0
- package/dist/{chunk-I52UTPHD.js → chunk-AYLYOLVG.js} +2 -2
- package/dist/{chunk-3VYNEJMC.js → chunk-BO6OKTIG.js} +2 -2
- package/dist/{chunk-PHBQMNG3.js → chunk-CVIWZYO3.js} +2 -2
- package/dist/{chunk-2M7EBC4K.js → chunk-DZ67OJVF.js} +2 -2
- package/dist/{chunk-VUP76ZMQ.js → chunk-E3JFQ7PH.js} +2 -2
- package/dist/{chunk-W5BJQRNM.js → chunk-E6OBNWMU.js} +2 -2
- package/dist/chunk-EHAZWZ3O.js +2 -0
- package/dist/chunk-EHAZWZ3O.js.map +1 -0
- package/dist/{chunk-M6G27EJN.js → chunk-FEHSJUZJ.js} +2 -2
- package/dist/{chunk-4JVXDB5G.js → chunk-GD5556B2.js} +2 -2
- package/dist/chunk-IWA5B4U6.js +2 -0
- package/dist/chunk-IWA5B4U6.js.map +1 -0
- package/dist/{chunk-Q3A4A2HL.js → chunk-KOIHMAAP.js} +2 -2
- package/dist/{chunk-EJ4COVQQ.js → chunk-L6FZRTSN.js} +2 -2
- package/dist/{chunk-4IXRU67S.js → chunk-LDJT7TII.js} +2 -2
- package/dist/chunk-LMYJ6V44.js +2 -0
- package/dist/chunk-LMYJ6V44.js.map +1 -0
- package/dist/{chunk-S2KE2JLJ.js → chunk-LRNSFLHR.js} +2 -2
- package/dist/{chunk-AU6AILO2.js → chunk-N3EIN72T.js} +2 -2
- package/dist/{chunk-CT2ROVBF.js → chunk-NRW33IP5.js} +2 -2
- package/dist/{chunk-QEWB24WT.js → chunk-OXCEJQFC.js} +2 -2
- package/dist/{chunk-OCNL6L4L.js → chunk-PFT7KJ65.js} +2 -2
- package/dist/{chunk-RNJWBKLA.js → chunk-QLNFHOLH.js} +2 -2
- package/dist/{chunk-RDGF4PBB.js → chunk-R3LY6TV5.js} +2 -2
- package/dist/chunk-R645TMO5.js +2 -0
- package/dist/{chunk-2TADRH4W.js.map → chunk-R645TMO5.js.map} +1 -1
- package/dist/{chunk-BGXVK7HL.js → chunk-R64X3EJF.js} +2 -2
- package/dist/{chunk-JHPCP2ZX.js → chunk-RAHCZTQ3.js} +2 -2
- package/dist/{chunk-BLZW25OE.js → chunk-SA74WAVS.js} +2 -2
- package/dist/{chunk-P4ZSYIA4.js → chunk-SB3IYODL.js} +2 -2
- package/dist/{chunk-7KNNJBO6.js → chunk-TUFTB5UD.js} +2 -2
- package/dist/chunk-UFBTCHEI.js +2 -0
- package/dist/{chunk-IUZ7DEXC.js.map → chunk-UFBTCHEI.js.map} +1 -1
- package/dist/{chunk-74DRB7Z5.js → chunk-VLLLNIMN.js} +2 -2
- package/dist/chunk-VM2DQCZO.js +2 -0
- package/dist/chunk-VM2DQCZO.js.map +1 -0
- package/dist/chunk-W55MUSAS.js +2 -0
- package/dist/{chunk-NVYMAOQ7.js.map → chunk-W55MUSAS.js.map} +1 -1
- package/dist/chunk-WLBRCGTG.js +2 -0
- package/dist/{chunk-QKLIYOMA.js.map → chunk-WLBRCGTG.js.map} +1 -1
- package/dist/{chunk-HCZWP44I.js → chunk-WNTOQYRY.js} +2 -2
- package/dist/{chunk-T5LZSTW3.js → chunk-WZAWPSKS.js} +2 -2
- package/dist/{chunk-46JFDBPC.js → chunk-XP7UEI56.js} +2 -2
- package/dist/{chunk-LHSNAVGR.js → chunk-YXWBSRKS.js} +2 -2
- package/dist/{chunk-KH5SAWNH.js → chunk-ZIPHLBX4.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.d.ts +10 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.d.ts +11 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.d.ts +18 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.d.ts +12 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +2 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/constants.js.map +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.d.ts +11 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.js +1 -0
- package/dist/flows/Termination/components/AcknowledgeInformation/types.js.map +1 -0
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +4 -0
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +17 -0
- package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +17 -0
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/api.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2TADRH4W.js +0 -2
- package/dist/chunk-32GSS4UM.js +0 -2
- package/dist/chunk-32GSS4UM.js.map +0 -1
- package/dist/chunk-HHWIJGDR.js +0 -2
- package/dist/chunk-HHWIJGDR.js.map +0 -1
- package/dist/chunk-IUZ7DEXC.js +0 -2
- package/dist/chunk-MP2T74PU.js +0 -2
- package/dist/chunk-MP2T74PU.js.map +0 -1
- package/dist/chunk-NVYMAOQ7.js +0 -2
- package/dist/chunk-QKLIYOMA.js +0 -2
- package/dist/chunk-XSHHMBMT.js +0 -2
- package/dist/chunk-XSHHMBMT.js.map +0 -1
- /package/dist/{chunk-I3PGODII.js.map → chunk-4ZGIL6OE.js.map} +0 -0
- /package/dist/{chunk-22JG4IMF.js.map → chunk-5NPET4ZO.js.map} +0 -0
- /package/dist/{chunk-VVF4IZES.js.map → chunk-7Y46DL2U.js.map} +0 -0
- /package/dist/{chunk-NWEXPORY.js.map → chunk-A2SWQS2N.js.map} +0 -0
- /package/dist/{chunk-I52UTPHD.js.map → chunk-AYLYOLVG.js.map} +0 -0
- /package/dist/{chunk-3VYNEJMC.js.map → chunk-BO6OKTIG.js.map} +0 -0
- /package/dist/{chunk-PHBQMNG3.js.map → chunk-CVIWZYO3.js.map} +0 -0
- /package/dist/{chunk-2M7EBC4K.js.map → chunk-DZ67OJVF.js.map} +0 -0
- /package/dist/{chunk-VUP76ZMQ.js.map → chunk-E3JFQ7PH.js.map} +0 -0
- /package/dist/{chunk-W5BJQRNM.js.map → chunk-E6OBNWMU.js.map} +0 -0
- /package/dist/{chunk-M6G27EJN.js.map → chunk-FEHSJUZJ.js.map} +0 -0
- /package/dist/{chunk-4JVXDB5G.js.map → chunk-GD5556B2.js.map} +0 -0
- /package/dist/{chunk-Q3A4A2HL.js.map → chunk-KOIHMAAP.js.map} +0 -0
- /package/dist/{chunk-EJ4COVQQ.js.map → chunk-L6FZRTSN.js.map} +0 -0
- /package/dist/{chunk-4IXRU67S.js.map → chunk-LDJT7TII.js.map} +0 -0
- /package/dist/{chunk-S2KE2JLJ.js.map → chunk-LRNSFLHR.js.map} +0 -0
- /package/dist/{chunk-AU6AILO2.js.map → chunk-N3EIN72T.js.map} +0 -0
- /package/dist/{chunk-CT2ROVBF.js.map → chunk-NRW33IP5.js.map} +0 -0
- /package/dist/{chunk-QEWB24WT.js.map → chunk-OXCEJQFC.js.map} +0 -0
- /package/dist/{chunk-OCNL6L4L.js.map → chunk-PFT7KJ65.js.map} +0 -0
- /package/dist/{chunk-RNJWBKLA.js.map → chunk-QLNFHOLH.js.map} +0 -0
- /package/dist/{chunk-RDGF4PBB.js.map → chunk-R3LY6TV5.js.map} +0 -0
- /package/dist/{chunk-BGXVK7HL.js.map → chunk-R64X3EJF.js.map} +0 -0
- /package/dist/{chunk-JHPCP2ZX.js.map → chunk-RAHCZTQ3.js.map} +0 -0
- /package/dist/{chunk-BLZW25OE.js.map → chunk-SA74WAVS.js.map} +0 -0
- /package/dist/{chunk-P4ZSYIA4.js.map → chunk-SB3IYODL.js.map} +0 -0
- /package/dist/{chunk-7KNNJBO6.js.map → chunk-TUFTB5UD.js.map} +0 -0
- /package/dist/{chunk-74DRB7Z5.js.map → chunk-VLLLNIMN.js.map} +0 -0
- /package/dist/{chunk-HCZWP44I.js.map → chunk-WNTOQYRY.js.map} +0 -0
- /package/dist/{chunk-T5LZSTW3.js.map → chunk-WZAWPSKS.js.map} +0 -0
- /package/dist/{chunk-46JFDBPC.js.map → chunk-XP7UEI56.js.map} +0 -0
- /package/dist/{chunk-LHSNAVGR.js.map → chunk-YXWBSRKS.js.map} +0 -0
- /package/dist/{chunk-KH5SAWNH.js.map → chunk-ZIPHLBX4.js.map} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"mwHAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,CAJSV,EAAAS,EAAA,gBAMF,SAASE,EAAWC,EAAoC,CACzDA,GAAO,Q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AQ,EAClE,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,GAAA,4BAsBF,SAASU,GAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,GAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,GAC3B,SAAAD,EAACa,GAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
1
|
+
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n local: 'http://localhost:4000/api/eor',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mapp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EAACG,GAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Z as ZendeskTriggerButton, c as cn } from './ZendeskTriggerButton-
|
|
1
|
+
export { Z as ZendeskTriggerButton, c as cn } from './ZendeskTriggerButton-DIV8pCPo.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
package/dist/internals.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as j,b as m,c as n,d as o,f as p,g as q,h as r,i as s,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E}from"./chunk-D6X2WCEG.js";import{a as t,b as u}from"./chunk-HPHWQU34.js";import{
|
|
1
|
+
import{a as Q,b as R,c as S}from"./chunk-JBUNDNKJ.js";import{a as M,b as N,c as O,d as P}from"./chunk-7R347KBY.js";import{a as G,b as H,c as I,d as J,e as K,f as L}from"./chunk-AFRA4BIW.js";import{a as F}from"./chunk-3A47R5RQ.js";import{a as j,b as m,c as n,d as o,f as p,g as q,h as r,i as s,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E}from"./chunk-D6X2WCEG.js";import{a as t,b as u}from"./chunk-HPHWQU34.js";import{b as i}from"./chunk-ANQ4HVVK.js";import{a as c}from"./chunk-PD24XKD6.js";import{a as d,b as e,d as f,e as g,f as h}from"./chunk-TWIUL2P3.js";import"./chunk-ZX5OIIJX.js";import"./chunk-3O3Q24JL.js";import{a as k,b as l}from"./chunk-WVDTHFGS.js";import"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-MQ6F5LE4.js";import{a}from"./chunk-43WMZDDH.js";import"./chunk-P37U34EQ.js";export{C as Alert,E as AlertDescription,D as AlertTitle,u as Badge,l as Button,G as Card,K as CardContent,J as CardDescription,L as CardFooter,H as CardHeader,I as CardTitle,j as Checkbox,Q as Collapsible,S as CollapsibleContent,R as CollapsibleTrigger,v as Dialog,x as DialogContent,B as DialogDescription,z as DialogFooter,y as DialogHeader,A as DialogTitle,w as DialogTrigger,d as Drawer,f as DrawerContent,g as DrawerHeader,h as DrawerTitle,e as DrawerTrigger,c as Input,b as Label,m as RadioGroup,n as RadioGroupItem,F as ScrollArea,o as Select,r as SelectContent,s as SelectItem,q as SelectTrigger,p as SelectValue,M as Tabs,P as TabsContent,N as TabsList,O as TabsTrigger,i as ZendeskTriggerButton,t as badgeVariants,k as buttonVariants,a as cn};
|
|
2
2
|
//# sourceMappingURL=internals.js.map
|
package/package.json
CHANGED
package/dist/chunk-2TADRH4W.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-ZSCKSEAA.js";import{a as m}from"./chunk-ZE3YT3Q6.js";import{a as e}from"./chunk-32GSS4UM.js";import{a}from"./chunk-MP2T74PU.js";import{b as n}from"./chunk-WVDTHFGS.js";import{b as s}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as y,jsx as r,jsxs as t}from"react/jsx-runtime";function N({grossSalary:l,currency:p,hasExtraStatutoryPayment:c=!1}){return t("div",{children:[t("div",{className:"flex justify-between items-center mb-2",children:[t("div",{className:"flex items-center gap-2",children:[r("h3",{className:"font-medium text-primary-foreground",children:"Gross Salary"}),c&&r(m,{content:t(y,{children:[r("span",{children:"This country respects extra payments on top of the gross salary."})," ",r(a,{zendeskId:e.extraPayments,children:"Learn more"})]}),children:t(n,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0 mt-2",children:[r(f,{className:"h-3 w-3 text-gray-400"}),r("span",{className:"sr-only",children:"Info"})]})})]}),r("span",{className:"font-semibold text-lg",children:s(l,p)})]}),r(i,{})]})}o(N,"CostCalculatorGrossSalary");export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2TADRH4W.js.map
|
package/dist/chunk-32GSS4UM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={disclaimerCostCalculator:4668194326797,employeeOnboardingTimeline:4411262104589,extraPayments:4466822781709,internationalPricing:4410698586893,remoteFxRate:33271144977421,terminationEmployeeCommunication:4411585179661,terminationNoticePeriods:5831900985613};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-32GSS4UM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/zendesk-drawer/utils.ts"],"sourcesContent":["export const zendeskArticles = {\n disclaimerCostCalculator: 4668194326797,\n employeeOnboardingTimeline: 4411262104589,\n extraPayments: 4466822781709,\n internationalPricing: 4410698586893,\n remoteFxRate: 33271144977421,\n terminationEmployeeCommunication: 4411585179661,\n terminationNoticePeriods: 5831900985613,\n};\n"],"mappings":"AAAO,IAAMA,EAAkB,CAC7B,yBAA0B,cAC1B,2BAA4B,cAC5B,cAAe,cACf,qBAAsB,cACtB,aAAc,eACd,iCAAkC,cAClC,yBAA0B,aAC5B","names":["zendeskArticles"]}
|
package/dist/chunk-HHWIJGDR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-SLMJEZJ7.js";import{a as C}from"./chunk-6IL4TB7S.js";import{a as j}from"./chunk-VUP76ZMQ.js";import{a as P}from"./chunk-S4XU4SE7.js";import{a as g}from"./chunk-32GSS4UM.js";import{a as M}from"./chunk-KDUM4EZJ.js";import{a as V}from"./chunk-2YTBWEC7.js";import{a as S}from"./chunk-MP2T74PU.js";import{a as x,b as k}from"./chunk-2M7EBC4K.js";import{a as h}from"./chunk-PJBAQZ6G.js";import{a as F}from"./chunk-Z5WMKCRJ.js";import{c as m}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-43WMZDDH.js";import{a as i}from"./chunk-P37U34EQ.js";import{createHeadlessForm as Z}from"@remoteoss/json-schema-form";import Q from"lodash.omitby";import U from"lodash.isnull";import{format as W}from"date-fns";import{useMemo as b}from"react";import G from"lodash.omit";import{jsx as N,jsxs as K}from"react/jsx-runtime";function c(t,e,f){return{"x-jsf-presentation":{inputType:"hidden",Component:i(()=>K("div",{className:r("RemoteFlows__InformationStatement",f?.className),children:[N("h3",{className:r("RemoteFlows__InformationStatement__Title"),children:t}),N("p",{className:r("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(c,"createInformationField");import{Fragment as Y,jsx as d,jsxs as ee}from"react/jsx-runtime";function X(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}i(X,"buildInitialValues");var ke=i(({employmentId:t,options:e,initialValues:f})=>{let{fieldValues:y,setFieldValues:v,stepState:n,previousStep:$,nextStep:R}=h(P),{data:p}=M({employmentId:t}),_=X({...n.values?.employee_communication,...n.values?.termination_details,...n.values?.paid_time_off,...n.values?.additional_information,...f}),u=b(()=>({...n.values?.[n.currentStep.name],..._,...y}),[n.values,n.currentStep.name,y,_]),D=b(()=>({fields:{risk_assesment_info:c("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:c("Proposed termination date",ee(Y,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",d(S,{zendeskId:g.terminationNoticePeriods,className:r("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:W(new Date,"yyyy-MM-dd")}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:i(()=>{let a=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return d(C,{employeeName:p?.basic_information?.name,proposedTerminationDate:u.proposed_termination_date,employmentId:t,employment:p,render:o=>a?d(a,{...o}):d(w,{...o})})},"Component")}}}}),[e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,u.proposed_termination_date,t,p]),{data:s,isLoading:E}=k({formValues:u,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...D?.fields}},step:n.currentStep.name}),l=Z(j.data.schema),T=x(),{mutateAsync:O}=V(T);async function I(a){if(!t)throw new Error("Employment id is missing");if(s){let o=m(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:B}=o,H=B==="yes"?{employee_awareness:{date:o.customer_informed_employee_date,note:o.customer_informed_employee_description}}:void 0,L=F(o,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),A=G(L,"customer_informed_employee_date","customer_informed_employee_description"),q=Q({...A,...H},U);return O({employment_id:t,termination_details:q,type:"termination"})}}i(I,"onSubmit");function J(){$()}i(J,"back");function z(){R()}return i(z,"next"),{employmentId:t,stepState:n,fields:s?.fields||[],isLoading:E,isSubmitting:T.isPending,initialValues:_,handleValidation:i(a=>{if(s){let o=m(a,s?.fields);return s?.handleValidation(o)}return null},"handleValidation"),checkFieldUpdates:i(a=>{if(l){let o=m(a,l?.fields,{isPartialValidation:!0});v(o)}},"checkFieldUpdates"),parseFormValues:i(a=>m(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:I,back:J,next:z}},"useTermination");export{ke as a};
|
|
2
|
-
//# sourceMappingURL=chunk-HHWIJGDR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmploymentQuery({ employmentId });\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: format(new Date(), 'yyyy-MM-dd'),\n },\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n },\n };\n }, [\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n formValues.proposed_termination_date,\n employmentId,\n employment,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n 'x-jsf-presentation': {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"ujBAAA,OAAmB,sBAAAA,MAA0B,8BAC7C,OAAOC,MAAY,gBACnB,OAAOC,MAAY,gBACnB,OAAS,UAAAC,MAAc,WACvB,OAAS,WAAAC,MAAe,QAWxB,OAAOC,MAAU,cCcT,OAME,OAAAC,EANF,QAAAC,MAAA,oBAXD,SAASC,EACdC,EACAC,EACAC,EAGgB,CAChB,MAAO,CACL,qBAAsB,CACpB,UAAW,SACX,UAAWC,EAAA,IACTL,EAAC,OACC,UAAWM,EACT,oCACAF,GAAS,SACX,EAEA,UAAAL,EAAC,MAAG,UAAWO,EAAG,0CAA0C,EACzD,SAAAJ,EACH,EACAH,EAAC,KAAE,UAAWO,EAAG,gDAAgD,EAC9D,SAAAH,EACH,GACF,EAbS,YAeb,CACF,CACF,CA3BgBE,EAAAJ,EAAA,0BDgFN,mBAAAM,EAKE,OAAAC,EALF,QAAAC,OAAA,oBAtEV,SAASC,EACPC,EACuB,CAsBvB,MArB6C,CAC3C,aAAc,GACd,2BAA4B,GAC5B,gCAAiC,GACjC,uCAAwC,GACxC,eAAgB,GAChB,mBAAoB,OACpB,mBAAoB,GACpB,yBAA0B,CAAC,EAC3B,2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ACzB,CACE,mBAAoB,CAClB,KAAMF,EAAa,gCACnB,KAAMA,EAAa,sCACrB,CACF,EACA,OASAI,EAAoBC,EACxBL,EARqB,CACrB,uBACA,eACA,6BACA,4BACF,CAKA,EAEMM,EAAmBC,EACvBH,EACA,kCACA,wCACF,EAEMI,EAA+CC,EACnD,CACE,GAAGH,EACH,GAAGH,CACL,EACAO,CACF,EAQA,OAAOd,EAN6C,CAClD,cAAejC,EACf,oBAAqB6C,EACrB,KAAM,aACR,CAEqC,CACvC,CAGF,CA9De/C,EAAAqC,EAAA,YAgEf,SAASa,GAAO,CACd1C,EAAa,CACf,CAFSR,EAAAkD,EAAA,QAIT,SAASC,GAAO,CACd1C,EAAS,CACX,CAFS,OAAAT,EAAAmD,EAAA,QAIF,CAIL,aAAAjD,EAIA,UAAAK,EAIA,OAAQoB,GAAyB,QAAU,CAAC,EAI5C,UAAWC,EAIX,aAAcK,EAAkB,UAIhC,cAAenB,EAMf,iBAAkBd,EAACsC,GAAkC,CACnD,GAAIX,EAAyB,CAC3B,IAAMY,EAAeC,EACnBF,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBvC,EAACsC,GAA2C,CAC7D,GAAIR,EAAyB,CAC3B,IAAMS,EAAeC,EACnBF,EACAR,GAAyB,OACzB,CAAE,oBAAqB,EAAK,CAC9B,EACAxB,EAAeiC,CAAqC,CACtD,CACF,EATmB,qBAenB,gBAAiBvC,EAACsC,GACTE,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAHc,mBAUjB,SAAAO,EAMA,KAAAa,EAMA,KAAAC,CACF,CACF,EAjS8B","names":["createHeadlessForm","omitBy","isNull","format","useMemo","omit","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","format","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
|
package/dist/chunk-IUZ7DEXC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-32GSS4UM.js";import{a as l}from"./chunk-HFI2MD3H.js";import{a as m}from"./chunk-MP2T74PU.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(m,{className:"text-sm",zendeskId:y.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
|
|
2
|
-
//# sourceMappingURL=chunk-IUZ7DEXC.js.map
|
package/dist/chunk-MP2T74PU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,b as h,d as C,e as Z,f as v,g as y}from"./chunk-TWIUL2P3.js";import{g}from"./chunk-3O3Q24JL.js";import{b as w,d as f}from"./chunk-3ZWDIEEM.js";import{a as k,f as D}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{useQuery as F}from"@tanstack/react-query";var x=e((r,a)=>{let{client:s}=f();return F({queryKey:["zendesk-article",r],queryFn:e(async()=>{let t=await g({client:s,path:{id:Number(r)}});if(t.error)throw new Error(t.error.message||"Failed to fetch article");return t},"queryFn"),select:e(t=>{let o=t.data?.data.help_center_article;return o&&{...o,body:D(o.body||"")}},"select"),retry:!1,...a})},"useZendeskArticle");import{jsx as n,jsxs as l}from"react/jsx-runtime";var N=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL"),T=e(({Trigger:r,zendeskId:a,open:s,onClose:t})=>{let{components:o}=w(),i=N(a),d=e(()=>{t?.()},"handleClose"),{data:c,isLoading:m,error:p}=x(a,{enabled:s}),u=o?.zendeskDrawer;return u?n(u,{open:s,onClose:d,data:c,isLoading:m,error:p,zendeskURL:i,Trigger:r}):l(b,{open:s,onOpenChange:R=>!R&&d(),direction:"right",children:[n(h,{asChild:!0,children:r}),n(C,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:l("div",{className:"h-full flex flex-col",children:[l(Z,{children:[n(v,{children:c?.title}),l(y,{children:["For more details see our"," ",n("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),m&&n("div",{children:"Loading..."}),p&&n("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),n("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:c?.body||""}})]})})]})},"ZendeskDrawer");import{useState as L}from"react";import{jsx as _}from"react/jsx-runtime";function $({zendeskId:r,className:a,onClick:s,children:t}){let[o,i]=L(!1);return _(T,{zendeskId:r,open:o,onClose:()=>i(!1),Trigger:_("button",{onClick:e(()=>{i(!0),s?.(r)},"handleClick"),className:k("RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",a),children:t})})}e($,"ZendeskTriggerButton");export{$ as a};
|
|
2
|
-
//# sourceMappingURL=chunk-MP2T74PU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/shared/zendesk-drawer/api.ts","../src/components/shared/zendesk-drawer/ZendeskDrawer.tsx","../src/components/shared/zendesk-drawer/ZendeskTriggerButton.tsx"],"sourcesContent":["import { getShowHelpCenterArticle } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { sanitizeHtmlWithImageErrorHandling } from '@/src/lib/utils';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useZendeskArticle = (\n zendeskId: number | null,\n queryOptions?: { enabled?: boolean },\n) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['zendesk-article', zendeskId],\n queryFn: async () => {\n const response = await getShowHelpCenterArticle({\n client: client as Client,\n path: {\n id: Number(zendeskId),\n },\n });\n\n if (response.error) {\n throw new Error(response.error.message || 'Failed to fetch article');\n }\n\n return response;\n },\n select: (data) => {\n const article = data.data?.data.help_center_article;\n if (article) {\n return {\n ...article,\n body: sanitizeHtmlWithImageErrorHandling(article.body || ''),\n };\n }\n return article;\n },\n retry: false,\n ...queryOptions,\n });\n};\n","import { useZendeskArticle } from '@/src/components/shared/zendesk-drawer/api';\nimport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerDescription,\n DrawerHeader,\n DrawerTitle,\n} from '@/src/components/ui/drawer';\nimport { useFormFields } from '@/src/context';\n\nexport type ZendeskDrawerProps = {\n Trigger: React.ReactElement;\n zendeskId: number;\n open: boolean;\n onClose: () => void;\n};\n\nconst buildZendeskURL = (zendeskId: number) => {\n return `https://support.remote.com/hc/en-us/articles/${zendeskId}`;\n};\n\nexport const ZendeskDrawer = ({\n Trigger,\n zendeskId,\n open,\n onClose,\n}: ZendeskDrawerProps) => {\n const { components } = useFormFields();\n const zendeskURL = buildZendeskURL(zendeskId);\n\n const handleClose = () => {\n onClose?.();\n };\n\n const { data, isLoading, error } = useZendeskArticle(zendeskId, {\n enabled: open,\n });\n\n const CustomZendeskDrawer = components?.zendeskDrawer;\n\n if (CustomZendeskDrawer) {\n return (\n <CustomZendeskDrawer\n open={open}\n onClose={handleClose}\n data={data}\n isLoading={isLoading}\n error={error}\n zendeskURL={zendeskURL}\n Trigger={Trigger}\n />\n );\n }\n\n return (\n <Drawer\n open={open}\n onOpenChange={(open) => !open && handleClose()}\n direction='right'\n >\n <DrawerTrigger asChild>{Trigger}</DrawerTrigger>\n <DrawerContent className='h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer'>\n <div className='h-full flex flex-col'>\n <DrawerHeader>\n <DrawerTitle>{data?.title}</DrawerTitle>\n <DrawerDescription>\n For more details see our{' '}\n <a href={zendeskURL} target='_blank' rel='noopener noreferrer'>\n help article\n </a>{' '}\n </DrawerDescription>\n </DrawerHeader>\n {isLoading && <div>Loading...</div>}\n {error && (\n <div className='text-sm p-4 text-red-500'>\n Error loading article\n </div>\n )}\n <div\n className='flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content'\n dangerouslySetInnerHTML={{\n __html: data?.body || '',\n }}\n ></div>\n </div>\n </DrawerContent>\n </Drawer>\n );\n};\n","import { cn } from '@/src/lib/utils';\nimport { ZendeskDrawer } from './ZendeskDrawer';\nimport { useState } from 'react';\n\ninterface ZendeskTriggerButtonProps {\n zendeskId: number;\n className?: string;\n onClick?: (zendeskId: number) => void;\n children?: React.ReactNode;\n}\n\nexport function ZendeskTriggerButton({\n zendeskId,\n className,\n onClick,\n children,\n}: ZendeskTriggerButtonProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n const handleClick = () => {\n setIsOpen(true);\n onClick?.(zendeskId);\n };\n\n return (\n <ZendeskDrawer\n zendeskId={zendeskId}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n Trigger={\n <button\n onClick={handleClick}\n className={cn(\n 'RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0',\n className,\n )}\n >\n {children}\n </button>\n }\n />\n );\n}\n"],"mappings":"oPAIA,OAAS,YAAAA,MAAgB,wBAElB,IAAMC,EAAoBC,EAAA,CAC/BC,EACAC,IACG,CACH,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBJ,CAAS,EACvC,QAASD,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAyB,CAC9C,OAAQJ,EACR,KAAM,CACJ,GAAI,OAAOF,CAAS,CACtB,CACF,CAAC,EAED,GAAIK,EAAS,MACX,MAAM,IAAI,MAAMA,EAAS,MAAM,SAAW,yBAAyB,EAGrE,OAAOA,CACT,EAbS,WAcT,OAAQN,EAACQ,GAAS,CAChB,IAAMC,EAAUD,EAAK,MAAM,KAAK,oBAChC,OAAIC,GACK,CACL,GAAGA,EACH,KAAMC,EAAmCD,EAAQ,MAAQ,EAAE,CAC7D,CAGJ,EATQ,UAUR,MAAO,GACP,GAAGP,CACL,CAAC,CACH,EAlCiC,qBCqC3B,cAAAS,EAuBM,QAAAC,MAvBN,oBAzBN,IAAMC,EAAkBC,EAACC,GAChB,gDAAgDA,CAAS,GAD1C,mBAIXC,EAAgBF,EAAA,CAAC,CAC5B,QAAAG,EACA,UAAAF,EACA,KAAAG,EACA,QAAAC,CACF,IAA0B,CACxB,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/BC,EAAaT,EAAgBE,CAAS,EAEtCQ,EAAcT,EAAA,IAAM,CACxBK,IAAU,CACZ,EAFoB,eAId,CAAE,KAAAK,EAAM,UAAAC,EA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BgBK,EAAAT,EAAA","names":["useQuery","useZendeskArticle","__name","zendeskId","queryOptions","client","useClient","useQuery","response","getShowHelpCenterArticle","data","article","sanitizeHtmlWithImageErrorHandling","jsx","jsxs","buildZendeskURL","__name","zendeskId","ZendeskDrawer","Trigger","open","onClose","components","useFormFields","zendeskURL","handleClose","data","isLoading","error","useZendeskArticle","CustomZendeskDrawer","Drawer","DrawerTrigger","DrawerContent","DrawerHeader","DrawerTitle","DrawerDescription","useState","jsx","ZendeskTriggerButton","zendeskId","className","onClick","children","isOpen","setIsOpen","useState","ZendeskDrawer","__name","cn"]}
|
package/dist/chunk-NVYMAOQ7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as f}from"./chunk-32GSS4UM.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w}from"./chunk-MP2T74PU.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:f.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(w,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(w,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:f.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
|
|
2
|
-
//# sourceMappingURL=chunk-NVYMAOQ7.js.map
|
package/dist/chunk-QKLIYOMA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-32GSS4UM.js";import{a as n}from"./chunk-MP2T74PU.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as m}from"react/jsx-runtime";var r=["You submit your termination request.","We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","We share termination documents with the employee.","The employee signs the termination documents if required.","We process the final salary and offboard the employee."],h=o(()=>m(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. We'll lead communication with them after you submit this form and we finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. We'll ask for the details regarding that communication and take it from there."}),t(n,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:i.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:r.map((a,l)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},l))})]}),"TerminationDialogInfoContent");export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QKLIYOMA.js.map
|
package/dist/chunk-XSHHMBMT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={data:{version:7,schema:{additionalProperties:!1,allOf:[],properties:{acknowledge_termination_procedure:{description:"",title:"I, {{requesterName}} have read and agree to the procedures as defined in the termination form.",type:"boolean","x-jsf-presentation":{direction:"column",inputType:"checkbox"}}},required:["acknowledge_termination_procedure"],type:"object","x-jsf-order":["acknowledge_termination_procedure"]}}};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-XSHHMBMT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/json-schemas/additionalInformation.ts"],"sourcesContent":["export const additionalInformationSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [],\n properties: {\n acknowledge_termination_procedure: {\n description: '',\n title:\n 'I, {{requesterName}} have read and agree to the procedures as defined in the termination form.',\n type: 'boolean',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'checkbox',\n },\n },\n },\n required: ['acknowledge_termination_procedure'],\n type: 'object',\n 'x-jsf-order': ['acknowledge_termination_procedure'],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAA8B,CACzC,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CAAC,EACR,WAAY,CACV,kCAAmC,CACjC,YAAa,GACb,MACE,iGACF,KAAM,UACN,qBAAsB,CACpB,UAAW,SACX,UAAW,UACb,CACF,CACF,EACA,SAAU,CAAC,mCAAmC,EAC9C,KAAM,SACN,cAAe,CAAC,mCAAmC,CACrD,CACF,CACF","names":["additionalInformationSchema"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|