@fanfare-io/fanfare-sdk-react 0.2.0 → 0.4.0

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.
@@ -10,18 +10,22 @@
10
10
  * already-normalized UI value) to a member of the union. Unknown values
11
11
  * fall back to `"ended"`.
12
12
  *
13
- * journey machine code -> UI outcome reason
13
+ * journey machine code -> UI outcome reason
14
14
  * ----------------------------------------------
15
- * expired -> expired
16
- * queue_denied -> not_selected
17
- * draw_denied -> not_selected
18
- * timed_release_denied -> sold_out
19
- * already_completed -> ended
20
- * closed -> ended
21
- * unknown / other -> ended
15
+ * expired -> expired
16
+ * queue_denied / draw_denied / denied / lost -> not_selected
17
+ * timed_release_denied -> sold_out
18
+ * outbid -> outbid
19
+ * reserve_not_met -> reserve_not_met
20
+ * completed / already_completed -> completed (a success terminal, not a loss)
21
+ * closed / unknown / other -> ended
22
+ *
23
+ * The terminal projection carries the outcome TYPE (completed/denied/lost);
24
+ * mapping it here makes a paying winner, a denied entrant, and a plain loss
25
+ * render distinct copy rather than collapsing to the generic "ended" panel.
22
26
  *
23
27
  * Static story lanes pass UI values directly (e.g. `"outbid"`); those
24
28
  * pass through unchanged.
25
29
  */
26
- export type OutcomeReason = "expired" | "not_selected" | "sold_out" | "outbid" | "reserve_not_met" | "ended";
30
+ export type OutcomeReason = "expired" | "not_selected" | "sold_out" | "outbid" | "reserve_not_met" | "completed" | "ended";
27
31
  export declare function normalizeOutcomeReason(reason: string | undefined): OutcomeReason;
@@ -1,6 +1,6 @@
1
1
  import { BotMitigationState, RoutingChallenge } from '@fanfare-io/fanfare-sdk-core/challenges';
2
2
  import { JourneyHandle, JourneySnapshot, JourneyView, SequenceView } from '@fanfare-io/fanfare-sdk-core/experiences';
3
- import { BrandTheme } from '../../theme';
3
+ import { BrandTheme, WidgetVariant } from '../../theme';
4
4
  import { AuthInputMode } from '../auth/auth-input';
5
5
  import * as React from "react";
6
6
  type ParticipationType = "queue" | "draw" | "auction" | "timed_release" | "appointment";
@@ -118,7 +118,7 @@ export interface ExperienceWidgetProps {
118
118
  /** Theme customization */
119
119
  theme?: BrandTheme;
120
120
  /** Widget variant (overrides theme.variant if provided) */
121
- variant?: "default" | "retro" | "rounded" | "clean";
121
+ variant?: WidgetVariant;
122
122
  /** Slots for targeted overrides */
123
123
  slots?: ExperienceWidgetSlots;
124
124
  /** Render prop for full control (ignores slots if provided) */
@@ -3,7 +3,7 @@ import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../../module';
4
4
  export interface AppointmentModuleProps {
5
5
  appointmentId: string;
6
- state$?: ReadableAtom<AppointmentDisplayState>;
6
+ display$?: ReadableAtom<AppointmentDisplayState>;
7
7
  sequencePhase: "enterable" | "participating" | "ended";
8
8
  bookingWindowOpenAt?: string;
9
9
  bookingWindowCloseAt?: string;
@@ -22,7 +22,7 @@ export interface AppointmentModuleProps {
22
22
  isReentering?: boolean;
23
23
  className?: string;
24
24
  }
25
- export declare function AppointmentModule({ appointmentId, state$, sequencePhase, bookingWindowOpenAt, bookingWindowCloseAt, timezone, defaultLocationId, onBook, onCancel, onReschedule, isBooking, isCancelling, isRescheduling, bookError, cancelError, outcomeReason, onReenter, isReentering, className, }: AppointmentModuleProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function AppointmentModule({ appointmentId, display$, sequencePhase, bookingWindowOpenAt, bookingWindowCloseAt, timezone, defaultLocationId, onBook, onCancel, onReschedule, isBooking, isCancelling, isRescheduling, bookError, cancelError, outcomeReason, onReenter, isReentering, className, }: AppointmentModuleProps): import("react/jsx-runtime").JSX.Element;
26
26
  export declare namespace AppointmentModule {
27
27
  var displayName: string;
28
28
  }
@@ -2,7 +2,7 @@ import { AuctionDisplayState } from '@fanfare-io/fanfare-sdk-core/internals';
2
2
  import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../../module';
4
4
  export interface AuctionModuleProps {
5
- state$?: ReadableAtom<AuctionDisplayState>;
5
+ display$?: ReadableAtom<AuctionDisplayState>;
6
6
  fallbackState?: AuctionDisplayState;
7
7
  sequencePhase: "enterable" | "participating" | "settling" | "granted" | "ended";
8
8
  canEnter: boolean;
@@ -27,7 +27,7 @@ export interface AuctionModuleProps {
27
27
  isReentering?: boolean;
28
28
  className?: string;
29
29
  }
30
- export declare function AuctionModule({ state$, fallbackState, sequencePhase, canEnter, canLeave, onEnter, onLeave, onBid, isEntering, isLeaving, countdownTo, defaultBidAmount, currencyCode, locale, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: AuctionModuleProps): import("react/jsx-runtime").JSX.Element | null;
30
+ export declare function AuctionModule({ display$, fallbackState, sequencePhase, canEnter, canLeave, onEnter, onLeave, onBid, isEntering, isLeaving, countdownTo, defaultBidAmount, currencyCode, locale, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: AuctionModuleProps): import("react/jsx-runtime").JSX.Element | null;
31
31
  export declare namespace AuctionModule {
32
32
  var displayName: string;
33
33
  }
@@ -3,7 +3,7 @@ import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../../module';
4
4
  export interface DrawModuleProps {
5
5
  /** Reactive display state atom from the journey */
6
- state$?: ReadableAtom<DrawDisplayState>;
6
+ display$?: ReadableAtom<DrawDisplayState>;
7
7
  /** Current sequence phase */
8
8
  sequencePhase: "enterable" | "participating" | "settling" | "granted" | "ended";
9
9
  /** Whether user can enter (active only) */
@@ -37,7 +37,7 @@ export interface DrawModuleProps {
37
37
  /** Additional class name */
38
38
  className?: string;
39
39
  }
40
- export declare function DrawModule({ state$, sequencePhase, canEnter, canLeave, onEnter, onLeave, isEntering, isLeaving, countdownTo, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: DrawModuleProps): import("react/jsx-runtime").JSX.Element | null;
40
+ export declare function DrawModule({ display$, sequencePhase, canEnter, canLeave, onEnter, onLeave, isEntering, isLeaving, countdownTo, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: DrawModuleProps): import("react/jsx-runtime").JSX.Element | null;
41
41
  export declare namespace DrawModule {
42
42
  var displayName: string;
43
43
  }
@@ -2,7 +2,7 @@ import { QueueDisplayState } from '@fanfare-io/fanfare-sdk-core/internals';
2
2
  import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../../module';
4
4
  export interface QueueModuleProps {
5
- state$?: ReadableAtom<QueueDisplayState>;
5
+ display$?: ReadableAtom<QueueDisplayState>;
6
6
  sequencePhase: "enterable" | "participating" | "granted" | "ended";
7
7
  canEnter: boolean;
8
8
  canLeave: boolean;
@@ -21,7 +21,7 @@ export interface QueueModuleProps {
21
21
  isReentering?: boolean;
22
22
  className?: string;
23
23
  }
24
- export declare function QueueModule({ state$, sequencePhase, canEnter, canLeave, onEnter, onLeave, isEntering, isLeaving, closeAt, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: QueueModuleProps): import("react/jsx-runtime").JSX.Element | null;
24
+ export declare function QueueModule({ display$, sequencePhase, canEnter, canLeave, onEnter, onLeave, isEntering, isLeaving, closeAt, grant: _grant, expiresAt, checkoutUrl, onCheckoutClick, outcomeReason, onReenter, isReentering, className, }: QueueModuleProps): import("react/jsx-runtime").JSX.Element | null;
25
25
  export declare namespace QueueModule {
26
26
  var displayName: string;
27
27
  }
@@ -2,7 +2,7 @@ import { TimedReleaseDisplayState } from '@fanfare-io/fanfare-sdk-core/internals
2
2
  import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../../module';
4
4
  export interface TimedReleaseModuleProps {
5
- state$?: ReadableAtom<TimedReleaseDisplayState>;
5
+ display$?: ReadableAtom<TimedReleaseDisplayState>;
6
6
  sequencePhase: "enterable" | "participating" | "granted" | "ended";
7
7
  canEnter: boolean;
8
8
  canLeave: boolean;
@@ -21,7 +21,7 @@ export interface TimedReleaseModuleProps {
21
21
  isReentering?: boolean;
22
22
  className?: string;
23
23
  }
24
- export declare function TimedReleaseModule({ state$, sequencePhase, canEnter, canLeave, onEnter, onLeave, onComplete, isEntering, isLeaving, countdownTo, checkoutUrl, onCheckoutClick, grant: _grant, expiresAt, outcomeReason, onReenter, isReentering, className, }: TimedReleaseModuleProps): import("react/jsx-runtime").JSX.Element | null;
24
+ export declare function TimedReleaseModule({ display$, sequencePhase, canEnter, canLeave, onEnter, onLeave, onComplete, isEntering, isLeaving, countdownTo, checkoutUrl, onCheckoutClick, grant: _grant, expiresAt, outcomeReason, onReenter, isReentering, className, }: TimedReleaseModuleProps): import("react/jsx-runtime").JSX.Element | null;
25
25
  export declare namespace TimedReleaseModule {
26
26
  var displayName: string;
27
27
  }
@@ -18,12 +18,14 @@ export interface UpcomingModuleProps {
18
18
  canEnter?: boolean;
19
19
  /** Called when user enters */
20
20
  onEnter?: () => void;
21
+ /** Entry button label override */
22
+ enterLabel?: string;
21
23
  /** Whether entry is in progress */
22
24
  isEntering?: boolean;
23
25
  /** Additional class name */
24
26
  className?: string;
25
27
  }
26
- export declare function UpcomingModule({ title, description, startsAt, onCountdownComplete, canEnter, onEnter, isEntering, className, }: UpcomingModuleProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function UpcomingModule({ title, description, startsAt, onCountdownComplete, canEnter, onEnter, enterLabel, isEntering, className, }: UpcomingModuleProps): import("react/jsx-runtime").JSX.Element;
27
29
  export declare namespace UpcomingModule {
28
30
  var displayName: string;
29
31
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * UpgradeOffer
3
+ *
4
+ * Rough-and-ready affordance shown in the routed state when a higher-priority
5
+ * sequence is available behind an access-code gate. Renders an unobtrusive link
6
+ * that reveals an input; submitting attempts the upgrade via
7
+ * `RoutedView.submitAccessCode`. Routing is monotonic for the consumer: a wrong
8
+ * code leaves them in their current sequence.
9
+ *
10
+ * Controlled: open/invalid/submitting are owned by the widget so the panel
11
+ * survives the brief `routing` transition a reroute passes through (otherwise
12
+ * the affordance unmounts mid-attempt and loses its state).
13
+ */
14
+ export interface UpgradeOfferProps {
15
+ open: boolean;
16
+ invalid: boolean;
17
+ submitting: boolean;
18
+ onOpen: () => void;
19
+ onClose: () => void;
20
+ onSubmit: (accessCode: string) => void;
21
+ }
22
+ export declare function UpgradeOffer({ open, invalid, submitting, onOpen, onClose, onSubmit }: UpgradeOfferProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare namespace UpgradeOffer {
24
+ var displayName: string;
25
+ }
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Waitlist Widget Internal Components
3
3
  *
4
- * Building blocks for the WaitlistWidget.
4
+ * Waitlist confirmation is rendered by the shared internal WaitlistView.
5
5
  */
6
- export { WaitlistActions, type WaitlistActionsProps, type WaitlistStatus } from './waitlist-actions';