@srimandir/astrology-common 7.2.2 → 7.3.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.
- package/dist/astrology-common.css +1 -1
- package/dist/components/CircularMarquee/CircularMarquee.d.ts +1 -1
- package/dist/components/ConsultationSlotSelector/types.d.ts +1 -3
- 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/PrivacyBanner/PrivacyBanner.d.ts +1 -1
- package/dist/components/UserReviewsSection/UserReviewsSection.d.ts +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +1517 -1388
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Consultations/AstrologerCard.d.ts +0 -11
- package/dist/components/Consultations/AstrologerList.d.ts +0 -18
- package/dist/components/Consultations/AstrologerPhoto.d.ts +0 -9
- package/dist/components/Consultations/RecommendedBadge.d.ts +0 -7
- package/dist/components/Consultations/icons.d.ts +0 -5
- package/dist/components/Consultations/index.d.ts +0 -6
- package/dist/components/Consultations/mockAstrologers.d.ts +0 -2
- package/dist/components/Consultations/types.d.ts +0 -10
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +0 -27
- package/dist/components/PhoneNumberInput/countries.d.ts +0 -13
- package/dist/components/PhoneNumberInput/icons.d.ts +0 -3
- package/dist/components/PhoneNumberInput/index.d.ts +0 -3
- package/dist/components/PhoneNumberInput/usePhoneNumberInput.d.ts +0 -22
- package/dist/utils/phoneValidation.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srimandir/astrology-common",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
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": "7b20b483d601393fb1815630dc430ec3caf88419"
|
|
72
72
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { AstrologerListItem } from './types';
|
|
3
|
-
export interface AstrologerCardProps {
|
|
4
|
-
astrologer: AstrologerListItem;
|
|
5
|
-
isSelected?: boolean;
|
|
6
|
-
onClick?: (astrologer: AstrologerListItem) => void;
|
|
7
|
-
/** Passed through to `AstrologerPhoto`. */
|
|
8
|
-
fallbackPhotoUrl?: string;
|
|
9
|
-
formatConsultationCount?: (count: number) => string;
|
|
10
|
-
}
|
|
11
|
-
export declare const AstrologerCard: React.FC<AstrologerCardProps>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { AstrologerListItem } from './types';
|
|
3
|
-
export interface AstrologerListProps {
|
|
4
|
-
astrologers: AstrologerListItem[];
|
|
5
|
-
/** Renders shimmer skeleton cards instead of the astrologer list. */
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
/** Selected astrologer id. Omit to let the component manage it. */
|
|
8
|
-
selectedAstrologerId?: string;
|
|
9
|
-
onAstrologerSelect?: (astrologer: AstrologerListItem) => void;
|
|
10
|
-
/** Section title. Wins over `t("planSelectAstrologerHeading")`. */
|
|
11
|
-
title?: string;
|
|
12
|
-
fallbackPhotoUrl?: string;
|
|
13
|
-
formatConsultationCount?: (count: number) => string;
|
|
14
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
15
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const AstrologerList: React.FC<AstrologerListProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface AstrologerPhotoProps {
|
|
3
|
-
photoUrl: string;
|
|
4
|
-
name: string;
|
|
5
|
-
rating: number;
|
|
6
|
-
/** Shown when `photoUrl` is empty or fails to load. Defaults to a neutral avatar glyph. */
|
|
7
|
-
fallbackPhotoUrl?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const AstrologerPhoto: React.FC<AstrologerPhotoProps>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface RecommendedBadgeProps {
|
|
3
|
-
/** Wins over `t("planRecommendedAstrologer")`. */
|
|
4
|
-
label?: string;
|
|
5
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare const RecommendedBadge: React.FC<RecommendedBadgeProps>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { AstrologerCard, type AstrologerCardProps } from './AstrologerCard';
|
|
2
|
-
export { AstrologerPhoto, type AstrologerPhotoProps } from './AstrologerPhoto';
|
|
3
|
-
export { RecommendedBadge, type RecommendedBadgeProps } from './RecommendedBadge';
|
|
4
|
-
export { AstrologerList, type AstrologerListProps } from './AstrologerList';
|
|
5
|
-
export { MOCK_ASTROLOGERS } from './mockAstrologers';
|
|
6
|
-
export type { AstrologerListItem } from './types';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** A single astrologer, shaped to match what a consultation-booking API returns. */
|
|
2
|
-
export interface AstrologerListItem {
|
|
3
|
-
astrologer_id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
photo_url: string;
|
|
6
|
-
languages: string[];
|
|
7
|
-
rating: number;
|
|
8
|
-
consultation_count: number;
|
|
9
|
-
is_recommended?: boolean;
|
|
10
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Country } from './countries';
|
|
3
|
-
import { validatePhoneByCountryCode, getMaxLengthForCountry } from '../../utils/phoneValidation';
|
|
4
|
-
export { validatePhoneByCountryCode, getMaxLengthForCountry };
|
|
5
|
-
export interface PhoneNumberInputProps {
|
|
6
|
-
/** Dial code, e.g. "+91". Omit to let the component manage it. */
|
|
7
|
-
countryCode?: string;
|
|
8
|
-
/** The number itself, digits only. Omit to let the component manage it. */
|
|
9
|
-
contactNumber?: string;
|
|
10
|
-
error?: string;
|
|
11
|
-
label?: React.ReactNode;
|
|
12
|
-
helperText?: React.ReactNode;
|
|
13
|
-
/** Defaults to `DEFAULT_COUNTRIES`. */
|
|
14
|
-
countries?: Country[];
|
|
15
|
-
/** Returns a flag image URL for an ISO code; falls back to an emoji flag when omitted/null. */
|
|
16
|
-
getFlagUrl?: (iso: string) => string | null | undefined;
|
|
17
|
-
onCountryCodeChange?: (code: string, countryName: string) => void;
|
|
18
|
-
onPhoneNumberChange?: (value: string) => void;
|
|
19
|
-
onValidationChange?: (isValid: boolean, error: string) => void;
|
|
20
|
-
onDropdownFocus?: (countryCode: string) => void;
|
|
21
|
-
onInputFocus?: (countryCode: string) => void;
|
|
22
|
-
inputRef?: (ele: HTMLInputElement | null) => void;
|
|
23
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
24
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const PhoneNumberInput: React.FC<PhoneNumberInputProps>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Dial-code country list + flag helper for `PhoneNumberInput`. */
|
|
2
|
-
export interface Country {
|
|
3
|
-
name: string;
|
|
4
|
-
code: string;
|
|
5
|
-
iso: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const DEFAULT_COUNTRIES: Country[];
|
|
8
|
-
/**
|
|
9
|
-
* Renders a flag purely from the ISO alpha-2 code via Unicode regional
|
|
10
|
-
* indicator symbols — no image assets/CDN needed. Pass `getFlagUrl` to
|
|
11
|
-
* `PhoneNumberInput` instead if the host wants real flag images.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getFlagEmoji: (iso: string | undefined) => string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Country } from './countries';
|
|
2
|
-
interface UsePhoneNumberInputOptions {
|
|
3
|
-
countryCode: string;
|
|
4
|
-
contactNumber: string;
|
|
5
|
-
countries: Country[];
|
|
6
|
-
onCountryCodeChange: (code: string, countryName: string) => void;
|
|
7
|
-
onPhoneNumberChange: (value: string) => void;
|
|
8
|
-
onValidationChange?: (isValid: boolean, error: string) => void;
|
|
9
|
-
onDropdownFocus?: (countryCode: string) => void;
|
|
10
|
-
onInputFocus?: (countryCode: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const usePhoneNumberInput: ({ countryCode, contactNumber, countries, onCountryCodeChange, onPhoneNumberChange, onValidationChange, onDropdownFocus, onInputFocus, }: UsePhoneNumberInputOptions) => {
|
|
13
|
-
isDropdownOpen: boolean;
|
|
14
|
-
selectedCountry: Country;
|
|
15
|
-
maxLength: number;
|
|
16
|
-
handleCountrySelect: (country: Country) => void;
|
|
17
|
-
handlePhoneChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
handleDropdownToggle: () => void;
|
|
19
|
-
handlePhoneFocus: () => void;
|
|
20
|
-
closeDropdown: () => void;
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|