@schematichq/schematic-react 0.2.0-rc.5 → 0.2.0-rc.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ import { HTMLAttributes } from 'react';
15
15
  import { IStyledComponentBase } from 'styled-components/dist/types';
16
16
  import { JSX as JSX_2 } from 'react/jsx-runtime';
17
17
  import { Keys } from '@schematichq/schematic-js';
18
+ import { default as React_2 } from 'react';
18
19
  import { RefAttributes } from 'react';
19
20
  import { RefObject } from 'react';
20
21
  import { Schematic } from '@schematichq/schematic-js';
@@ -76,7 +77,7 @@ declare class BaseAPI {
76
77
  }
77
78
 
78
79
  declare type BaseSchematicProviderProps = Omit<SchematicJS.SchematicOptions, "client" | "publishableKey"> & {
79
- children: React.ReactNode;
80
+ children: React_2.ReactNode;
80
81
  };
81
82
 
82
83
  /**
@@ -322,6 +323,12 @@ declare interface BillingProductForSubscriptionResponseData {
322
323
  * @memberof BillingProductForSubscriptionResponseData
323
324
  */
324
325
  price: number;
326
+ /**
327
+ *
328
+ * @type {string}
329
+ * @memberof BillingProductForSubscriptionResponseData
330
+ */
331
+ priceExternalId?: string | null;
325
332
  /**
326
333
  *
327
334
  * @type {number}
@@ -671,6 +678,12 @@ declare interface CompanyPlanDetailResponseData {
671
678
  * @memberof CompanyPlanDetailResponseData
672
679
  */
673
680
  id: string;
681
+ /**
682
+ *
683
+ * @type {boolean}
684
+ * @memberof CompanyPlanDetailResponseData
685
+ */
686
+ isDefault: boolean;
674
687
  /**
675
688
  *
676
689
  * @type {BillingPriceResponseData}
@@ -1162,13 +1175,15 @@ export declare interface EmbedContextProps {
1162
1175
  stripe: Promise<Stripe | null> | null;
1163
1176
  layout: EmbedLayout;
1164
1177
  error?: Error;
1178
+ isPending: boolean;
1179
+ hydrate: () => void;
1165
1180
  setData: (data: RecursivePartial<ComponentHydrateResponseData>) => void;
1166
1181
  updateSettings: (settings: RecursivePartial<EmbedSettings>) => void;
1167
1182
  setStripe: (stripe: Promise<Stripe | null> | null) => void;
1168
1183
  setLayout: (layout: EmbedLayout) => void;
1169
1184
  }
1170
1185
 
1171
- declare type EmbedLayout = "portal" | "checkout" | "payment" | "disabled";
1186
+ declare type EmbedLayout = "portal" | "checkout" | "payment" | "success" | "disabled";
1172
1187
 
1173
1188
  export declare interface EmbedProps {
1174
1189
  accessToken?: string;
@@ -1950,7 +1965,7 @@ export declare const IconRound: ({ name, variant, size, colors, ...props }: Icon
1950
1965
  export declare interface IconRoundProps extends React.HTMLAttributes<HTMLElement> {
1951
1966
  name: IconNameTypes;
1952
1967
  variant?: "outline" | "filled";
1953
- size?: "tn" | "sm" | "md" | "lg";
1968
+ size?: "tn" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
1954
1969
  colors?: [string, string];
1955
1970
  }
1956
1971
 
@@ -2045,7 +2060,7 @@ declare interface InvoiceResponseData {
2045
2060
  * @type {string}
2046
2061
  * @memberof InvoiceResponseData
2047
2062
  */
2048
- externalId: string;
2063
+ externalId?: string | null;
2049
2064
  /**
2050
2065
  *
2051
2066
  * @type {string}
@@ -2093,6 +2108,8 @@ declare class JSONApiResponse<T> {
2093
2108
 
2094
2109
  export { Keys }
2095
2110
 
2111
+ export declare const Loader: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2112
+
2096
2113
  declare function mapValues(data: any, fn: (item: any) => any): {};
2097
2114
 
2098
2115
  export declare const MeteredFeatures: ForwardRefExoticComponent<ElementProps & RecursivePartial<DesignProps_3> & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement | null>>;
@@ -2105,18 +2122,19 @@ declare interface Middleware {
2105
2122
  onError?(context: ErrorContext): Promise<Response | void>;
2106
2123
  }
2107
2124
 
2108
- export declare const Modal: ({ children, onClose }: ModalProps) => JSX_2.Element;
2125
+ export declare const Modal: ({ children, size, onClose }: ModalProps) => JSX_2.Element;
2109
2126
 
2110
- export declare const ModalHeader: ({ children, onClose }: ModalHeaderProps) => JSX_2.Element;
2127
+ export declare const ModalHeader: ({ children, bordered, onClose, }: ModalHeaderProps) => JSX_2.Element;
2111
2128
 
2112
2129
  declare interface ModalHeaderProps {
2113
- children: React.ReactNode;
2130
+ children?: React.ReactNode;
2131
+ bordered?: boolean;
2114
2132
  onClose?: () => void;
2115
2133
  }
2116
2134
 
2117
2135
  declare interface ModalProps {
2118
2136
  children: React.ReactNode;
2119
- size?: "md" | "lg";
2137
+ size?: "sm" | "md" | "lg" | "auto";
2120
2138
  onClose?: () => void;
2121
2139
  }
2122
2140
 
@@ -2205,12 +2223,6 @@ declare interface PaymentMethodResponseData {
2205
2223
  * @memberof PaymentMethodResponseData
2206
2224
  */
2207
2225
  id: string;
2208
- /**
2209
- *
2210
- * @type {string}
2211
- * @memberof PaymentMethodResponseData
2212
- */
2213
- invoiceExternalId?: string | null;
2214
2226
  /**
2215
2227
  *
2216
2228
  * @type {string}
@@ -2848,8 +2860,7 @@ export { Schematic }
2848
2860
  export { SchematicContext }
2849
2861
 
2850
2862
  declare interface SchematicContextProps {
2851
- client?: SchematicJS.Schematic;
2852
- flagValues: Record<string, boolean>;
2863
+ client: SchematicJS.Schematic;
2853
2864
  }
2854
2865
 
2855
2866
  export declare const SchematicEmbed: ({ id, accessToken, apiConfig }: EmbedProps) => JSX_2.Element;
@@ -2860,7 +2871,7 @@ export declare interface SchematicHookOpts {
2860
2871
 
2861
2872
  export { SchematicOptions }
2862
2873
 
2863
- export declare const SchematicProvider: React.FC<SchematicProviderProps>;
2874
+ export declare const SchematicProvider: React_2.FC<SchematicProviderProps>;
2864
2875
 
2865
2876
  export declare type SchematicProviderProps = SchematicProviderPropsWithClient | SchematicProviderPropsWithPublishableKey;
2866
2877
 
@@ -2960,12 +2971,12 @@ export declare const useEmbed: () => EmbedContextProps;
2960
2971
  export declare const useSchematic: () => SchematicContextProps;
2961
2972
 
2962
2973
  export declare const useSchematicContext: (opts?: SchematicHookOpts) => {
2963
- setContext: ((context: SchematicJS.SchematicContext) => Promise<void>) | undefined;
2974
+ setContext: (context: SchematicJS.SchematicContext) => Promise<void>;
2964
2975
  };
2965
2976
 
2966
2977
  export declare const useSchematicEvents: (opts?: SchematicHookOpts) => {
2967
- track: ((body: SchematicJS.EventBodyTrack) => Promise<void>) | undefined;
2968
- identify: ((body: SchematicJS.EventBodyIdentify) => Promise<void>) | undefined;
2978
+ track: (body: SchematicJS.EventBodyTrack) => Promise<void>;
2979
+ identify: (body: SchematicJS.EventBodyIdentify) => Promise<void>;
2969
2980
  };
2970
2981
 
2971
2982
  export declare const useSchematicFlag: (key: string, opts?: UseSchematicFlagOpts) => boolean;
@@ -2974,6 +2985,8 @@ export declare type UseSchematicFlagOpts = SchematicHookOpts & {
2974
2985
  fallback?: boolean;
2975
2986
  };
2976
2987
 
2988
+ export declare const useSchematicIsPending: (opts?: SchematicHookOpts) => boolean;
2989
+
2977
2990
  export declare const Viewport: ForwardRefExoticComponent<Omit<ViewportProps, "ref"> & RefAttributes<HTMLDivElement | null>>;
2978
2991
 
2979
2992
  export declare interface ViewportProps extends React.HTMLProps<HTMLDivElement> {