@srimandir/astrology-common 7.0.0 → 7.1.2
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/astrology-common.css +1 -1
- package/dist/components/CircularMarquee/CircularMarquee.d.ts +1 -1
- package/dist/components/Consultations/AstrologerCard.d.ts +11 -0
- package/dist/components/Consultations/AstrologerList.d.ts +18 -0
- package/dist/components/Consultations/AstrologerPhoto.d.ts +9 -0
- package/dist/components/Consultations/RecommendedBadge.d.ts +7 -0
- package/dist/components/Consultations/icons.d.ts +5 -0
- package/dist/components/Consultations/index.d.ts +6 -0
- package/dist/components/Consultations/mockAstrologers.d.ts +2 -0
- package/dist/components/Consultations/types.d.ts +10 -0
- package/dist/components/ContactUsSection/ContactUsSection.d.ts +1 -1
- package/dist/components/FAQAccordion/FAQAccordion.d.ts +1 -1
- package/dist/components/FooterShell/FooterCTAButton.d.ts +1 -1
- package/dist/components/FooterShell/FooterShell.d.ts +1 -1
- package/dist/components/FormCheckboxWithHelp/FormCheckboxWithHelp.d.ts +1 -1
- package/dist/components/FormContainer/FormContainer.d.ts +1 -1
- package/dist/components/FormDateInput/FormDateInput.d.ts +1 -1
- package/dist/components/FormField/FormField.d.ts +1 -1
- package/dist/components/FormFooterNote/FormFooterNote.d.ts +1 -1
- package/dist/components/FormLocationInput/FormLocationInput.d.ts +1 -1
- package/dist/components/FormSectionHeader/FormSectionHeader.d.ts +1 -1
- package/dist/components/FormSegmentedControl/FormSegmentedControl.d.ts +1 -1
- package/dist/components/FormTagPills/FormTagPills.d.ts +1 -1
- package/dist/components/FormTextInput/FormTextInput.d.ts +1 -1
- package/dist/components/FormTimeInput/FormTimeInput.d.ts +1 -1
- package/dist/components/MarqueeStrip/MarqueeStrip.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +27 -0
- package/dist/components/PhoneNumberInput/countries.d.ts +13 -0
- package/dist/components/PhoneNumberInput/icons.d.ts +3 -0
- package/dist/components/PhoneNumberInput/index.d.ts +3 -0
- package/dist/components/PhoneNumberInput/usePhoneNumberInput.d.ts +22 -0
- package/dist/components/PrivacyBanner/PrivacyBanner.d.ts +1 -1
- package/dist/components/UserReviewsSection/UserReviewsSection.d.ts +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1479 -1271
- package/dist/index.js.map +1 -1
- package/dist/utils/phoneValidation.d.ts +6 -0
- package/package.json +2 -2
- package/dist/components/AstrologerCard/AstrologerCard.d.ts +0 -27
- package/dist/components/AstrologerCard/CardIcons.d.ts +0 -9
- package/dist/components/AstrologerCard/currency.d.ts +0 -9
- package/dist/components/AstrologerCard/index.d.ts +0 -3
- package/dist/components/AstrologerCard/types.d.ts +0 -57
- package/dist/components/ConsultationSlotSheet/ConsultationSlotSheet.d.ts +0 -45
- package/dist/components/ConsultationSlotSheet/index.d.ts +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Phone number is treated as optional — an empty string is always valid. */
|
|
2
|
+
export declare const validatePhoneByCountryCode: (phoneNumber: string, countryCode: string) => {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
error: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getMaxLengthForCountry: (countryCode: string) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srimandir/astrology-common",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "Shared UI and content for Srimandir astrology packages (Reviews, FAQs, form elements)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"shared-ui"
|
|
69
69
|
],
|
|
70
70
|
"license": "MIT",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "bcb2525af5bf9a66b0c238b69f1e3058fe6c2734"
|
|
72
72
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { AstrologerCardAstrologer, AstrologerCardPricing } from './types';
|
|
3
|
-
export interface AstrologerCardProps {
|
|
4
|
-
astrologer: AstrologerCardAstrologer;
|
|
5
|
-
/**
|
|
6
|
-
* Price block. Omit to hide the price area entirely — see
|
|
7
|
-
* `AstrologerCardPricing`, none of these values come from the API yet.
|
|
8
|
-
*/
|
|
9
|
-
pricing?: AstrologerCardPricing;
|
|
10
|
-
/**
|
|
11
|
-
* Pre-resolved currency symbol, e.g. "₹" or "$". Wins over
|
|
12
|
-
* `pricing.currencyCode`; pass it when the host maps currency itself.
|
|
13
|
-
*/
|
|
14
|
-
currencySymbol?: string;
|
|
15
|
-
/** Fired with the astrologer when "Select Slot" is tapped. */
|
|
16
|
-
onSelectSlot?: (astrologer: AstrologerCardAstrologer) => void;
|
|
17
|
-
/** Greys out the CTA, e.g. while a booking is already in flight. */
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
/** CTA label. Wins over `t("consultationSelectSlot")`. */
|
|
20
|
-
ctaLabel?: string;
|
|
21
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
22
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
23
|
-
className?: string;
|
|
24
|
-
/** Forwarded to the outermost element so hosts can attach impression observers. */
|
|
25
|
-
innerRef?: React.Ref<HTMLDivElement>;
|
|
26
|
-
}
|
|
27
|
-
export declare const AstrologerCard: React.FC<AstrologerCardProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Filled star for the rating pill, traced from the Figma
|
|
4
|
-
* "Interface, Essential/star-favorite" asset. Golden Honey 500 (#ffc627).
|
|
5
|
-
*/
|
|
6
|
-
export declare const StarIcon: React.FC<{
|
|
7
|
-
size?: number;
|
|
8
|
-
className?: string;
|
|
9
|
-
}>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currency symbol for an ISO 4217 code.
|
|
3
|
-
*
|
|
4
|
-
* Deliberately small: the card only ever shows rupees or dollars today, and
|
|
5
|
-
* hosts that price in other currencies pass a resolved `currencySymbol` prop
|
|
6
|
-
* instead (hanuman has its own country-aware `getCurrencySymbol`). Unknown
|
|
7
|
-
* codes fall back to "$" rather than rendering a bare number.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getAstrologerPriceSymbol: (currencyCode?: string) => string;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/** Shared types for the astrologer listing card. */
|
|
2
|
-
/**
|
|
3
|
-
* Price block for one astrologer card.
|
|
4
|
-
*
|
|
5
|
-
* NOT RETURNED BY ANY CURRENT API — the available-astrologers response has no
|
|
6
|
-
* price fields at all (see `AstrologerCardAstrologer` below). The host resolves
|
|
7
|
-
* these from wherever pricing eventually lands (per-astrologer, flat rate, or a
|
|
8
|
-
* separate pricing call); the card just renders them. Omit the whole object and
|
|
9
|
-
* the card hides its price area rather than inventing a number.
|
|
10
|
-
*/
|
|
11
|
-
export interface AstrologerCardPricing {
|
|
12
|
-
/** Struck-through list price, e.g. 499. Omit to show only `price`. */
|
|
13
|
-
mrp?: number;
|
|
14
|
-
/** Amount actually charged, e.g. 99. */
|
|
15
|
-
price: number;
|
|
16
|
-
/** Discount badge value, e.g. 30 renders "30% Off". Omit to hide the badge. */
|
|
17
|
-
discountPercent?: number;
|
|
18
|
-
/**
|
|
19
|
-
* ISO 4217 code, e.g. "INR" / "USD". Used only when `currencySymbol` is not
|
|
20
|
-
* given — see `AstrologerCardProps.currencySymbol`.
|
|
21
|
-
*/
|
|
22
|
-
currencyCode?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The astrologer fields this card renders.
|
|
26
|
-
*
|
|
27
|
-
* Mirrors the host's available-astrologers response. Fields marked
|
|
28
|
-
* "not in the API" have no source in that response today — each one is
|
|
29
|
-
* optional here and has a defined fallback in the card, so the card renders
|
|
30
|
-
* correctly against the API as it stands today.
|
|
31
|
-
*/
|
|
32
|
-
export interface AstrologerCardAstrologer {
|
|
33
|
-
/** API: `astrologer_id`. */
|
|
34
|
-
id: string;
|
|
35
|
-
/** API: `name`. */
|
|
36
|
-
name: string;
|
|
37
|
-
/** API: `photo_url`. Falls back to the initial-letter avatar when empty. */
|
|
38
|
-
photoUrl?: string;
|
|
39
|
-
/** API: `languages` — rendered comma-joined. Falls back to hiding the line. */
|
|
40
|
-
languages?: string[];
|
|
41
|
-
/**
|
|
42
|
-
* API: `specialties` (nullable) — rendered as the tag pills.
|
|
43
|
-
* Falls back to hiding the tag row when null/empty.
|
|
44
|
-
*/
|
|
45
|
-
specialties?: string[] | null;
|
|
46
|
-
/** API: `experience_years`. Falls back to hiding the line when 0/undefined. */
|
|
47
|
-
experienceYears?: number;
|
|
48
|
-
/** API: `rating`. Falls back to hiding the badge when 0/undefined. */
|
|
49
|
-
rating?: number;
|
|
50
|
-
/**
|
|
51
|
-
* NOT IN THE API. The available-astrologers response has no per-user booking
|
|
52
|
-
* history — `consultation_count` is a global total and `is_recommended` is a
|
|
53
|
-
* merchandising flag, so neither answers "did *this* user consult them
|
|
54
|
-
* before". Falls back to `false`, i.e. no ribbon, until an API exposes it.
|
|
55
|
-
*/
|
|
56
|
-
isPreviouslyConsulted?: boolean;
|
|
57
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ConsultationSlot, ConsultationSlotDay, ConsultationSlotPeriod } from '../ConsultationSlotSelector';
|
|
3
|
-
export interface ConsultationSlotSheetProps {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
/** Availability to render. Passed straight through to the selector. */
|
|
7
|
-
days: ConsultationSlotDay[];
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
error?: boolean;
|
|
10
|
-
onRetry?: () => void;
|
|
11
|
-
selectedDate?: string;
|
|
12
|
-
onDateSelect?: (date: string) => void;
|
|
13
|
-
selectedPeriod?: ConsultationSlotPeriod;
|
|
14
|
-
onPeriodSelect?: (period: ConsultationSlotPeriod) => void;
|
|
15
|
-
selectedSlotStart?: string | null;
|
|
16
|
-
onSlotSelect?: (slot: ConsultationSlot) => void;
|
|
17
|
-
/**
|
|
18
|
-
* The host's phone-number input, rendered above the slot picker. Omit it and
|
|
19
|
-
* the sheet shows the slot picker alone (e.g. when the number is already known).
|
|
20
|
-
*/
|
|
21
|
-
phoneNumberSection?: React.ReactNode;
|
|
22
|
-
/** Sheet title. Wins over `t("consultationSheetTitle")`. */
|
|
23
|
-
title?: string;
|
|
24
|
-
/** Heading above the date strip. Wins over `t("consultationSelectTimeSlot")`. */
|
|
25
|
-
heading?: string;
|
|
26
|
-
/** Image URL for the 64px badge straddling the sheet's top edge. */
|
|
27
|
-
iconUrl?: string;
|
|
28
|
-
/** Arbitrary node for that badge; wins over `iconUrl`. */
|
|
29
|
-
icon?: React.ReactNode;
|
|
30
|
-
/** Footer CTA label. Wins over `t("consultationScheduleCall")`. */
|
|
31
|
-
ctaLabel?: string;
|
|
32
|
-
onCtaClick?: () => void;
|
|
33
|
-
/** Greys out the CTA — e.g. nothing selected yet, or a booking in flight. */
|
|
34
|
-
ctaDisabled?: boolean;
|
|
35
|
-
/** Swaps the CTA label for a busy label while a booking is in flight. */
|
|
36
|
-
isProcessing?: boolean;
|
|
37
|
-
/** Shown under the CTA in red, e.g. a failed booking attempt. */
|
|
38
|
-
errorMessage?: string | null;
|
|
39
|
-
/** International build — labels the evening tab "Evening/Night". */
|
|
40
|
-
isGlobal?: boolean;
|
|
41
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
42
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
43
|
-
className?: string;
|
|
44
|
-
}
|
|
45
|
-
export declare const ConsultationSlotSheet: React.FC<ConsultationSlotSheetProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ConsultationSlotSheet, type ConsultationSlotSheetProps, } from './ConsultationSlotSheet';
|