@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 CHANGED
@@ -79,6 +79,7 @@ git commit -m "bump version"
79
79
  # !! Create PR and merge it
80
80
 
81
81
  git checkout main
82
+ git pull
82
83
  git tag -a vX.Y.Z
83
84
  git push origin vX.Y.Z
84
85
  ```
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
- credits?: number;
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
- credits?: number;
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: any): v is BillingError;
135
+ static from(v: unknown): v is BillingError;
133
136
  }
134
- declare function getBillingInfo(client: Client): Promise<BillingError | {
135
- credits: number;
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 };