@forgebuild/hotal-ui 0.23.203 → 0.23.205

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
@@ -421,10 +421,32 @@ export interface SpaBookingPayload {
421
421
  email: string;
422
422
  phone: string;
423
423
  notes: string;
424
+ /** The PaymentIntent confirmed on the Details step -- only present when
425
+ * payment is enabled (stripePublishableKey + createPaymentIntent). Verify
426
+ * its status and amount server-side before booking, and refund/cancel it
427
+ * if the booking is then rejected. */
428
+ stripePaymentIntentId?: string;
424
429
  }
425
430
 
426
431
  export type SpaBookingResult = { ok: true } | { ok: false; error?: string };
427
432
 
433
+ /** The slot a spa PaymentIntent is created for -- the host prices it. */
434
+ export interface SpaPaymentIntentRequest {
435
+ treatmentId: string;
436
+ date: string;
437
+ time: string;
438
+ therapistId?: string;
439
+ }
440
+
441
+ export interface SpaPaymentIntentResult {
442
+ clientSecret: string;
443
+ paymentIntentId: string;
444
+ /** The intent's amount (Stripe integer units) and currency, shown as
445
+ * "£X due now" above the card form. Omit either to show no amount. */
446
+ amount?: number;
447
+ currency?: string;
448
+ }
449
+
428
450
  export interface SpaBookingWidgetStrings {
429
451
  chooseServiceLabel: string;
430
452
  loadingServices: string;
@@ -440,6 +462,7 @@ export interface SpaBookingWidgetStrings {
440
462
  therapistFilterLabel: string;
441
463
  anyTherapistLabel: string;
442
464
  staffRowLabel: string;
465
+ bookedAtLabel: string;
443
466
  totalLabel: string;
444
467
  continueLabel: string;
445
468
  changeServiceLabel: string;
@@ -462,6 +485,13 @@ export interface SpaBookingWidgetStrings {
462
485
  memberRateLabel: string;
463
486
  membersOnlyLabel: string;
464
487
  membersOnlyHint: string;
488
+ paymentLabel: string;
489
+ paymentDueLabel: string;
490
+ paymentHint: string;
491
+ paymentUnavailable: string;
492
+ paymentNotReady: string;
493
+ paymentFailed: string;
494
+ confirmPayLabel: string;
465
495
  }
466
496
 
467
497
  export interface SpaBookingWidgetElement extends HTMLElement {
@@ -475,6 +505,9 @@ export interface SpaBookingWidgetElement extends HTMLElement {
475
505
  * a free service (e.g. a consultation call) where showing "£0.00"
476
506
  * throughout would read oddly. */
477
507
  hidePrice?: boolean;
508
+ /** Hides only prices that are exactly 0 (a free service in the list, and
509
+ * its summary/total), leaving every other price visible. */
510
+ hideZeroPrice?: boolean;
478
511
  /** Skips the "Details" (name/email/phone/notes) step -- for editing an
479
512
  * existing booking (a reschedule) rather than collecting a new guest's
480
513
  * contact info. "Continue" on the datetime step submits directly using
@@ -485,9 +518,13 @@ export interface SpaBookingWidgetElement extends HTMLElement {
485
518
  * e.g. `[2]` for a Tuesday closure. Visual hint only -- fetchAvailability
486
519
  * is the real source of truth for what's bookable. */
487
520
  closedWeekdays?: number[];
488
- /** BCP 47 locale (e.g. "fr-FR") used to format month/weekday names;
489
- * defaults to the browser's own locale. */
521
+ /** BCP 47 locale (e.g. "fr-FR") used to format month/weekday names,
522
+ * dates and prices; defaults to the browser's own locale. */
490
523
  locale?: string;
524
+ /** ISO 4217 code (e.g. "EUR") every price is formatted in, using
525
+ * `locale`. Default "GBP". The payment step's "due now" label uses the
526
+ * PaymentIntent's own currency instead. */
527
+ currency?: string;
491
528
  /** Jumps straight to the calendar step, pre-selected to whichever
492
529
  * treatment's name matches this, once treatments have loaded. Re-fires on
493
530
  * every change, even mid-flow on a different service or step. */
@@ -523,6 +560,16 @@ export interface SpaBookingWidgetElement extends HTMLElement {
523
560
  * undefined on "Any therapist" or when fetchTherapists was never provided. */
524
561
  fetchAvailability?: (fromISO: string, toISO: string, treatmentId: string, therapistId?: string) => Promise<SpaAvailabilityDay[]>;
525
562
  submitBooking?: (payload: SpaBookingPayload) => Promise<SpaBookingResult>;
563
+ /** Optional payment: with both this and stripePublishableKey set, the
564
+ * Details step shows a Stripe Payment Element and confirms it before
565
+ * submitBooking (which then gets stripePaymentIntentId). The host's
566
+ * intent decides full charge, deposit, or manual-capture hold. Called
567
+ * on entering Details, and again if the visitor picks a different slot
568
+ * before paying. Unused in skipDetailsStep mode. JS property only. */
569
+ createPaymentIntent?: (req: SpaPaymentIntentRequest) => Promise<SpaPaymentIntentResult>;
570
+ stripePublishableKey?: string;
571
+ /** Stripe Elements `appearance` object. JS property only. */
572
+ stripeAppearance?: Record<string, unknown>;
526
573
  }
527
574
 
528
575
  export interface ReservationCancelPayload {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgebuild/hotal-ui",
3
- "version": "0.23.203",
3
+ "version": "0.23.205",
4
4
  "description": "Reusable Svelte UI components for booking and reservation experiences.",
5
5
  "type": "module",
6
6
  "license": "MIT",