@forgebuild/hotal-ui 0.23.15 → 0.23.18

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/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export interface ReservationBarElement extends HTMLElement {
19
19
  defaultTime?: string;
20
20
  showReserveButton?: boolean;
21
21
  reserveHref?: string;
22
+ applyOnSelect?: boolean;
22
23
  syncWithUrl?: boolean;
23
24
  closedWeekdays?: number[];
24
25
  locale?: string;
@@ -302,6 +303,95 @@ export interface EventContactFormElement extends HTMLElement {
302
303
  submitInquiry?: (payload: EventInquiryPayload) => Promise<SubmitInquiryResult>;
303
304
  }
304
305
 
306
+ export interface SpaTreatment {
307
+ id: string;
308
+ name: string;
309
+ durationMins: number;
310
+ price: number;
311
+ }
312
+
313
+ export interface SpaAvailabilityDay {
314
+ date: string;
315
+ slots: { time: string }[];
316
+ }
317
+
318
+ export interface SpaBookingPayload {
319
+ treatmentId: string;
320
+ date: string;
321
+ time: string;
322
+ name: string;
323
+ email: string;
324
+ phone: string;
325
+ notes: string;
326
+ }
327
+
328
+ export type SpaBookingResult = { ok: true } | { ok: false; error?: string };
329
+
330
+ export interface SpaBookingWidgetStrings {
331
+ chooseServiceLabel: string;
332
+ loadingServices: string;
333
+ loadServicesError: string;
334
+ previousMonth: string;
335
+ nextMonth: string;
336
+ morningLabel: string;
337
+ afternoonLabel: string;
338
+ eveningLabel: string;
339
+ pickDayHint: string;
340
+ noSlotsForDay: string;
341
+ staffRowLabel: string;
342
+ totalLabel: string;
343
+ continueLabel: string;
344
+ changeServiceLabel: string;
345
+ backLabel: string;
346
+ nameLabel: string;
347
+ namePlaceholder: string;
348
+ emailLabel: string;
349
+ emailPlaceholder: string;
350
+ emailInvalidTitle: string;
351
+ phoneLabel: string;
352
+ phonePlaceholder: string;
353
+ notesLabel: string;
354
+ notesPlaceholder: string;
355
+ confirmingLabel: string;
356
+ confirmLabel: string;
357
+ notWiredError: string;
358
+ genericSubmitError: string;
359
+ successMessage: string;
360
+ }
361
+
362
+ export interface SpaBookingWidgetElement extends HTMLElement {
363
+ heading?: string;
364
+ tagline?: string;
365
+ description?: string;
366
+ /** Shown as a "Staff" row in the summary panel once a service is picked.
367
+ * Purely presentational -- there is no staff picker. Omit to hide the row. */
368
+ staffLabel?: string;
369
+ /** JS `Date#getDay()` values (0 = Sunday) to gray out on the calendar,
370
+ * e.g. `[2]` for a Tuesday closure. Visual hint only -- fetchAvailability
371
+ * is the real source of truth for what's bookable. */
372
+ closedWeekdays?: number[];
373
+ /** BCP 47 locale (e.g. "fr-FR") used to format month/weekday names;
374
+ * defaults to the browser's own locale. */
375
+ locale?: string;
376
+ /** Jumps straight to the calendar step, pre-selected to whichever
377
+ * treatment's name matches this, once treatments have loaded. Re-fires on
378
+ * every change, even mid-flow on a different service or step. */
379
+ initialTreatmentTitle?: string;
380
+ /** Pre-fills the matching contact-details field once a (truthy) value is
381
+ * available, but only while that field is still empty -- never overwrites
382
+ * something the visitor already typed. Applied once per field, no re-fire
383
+ * on later changes (unlike initialTreatmentTitle). */
384
+ initialName?: string;
385
+ initialEmail?: string;
386
+ initialPhone?: string;
387
+ strings?: Partial<SpaBookingWidgetStrings>;
388
+ fetchTreatments?: () => Promise<SpaTreatment[]>;
389
+ /** Host-provided loader for one calendar month at a time:
390
+ * (fromISO, toISO, treatmentId) => per-day bookable start times. */
391
+ fetchAvailability?: (fromISO: string, toISO: string, treatmentId: string) => Promise<SpaAvailabilityDay[]>;
392
+ submitBooking?: (payload: SpaBookingPayload) => Promise<SpaBookingResult>;
393
+ }
394
+
305
395
  export interface ReservationCancelPayload {
306
396
  reservationId: string;
307
397
  restaurantSlug?: string;
@@ -1047,6 +1137,7 @@ declare global {
1047
1137
  'menu-section': MenuSectionElement;
1048
1138
  'event-inquiries-feed': EventInquiriesFeedElement;
1049
1139
  'event-contact-form': EventContactFormElement;
1140
+ 'spa-booking-widget': SpaBookingWidgetElement;
1050
1141
  'reservation-cancel': ReservationCancelElement;
1051
1142
  'live-reservations-feed': LiveReservationsFeedElement;
1052
1143
  'live-room-bookings-feed': LiveRoomBookingsFeedElement;
@@ -1075,6 +1166,7 @@ declare global {
1075
1166
  reservationchange: CustomEvent<{ date: string; guests: number; time: string }>;
1076
1167
  'booking-confirmed': CustomEvent<{ date: string; time: string; guests: number }>;
1077
1168
  'inquiry-submitted': CustomEvent<EventInquiryPayload>;
1169
+ 'booking-submitted': CustomEvent<SpaBookingPayload>;
1078
1170
  'cancel-requested': CustomEvent<ReservationCancelPayload>;
1079
1171
  'cancel-confirmed': CustomEvent<{ token: string }>;
1080
1172
  'slide-change': CustomEvent<VenueCarouselSlideEventDetail>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgebuild/hotal-ui",
3
- "version": "0.23.15",
3
+ "version": "0.23.18",
4
4
  "description": "Reusable Svelte UI components for booking and reservation experiences.",
5
5
  "type": "module",
6
6
  "license": "MIT",