@forgebuild/hotal-ui 0.23.14 → 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;
@@ -275,6 +276,25 @@ export interface EventContactFormElement extends HTMLElement {
275
276
  * fixed pair, not a general-purpose field. Must be set as a JS property to
276
277
  * get false, same as requireDate above. */
277
278
  showFormat?: boolean;
279
+ /** Whether the Event Type / Occasion field is shown at all. Default true.
280
+ * Unlike showFormat, there is no way to make this field optional-but-visible
281
+ * -- it's always been unvalidated (never blocked submit), so the only
282
+ * meaningful states are "shown" and "not shown". When false, payload.eventType
283
+ * is always ''. Must be set as a JS property to get false, same as above. */
284
+ showEventType?: boolean;
285
+ /** Whether the Guests stepper (and, if shown, the Event Format toggle nested
286
+ * inside it) is shown at all. Default true. When false, payload.guests is
287
+ * always minGuests (the stepper never gets a chance to change it) and
288
+ * showFormat has no effect, since its toggle lives inside this block. Must
289
+ * be set as a JS property to get false, same as above. */
290
+ showGuests?: boolean;
291
+ /** Whether the date calendar is shown at all. Default true. Distinct from
292
+ * requireDate, which only controls whether a visible calendar is mandatory
293
+ * -- this removes the field entirely. Forces requireDate's effect off
294
+ * regardless of its own value (a hidden field can't be required), so
295
+ * payload.date is always null when this is false. Must be set as a JS
296
+ * property to get false, same as above. */
297
+ showDate?: boolean;
278
298
  submitNote?: string;
279
299
  /** BCP 47 locale (e.g. "fr-FR") used to format month/weekday names in the
280
300
  * calendar; defaults to the browser's own locale. */
@@ -283,6 +303,95 @@ export interface EventContactFormElement extends HTMLElement {
283
303
  submitInquiry?: (payload: EventInquiryPayload) => Promise<SubmitInquiryResult>;
284
304
  }
285
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
+
286
395
  export interface ReservationCancelPayload {
287
396
  reservationId: string;
288
397
  restaurantSlug?: string;
@@ -1028,6 +1137,7 @@ declare global {
1028
1137
  'menu-section': MenuSectionElement;
1029
1138
  'event-inquiries-feed': EventInquiriesFeedElement;
1030
1139
  'event-contact-form': EventContactFormElement;
1140
+ 'spa-booking-widget': SpaBookingWidgetElement;
1031
1141
  'reservation-cancel': ReservationCancelElement;
1032
1142
  'live-reservations-feed': LiveReservationsFeedElement;
1033
1143
  'live-room-bookings-feed': LiveRoomBookingsFeedElement;
@@ -1056,6 +1166,7 @@ declare global {
1056
1166
  reservationchange: CustomEvent<{ date: string; guests: number; time: string }>;
1057
1167
  'booking-confirmed': CustomEvent<{ date: string; time: string; guests: number }>;
1058
1168
  'inquiry-submitted': CustomEvent<EventInquiryPayload>;
1169
+ 'booking-submitted': CustomEvent<SpaBookingPayload>;
1059
1170
  'cancel-requested': CustomEvent<ReservationCancelPayload>;
1060
1171
  'cancel-confirmed': CustomEvent<{ token: string }>;
1061
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.14",
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",