@schematichq/schematic-components 2.8.4 → 2.9.0-rc.1

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.
@@ -17,13 +17,14 @@ import { RuleSet } from 'styled-components';
17
17
  import type { Stripe } from '@stripe/stripe-js';
18
18
  import { Substitute } from 'styled-components/dist/types';
19
19
 
20
- export declare const AddOns: ({ addOns, toggle, isLoading, period }: AddOnsProps) => JSX.Element;
20
+ export declare const AddOns: ({ addOns, toggle, isLoading, period, currency, }: AddOnsProps) => JSX.Element;
21
21
 
22
22
  declare interface AddOnsProps {
23
23
  addOns: SelectedPlan[];
24
24
  toggle: (id: string) => void;
25
25
  isLoading: boolean;
26
26
  period: string;
27
+ currency?: string;
27
28
  }
28
29
 
29
30
  declare interface AvailablePlanOptions {
@@ -260,6 +261,7 @@ declare type BillingCreditExpiryUnit_2 = (typeof BillingCreditExpiryUnit_2)[keyo
260
261
  * @export
261
262
  */
262
263
  declare const BillingCreditGrantReason: {
264
+ readonly Adjustment: "adjustment";
263
265
  readonly BillingCreditAutoTopup: "billing_credit_auto_topup";
264
266
  readonly Free: "free";
265
267
  readonly Plan: "plan";
@@ -2974,6 +2976,7 @@ export declare type CheckoutState = {
2974
2976
  bypassCreditsSelection?: boolean;
2975
2977
  addOnIds?: string[];
2976
2978
  hideSkippedStages?: boolean;
2979
+ selectedCurrency?: string;
2977
2980
  };
2978
2981
 
2979
2982
  /**
@@ -4850,12 +4853,13 @@ declare interface CreditGrantDetail {
4850
4853
  quantity: number;
4851
4854
  }
4852
4855
 
4853
- export declare const Credits: ({ bundles, updateCount }: CreditsProps) => JSX.Element;
4856
+ export declare const Credits: ({ bundles, updateCount, currency }: CreditsProps) => JSX.Element;
4854
4857
 
4855
4858
  declare interface CreditsProps {
4856
4859
  isLoading: boolean;
4857
4860
  bundles: CreditBundle[];
4858
4861
  updateCount: (id: string, count: number) => void;
4862
+ currency?: string;
4859
4863
  }
4860
4864
 
4861
4865
  /**
@@ -5285,6 +5289,7 @@ declare interface DesignProps_6 {
5285
5289
 
5286
5290
  declare interface DesignProps_7 {
5287
5291
  showPeriodToggle: boolean;
5292
+ showCurrencySelector: boolean;
5288
5293
  showDiscount: boolean;
5289
5294
  header: {
5290
5295
  isVisible: boolean;
@@ -5458,7 +5463,7 @@ export declare interface EmbedState {
5458
5463
  checkoutState?: CheckoutState;
5459
5464
  }
5460
5465
 
5461
- export declare const Entitlement: ({ entitlement, period, credits, tooltipPortal, }: EntitlementProps) => JSX.Element;
5466
+ export declare const Entitlement: ({ entitlement, period, credits, tooltipPortal, currency: selectedCurrency, }: EntitlementProps) => JSX.Element;
5462
5467
 
5463
5468
  /**
5464
5469
  *
@@ -5545,6 +5550,7 @@ export declare interface EntitlementProps {
5545
5550
  period: string;
5546
5551
  credits: Credit[];
5547
5552
  tooltipPortal?: HTMLElement | null;
5553
+ currency?: string;
5548
5554
  }
5549
5555
 
5550
5556
  /**
@@ -7622,7 +7628,7 @@ declare interface PaymentMethodResponseData {
7622
7628
  updatedAt: Date;
7623
7629
  }
7624
7630
 
7625
- export declare const Plan: ({ isLoading, plans, selectedPlan, period, selectPlan, shouldTrial, tooltipPortal, }: PlanProps) => JSX.Element;
7631
+ export declare const Plan: ({ isLoading, plans, selectedPlan, period, selectPlan, shouldTrial, tooltipPortal, currency, }: PlanProps) => JSX.Element;
7626
7632
 
7627
7633
  declare type Plan_2 = CompanyPlanDetailResponseData;
7628
7634
 
@@ -8568,6 +8574,7 @@ declare interface PlanProps {
8568
8574
  }) => void;
8569
8575
  shouldTrial: boolean;
8570
8576
  tooltipPortal?: HTMLElement | null;
8577
+ currency?: string;
8571
8578
  }
8572
8579
 
8573
8580
  /**
@@ -9581,7 +9588,7 @@ declare interface PublicPlansResponseData {
9581
9588
  showZeroPriceAsFree: boolean;
9582
9589
  }
9583
9590
 
9584
- export declare const Quantity: ({ entitlements, updateQuantity, period, tooltipPortal, }: QuantityProps) => JSX.Element;
9591
+ export declare const Quantity: ({ entitlements, updateQuantity, period, tooltipPortal, currency: selectedCurrency, }: QuantityProps) => JSX.Element;
9585
9592
 
9586
9593
  declare interface QuantityProps {
9587
9594
  isLoading: boolean;
@@ -9590,6 +9597,7 @@ declare interface QuantityProps {
9590
9597
  entitlements: UsageBasedEntitlement[];
9591
9598
  updateQuantity: (id: string, quantity: number) => void;
9592
9599
  tooltipPortal?: HTMLElement | null;
9600
+ currency?: string;
9593
9601
  }
9594
9602
 
9595
9603
  declare interface RequestContext {
@@ -10788,6 +10796,8 @@ declare interface UsageBasedEntitlementResponseData {
10788
10796
  yearlyUsageBasedPrice?: BillingPriceView;
10789
10797
  }
10790
10798
 
10799
+ export declare function useAvailableCurrencies(): string[];
10800
+
10791
10801
  export declare function useAvailablePlans(activePeriod: string, options?: AvailablePlanOptions): {
10792
10802
  plans: SelectedPlan[];
10793
10803
  addOns: SelectedPlan[];
@@ -10820,6 +10830,13 @@ export declare function useRequest<TData>(fn: () => Promise<{
10820
10830
  data: TData;
10821
10831
  }> | undefined): [RequestState<TData>, () => Promise<void>];
10822
10832
 
10833
+ /**
10834
+ * Returns the currency of the company's active subscription, if any.
10835
+ * Stripe does not allow mixing currencies on a subscription, so when
10836
+ * this is set the currency selector should be locked.
10837
+ */
10838
+ export declare function useSubscriptionCurrency(): string | undefined;
10839
+
10823
10840
  export declare function useTrialEnd(): {
10824
10841
  endDate: Date | undefined;
10825
10842
  amount: number | undefined;