@schematichq/schematic-components 1.2.0 → 1.4.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.
@@ -15,6 +15,10 @@ import { RefAttributes } from 'react';
15
15
  import { RuleSet } from 'styled-components';
16
16
  import { Substitute } from 'styled-components/dist/types';
17
17
 
18
+ declare interface AvailablePlanOptions {
19
+ useSelectedPeriod?: boolean;
20
+ }
21
+
18
22
  /**
19
23
  *
20
24
  * @export
@@ -1876,6 +1880,12 @@ declare interface ChangeSubscriptionRequestBody {
1876
1880
  skipTrial: boolean;
1877
1881
  }
1878
1882
 
1883
+ export declare const CheckoutDialog: ({ top }: CheckoutDialogProps) => JSX.Element;
1884
+
1885
+ declare interface CheckoutDialogProps {
1886
+ top?: number;
1887
+ }
1888
+
1879
1889
  /**
1880
1890
  *
1881
1891
  * @export
@@ -1896,11 +1906,19 @@ declare interface CheckoutResponse {
1896
1906
  params: object;
1897
1907
  }
1898
1908
 
1909
+ export declare interface CheckoutStage {
1910
+ id: string;
1911
+ name: string;
1912
+ label?: string;
1913
+ description?: string;
1914
+ }
1915
+
1899
1916
  export declare type CheckoutState = {
1900
1917
  period?: string;
1901
1918
  planId?: string | null;
1902
1919
  addOnId?: string | null;
1903
1920
  usage?: boolean;
1921
+ addOnUsage?: boolean;
1904
1922
  credits?: boolean;
1905
1923
  };
1906
1924
 
@@ -2374,7 +2392,7 @@ declare interface CompanyPlanDetailResponseData {
2374
2392
  * @type {Array<PlanCreditGrantView>}
2375
2393
  * @memberof CompanyPlanDetailResponseData
2376
2394
  */
2377
- includedCreditGrants: Array<PlanCreditGrantView>;
2395
+ includedCreditGrants: Array<PlanCreditGrantView_2>;
2378
2396
  /**
2379
2397
  *
2380
2398
  * @type {boolean}
@@ -2810,6 +2828,12 @@ declare interface ComponentHydrateResponseData {
2810
2828
  * @memberof ComponentHydrateResponseData
2811
2829
  */
2812
2830
  featureUsage?: FeatureUsageDetailResponseData;
2831
+ /**
2832
+ *
2833
+ * @type {boolean}
2834
+ * @memberof ComponentHydrateResponseData
2835
+ */
2836
+ showPeriodToggle: boolean;
2813
2837
  /**
2814
2838
  *
2815
2839
  * @type {StripeEmbedInfo}
@@ -2920,6 +2944,8 @@ declare interface ConfigurationParameters {
2920
2944
 
2921
2945
  export declare const Container: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2922
2946
 
2947
+ export declare const createActiveUsageBasedEntitlementsReducer: (entitlements: FeatureUsageResponseData[], period: string) => (acc: UsageBasedEntitlement[], entitlement: PlanEntitlementResponseData_2) => UsageBasedEntitlement[];
2948
+
2923
2949
  /**
2924
2950
  *
2925
2951
  * @export
@@ -3421,6 +3447,7 @@ export declare const EmbedContext: Context<EmbedContextProps>;
3421
3447
 
3422
3448
  export declare interface EmbedContextProps extends EmbedState {
3423
3449
  hydratePublic: () => DebouncedApiPromise<PublicPlansResponseData>;
3450
+ hydrate: () => DebouncedApiPromise<ComponentHydrateResponseData>;
3424
3451
  hydrateComponent: (id: string) => DebouncedApiPromise<ComponentHydrateResponseData>;
3425
3452
  hydrateExternal: (fn: () => Promise<ComponentHydrateResponseData>) => DebouncedApiPromise<ComponentHydrateResponseData>;
3426
3453
  getUpcomingInvoice: (id: string) => DebouncedApiPromise<HydrateUpcomingInvoiceResponse>;
@@ -3799,7 +3826,7 @@ declare interface EventSummaryResponseData {
3799
3826
  * @type {number}
3800
3827
  * @memberof EventSummaryResponseData
3801
3828
  */
3802
- companyCount?: number | null;
3829
+ companyCount: number;
3803
3830
  /**
3804
3831
  *
3805
3832
  * @type {string}
@@ -3829,7 +3856,7 @@ declare interface EventSummaryResponseData {
3829
3856
  * @type {number}
3830
3857
  * @memberof EventSummaryResponseData
3831
3858
  */
3832
- userCount?: number | null;
3859
+ userCount: number;
3833
3860
  }
3834
3861
 
3835
3862
  /**
@@ -3854,7 +3881,7 @@ declare interface EventSummaryResponseData_2 {
3854
3881
  * @type {number}
3855
3882
  * @memberof EventSummaryResponseData
3856
3883
  */
3857
- companyCount?: number | null;
3884
+ companyCount: number;
3858
3885
  /**
3859
3886
  *
3860
3887
  * @type {string}
@@ -3884,7 +3911,7 @@ declare interface EventSummaryResponseData_2 {
3884
3911
  * @type {number}
3885
3912
  * @memberof EventSummaryResponseData
3886
3913
  */
3887
- userCount?: number | null;
3914
+ userCount: number;
3888
3915
  }
3889
3916
 
3890
3917
  /**
@@ -4760,6 +4787,7 @@ export declare type IncludedFeaturesProps = DesignProps_2;
4760
4787
 
4761
4788
  export declare const initialContext: {
4762
4789
  hydratePublic: () => never;
4790
+ hydrate: () => never;
4763
4791
  hydrateComponent: () => never;
4764
4792
  hydrateExternal: () => never;
4765
4793
  getUpcomingInvoice: () => never;
@@ -5267,6 +5295,109 @@ declare interface PlanCreditGrantView {
5267
5295
  updatedAt: Date;
5268
5296
  }
5269
5297
 
5298
+ /**
5299
+ * Schematic API
5300
+ * Schematic API
5301
+ *
5302
+ * The version of the OpenAPI document: 0.1
5303
+ *
5304
+ *
5305
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
5306
+ * https://openapi-generator.tech
5307
+ * Do not edit the class manually.
5308
+ */
5309
+ /**
5310
+ *
5311
+ * @export
5312
+ * @interface PlanCreditGrantView
5313
+ */
5314
+ declare interface PlanCreditGrantView_2 {
5315
+ /**
5316
+ *
5317
+ * @type {Date}
5318
+ * @memberof PlanCreditGrantView
5319
+ */
5320
+ createdAt: Date;
5321
+ /**
5322
+ *
5323
+ * @type {number}
5324
+ * @memberof PlanCreditGrantView
5325
+ */
5326
+ creditAmount: number;
5327
+ /**
5328
+ *
5329
+ * @type {string}
5330
+ * @memberof PlanCreditGrantView
5331
+ */
5332
+ creditDescription: string;
5333
+ /**
5334
+ *
5335
+ * @type {string}
5336
+ * @memberof PlanCreditGrantView
5337
+ */
5338
+ creditIcon?: string | null;
5339
+ /**
5340
+ *
5341
+ * @type {string}
5342
+ * @memberof PlanCreditGrantView
5343
+ */
5344
+ creditId: string;
5345
+ /**
5346
+ *
5347
+ * @type {string}
5348
+ * @memberof PlanCreditGrantView
5349
+ */
5350
+ creditName: string;
5351
+ /**
5352
+ *
5353
+ * @type {string}
5354
+ * @memberof PlanCreditGrantView
5355
+ */
5356
+ id: string;
5357
+ /**
5358
+ *
5359
+ * @type {string}
5360
+ * @memberof PlanCreditGrantView
5361
+ */
5362
+ planId: string;
5363
+ /**
5364
+ *
5365
+ * @type {string}
5366
+ * @memberof PlanCreditGrantView
5367
+ */
5368
+ planName: string;
5369
+ /**
5370
+ *
5371
+ * @type {string}
5372
+ * @memberof PlanCreditGrantView
5373
+ */
5374
+ pluralName?: string | null;
5375
+ /**
5376
+ *
5377
+ * @type {string}
5378
+ * @memberof PlanCreditGrantView
5379
+ */
5380
+ resetCadence: string;
5381
+ /**
5382
+ *
5383
+ * @type {string}
5384
+ * @memberof PlanCreditGrantView
5385
+ */
5386
+ resetStart: string;
5387
+ /**
5388
+ *
5389
+ * @type {string}
5390
+ * @memberof PlanCreditGrantView
5391
+ */
5392
+ singularName?: string | null;
5393
+ /**
5394
+ *
5395
+ * @type {Date}
5396
+ * @memberof PlanCreditGrantView
5397
+ */
5398
+ updatedAt: Date;
5399
+ }
5400
+
5270
5401
  /**
5271
5402
  *
5272
5403
  * @export
@@ -5929,6 +6060,12 @@ declare interface PlanViewPublicResponseData {
5929
6060
  * @memberof PlanViewPublicResponseData
5930
6061
  */
5931
6062
  id: string;
6063
+ /**
6064
+ *
6065
+ * @type {Array<PlanCreditGrantView>}
6066
+ * @memberof PlanViewPublicResponseData
6067
+ */
6068
+ includedCreditGrants: Array<PlanCreditGrantView>;
5932
6069
  /**
5933
6070
  *
5934
6071
  * @type {boolean}
@@ -7034,7 +7171,7 @@ declare type SelectedPlan = Plan & {
7034
7171
  * Do not edit the class manually.
7035
7172
  */
7036
7173
  /**
7037
- *
7174
+ * The returned resource
7038
7175
  * @export
7039
7176
  * @interface SetupIntentResponseData
7040
7177
  */
@@ -7325,6 +7462,12 @@ declare interface UpdatePaymentMethodResponse {
7325
7462
  params: object;
7326
7463
  }
7327
7464
 
7465
+ declare interface UsageBasedEntitlement extends PlanEntitlementResponseData_2 {
7466
+ allocation: number;
7467
+ usage: number;
7468
+ quantity: number;
7469
+ }
7470
+
7328
7471
  /**
7329
7472
  *
7330
7473
  * @export
@@ -7399,7 +7542,7 @@ declare interface UsageBasedEntitlementResponseData {
7399
7542
  yearlyUsageBasedPrice?: BillingPriceView_2;
7400
7543
  }
7401
7544
 
7402
- export declare function useAvailablePlans(activePeriod: string): {
7545
+ export declare function useAvailablePlans(activePeriod: string, options?: AvailablePlanOptions): {
7403
7546
  plans: SelectedPlan[];
7404
7547
  addOns: SelectedPlan[];
7405
7548
  periods: string[];