@getruba/checkout 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.
@@ -0,0 +1,95 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { s as schemas } from '../index.d-DvLuMU7T.cjs';
3
+ import { A } from './config-oYrbe6vX.js';
4
+ import { Appearance, Stripe, StripeElements } from '@stripe/stripe-js';
5
+ import { UseFormReturn } from 'react-hook-form';
6
+ import { ProductCheckoutPublic } from '../guards.cjs';
7
+ import 'openapi-fetch';
8
+
9
+ interface ThemingPresetProps {
10
+ stripe: Appearance;
11
+ }
12
+
13
+ interface CheckoutFormProps {
14
+ form: UseFormReturn<schemas['CheckoutUpdatePublic']>;
15
+ checkout: schemas['CheckoutPublic'];
16
+ update: (data: schemas['CheckoutUpdatePublic']) => Promise<schemas['CheckoutPublic']>;
17
+ confirm: (data: schemas['CheckoutConfirmStripe'], stripe: Stripe | null, elements: StripeElements | null) => Promise<schemas['CheckoutPublicConfirmed']>;
18
+ loading: boolean;
19
+ loadingLabel: string | undefined;
20
+ disabled?: boolean;
21
+ isUpdatePending?: boolean;
22
+ theme?: 'light' | 'dark';
23
+ themePreset: ThemingPresetProps;
24
+ locale?: A;
25
+ beforeSubmit?: React.ReactNode;
26
+ }
27
+ declare const CheckoutForm: (props: CheckoutFormProps) => react_jsx_runtime.JSX.Element;
28
+
29
+ interface CheckoutHeroPriceProps {
30
+ checkout: ProductCheckoutPublic;
31
+ locale?: A;
32
+ }
33
+ declare const CheckoutHeroPrice: ({ checkout, locale }: CheckoutHeroPriceProps) => react_jsx_runtime.JSX.Element;
34
+
35
+ interface CheckoutPricingProps {
36
+ checkout: ProductCheckoutPublic;
37
+ layout?: 'default' | 'stacked';
38
+ locale?: A;
39
+ }
40
+ declare const CheckoutPricing: ({ checkout, layout, locale, }: CheckoutPricingProps) => react_jsx_runtime.JSX.Element;
41
+
42
+ interface CheckoutPricingBreakdownProps {
43
+ checkout: schemas['CheckoutPublic'];
44
+ locale?: A;
45
+ }
46
+ declare const CheckoutPricingBreakdown: ({ checkout, locale, }: CheckoutPricingBreakdownProps) => react_jsx_runtime.JSX.Element | null;
47
+
48
+ interface CheckoutProductSwitcherItemPriceProps {
49
+ isSelected: boolean;
50
+ product: ProductCheckoutPublic['product'];
51
+ price: schemas['ProductPrice'] | schemas['LegacyRecurringProductPrice'];
52
+ checkout: ProductCheckoutPublic;
53
+ locale?: A;
54
+ }
55
+ declare const CheckoutProductSwitcherItemPrice: ({ isSelected, product, price, checkout, locale, }: CheckoutProductSwitcherItemPriceProps) => react_jsx_runtime.JSX.Element;
56
+ interface CheckoutProductSwitcherProps {
57
+ checkout: ProductCheckoutPublic;
58
+ update?: (data: schemas['CheckoutUpdatePublic']) => Promise<ProductCheckoutPublic>;
59
+ disabled?: boolean;
60
+ themePreset: ThemingPresetProps;
61
+ locale?: A;
62
+ }
63
+ declare const CheckoutProductSwitcher: ({ checkout, update, locale, }: CheckoutProductSwitcherProps) => react_jsx_runtime.JSX.Element | null;
64
+
65
+ interface CheckoutPWYWFormProps {
66
+ update: (data: schemas['CheckoutUpdatePublic']) => void;
67
+ checkout: schemas['CheckoutPublic'];
68
+ productPrice: schemas['ProductPriceCustom'];
69
+ locale?: A;
70
+ }
71
+ declare const CheckoutPWYWForm: ({ update, checkout, productPrice, locale, }: CheckoutPWYWFormProps) => react_jsx_runtime.JSX.Element;
72
+
73
+ interface CheckoutSeatSelectorProps {
74
+ checkout: ProductCheckoutPublic;
75
+ update: (data: schemas['CheckoutUpdatePublic']) => Promise<schemas['CheckoutPublic']>;
76
+ locale?: A;
77
+ compact?: boolean;
78
+ }
79
+ declare const CheckoutSeatSelector: ({ checkout, update, locale, compact, }: CheckoutSeatSelectorProps) => react_jsx_runtime.JSX.Element | null;
80
+
81
+ interface MeteredPricesDisplayProps {
82
+ checkout: ProductCheckoutPublic;
83
+ locale?: A;
84
+ }
85
+ declare const MeteredPricesDisplay: ({ checkout, locale, }: MeteredPricesDisplayProps) => react_jsx_runtime.JSX.Element | null;
86
+
87
+ interface ProductPriceLabelProps {
88
+ product: schemas['CheckoutProduct'];
89
+ price: schemas['ProductPrice'] | schemas['LegacyRecurringProductPrice'];
90
+ locale?: A;
91
+ mode?: 'compact' | 'standard';
92
+ }
93
+ declare const ProductPriceLabel: React.FC<ProductPriceLabelProps>;
94
+
95
+ export { CheckoutForm, CheckoutHeroPrice, CheckoutPWYWForm, CheckoutPricing, CheckoutPricingBreakdown, CheckoutProductSwitcher, CheckoutProductSwitcherItemPrice, CheckoutSeatSelector, MeteredPricesDisplay, ProductPriceLabel };
@@ -0,0 +1,95 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { s as schemas } from '../index.d-DvLuMU7T.js';
3
+ import { A } from './config-oYrbe6vX.js';
4
+ import { Appearance, Stripe, StripeElements } from '@stripe/stripe-js';
5
+ import { UseFormReturn } from 'react-hook-form';
6
+ import { ProductCheckoutPublic } from '../guards.js';
7
+ import 'openapi-fetch';
8
+
9
+ interface ThemingPresetProps {
10
+ stripe: Appearance;
11
+ }
12
+
13
+ interface CheckoutFormProps {
14
+ form: UseFormReturn<schemas['CheckoutUpdatePublic']>;
15
+ checkout: schemas['CheckoutPublic'];
16
+ update: (data: schemas['CheckoutUpdatePublic']) => Promise<schemas['CheckoutPublic']>;
17
+ confirm: (data: schemas['CheckoutConfirmStripe'], stripe: Stripe | null, elements: StripeElements | null) => Promise<schemas['CheckoutPublicConfirmed']>;
18
+ loading: boolean;
19
+ loadingLabel: string | undefined;
20
+ disabled?: boolean;
21
+ isUpdatePending?: boolean;
22
+ theme?: 'light' | 'dark';
23
+ themePreset: ThemingPresetProps;
24
+ locale?: A;
25
+ beforeSubmit?: React.ReactNode;
26
+ }
27
+ declare const CheckoutForm: (props: CheckoutFormProps) => react_jsx_runtime.JSX.Element;
28
+
29
+ interface CheckoutHeroPriceProps {
30
+ checkout: ProductCheckoutPublic;
31
+ locale?: A;
32
+ }
33
+ declare const CheckoutHeroPrice: ({ checkout, locale }: CheckoutHeroPriceProps) => react_jsx_runtime.JSX.Element;
34
+
35
+ interface CheckoutPricingProps {
36
+ checkout: ProductCheckoutPublic;
37
+ layout?: 'default' | 'stacked';
38
+ locale?: A;
39
+ }
40
+ declare const CheckoutPricing: ({ checkout, layout, locale, }: CheckoutPricingProps) => react_jsx_runtime.JSX.Element;
41
+
42
+ interface CheckoutPricingBreakdownProps {
43
+ checkout: schemas['CheckoutPublic'];
44
+ locale?: A;
45
+ }
46
+ declare const CheckoutPricingBreakdown: ({ checkout, locale, }: CheckoutPricingBreakdownProps) => react_jsx_runtime.JSX.Element | null;
47
+
48
+ interface CheckoutProductSwitcherItemPriceProps {
49
+ isSelected: boolean;
50
+ product: ProductCheckoutPublic['product'];
51
+ price: schemas['ProductPrice'] | schemas['LegacyRecurringProductPrice'];
52
+ checkout: ProductCheckoutPublic;
53
+ locale?: A;
54
+ }
55
+ declare const CheckoutProductSwitcherItemPrice: ({ isSelected, product, price, checkout, locale, }: CheckoutProductSwitcherItemPriceProps) => react_jsx_runtime.JSX.Element;
56
+ interface CheckoutProductSwitcherProps {
57
+ checkout: ProductCheckoutPublic;
58
+ update?: (data: schemas['CheckoutUpdatePublic']) => Promise<ProductCheckoutPublic>;
59
+ disabled?: boolean;
60
+ themePreset: ThemingPresetProps;
61
+ locale?: A;
62
+ }
63
+ declare const CheckoutProductSwitcher: ({ checkout, update, locale, }: CheckoutProductSwitcherProps) => react_jsx_runtime.JSX.Element | null;
64
+
65
+ interface CheckoutPWYWFormProps {
66
+ update: (data: schemas['CheckoutUpdatePublic']) => void;
67
+ checkout: schemas['CheckoutPublic'];
68
+ productPrice: schemas['ProductPriceCustom'];
69
+ locale?: A;
70
+ }
71
+ declare const CheckoutPWYWForm: ({ update, checkout, productPrice, locale, }: CheckoutPWYWFormProps) => react_jsx_runtime.JSX.Element;
72
+
73
+ interface CheckoutSeatSelectorProps {
74
+ checkout: ProductCheckoutPublic;
75
+ update: (data: schemas['CheckoutUpdatePublic']) => Promise<schemas['CheckoutPublic']>;
76
+ locale?: A;
77
+ compact?: boolean;
78
+ }
79
+ declare const CheckoutSeatSelector: ({ checkout, update, locale, compact, }: CheckoutSeatSelectorProps) => react_jsx_runtime.JSX.Element | null;
80
+
81
+ interface MeteredPricesDisplayProps {
82
+ checkout: ProductCheckoutPublic;
83
+ locale?: A;
84
+ }
85
+ declare const MeteredPricesDisplay: ({ checkout, locale, }: MeteredPricesDisplayProps) => react_jsx_runtime.JSX.Element | null;
86
+
87
+ interface ProductPriceLabelProps {
88
+ product: schemas['CheckoutProduct'];
89
+ price: schemas['ProductPrice'] | schemas['LegacyRecurringProductPrice'];
90
+ locale?: A;
91
+ mode?: 'compact' | 'standard';
92
+ }
93
+ declare const ProductPriceLabel: React.FC<ProductPriceLabelProps>;
94
+
95
+ export { CheckoutForm, CheckoutHeroPrice, CheckoutPWYWForm, CheckoutPricing, CheckoutPricingBreakdown, CheckoutProductSwitcher, CheckoutProductSwitcherItemPrice, CheckoutSeatSelector, MeteredPricesDisplay, ProductPriceLabel };