@schematichq/schematic-components 2.5.1 → 2.6.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.
@@ -293,6 +293,12 @@ declare interface BillingCreditResponseData {
293
293
  * @memberof BillingCreditResponseData
294
294
  */
295
295
  burnStrategy: BillingCreditBurnStrategy;
296
+ /**
297
+ *
298
+ * @type {boolean}
299
+ * @memberof BillingCreditResponseData
300
+ */
301
+ costEditable: boolean;
296
302
  /**
297
303
  *
298
304
  * @type {Date}
@@ -385,6 +391,12 @@ declare interface BillingCreditResponseData_2 {
385
391
  * @memberof BillingCreditResponseData
386
392
  */
387
393
  burnStrategy: BillingCreditBurnStrategy_2;
394
+ /**
395
+ *
396
+ * @type {boolean}
397
+ * @memberof BillingCreditResponseData
398
+ */
399
+ costEditable: boolean;
388
400
  /**
389
401
  *
390
402
  * @type {Date}
@@ -667,6 +679,12 @@ declare interface BillingPlanCreditGrantResponseData {
667
679
  * @memberof BillingPlanCreditGrantResponseData
668
680
  */
669
681
  id: string;
682
+ /**
683
+ *
684
+ * @type {PreviewObjectResponseData}
685
+ * @memberof BillingPlanCreditGrantResponseData
686
+ */
687
+ plan?: PreviewObjectResponseData;
670
688
  /**
671
689
  *
672
690
  * @type {string}
@@ -674,9 +692,10 @@ declare interface BillingPlanCreditGrantResponseData {
674
692
  */
675
693
  planId: string;
676
694
  /**
677
- *
695
+ * Use plan.name from the nested plan object instead
678
696
  * @type {string}
679
697
  * @memberof BillingPlanCreditGrantResponseData
698
+ * @deprecated
680
699
  */
681
700
  planName: string;
682
701
  /**
@@ -2204,6 +2223,20 @@ portal?: HTMLElement | null;
2204
2223
 
2205
2224
  export declare type ButtonElementProps = DesignProps;
2206
2225
 
2226
+ export declare const ButtonGroup: ({ plan, isLoading, isSelected, onSelect, shouldTrial, }: ButtonGroupProps) => JSX.Element;
2227
+
2228
+ export declare interface ButtonGroupProps {
2229
+ plan: SelectedPlan;
2230
+ isLoading: boolean;
2231
+ isSelected: boolean;
2232
+ onSelect: (updates: {
2233
+ plan: SelectedPlan;
2234
+ period?: string;
2235
+ shouldTrial?: boolean;
2236
+ }) => void;
2237
+ shouldTrial?: boolean;
2238
+ }
2239
+
2207
2240
  export declare interface ButtonProps {
2208
2241
  $color?: ButtonColor;
2209
2242
  $size?: ButtonSize;
@@ -2744,6 +2777,12 @@ declare interface CompanyDetailResponseData {
2744
2777
  * @memberof CompanyDetailResponseData
2745
2778
  */
2746
2779
  defaultPaymentMethod?: PaymentMethodResponseData;
2780
+ /**
2781
+ *
2782
+ * @type {Array<FeatureEntitlement>}
2783
+ * @memberof CompanyDetailResponseData
2784
+ */
2785
+ entitlements: Array<FeatureEntitlement>;
2747
2786
  /**
2748
2787
  *
2749
2788
  * @type {Array<EntityTraitDetailResponseData>}
@@ -3679,6 +3718,12 @@ declare interface ComponentDisplaySettings {
3679
3718
  * @memberof ComponentDisplaySettings
3680
3719
  */
3681
3720
  showCredits: boolean;
3721
+ /**
3722
+ *
3723
+ * @type {boolean}
3724
+ * @memberof ComponentDisplaySettings
3725
+ */
3726
+ showFeatureDescription: boolean;
3682
3727
  /**
3683
3728
  *
3684
3729
  * @type {boolean}
@@ -3722,6 +3767,12 @@ declare interface ComponentDisplaySettings_2 {
3722
3767
  * @memberof ComponentDisplaySettings
3723
3768
  */
3724
3769
  showCredits: boolean;
3770
+ /**
3771
+ *
3772
+ * @type {boolean}
3773
+ * @memberof ComponentDisplaySettings
3774
+ */
3775
+ showFeatureDescription: boolean;
3725
3776
  /**
3726
3777
  *
3727
3778
  * @type {boolean}
@@ -4084,9 +4135,9 @@ declare const ConditionConditionTypeEnum: {
4084
4135
  readonly BillingProduct: "billing_product";
4085
4136
  readonly Company: "company";
4086
4137
  readonly Credit: "credit";
4087
- readonly CrmProduct: "crm_product";
4088
4138
  readonly Metric: "metric";
4089
4139
  readonly Plan: "plan";
4140
+ readonly PlanVersion: "plan_version";
4090
4141
  readonly Trait: "trait";
4091
4142
  readonly User: "user";
4092
4143
  };
@@ -4174,6 +4225,10 @@ export declare const ContainerStyle: RuleSet<object>;
4174
4225
 
4175
4226
  export declare const createActiveUsageBasedEntitlementsReducer: (entitlements: FeatureUsageResponseData[], period: string) => (acc: UsageBasedEntitlement[], entitlement: PlanEntitlementResponseData) => UsageBasedEntitlement[];
4176
4227
 
4228
+ declare type Credit = Omit<CreditWithCompanyContext, "companyId" | "companyName" | "bundleId" | "total" | "grants"> & {
4229
+ period?: string;
4230
+ };
4231
+
4177
4232
  declare type CreditBundle = BillingCreditBundleView & {
4178
4233
  count: number;
4179
4234
  };
@@ -4467,6 +4522,28 @@ declare interface CreditTransferView {
4467
4522
  relatedGrantId: string;
4468
4523
  }
4469
4524
 
4525
+ declare interface CreditWithCompanyContext {
4526
+ id: CreditCompanyGrantView["billingCreditId"];
4527
+ name: CreditCompanyGrantView["creditName"];
4528
+ singularName: CreditCompanyGrantView["singularName"];
4529
+ pluralName: CreditCompanyGrantView["pluralName"];
4530
+ description: CreditCompanyGrantView["creditDescription"];
4531
+ icon: CreditCompanyGrantView["creditIcon"];
4532
+ grantReason: CreditCompanyGrantView["grantReason"];
4533
+ quantity: CreditCompanyGrantView["quantity"];
4534
+ companyId: CreditCompanyGrantView["companyId"];
4535
+ companyName: CreditCompanyGrantView["companyName"];
4536
+ planId: CreditCompanyGrantView["planId"];
4537
+ planName: CreditCompanyGrantView["planName"];
4538
+ bundleId: CreditCompanyGrantView["billingCreditBundleId"];
4539
+ total: {
4540
+ value: number;
4541
+ remaining: number;
4542
+ used: number;
4543
+ };
4544
+ grants: CreditCompanyGrantView[];
4545
+ }
4546
+
4470
4547
  /**
4471
4548
  * Schematic API
4472
4549
  * Schematic API
@@ -4659,6 +4736,7 @@ declare interface DesignProps_10 {
4659
4736
  }
4660
4737
 
4661
4738
  declare interface DesignProps_2 {
4739
+ visibleFeatures?: string[];
4662
4740
  header: {
4663
4741
  isVisible: boolean;
4664
4742
  fontStyle: FontStyle;
@@ -4669,7 +4747,7 @@ declare interface DesignProps_2 {
4669
4747
  fontStyle: FontStyle;
4670
4748
  style: "light" | "dark";
4671
4749
  };
4672
- entitlement: {
4750
+ description: {
4673
4751
  isVisible: boolean;
4674
4752
  fontStyle: FontStyle;
4675
4753
  };
@@ -4677,11 +4755,14 @@ declare interface DesignProps_2 {
4677
4755
  isVisible: boolean;
4678
4756
  fontStyle: FontStyle;
4679
4757
  };
4758
+ entitlement: {
4759
+ isVisible: boolean;
4760
+ fontStyle: FontStyle;
4761
+ };
4680
4762
  usage: {
4681
4763
  isVisible: boolean;
4682
4764
  fontStyle: FontStyle;
4683
4765
  };
4684
- visibleFeatures?: string[];
4685
4766
  }
4686
4767
 
4687
4768
  declare interface DesignProps_3 {
@@ -4937,6 +5018,8 @@ export declare interface EmbedState {
4937
5018
  checkoutState?: CheckoutState;
4938
5019
  }
4939
5020
 
5021
+ export declare const Entitlement: ({ entitlement, period, credits, tooltipPortal, }: EntitlementProps) => JSX.Element;
5022
+
4940
5023
  /**
4941
5024
  *
4942
5025
  * @export
@@ -4965,6 +5048,13 @@ declare const EntitlementPriceBehavior_2: {
4965
5048
 
4966
5049
  declare type EntitlementPriceBehavior_2 = (typeof EntitlementPriceBehavior_2)[keyof typeof EntitlementPriceBehavior_2];
4967
5050
 
5051
+ export declare interface EntitlementProps {
5052
+ entitlement: PlanEntitlementResponseData;
5053
+ period: string;
5054
+ credits: Credit[];
5055
+ tooltipPortal?: HTMLElement | null;
5056
+ }
5057
+
4968
5058
  /**
4969
5059
  *
4970
5060
  * @export
@@ -5623,6 +5713,120 @@ declare interface FeatureDetailResponseData_2 {
5623
5713
  updatedAt: Date;
5624
5714
  }
5625
5715
 
5716
+ /**
5717
+ *
5718
+ * @export
5719
+ * @interface FeatureEntitlement
5720
+ */
5721
+ declare interface FeatureEntitlement {
5722
+ /**
5723
+ * If the company has a numeric entitlement for this feature, the allocated amount
5724
+ * @type {number}
5725
+ * @memberof FeatureEntitlement
5726
+ */
5727
+ allocation?: number | null;
5728
+ /**
5729
+ * If the company has a credit-based entitlement for this feature, the ID of the credit
5730
+ * @type {string}
5731
+ * @memberof FeatureEntitlement
5732
+ */
5733
+ creditId?: string | null;
5734
+ /**
5735
+ * If the company has a credit-based entitlement for this feature, the remaining credit amount
5736
+ * @type {number}
5737
+ * @memberof FeatureEntitlement
5738
+ */
5739
+ creditRemaining?: number | null;
5740
+ /**
5741
+ * If the company has a credit-based entitlement for this feature, the total credit amount
5742
+ * @type {number}
5743
+ * @memberof FeatureEntitlement
5744
+ */
5745
+ creditTotal?: number | null;
5746
+ /**
5747
+ * If the company has a credit-based entitlement for this feature, the amount of credit used
5748
+ * @type {number}
5749
+ * @memberof FeatureEntitlement
5750
+ */
5751
+ creditUsed?: number | null;
5752
+ /**
5753
+ * If the feature is event-based, the name of the event tracked for usage
5754
+ * @type {string}
5755
+ * @memberof FeatureEntitlement
5756
+ */
5757
+ eventName?: string | null;
5758
+ /**
5759
+ * The ID of the feature
5760
+ * @type {string}
5761
+ * @memberof FeatureEntitlement
5762
+ */
5763
+ featureId: string;
5764
+ /**
5765
+ * The key of the flag associated with the feature
5766
+ * @type {string}
5767
+ * @memberof FeatureEntitlement
5768
+ */
5769
+ featureKey: string;
5770
+ /**
5771
+ * For event-based feature entitlements, the period over which usage is tracked
5772
+ * @type {string}
5773
+ * @memberof FeatureEntitlement
5774
+ */
5775
+ metricPeriod?: FeatureEntitlementMetricPeriodEnum | null;
5776
+ /**
5777
+ * For event-based feature entitlements, when the usage period will reset
5778
+ * @type {Date}
5779
+ * @memberof FeatureEntitlement
5780
+ */
5781
+ metricResetAt?: Date | null;
5782
+ /**
5783
+ * For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle
5784
+ * @type {string}
5785
+ * @memberof FeatureEntitlement
5786
+ */
5787
+ monthReset?: FeatureEntitlementMonthResetEnum | null;
5788
+ /**
5789
+ * For usage-based pricing, the soft limit for overage charges or the next tier boundary
5790
+ * @type {number}
5791
+ * @memberof FeatureEntitlement
5792
+ */
5793
+ softLimit?: number | null;
5794
+ /**
5795
+ * If the company has a numeric entitlement for this feature, the current usage amount
5796
+ * @type {number}
5797
+ * @memberof FeatureEntitlement
5798
+ */
5799
+ usage?: number | null;
5800
+ /**
5801
+ *
5802
+ * @type {EntitlementValueType}
5803
+ * @memberof FeatureEntitlement
5804
+ */
5805
+ valueType: EntitlementValueType;
5806
+ }
5807
+
5808
+ /**
5809
+ * @export
5810
+ */
5811
+ declare const FeatureEntitlementMetricPeriodEnum: {
5812
+ readonly AllTime: "all_time";
5813
+ readonly CurrentDay: "current_day";
5814
+ readonly CurrentMonth: "current_month";
5815
+ readonly CurrentWeek: "current_week";
5816
+ };
5817
+
5818
+ declare type FeatureEntitlementMetricPeriodEnum = (typeof FeatureEntitlementMetricPeriodEnum)[keyof typeof FeatureEntitlementMetricPeriodEnum];
5819
+
5820
+ /**
5821
+ * @export
5822
+ */
5823
+ declare const FeatureEntitlementMonthResetEnum: {
5824
+ readonly FirstOfMonth: "first_of_month";
5825
+ readonly BillingCycle: "billing_cycle";
5826
+ };
5827
+
5828
+ declare type FeatureEntitlementMonthResetEnum = (typeof FeatureEntitlementMonthResetEnum)[keyof typeof FeatureEntitlementMonthResetEnum];
5829
+
5626
5830
  /**
5627
5831
  *
5628
5832
  * @export
@@ -6413,6 +6617,49 @@ declare interface GenericPreviewObject {
6413
6617
  name: string;
6414
6618
  }
6415
6619
 
6620
+ /**
6621
+ * Schematic API
6622
+ * Schematic API
6623
+ *
6624
+ * The version of the OpenAPI document: 0.1
6625
+ *
6626
+ *
6627
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6628
+ * https://openapi-generator.tech
6629
+ * Do not edit the class manually.
6630
+ */
6631
+ /**
6632
+ *
6633
+ * @export
6634
+ * @interface GenericPreviewObject
6635
+ */
6636
+ declare interface GenericPreviewObject_2 {
6637
+ /**
6638
+ *
6639
+ * @type {string}
6640
+ * @memberof GenericPreviewObject
6641
+ */
6642
+ description?: string | null;
6643
+ /**
6644
+ *
6645
+ * @type {string}
6646
+ * @memberof GenericPreviewObject
6647
+ */
6648
+ id: string;
6649
+ /**
6650
+ *
6651
+ * @type {string}
6652
+ * @memberof GenericPreviewObject
6653
+ */
6654
+ imageUrl?: string | null;
6655
+ /**
6656
+ *
6657
+ * @type {string}
6658
+ * @memberof GenericPreviewObject
6659
+ */
6660
+ name: string;
6661
+ }
6662
+
6416
6663
  /**
6417
6664
  *
6418
6665
  * @export
@@ -6648,6 +6895,19 @@ export declare type InvoicesProps = DesignProps_3 & {
6648
6895
  data?: InvoiceResponseData[];
6649
6896
  };
6650
6897
 
6898
+ export declare const LeadingLineHeightMap: Record<LeadingNameType, number>;
6899
+
6900
+ export declare enum LeadingName {
6901
+ None = "none",
6902
+ Tight = "tight",
6903
+ Snug = "snug",
6904
+ Normal = "normal",
6905
+ Relaxed = "relaxed",
6906
+ Loose = "loose"
6907
+ }
6908
+
6909
+ export declare type LeadingNameType = `${LeadingName}`;
6910
+
6651
6911
  /**
6652
6912
  * Schematic API
6653
6913
  * Schematic API
@@ -7018,16 +7278,16 @@ declare interface PlanCreditGrantView {
7018
7278
  id: string;
7019
7279
  /**
7020
7280
  *
7021
- * @type {string}
7281
+ * @type {GenericPreviewObject}
7022
7282
  * @memberof PlanCreditGrantView
7023
7283
  */
7024
- planId: string;
7284
+ plan?: GenericPreviewObject;
7025
7285
  /**
7026
7286
  *
7027
7287
  * @type {string}
7028
7288
  * @memberof PlanCreditGrantView
7029
7289
  */
7030
- planName: string;
7290
+ planId: string;
7031
7291
  /**
7032
7292
  *
7033
7293
  * @type {string}
@@ -7176,16 +7436,16 @@ declare interface PlanCreditGrantView_2 {
7176
7436
  id: string;
7177
7437
  /**
7178
7438
  *
7179
- * @type {string}
7439
+ * @type {GenericPreviewObject}
7180
7440
  * @memberof PlanCreditGrantView
7181
7441
  */
7182
- planId: string;
7442
+ plan?: GenericPreviewObject_2;
7183
7443
  /**
7184
7444
  *
7185
7445
  * @type {string}
7186
7446
  * @memberof PlanCreditGrantView
7187
7447
  */
7188
- planName: string;
7448
+ planId: string;
7189
7449
  /**
7190
7450
  *
7191
7451
  * @type {string}
@@ -8681,7 +8941,7 @@ declare interface PublicPlansResponseData {
8681
8941
  showZeroPriceAsFree: boolean;
8682
8942
  }
8683
8943
 
8684
- export declare const Quantity: ({ entitlements, updateQuantity, period, }: QuantityProps) => JSX.Element;
8944
+ export declare const Quantity: ({ entitlements, updateQuantity, period, tooltipPortal, }: QuantityProps) => JSX.Element;
8685
8945
 
8686
8946
  declare interface QuantityProps {
8687
8947
  isLoading: boolean;
@@ -8689,6 +8949,7 @@ declare interface QuantityProps {
8689
8949
  selectedPlan?: SelectedPlan;
8690
8950
  entitlements: UsageBasedEntitlement[];
8691
8951
  updateQuantity: (id: string, quantity: number) => void;
8952
+ tooltipPortal?: HTMLElement | null;
8692
8953
  }
8693
8954
 
8694
8955
  declare interface RequestContext {
@@ -9320,10 +9581,17 @@ declare type RuleRuleTypeEnum = (typeof RuleRuleTypeEnum)[keyof typeof RuleRuleT
9320
9581
 
9321
9582
  export declare const SchematicEmbed: ({ id, accessToken }: EmbedProps) => JSX.Element;
9322
9583
 
9584
+ export declare const Selected: ({ isCurrent, isTrial, }: SelectedProps) => JSX.Element;
9585
+
9323
9586
  declare type SelectedPlan = Plan_2 & {
9324
9587
  isSelected: boolean;
9325
9588
  };
9326
9589
 
9590
+ export declare interface SelectedProps {
9591
+ isCurrent?: boolean;
9592
+ isTrial?: boolean;
9593
+ }
9594
+
9327
9595
  /**
9328
9596
  * Schematic API
9329
9597
  * Schematic API
@@ -9367,6 +9635,12 @@ declare interface SetupIntentResponseData {
9367
9635
  setupIntentClientSecret?: string | null;
9368
9636
  }
9369
9637
 
9638
+ declare type SharedEntitlementUsageProps = {
9639
+ allocation: number;
9640
+ usage: number;
9641
+ quantity: number;
9642
+ };
9643
+
9370
9644
  /**
9371
9645
  * Schematic API
9372
9646
  * Schematic API
@@ -9423,7 +9697,7 @@ portal?: HTMLElement | null;
9423
9697
 
9424
9698
  export declare type TextElementProps = DesignProps_8;
9425
9699
 
9426
- export declare enum TextPropNames {
9700
+ export declare enum TextPropName {
9427
9701
  Font = "$font",
9428
9702
  Size = "$size",
9429
9703
  Weight = "$weight",
@@ -9432,7 +9706,7 @@ export declare enum TextPropNames {
9432
9706
  Align = "$align"
9433
9707
  }
9434
9708
 
9435
- export declare type TextPropNameTypes = `${TextPropNames}`;
9709
+ export declare type TextPropNameType = `${TextPropName}`;
9436
9710
 
9437
9711
  export declare interface TextProps {
9438
9712
  display?: FontStyle;
@@ -9441,7 +9715,7 @@ export declare interface TextProps {
9441
9715
  $size?: ComponentProps["$fontSize"];
9442
9716
  $weight?: ComponentProps["$fontWeight"];
9443
9717
  $color?: ComponentProps["$color"];
9444
- $leading?: ComponentProps["$lineHeight"];
9718
+ $leading?: LeadingNameType;
9445
9719
  $align?: ComponentProps["$textAlign"];
9446
9720
  }
9447
9721
 
@@ -9697,11 +9971,7 @@ declare interface UpdatePaymentMethodResponse {
9697
9971
  params: object;
9698
9972
  }
9699
9973
 
9700
- declare interface UsageBasedEntitlement extends PlanEntitlementResponseData {
9701
- allocation: number;
9702
- usage: number;
9703
- quantity: number;
9704
- }
9974
+ declare type UsageBasedEntitlement = PlanEntitlementResponseData & SharedEntitlementUsageProps;
9705
9975
 
9706
9976
  /**
9707
9977
  *