@fanfare-io/fanfare-sdk-solid 0.22.0 → 0.23.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.
package/README.md CHANGED
@@ -44,6 +44,14 @@ Solid applications can use `FanfareProvider`, `ExperienceWidget`, and `useExperi
44
44
 
45
45
  `slots` override targeted states while keeping the default widget flow. `children` receives `{ journey, view, snapshot, error, start, isStarting }` when you want to render the full state yourself. Solid `ExperienceWidget` accepts both `class` and `className`.
46
46
 
47
+ Mounted inside a shadow root, the widget's styleable elements export CSS parts named after their
48
+ `data-slot`, so a page styles them with `::part()` — `fanfare-host::part(auction-cta)`. The
49
+ attribution footer and every element that contains its "Powered by Fanfare" row are
50
+ deliberately not parts: the widget root and the panel cards that carry that row. The payment
51
+ card field is not a part either. A panel whose footer holds no attribution row keeps its card
52
+ as a part — `auction-module` is one; [`docs/STYLING.md`](./docs/STYLING.md#parts) lists every
53
+ part and every exception.
54
+
47
55
  ## Selection
48
56
 
49
57
  Some experiences capture which product and variant a consumer gets. `ExperienceWidget` renders that
@@ -0,0 +1,2 @@
1
+ /** The consumer-facing name of a wire card brand (`visa` → `Visa`, `cartes_bancaires` → `Cartes Bancaires`). */
2
+ export declare function cardBrandName(brand: string): string;
@@ -1,10 +1,11 @@
1
1
  import { JSX } from 'solid-js';
2
2
  import { CheckoutProcessingSlotProps } from '../widgets/experience-widget';
3
3
  /**
4
- * Default processing panel shown for the gap between a submitted reservation checkout and the
5
- * server's confirmation.
4
+ * Default processing panel shown for the gap between a submitted checkout and the server's
5
+ * confirmation.
6
6
  *
7
7
  * The consumer must not navigate away while the payment settles, so the wait is announced rather
8
- * than shown only as motion.
8
+ * than shown only as motion. It reads as the same callout the payment panel shows while a bank
9
+ * confirmation resumes, so the two waits on one payment look like one wait.
9
10
  */
10
11
  export declare function CheckoutProcessingPanel(_props: CheckoutProcessingSlotProps): JSX.Element;
@@ -5,9 +5,9 @@ import { PaymentCollectionSlotProps } from '../widgets/experience-widget';
5
5
  *
6
6
  * The hold amount is rendered from the view's own figure — the client never derives one.
7
7
  *
8
- * The configuration block reaches this panel on the entry mount only. A retry is offered from an
9
- * ended view, which carries none, so that mount renders payment as unavailable and a consumer with
10
- * a saved method submits without needing Stripe.js at all.
8
+ * An absent configuration block means its read failed. A saved method pays without Stripe.js, so
9
+ * with one the outage narrows to the new-card choice; with none, re-reading the configuration is
10
+ * the panel's only way forward.
11
11
  *
12
12
  * Entry has no server-side resume: a paused authorization is carried forward by submitting the
13
13
  * identical payment input again, held here from the first submit, so exactly one payment method is
@@ -0,0 +1,18 @@
1
+ import { PaymentMethodSummary } from '@fanfare-io/fanfare-sdk-core/experiences';
2
+ import { JSX } from 'solid-js';
3
+ export interface PaymentMethodListProps {
4
+ methods: PaymentMethodSummary[];
5
+ /** Unique per panel: radios sharing a name form one group across the whole document. */
6
+ name: string;
7
+ selectedId: string | undefined;
8
+ newCardActive: boolean;
9
+ /** Offer the new-card row; absent when no card entry can be mounted. */
10
+ cardEntryAvailable: boolean;
11
+ onSelectSaved: (id: string) => void;
12
+ onSelectNew: () => void;
13
+ }
14
+ /**
15
+ * Saved payment methods and the new-card choice, as one radio group of selector rows. The row look
16
+ * lives in the theme stylesheet, keyed on `payment-method-row`.
17
+ */
18
+ export declare function PaymentMethodList(props: PaymentMethodListProps): JSX.Element;
@@ -3,8 +3,9 @@ import { ReceiptSlotProps } from '../widgets/experience-widget';
3
3
  /**
4
4
  * Default panel for a completed Fanfare-managed payment.
5
5
  *
6
- * The order reference is the outcome. An admission credential appears only on the arm that carries
7
- * one, and stays subordinate to the purchase: payment is terminal, so a receipt must never read as
8
- * the thing that admits its holder.
6
+ * The purchase is the outcome: the panel is labelled as one and leads with what was paid, and the
7
+ * order reference follows. An admission credential appears only on the arm that carries one, and
8
+ * stays subordinate to the purchase: payment is terminal, so a receipt must never read as the thing
9
+ * that admits its holder.
9
10
  */
10
11
  export declare function ReceiptPanel(props: ReceiptSlotProps): JSX.Element;
@@ -4,6 +4,11 @@ declare const spinnerVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  styleVariant?: "default" | "retro" | "rounded" | "clean" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ /**
8
+ * Whether `Spinner` and `Button` export their CSS `part` names. A subtree a page must never style
9
+ * from outside — the payment field — renders with it off.
10
+ */
11
+ export declare const ExportPartsContext: import('solid-js').Context<boolean>;
7
12
  export interface SpinnerProps extends JSX.SvgSVGAttributes<SVGSVGElement>, Omit<VariantProps<typeof spinnerVariants>, "styleVariant"> {
8
13
  className?: string;
9
14
  }