@srimandir/make-your-own-ritual 0.1.4 → 0.1.6

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.
Files changed (30) hide show
  1. package/dist/components/DeathTithi/DeathTithi.d.ts +14 -0
  2. package/dist/components/DeathTithi/index.d.ts +2 -0
  3. package/dist/components/LandingPage/LandingPage.d.ts +7 -74
  4. package/dist/components/LandingPage/index.d.ts +1 -1
  5. package/dist/components/MakeYourOwnRitualPage/MakeYourOwnRitualPage.d.ts +8 -0
  6. package/dist/components/MakeYourOwnRitualPage/index.d.ts +2 -0
  7. package/dist/components/PujaProgressTabs/PujaProgressTabs.d.ts +14 -0
  8. package/dist/components/PujaProgressTabs/index.d.ts +2 -0
  9. package/dist/components/SelectAncestors/SelectAncestors.d.ts +18 -0
  10. package/dist/components/SelectAncestors/index.d.ts +2 -0
  11. package/dist/components/SelectRitualDaySheet/SelectRitualDaySheet.d.ts +11 -0
  12. package/dist/components/SelectRitualDaySheet/index.d.ts +2 -0
  13. package/dist/constants/index.d.ts +1 -2
  14. package/dist/constants/pujaSteps.constants.d.ts +3 -0
  15. package/dist/i18n/index.d.ts +8 -2
  16. package/dist/i18n/translations.en.d.ts +92 -0
  17. package/dist/index.d.ts +10 -5
  18. package/dist/make-your-own-ritual.js +1318 -697
  19. package/dist/make-your-own-ritual.js.map +1 -0
  20. package/dist/style.css +1 -1
  21. package/dist/types/index.d.ts +3 -0
  22. package/dist/types/landingPage.types.d.ts +13 -0
  23. package/dist/types/makeYourOwnRitual.types.d.ts +104 -0
  24. package/dist/types/pitruPakshStore.types.d.ts +53 -0
  25. package/dist/utils/index.d.ts +1 -0
  26. package/dist/utils/price.utils.d.ts +1 -0
  27. package/package.json +13 -14
  28. package/dist/constants/rituals.d.ts +0 -11
  29. package/dist/i18n/I18nContext.d.ts +0 -11
  30. package/dist/make-your-own-ritual.umd.cjs +0 -14
@@ -0,0 +1,14 @@
1
+ import { MakeYourOwnRitualDataState, RitualDataAction, TithiPreview, TithiValidity } from '../../types';
2
+ export interface DeathTithiProps {
3
+ store: MakeYourOwnRitualDataState;
4
+ mutate: (action: RitualDataAction) => void;
5
+ avatarUrl: string;
6
+ audioSrc?: string;
7
+ onBackClick?: () => void;
8
+ onProceed?: () => void;
9
+ /** Resolves the tithi a picked death date falls on. Persisted via SET_TITHI_PREVIEW; not rendered by this component. */
10
+ onResolveTithiForDate?: (date: string, ancestorKey: string) => Promise<TithiPreview | undefined>;
11
+ /** Checks whether a directly-picked tithi is still bookable. Never rejects — a failure resolves to undefined. */
12
+ onValidateTithi?: (tithiKey: string, ancestorKey: string) => Promise<TithiValidity | undefined>;
13
+ }
14
+ export declare function DeathTithi({ store, mutate, avatarUrl, audioSrc, onBackClick, onProceed, onResolveTithiForDate, onValidateTithi, }: DeathTithiProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DeathTithi } from './DeathTithi';
2
+ export type { DeathTithiProps } from './DeathTithi';
@@ -1,76 +1,9 @@
1
- export interface RitualInput {
2
- id: string;
3
- imageUrl: string;
4
- imageAlt?: string;
5
- title: string;
6
- description: string;
7
- /** e.g. "Koti Tirtha (Gokarna)" */
8
- locationLabel?: string;
9
- /** e.g. "4.9 ★ Pooja Rating" */
10
- ratingLabel?: string;
11
- /** e.g. "Booked by 2k devotees" */
12
- bookedLabel?: string;
13
- /** Already-formatted display price, e.g. "₹200" — summed for the running total shown in the proceed bar. */
14
- price: string;
15
- }
1
+ import { SupportedLocale } from '../../i18n';
2
+ import { LandingPageStore, LandingPageAction } from '../../types';
16
3
  export interface LandingPageProps {
17
- /** Ritual catalog to render — pass the host app's real data. Defaults to this package's own sample content. */
18
- rituals?: RitualInput[];
19
- /** Ritual ids selected on first render, e.g. when resuming a previous session. Defaults to none selected. */
20
- initialSelectedRitualIds?: string[];
21
- /** Campaign badge, e.g. "Pitru Paksh Special". */
22
- badgeLabel?: string;
23
- /** e.g. "27 September - 12 October, 2026". */
24
- dateRangeLabel?: string;
25
- headline?: string;
26
- /** Width of the decorative header mandala, in px or any CSS size. Defaults to 225. */
27
- mandalaWidth?: number | string;
28
- /** Offset of the decorative header mandala from the header's top edge. Defaults to -149. */
29
- mandalaTop?: number | string;
30
- /** Set to false to hide the decorative header mandala entirely. */
31
- showMandala?: boolean;
32
- /** Set to false to hide the note shown below the header, above the ritual list. */
33
- showRitualNote?: boolean;
34
- /** e.g. "You can choose more than one ritual." */
35
- chooseMultipleNote?: string;
36
- /** e.g. "You will choose the ancestors and the tithi in the next step." — shown next to an info icon. */
37
- nextStepInfoNote?: string;
38
- /** Text classes for every card's title. Defaults to `text-base font-bold text-[#374151]`. */
39
- ritualTitleClassName?: string;
40
- /** Text classes for every card's description. Defaults to `text-xs font-medium text-[#6b7280] opacity-90`. */
41
- ritualDescriptionClassName?: string;
42
- /** Background classes for every card's rating/booked strip. Defaults to `bg-[#f3f5e9]`. */
43
- ritualTagClassName?: string;
44
- /** Text classes for every card's rating/booked strip. Defaults to `text-[#4b5513]`. */
45
- ritualTagTextClassName?: string;
46
- /** Shared label on every card's price row, e.g. "Starts from". */
47
- priceLabel?: string;
48
- /** Shared link label on every card, e.g. "About Puja". */
49
- aboutLinkLabel?: string;
50
- /** aria-label for every card's select toggle. */
51
- selectAriaLabel?: string;
52
- /** e.g. "Ritual" — used when exactly one ritual is selected. */
53
- ritualCountSingular?: string;
54
- /** e.g. "Rituals" — used when more than one ritual is selected. */
55
- ritualCountPlural?: string;
56
- /** Proceed CTA label, e.g. "Continue". */
57
- proceedLabel?: string;
58
- /** Set to false to hide the info icon next to the total in the proceed bar. */
59
- showPriceInfoIcon?: boolean;
60
- /** Called when the info icon next to the total is clicked, e.g. to open a bill breakdown. */
61
- onPriceInfoClick?: () => void;
62
- onProceed?: (selectedRitualIds: string[]) => void;
63
- onAboutRitualClick?: (ritualId: string) => void;
64
- className?: string;
4
+ store: LandingPageStore;
5
+ mutate: (action: LandingPageAction) => void;
6
+ onProceed: (selectedRitualIds: string[]) => void;
7
+ onLocaleChange: (locale: SupportedLocale) => void;
65
8
  }
66
- /**
67
- * Master landing page for the "Make Your Own Ritual" mweb flow: the Pitru
68
- * Paksha event header, a list of selectable ritual cards, and a sticky
69
- * proceed bar at the bottom.
70
- *
71
- * Fully controllable for host-app use (e.g. hanuman): pass `rituals` with
72
- * real catalog data and override any copy prop with real content. Every prop
73
- * is optional and falls back to this package's own sample content, so it
74
- * also works standalone out of the box.
75
- */
76
- export declare function LandingPage({ rituals, initialSelectedRitualIds, badgeLabel, dateRangeLabel, headline, mandalaWidth, mandalaTop, showMandala, showRitualNote, chooseMultipleNote, nextStepInfoNote, ritualTitleClassName, ritualDescriptionClassName, ritualTagClassName, ritualTagTextClassName, priceLabel, aboutLinkLabel, selectAriaLabel, ritualCountSingular, ritualCountPlural, proceedLabel, showPriceInfoIcon, onPriceInfoClick, onProceed, onAboutRitualClick, className, }: LandingPageProps): import("react").JSX.Element;
9
+ export declare function LandingPage({ store, mutate, onProceed, onLocaleChange, }: LandingPageProps): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export { LandingPage } from './LandingPage';
2
- export type { LandingPageProps, RitualInput } from './LandingPage';
2
+ export type { LandingPageProps } from './LandingPage';
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface MakeYourOwnRitualPageProps {
3
+ /** Fired when the user taps the CTA. Host app decides what happens next. */
4
+ onCtaClick?: () => void;
5
+ ctaLabel?: string;
6
+ className?: string;
7
+ }
8
+ export declare const MakeYourOwnRitualPage: React.FC<MakeYourOwnRitualPageProps>;
@@ -0,0 +1,2 @@
1
+ export { MakeYourOwnRitualPage } from './MakeYourOwnRitualPage';
2
+ export type { MakeYourOwnRitualPageProps } from './MakeYourOwnRitualPage';
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ export type PujaTabStatus = 'completed' | 'active' | 'pending';
3
+ export interface PujaTabItem {
4
+ id: string;
5
+ label: string;
6
+ status: PujaTabStatus;
7
+ }
8
+ export interface PujaProgressTabsProps {
9
+ items: PujaTabItem[];
10
+ /** Called when a `completed` or `active` tab is clicked. `pending` tabs are never clickable. */
11
+ onTabClick?: (id: string) => void;
12
+ className?: string;
13
+ }
14
+ export declare const PujaProgressTabs: React.FC<PujaProgressTabsProps>;
@@ -0,0 +1,2 @@
1
+ export { PujaProgressTabs } from './PujaProgressTabs';
2
+ export type { PujaProgressTabsProps, PujaTabItem, PujaTabStatus } from './PujaProgressTabs';
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { MakeYourOwnRitualDataState, RitualDataAction } from '../../types';
3
+ import { RitualDayOption } from '../SelectRitualDaySheet';
4
+ export interface SelectAncestorsProps {
5
+ store: MakeYourOwnRitualDataState;
6
+ mutate: (action: RitualDataAction) => void;
7
+ avatarUrl: string;
8
+ audioSrc?: string;
9
+ /** Fires only when going back from the first puja step (Pitru Shanti). */
10
+ onBackClick?: () => void;
11
+ /**
12
+ * Fires once the ritual-day choice is confirmed. `'amavasya'` needs no
13
+ * death-tithi step — only `'death-anniversary'` does; branch on it to
14
+ * decide whether to show `DeathTithi` next.
15
+ */
16
+ onProceed?: (ritualDay: RitualDayOption) => void;
17
+ }
18
+ export declare const SelectAncestors: React.FC<SelectAncestorsProps>;
@@ -0,0 +1,2 @@
1
+ export { SelectAncestors } from './SelectAncestors';
2
+ export type { SelectAncestorsProps } from './SelectAncestors';
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export type RitualDayOption = 'amavasya' | 'death-anniversary';
3
+ export interface SelectRitualDaySheetProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ /** Fires with the option active when the CTA is pressed — 'amavasya' needs no death-tithi step; only 'death-anniversary' does. */
7
+ onCtaClick: (option: RitualDayOption) => void;
8
+ /** True when every ancestor's tithi is unknown (all pujas selected "All Ancestors") — Amavasya is then the only sensible day, so skip the choice. Otherwise both options are offered. */
9
+ amavasyaOnly: boolean;
10
+ }
11
+ export declare const SelectRitualDaySheet: React.FC<SelectRitualDaySheetProps>;
@@ -0,0 +1,2 @@
1
+ export { SelectRitualDaySheet } from './SelectRitualDaySheet';
2
+ export type { SelectRitualDaySheetProps, RitualDayOption } from './SelectRitualDaySheet';
@@ -1,2 +1 @@
1
- export { RITUAL_OPTIONS } from './rituals';
2
- export type { RitualData } from './rituals';
1
+ export { buildPujaTabs } from './pujaSteps.constants';
@@ -0,0 +1,3 @@
1
+ import { SelectedItem, PujaId } from '../types';
2
+ import { PujaTabItem } from '../components/PujaProgressTabs';
3
+ export declare function buildPujaTabs(selectedRitual: SelectedItem[], currentPujaId: PujaId): PujaTabItem[];
@@ -1,4 +1,10 @@
1
- export { I18nProvider, useI18n } from './I18nContext';
2
- export type { I18nContextValue } from './I18nContext';
1
+ import { FC, ReactNode } from 'react';
2
+ import { I18nContextValue } from '../../../common/dist/common.js';
3
+ import { SupportedLocale } from './translations';
4
+ export declare const I18nProvider: FC<{
5
+ locale: SupportedLocale;
6
+ children: ReactNode;
7
+ }>;
8
+ export declare function useI18n(): I18nContextValue<SupportedLocale> | null;
3
9
  export { translations, SUPPORTED_LOCALES, LOCALE_LABELS } from './translations';
4
10
  export type { SupportedLocale } from './translations';
@@ -22,4 +22,96 @@ export declare const en: {
22
22
  ritualCountSingular: string;
23
23
  ritualCountPlural: string;
24
24
  ctaProceed: string;
25
+ makeYourOwnRitualCtaLabel: string;
26
+ makeYourOwnRitualHeroTitle: string;
27
+ makeYourOwnRitualHeroSubtitle: string;
28
+ makeYourOwnRitualIntroTitle: string;
29
+ makeYourOwnRitualIntroBody: string;
30
+ makeYourOwnRitualChoicesTitle: string;
31
+ makeYourOwnRitualChoiceDeity: string;
32
+ makeYourOwnRitualChoiceTemple: string;
33
+ makeYourOwnRitualChoiceSankalp: string;
34
+ makeYourOwnRitualChoiceOfferings: string;
35
+ makeYourOwnRitualStepsTitle: string;
36
+ makeYourOwnRitualStep1Title: string;
37
+ makeYourOwnRitualStep1Text: string;
38
+ makeYourOwnRitualStep2Title: string;
39
+ makeYourOwnRitualStep2Text: string;
40
+ makeYourOwnRitualStep3Title: string;
41
+ makeYourOwnRitualStep3Text: string;
42
+ selectAncestorsBackAriaLabel: string;
43
+ selectAncestorsProgressLabel: string;
44
+ selectAncestorsQuestion: string;
45
+ selectAncestorsCardHeadingPrefix: string;
46
+ selectAncestorsAllAncestorsCaption: string;
47
+ selectAncestorsCtaNextRitual: string;
48
+ selectAncestorsCtaProceed: string;
49
+ selectAncestorsAddMoreLabel: string;
50
+ selectAncestorsAndAddMoreLabel: string;
51
+ selectAncestorsOptionAll: string;
52
+ selectAncestorsOptionMother: string;
53
+ selectAncestorsOptionFather: string;
54
+ selectAncestorsOptionWife: string;
55
+ selectAncestorsOptionHusband: string;
56
+ selectAncestorsOptionGrandfatherPaternal: string;
57
+ selectAncestorsOptionGrandmotherPaternal: string;
58
+ selectAncestorsOptionGrandfatherMaternal: string;
59
+ selectAncestorsOptionGrandmotherMaternal: string;
60
+ selectAncestorsOptionGreatGrandfatherPaternal: string;
61
+ selectAncestorsOptionGreatGrandmotherPaternal: string;
62
+ selectAncestorsOptionGreatGrandfatherMaternal: string;
63
+ selectAncestorsOptionGreatGrandmotherMaternal: string;
64
+ deathTithiProgressLabel: string;
65
+ deathTithiQuestionPrefix: string;
66
+ deathTithiQuestionHighlight: string;
67
+ deathTithiQuestionSuffix: string;
68
+ deathTithiSubtextPrefix: string;
69
+ deathTithiSubtextHighlight: string;
70
+ deathTithiOption1Title: string;
71
+ deathTithiOption1Subtext: string;
72
+ deathTithiOption2Title: string;
73
+ deathTithiOption2Subtext: string;
74
+ deathTithiOption3Title: string;
75
+ deathTithiOption3Subtext: string;
76
+ deathTithiOption3ExpandedTitle: string;
77
+ deathTithiOption3ExpandedBody: string;
78
+ deathTithiCtaLabel: string;
79
+ deathTithiFinalCtaLabel: string;
80
+ deathTithiPickerHeadingSuffix: string;
81
+ deathTithiPickerConfirmCta: string;
82
+ deathDatePickerConfirmCta: string;
83
+ deathDatePickerTimezoneLabel: string;
84
+ tithiNamePratipada: string;
85
+ tithiNameDvitiya: string;
86
+ tithiNameTritiya: string;
87
+ tithiNameChaturthi: string;
88
+ tithiNamePanchami: string;
89
+ tithiNameShashthi: string;
90
+ tithiNameSaptami: string;
91
+ tithiNameAshtami: string;
92
+ tithiNameNavami: string;
93
+ tithiNameDashami: string;
94
+ tithiNameEkadashi: string;
95
+ tithiNameDvadashi: string;
96
+ tithiNameTrayodashi: string;
97
+ tithiNameChaturdashi: string;
98
+ tithiNameAmavasya: string;
99
+ amavasyaFallbackTithiPassedHeader: string;
100
+ amavasyaFallbackCardTitle: string;
101
+ amavasyaFallbackCardBadge: string;
102
+ amavasyaFallbackCardBodyDatePassed: string;
103
+ amavasyaFallbackCta: string;
104
+ addAncestorModalTitle: string;
105
+ addAncestorModalFieldLabel: string;
106
+ addAncestorModalNamePrefix: string;
107
+ addAncestorModalNamePlaceholder: string;
108
+ addAncestorModalAddMore: string;
109
+ addAncestorModalSaveCta: string;
110
+ selectRitualDaySheetHeading: string;
111
+ selectRitualDaySheetCardTitle: string;
112
+ selectRitualDaySheetCardDescription: string;
113
+ selectRitualDaySheetTag: string;
114
+ selectRitualDaySheetDeathAnniversaryTitle: string;
115
+ selectRitualDaySheetDeathAnniversaryDescription: string;
116
+ selectRitualDaySheetCta: string;
25
117
  };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  export { I18nProvider, useI18n } from './i18n';
2
2
  export type { SupportedLocale } from './i18n';
3
+ export { SelectAncestors } from './components/SelectAncestors';
4
+ export type { SelectAncestorsProps } from './components/SelectAncestors';
5
+ export type { RitualDayOption } from './components/SelectRitualDaySheet';
6
+ export { DeathTithi } from './components/DeathTithi';
7
+ export type { DeathTithiProps } from './components/DeathTithi';
8
+ export { ALL_ANCESTORS_ID, ANCESTOR_OPTIONS } from '../../pitru-paksh-common/dist/pitru-paksh-common.js';
9
+ export type { RitualDataAction, PhoneNumberData, PujaId, SelectedItem, AncestorSelection, TithiPreview, TithiValidity, DeathTithiSelection, MakeYourOwnRitualDataState, SetSelectedRitualsAction, LandingPageAction, LandingPageStore, PitruPakshStoreTemple, PitruPakshStoreAddOn, PitruPakshOrderedRitual, PitruPakshStoreData, PitruPakshRenderableRitual, } from './types';
10
+ export { MakeYourOwnRitualPage } from './components/MakeYourOwnRitualPage';
11
+ export type { MakeYourOwnRitualPageProps } from './components/MakeYourOwnRitualPage';
3
12
  export { LandingPage } from './components/LandingPage';
4
- export type { LandingPageProps, RitualInput } from './components/LandingPage';
5
- export { RitualCard } from './components/RitualCard';
6
- export type { RitualCardProps } from './components/RitualCard';
7
- export { RITUAL_OPTIONS } from './constants';
8
- export type { RitualData } from './constants';
13
+ export type { LandingPageProps } from './components/LandingPage';