@alfadocs/ui-kit 0.25.2 → 0.30.1
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/_chunks/booking-Bw9eOU4k.js +2292 -0
- package/dist/_chunks/{calendar-9eOXumpH.js → calendar-WWNx448i.js} +10 -9
- package/dist/_chunks/{contact-card-CeEfEAxh.js → contact-card-DYbp--s-.js} +2 -2
- package/dist/_chunks/{header-B8V_sNPy.js → header-CkMb1TZS.js} +23 -23
- package/dist/_chunks/heart-pulse-CvuyFKHB.js +21 -0
- package/dist/_chunks/{link-DmM5IevO.js → link-DrD_cRUg.js} +50 -45
- package/dist/_chunks/parseISO-Dk4xa7q6.js +120 -0
- package/dist/_chunks/patient-search-DuSoGG2t.js +1113 -0
- package/dist/_chunks/{patient-shell-Bq8CjRYF.js → patient-shell-CAXYzbRw.js} +2 -2
- package/dist/_chunks/public-footer.agent-DivkKdG4.js +537 -0
- package/dist/_chunks/reviews-panel-CFttsfuC.js +513 -0
- package/dist/_chunks/slot-grid-B2zprPcv.js +387 -0
- package/dist/_chunks/stethoscope-DT5qCW8Y.js +18 -0
- package/dist/agent-catalog.json +117 -22
- package/dist/components/booking/booking-types.d.ts +167 -0
- package/dist/components/booking/booking.agent.d.ts +1 -1
- package/dist/components/booking/booking.d.ts +4 -89
- package/dist/components/booking/cascade.d.ts +96 -0
- package/dist/components/booking/details-form.d.ts +39 -0
- package/dist/components/booking/index.d.ts +2 -1
- package/dist/components/booking/index.js +5 -3
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts +6 -2
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/link.d.ts +7 -0
- package/dist/components/patient-search/index.d.ts +4 -0
- package/dist/components/patient-search/index.js +6 -0
- package/dist/components/patient-search/patient-search.agent.d.ts +4 -0
- package/dist/components/patient-search/patient-search.d.ts +112 -0
- package/dist/components/public-footer/index.d.ts +6 -0
- package/dist/components/public-footer/index.js +10 -0
- package/dist/components/public-footer/legal-urls.d.ts +18 -0
- package/dist/components/public-footer/public-footer.agent.d.ts +4 -0
- package/dist/components/public-footer/public-footer.d.ts +58 -0
- package/dist/components/public-footer/socials.d.ts +9 -0
- package/dist/components/reviews-panel/index.d.ts +4 -0
- package/dist/components/reviews-panel/index.js +6 -0
- package/dist/components/reviews-panel/reviews-panel.agent.d.ts +4 -0
- package/dist/components/reviews-panel/reviews-panel.d.ts +76 -0
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/i18n/config.js +3994 -38
- package/dist/i18n/locales/ar.d.ts +221 -0
- package/dist/i18n/locales/de.d.ts +221 -0
- package/dist/i18n/locales/el.d.ts +221 -0
- package/dist/i18n/locales/es.d.ts +221 -0
- package/dist/i18n/locales/fr.d.ts +221 -0
- package/dist/i18n/locales/hi.d.ts +221 -0
- package/dist/i18n/locales/ja.d.ts +221 -0
- package/dist/i18n/locales/nl.d.ts +221 -0
- package/dist/i18n/locales/pl.d.ts +221 -0
- package/dist/i18n/locales/pt.d.ts +221 -0
- package/dist/i18n/locales/ro.d.ts +221 -0
- package/dist/i18n/locales/ru.d.ts +221 -0
- package/dist/i18n/locales/sq.d.ts +221 -0
- package/dist/i18n/locales/sv.d.ts +221 -0
- package/dist/i18n/locales/tr.d.ts +221 -0
- package/dist/i18n/locales/zh.d.ts +221 -0
- package/dist/i18n/resources.d.ts +442 -0
- package/dist/index.js +351 -336
- package/dist/locales/ar.json +222 -1
- package/dist/locales/de.json +222 -1
- package/dist/locales/el.json +222 -1
- package/dist/locales/en.json +222 -1
- package/dist/locales/es.json +222 -1
- package/dist/locales/fr.json +222 -1
- package/dist/locales/hi.json +222 -1
- package/dist/locales/it.json +222 -1
- package/dist/locales/ja.json +222 -1
- package/dist/locales/nl.json +222 -1
- package/dist/locales/pl.json +222 -1
- package/dist/locales/pt.json +222 -1
- package/dist/locales/ro.json +222 -1
- package/dist/locales/ru.json +222 -1
- package/dist/locales/sq.json +222 -1
- package/dist/locales/sv.json +222 -1
- package/dist/locales/tr.json +222 -1
- package/dist/locales/zh.json +222 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/booking-CXngC-1u.js +0 -1743
- package/dist/_chunks/slot-grid-DoodeQGZ.js +0 -502
- package/dist/_chunks/stethoscope-B8kpbtjh.js +0 -35
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type BookingVariant = 'inline-list' | 'accordion' | 'calendar' | 'flexible' | 'progress';
|
|
3
|
+
export type InsuranceType = 'private' | 'public';
|
|
4
|
+
/** Channels the patient can pick to receive the confirmation link. */
|
|
5
|
+
export type ConfirmationChannel = 'email' | 'whatsapp' | 'sms';
|
|
6
|
+
/** Fixed order — email first, then WhatsApp, then SMS. */
|
|
7
|
+
export declare const CONFIRMATION_CHANNEL_ORDER: readonly ConfirmationChannel[];
|
|
8
|
+
export interface BookingSpecialty {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional ordering hint; falls back to array order. */
|
|
12
|
+
sequenceNumber?: number;
|
|
13
|
+
/** Restrict to operators-on-page when lockedOperatorId is set. */
|
|
14
|
+
operatorIds?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface BookingService {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Minutes — required for slot fetching. */
|
|
20
|
+
durationMin: number;
|
|
21
|
+
/** Required when useSpecialties is true. */
|
|
22
|
+
specialtyId?: string;
|
|
23
|
+
/** Operators who can perform this service. */
|
|
24
|
+
operatorIds?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface BookingOperator {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
specialtyIds?: string[];
|
|
30
|
+
appointmentBookingReasonIds?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface BookingSlot {
|
|
33
|
+
/** Opaque unique key within `availableSlots[date]`. */
|
|
34
|
+
key: string;
|
|
35
|
+
/** HH:mm 24h — used for display. */
|
|
36
|
+
time: string;
|
|
37
|
+
available: boolean;
|
|
38
|
+
/** Opaque passthrough so the consumer can resolve operatorId / chairId
|
|
39
|
+
* / dateTime when `onSubmit` fires. */
|
|
40
|
+
meta?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface BookingDetails {
|
|
43
|
+
firstName: string;
|
|
44
|
+
lastName: string;
|
|
45
|
+
email: string;
|
|
46
|
+
mobilePhone: string;
|
|
47
|
+
privacyConsent: boolean;
|
|
48
|
+
termsConsent: boolean;
|
|
49
|
+
codiceFiscale?: string;
|
|
50
|
+
dateOfBirth?: string;
|
|
51
|
+
insuranceNumber?: string;
|
|
52
|
+
note?: string;
|
|
53
|
+
returningPatient?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Channels the patient picked for the confirmation link. Guaranteed to
|
|
56
|
+
* be a non-empty subset of the practice's enabled `confirmationChannels`
|
|
57
|
+
* when present. Omitted when only one channel is enabled (implicit —
|
|
58
|
+
* backend infers from the practice config).
|
|
59
|
+
*/
|
|
60
|
+
confirmationChannels?: ConfirmationChannel[];
|
|
61
|
+
}
|
|
62
|
+
export interface BookingValue {
|
|
63
|
+
insuranceType?: InsuranceType;
|
|
64
|
+
specialtyId?: string;
|
|
65
|
+
serviceId?: string;
|
|
66
|
+
/** May be the literal `'all'` sentinel to mean "no operator preference". */
|
|
67
|
+
operatorId?: string;
|
|
68
|
+
/** YYYY-MM-DD. */
|
|
69
|
+
date?: string;
|
|
70
|
+
/** Opaque key from `availableSlots[date]`. */
|
|
71
|
+
slotKey?: string;
|
|
72
|
+
/** Partial details — fully populated when the user is ready to submit. */
|
|
73
|
+
details?: Partial<BookingDetails>;
|
|
74
|
+
}
|
|
75
|
+
export interface BookingSubmitPayload {
|
|
76
|
+
slot: BookingSlot;
|
|
77
|
+
value: BookingValue;
|
|
78
|
+
/** Fully populated + validated (privacy + terms ticked, required fields filled). */
|
|
79
|
+
details: BookingDetails;
|
|
80
|
+
}
|
|
81
|
+
export interface BookingValidationResult {
|
|
82
|
+
valid: boolean;
|
|
83
|
+
/** Optional localised hint shown next to the field on failure. */
|
|
84
|
+
hint?: string;
|
|
85
|
+
}
|
|
86
|
+
export type BookingValidator = (value: string) => Promise<BookingValidationResult>;
|
|
87
|
+
export interface BookingHandle {
|
|
88
|
+
getVariant: () => BookingVariant;
|
|
89
|
+
/** Clear `value` back to an empty state via `onChange`. */
|
|
90
|
+
reset: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Jump to a specific step. Implementations may clamp to the first
|
|
93
|
+
* incomplete step if the requested one isn't reachable yet.
|
|
94
|
+
*/
|
|
95
|
+
goToStep: (step: 1 | 2 | 3 | 4 | 5 | 6 | 7) => void;
|
|
96
|
+
}
|
|
97
|
+
export interface BookingProps extends Omit<ComponentPropsWithoutRef<'div'>, 'aria-label' | 'onChange' | 'onSubmit'> {
|
|
98
|
+
variant?: BookingVariant;
|
|
99
|
+
country?: string;
|
|
100
|
+
useSpecialties?: boolean;
|
|
101
|
+
allowOperatorSelection?: boolean;
|
|
102
|
+
/** Pins step 4 to this operator. */
|
|
103
|
+
lockedOperatorId?: string;
|
|
104
|
+
specialties?: BookingSpecialty[];
|
|
105
|
+
services: BookingService[];
|
|
106
|
+
operators?: BookingOperator[];
|
|
107
|
+
availableDates: string[];
|
|
108
|
+
availableSlots: Record<string, BookingSlot[]>;
|
|
109
|
+
/** Server-side hint of the next free date when the current window is empty. */
|
|
110
|
+
nextAvailableDate?: string;
|
|
111
|
+
requireCodiceFiscale?: boolean;
|
|
112
|
+
requireDateOfBirth?: boolean;
|
|
113
|
+
requireInsuranceNumber?: boolean;
|
|
114
|
+
showNote?: boolean;
|
|
115
|
+
showReturningPatientFlag?: boolean;
|
|
116
|
+
privacyPolicyUrl?: string;
|
|
117
|
+
termsUrl?: string;
|
|
118
|
+
validateCodiceFiscale?: BookingValidator;
|
|
119
|
+
validateInsuranceNumber?: BookingValidator;
|
|
120
|
+
/** Default: false. Specialty auto-select on length=1 is always on. */
|
|
121
|
+
autoSelectSingleService?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Channels the practice has enabled. The picker renders one checkbox
|
|
124
|
+
* per channel; when length === 1, the picker is hidden and the single
|
|
125
|
+
* channel is implicit. Defaults to `['email']` when omitted.
|
|
126
|
+
*/
|
|
127
|
+
confirmationChannels?: ConfirmationChannel[];
|
|
128
|
+
/**
|
|
129
|
+
* Pre-checked channels. Intersected with `confirmationChannels` for
|
|
130
|
+
* safety. When omitted, the kit applies a smart default (always email;
|
|
131
|
+
* +whatsapp when mobile is plausibly filled; +sms when whatsapp isn't
|
|
132
|
+
* available).
|
|
133
|
+
*/
|
|
134
|
+
defaultConfirmationChannels?: ConfirmationChannel[];
|
|
135
|
+
value: BookingValue;
|
|
136
|
+
onChange: (next: BookingValue) => void;
|
|
137
|
+
onSubmit: (payload: BookingSubmitPayload) => void | Promise<void>;
|
|
138
|
+
loadingSlots?: boolean;
|
|
139
|
+
submitting?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Surface a submit-failure message inside the form (Alert variant=destructive
|
|
142
|
+
* above the submit button). The consumer owns the state — set it after an
|
|
143
|
+
* `onSubmit` rejection, clear it when retrying or on a field edit. When set,
|
|
144
|
+
* the kit's normal "form stays mounted on rejected promise" behaviour is
|
|
145
|
+
* unchanged; this just gives the failure a sanctioned slot to render.
|
|
146
|
+
*/
|
|
147
|
+
submitError?: ReactNode;
|
|
148
|
+
/**
|
|
149
|
+
* @default 'live'
|
|
150
|
+
* In `'demo'` mode the kit's step-8 success view swaps its description to
|
|
151
|
+
* a localised "This was a demo — no confirmation was sent." so the copy
|
|
152
|
+
* stays honest when no real API call was made.
|
|
153
|
+
*/
|
|
154
|
+
mode?: 'live' | 'demo';
|
|
155
|
+
/**
|
|
156
|
+
* @default true
|
|
157
|
+
* Render a "Modify booking" button on the step-8 success view that returns
|
|
158
|
+
* to step 7 without clearing `value`/`details`. Practices that want a
|
|
159
|
+
* one-shot booking flow can hide this.
|
|
160
|
+
*/
|
|
161
|
+
showModifyOnSuccess?: boolean;
|
|
162
|
+
emptyServicesSlot?: ReactNode;
|
|
163
|
+
onboardingIncompleteSlot?: ReactNode;
|
|
164
|
+
'aria-label'?: string;
|
|
165
|
+
id?: string;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=booking-types.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AgentAdapter } from '../../agent/types';
|
|
2
|
-
import type { BookingHandle } from './booking';
|
|
2
|
+
import type { BookingHandle } from './booking-types';
|
|
3
3
|
export declare const bookingAgent: AgentAdapter<BookingHandle>;
|
|
4
4
|
//# sourceMappingURL=booking.agent.d.ts.map
|
|
@@ -1,91 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export interface BookingService {
|
|
6
|
-
id: string;
|
|
7
|
-
/** Already-translated label (consumer owns data i18n). */
|
|
8
|
-
label: string;
|
|
9
|
-
/** Duration in minutes — shown alongside the label. */
|
|
10
|
-
durationMin: number;
|
|
11
|
-
/** Optional secondary line, e.g. "Prima visita o consulto". */
|
|
12
|
-
description?: string;
|
|
13
|
-
/** Optional price token — already formatted by the consumer. */
|
|
14
|
-
price?: string;
|
|
15
|
-
/** Optional payment hint — "Paga in studio" / "Paga online". */
|
|
16
|
-
paymentHint?: string;
|
|
17
|
-
/** Optional specialty id used to filter when a specialty chip is active. */
|
|
18
|
-
specialtyId?: string;
|
|
19
|
-
/** Optional icon — defaults to a stethoscope glyph. */
|
|
20
|
-
icon?: ReactNode;
|
|
21
|
-
}
|
|
22
|
-
/** Specialty chip rendered above the service list in `inline-list`. */
|
|
23
|
-
export interface BookingSpecialty {
|
|
24
|
-
id: string;
|
|
25
|
-
label: string;
|
|
26
|
-
/**
|
|
27
|
-
* Optional icon override. When omitted, a keyword-based heuristic picks
|
|
28
|
-
* an icon from the specialty's label (cardio → HeartPulse, derma →
|
|
29
|
-
* Sparkles, etc.) and renders it in the accent colour.
|
|
30
|
-
*/
|
|
31
|
-
icon?: ReactNode;
|
|
32
|
-
}
|
|
33
|
-
/** One slot in an `availableSlots[date]` array. */
|
|
34
|
-
export interface BookingSlot {
|
|
35
|
-
/** Stable key — consumer-defined. Opaque to the component. */
|
|
36
|
-
key: string;
|
|
37
|
-
/** HH:mm 24h. */
|
|
38
|
-
time: string;
|
|
39
|
-
available: boolean;
|
|
40
|
-
/** Optional tooltip explaining a disabled slot. */
|
|
41
|
-
unavailableReason?: string;
|
|
42
|
-
}
|
|
43
|
-
/** Booking selection — controlled by the consumer. */
|
|
44
|
-
export interface BookingValue {
|
|
45
|
-
serviceId?: string;
|
|
46
|
-
specialtyId?: string;
|
|
47
|
-
/** ISO yyyy-mm-dd. */
|
|
48
|
-
date?: string;
|
|
49
|
-
/** HH:mm 24h. */
|
|
50
|
-
time?: string;
|
|
51
|
-
/** Slot lookup key — opaque to the component; passed through to onSubmit. */
|
|
52
|
-
slotKey?: string;
|
|
53
|
-
}
|
|
54
|
-
declare const rootVariants: (props?: ({
|
|
55
|
-
variant?: "progress" | "calendar" | "accordion" | "inline-list" | "flexible" | null | undefined;
|
|
56
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
57
|
-
export interface BookingProps extends Omit<ComponentPropsWithoutRef<'div'>, 'aria-label' | 'onChange' | 'onSubmit'>, VariantProps<typeof rootVariants> {
|
|
58
|
-
services: BookingService[];
|
|
59
|
-
/** Optional — hides the specialty chip row when absent. */
|
|
60
|
-
specialties?: BookingSpecialty[];
|
|
61
|
-
availableDates: string[];
|
|
62
|
-
availableSlots: Record<string, BookingSlot[]>;
|
|
63
|
-
value: BookingValue;
|
|
64
|
-
onChange: (next: BookingValue) => void;
|
|
65
|
-
onSubmit?: (value: BookingValue) => void;
|
|
66
|
-
/** Optional pre-filter slot rendered above the variant body. */
|
|
67
|
-
filtersSlot?: ReactNode;
|
|
68
|
-
/** Optional details/contact form rendered after the slot pick. */
|
|
69
|
-
detailsSlot?: ReactNode;
|
|
70
|
-
/** Optional sticky CTA strip below the body. */
|
|
71
|
-
ctaSlot?: ReactNode;
|
|
72
|
-
/** Header content. `null` omits the header. Defaults to variant title + subtitle. */
|
|
73
|
-
heading?: ReactNode;
|
|
74
|
-
loadingDates?: boolean;
|
|
75
|
-
loadingSlots?: boolean;
|
|
76
|
-
/** Override aria-label on the root region. */
|
|
77
|
-
'aria-label'?: string;
|
|
78
|
-
/** Agent-readiness instance id. */
|
|
79
|
-
id?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface BookingHandle {
|
|
82
|
-
getCurrentStep: () => number;
|
|
83
|
-
getTotalSteps: () => number;
|
|
84
|
-
gotoStep: (step: number) => void;
|
|
85
|
-
next: () => void;
|
|
86
|
-
previous: () => void;
|
|
87
|
-
getVariant: () => BookingVariant;
|
|
88
|
-
}
|
|
1
|
+
import type { BookingProps } from './booking-types';
|
|
2
|
+
export type { BookingDetails, BookingHandle, BookingOperator, BookingProps, BookingService, BookingSlot, BookingSpecialty, BookingSubmitPayload, BookingValidationResult, BookingValidator, BookingValue, BookingVariant, ConfirmationChannel, InsuranceType, } from './booking-types';
|
|
3
|
+
export { CONFIRMATION_CHANNEL_ORDER } from './booking-types';
|
|
4
|
+
export { OPERATORS_ALL } from './cascade';
|
|
89
5
|
export declare const Booking: import("react").ForwardRefExoticComponent<BookingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
90
|
-
export {};
|
|
91
6
|
//# sourceMappingURL=booking.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { BookingOperator, BookingService, BookingSlot, BookingSpecialty, BookingValue, ConfirmationChannel, InsuranceType } from './booking-types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentinel for the operator filter's "All operators" pseudo-option. Mirrors
|
|
4
|
+
* `OPERATORS_ALL = '0'` in the legacy `useBookingState.js`, but the kit
|
|
5
|
+
* uses `'all'` as the well-known string so consumers can't accidentally
|
|
6
|
+
* collide with a real operator id of `'0'`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OPERATORS_ALL: "all";
|
|
9
|
+
export interface CascadePolicy {
|
|
10
|
+
/** ISO 3166-1 alpha-2 country code. Currently only `'de'` toggles a gate. */
|
|
11
|
+
country?: string;
|
|
12
|
+
useSpecialties?: boolean;
|
|
13
|
+
allowOperatorSelection?: boolean;
|
|
14
|
+
/** When set, locks step 4 to this operator id and hides the picker. */
|
|
15
|
+
lockedOperatorId?: string;
|
|
16
|
+
/** Defaults to `false`. When true, single-service lists auto-pre-fill. */
|
|
17
|
+
autoSelectSingleService?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CascadeInputs extends CascadePolicy {
|
|
20
|
+
specialties: BookingSpecialty[];
|
|
21
|
+
services: BookingService[];
|
|
22
|
+
operators: BookingOperator[];
|
|
23
|
+
availableDates: string[];
|
|
24
|
+
availableSlots: Record<string, BookingSlot[]>;
|
|
25
|
+
value: BookingValue;
|
|
26
|
+
}
|
|
27
|
+
export interface CascadeGates {
|
|
28
|
+
insurance: boolean;
|
|
29
|
+
specialty: boolean;
|
|
30
|
+
service: boolean;
|
|
31
|
+
operator: boolean;
|
|
32
|
+
date: boolean;
|
|
33
|
+
slot: boolean;
|
|
34
|
+
details: boolean;
|
|
35
|
+
/** True when a service is picked but no eligible operators can perform it. */
|
|
36
|
+
onboardingIncomplete: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface CascadeFiltered {
|
|
39
|
+
specialties: BookingSpecialty[];
|
|
40
|
+
services: BookingService[];
|
|
41
|
+
/**
|
|
42
|
+
* Eligible operators for the active specialty (when `useSpecialties=true`)
|
|
43
|
+
* OR the active service. Excludes the "All operators" sentinel — that's
|
|
44
|
+
* always prepended in the UI layer.
|
|
45
|
+
*/
|
|
46
|
+
operators: BookingOperator[];
|
|
47
|
+
}
|
|
48
|
+
/** Step number — 1-indexed, matches the docs / a11y order. */
|
|
49
|
+
export type CascadeStep = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
50
|
+
export interface CascadeOutputs {
|
|
51
|
+
gates: CascadeGates;
|
|
52
|
+
filtered: CascadeFiltered;
|
|
53
|
+
/** Current step: the first visible step that has an unfulfilled requirement. */
|
|
54
|
+
currentStep: CascadeStep;
|
|
55
|
+
/** Total visible steps (1..7 minus any auto-skipped). */
|
|
56
|
+
totalSteps: number;
|
|
57
|
+
/** Ordered list of the visible step indices, used by variants that show a stepper. */
|
|
58
|
+
visibleSteps: CascadeStep[];
|
|
59
|
+
/** Whether every required step is satisfied — the submit button is gated on this. */
|
|
60
|
+
isReadyToSubmit: boolean;
|
|
61
|
+
/** Selected service's duration, if any — needed for slot fetching. */
|
|
62
|
+
durationMin?: number;
|
|
63
|
+
/** Selected slot resolved from `value.date` + `value.slotKey`. */
|
|
64
|
+
selectedSlot?: BookingSlot;
|
|
65
|
+
}
|
|
66
|
+
export declare function deriveCascade(inputs: CascadeInputs): CascadeOutputs;
|
|
67
|
+
export declare function resetOnInsuranceChange(value: BookingValue, next: InsuranceType | undefined): BookingValue;
|
|
68
|
+
export declare function resetOnSpecialtyChange(value: BookingValue, next: string | undefined): BookingValue;
|
|
69
|
+
export declare function resetOnServiceChange(value: BookingValue, next: string | undefined): BookingValue;
|
|
70
|
+
export declare function resetOnOperatorChange(value: BookingValue, next: string | undefined): BookingValue;
|
|
71
|
+
export declare function resetOnDateChange(value: BookingValue, next: string | undefined): BookingValue;
|
|
72
|
+
export declare function resetOnSlotChange(value: BookingValue, next: string | undefined): BookingValue;
|
|
73
|
+
export declare function applyAutoSelects(value: BookingValue, inputs: CascadePolicy & {
|
|
74
|
+
specialties: BookingSpecialty[];
|
|
75
|
+
services: BookingService[];
|
|
76
|
+
}): BookingValue;
|
|
77
|
+
/** Resolve the active operator id, treating the `'all'` sentinel as `undefined`. */
|
|
78
|
+
export declare function resolveOperatorId(value: BookingValue): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the effective list of enabled channels. Falls back to `['email']`
|
|
81
|
+
* when the consumer omits the prop, preserving the pre-amendment behaviour.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveConfirmationChannels(enabled: ConfirmationChannel[] | undefined): ConfirmationChannel[];
|
|
84
|
+
/**
|
|
85
|
+
* Compute the channels to pre-check. Result is intersected with `enabled`
|
|
86
|
+
* for safety so a channel the practice didn't enable never gets ticked.
|
|
87
|
+
*
|
|
88
|
+
* Rules (per spec):
|
|
89
|
+
* 1. Always include 'email'.
|
|
90
|
+
* 2. Include 'whatsapp' if enabled AND mobile looks plausible.
|
|
91
|
+
* 3. Include 'sms' ONLY when whatsapp is NOT in `enabled`.
|
|
92
|
+
* 4. If the consumer passes `override`, honour it verbatim (still
|
|
93
|
+
* intersected with `enabled` for safety).
|
|
94
|
+
*/
|
|
95
|
+
export declare function defaultConfirmationSelection(enabled: ConfirmationChannel[] | undefined, mobile: string | undefined, override?: ConfirmationChannel[]): ConfirmationChannel[];
|
|
96
|
+
//# sourceMappingURL=cascade.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { BookingDetails, BookingValidator, ConfirmationChannel } from './booking-types';
|
|
3
|
+
export interface BookingDetailsFormProps {
|
|
4
|
+
value: Partial<BookingDetails>;
|
|
5
|
+
onChange: (next: Partial<BookingDetails>) => void;
|
|
6
|
+
onSubmit: (details: BookingDetails) => void | Promise<void>;
|
|
7
|
+
requireCodiceFiscale?: boolean;
|
|
8
|
+
requireDateOfBirth?: boolean;
|
|
9
|
+
/** When `true` AND `insuranceType === 'public'`, render the Versichertennummer field. */
|
|
10
|
+
requireInsuranceNumber?: boolean;
|
|
11
|
+
insuranceType?: 'private' | 'public';
|
|
12
|
+
showNote?: boolean;
|
|
13
|
+
showReturningPatientFlag?: boolean;
|
|
14
|
+
privacyPolicyUrl?: string;
|
|
15
|
+
termsUrl?: string;
|
|
16
|
+
validateCodiceFiscale?: BookingValidator;
|
|
17
|
+
validateInsuranceNumber?: BookingValidator;
|
|
18
|
+
submitting?: boolean;
|
|
19
|
+
/** Optional summary node rendered above the form (e.g. confirm-time chip). */
|
|
20
|
+
summarySlot?: ReactNode;
|
|
21
|
+
defaultPhoneCountry?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Channels the practice has enabled. When omitted, defaults to
|
|
24
|
+
* `['email']` (picker hidden — single implicit channel). When the
|
|
25
|
+
* resolved list has length 1 the picker stays hidden.
|
|
26
|
+
*/
|
|
27
|
+
confirmationChannels?: ConfirmationChannel[];
|
|
28
|
+
/** Pre-checked channels override; falls back to a smart default. */
|
|
29
|
+
defaultConfirmationChannels?: ConfirmationChannel[];
|
|
30
|
+
/**
|
|
31
|
+
* Render an error Alert above the submit button. Set after an
|
|
32
|
+
* `onSubmit` rejection, clear before retrying. The kit doesn't
|
|
33
|
+
* disable the submit button while this is set — the patient can
|
|
34
|
+
* re-submit immediately.
|
|
35
|
+
*/
|
|
36
|
+
submitError?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare const BookingDetailsForm: import("react").ForwardRefExoticComponent<BookingDetailsFormProps & import("react").RefAttributes<HTMLFormElement>>;
|
|
39
|
+
//# sourceMappingURL=details-form.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Booking } from './booking';
|
|
2
|
-
export type { BookingProps, BookingHandle, BookingVariant, BookingValue, BookingService, BookingSpecialty, BookingSlot, } from './booking';
|
|
2
|
+
export type { BookingProps, BookingHandle, BookingVariant, BookingValue, BookingService, BookingSpecialty, BookingSlot, BookingOperator, BookingDetails, BookingSubmitPayload, BookingValidator, BookingValidationResult, ConfirmationChannel, InsuranceType, } from './booking';
|
|
3
|
+
export { CONFIRMATION_CHANNEL_ORDER, OPERATORS_ALL } from './booking';
|
|
3
4
|
export { bookingAgent } from './booking.agent';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as A, C as R, O as a, b as s } from "../../_chunks/booking-Bw9eOU4k.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A as Booking,
|
|
4
|
+
R as CONFIRMATION_CHANNEL_ORDER,
|
|
5
|
+
a as OPERATORS_ALL,
|
|
6
|
+
s as bookingAgent
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
2
|
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
3
3
|
import { type VariantProps } from 'class-variance-authority';
|
|
4
4
|
/** Agent-readiness curated handle for Checkbox. */
|
|
@@ -12,7 +12,11 @@ declare const checkboxVariants: (props?: ({
|
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
type RadixRootProps = ComponentPropsWithoutRef<typeof RadixCheckbox.Root>;
|
|
14
14
|
export interface CheckboxProps extends Omit<RadixRootProps, 'checked' | 'onCheckedChange' | 'children'>, VariantProps<typeof checkboxVariants> {
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Visible label rendered next to the box. Accepts a string or any React
|
|
17
|
+
* node — useful for consent labels that embed a privacy / T&C link.
|
|
18
|
+
*/
|
|
19
|
+
label: ReactNode;
|
|
16
20
|
checked?: boolean | 'indeterminate';
|
|
17
21
|
onCheckedChange?: (checked: boolean | 'indeterminate') => void;
|
|
18
22
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as r, a as d, b as H, c as s, d as n, e as t, f as i, g as o } from "../../_chunks/header-
|
|
1
|
+
import { H as r, a as d, b as H, c as s, d as n, e as t, f as i, g as o } from "../../_chunks/header-CkMb1TZS.js";
|
|
2
2
|
export {
|
|
3
3
|
r as Header,
|
|
4
4
|
d as HeaderBrand,
|
|
@@ -65,6 +65,7 @@ export * from './header';
|
|
|
65
65
|
export * from './navigation-menu';
|
|
66
66
|
export * from './link';
|
|
67
67
|
export * from './pagination';
|
|
68
|
+
export * from './public-footer';
|
|
68
69
|
export * from './public-header';
|
|
69
70
|
export * from './search-bar';
|
|
70
71
|
export * from './sidebar';
|
|
@@ -116,8 +117,10 @@ export * from './transcript-panel';
|
|
|
116
117
|
export * from './typing-indicator';
|
|
117
118
|
export * from './booking';
|
|
118
119
|
export * from './calendar';
|
|
120
|
+
export * from './patient-search';
|
|
119
121
|
export * from './payment-form';
|
|
120
122
|
export * from './pdf-viewer';
|
|
123
|
+
export * from './reviews-panel';
|
|
121
124
|
export * from './rich-text-editor';
|
|
122
125
|
export * from './signature-capture';
|
|
123
126
|
export * from './slot-grid';
|
|
@@ -23,6 +23,13 @@ export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
|
23
23
|
* trailing `ExternalLink` icon with an i18n'd aria-label.
|
|
24
24
|
*/
|
|
25
25
|
external?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Render the trailing external-link glyph. Default `true` — set to
|
|
28
|
+
* `false` for surfaces (footer, social rows, dense nav) where the
|
|
29
|
+
* indicator adds visual noise. The `target` / `rel` / "opens in new
|
|
30
|
+
* tab" aria-label are still applied.
|
|
31
|
+
*/
|
|
32
|
+
externalIcon?: boolean;
|
|
26
33
|
/**
|
|
27
34
|
* Render the link in a non-interactive disabled state. Strips `href`,
|
|
28
35
|
* adds `aria-disabled` + `role="link"`, suppresses the underline.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PatientSearch } from './patient-search';
|
|
2
|
+
export type { PatientSearchProps, PatientSearchHandle, PatientSearchVariant, PatientSearchObject, PatientSearchPlace, DiscoveryCard, FacetGroup, FacetOption, SearchValue, WhenFilter, } from './patient-search';
|
|
3
|
+
export { patientSearchAgent } from './patient-search.agent';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
export type PatientSearchVariant = 'who-where' | 'who-where-when' | 'faceted' | 'discovery';
|
|
4
|
+
export type WhenFilter = 'today' | 'tomorrow' | 'this_week' | 'anytime';
|
|
5
|
+
/** Result from `loadObjects` — a profession, specialty, operator, or practice. */
|
|
6
|
+
export interface PatientSearchObject {
|
|
7
|
+
/** Stable opaque key, e.g. `"profession:dentista"` or `"operator:mario-rossi-9001"`. */
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Opaque consumer payload — used in `onObjectSelect` to route. */
|
|
12
|
+
__payload?: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** Result from `loadPlaces` — a Google-Places-style place prediction. */
|
|
15
|
+
export interface PatientSearchPlace {
|
|
16
|
+
/** Place ID or stable text. */
|
|
17
|
+
value: string;
|
|
18
|
+
/** Display label, e.g. `"Milano, Italia"`. */
|
|
19
|
+
label: string;
|
|
20
|
+
lat?: number;
|
|
21
|
+
lng?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Curated card for the `discovery` variant. */
|
|
24
|
+
export interface DiscoveryCard {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
href: string;
|
|
29
|
+
icon?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Accent token. `auto` rotates through the brand palette by row index.
|
|
32
|
+
* Defaults to `auto`.
|
|
33
|
+
*/
|
|
34
|
+
accent?: 'violet' | 'purple' | 'magenta' | 'blue' | 'auto';
|
|
35
|
+
badge?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface FacetOption {
|
|
38
|
+
value: string;
|
|
39
|
+
label: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FacetGroup {
|
|
42
|
+
/** Stable key — e.g. `"insurance"`, `"language"`. */
|
|
43
|
+
key: string;
|
|
44
|
+
/** Display label, e.g. `"Convenzione"`. */
|
|
45
|
+
label: string;
|
|
46
|
+
/** Empty array = boolean toggle chip. Non-empty = dropdown chip. */
|
|
47
|
+
options: FacetOption[];
|
|
48
|
+
/** Whether multiple options can be selected. Default false. */
|
|
49
|
+
multi?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface SearchValue {
|
|
52
|
+
object?: PatientSearchObject;
|
|
53
|
+
place?: PatientSearchPlace;
|
|
54
|
+
when?: WhenFilter;
|
|
55
|
+
facets?: Record<string, string[]>;
|
|
56
|
+
geo?: {
|
|
57
|
+
lat: number;
|
|
58
|
+
lng: number;
|
|
59
|
+
radiusKm: number;
|
|
60
|
+
label?: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** Curated imperative handle — used by the agent adapter. */
|
|
64
|
+
export interface PatientSearchHandle {
|
|
65
|
+
getVariant: () => PatientSearchVariant;
|
|
66
|
+
reset: () => void;
|
|
67
|
+
/** Move focus to the most-relevant field for the current variant. */
|
|
68
|
+
focusPrimary: () => void;
|
|
69
|
+
}
|
|
70
|
+
declare const rootVariants: (props?: ({
|
|
71
|
+
variant?: "who-where" | "who-where-when" | "faceted" | "discovery" | null | undefined;
|
|
72
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
73
|
+
export interface PatientSearchProps extends Omit<ComponentPropsWithoutRef<'div'>, 'aria-label' | 'onChange' | 'onSubmit'>, VariantProps<typeof rootVariants> {
|
|
74
|
+
variant: PatientSearchVariant;
|
|
75
|
+
loadObjects: (query: string, ctx: {
|
|
76
|
+
signal: AbortSignal;
|
|
77
|
+
}) => Promise<PatientSearchObject[]>;
|
|
78
|
+
loadPlaces: (query: string, ctx: {
|
|
79
|
+
signal: AbortSignal;
|
|
80
|
+
}) => Promise<PatientSearchPlace[]>;
|
|
81
|
+
onObjectSelect?: (option: PatientSearchObject) => void;
|
|
82
|
+
onPlaceSelect?: (place: PatientSearchPlace) => void;
|
|
83
|
+
facets?: FacetGroup[];
|
|
84
|
+
/** Default radius in km when geolocation is granted. Snaps to the nearest preset. */
|
|
85
|
+
defaultRadiusKm?: number;
|
|
86
|
+
/** Reverse-geocode lat/lng → human label. Optional. */
|
|
87
|
+
reverseGeocode?: (lat: number, lng: number) => Promise<string>;
|
|
88
|
+
discoveryCards?: DiscoveryCard[];
|
|
89
|
+
/** Forwarded to the consumer's loaders if they want to constrain by country. */
|
|
90
|
+
countryCode?: 'it' | 'de' | string;
|
|
91
|
+
value: SearchValue;
|
|
92
|
+
onChange: (next: SearchValue) => void;
|
|
93
|
+
onSubmit: (value: SearchValue) => void | Promise<void>;
|
|
94
|
+
submitting?: boolean;
|
|
95
|
+
/** Custom CTA label override; defaults to `ui.patientSearch.submit.cta`. */
|
|
96
|
+
submitLabel?: string;
|
|
97
|
+
/**
|
|
98
|
+
* @default false
|
|
99
|
+
* By default the kit disables the submit button until at least one
|
|
100
|
+
* search dimension is set (object, place, geo, non-anytime when, or
|
|
101
|
+
* a facet). Set to `true` to allow an empty submit — useful for
|
|
102
|
+
* "browse all" patterns where the consumer wants to show all results
|
|
103
|
+
* with no initial filter.
|
|
104
|
+
*/
|
|
105
|
+
allowEmptySubmit?: boolean;
|
|
106
|
+
'aria-label'?: string;
|
|
107
|
+
/** Agent-readiness instance id. */
|
|
108
|
+
id?: string;
|
|
109
|
+
}
|
|
110
|
+
export declare const PatientSearch: import("react").ForwardRefExoticComponent<PatientSearchProps & import("react").RefAttributes<PatientSearchHandle>>;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=patient-search.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PublicFooter } from './public-footer';
|
|
2
|
+
export type { PublicFooterProps, PublicFooterHandle, PublicFooterVariant, PublicFooterLink, PublicFooterLinkGroup, PublicFooterSocial, } from './public-footer';
|
|
3
|
+
export { DEFAULT_MARKETING_BASE_URL, composeLegalUrls, type LegalUrlOverrides, type ResolvedLegalUrls, } from './legal-urls';
|
|
4
|
+
export { SOCIAL_NETWORKS, DEFAULT_SOCIAL_URLS, type SocialNetwork, } from './socials';
|
|
5
|
+
export { publicFooterAgent } from './public-footer.agent';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { D as s, a as A, P as L, S as e, c as S, p as _ } from "../../_chunks/public-footer.agent-DivkKdG4.js";
|
|
2
|
+
export {
|
|
3
|
+
s as DEFAULT_MARKETING_BASE_URL,
|
|
4
|
+
A as DEFAULT_SOCIAL_URLS,
|
|
5
|
+
L as PublicFooter,
|
|
6
|
+
e as SOCIAL_NETWORKS,
|
|
7
|
+
S as composeLegalUrls,
|
|
8
|
+
_ as publicFooterAgent
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|