@srimandir/pitru-paksh-common 2.45.0 → 2.46.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,8 +1,6 @@
1
- import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
2
1
  export interface AddAncestorSheetProps {
3
2
  isOpen: boolean;
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;
3
+ onClose: () => void;
6
4
  onSave: (names: string[]) => void;
7
5
  title: string;
8
6
  fieldLabel: string;
@@ -55,14 +55,6 @@ 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;
66
58
  /** Add-on `ServiceOfferCard`s (tarpan, cow service, public service, ...). Omit/empty to hide the section. */
67
59
  addons?: CartViewAddon[];
68
60
  addonsSectionClassName?: string;
@@ -74,8 +66,6 @@ export interface CartViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>
74
66
  addonClassName?: string;
75
67
  /** Optional card implementation for add-ons. Defaults to `ServiceOfferCard`. */
76
68
  addonComponent?: React.ComponentType<ServiceOfferCardProps>;
77
- /** Same as `onItemRef`, for add-on cards. */
78
- onAddonRef?: (id: CartViewAddon['id'], el: HTMLDivElement | null) => void;
79
69
  /** Price breakdown. Omit to hide it. All `BillDetails` props are available. */
80
70
  billDetails?: BillDetailsProps;
81
71
  /** FAQ accordion. Omit to hide it. All `FAQSection` props are available. */
@@ -1,4 +1,3 @@
1
- import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
2
1
  export interface PickedDate {
3
2
  day: number;
4
3
  /** 1-12 */
@@ -7,7 +6,7 @@ export interface PickedDate {
7
6
  }
8
7
  export interface DatePickerSheetProps {
9
8
  isOpen: boolean;
10
- onClose: (reason?: BottomSheetCloseReason) => void;
9
+ onClose: () => void;
11
10
  /** Shows a small circular avatar next to `heading`, e.g. to identify which ancestor's date this is. Omit for a plain heading. */
12
11
  avatarUrl?: string;
13
12
  heading: string;
@@ -18,10 +18,9 @@ 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. `isExpanded`
22
- * is the state it just switched to.
21
+ * fires alongside that toggle — use it for tracking, not for controlling visibility.
23
22
  */
24
- onExpandClick?: (isExpanded: boolean) => void;
23
+ onExpandClick?: () => void;
25
24
  expandButtonAriaLabel?: string;
26
25
  /** Only rendered while expanded (added, or manually expanded via the chevron) */
27
26
  imageUrl?: string;
@@ -1,6 +1,20 @@
1
1
  /** Max length enforced on every free-text name field (Karta, ancestor, Gotra). */
2
2
  export declare const MAX_NAME_LENGTH = 40;
3
+ /** Min length (after trimming) required of a non-empty Karta/ancestor name. */
4
+ export declare const MIN_NAME_LENGTH = 3;
3
5
  /** This form only ever collects an Indian mobile number — there's no country selector. */
4
6
  export declare const INDIA_COUNTRY_CODE = "+91";
5
7
  /** Basic email shape check used for the `isGlobal` email field's error state. */
6
8
  export declare const EMAIL_PATTERN: RegExp;
9
+ /**
10
+ * Letters (any script — this form's names aren't Latin-only, see the `te`/`kn`
11
+ * locales) and spaces only — no digits or punctuation. Used to live-strip a
12
+ * Karta/ancestor name field as it's typed, the same way the WhatsApp field
13
+ * already strips non-digits on every keystroke, rather than accepting bad
14
+ * input and only flagging it after the fact.
15
+ */
16
+ export declare const NAME_DISALLOWED_CHARACTERS_PATTERN: RegExp;
17
+ /** Strips anything `NAME_DISALLOWED_CHARACTERS_PATTERN` matches, e.g. for a Karta/ancestor name's `onChange`. */
18
+ export declare const sanitizeNameInput: (value: string) => string;
19
+ /** A non-empty Karta/ancestor name field is only valid once it clears `MIN_NAME_LENGTH` after trimming. */
20
+ export declare const isNameLongEnough: (value: string) => boolean;
@@ -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, onProceedCtaClick, onConfirmModalOpen, onConfirmEditDetailsClick, onConfirmModalDismiss, 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, 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 —
@@ -7,7 +7,7 @@
7
7
  * `PujaDetailsFormProps` explicitly to override a piece of it for a one-off
8
8
  * usage.
9
9
  */
10
- export type PujaDetailsFormLocale = 'en' | 'hi' | 'te' | 'kn';
10
+ export type PujaDetailsFormLocale = 'en' | 'hi' | 'te' | 'kn' | 'ta';
11
11
  export interface PujaDetailsFormDefaultCopy {
12
12
  topBarTitle: string;
13
13
  backButtonAriaLabel: string;
@@ -23,6 +23,10 @@ export interface PujaDetailsFormDefaultCopy {
23
23
  /** e.g. "(optional)" — appended after `kartaNameLabel` for every Karta name field after the first (which is always required). */
24
24
  kartaNameOptionalSuffix: string;
25
25
  kartaNamePlaceholder: string;
26
+ /** Shown under a Karta/ancestor name field once it's been typed into but is still under `MIN_NAME_LENGTH`, e.g. "Name must be at least 3 characters". */
27
+ nameMinLengthError: string;
28
+ /** Shown under an ancestor name field once it's been left empty (blurred without typing anything), e.g. "Please enter your ancestor's name to proceed". */
29
+ ancestorNameRequiredError: string;
26
30
  gotraFieldLabel: string;
27
31
  gotraFieldPlaceholder: string;
28
32
  gotraUnknownCheckboxLabel: string;
@@ -86,18 +86,5 @@ 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;
102
89
  className?: string;
103
90
  }
@@ -77,13 +77,6 @@ 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;
87
80
  }
88
81
  /**
89
82
  * Add-on card used on "review your booking" screens: an image with a
@@ -1,7 +1,6 @@
1
- import { BottomSheetCloseReason } from '../../../../common/dist/common.js';
2
1
  export interface TithiPickerSheetProps {
3
2
  isOpen: boolean;
4
- onClose: (reason?: BottomSheetCloseReason) => void;
3
+ onClose: () => void;
5
4
  avatarUrl: string;
6
5
  heading: string;
7
6
  tithis: string[];