@srimandir/pitru-paksh-common 2.10.0 → 2.11.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.
@@ -8,4 +8,4 @@ import { ConfirmPujaDetailsModalProps } from './ConfirmPujaDetailsModal.types';
8
8
  *
9
9
  * All labels default to locale-specific copy (`locale`, `'en'`/`'hi'`/`'te'`).
10
10
  */
11
- export declare function ConfirmPujaDetailsModal({ isOpen, onClose, locale, ancestors, kartaNames, gotra, whatsappNumber, amount, onEditDetailsClick, onProceedPayment, className, }: ConfirmPujaDetailsModalProps): import("react").JSX.Element;
11
+ export declare function ConfirmPujaDetailsModal({ isOpen, onClose, locale, ancestors, kartaNames, gotra, whatsappNumber, amount, onEditDetailsClick, onProceedPayment, className, isGlobal }: ConfirmPujaDetailsModalProps): import("react").JSX.Element;
@@ -16,6 +16,7 @@ export interface ConfirmPujaDetailsModalDefaultCopy {
16
16
  editDetailsLabel: string;
17
17
  /** e.g. "Pay {amount}" — `{amount}` is replaced with the `amount` prop (already formatted, e.g. "₹1648/-"). Word order varies by locale. */
18
18
  payButtonTemplate: string;
19
+ emailLabel: string;
19
20
  }
20
21
  export declare const CONFIRM_PUJA_DETAILS_MODAL_DEFAULT_COPY: Record<ConfirmPujaDetailsModalLocale, ConfirmPujaDetailsModalDefaultCopy>;
21
22
  /** Resolves the default copy for `locale`, falling back to `'en'` when unsupported. */
@@ -22,4 +22,5 @@ export interface ConfirmPujaDetailsModalProps {
22
22
  /** Fired when the Pay button is clicked, to hand off to the payment flow. */
23
23
  onProceedPayment: () => void;
24
24
  className?: string;
25
+ isGlobal: boolean;
25
26
  }
@@ -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, 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, 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';
10
+ export type PujaDetailsFormLocale = 'en' | 'hi' | 'te' | 'kn';
11
11
  export interface PujaDetailsFormDefaultCopy {
12
12
  topBarTitle: string;
13
13
  backButtonAriaLabel: string;
@@ -42,8 +42,23 @@ export interface PujaDetailsFormDefaultCopy {
42
42
  /** Displayed as the Gotra in `ConfirmPujaDetailsModal` when `isGotraUnknown` is set, per `gotraUnknownHelperText`. */
43
43
  kashyapGotraLabel: string;
44
44
  }
45
- export declare const PUJA_DETAILS_FORM_DEFAULT_COPY: Record<PujaDetailsFormLocale, PujaDetailsFormDefaultCopy>;
46
- /** Resolves the default copy for `locale`, falling back to `'en'` when unsupported. */
45
+ /**
46
+ * Each locale need only cover what's actually been translated so far — a
47
+ * locale added ahead of a full translation pass (see `kn` below) isn't
48
+ * required to duplicate every key just to type-check. `en` is the one
49
+ * locale that must stay complete: it's `getPujaDetailsFormDefaultCopy`'s
50
+ * fallback for whatever a partial locale is still missing.
51
+ */
52
+ export declare const PUJA_DETAILS_FORM_DEFAULT_COPY: Record<PujaDetailsFormLocale, Partial<PujaDetailsFormDefaultCopy>> & {
53
+ en: PujaDetailsFormDefaultCopy;
54
+ };
55
+ /**
56
+ * Resolves the default copy for `locale`, merged onto the English baseline
57
+ * key-by-key (a blank value counts as missing too) — so a locale that's
58
+ * only partially translated so far (see `kn` above) shows real copy for
59
+ * what it has and English for what it doesn't, rather than requiring every
60
+ * key up front or falling back to English wholesale for one missing key.
61
+ */
47
62
  export declare const getPujaDetailsFormDefaultCopy: (locale?: string) => PujaDetailsFormDefaultCopy;
48
63
  /** Resolves the ordinal word/numeral for a 1-based Karta field `position`, falling back to `'en'` when `locale` is unsupported. */
49
64
  export declare const getKartaOrdinalLabel: (position: number, locale?: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { CheckoutBarProps } from '../CheckoutBar';
2
- import { PujaDetailsFormLocale } from './PujaDetailsForm.translations';
2
+ import { PujaDetailsFormDefaultCopy, PujaDetailsFormLocale } from './PujaDetailsForm.translations';
3
3
  /** A single ancestor whose name is read in the sankalp. */
4
4
  export interface AncestorNameEntry {
5
5
  id: string;
@@ -30,10 +30,20 @@ export interface PujaDetailsFormValues {
30
30
  }
31
31
  export interface PujaDetailsFormProps {
32
32
  /**
33
- * Locale used to resolve all the default labels/placeholders below when
34
- * they aren't passed explicitly. Defaults to `'en'`.
33
+ * Locale used to resolve default labels/placeholders when `copy` doesn't
34
+ * cover them. Defaults to `'en'`.
35
35
  */
36
36
  locale?: PujaDetailsFormLocale;
37
+ /**
38
+ * Every piece of static copy this form shows — the app's own i18n system
39
+ * should be the one source of truth for it, not this component. Merged
40
+ * key-by-key over `locale`'s built-in default (a blank value in `copy`
41
+ * still falls back to the default), so a caller mid-translating a new
42
+ * locale need only pass what it already has. Omit entirely to use the
43
+ * built-in default outright (e.g. Storybook, which has no i18n of its
44
+ * own to source `copy` from).
45
+ */
46
+ copy?: Partial<PujaDetailsFormDefaultCopy>;
37
47
  values: PujaDetailsFormValues;
38
48
  onValuesChange: (values: PujaDetailsFormValues) => void;
39
49
  /**