@resira/ui 0.4.10 → 0.4.12

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.cts CHANGED
@@ -256,6 +256,27 @@ interface DeeplinkGuest {
256
256
  /** Notes. */
257
257
  notes?: string;
258
258
  }
259
+ /** Promoter mode settings for fast, low-bandwidth on-the-spot booking. */
260
+ interface PromoterModeConfig {
261
+ /** Enable promoter optimizations. */
262
+ enabled?: boolean;
263
+ /** Guest contact requirement strategy. @default "phone-required" */
264
+ contactMode?: "email-required" | "phone-required" | "either";
265
+ /** Hide service/resource images to reduce network usage. @default true */
266
+ disableImages?: boolean;
267
+ /** Skip live promo-code validation call until booking submit. @default true */
268
+ disablePromoValidation?: boolean;
269
+ /** Hide promo field entirely for ultra-fast flows. @default false */
270
+ hidePromoInput?: boolean;
271
+ /** Cache TTL for availability/resources/products in milliseconds. @default 300000 */
272
+ cacheTtlMs?: number;
273
+ /** Use stale cached data when network requests fail. @default true */
274
+ useStaleDataOnError?: boolean;
275
+ /** Auto-advance from availability as soon as selection is made. @default true */
276
+ autoAdvanceAvailability?: boolean;
277
+ /** Override step-indicator visibility specifically for promoter mode. @default false */
278
+ showStepIndicator?: boolean;
279
+ }
259
280
  /** Configuration passed to ResiraProvider. */
260
281
  interface ResiraProviderConfig {
261
282
  /** Theme overrides. */
@@ -309,6 +330,8 @@ interface ResiraProviderConfig {
309
330
  }) => void;
310
331
  /** Called when an error occurs during the booking flow. */
311
332
  onError?: (code: string, message: string) => void;
333
+ /** Promoter mode configuration for fast in-person bookings. */
334
+ promoterMode?: PromoterModeConfig;
312
335
  }
313
336
  /** Props for the ResiraProvider component. */
314
337
  interface ResiraProviderProps {
@@ -396,6 +419,8 @@ interface ResiraContextValue {
396
419
  onError?: (code: string, message: string) => void;
397
420
  /** Checkout session token — when provided, the widget skips to checkout. */
398
421
  checkoutSessionToken?: string;
422
+ /** Resolved promoter-mode behavior flags. */
423
+ promoterMode: Required<PromoterModeConfig>;
399
424
  }
400
425
  /** Steps in the booking flow. */
401
426
  type BookingStep = "resource" | "availability" | "details" | "terms" | "payment" | "confirmation" | "checkout";
@@ -545,7 +570,7 @@ declare function validateGuestForm(values: GuestFormValues, labels: {
545
570
  required: string;
546
571
  invalidEmail: string;
547
572
  contactRequired?: string;
548
- }, contactMode?: "email-required" | "either"): GuestFormErrors;
573
+ }, contactMode?: "email-required" | "phone-required" | "either"): GuestFormErrors;
549
574
  interface GuestFormProps {
550
575
  values: GuestFormValues;
551
576
  onChange: (values: GuestFormValues) => void;
@@ -562,8 +587,10 @@ interface WaiverConsentProps {
562
587
  onDiscountCodeChange: (code: string) => void;
563
588
  onPromoValidated?: (result: ValidatePromoCodeResponse) => void;
564
589
  error?: string;
590
+ disablePromoValidation?: boolean;
591
+ hidePromoInput?: boolean;
565
592
  }
566
- declare function WaiverConsent({ termsAccepted, onTermsChange, waiverAccepted, onWaiverChange, discountCode, onDiscountCodeChange, onPromoValidated, error, }: WaiverConsentProps): react_jsx_runtime.JSX.Element;
593
+ declare function WaiverConsent({ termsAccepted, onTermsChange, waiverAccepted, onWaiverChange, discountCode, onDiscountCodeChange, onPromoValidated, error, disablePromoValidation, hidePromoInput, }: WaiverConsentProps): react_jsx_runtime.JSX.Element;
567
594
 
568
595
  interface PaymentFormProps {
569
596
  /** Stripe client secret from the payment intent. */
@@ -942,4 +969,4 @@ declare function TagIcon({ size, className }: IconProps): react_jsx_runtime.JSX.
942
969
  declare function CubeIcon({ size, className }: IconProps): react_jsx_runtime.JSX.Element;
943
970
  declare function ViewfinderIcon({ size, className }: IconProps): react_jsx_runtime.JSX.Element;
944
971
 
945
- export { AlertCircleIcon, BookingCalendar, BookingModal, type BookingSelection, type BookingStep, CalendarIcon, CheckCircleIcon, CheckIcon, type CheckoutSessionErrorCode, ChevronLeftIcon, ChevronRightIcon, ClockIcon, ConfirmationView, CreditCardIcon, CubeIcon, DEFAULT_LOCALE, DEFAULT_THEME, type DeeplinkGuest, type DeeplinkSelection, DishShowcase, type DishShowcaseProps, type DomainConfig, GuestForm, type GuestFormErrors, type GuestFormValues, LockIcon, MailIcon, MinusIcon, NoteIcon, PaymentForm, PhoneIcon, PlusIcon, ProductSelector, ResiraBookingWidget, type ResiraClassNames, type ResiraContextValue, type ResiraDomain, type ResiraLocale, ResiraProvider, type ResiraProviderConfig, type ResiraProviderProps, type ResiraTheme, ResourcePicker, type Service, type ServiceLayout, type ServiceOption, ShieldIcon, SummaryPreview, TagIcon, TimeSlotPicker, type UseServicesReturn, UserIcon, UsersIcon, ViewfinderIcon, WaiverConsent, XIcon, fetchServices, resolveTheme, themeToCSS, useAvailability, useCheckoutSession, useDish, useDishes, usePaymentIntent, useProducts, useReservation, useResira, useResources, useServices, validateGuestForm };
972
+ export { AlertCircleIcon, BookingCalendar, BookingModal, type BookingSelection, type BookingStep, CalendarIcon, CheckCircleIcon, CheckIcon, type CheckoutSessionErrorCode, ChevronLeftIcon, ChevronRightIcon, ClockIcon, ConfirmationView, CreditCardIcon, CubeIcon, DEFAULT_LOCALE, DEFAULT_THEME, type DeeplinkGuest, type DeeplinkSelection, DishShowcase, type DishShowcaseProps, type DomainConfig, GuestForm, type GuestFormErrors, type GuestFormValues, LockIcon, MailIcon, MinusIcon, NoteIcon, PaymentForm, PhoneIcon, PlusIcon, ProductSelector, type PromoterModeConfig, ResiraBookingWidget, type ResiraClassNames, type ResiraContextValue, type ResiraDomain, type ResiraLocale, ResiraProvider, type ResiraProviderConfig, type ResiraProviderProps, type ResiraTheme, ResourcePicker, type Service, type ServiceLayout, type ServiceOption, ShieldIcon, SummaryPreview, TagIcon, TimeSlotPicker, type UseServicesReturn, UserIcon, UsersIcon, ViewfinderIcon, WaiverConsent, XIcon, fetchServices, resolveTheme, themeToCSS, useAvailability, useCheckoutSession, useDish, useDishes, usePaymentIntent, useProducts, useReservation, useResira, useResources, useServices, validateGuestForm };
package/dist/index.d.ts CHANGED
@@ -256,6 +256,27 @@ interface DeeplinkGuest {
256
256
  /** Notes. */
257
257
  notes?: string;
258
258
  }
259
+ /** Promoter mode settings for fast, low-bandwidth on-the-spot booking. */
260
+ interface PromoterModeConfig {
261
+ /** Enable promoter optimizations. */
262
+ enabled?: boolean;
263
+ /** Guest contact requirement strategy. @default "phone-required" */
264
+ contactMode?: "email-required" | "phone-required" | "either";
265
+ /** Hide service/resource images to reduce network usage. @default true */
266
+ disableImages?: boolean;
267
+ /** Skip live promo-code validation call until booking submit. @default true */
268
+ disablePromoValidation?: boolean;
269
+ /** Hide promo field entirely for ultra-fast flows. @default false */
270
+ hidePromoInput?: boolean;
271
+ /** Cache TTL for availability/resources/products in milliseconds. @default 300000 */
272
+ cacheTtlMs?: number;
273
+ /** Use stale cached data when network requests fail. @default true */
274
+ useStaleDataOnError?: boolean;
275
+ /** Auto-advance from availability as soon as selection is made. @default true */
276
+ autoAdvanceAvailability?: boolean;
277
+ /** Override step-indicator visibility specifically for promoter mode. @default false */
278
+ showStepIndicator?: boolean;
279
+ }
259
280
  /** Configuration passed to ResiraProvider. */
260
281
  interface ResiraProviderConfig {
261
282
  /** Theme overrides. */
@@ -309,6 +330,8 @@ interface ResiraProviderConfig {
309
330
  }) => void;
310
331
  /** Called when an error occurs during the booking flow. */
311
332
  onError?: (code: string, message: string) => void;
333
+ /** Promoter mode configuration for fast in-person bookings. */
334
+ promoterMode?: PromoterModeConfig;
312
335
  }
313
336
  /** Props for the ResiraProvider component. */
314
337
  interface ResiraProviderProps {
@@ -396,6 +419,8 @@ interface ResiraContextValue {
396
419
  onError?: (code: string, message: string) => void;
397
420
  /** Checkout session token — when provided, the widget skips to checkout. */
398
421
  checkoutSessionToken?: string;
422
+ /** Resolved promoter-mode behavior flags. */
423
+ promoterMode: Required<PromoterModeConfig>;
399
424
  }
400
425
  /** Steps in the booking flow. */
401
426
  type BookingStep = "resource" | "availability" | "details" | "terms" | "payment" | "confirmation" | "checkout";
@@ -545,7 +570,7 @@ declare function validateGuestForm(values: GuestFormValues, labels: {
545
570
  required: string;
546
571
  invalidEmail: string;
547
572
  contactRequired?: string;
548
- }, contactMode?: "email-required" | "either"): GuestFormErrors;
573
+ }, contactMode?: "email-required" | "phone-required" | "either"): GuestFormErrors;
549
574
  interface GuestFormProps {
550
575
  values: GuestFormValues;
551
576
  onChange: (values: GuestFormValues) => void;
@@ -562,8 +587,10 @@ interface WaiverConsentProps {
562
587
  onDiscountCodeChange: (code: string) => void;
563
588
  onPromoValidated?: (result: ValidatePromoCodeResponse) => void;
564
589
  error?: string;
590
+ disablePromoValidation?: boolean;
591
+ hidePromoInput?: boolean;
565
592
  }
566
- declare function WaiverConsent({ termsAccepted, onTermsChange, waiverAccepted, onWaiverChange, discountCode, onDiscountCodeChange, onPromoValidated, error, }: WaiverConsentProps): react_jsx_runtime.JSX.Element;
593
+ declare function WaiverConsent({ termsAccepted, onTermsChange, waiverAccepted, onWaiverChange, discountCode, onDiscountCodeChange, onPromoValidated, error, disablePromoValidation, hidePromoInput, }: WaiverConsentProps): react_jsx_runtime.JSX.Element;
567
594
 
568
595
  interface PaymentFormProps {
569
596
  /** Stripe client secret from the payment intent. */
@@ -942,4 +969,4 @@ declare function TagIcon({ size, className }: IconProps): react_jsx_runtime.JSX.
942
969
  declare function CubeIcon({ size, className }: IconProps): react_jsx_runtime.JSX.Element;
943
970
  declare function ViewfinderIcon({ size, className }: IconProps): react_jsx_runtime.JSX.Element;
944
971
 
945
- export { AlertCircleIcon, BookingCalendar, BookingModal, type BookingSelection, type BookingStep, CalendarIcon, CheckCircleIcon, CheckIcon, type CheckoutSessionErrorCode, ChevronLeftIcon, ChevronRightIcon, ClockIcon, ConfirmationView, CreditCardIcon, CubeIcon, DEFAULT_LOCALE, DEFAULT_THEME, type DeeplinkGuest, type DeeplinkSelection, DishShowcase, type DishShowcaseProps, type DomainConfig, GuestForm, type GuestFormErrors, type GuestFormValues, LockIcon, MailIcon, MinusIcon, NoteIcon, PaymentForm, PhoneIcon, PlusIcon, ProductSelector, ResiraBookingWidget, type ResiraClassNames, type ResiraContextValue, type ResiraDomain, type ResiraLocale, ResiraProvider, type ResiraProviderConfig, type ResiraProviderProps, type ResiraTheme, ResourcePicker, type Service, type ServiceLayout, type ServiceOption, ShieldIcon, SummaryPreview, TagIcon, TimeSlotPicker, type UseServicesReturn, UserIcon, UsersIcon, ViewfinderIcon, WaiverConsent, XIcon, fetchServices, resolveTheme, themeToCSS, useAvailability, useCheckoutSession, useDish, useDishes, usePaymentIntent, useProducts, useReservation, useResira, useResources, useServices, validateGuestForm };
972
+ export { AlertCircleIcon, BookingCalendar, BookingModal, type BookingSelection, type BookingStep, CalendarIcon, CheckCircleIcon, CheckIcon, type CheckoutSessionErrorCode, ChevronLeftIcon, ChevronRightIcon, ClockIcon, ConfirmationView, CreditCardIcon, CubeIcon, DEFAULT_LOCALE, DEFAULT_THEME, type DeeplinkGuest, type DeeplinkSelection, DishShowcase, type DishShowcaseProps, type DomainConfig, GuestForm, type GuestFormErrors, type GuestFormValues, LockIcon, MailIcon, MinusIcon, NoteIcon, PaymentForm, PhoneIcon, PlusIcon, ProductSelector, type PromoterModeConfig, ResiraBookingWidget, type ResiraClassNames, type ResiraContextValue, type ResiraDomain, type ResiraLocale, ResiraProvider, type ResiraProviderConfig, type ResiraProviderProps, type ResiraTheme, ResourcePicker, type Service, type ServiceLayout, type ServiceOption, ShieldIcon, SummaryPreview, TagIcon, TimeSlotPicker, type UseServicesReturn, UserIcon, UsersIcon, ViewfinderIcon, WaiverConsent, XIcon, fetchServices, resolveTheme, themeToCSS, useAvailability, useCheckoutSession, useDish, useDishes, usePaymentIntent, useProducts, useReservation, useResira, useResources, useServices, validateGuestForm };