@schematichq/schematic-components 2.10.3 → 2.11.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.
@@ -27,6 +27,18 @@ declare interface AddOnsProps {
27
27
  currency?: string;
28
28
  }
29
29
 
30
+ export declare const AutoTopup: ({ planCreditGrants, autoTopupConfigs, updateAutoTopupConfig, }: AutoTopupProps) => JSX.Element;
31
+
32
+ declare type AutoTopupConfig = Pick<CompanyPlanCreditGrantView, "companyAutoTopupEnabled" | "companyAutoTopupThresholdCredits" | "companyAutoTopupAmount">;
33
+
34
+ declare interface AutoTopupProps {
35
+ isLoading: boolean;
36
+ planCreditGrants: PlanCreditGrantView[];
37
+ autoTopupConfigs: Map<string, AutoTopupConfig>;
38
+ updateAutoTopupConfig: (id: string, config: Partial<AutoTopupConfig>) => void;
39
+ currency?: string;
40
+ }
41
+
30
42
  export declare interface AvailableCurrenciesResult {
31
43
  currencies: string[];
32
44
  invalidFilterEntries: string[];
@@ -940,6 +952,12 @@ declare interface BillingPlanCreditGrantResponseData {
940
952
  * @memberof BillingPlanCreditGrantResponseData
941
953
  */
942
954
  autoTopupExpiryUnitCount?: number | null;
955
+ /**
956
+ *
957
+ * @type {boolean}
958
+ * @memberof BillingPlanCreditGrantResponseData
959
+ */
960
+ autoTopupSelfService: boolean;
943
961
  /**
944
962
  *
945
963
  * @type {number}
@@ -2760,6 +2778,12 @@ declare interface ChangeSubscriptionRequestBody {
2760
2778
  * @memberof ChangeSubscriptionRequestBody
2761
2779
  */
2762
2780
  addOnIds: Array<UpdateAddOnRequestBody>;
2781
+ /**
2782
+ *
2783
+ * @type {Array<UpdateAutoTopupOverrideRequestBody>}
2784
+ * @memberof ChangeSubscriptionRequestBody
2785
+ */
2786
+ autoTopupOverrides: Array<UpdateAutoTopupOverrideRequestBody>;
2763
2787
  /**
2764
2788
  *
2765
2789
  * @type {string}
@@ -3555,6 +3579,211 @@ declare interface CompanyOverrideResponseData {
3555
3579
  valueType: EntitlementValueType;
3556
3580
  }
3557
3581
 
3582
+ /**
3583
+ *
3584
+ * @export
3585
+ * @interface CompanyPlanCreditGrantView
3586
+ */
3587
+ declare interface CompanyPlanCreditGrantView {
3588
+ /**
3589
+ *
3590
+ * @type {number}
3591
+ * @memberof CompanyPlanCreditGrantView
3592
+ */
3593
+ billingCreditAutoTopupAmount?: number | null;
3594
+ /**
3595
+ *
3596
+ * @type {string}
3597
+ * @memberof CompanyPlanCreditGrantView
3598
+ */
3599
+ billingCreditAutoTopupAmountType?: string | null;
3600
+ /**
3601
+ *
3602
+ * @type {boolean}
3603
+ * @memberof CompanyPlanCreditGrantView
3604
+ */
3605
+ billingCreditAutoTopupEnabled: boolean;
3606
+ /**
3607
+ *
3608
+ * @type {BillingCreditExpiryType}
3609
+ * @memberof CompanyPlanCreditGrantView
3610
+ */
3611
+ billingCreditAutoTopupExpiryType?: BillingCreditExpiryType | null;
3612
+ /**
3613
+ *
3614
+ * @type {BillingCreditExpiryUnit}
3615
+ * @memberof CompanyPlanCreditGrantView
3616
+ */
3617
+ billingCreditAutoTopupExpiryUnit?: BillingCreditExpiryUnit | null;
3618
+ /**
3619
+ *
3620
+ * @type {number}
3621
+ * @memberof CompanyPlanCreditGrantView
3622
+ */
3623
+ billingCreditAutoTopupExpiryUnitCount?: number | null;
3624
+ /**
3625
+ *
3626
+ * @type {boolean}
3627
+ * @memberof CompanyPlanCreditGrantView
3628
+ */
3629
+ billingCreditAutoTopupSelfService: boolean;
3630
+ /**
3631
+ *
3632
+ * @type {number}
3633
+ * @memberof CompanyPlanCreditGrantView
3634
+ */
3635
+ billingCreditAutoTopupThresholdCredits?: number | null;
3636
+ /**
3637
+ *
3638
+ * @type {number}
3639
+ * @memberof CompanyPlanCreditGrantView
3640
+ */
3641
+ billingCreditAutoTopupThresholdPercent?: number | null;
3642
+ /**
3643
+ *
3644
+ * @type {number}
3645
+ * @memberof CompanyPlanCreditGrantView
3646
+ */
3647
+ companyAutoTopupAmount?: number | null;
3648
+ /**
3649
+ *
3650
+ * @type {boolean}
3651
+ * @memberof CompanyPlanCreditGrantView
3652
+ */
3653
+ companyAutoTopupEnabled?: boolean | null;
3654
+ /**
3655
+ *
3656
+ * @type {number}
3657
+ * @memberof CompanyPlanCreditGrantView
3658
+ */
3659
+ companyAutoTopupThresholdCredits?: number | null;
3660
+ /**
3661
+ *
3662
+ * @type {Date}
3663
+ * @memberof CompanyPlanCreditGrantView
3664
+ */
3665
+ createdAt: Date;
3666
+ /**
3667
+ *
3668
+ * @type {BillingCreditView}
3669
+ * @memberof CompanyPlanCreditGrantView
3670
+ */
3671
+ credit?: BillingCreditView;
3672
+ /**
3673
+ *
3674
+ * @type {number}
3675
+ * @memberof CompanyPlanCreditGrantView
3676
+ */
3677
+ creditAmount: number;
3678
+ /**
3679
+ * Deprecated field, will be removed in the future. Use Credit.Description instead.
3680
+ * @type {string}
3681
+ * @memberof CompanyPlanCreditGrantView
3682
+ * @deprecated
3683
+ */
3684
+ creditDescription: string;
3685
+ /**
3686
+ * Deprecated field, will be removed in the future. Use Credit.Icon instead.
3687
+ * @type {string}
3688
+ * @memberof CompanyPlanCreditGrantView
3689
+ * @deprecated
3690
+ */
3691
+ creditIcon?: string | null;
3692
+ /**
3693
+ *
3694
+ * @type {string}
3695
+ * @memberof CompanyPlanCreditGrantView
3696
+ */
3697
+ creditId: string;
3698
+ /**
3699
+ * Deprecated field, will be removed in the future. Use Credit.Name instead.
3700
+ * @type {string}
3701
+ * @memberof CompanyPlanCreditGrantView
3702
+ * @deprecated
3703
+ */
3704
+ creditName: string;
3705
+ /**
3706
+ *
3707
+ * @type {BillingCreditExpiryType}
3708
+ * @memberof CompanyPlanCreditGrantView
3709
+ */
3710
+ expiryType?: BillingCreditExpiryType | null;
3711
+ /**
3712
+ *
3713
+ * @type {BillingCreditExpiryUnit}
3714
+ * @memberof CompanyPlanCreditGrantView
3715
+ */
3716
+ expiryUnit?: BillingCreditExpiryUnit | null;
3717
+ /**
3718
+ *
3719
+ * @type {number}
3720
+ * @memberof CompanyPlanCreditGrantView
3721
+ */
3722
+ expiryUnitCount?: number | null;
3723
+ /**
3724
+ *
3725
+ * @type {string}
3726
+ * @memberof CompanyPlanCreditGrantView
3727
+ */
3728
+ id: string;
3729
+ /**
3730
+ *
3731
+ * @type {GenericPreviewObject}
3732
+ * @memberof CompanyPlanCreditGrantView
3733
+ */
3734
+ plan?: GenericPreviewObject;
3735
+ /**
3736
+ *
3737
+ * @type {string}
3738
+ * @memberof CompanyPlanCreditGrantView
3739
+ */
3740
+ planId: string;
3741
+ /**
3742
+ *
3743
+ * @type {string}
3744
+ * @memberof CompanyPlanCreditGrantView
3745
+ */
3746
+ planVersionId?: string | null;
3747
+ /**
3748
+ * Deprecated field, will be removed in the future. Use Credit.PluralName instead.
3749
+ * @type {string}
3750
+ * @memberof CompanyPlanCreditGrantView
3751
+ * @deprecated
3752
+ */
3753
+ pluralName?: string | null;
3754
+ /**
3755
+ *
3756
+ * @type {BillingPlanCreditGrantResetCadence}
3757
+ * @memberof CompanyPlanCreditGrantView
3758
+ */
3759
+ resetCadence?: BillingPlanCreditGrantResetCadence | null;
3760
+ /**
3761
+ *
3762
+ * @type {BillingPlanCreditGrantResetStart}
3763
+ * @memberof CompanyPlanCreditGrantView
3764
+ */
3765
+ resetStart?: BillingPlanCreditGrantResetStart | null;
3766
+ /**
3767
+ *
3768
+ * @type {BillingPlanCreditGrantResetType}
3769
+ * @memberof CompanyPlanCreditGrantView
3770
+ */
3771
+ resetType: BillingPlanCreditGrantResetType;
3772
+ /**
3773
+ * Deprecated field, will be removed in the future. Use Credit.SingularName instead.
3774
+ * @type {string}
3775
+ * @memberof CompanyPlanCreditGrantView
3776
+ * @deprecated
3777
+ */
3778
+ singularName?: string | null;
3779
+ /**
3780
+ *
3781
+ * @type {Date}
3782
+ * @memberof CompanyPlanCreditGrantView
3783
+ */
3784
+ updatedAt: Date;
3785
+ }
3786
+
3558
3787
  /**
3559
3788
  *
3560
3789
  * @export
@@ -3854,10 +4083,10 @@ declare interface CompanyPlanWithBillingSubView {
3854
4083
  imageUrl?: string | null;
3855
4084
  /**
3856
4085
  *
3857
- * @type {Array<PlanCreditGrantView>}
4086
+ * @type {Array<CompanyPlanCreditGrantView>}
3858
4087
  * @memberof CompanyPlanWithBillingSubView
3859
4088
  */
3860
- includedCreditGrants: Array<PlanCreditGrantView>;
4089
+ includedCreditGrants: Array<CompanyPlanCreditGrantView>;
3861
4090
  /**
3862
4091
  *
3863
4092
  * @type {string}
@@ -5303,6 +5532,14 @@ declare interface CustomPlanBillingResponseData {
5303
5532
  updatedAt: Date;
5304
5533
  }
5305
5534
 
5535
+ export declare interface CustomPlanBillingState {
5536
+ billing: CustomPlanBillingResponseData;
5537
+ planName?: string;
5538
+ deadline: Date;
5539
+ isAwaitingActivation: boolean;
5540
+ isAwaitingPayment: boolean;
5541
+ }
5542
+
5306
5543
  /**
5307
5544
  *
5308
5545
  * @export
@@ -5806,7 +6043,7 @@ export declare interface EmbedState {
5806
6043
  currencyFilter?: string[];
5807
6044
  }
5808
6045
 
5809
- export declare const Entitlement: ({ entitlement, period, credits, tooltipPortal, currency: selectedCurrency, }: EntitlementProps) => JSX.Element;
6046
+ export declare const Entitlement: ({ portal, entitlement, period, credits, currency: selectedCurrency, }: EntitlementProps) => JSX.Element;
5810
6047
 
5811
6048
  /**
5812
6049
  *
@@ -5889,10 +6126,10 @@ declare const EntitlementPriceBehavior_2: {
5889
6126
  declare type EntitlementPriceBehavior_2 = (typeof EntitlementPriceBehavior_2)[keyof typeof EntitlementPriceBehavior_2];
5890
6127
 
5891
6128
  export declare interface EntitlementProps {
6129
+ portal?: HTMLElement | null;
5892
6130
  entitlement: PlanEntitlementResponseData;
5893
6131
  period: string;
5894
6132
  credits: Credit[];
5895
- tooltipPortal?: HTMLElement | null;
5896
6133
  currency?: string;
5897
6134
  }
5898
6135
 
@@ -8242,7 +8479,7 @@ declare interface PaymentMethodResponseData {
8242
8479
  updatedAt: Date;
8243
8480
  }
8244
8481
 
8245
- export declare const Plan: ({ isLoading, plans, selectedPlan, period, selectPlan, shouldTrial, tooltipPortal, currency, }: PlanProps) => JSX.Element;
8482
+ export declare const Plan: ({ portal, isLoading, plans, selectedPlan, period, selectPlan, shouldTrial, currency, }: PlanProps) => JSX.Element;
8246
8483
 
8247
8484
  declare type Plan_2 = CompanyPlanDetailResponseData;
8248
8485
 
@@ -8288,6 +8525,12 @@ declare interface PlanCreditGrantView {
8288
8525
  * @memberof PlanCreditGrantView
8289
8526
  */
8290
8527
  billingCreditAutoTopupExpiryUnitCount?: number | null;
8528
+ /**
8529
+ *
8530
+ * @type {boolean}
8531
+ * @memberof PlanCreditGrantView
8532
+ */
8533
+ billingCreditAutoTopupSelfService: boolean;
8291
8534
  /**
8292
8535
  *
8293
8536
  * @type {number}
@@ -8469,6 +8712,12 @@ declare interface PlanCreditGrantView_2 {
8469
8712
  * @memberof PlanCreditGrantView
8470
8713
  */
8471
8714
  billingCreditAutoTopupExpiryUnitCount?: number | null;
8715
+ /**
8716
+ *
8717
+ * @type {boolean}
8718
+ * @memberof PlanCreditGrantView
8719
+ */
8720
+ billingCreditAutoTopupSelfService: boolean;
8472
8721
  /**
8473
8722
  *
8474
8723
  * @type {number}
@@ -9271,6 +9520,7 @@ portal?: HTMLElement | null;
9271
9520
  export declare type PlanManagerProps = DesignProps_6;
9272
9521
 
9273
9522
  declare interface PlanProps {
9523
+ portal?: HTMLElement | null;
9274
9524
  isLoading: boolean;
9275
9525
  plans: SelectedPlan[];
9276
9526
  selectedPlan?: SelectedPlan;
@@ -9281,7 +9531,6 @@ declare interface PlanProps {
9281
9531
  shouldTrial?: boolean;
9282
9532
  }) => void;
9283
9533
  shouldTrial: boolean;
9284
- tooltipPortal?: HTMLElement | null;
9285
9534
  currency?: string;
9286
9535
  }
9287
9536
 
@@ -10344,15 +10593,15 @@ declare interface PublicPlansResponseData {
10344
10593
  showZeroPriceAsFree: boolean;
10345
10594
  }
10346
10595
 
10347
- export declare const Quantity: ({ entitlements, updateQuantity, period, tooltipPortal, currency: selectedCurrency, }: QuantityProps) => JSX.Element;
10596
+ export declare const Quantity: ({ portal, entitlements, updateQuantity, period, currency: selectedCurrency, }: QuantityProps) => JSX.Element;
10348
10597
 
10349
10598
  declare interface QuantityProps {
10599
+ portal?: HTMLElement | null;
10350
10600
  isLoading: boolean;
10351
10601
  period: string;
10352
10602
  selectedPlan?: SelectedPlan;
10353
10603
  entitlements: UsageBasedEntitlement[];
10354
10604
  updateQuantity: (id: string, quantity: number) => void;
10355
- tooltipPortal?: HTMLElement | null;
10356
10605
  currency?: string;
10357
10606
  }
10358
10607
 
@@ -11158,6 +11407,8 @@ declare type SharedEntitlementUsageProps = {
11158
11407
  quantity: number;
11159
11408
  };
11160
11409
 
11410
+ declare type Status = "idle" | "confirming" | "succeeded" | "failed";
11411
+
11161
11412
  /**
11162
11413
  * Schematic API
11163
11414
  * Schematic API
@@ -11261,12 +11512,14 @@ export declare interface ThemeSettings {
11261
11512
  };
11262
11513
  }
11263
11514
 
11264
- export declare const Tooltip: ({ children, trigger, content, portal, position, ...rest }: TooltipProps) => JSX.Element;
11515
+ export declare const Toggle: IStyledComponentBase<"web", FastOmit<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof ClassAttributes<HTMLInputElement> | keyof InputHTMLAttributes<HTMLInputElement>> & ClassAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLInputElement>, "type"> & Partial<Pick<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof ClassAttributes<HTMLInputElement> | keyof InputHTMLAttributes<HTMLInputElement>> & ClassAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLInputElement>, "type">>> & string;
11516
+
11517
+ export declare const Tooltip: ({ children, portal, trigger, content, position, ...rest }: TooltipProps) => JSX.Element;
11265
11518
 
11266
11519
  export declare interface TooltipProps extends BoxProps {
11267
- trigger: React.ReactElement;
11268
- content: React.ReactNode;
11269
11520
  portal?: HTMLElement | null;
11521
+ trigger: React.ReactElement<BoxProps & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
11522
+ content: React.ReactNode;
11270
11523
  position?: Position;
11271
11524
  }
11272
11525
 
@@ -11438,6 +11691,49 @@ declare interface UpdateAddOnRequestBody {
11438
11691
  priceId: string;
11439
11692
  }
11440
11693
 
11694
+ /**
11695
+ * Schematic API
11696
+ * Schematic API
11697
+ *
11698
+ * The version of the OpenAPI document: 0.1
11699
+ *
11700
+ *
11701
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11702
+ * https://openapi-generator.tech
11703
+ * Do not edit the class manually.
11704
+ */
11705
+ /**
11706
+ *
11707
+ * @export
11708
+ * @interface UpdateAutoTopupOverrideRequestBody
11709
+ */
11710
+ declare interface UpdateAutoTopupOverrideRequestBody {
11711
+ /**
11712
+ *
11713
+ * @type {number}
11714
+ * @memberof UpdateAutoTopupOverrideRequestBody
11715
+ */
11716
+ autoTopupAmount?: number | null;
11717
+ /**
11718
+ *
11719
+ * @type {boolean}
11720
+ * @memberof UpdateAutoTopupOverrideRequestBody
11721
+ */
11722
+ autoTopupEnabled?: boolean | null;
11723
+ /**
11724
+ *
11725
+ * @type {number}
11726
+ * @memberof UpdateAutoTopupOverrideRequestBody
11727
+ */
11728
+ autoTopupThresholdCredits?: number | null;
11729
+ /**
11730
+ *
11731
+ * @type {string}
11732
+ * @memberof UpdateAutoTopupOverrideRequestBody
11733
+ */
11734
+ planCreditGrantId: string;
11735
+ }
11736
+
11441
11737
  /**
11442
11738
  * Schematic API
11443
11739
  * Schematic API
@@ -11623,6 +11919,8 @@ export declare function useAvailablePlans(activePeriod: string, options?: Availa
11623
11919
  periods: string[];
11624
11920
  };
11625
11921
 
11922
+ export declare function useCustomPlanBilling(): CustomPlanBillingState | undefined;
11923
+
11626
11924
  export declare const useEmbed: () => EmbedContextProps;
11627
11925
 
11628
11926
  export declare function useIsLightBackground(): boolean;
@@ -11641,7 +11939,7 @@ declare interface UsePaymentConfirmationReturn {
11641
11939
  confirmPayment: () => Promise<void>;
11642
11940
  isConfirming: boolean;
11643
11941
  error: Error | null;
11644
- status: "idle" | "confirming" | "succeeded" | "failed";
11942
+ status: Status;
11645
11943
  reset: () => void;
11646
11944
  }
11647
11945