@kittycad/react-shared 0.1.9 → 1.0.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 +1 -0
- package/dist/index.d.ts +14 -8
- package/dist/index.esm.js +2405 -1845
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2462 -1902
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { SVGProps } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { AccountProvider, Client } from '@kittycad/lib';
|
|
4
|
+
import { AccountProvider, CustomerBalance, PaymentMethod, Client } from '@kittycad/lib';
|
|
5
5
|
import { BillingError as BillingError$1 } from '@/lib/billing';
|
|
6
6
|
import { DeepPartial } from '@/lib/types';
|
|
7
7
|
import { ClassValue } from 'clsx';
|
|
@@ -71,8 +71,9 @@ type TextProps = {
|
|
|
71
71
|
};
|
|
72
72
|
type BillingDialogProps = {
|
|
73
73
|
error?: BillingError$1;
|
|
74
|
-
|
|
74
|
+
balance?: number;
|
|
75
75
|
allowance?: number;
|
|
76
|
+
userPaymentBalance?: CustomerBalance;
|
|
76
77
|
upgradeHref: string;
|
|
77
78
|
text?: DeepPartial<TextProps>;
|
|
78
79
|
upgradeClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
@@ -87,8 +88,10 @@ declare enum BillingRemainingMode {
|
|
|
87
88
|
interface BillingRemainingProps {
|
|
88
89
|
mode: BillingRemainingMode;
|
|
89
90
|
error?: BillingError$1;
|
|
90
|
-
|
|
91
|
+
balance?: number;
|
|
91
92
|
allowance?: number;
|
|
93
|
+
paymentMethods?: PaymentMethod[];
|
|
94
|
+
userPaymentBalance?: CustomerBalance;
|
|
92
95
|
}
|
|
93
96
|
declare const BillingRemaining: (props: BillingRemainingProps) => react_jsx_runtime.JSX.Element;
|
|
94
97
|
|
|
@@ -129,14 +132,17 @@ type IBillingError = _IBillingError extends {
|
|
|
129
132
|
declare class BillingError {
|
|
130
133
|
error: IBillingError;
|
|
131
134
|
constructor(error: IBillingError);
|
|
132
|
-
static from(v:
|
|
135
|
+
static from(v: unknown): v is BillingError;
|
|
133
136
|
}
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
interface IBillingInfo {
|
|
138
|
+
balance: number;
|
|
136
139
|
allowance?: number;
|
|
140
|
+
userPaymentBalance: CustomerBalance;
|
|
141
|
+
paymentMethods: PaymentMethod[];
|
|
137
142
|
isOrg: boolean;
|
|
138
143
|
hasSubscription: boolean;
|
|
139
|
-
}
|
|
144
|
+
}
|
|
145
|
+
declare function getBillingInfo(client: Client): Promise<BillingError | IBillingInfo>;
|
|
140
146
|
|
|
141
147
|
export { BillingDialog, BillingError, BillingRemaining, BillingRemainingMode, Button, CustomIcon, EmailLoginForm, LoginTitle, SignInPageContent, Spinner, cn, getBillingInfo };
|
|
142
|
-
export type { BillingDialogProps, BrandTheme, ButtonProps, EmailLoginFormProps, LoginTitleProps, SignInPageContentProps };
|
|
148
|
+
export type { BillingDialogProps, BrandTheme, ButtonProps, EmailLoginFormProps, IBillingInfo, LoginTitleProps, SignInPageContentProps };
|