@schematichq/schematic-components 2.14.1 → 2.16.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.
- package/dist/schematic-components.cjs.js +1937 -1322
- package/dist/schematic-components.d.ts +75 -7
- package/dist/schematic-components.esm.js +1673 -1058
- package/package.json +18 -18
|
@@ -4,14 +4,13 @@ import { Context } from 'react';
|
|
|
4
4
|
import { DetailedHTMLProps } from 'react';
|
|
5
5
|
import { FastOmit } from 'styled-components';
|
|
6
6
|
import { ForwardRefExoticComponent } from 'react';
|
|
7
|
-
import { HTMLAttributeAnchorTarget } from 'react';
|
|
8
7
|
import { HTMLAttributes } from 'react';
|
|
9
8
|
import { IconNames } from '@schematichq/schematic-icons';
|
|
10
9
|
import { IconProps as IconProps_2 } from '@schematichq/schematic-icons';
|
|
11
10
|
import { iconsList } from '@schematichq/schematic-icons';
|
|
12
11
|
import { InputHTMLAttributes } from 'react';
|
|
13
12
|
import { IStyledComponentBase } from 'styled-components/dist/types';
|
|
14
|
-
import { JSX } from 'react
|
|
13
|
+
import { JSX } from 'react';
|
|
15
14
|
import { RefAttributes } from 'react';
|
|
16
15
|
import { RuleSet } from 'styled-components';
|
|
17
16
|
import type { Stripe } from '@stripe/stripe-js';
|
|
@@ -297,6 +296,7 @@ declare const BillingCreditGrantZeroedOutReason: {
|
|
|
297
296
|
readonly Manual: "manual";
|
|
298
297
|
readonly PlanChange: "plan_change";
|
|
299
298
|
readonly PlanPeriodReset: "plan_period_reset";
|
|
299
|
+
readonly Reconciled: "reconciled";
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
declare type BillingCreditGrantZeroedOutReason = (typeof BillingCreditGrantZeroedOutReason)[keyof typeof BillingCreditGrantZeroedOutReason];
|
|
@@ -2882,6 +2882,25 @@ export declare interface BypassConfig {
|
|
|
2882
2882
|
* is not eligible for a trial.
|
|
2883
2883
|
*/
|
|
2884
2884
|
startTrialIfAvailable?: boolean;
|
|
2885
|
+
/**
|
|
2886
|
+
* Currency to pre-select (e.g. "EUR"). Case-insensitive.
|
|
2887
|
+
*
|
|
2888
|
+
* Useful for flows that skip the plan stage: the host can pin the checkout
|
|
2889
|
+
* to a currency the customer never had a chance to choose. Ignored when the
|
|
2890
|
+
* company already has an active subscription (its currency is locked), or
|
|
2891
|
+
* when the value is not among the available currencies — in which case the
|
|
2892
|
+
* checkout falls back to the first available currency.
|
|
2893
|
+
*/
|
|
2894
|
+
currency?: string;
|
|
2895
|
+
/**
|
|
2896
|
+
* Whether to show the currency selector dropdown in checkout. Default: true.
|
|
2897
|
+
*
|
|
2898
|
+
* Set to false to hide the dropdown entirely — combine with `currency` to
|
|
2899
|
+
* pin checkout to a single currency the customer cannot change. Has no
|
|
2900
|
+
* effect when there is only one available currency or the subscription
|
|
2901
|
+
* currency is locked (the selector is already hidden in those cases).
|
|
2902
|
+
*/
|
|
2903
|
+
showCurrencySelector?: boolean;
|
|
2885
2904
|
}
|
|
2886
2905
|
|
|
2887
2906
|
export declare const Card: ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement | null>>;
|
|
@@ -2941,6 +2960,12 @@ declare interface ChangeSubscriptionRequestBody {
|
|
|
2941
2960
|
* @memberof ChangeSubscriptionRequestBody
|
|
2942
2961
|
*/
|
|
2943
2962
|
newPriceId: string;
|
|
2963
|
+
/**
|
|
2964
|
+
*
|
|
2965
|
+
* @type {boolean}
|
|
2966
|
+
* @memberof ChangeSubscriptionRequestBody
|
|
2967
|
+
*/
|
|
2968
|
+
optInAccepted?: boolean | null;
|
|
2944
2969
|
/**
|
|
2945
2970
|
*
|
|
2946
2971
|
* @type {Array<UpdatePayInAdvanceRequestBody>}
|
|
@@ -2993,7 +3018,9 @@ declare const ChargeType_2: {
|
|
|
2993
3018
|
|
|
2994
3019
|
declare type ChargeType_2 = (typeof ChargeType_2)[keyof typeof ChargeType_2];
|
|
2995
3020
|
|
|
2996
|
-
export declare const
|
|
3021
|
+
export declare const Checkbox: 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;
|
|
3022
|
+
|
|
3023
|
+
export declare const Checkout: ({ customCheckoutFields, customFieldValues, isPaymentMethodRequired, onCustomFieldChange, optInRequired, optInTitle, optInText, optInAccepted, setOptInAccepted, setPaymentMethodId, updatePromoCode, confirmPaymentIntentProps, financeData, onPaymentMethodSaved, }: CheckoutProps) => JSX.Element | null;
|
|
2997
3024
|
|
|
2998
3025
|
/**
|
|
2999
3026
|
* Host-provided initial values used to pre-populate the checkout payment form.
|
|
@@ -3120,7 +3147,15 @@ export declare interface CheckoutPrefill {
|
|
|
3120
3147
|
}
|
|
3121
3148
|
|
|
3122
3149
|
declare interface CheckoutProps {
|
|
3150
|
+
customCheckoutFields?: CheckoutFieldWithValue[];
|
|
3151
|
+
customFieldValues: Record<string, string>;
|
|
3123
3152
|
isPaymentMethodRequired: boolean;
|
|
3153
|
+
onCustomFieldChange: (fieldId: string, value: string) => void;
|
|
3154
|
+
optInRequired: boolean;
|
|
3155
|
+
optInTitle?: string | null;
|
|
3156
|
+
optInText?: string | null;
|
|
3157
|
+
optInAccepted: boolean;
|
|
3158
|
+
setOptInAccepted: (accepted: boolean) => void;
|
|
3124
3159
|
setPaymentMethodId: (id: string) => void;
|
|
3125
3160
|
updatePromoCode: (code: string) => void;
|
|
3126
3161
|
confirmPaymentIntentProps?: ConfirmPaymentIntentProps_2 | null | undefined;
|
|
@@ -3379,6 +3414,7 @@ export declare type CheckoutState = {
|
|
|
3379
3414
|
addOnIds?: string[];
|
|
3380
3415
|
hideSkippedStages?: boolean;
|
|
3381
3416
|
selectedCurrency?: string;
|
|
3417
|
+
showCurrencySelector?: boolean;
|
|
3382
3418
|
startTrialIfAvailable?: boolean;
|
|
3383
3419
|
};
|
|
3384
3420
|
|
|
@@ -6293,6 +6329,7 @@ export declare interface EmbedContextProps extends EmbedState {
|
|
|
6293
6329
|
checkout: (changeSubscriptionRequestBody: ChangeSubscriptionRequestBody) => DebouncedApiPromise<CheckoutResponse>;
|
|
6294
6330
|
finishCheckout: (changeSubscriptionRequestBody: CheckoutResponseData) => void;
|
|
6295
6331
|
unsubscribe: () => DebouncedApiPromise<CheckoutUnsubscribeResponse>;
|
|
6332
|
+
updateCustomFieldValues: (values: Record<string, string>) => Promise<void> | undefined;
|
|
6296
6333
|
setAccessToken: (token: string) => void;
|
|
6297
6334
|
setError: (error: Error) => void;
|
|
6298
6335
|
setLayout: (layout: EmbedLayout) => void;
|
|
@@ -6913,11 +6950,23 @@ declare interface FeatureEntitlement {
|
|
|
6913
6950
|
*/
|
|
6914
6951
|
creditId?: string | null;
|
|
6915
6952
|
/**
|
|
6916
|
-
* If the company has a credit-based entitlement for this feature, the
|
|
6953
|
+
* If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead
|
|
6917
6954
|
* @type {number}
|
|
6918
6955
|
* @memberof FeatureEntitlement
|
|
6919
6956
|
*/
|
|
6920
6957
|
creditRemaining?: number | null;
|
|
6958
|
+
/**
|
|
6959
|
+
* If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released
|
|
6960
|
+
* @type {number}
|
|
6961
|
+
* @memberof FeatureEntitlement
|
|
6962
|
+
*/
|
|
6963
|
+
creditReserved?: number | null;
|
|
6964
|
+
/**
|
|
6965
|
+
* If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users
|
|
6966
|
+
* @type {number}
|
|
6967
|
+
* @memberof FeatureEntitlement
|
|
6968
|
+
*/
|
|
6969
|
+
creditSettled?: number | null;
|
|
6921
6970
|
/**
|
|
6922
6971
|
* If the company has a credit-based entitlement for this feature, the total credit amount
|
|
6923
6972
|
* @type {number}
|
|
@@ -8222,6 +8271,7 @@ export declare const initialContext: {
|
|
|
8222
8271
|
previewCheckout: () => never;
|
|
8223
8272
|
checkout: () => never;
|
|
8224
8273
|
unsubscribe: () => never;
|
|
8274
|
+
updateCustomFieldValues: () => never;
|
|
8225
8275
|
setError: () => never;
|
|
8226
8276
|
setAccessToken: () => never;
|
|
8227
8277
|
setLayout: () => never;
|
|
@@ -8246,11 +8296,11 @@ export declare const initialContext: {
|
|
|
8246
8296
|
|
|
8247
8297
|
export declare const initialState: EmbedState;
|
|
8248
8298
|
|
|
8249
|
-
export declare const Input: IStyledComponentBase<"web", FastOmit<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$color" | "$
|
|
8299
|
+
export declare const Input: IStyledComponentBase<"web", FastOmit<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$color" | "$size" | "$variant"> & {
|
|
8250
8300
|
$size?: "xs" | "sm" | "md" | "lg" | "full";
|
|
8251
8301
|
$color?: "primary" | "secondary" | "danger";
|
|
8252
8302
|
$variant?: "filled" | "outline" | "ghost" | "text";
|
|
8253
|
-
}, never> & Partial<Pick<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$color" | "$
|
|
8303
|
+
}, never> & Partial<Pick<FastOmit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$color" | "$size" | "$variant"> & {
|
|
8254
8304
|
$size?: "xs" | "sm" | "md" | "lg" | "full";
|
|
8255
8305
|
$color?: "primary" | "secondary" | "danger";
|
|
8256
8306
|
$variant?: "filled" | "outline" | "ghost" | "text";
|
|
@@ -10753,6 +10803,24 @@ declare interface PreviewSubscriptionChangeResponseData {
|
|
|
10753
10803
|
* @deprecated
|
|
10754
10804
|
*/
|
|
10755
10805
|
newCharges: number;
|
|
10806
|
+
/**
|
|
10807
|
+
*
|
|
10808
|
+
* @type {boolean}
|
|
10809
|
+
* @memberof PreviewSubscriptionChangeResponseData
|
|
10810
|
+
*/
|
|
10811
|
+
optInRequired: boolean;
|
|
10812
|
+
/**
|
|
10813
|
+
*
|
|
10814
|
+
* @type {string}
|
|
10815
|
+
* @memberof PreviewSubscriptionChangeResponseData
|
|
10816
|
+
*/
|
|
10817
|
+
optInText?: string | null;
|
|
10818
|
+
/**
|
|
10819
|
+
*
|
|
10820
|
+
* @type {string}
|
|
10821
|
+
* @memberof PreviewSubscriptionChangeResponseData
|
|
10822
|
+
*/
|
|
10823
|
+
optInTitle?: string | null;
|
|
10756
10824
|
/**
|
|
10757
10825
|
*
|
|
10758
10826
|
* @type {boolean}
|
|
@@ -10947,7 +11015,7 @@ export declare const PricingTable: ForwardRefExoticComponent<ElementProps & Deep
|
|
|
10947
11015
|
|
|
10948
11016
|
export declare type PricingTableOptions = {
|
|
10949
11017
|
callToActionUrl?: string;
|
|
10950
|
-
callToActionTarget?: HTMLAttributeAnchorTarget;
|
|
11018
|
+
callToActionTarget?: React.HTMLAttributeAnchorTarget;
|
|
10951
11019
|
onCallToAction?: (plan: PlanViewPublicResponseData | CompanyPlanDetailResponseData) => unknown;
|
|
10952
11020
|
};
|
|
10953
11021
|
|