@fanfare-io/fanfare-sdk-solid 0.2.0 → 0.3.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.
@@ -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;
@@ -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;
@@ -2,7 +2,7 @@ import { DrawDisplayState } from '@fanfare-io/fanfare-sdk-core/internals';
2
2
  import { ReadableAtom } from 'nanostores';
3
3
  import { OutcomeReason } from '../module';
4
4
  export interface DrawModuleProps {
5
- state$?: ReadableAtom<DrawDisplayState>;
5
+ display$?: ReadableAtom<DrawDisplayState>;
6
6
  sequencePhase: "enterable" | "participating" | "settling" | "granted" | "ended";
7
7
  canEnter: boolean;
8
8
  canLeave: boolean;
@@ -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;
@@ -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;
@@ -5,6 +5,7 @@ export interface UpcomingModuleProps {
5
5
  onCountdownComplete?: () => void;
6
6
  canEnter?: boolean;
7
7
  onEnter?: () => void;
8
+ enterLabel?: string;
8
9
  isEntering?: boolean;
9
10
  class?: string;
10
11
  className?: string;
@@ -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,7 +1,7 @@
1
1
  import { FanfareSDK } from '@fanfare-io/fanfare-sdk-core';
2
2
  import { Locale, PartialTranslationMessages, TranslationMessageKey } from '@fanfare-io/fanfare-sdk-i18n';
3
3
  import { JSX } from 'solid-js';
4
- interface FanfareProviderProps {
4
+ export interface FanfareProviderProps {
5
5
  sdk: FanfareSDK;
6
6
  locale?: Locale;
7
7
  translations?: PartialTranslationMessages<TranslationMessageKey>;
@@ -24,4 +24,3 @@ export declare function FanfareProvider(props: FanfareProviderProps): JSX.Elemen
24
24
  * Hook to access Fanfare SDK in SolidJS
25
25
  */
26
26
  export declare function useFanfare(): FanfareSDK;
27
- export {};
@@ -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';
package/dist/index.d.ts CHANGED
@@ -6,13 +6,25 @@
6
6
  * @packageDocumentation
7
7
  */
8
8
  export { FanfareProvider, useFanfare } from './components/provider';
9
- export * from './hooks';
10
- export * from './i18n';
11
- export * from './theme';
12
- export * from './components/auth';
13
- export * from './components/compositions';
14
- export * from './components/module';
15
- export * from './components/primitives';
16
- export * from './components/widgets';
9
+ export type { FanfareProviderProps } from './components/provider';
10
+ export { useExperienceJourney, useFanfareAuth, useJourneySnapshot, useNanostore } from './hooks';
11
+ export { I18nProvider, RTL_LOCALES, isRTLLocale, useTranslations } from './i18n';
12
+ export type { I18nConfig, I18nProviderProps, Locale, PartialTranslationMessages, RTLLocale, TextDirection, TranslateFunction, TranslateOptions, TranslationKey, TranslationMessageKey, TranslationMessages, } from './i18n';
13
+ export { THEME_CSS_VARS, ThemeProvider, buildThemeCssVars } from './theme';
14
+ export type { ResolvedTheme, ThemeCssVar, ThemeProviderProps, WidgetThemeConfig, WidgetVariant } from './theme';
15
+ export { AuthForm, AuthInput, OTPInput } from './components/auth';
16
+ export type { AuthFormProps, AuthInputProps } from './components/auth';
17
+ export { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, buttonVariants, } from './components/primitives';
18
+ export type { ButtonProps } from './components/primitives';
19
+ export { InfoPanel, PanelBody, PanelFooter, PanelHeading, PanelLayout, normalizeOutcomeReason, } from './components/module';
20
+ export type { InfoPanelProps, OutcomeReason, PanelBodyProps, PanelFooterProps, PanelHeadingProps, PanelHeadingVariant, PanelLayoutProps, } from './components/module';
21
+ export { AccessCodeForm, ChallengeGate, EndedModule, ErrorView, GrantedPanel, OutcomePanel, } from './components/compositions';
22
+ export type { AccessCodeFormProps, ChallengeGateProps, EndedModuleProps, ErrorViewProps, GrantedPanelProps, OutcomePanelProps, } from './components/compositions';
23
+ export { ExperienceWidget } from './components/widgets';
24
+ export type { AccessCodeSlotProps, AuthSlotProps, ChallengeSlotProps, EndedSlotProps, EnterableSlotProps, ErrorSlotProps, ExperienceRenderProps, ExperienceWidgetProps, ExperienceWidgetSlots, ExpiredSlotProps, GrantedSlotProps, LoadingSlotProps, ParticipatingSlotProps, SlotProps, StartSlotProps, UpcomingSlotProps, WaitlistSlotProps, } from './components/widgets';
25
+ export { LoadingView, StartView, UpcomingModule, WaitlistView } from './components/widgets';
26
+ export type { LoadingViewProps, StartViewProps, UpcomingModuleProps, WaitlistViewProps } from './components/widgets';
27
+ export { AuctionModule, DrawModule, QueueModule, TimedReleaseModule } from './components/widgets';
28
+ export type { AuctionModuleProps, DrawModuleProps, QueueModuleProps, TimedReleaseModuleProps, } from './components/widgets';
17
29
  export * from './styles';
18
30
  export { registerWebComponents } from './register';