@schematichq/schematic-react 0.2.0-rc.1 → 0.2.0-rc.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  import { Context } from 'react';
2
2
  import * as Craft from '@craftjs/core';
3
3
  import { DetailedHTMLProps } from 'react';
4
+ import { Dispatch } from 'react';
4
5
  import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES } from 'react';
5
6
  import { Event as Event_2 } from '@schematichq/schematic-js';
6
7
  import { EventBody } from '@schematichq/schematic-js';
@@ -15,7 +16,6 @@ import { HTMLAttributes } from 'react';
15
16
  import { IStyledComponentBase } from 'styled-components/dist/types';
16
17
  import { JSX as JSX_2 } from 'react/jsx-runtime';
17
18
  import { Keys } from '@schematichq/schematic-js';
18
- import { default as React_2 } from 'react';
19
19
  import { ReactNode } from 'react';
20
20
  import { RefAttributes } from 'react';
21
21
  import { RefObject } from 'react';
@@ -23,11 +23,13 @@ import { Schematic } from '@schematichq/schematic-js';
23
23
  import { SchematicContext } from '@schematichq/schematic-js';
24
24
  import * as SchematicJS from '@schematichq/schematic-js';
25
25
  import { SchematicOptions } from '@schematichq/schematic-js';
26
+ import { SetStateAction } from 'react';
27
+ import { Stripe } from '@stripe/stripe-js';
26
28
  import { Substitute } from 'styled-components/dist/types';
27
29
  import { Traits } from '@schematichq/schematic-js';
28
30
 
29
31
  declare type BaseSchematicProviderProps = Omit<SchematicJS.SchematicOptions, "client" | "publishableKey"> & {
30
- children: ReactNode;
32
+ children: React.ReactNode;
31
33
  };
32
34
 
33
35
  /**
@@ -202,6 +204,97 @@ declare interface BillingProductDetailResponseData {
202
204
  updatedAt: Date;
203
205
  }
204
206
 
207
+ /**
208
+ * Schematic API
209
+ * Schematic API
210
+ *
211
+ * The version of the OpenAPI document: 0.1
212
+ *
213
+ *
214
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
215
+ * https://openapi-generator.tech
216
+ * Do not edit the class manually.
217
+ */
218
+ /**
219
+ *
220
+ * @export
221
+ * @interface BillingProductForSubscriptionResponseData
222
+ */
223
+ declare interface BillingProductForSubscriptionResponseData {
224
+ /**
225
+ *
226
+ * @type {string}
227
+ * @memberof BillingProductForSubscriptionResponseData
228
+ */
229
+ accountId: string;
230
+ /**
231
+ *
232
+ * @type {Date}
233
+ * @memberof BillingProductForSubscriptionResponseData
234
+ */
235
+ createdAt: Date;
236
+ /**
237
+ *
238
+ * @type {string}
239
+ * @memberof BillingProductForSubscriptionResponseData
240
+ */
241
+ currency: string;
242
+ /**
243
+ *
244
+ * @type {string}
245
+ * @memberof BillingProductForSubscriptionResponseData
246
+ */
247
+ environmentId: string;
248
+ /**
249
+ *
250
+ * @type {string}
251
+ * @memberof BillingProductForSubscriptionResponseData
252
+ */
253
+ externalId: string;
254
+ /**
255
+ *
256
+ * @type {string}
257
+ * @memberof BillingProductForSubscriptionResponseData
258
+ */
259
+ id: string;
260
+ /**
261
+ *
262
+ * @type {string}
263
+ * @memberof BillingProductForSubscriptionResponseData
264
+ */
265
+ interval?: string | null;
266
+ /**
267
+ *
268
+ * @type {string}
269
+ * @memberof BillingProductForSubscriptionResponseData
270
+ */
271
+ name: string;
272
+ /**
273
+ *
274
+ * @type {number}
275
+ * @memberof BillingProductForSubscriptionResponseData
276
+ */
277
+ price: number;
278
+ /**
279
+ *
280
+ * @type {number}
281
+ * @memberof BillingProductForSubscriptionResponseData
282
+ */
283
+ quantity: number;
284
+ /**
285
+ *
286
+ * @type {string}
287
+ * @memberof BillingProductForSubscriptionResponseData
288
+ */
289
+ subscriptionId: string;
290
+ /**
291
+ *
292
+ * @type {Date}
293
+ * @memberof BillingProductForSubscriptionResponseData
294
+ */
295
+ updatedAt: Date;
296
+ }
297
+
205
298
  export declare const Box: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ComponentProps>> & string;
206
299
 
207
300
  export declare type BoxProps = ComponentProps;
@@ -227,6 +320,11 @@ export declare interface CardProps {
227
320
  className?: string;
228
321
  }
229
322
 
323
+ export declare const Column: ForwardRefExoticComponent<Omit<ColumnProps, "ref"> & RefAttributes<HTMLDivElement | null>>;
324
+
325
+ export declare interface ColumnProps extends React.HTMLProps<HTMLDivElement> {
326
+ }
327
+
230
328
  /**
231
329
  *
232
330
  * @export
@@ -423,6 +521,62 @@ declare interface CompanyPlanDetailResponseData {
423
521
  yearlyPrice?: BillingPriceResponseData;
424
522
  }
425
523
 
524
+ /**
525
+ *
526
+ * @export
527
+ * @interface CompanySubscriptionResponseData
528
+ */
529
+ declare interface CompanySubscriptionResponseData {
530
+ /**
531
+ *
532
+ * @type {string}
533
+ * @memberof CompanySubscriptionResponseData
534
+ */
535
+ customerExternalId: string;
536
+ /**
537
+ *
538
+ * @type {Date}
539
+ * @memberof CompanySubscriptionResponseData
540
+ */
541
+ expiredAt?: Date | null;
542
+ /**
543
+ *
544
+ * @type {string}
545
+ * @memberof CompanySubscriptionResponseData
546
+ */
547
+ interval: string;
548
+ /**
549
+ *
550
+ * @type {InvoiceResponseData}
551
+ * @memberof CompanySubscriptionResponseData
552
+ */
553
+ latestInvoice?: InvoiceResponseData;
554
+ /**
555
+ *
556
+ * @type {PaymentMethodResponseData}
557
+ * @memberof CompanySubscriptionResponseData
558
+ */
559
+ paymentMethod?: PaymentMethodResponseData;
560
+ /**
561
+ *
562
+ * @type {Array<BillingProductForSubscriptionResponseData>}
563
+ * @memberof CompanySubscriptionResponseData
564
+ */
565
+ products: Array<BillingProductForSubscriptionResponseData>;
566
+ /**
567
+ *
568
+ * @type {string}
569
+ * @memberof CompanySubscriptionResponseData
570
+ */
571
+ subscriptionExternalId: string;
572
+ /**
573
+ *
574
+ * @type {number}
575
+ * @memberof CompanySubscriptionResponseData
576
+ */
577
+ totalPrice: number;
578
+ }
579
+
426
580
  /**
427
581
  * The returned resource
428
582
  * @export
@@ -459,6 +613,12 @@ declare interface ComponentHydrateResponseData {
459
613
  * @memberof ComponentHydrateResponseData
460
614
  */
461
615
  stripeEmbed?: StripeEmbedInfo;
616
+ /**
617
+ *
618
+ * @type {CompanySubscriptionResponseData}
619
+ * @memberof ComponentHydrateResponseData
620
+ */
621
+ subscription?: CompanySubscriptionResponseData;
462
622
  }
463
623
 
464
624
  declare interface ComponentProps extends TransientCSSProperties {
@@ -782,10 +942,12 @@ export declare interface EmbedContextProps {
782
942
  data: RecursivePartial<ComponentHydrateResponseData>;
783
943
  nodes: SerializedNodeWithChildren[];
784
944
  settings: EmbedSettings;
945
+ stripe: Promise<Stripe | null> | null;
785
946
  layout: EmbedLayout;
786
947
  error?: Error;
787
948
  setData: (data: RecursivePartial<ComponentHydrateResponseData>) => void;
788
949
  updateSettings: (settings: RecursivePartial<EmbedSettings>) => void;
950
+ setStripe: (stripe: Promise<Stripe | null> | null) => void;
789
951
  setLayout: (layout: EmbedLayout) => void;
790
952
  }
791
953
 
@@ -1538,6 +1700,115 @@ export declare const IncludedFeatures: ForwardRefExoticComponent<ElementProps &
1538
1700
 
1539
1701
  export declare type IncludedFeaturesProps = DesignProps_2;
1540
1702
 
1703
+ /**
1704
+ * Schematic API
1705
+ * Schematic API
1706
+ *
1707
+ * The version of the OpenAPI document: 0.1
1708
+ *
1709
+ *
1710
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1711
+ * https://openapi-generator.tech
1712
+ * Do not edit the class manually.
1713
+ */
1714
+ /**
1715
+ *
1716
+ * @export
1717
+ * @interface InvoiceResponseData
1718
+ */
1719
+ declare interface InvoiceResponseData {
1720
+ /**
1721
+ *
1722
+ * @type {number}
1723
+ * @memberof InvoiceResponseData
1724
+ */
1725
+ amountDue: number;
1726
+ /**
1727
+ *
1728
+ * @type {number}
1729
+ * @memberof InvoiceResponseData
1730
+ */
1731
+ amountPaid: number;
1732
+ /**
1733
+ *
1734
+ * @type {number}
1735
+ * @memberof InvoiceResponseData
1736
+ */
1737
+ amountRemaining: number;
1738
+ /**
1739
+ *
1740
+ * @type {string}
1741
+ * @memberof InvoiceResponseData
1742
+ */
1743
+ collectionMethod: string;
1744
+ /**
1745
+ *
1746
+ * @type {string}
1747
+ * @memberof InvoiceResponseData
1748
+ */
1749
+ companyId?: string | null;
1750
+ /**
1751
+ *
1752
+ * @type {Date}
1753
+ * @memberof InvoiceResponseData
1754
+ */
1755
+ createdAt: Date;
1756
+ /**
1757
+ *
1758
+ * @type {string}
1759
+ * @memberof InvoiceResponseData
1760
+ */
1761
+ currency: string;
1762
+ /**
1763
+ *
1764
+ * @type {string}
1765
+ * @memberof InvoiceResponseData
1766
+ */
1767
+ customerExternalId: string;
1768
+ /**
1769
+ *
1770
+ * @type {Date}
1771
+ * @memberof InvoiceResponseData
1772
+ */
1773
+ dueDate?: Date | null;
1774
+ /**
1775
+ *
1776
+ * @type {string}
1777
+ * @memberof InvoiceResponseData
1778
+ */
1779
+ environmentId: string;
1780
+ /**
1781
+ *
1782
+ * @type {string}
1783
+ * @memberof InvoiceResponseData
1784
+ */
1785
+ externalId: string;
1786
+ /**
1787
+ *
1788
+ * @type {string}
1789
+ * @memberof InvoiceResponseData
1790
+ */
1791
+ id: string;
1792
+ /**
1793
+ *
1794
+ * @type {string}
1795
+ * @memberof InvoiceResponseData
1796
+ */
1797
+ subscriptionExternalId?: string | null;
1798
+ /**
1799
+ *
1800
+ * @type {number}
1801
+ * @memberof InvoiceResponseData
1802
+ */
1803
+ subtotal: number;
1804
+ /**
1805
+ *
1806
+ * @type {Date}
1807
+ * @memberof InvoiceResponseData
1808
+ */
1809
+ updatedAt: Date;
1810
+ }
1811
+
1541
1812
  export declare const Invoices: ForwardRefExoticComponent<ElementProps & RecursivePartial<DesignProps_6> & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement | null>>;
1542
1813
 
1543
1814
  export declare type InvoicesProps = DesignProps_6;
@@ -1554,12 +1825,130 @@ declare interface Middleware {
1554
1825
  onError?(context: ErrorContext): Promise<Response | void>;
1555
1826
  }
1556
1827
 
1828
+ export declare const OverlayHeader: ({ children }: {
1829
+ children: ReactNode;
1830
+ }) => JSX_2.Element;
1831
+
1832
+ export declare const OverlaySideBar: ({ pricePeriod, setPricePeriod, setCheckoutStage, }: {
1833
+ pricePeriod: "month" | "year";
1834
+ setPricePeriod: Dispatch<SetStateAction<"month" | "year">>;
1835
+ setCheckoutStage: Dispatch<SetStateAction<"plan" | "checkout">>;
1836
+ }) => JSX_2.Element;
1837
+
1838
+ export declare const OverlayWrapper: ({ children, size, }: {
1839
+ children: ReactNode;
1840
+ size?: "md" | "lg";
1841
+ }) => JSX_2.Element;
1842
+
1557
1843
  export declare const PaymentMethod: ForwardRefExoticComponent<ElementProps & RecursivePartial<DesignProps_5> & HTMLAttributes<HTMLDivElement> & {
1558
1844
  portal?: HTMLElement | null;
1559
1845
  } & RefAttributes<HTMLDivElement | null>>;
1560
1846
 
1561
1847
  export declare type PaymentMethodProps = DesignProps_5;
1562
1848
 
1849
+ /**
1850
+ * Schematic API
1851
+ * Schematic API
1852
+ *
1853
+ * The version of the OpenAPI document: 0.1
1854
+ *
1855
+ *
1856
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1857
+ * https://openapi-generator.tech
1858
+ * Do not edit the class manually.
1859
+ */
1860
+ /**
1861
+ *
1862
+ * @export
1863
+ * @interface PaymentMethodResponseData
1864
+ */
1865
+ declare interface PaymentMethodResponseData {
1866
+ /**
1867
+ *
1868
+ * @type {string}
1869
+ * @memberof PaymentMethodResponseData
1870
+ */
1871
+ cardBrand?: string | null;
1872
+ /**
1873
+ *
1874
+ * @type {number}
1875
+ * @memberof PaymentMethodResponseData
1876
+ */
1877
+ cardExpMonth?: number | null;
1878
+ /**
1879
+ *
1880
+ * @type {number}
1881
+ * @memberof PaymentMethodResponseData
1882
+ */
1883
+ cardExpYear?: number | null;
1884
+ /**
1885
+ *
1886
+ * @type {string}
1887
+ * @memberof PaymentMethodResponseData
1888
+ */
1889
+ cardLast4?: string | null;
1890
+ /**
1891
+ *
1892
+ * @type {string}
1893
+ * @memberof PaymentMethodResponseData
1894
+ */
1895
+ companyId?: string | null;
1896
+ /**
1897
+ *
1898
+ * @type {Date}
1899
+ * @memberof PaymentMethodResponseData
1900
+ */
1901
+ createdAt: Date;
1902
+ /**
1903
+ *
1904
+ * @type {string}
1905
+ * @memberof PaymentMethodResponseData
1906
+ */
1907
+ customerExternalId: string;
1908
+ /**
1909
+ *
1910
+ * @type {string}
1911
+ * @memberof PaymentMethodResponseData
1912
+ */
1913
+ environmentId: string;
1914
+ /**
1915
+ *
1916
+ * @type {string}
1917
+ * @memberof PaymentMethodResponseData
1918
+ */
1919
+ externalId: string;
1920
+ /**
1921
+ *
1922
+ * @type {string}
1923
+ * @memberof PaymentMethodResponseData
1924
+ */
1925
+ id: string;
1926
+ /**
1927
+ *
1928
+ * @type {string}
1929
+ * @memberof PaymentMethodResponseData
1930
+ */
1931
+ invoiceExternalId?: string | null;
1932
+ /**
1933
+ *
1934
+ * @type {string}
1935
+ * @memberof PaymentMethodResponseData
1936
+ */
1937
+ paymentMethodType: string;
1938
+ /**
1939
+ *
1940
+ * @type {string}
1941
+ * @memberof PaymentMethodResponseData
1942
+ */
1943
+ subscriptionExternalId?: string | null;
1944
+ /**
1945
+ *
1946
+ * @type {Date}
1947
+ * @memberof PaymentMethodResponseData
1948
+ */
1949
+ updatedAt: Date;
1950
+ }
1951
+
1563
1952
  /**
1564
1953
  *
1565
1954
  * @export
@@ -1801,6 +2190,11 @@ declare interface ResponseContext {
1801
2190
  response: Response;
1802
2191
  }
1803
2192
 
2193
+ export declare const Root: ForwardRefExoticComponent<Omit<RootProps, "ref"> & RefAttributes<HTMLDivElement | null>>;
2194
+
2195
+ export declare interface RootProps extends React.HTMLProps<HTMLDivElement> {
2196
+ }
2197
+
1804
2198
  /**
1805
2199
  *
1806
2200
  * @export
@@ -2119,7 +2513,7 @@ export declare interface SchematicHookOpts {
2119
2513
 
2120
2514
  export { SchematicOptions }
2121
2515
 
2122
- export declare const SchematicProvider: React_2.FC<SchematicProviderProps>;
2516
+ export declare const SchematicProvider: React.FC<SchematicProviderProps>;
2123
2517
 
2124
2518
  export declare type SchematicProviderProps = SchematicProviderPropsWithClient | SchematicProviderPropsWithPublishableKey;
2125
2519
 
@@ -2164,7 +2558,7 @@ declare interface StripeEmbedInfo {
2164
2558
  * @type {string}
2165
2559
  * @memberof StripeEmbedInfo
2166
2560
  */
2167
- customerEkey: string;
2561
+ customerEkey?: string | null;
2168
2562
  /**
2169
2563
  *
2170
2564
  * @type {string}
@@ -2221,4 +2615,9 @@ export declare type UseSchematicFlagOpts = SchematicHookOpts & {
2221
2615
  fallback?: boolean;
2222
2616
  };
2223
2617
 
2618
+ export declare const Viewport: ForwardRefExoticComponent<Omit<ViewportProps, "ref"> & RefAttributes<HTMLDivElement | null>>;
2619
+
2620
+ export declare interface ViewportProps extends React.HTMLProps<HTMLDivElement> {
2621
+ }
2622
+
2224
2623
  export { }