@bunnyapp/components 2.0.0-beta.1 → 2.0.0-beta.2

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.
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof Checkout>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
+ export declare const Preview: Story;
7
8
  export declare const DisabledFields: Story;
8
9
  export declare const WithDocumentTemplate: Story;
9
10
  export declare const StoredPaymentMethod: Story;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * "Pay $50.00" with the amount due (or "Start trial" on a trial, "Complete order" when nothing is due), with the authorization text
3
3
  * under it. Disabled only until the amount due first resolves and while a recalculation (e.g. taxes)
4
- * is in flight; an incomplete form stays submittable so that submitting shows what is missing.
4
+ * is in flight; an incomplete form stays submittable so that submitting shows what is missing. Always disabled in a
5
+ * preview.
5
6
  */
6
7
  export default function PayButton({ isProcessing }: {
7
8
  isProcessing: boolean;
@@ -21,8 +21,10 @@ export type CheckoutFlowProps = {
21
21
  defaultCouponCode?: string;
22
22
  /** Callbacks fired at key lifecycle events */
23
23
  callbacks?: CheckoutCallbacks;
24
+ /** Renders the flow with pricing and fields working but never submits it, e.g. to preview it inside an admin screen */
25
+ preview?: boolean;
24
26
  };
25
27
  /** The providers both flows mount, in one order: config, form instance, result, then the appearance. */
26
- export default function CheckoutRoot({ priceListCode, enableTrial, form, defaultCouponCode, callbacks, appearance, children, }: Omit<CheckoutFlowProps, 'style'> & {
28
+ export default function CheckoutRoot({ priceListCode, enableTrial, form, defaultCouponCode, callbacks, appearance, preview, children, }: Omit<CheckoutFlowProps, 'style'> & {
27
29
  children: ReactNode;
28
30
  }): import("react").JSX.Element;
@@ -62,6 +62,8 @@ export type CheckoutConfig = {
62
62
  defaultCouponCode: string | undefined;
63
63
  form: CheckoutFormOptions;
64
64
  callbacks: CheckoutCallbacks;
65
+ /** The flow renders but never submits. */
66
+ preview: boolean;
65
67
  };
66
68
  export declare const CheckoutConfigProvider: ({ value, children }: {
67
69
  value: CheckoutConfig;
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof Signup>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
+ export declare const Preview: Story;
7
8
  export declare const DisabledFields: Story;
8
9
  export declare const Mobile: Story;
9
10
  export declare const Ledger: Story;