@srimandir/pitru-paksh-common 2.47.0 → 2.48.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.
@@ -1,6 +1,8 @@
1
+ import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
1
2
  export interface AddAncestorSheetProps {
2
3
  isOpen: boolean;
3
- onClose: () => void;
4
+ /** Not called on Save — only on an actual dismiss (close button, backdrop, Escape). Saving is `onSave`'s job to close, so callers can tell the two apart. */
5
+ onClose: (reason?: BottomSheetCloseReason) => void;
4
6
  onSave: (names: string[]) => void;
5
7
  title: string;
6
8
  fieldLabel: string;
@@ -55,6 +55,14 @@ export interface CartViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>
55
55
  itemsClassName?: string;
56
56
  /** className applied to every item; per-item `className` (via the item object) wins/merges on top. */
57
57
  itemClassName?: string;
58
+ /**
59
+ * Reports each rendered item row's DOM node as it mounts/unmounts, keyed
60
+ * by the item's own `id`. No visibility tracking happens here — this
61
+ * component stays dumb; observing these nodes (e.g. via
62
+ * `IntersectionObserver`) is the caller's job, same division as
63
+ * `Outcome`'s own `onCardRef`.
64
+ */
65
+ onItemRef?: (id: CartViewItem['id'], el: HTMLDivElement | null) => void;
58
66
  /** Add-on `ServiceOfferCard`s (tarpan, cow service, public service, ...). Omit/empty to hide the section. */
59
67
  addons?: CartViewAddon[];
60
68
  addonsSectionClassName?: string;
@@ -66,6 +74,8 @@ export interface CartViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>
66
74
  addonClassName?: string;
67
75
  /** Optional card implementation for add-ons. Defaults to `ServiceOfferCard`. */
68
76
  addonComponent?: React.ComponentType<ServiceOfferCardProps>;
77
+ /** Same as `onItemRef`, for add-on cards. */
78
+ onAddonRef?: (id: CartViewAddon['id'], el: HTMLDivElement | null) => void;
69
79
  /** Price breakdown. Omit to hide it. All `BillDetails` props are available. */
70
80
  billDetails?: BillDetailsProps;
71
81
  /** FAQ accordion. Omit to hide it. All `FAQSection` props are available. */
@@ -1,3 +1,4 @@
1
+ import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
1
2
  export interface PickedDate {
2
3
  day: number;
3
4
  /** 1-12 */
@@ -6,7 +7,7 @@ export interface PickedDate {
6
7
  }
7
8
  export interface DatePickerSheetProps {
8
9
  isOpen: boolean;
9
- onClose: () => void;
10
+ onClose: (reason?: BottomSheetCloseReason) => void;
10
11
  /** Shows a small circular avatar next to `heading`, e.g. to identify which ancestor's date this is. Omit for a plain heading. */
11
12
  avatarUrl?: string;
12
13
  heading: string;
@@ -18,9 +18,10 @@ export interface L2CardProps {
18
18
  /**
19
19
  * Chevron icon in the header, shown only while `isAdded` is false. Clicking it toggles the card's
20
20
  * own expanded/collapsed display so a not-yet-added ritual can still be previewed. This callback
21
- * fires alongside that toggle — use it for tracking, not for controlling visibility.
21
+ * fires alongside that toggle — use it for tracking, not for controlling visibility. `isExpanded`
22
+ * is the state it just switched to.
22
23
  */
23
- onExpandClick?: () => void;
24
+ onExpandClick?: (isExpanded: boolean) => void;
24
25
  expandButtonAriaLabel?: string;
25
26
  /** Only rendered while expanded (added, or manually expanded via the chevron) */
26
27
  imageUrl?: string;
@@ -13,7 +13,7 @@ import { AncestorNameEntry, PujaDetailsFormProps, PujaDetailsFormValues } from '
13
13
  * always the fixed, translated copy (not overridable) since this form only
14
14
  * ever collects an Indian mobile number or an email.
15
15
  */
16
- export declare function PujaDetailsForm({ locale, values, onValuesChange, isGlobal, gotraOptions, isSarvaPitru, onBackClick, amount, ritualsCountLabel, onPriceInfoClick, showPriceInfoIcon, canProceed, copy: copyOverride, proceedCtaLabel, proceedButtonProps, onProceedPayment, className, }: PujaDetailsFormProps): import("react").JSX.Element;
16
+ export declare function PujaDetailsForm({ locale, values, onValuesChange, isGlobal, gotraOptions, isSarvaPitru, onBackClick, amount, ritualsCountLabel, onPriceInfoClick, showPriceInfoIcon, canProceed, copy: copyOverride, proceedCtaLabel, proceedButtonProps, onProceedPayment, onProceedCtaClick, onConfirmModalOpen, onConfirmEditDetailsClick, onConfirmModalDismiss, className, }: PujaDetailsFormProps): import("react").JSX.Element;
17
17
  /**
18
18
  * Convenience factory for a blank `PujaDetailsFormValues`, e.g. to seed local
19
19
  * component state. `kartaCount` sets how many Karta name fields render —
@@ -86,5 +86,18 @@ export interface PujaDetailsFormProps {
86
86
  * payment flow here.
87
87
  */
88
88
  onProceedPayment: () => void;
89
+ /**
90
+ * Fired when the sticky `CheckoutBar`'s own CTA is tapped — the same tap
91
+ * that opens `ConfirmPujaDetailsModal`, but a distinct moment from
92
+ * `onProceedPayment` (that one only fires later, off the modal's own Pay
93
+ * button).
94
+ */
95
+ onProceedCtaClick?: () => void;
96
+ /** The `ConfirmPujaDetailsModal` opened — the checkout bar's CTA was tapped. */
97
+ onConfirmModalOpen?: () => void;
98
+ /** The `ConfirmPujaDetailsModal`'s "Edit Details" was clicked (returns to this form). */
99
+ onConfirmEditDetailsClick?: () => void;
100
+ /** The `ConfirmPujaDetailsModal` closed via backdrop/X/Escape — not its own Edit Details or Pay. */
101
+ onConfirmModalDismiss?: () => void;
89
102
  className?: string;
90
103
  }
@@ -77,6 +77,13 @@ export interface ServiceOfferCardProps extends Omit<React.HTMLAttributes<HTMLDiv
77
77
  sheetSavedLabel?: React.ReactNode;
78
78
  /** Accessible name for the sheet dialog. */
79
79
  sheetAriaLabel?: string;
80
+ /**
81
+ * Fired when the inline "Read more"/"Read less" toggle is tapped —
82
+ * `isExpanded` is the state it just switched to. Also fires (as `true`) when
83
+ * the toggle instead opens the `ServiceOfferSheet` (`sheetPrice` set), since
84
+ * that's this card's only "read more" affordance in that case.
85
+ */
86
+ onReadMoreClick?: (isExpanded: boolean) => void;
80
87
  }
81
88
  /**
82
89
  * Add-on card used on "review your booking" screens: an image with a
@@ -1,6 +1,7 @@
1
+ import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
1
2
  export interface TithiPickerSheetProps {
2
3
  isOpen: boolean;
3
- onClose: () => void;
4
+ onClose: (reason?: BottomSheetCloseReason) => void;
4
5
  avatarUrl: string;
5
6
  heading: string;
6
7
  tithis: string[];
@@ -10,6 +10,15 @@ export interface VideoPlayerProps {
10
10
  /** Enforced on both the outer container and the video/poster itself. */
11
11
  width?: string | number;
12
12
  height?: string | number;
13
+ /**
14
+ * Locks the container to this CSS `aspect-ratio` (e.g. `"16/9"`) instead of
15
+ * a fixed pixel `height` — height then scales with whatever width the
16
+ * container ends up at (its own `className`/parent, not a `width` prop),
17
+ * so the full frame stays visible with no cropping on any device, and the
18
+ * box's space is reserved immediately rather than jumping once the video's
19
+ * metadata loads. Ignored when `width`/`height` are set.
20
+ */
21
+ aspectRatio?: string;
13
22
  /**
14
23
  * Crops the video/poster to cover its container instead of sizing off its
15
24
  * own intrinsic aspect ratio, centered on both axes — for callers that size