@veladent/booking-widget 0.0.0-stage → 1.0.4-dev.9

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.
Files changed (60) hide show
  1. package/README.md +38 -2
  2. package/index.js +5888 -0
  3. package/package.json +51 -4
  4. package/styles.css +1 -0
  5. package/types/booking/core/src/client.d.ts +21 -0
  6. package/types/booking/core/src/index.d.ts +5 -0
  7. package/types/booking/core/src/locale.d.ts +113 -0
  8. package/types/booking/core/src/timezone.d.ts +10 -0
  9. package/types/booking/core/src/types.d.ts +135 -0
  10. package/types/booking/core/src/validation.d.ts +9 -0
  11. package/types/booking/react/src/booking-context.d.ts +70 -0
  12. package/types/booking/react/src/booking-parts-context.d.ts +7 -0
  13. package/types/booking/react/src/booking-parts.d.ts +148 -0
  14. package/types/booking/react/src/booking-widget.d.ts +19 -0
  15. package/types/booking/react/src/component-types.d.ts +33 -0
  16. package/types/booking/react/src/components/card-arrow.d.ts +4 -0
  17. package/types/booking/react/src/components/date-step.d.ts +2 -0
  18. package/types/booking/react/src/components/details-step.d.ts +2 -0
  19. package/types/booking/react/src/components/doctor-step.d.ts +2 -0
  20. package/types/booking/react/src/components/existing-phone-step.d.ts +2 -0
  21. package/types/booking/react/src/components/existing-record-step.d.ts +4 -0
  22. package/types/booking/react/src/components/gate-step.d.ts +2 -0
  23. package/types/booking/react/src/components/index.d.ts +15 -0
  24. package/types/booking/react/src/components/option-card.d.ts +8 -0
  25. package/types/booking/react/src/components/otp-step.d.ts +2 -0
  26. package/types/booking/react/src/components/payment-step.d.ts +2 -0
  27. package/types/booking/react/src/components/phone-input.d.ts +16 -0
  28. package/types/booking/react/src/components/service-step.d.ts +2 -0
  29. package/types/booking/react/src/components/step-header.d.ts +2 -0
  30. package/types/booking/react/src/components/summary-modal.d.ts +2 -0
  31. package/types/booking/react/src/components/treatment-step.d.ts +2 -0
  32. package/types/booking/react/src/components/utils.d.ts +8 -0
  33. package/types/booking/react/src/environment.d.ts +16 -0
  34. package/types/booking/react/src/index.d.ts +6 -0
  35. package/types/booking/react/src/verification-session.d.ts +12 -0
  36. package/types/ui/src/components/application/date-picker/calendar.d.ts +14 -0
  37. package/types/ui/src/components/application/date-picker/cell.d.ts +11 -0
  38. package/types/ui/src/components/application/date-picker/date-picker.d.ts +20 -0
  39. package/types/ui/src/components/base/avatar/avatar.d.ts +64 -0
  40. package/types/ui/src/components/base/avatar/base-components/avatar-add-button.d.ts +8 -0
  41. package/types/ui/src/components/base/avatar/base-components/avatar-company-icon.d.ts +7 -0
  42. package/types/ui/src/components/base/avatar/base-components/avatar-count.d.ts +6 -0
  43. package/types/ui/src/components/base/avatar/base-components/avatar-online-indicator.d.ts +7 -0
  44. package/types/ui/src/components/base/avatar/base-components/index.d.ts +4 -0
  45. package/types/ui/src/components/base/avatar/base-components/verified-tick.d.ts +6 -0
  46. package/types/ui/src/components/base/buttons/button.d.ts +104 -0
  47. package/types/ui/src/components/base/checkbox/checkbox.d.ts +26 -0
  48. package/types/ui/src/components/base/input/hint-text.d.ts +14 -0
  49. package/types/ui/src/components/base/input/input-date.d.ts +41 -0
  50. package/types/ui/src/components/base/input/input.d.ts +63 -0
  51. package/types/ui/src/components/base/input/label.d.ts +15 -0
  52. package/types/ui/src/components/base/input/pin-input.d.ts +55 -0
  53. package/types/ui/src/components/base/select/combobox.d.ts +14 -0
  54. package/types/ui/src/components/base/select/popover.d.ts +7 -0
  55. package/types/ui/src/components/base/select/select-item.d.ts +10 -0
  56. package/types/ui/src/components/base/select/select-shared.d.ts +58 -0
  57. package/types/ui/src/components/base/select/select.d.ts +19 -0
  58. package/types/ui/src/components/base/tooltip/tooltip.d.ts +29 -0
  59. package/types/ui/src/utils/cx.d.ts +11 -0
  60. package/types/ui/src/utils/is-react-component.d.ts +19 -0
@@ -0,0 +1,21 @@
1
+ import type { BookingClientOptions, BookingConfig, BookingResult, BookingSlot, CreateBookingInput, GetSlotsInput, RequestBookingVerificationInput, RequestBookingVerificationResult, VerifyBookingCodeInput, VerifyBookingCodeResult } from "./types.js";
2
+ export declare class BookingApiError extends Error {
3
+ readonly status: number;
4
+ readonly code?: string;
5
+ constructor(message: string, status: number, code?: string);
6
+ }
7
+ export interface BookingClient {
8
+ cancelPayment?(sessionId: string): Promise<Omit<BookingResult, "status"> & {
9
+ status: "pending" | "confirmed" | "expired";
10
+ }>;
11
+ createRequest(input: CreateBookingInput): Promise<BookingResult>;
12
+ getConfig(signal?: AbortSignal): Promise<BookingConfig>;
13
+ getPaymentStatus?(sessionId: string): Promise<Omit<BookingResult, "status"> & {
14
+ status: "pending" | "confirmed" | "expired";
15
+ }>;
16
+ getSlots(input: GetSlotsInput): Promise<BookingSlot[]>;
17
+ requestVerification(input: RequestBookingVerificationInput): Promise<RequestBookingVerificationResult>;
18
+ verificationStorageKey?: string;
19
+ verifyCode(input: VerifyBookingCodeInput): Promise<VerifyBookingCodeResult>;
20
+ }
21
+ export declare function createBookingClient(options: BookingClientOptions): BookingClient;
@@ -0,0 +1,5 @@
1
+ export * from "./client.js";
2
+ export * from "./locale.js";
3
+ export * from "./timezone.js";
4
+ export * from "./types.js";
5
+ export * from "./validation.js";
@@ -0,0 +1,113 @@
1
+ import type { BookingLocale } from "./types.js";
2
+ export type BookingDirection = "ltr" | "rtl";
3
+ export interface BookingCopy {
4
+ addressLine1: string;
5
+ anyPractitioner: string;
6
+ anyPractitionerDescription: string;
7
+ appointmentSummary: string;
8
+ appointmentTitle: string;
9
+ back: string;
10
+ balance: string;
11
+ bookAgain: string;
12
+ bookingDisabled: string;
13
+ bookingFailed: string;
14
+ bookingUnavailableDescription: string;
15
+ bookingUnavailableTitle: string;
16
+ callPractice: string;
17
+ cancelPayment: string;
18
+ checkingPayment: string;
19
+ checkPayment: string;
20
+ chooseAnotherDate: string;
21
+ chooseDate: string;
22
+ chooseDateTime: string;
23
+ chooseDoctor: string;
24
+ chooseService: string;
25
+ chooseTime: string;
26
+ chooseTreatment: string;
27
+ clinic: string;
28
+ close: string;
29
+ codeExpired: string;
30
+ codeExpiresIn: string;
31
+ confirmationDescription: string;
32
+ confirmCode: string;
33
+ confirmed: string;
34
+ contactPractice: string;
35
+ contactSite: string;
36
+ continue: string;
37
+ dateOfBirth: string;
38
+ deposit: string;
39
+ email: string;
40
+ existingPatient: string;
41
+ existingPatientDescription: string;
42
+ findPatientRecord: string;
43
+ firstName: string;
44
+ fullName: string;
45
+ gender: string;
46
+ genderOptions: {
47
+ female: string;
48
+ male: string;
49
+ other: string;
50
+ preferNotToSay: string;
51
+ };
52
+ genderPlaceholder: string;
53
+ goBackAndEdit: string;
54
+ identityUnavailable: string;
55
+ identityUnavailableDescription: string;
56
+ invalidInput: string;
57
+ lastName: string;
58
+ loadingSlots: string;
59
+ loginTitle: string;
60
+ marketingOptIn: string;
61
+ newPatient: string;
62
+ newPatientDescription: string;
63
+ noDoctors: string;
64
+ noMatchingServices: string;
65
+ noServices: string;
66
+ noSlots: string;
67
+ noTreatments: string;
68
+ otpCode: string;
69
+ otpDescription: string;
70
+ otpSent: string;
71
+ patientDetails: string;
72
+ patientDetailsRequired: string;
73
+ patientNoMatch: string;
74
+ patientNoMatchDescription: string;
75
+ paymentAtPractice: string;
76
+ paymentExpired: string;
77
+ paymentPending: string;
78
+ paymentReceived: string;
79
+ paymentStatusUnavailable: string;
80
+ payWithStripe: string;
81
+ pendingConfirmation: string;
82
+ phone: string;
83
+ phoneCountry: string;
84
+ phoneCountryCodeHint: string;
85
+ postcode: string;
86
+ practitionerDescription: string;
87
+ preparingPayment: string;
88
+ price: string;
89
+ registeredQuestion: string;
90
+ requestCode: string;
91
+ resendCode: string;
92
+ resendCodeIn: string;
93
+ retry: string;
94
+ reviewPayment: string;
95
+ searchServices: string;
96
+ selectDateFirst: string;
97
+ serviceDescription: string;
98
+ slotsLoadFailed: string;
99
+ somethingElse: string;
100
+ submit: string;
101
+ submitting: string;
102
+ title: string;
103
+ titleLabel: string;
104
+ titlePlaceholder: string;
105
+ total: string;
106
+ treatmentDescription: string;
107
+ verificationReminders: string;
108
+ verifyPhone: string;
109
+ yourDetails: string;
110
+ }
111
+ export declare function resolveLocale(locale?: BookingLocale): string;
112
+ export declare function getLocaleDirection(locale?: BookingLocale): BookingDirection;
113
+ export declare function getBookingCopy(locale?: BookingLocale): BookingCopy;
@@ -0,0 +1,10 @@
1
+ import type { BookingLocale } from "./types.js";
2
+ export interface FormatDateTimeOptions {
3
+ locale?: BookingLocale;
4
+ timeZone: string;
5
+ }
6
+ export declare function formatBookingDateTime(value: Date | string, options: FormatDateTimeOptions): string;
7
+ export declare function formatBookingDate(value: Date | string, options: FormatDateTimeOptions): string;
8
+ export declare function formatBookingTime(value: Date | string, options: FormatDateTimeOptions): string;
9
+ export declare function getDateKeyInTimeZone(value: Date | string, timeZone: string): string;
10
+ export declare function addCalendarDays(dateKey: string, days: number): string;
@@ -0,0 +1,135 @@
1
+ export type BookingLocale = string;
2
+ export interface BookingTheme {
3
+ accentColor?: string;
4
+ colorMode?: "dark" | "light";
5
+ radius?: string;
6
+ }
7
+ export interface BookingDoctor {
8
+ avatarUrl?: string | null;
9
+ displayName: string;
10
+ id: string;
11
+ specialty?: string | null;
12
+ }
13
+ export interface BookingService {
14
+ description?: string | null;
15
+ id: string;
16
+ name: string;
17
+ }
18
+ export interface BookingTreatment {
19
+ currencyCode: string;
20
+ currencySymbol?: string | null;
21
+ deposit?: number | null;
22
+ description?: string | null;
23
+ durationMinutes: number;
24
+ id: string;
25
+ name: string;
26
+ price: number;
27
+ serviceId: string;
28
+ }
29
+ export interface BookingConfig {
30
+ doctors: BookingDoctor[];
31
+ enabled: boolean;
32
+ locale: BookingLocale;
33
+ services: BookingService[];
34
+ siteAddress?: string | null;
35
+ siteLogoUrl?: string | null;
36
+ siteName?: string | null;
37
+ sitePhone?: string | null;
38
+ theme?: BookingTheme | null;
39
+ timeZone: string;
40
+ treatments: BookingTreatment[];
41
+ }
42
+ export interface BookingSlot {
43
+ available: boolean;
44
+ doctorId: string;
45
+ doctorName?: string | null;
46
+ end: string;
47
+ id: string;
48
+ start: string;
49
+ }
50
+ export interface BookingContact {
51
+ address?: string;
52
+ email: string;
53
+ firstName?: string;
54
+ fullName: string;
55
+ lastName?: string;
56
+ marketingOptIn?: boolean;
57
+ phone: string;
58
+ postalCode?: string;
59
+ title?: string;
60
+ }
61
+ export interface PatientDetails {
62
+ dateOfBirth: string;
63
+ gender: string;
64
+ }
65
+ export interface CreateBookingInput {
66
+ bookingMode: "existing" | "new";
67
+ checkoutRequestId?: string;
68
+ contact: BookingContact;
69
+ doctorId: string;
70
+ end: string;
71
+ patientDetails: PatientDetails;
72
+ start: string;
73
+ treatmentId: string;
74
+ verificationCode: string;
75
+ }
76
+ export interface RequestBookingVerificationInput {
77
+ bookingMode?: "existing" | "new";
78
+ identity?: {
79
+ firstName: string;
80
+ lastName: string;
81
+ dateOfBirth: string;
82
+ };
83
+ phone: string;
84
+ }
85
+ export interface RequestBookingVerificationResult {
86
+ cooldownSeconds: number;
87
+ expiresInSeconds: number;
88
+ is_patient_found?: boolean;
89
+ }
90
+ export interface VerifyBookingCodeInput {
91
+ bookingMode?: "existing" | "new";
92
+ code: string;
93
+ identity?: {
94
+ firstName: string;
95
+ lastName: string;
96
+ dateOfBirth: string;
97
+ };
98
+ phone: string;
99
+ }
100
+ export interface VerifyBookingCodeResult {
101
+ patientMatched?: boolean;
102
+ sessionExpiresInSeconds?: number;
103
+ sessionToken?: string;
104
+ verified: boolean;
105
+ }
106
+ export interface BookingResult {
107
+ checkout?: {
108
+ sessionId: string;
109
+ url: string;
110
+ amount: number;
111
+ price: number;
112
+ currency: string;
113
+ };
114
+ payment?: {
115
+ price: number;
116
+ currency: string;
117
+ };
118
+ scheduledEnd: string;
119
+ scheduledStart: string;
120
+ status: "pending" | "confirmed";
121
+ treatmentName?: string;
122
+ }
123
+ export interface GetSlotsInput {
124
+ date: string;
125
+ doctorId?: string;
126
+ fromDate?: string;
127
+ signal?: AbortSignal;
128
+ toDate?: string;
129
+ treatmentId: string;
130
+ }
131
+ export interface BookingClientOptions {
132
+ baseUrl: string;
133
+ fetcher?: typeof fetch;
134
+ publishableKey: string;
135
+ }
@@ -0,0 +1,9 @@
1
+ import type { BookingContact, PatientDetails } from "./types.js";
2
+ export declare function normalizeEmail(value: string): string;
3
+ export declare function normalizePhone(value: string): string;
4
+ export declare function isLikelyE164(value: string): boolean;
5
+ export declare function validateContact(contact: BookingContact): string | null;
6
+ export declare function validateExistingPhone(phone: string): string | null;
7
+ export declare function validateVerificationCode(code: string): string | null;
8
+ export declare function isValidPastDateOfBirth(value: string): boolean;
9
+ export declare function validatePatientDetails(details?: PatientDetails): string | null;
@@ -0,0 +1,70 @@
1
+ import { type BookingClient, type BookingConfig, type BookingContact, type BookingLocale, type BookingResult, type BookingSlot, type BookingTheme, getBookingCopy, type PatientDetails } from "@veladent/booking-core";
2
+ import { type ReactNode } from "react";
3
+ export type BookingStep = "loading" | "gate" | "existingPhone" | "existingRecord" | "patientNoMatch" | "identityUnavailable" | "service" | "treatment" | "doctor" | "date" | "summary" | "details" | "otp" | "payment" | "success" | "error";
4
+ export type BookingMode = "existing" | "new";
5
+ export interface BookingState {
6
+ bookingMode: BookingMode | null;
7
+ config: BookingConfig | null;
8
+ contact: BookingContact;
9
+ copy: ReturnType<typeof getBookingCopy>;
10
+ direction: "ltr" | "rtl";
11
+ error: string | null;
12
+ isCheckingPayment: boolean;
13
+ isLoading: boolean;
14
+ locale: string;
15
+ needsPatientDetails: boolean;
16
+ otpCode: string;
17
+ patientDetails: PatientDetails;
18
+ resendCooldownSeconds: number;
19
+ result: BookingResult | null;
20
+ selectedDate: string;
21
+ selectedDoctorId: string | null;
22
+ selectedServiceId: string | null;
23
+ selectedSlot: BookingSlot | null;
24
+ selectedTreatmentId: string | null;
25
+ slots: BookingSlot[];
26
+ slotsError: string | null;
27
+ step: BookingStep;
28
+ timeZone: string;
29
+ verificationCode: string;
30
+ verificationExpiresInSeconds: number;
31
+ verificationSent: boolean;
32
+ }
33
+ export interface BookingActions {
34
+ cancelPayment(): Promise<void>;
35
+ checkPayment(): Promise<void>;
36
+ chooseDate(date: string): void;
37
+ chooseDoctor(doctorId: string): void;
38
+ chooseMode(mode: BookingMode): void;
39
+ chooseService(serviceId: string): void;
40
+ chooseSlot(slot: BookingSlot): void;
41
+ chooseTreatment(treatmentId: string): void;
42
+ continueDoctor(): void;
43
+ continueTreatment(): void;
44
+ findPatientRecord(): Promise<void>;
45
+ goBack(): void;
46
+ reload(): Promise<void>;
47
+ requestVerification(): Promise<void>;
48
+ setOtpCode(code: string): void;
49
+ setStep(step: BookingStep): void;
50
+ startPayment(): void;
51
+ submit(): Promise<void>;
52
+ updateContact(fields: Partial<BookingContact>): void;
53
+ updatePatientDetails(fields: Partial<PatientDetails>): void;
54
+ verifyCode(): Promise<void>;
55
+ }
56
+ export interface BookingContextValue {
57
+ actions: BookingActions;
58
+ state: BookingState;
59
+ theme: BookingTheme;
60
+ }
61
+ export interface BookingProviderProps {
62
+ children?: ReactNode;
63
+ client: BookingClient;
64
+ locale?: BookingLocale;
65
+ onComplete?: (result: BookingResult) => void;
66
+ theme?: BookingTheme;
67
+ timeZone?: string;
68
+ }
69
+ export declare function BookingProvider({ client, locale: localeProp, timeZone: timeZoneProp, theme, onComplete, children, }: BookingProviderProps): import("react").JSX.Element;
70
+ export declare function useVeladantBooking(): BookingContextValue;
@@ -0,0 +1,7 @@
1
+ import type { BookingClassNames, BookingComponents } from "./component-types.js";
2
+ export interface BookingPartsContextValue {
3
+ classNames?: BookingClassNames;
4
+ components: BookingComponents;
5
+ }
6
+ export declare const BookingPartsContext: import("react").Context<BookingPartsContextValue | null>;
7
+ export declare function useBookingParts(): BookingPartsContextValue;
@@ -0,0 +1,148 @@
1
+ import { type ComponentPropsWithRef } from "react";
2
+ import { type BookingWidgetProps } from "./booking-widget.js";
3
+ import type { BookingClassNames } from "./component-types.js";
4
+ type DivProps = ComponentPropsWithRef<"div">;
5
+ export interface BookingStepProps extends Omit<DivProps, "children"> {
6
+ classNames?: BookingClassNames;
7
+ }
8
+ export interface BookingStepsProps extends DivProps {
9
+ classNames?: BookingClassNames;
10
+ }
11
+ export declare function BookingRoot({ children, ...props }: BookingWidgetProps): import("react").JSX.Element;
12
+ export declare function BookingHeader({ children, className, ...props }: ComponentPropsWithRef<"header">): import("react").JSX.Element;
13
+ export declare function BookingBranding({ children, className, ...props }: DivProps): import("react").JSX.Element | null;
14
+ export declare function BookingNavigation({ className, ...props }: DivProps): import("react").JSX.Element;
15
+ export declare function BookingTitle({ children, className, ...props }: ComponentPropsWithRef<"h2">): import("react").JSX.Element;
16
+ export declare function BookingDescription({ children, className, ...props }: ComponentPropsWithRef<"p">): import("react").JSX.Element | null;
17
+ export declare function BookingBackButton({ children, className, onClick, disabled, ...props }: ComponentPropsWithRef<"button">): import("react").JSX.Element | null;
18
+ export declare function BookingProgress({ children, className, ...props }: DivProps): import("react").JSX.Element | null;
19
+ export declare function BookingProgressIndicator({ className, style, ...props }: DivProps): import("react").JSX.Element;
20
+ export declare function BookingContent({ children, className, ...props }: DivProps): import("react").JSX.Element;
21
+ export declare const BookingGateStep: {
22
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
23
+ displayName: string;
24
+ };
25
+ export declare const BookingExistingPhoneStep: {
26
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
27
+ displayName: string;
28
+ };
29
+ export declare const BookingExistingRecordStep: {
30
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
31
+ displayName: string;
32
+ };
33
+ export declare const BookingPatientNoMatchStep: {
34
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
35
+ displayName: string;
36
+ };
37
+ export declare const BookingIdentityUnavailableStep: {
38
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
39
+ displayName: string;
40
+ };
41
+ export declare const BookingServiceStep: {
42
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
43
+ displayName: string;
44
+ };
45
+ export declare const BookingTreatmentStep: {
46
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
47
+ displayName: string;
48
+ };
49
+ export declare const BookingDoctorStep: {
50
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
51
+ displayName: string;
52
+ };
53
+ export declare const BookingDateStep: {
54
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
55
+ displayName: string;
56
+ };
57
+ export declare const BookingSummary: {
58
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
59
+ displayName: string;
60
+ };
61
+ export declare const BookingDetailsStep: {
62
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
63
+ displayName: string;
64
+ };
65
+ export declare const BookingOtpStep: {
66
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
67
+ displayName: string;
68
+ };
69
+ export declare const BookingPaymentStep: {
70
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
71
+ displayName: string;
72
+ };
73
+ export interface BookingLoadingProps extends DivProps {
74
+ spinnerClassName?: string;
75
+ }
76
+ export declare function BookingLoading({ className, spinnerClassName, ...props }: BookingLoadingProps): import("react").JSX.Element | null;
77
+ export declare function BookingSuccess({ className, ...props }: DivProps): import("react").JSX.Element | null;
78
+ export declare function BookingError({ className, ...props }: DivProps): import("react").JSX.Element | null;
79
+ export declare function BookingSteps({ children, className, classNames, ...props }: BookingStepsProps): import("react").JSX.Element;
80
+ export declare const Booking: {
81
+ BackButton: typeof BookingBackButton;
82
+ Branding: typeof BookingBranding;
83
+ Content: typeof BookingContent;
84
+ DateStep: {
85
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
86
+ displayName: string;
87
+ };
88
+ Description: typeof BookingDescription;
89
+ DetailsStep: {
90
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
91
+ displayName: string;
92
+ };
93
+ DoctorStep: {
94
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
95
+ displayName: string;
96
+ };
97
+ Error: typeof BookingError;
98
+ ExistingPhoneStep: {
99
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
100
+ displayName: string;
101
+ };
102
+ ExistingRecordStep: {
103
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
104
+ displayName: string;
105
+ };
106
+ GateStep: {
107
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
108
+ displayName: string;
109
+ };
110
+ Header: typeof BookingHeader;
111
+ IdentityUnavailableStep: {
112
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
113
+ displayName: string;
114
+ };
115
+ Loading: typeof BookingLoading;
116
+ Navigation: typeof BookingNavigation;
117
+ OtpStep: {
118
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
119
+ displayName: string;
120
+ };
121
+ PatientNoMatchStep: {
122
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
123
+ displayName: string;
124
+ };
125
+ PaymentStep: {
126
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
127
+ displayName: string;
128
+ };
129
+ Progress: typeof BookingProgress;
130
+ ProgressIndicator: typeof BookingProgressIndicator;
131
+ Root: typeof BookingRoot;
132
+ ServiceStep: {
133
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
134
+ displayName: string;
135
+ };
136
+ Steps: typeof BookingSteps;
137
+ Success: typeof BookingSuccess;
138
+ Summary: {
139
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
140
+ displayName: string;
141
+ };
142
+ Title: typeof BookingTitle;
143
+ TreatmentStep: {
144
+ ({ className, classNames, ...props }: BookingStepProps): import("react").JSX.Element | null;
145
+ displayName: string;
146
+ };
147
+ };
148
+ export {};
@@ -0,0 +1,19 @@
1
+ import { type BookingClient, type BookingLocale, type BookingResult, type BookingTheme } from "@veladent/booking-core";
2
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
3
+ import type { BookingClassNames, BookingComponentOverrides, BookingComponents } from "./component-types.js";
4
+
5
+ export declare const defaultBookingComponents: BookingComponents;
6
+ export interface BookingWidgetProps extends Omit<ComponentPropsWithRef<"section">, "children"> {
7
+ baseUrl?: string;
8
+ children?: ReactNode;
9
+ className?: string;
10
+ classNames?: BookingClassNames;
11
+ client?: BookingClient;
12
+ components?: BookingComponentOverrides;
13
+ locale?: BookingLocale;
14
+ onComplete?: (result: BookingResult) => void;
15
+ publishableKey?: string;
16
+ theme?: BookingTheme;
17
+ timeZone?: string;
18
+ }
19
+ export declare function BookingWidget({ client, baseUrl, publishableKey, locale, timeZone, theme, className, classNames, components, onComplete, children, ...rootProps }: BookingWidgetProps): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import type { ComponentType } from "react";
2
+ import type { BookingStep } from "./booking-context.js";
3
+ export type BookingPart = "root" | "header" | "body" | "loading" | "loadingSpinner" | "step" | "branding" | "gate" | "serviceList" | "service" | "treatmentList" | "treatment" | "doctorList" | "doctor" | "date" | "slotList" | "slot" | "summary" | "details" | "otp" | "form" | "input" | "button" | "hint" | "actions" | "error" | "success" | "payment" | "phone" | "phoneCountry";
4
+ export type BookingClassNames = Partial<Record<BookingPart, string>>;
5
+ export interface BookingStepComponentProps {
6
+ classNames?: BookingClassNames;
7
+ }
8
+ export interface StepHeaderProps {
9
+ backLabel: string;
10
+ className?: string;
11
+ direction: "ltr" | "rtl";
12
+ hideBack?: boolean;
13
+ onBack: () => void;
14
+ step: BookingStep;
15
+ title: string;
16
+ }
17
+ export interface BookingComponents {
18
+ DateStep: ComponentType<BookingStepComponentProps>;
19
+ DetailsStep: ComponentType<BookingStepComponentProps>;
20
+ DoctorStep: ComponentType<BookingStepComponentProps>;
21
+ ExistingPhoneStep: ComponentType<BookingStepComponentProps>;
22
+ ExistingRecordStep: ComponentType<BookingStepComponentProps>;
23
+ GateStep: ComponentType<BookingStepComponentProps>;
24
+ IdentityUnavailableStep: ComponentType<BookingStepComponentProps>;
25
+ OtpStep: ComponentType<BookingStepComponentProps>;
26
+ PatientNoMatchStep: ComponentType<BookingStepComponentProps>;
27
+ PaymentStep: ComponentType<BookingStepComponentProps>;
28
+ ServiceStep: ComponentType<BookingStepComponentProps>;
29
+ StepHeader: ComponentType<StepHeaderProps>;
30
+ SummaryModal: ComponentType<BookingStepComponentProps>;
31
+ TreatmentStep: ComponentType<BookingStepComponentProps>;
32
+ }
33
+ export type BookingComponentOverrides = Partial<BookingComponents>;
@@ -0,0 +1,4 @@
1
+ export interface CardArrowProps {
2
+ className?: string;
3
+ }
4
+ export declare function CardArrow({ className }: CardArrowProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function DateStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function DetailsStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function DoctorStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function ExistingPhoneStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function ExistingRecordStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
3
+ export declare function IdentityUnavailableStep({ classNames, }: BookingStepComponentProps): import("react").JSX.Element;
4
+ export declare function PatientNoMatchStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function GateStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export * from "./card-arrow.js";
2
+ export * from "./date-step.js";
3
+ export * from "./details-step.js";
4
+ export * from "./doctor-step.js";
5
+ export * from "./existing-phone-step.js";
6
+ export * from "./existing-record-step.js";
7
+ export * from "./gate-step.js";
8
+ export * from "./option-card.js";
9
+ export * from "./otp-step.js";
10
+ export * from "./payment-step.js";
11
+ export * from "./phone-input.js";
12
+ export * from "./service-step.js";
13
+ export * from "./step-header.js";
14
+ export * from "./summary-modal.js";
15
+ export * from "./treatment-step.js";
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ export interface OptionCardProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ onClick: () => void;
6
+ selected?: boolean;
7
+ }
8
+ export declare function OptionCard({ children, className, onClick, selected, }: OptionCardProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function OtpStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function PaymentStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { BookingTheme } from "@veladent/booking-core";
2
+ import { type CountryCode } from "libphonenumber-js";
3
+ import type { BookingClassNames } from "../component-types.js";
4
+ export interface PhoneInputProps {
5
+ classNames?: BookingClassNames;
6
+ countryLabel: string;
7
+ defaultCountry?: CountryCode;
8
+ isDisabled?: boolean;
9
+ isRequired?: boolean;
10
+ label: string;
11
+ locale?: string;
12
+ onChange: (phone: string) => void;
13
+ theme?: BookingTheme;
14
+ value: string;
15
+ }
16
+ export declare function PhoneInput({ value, onChange, label, countryLabel, locale, defaultCountry, isDisabled, isRequired, classNames, theme, }: PhoneInputProps): import("react").JSX.Element;