@srimandir/astrology-common 8.0.0 → 8.0.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/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.js +1169 -1551
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/AstrologersListCard/AstrologerCard.d.ts +0 -11
- package/dist/components/AstrologersListCard/AstrologerList.d.ts +0 -18
- package/dist/components/AstrologersListCard/AstrologerPhoto.d.ts +0 -9
- package/dist/components/AstrologersListCard/RecommendedBadge.d.ts +0 -7
- package/dist/components/AstrologersListCard/RecommendedRibbon.d.ts +0 -17
- package/dist/components/AstrologersListCard/icons.d.ts +0 -5
- package/dist/components/AstrologersListCard/index.d.ts +0 -7
- package/dist/components/AstrologersListCard/mockAstrologers.d.ts +0 -2
- package/dist/components/AstrologersListCard/types.d.ts +0 -10
- package/dist/components/ConsultationSlotSelector/AstrologyProfilesSection.d.ts +0 -27
- package/dist/components/ConsultationSlotSelector/ConsultationSlotSelector.d.ts +0 -55
- package/dist/components/ConsultationSlotSelector/PhoneNumberSection.d.ts +0 -17
- package/dist/components/ConsultationSlotSelector/SlotIcons.d.ts +0 -13
- package/dist/components/ConsultationSlotSelector/index.d.ts +0 -6
- package/dist/components/ConsultationSlotSelector/mockSlots.d.ts +0 -5
- package/dist/components/ConsultationSlotSelector/slotUtils.d.ts +0 -18
- package/dist/components/ConsultationSlotSelector/types.d.ts +0 -34
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srimandir/astrology-common",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Shared UI and content for Srimandir astrology packages (Reviews, FAQs, form elements)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react-dom": "^18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@srimandir/common": "^2.0.
|
|
46
|
+
"@srimandir/common": "^2.0.2",
|
|
47
47
|
"@storybook/addon-essentials": "8.4.7",
|
|
48
48
|
"@storybook/addon-interactions": "8.4.7",
|
|
49
49
|
"@storybook/addon-links": "8.4.7",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"shared-ui"
|
|
71
71
|
],
|
|
72
72
|
"license": "MIT",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "dbea635c08a1a2b15b3f20442bcac2ab4cc1859b"
|
|
74
74
|
}
|
|
@@ -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,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface RecommendedRibbonProps {
|
|
3
|
-
/** Wins over `t("planRecommendedAstrologer")`. */
|
|
4
|
-
label?: string;
|
|
5
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
6
|
-
/** Merged onto the root element — use it to position/size from a parent. */
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Standalone "Recommended" ribbon: a solid-fill flag with a notch cut into
|
|
11
|
-
* its right (free) edge and a darker fold flap under its left (anchored)
|
|
12
|
-
* edge. Purely presentational and unpositioned — unlike `RecommendedBadge`,
|
|
13
|
-
* this doesn't assume it's pinned to a card corner, so drop it wherever
|
|
14
|
-
* it's needed (e.g. `<RecommendedRibbon className={styles.myPlacement} />`
|
|
15
|
-
* from a `position: relative` parent).
|
|
16
|
-
*/
|
|
17
|
-
export declare const RecommendedRibbon: React.FC<RecommendedRibbonProps>;
|
|
@@ -1,7 +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 { RecommendedRibbon, type RecommendedRibbonProps } from './RecommendedRibbon';
|
|
5
|
-
export { AstrologerList, type AstrologerListProps } from './AstrologerList';
|
|
6
|
-
export { MOCK_ASTROLOGERS } from './mockAstrologers';
|
|
7
|
-
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
|
-
export interface AstrologyProfile {
|
|
3
|
-
id: string;
|
|
4
|
-
/** Person's name, e.g. "Aarav Sharma" */
|
|
5
|
-
name: string;
|
|
6
|
-
/** Free-form birth line, e.g. "12 Mar 1994 • 06:45 AM" */
|
|
7
|
-
birthDetails?: string;
|
|
8
|
-
/** Birth place, e.g. "Bengaluru, India" */
|
|
9
|
-
birthPlace?: string;
|
|
10
|
-
/** Relation tag shown as a pill, e.g. "Self", "Spouse" */
|
|
11
|
-
relation?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface AstrologyProfilesSectionProps {
|
|
14
|
-
/** Section title. Wins over `t("planAstrologyProfilesHeading")`. */
|
|
15
|
-
title?: string;
|
|
16
|
-
/** Profiles to show. Defaults to placeholder data. */
|
|
17
|
-
profiles?: AstrologyProfile[];
|
|
18
|
-
/** Selected profile id. Omit to let the component manage it. */
|
|
19
|
-
selectedProfileId?: string;
|
|
20
|
-
onProfileSelect?: (profileId: string) => void;
|
|
21
|
-
/** Called when "Add profile" is tapped; the tile is hidden when not passed. */
|
|
22
|
-
onAddProfile?: () => 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 AstrologyProfilesSection: React.FC<AstrologyProfilesSectionProps>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ConsultationLanguageOption, ConsultationSlot, ConsultationSlotDay, ConsultationSlotPeriod } from './types';
|
|
3
|
-
export interface ConsultationSlotSelectorProps {
|
|
4
|
-
/** Availability for the currently selected consultation language. */
|
|
5
|
-
days: ConsultationSlotDay[];
|
|
6
|
-
/** Renders the shimmer skeleton instead of the slot grid. */
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
/** Renders the error message (with a Retry button when `onRetry` is given). */
|
|
9
|
-
error?: boolean;
|
|
10
|
-
onRetry?: () => void;
|
|
11
|
-
/** Selected date, ISO "yyyy-MM-dd". Omit to let the component manage it. */
|
|
12
|
-
selectedDate?: string;
|
|
13
|
-
onDateSelect?: (date: string) => void;
|
|
14
|
-
/** Selected time-of-day tab. Omit to let the component manage it. */
|
|
15
|
-
selectedPeriod?: ConsultationSlotPeriod;
|
|
16
|
-
onPeriodSelect?: (period: ConsultationSlotPeriod) => void;
|
|
17
|
-
/**
|
|
18
|
-
* `start` of the selected slot. Omit to let the component manage it
|
|
19
|
-
* (defaults to the first slot of the visible period); pass `null` to show
|
|
20
|
-
* nothing as selected.
|
|
21
|
-
*/
|
|
22
|
-
selectedSlotStart?: string | null;
|
|
23
|
-
onSlotSelect?: (slot: ConsultationSlot) => void;
|
|
24
|
-
/** Hides the whole consultation-language row + its divider. */
|
|
25
|
-
hideLanguageSelector?: boolean;
|
|
26
|
-
languageOptions?: ConsultationLanguageOption[];
|
|
27
|
-
/** Selected language code. Omit to let the component manage it. */
|
|
28
|
-
selectedLanguage?: string;
|
|
29
|
-
onLanguageSelect?: (code: string) => void;
|
|
30
|
-
/** Shows the (placeholder) phone-number section above the slot picker. */
|
|
31
|
-
showPhoneNumberSection?: boolean;
|
|
32
|
-
/** Replaces the placeholder phone-number section with your own node. */
|
|
33
|
-
phoneNumberSection?: React.ReactNode;
|
|
34
|
-
/** Shows the (placeholder) astrology-profiles section above the slot picker. */
|
|
35
|
-
showAstrologyProfilesSection?: boolean;
|
|
36
|
-
/** Replaces the placeholder astrology-profiles section with your own node. */
|
|
37
|
-
astrologyProfilesSection?: React.ReactNode;
|
|
38
|
-
/** Heading above the date tabs. Wins over `t("planSelectSlotHeading")`. */
|
|
39
|
-
heading?: string;
|
|
40
|
-
/** Right-aligned next to the heading, e.g. "Timezone: Asia/Kolkata". Omit to hide. */
|
|
41
|
-
timezoneLabel?: string;
|
|
42
|
-
/** Label on the left of the language dropdown. Wins over `t(...)`. */
|
|
43
|
-
languageLabel?: string;
|
|
44
|
-
/** Replaces the "Your Report will be ready in 24-48 hours" banner; `null` hides it. */
|
|
45
|
-
reportReadyNote?: React.ReactNode;
|
|
46
|
-
/**
|
|
47
|
-
* International build — labels the evening tab "Evening/Night", since slots
|
|
48
|
-
* that late in IST land at night in most timezones global users book from.
|
|
49
|
-
*/
|
|
50
|
-
isGlobal?: boolean;
|
|
51
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
52
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
53
|
-
className?: string;
|
|
54
|
-
}
|
|
55
|
-
export declare const ConsultationSlotSelector: React.FC<ConsultationSlotSelectorProps>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface PhoneNumberSectionProps {
|
|
3
|
-
/** Section title. Wins over `t("planPhoneNumberHeading")`. */
|
|
4
|
-
title?: string;
|
|
5
|
-
/** Dial code shown before the number, e.g. "+91" */
|
|
6
|
-
countryCode?: string;
|
|
7
|
-
/** The number itself, e.g. "98765 43210" */
|
|
8
|
-
phoneNumber?: string;
|
|
9
|
-
/** Helper line under the number. */
|
|
10
|
-
helperText?: string;
|
|
11
|
-
/** Called when "Change" is tapped; the link is hidden when not passed. */
|
|
12
|
-
onEdit?: () => void;
|
|
13
|
-
/** Translation lookup; every string falls back to the English default. */
|
|
14
|
-
t?: (key: string, options?: any) => string | undefined;
|
|
15
|
-
className?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare const PhoneNumberSection: React.FC<PhoneNumberSectionProps>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
/** Tick shown next to the selected consultation language */
|
|
3
|
-
export declare const CheckIcon: React.FC;
|
|
4
|
-
/** Down chevron, used by the consultation-language dropdown trigger */
|
|
5
|
-
export declare const ChevronDownIcon: React.FC;
|
|
6
|
-
/** Sun icon for "Morning" period tab */
|
|
7
|
-
export declare const MorningIcon: React.FC;
|
|
8
|
-
/** Sun-cloud icon for "Afternoon" period tab */
|
|
9
|
-
export declare const AfternoonIcon: React.FC;
|
|
10
|
-
/** Moon icon for "Evening" period tab */
|
|
11
|
-
export declare const EveningIcon: React.FC;
|
|
12
|
-
/** Calendar-with-slash icon for the "No slots available" empty state */
|
|
13
|
-
export declare const CalendarOffIcon: React.FC;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ConsultationSlotSelector, type ConsultationSlotSelectorProps, } from './ConsultationSlotSelector';
|
|
2
|
-
export { PhoneNumberSection, type PhoneNumberSectionProps, } from './PhoneNumberSection';
|
|
3
|
-
export { AstrologyProfilesSection, type AstrologyProfilesSectionProps, type AstrologyProfile, } from './AstrologyProfilesSection';
|
|
4
|
-
export { formatSlotTime, formatSlotDayLabel, CONSULTATION_PERIOD_ORDER, CONSULTATION_LANGUAGE_OPTIONS, } from './slotUtils';
|
|
5
|
-
export { MOCK_SLOT_DAYS, MOCK_SLOT_DAYS_EMPTY } from './mockSlots';
|
|
6
|
-
export type { ConsultationSlot, ConsultationSlotDay, ConsultationSlotPeriod, ConsultationSlotDateLabel, ConsultationLanguageOption, } from './types';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ConsultationSlotDay } from './types';
|
|
2
|
-
/** Five days of availability with a deliberately uneven period mix. */
|
|
3
|
-
export declare const MOCK_SLOT_DAYS: ConsultationSlotDay[];
|
|
4
|
-
/** Every day sold out — drives the "No slots available" empty state. */
|
|
5
|
-
export declare const MOCK_SLOT_DAYS_EMPTY: ConsultationSlotDay[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ConsultationLanguageOption, ConsultationSlotDateLabel, ConsultationSlotPeriod } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Formats an ISO datetime (e.g. "2026-08-03T09:00:00+05:30") into a short
|
|
4
|
-
* label like "9:00 AM". Reads the hour/minute directly off the string
|
|
5
|
-
* instead of going through `Date`, so the slot shows the exact wall-clock
|
|
6
|
-
* time the backend sent rather than being reinterpreted in the browser's
|
|
7
|
-
* local timezone.
|
|
8
|
-
*/
|
|
9
|
-
export declare const formatSlotTime: (isoDateTime: string) => string;
|
|
10
|
-
/** Builds a short day-tab label ("Today" / "Tomorrow" / weekday) + day number for a "yyyy-MM-dd" date string. */
|
|
11
|
-
export declare const formatSlotDayLabel: (isoDate: string, referenceDate?: Date) => ConsultationSlotDateLabel;
|
|
12
|
-
export declare const CONSULTATION_PERIOD_ORDER: ConsultationSlotPeriod[];
|
|
13
|
-
/**
|
|
14
|
-
* Default consultation-language dropdown options. Host apps can pass their
|
|
15
|
-
* own list through the `languageOptions` prop — `labelKey` resolves via the
|
|
16
|
-
* `t` prop and falls back to `label`.
|
|
17
|
-
*/
|
|
18
|
-
export declare const CONSULTATION_LANGUAGE_OPTIONS: ConsultationLanguageOption[];
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** Shared types for the consultation slot selection UI. */
|
|
2
|
-
export type ConsultationSlotPeriod = 'morning' | 'afternoon' | 'evening';
|
|
3
|
-
/** A single time slot for a given day — bookable unless `disabled`. */
|
|
4
|
-
export interface ConsultationSlot {
|
|
5
|
-
/** ISO datetime with offset, e.g. "2026-08-03T09:00:00+05:30" */
|
|
6
|
-
start: string;
|
|
7
|
-
/** ISO datetime with offset */
|
|
8
|
-
end: string;
|
|
9
|
-
period: ConsultationSlotPeriod;
|
|
10
|
-
/** Already booked by someone else — rendered greyed out, not selectable. */
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/** A single day's availability. */
|
|
14
|
-
export interface ConsultationSlotDay {
|
|
15
|
-
/** ISO "yyyy-MM-dd" */
|
|
16
|
-
date: string;
|
|
17
|
-
has_availability: boolean;
|
|
18
|
-
slots: ConsultationSlot[];
|
|
19
|
-
}
|
|
20
|
-
/** A single selectable date tab, e.g. { dayLabel: "Tomorrow", dayNum: "21" } */
|
|
21
|
-
export interface ConsultationSlotDateLabel {
|
|
22
|
-
id: string;
|
|
23
|
-
dayLabel: string;
|
|
24
|
-
dayNum: string;
|
|
25
|
-
}
|
|
26
|
-
/** One entry in the consultation-language dropdown. */
|
|
27
|
-
export interface ConsultationLanguageOption {
|
|
28
|
-
/** Language code, e.g. "en", "hi" */
|
|
29
|
-
code: string;
|
|
30
|
-
/** Human readable label, used when no `t` translation is available */
|
|
31
|
-
label: string;
|
|
32
|
-
/** Translation key resolved through the `t` prop */
|
|
33
|
-
labelKey?: string;
|
|
34
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Country } from './countries';
|
|
3
|
-
import { validatePhoneByCountryCode, getMaxLengthForCountry } from '../../../../common/dist/index.js';
|
|
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 {};
|