@fanfare-io/fanfare-sdk-react 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
@@ -58,6 +58,14 @@ Customization has four levels of increasing specificity: `theme`, `variant`, `sl
58
58
 
59
59
  `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.
60
60
 
61
+ Mounted inside a shadow root, the widget's styleable elements export CSS parts named after their
62
+ `data-slot`, so a page styles them with `::part()` — `fanfare-host::part(auction-cta)`. The
63
+ attribution footer and every element that contains its "Powered by Fanfare" row are
64
+ deliberately not parts: the widget root and the panel cards that carry that row. The payment
65
+ card field is not a part either. A panel whose footer holds no attribution row keeps its card
66
+ as a part — `auction-module` is one; [`docs/STYLING.md`](./docs/STYLING.md#parts) lists every
67
+ part and every exception.
68
+
61
69
  ## Selection
62
70
 
63
71
  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;
@@ -5,6 +5,7 @@ import * as React from "react";
5
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): React.ReactElement;
@@ -5,9 +5,9 @@ import * as React from "react";
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 type * as React from "react";
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({ methods, name, selectedId, newCardActive, cardEntryAvailable, onSelectSaved, onSelectNew, }: PaymentMethodListProps): React.ReactElement;
@@ -3,8 +3,9 @@ import * as React from "react";
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): React.ReactElement;
@@ -4,6 +4,11 @@ declare const spinnerVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  styleVariant?: "default" | "rounded" | "retro" | "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: React.Context<boolean>;
7
12
  export interface SpinnerProps extends React.SVGAttributes<SVGSVGElement>, Omit<VariantProps<typeof spinnerVariants>, "styleVariant"> {
8
13
  }
9
14
  export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<SVGSVGElement>>;