@srimandir/dosha-calculator 2.4.25 → 2.4.27
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/components/DoshaLandingPage/DoshaLandingPage.d.ts +34 -0
- package/dist/components/DoshaLandingPage/LandingFormSection.d.ts +36 -0
- package/dist/components/KundliProcessingLoader/KundliProcessingLoader.d.ts +7 -0
- package/dist/components/QuestionnaireFlow/QuestionStepConstant.d.ts +7 -0
- package/dist/components/QuestionnaireFlow/QuestionnaireFlow.d.ts +13 -0
- package/dist/components/QuestionnaireFlow/stepHandler.d.ts +5 -0
- package/dist/dosha-calculator.js +13161 -10470
- package/dist/dosha-calculator.js.map +1 -1
- package/dist/dosha-calculator.umd.cjs +37 -36
- package/dist/dosha-calculator.umd.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/style.css +1 -1
- package/dist/types/dosha-api.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DoshaAnalytics } from '../../analytics';
|
|
2
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
+
import { DoshaCalculationResult, ResolvedPlace, BirthDetails } from '../../types/dosha-api';
|
|
4
|
+
import { DoshaImageComponent } from '../../types/image';
|
|
5
|
+
export interface DoshaLandingPageProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
logoUrl?: string;
|
|
8
|
+
languageSelector?: React.ReactNode;
|
|
9
|
+
showLanguageSelector?: boolean;
|
|
10
|
+
isGlobal?: boolean;
|
|
11
|
+
readMoreReviewsHref?: string;
|
|
12
|
+
supabaseUrl?: string;
|
|
13
|
+
supabaseAnonKey?: string;
|
|
14
|
+
googleMapsApiKey?: string;
|
|
15
|
+
supabase?: SupabaseClient | null;
|
|
16
|
+
resolvePlace?: (place: string) => Promise<ResolvedPlace | null>;
|
|
17
|
+
onResult?: (result: DoshaCalculationResult, birthDetails?: BirthDetails) => void;
|
|
18
|
+
onError?: (error: string) => void;
|
|
19
|
+
renderPujaCard?: (doshaType: string) => React.ReactNode;
|
|
20
|
+
isLoadingPujas?: boolean;
|
|
21
|
+
renderKundali?: () => React.ReactNode;
|
|
22
|
+
kundaliSectionId?: string;
|
|
23
|
+
analytics?: DoshaAnalytics;
|
|
24
|
+
getFirstPujaInfo?: (doshaType: string) => {
|
|
25
|
+
name: string;
|
|
26
|
+
price: number;
|
|
27
|
+
link?: string;
|
|
28
|
+
} | null;
|
|
29
|
+
onBookPujaClick?: () => void;
|
|
30
|
+
imageComponent?: DoshaImageComponent;
|
|
31
|
+
/** Whether to show the questionnaire flow after form submission (defaults to true) */
|
|
32
|
+
isShowQuestionnaire?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function DoshaLandingPage({ className, logoUrl, languageSelector, showLanguageSelector, isGlobal, readMoreReviewsHref, supabaseUrl, supabaseAnonKey, googleMapsApiKey, supabase: supabaseProp, resolvePlace: resolvePlaceProp, onResult, onError, renderPujaCard, isLoadingPujas, renderKundali, kundaliSectionId, analytics, getFirstPujaInfo, onBookPujaClick, imageComponent, isShowQuestionnaire, }: DoshaLandingPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DoshaAnalytics } from '../../analytics';
|
|
2
|
+
import { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
+
import { ResolvedPlace, DoshaCalculationResult, BirthDetails } from '../../types/dosha-api';
|
|
4
|
+
export interface LandingFormValues {
|
|
5
|
+
name: string;
|
|
6
|
+
gender: 'male' | 'female' | '';
|
|
7
|
+
dateOfBirth: string;
|
|
8
|
+
birthTime: string;
|
|
9
|
+
birthTimeUnknown: boolean;
|
|
10
|
+
birthPlace: string;
|
|
11
|
+
problems: string[];
|
|
12
|
+
otherProblemText?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LandingFormSectionProps {
|
|
15
|
+
t: (key: string) => string;
|
|
16
|
+
className?: string;
|
|
17
|
+
initialValues?: Partial<LandingFormValues>;
|
|
18
|
+
questionnaireAnswers?: string[];
|
|
19
|
+
onValuesChange?: (values: LandingFormValues) => void;
|
|
20
|
+
onFormValidityChange?: (isValid: boolean) => void;
|
|
21
|
+
supabase?: SupabaseClient | null;
|
|
22
|
+
resolvePlace?: (place: string) => Promise<ResolvedPlace | null>;
|
|
23
|
+
googleMapsApiKey?: string;
|
|
24
|
+
onResult?: (result: DoshaCalculationResult, birthDetails?: BirthDetails) => void;
|
|
25
|
+
onError?: (error: string) => void;
|
|
26
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
27
|
+
analytics?: DoshaAnalytics;
|
|
28
|
+
/** Whether the questionnaire flow is shown (used to hide problem area if true) */
|
|
29
|
+
isShowQuestionnaire?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface LandingFormSectionRef {
|
|
32
|
+
submit: (overrides?: {
|
|
33
|
+
questionnaireAnswers?: string[];
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export declare const LandingFormSection: import('react').ForwardRefExoticComponent<LandingFormSectionProps & import('react').RefAttributes<LandingFormSectionRef>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface KundliProcessingLoaderProps {
|
|
2
|
+
/** Translation function */
|
|
3
|
+
t: (key: string) => string;
|
|
4
|
+
/** Called when progress reaches 100% */
|
|
5
|
+
onComplete: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function KundliProcessingLoader({ t, onComplete }: KundliProcessingLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface QuestionnaireFlowProps {
|
|
2
|
+
/** Translation function */
|
|
3
|
+
t: (key: string) => string;
|
|
4
|
+
/** Called when all steps are completed, with the answers record */
|
|
5
|
+
onComplete: (answers: Record<number, string>) => void;
|
|
6
|
+
/** Called when user presses back on step 1 (dismiss questionnaire) */
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
/** Previously selected answers to pre-fill */
|
|
9
|
+
initialAnswers?: Record<number, string>;
|
|
10
|
+
/** The step to start at (0-indexed) */
|
|
11
|
+
initialStep?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function QuestionnaireFlow({ t, onComplete, onBack, initialAnswers, initialStep, }: QuestionnaireFlowProps): import("react/jsx-runtime").JSX.Element;
|