@stripe/react-stripe-js
Advanced tools
Comparing version 1.12.0 to 1.13.0
@@ -141,2 +141,34 @@ import { FunctionComponent, PropsWithChildren, ReactNode } from "react"; | ||
type CardCvcElementComponent = FunctionComponent<CardCvcElementProps>; | ||
interface CartElementProps extends ElementProps { | ||
/** | ||
* An object containing [Element configuration options](https://stripe.com/docs/js/elements_object/create_cart_element#cart_element_create-options). | ||
*/ | ||
options?: stripeJs.StripeCartElementOptions; | ||
/** | ||
* Triggered when data exposed by this Element is changed (e.g., when there is an error). | ||
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_change?type=cartElement). | ||
*/ | ||
onChange?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element is fully rendered and can accept imperative `element.focus()` calls. | ||
* Called with a reference to the underlying [Element instance](https://stripe.com/docs/js/element). | ||
*/ | ||
onReady?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element fails to load. | ||
*/ | ||
onLoadError?: (event: { | ||
elementType: "cart"; | ||
error: StripeError; | ||
}) => any; | ||
/** | ||
* Triggered when the "Checkout" button is clicked within the Element. | ||
*/ | ||
onCheckout?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when a line item's link is clicked within the Element. | ||
*/ | ||
onLineItemClick?: (event: stripeJs.StripeCartElementLineItemClickEvent) => any; | ||
} | ||
type CartElementComponent = FunctionComponent<CartElementProps>; | ||
interface FpxBankElementProps extends ElementProps { | ||
@@ -489,2 +521,7 @@ /** | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=cart) for the `CartElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
* Returns `null` if no `CartElement` is rendered in the current `Elements` provider tree. | ||
*/ | ||
getElement(component: CartElementComponent): stripeJs.StripeCartElement | null; | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=fpxBank) for the `FpxBankElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
@@ -667,2 +704,9 @@ * Returns `null` if no `FpxBankElement` is rendered in the current `Elements` provider tree. | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
declare const CartElement: CartElementComponent; | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -679,2 +723,2 @@ */ | ||
declare const AfterpayClearpayMessageElement: AfterpayClearpayMessageElementComponent; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, CartElementProps, CartElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, CartElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; |
@@ -141,2 +141,34 @@ import { FunctionComponent, PropsWithChildren, ReactNode } from "react"; | ||
type CardCvcElementComponent = FunctionComponent<CardCvcElementProps>; | ||
interface CartElementProps extends ElementProps { | ||
/** | ||
* An object containing [Element configuration options](https://stripe.com/docs/js/elements_object/create_cart_element#cart_element_create-options). | ||
*/ | ||
options?: stripeJs.StripeCartElementOptions; | ||
/** | ||
* Triggered when data exposed by this Element is changed (e.g., when there is an error). | ||
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_change?type=cartElement). | ||
*/ | ||
onChange?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element is fully rendered and can accept imperative `element.focus()` calls. | ||
* Called with a reference to the underlying [Element instance](https://stripe.com/docs/js/element). | ||
*/ | ||
onReady?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element fails to load. | ||
*/ | ||
onLoadError?: (event: { | ||
elementType: "cart"; | ||
error: StripeError; | ||
}) => any; | ||
/** | ||
* Triggered when the "Checkout" button is clicked within the Element. | ||
*/ | ||
onCheckout?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when a line item's link is clicked within the Element. | ||
*/ | ||
onLineItemClick?: (event: stripeJs.StripeCartElementLineItemClickEvent) => any; | ||
} | ||
type CartElementComponent = FunctionComponent<CartElementProps>; | ||
interface FpxBankElementProps extends ElementProps { | ||
@@ -489,2 +521,7 @@ /** | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=cart) for the `CartElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
* Returns `null` if no `CartElement` is rendered in the current `Elements` provider tree. | ||
*/ | ||
getElement(component: CartElementComponent): stripeJs.StripeCartElement | null; | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=fpxBank) for the `FpxBankElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
@@ -667,2 +704,9 @@ * Returns `null` if no `FpxBankElement` is rendered in the current `Elements` provider tree. | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
declare const CartElement: CartElementComponent; | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -679,2 +723,2 @@ */ | ||
declare const AfterpayClearpayMessageElement: AfterpayClearpayMessageElementComponent; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, CartElementProps, CartElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, CartElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; |
@@ -356,3 +356,3 @@ import React from 'react'; | ||
name: 'react-stripe-js', | ||
version: "1.12.0" | ||
version: "1.13.0" | ||
}); | ||
@@ -362,3 +362,3 @@ | ||
name: 'react-stripe-js', | ||
version: "1.12.0", | ||
version: "1.13.0", | ||
url: 'https://stripe.com/docs/stripe-js/react' | ||
@@ -645,2 +645,10 @@ }); | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
var CartElement = createElementComponent('cart', isServer); | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -661,2 +669,2 @@ */ | ||
export { AddressElement, AffirmMessageElement, AfterpayClearpayMessageElement, AuBankAccountElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, Elements, ElementsConsumer, EpsBankElement, FpxBankElement, IbanElement, IdealBankElement, LinkAuthenticationElement, P24BankElement, PaymentElement, PaymentMethodMessagingElement, PaymentRequestButtonElement, ShippingAddressElement, useElements, useStripe }; | ||
export { AddressElement, AffirmMessageElement, AfterpayClearpayMessageElement, AuBankAccountElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, CartElement, Elements, ElementsConsumer, EpsBankElement, FpxBankElement, IbanElement, IdealBankElement, LinkAuthenticationElement, P24BankElement, PaymentElement, PaymentMethodMessagingElement, PaymentRequestButtonElement, ShippingAddressElement, useElements, useStripe }; |
@@ -362,3 +362,3 @@ 'use strict'; | ||
name: 'react-stripe-js', | ||
version: "1.12.0" | ||
version: "1.13.0" | ||
}); | ||
@@ -368,3 +368,3 @@ | ||
name: 'react-stripe-js', | ||
version: "1.12.0", | ||
version: "1.13.0", | ||
url: 'https://stripe.com/docs/stripe-js/react' | ||
@@ -651,2 +651,10 @@ }); | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
var CartElement = createElementComponent('cart', isServer); | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -675,2 +683,3 @@ */ | ||
exports.CardNumberElement = CardNumberElement; | ||
exports.CartElement = CartElement; | ||
exports.Elements = Elements; | ||
@@ -677,0 +686,0 @@ exports.ElementsConsumer = ElementsConsumer; |
@@ -141,2 +141,34 @@ import { FunctionComponent, PropsWithChildren, ReactNode } from "react"; | ||
type CardCvcElementComponent = FunctionComponent<CardCvcElementProps>; | ||
interface CartElementProps extends ElementProps { | ||
/** | ||
* An object containing [Element configuration options](https://stripe.com/docs/js/elements_object/create_cart_element#cart_element_create-options). | ||
*/ | ||
options?: stripeJs.StripeCartElementOptions; | ||
/** | ||
* Triggered when data exposed by this Element is changed (e.g., when there is an error). | ||
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_change?type=cartElement). | ||
*/ | ||
onChange?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element is fully rendered and can accept imperative `element.focus()` calls. | ||
* Called with a reference to the underlying [Element instance](https://stripe.com/docs/js/element). | ||
*/ | ||
onReady?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element fails to load. | ||
*/ | ||
onLoadError?: (event: { | ||
elementType: "cart"; | ||
error: StripeError; | ||
}) => any; | ||
/** | ||
* Triggered when the "Checkout" button is clicked within the Element. | ||
*/ | ||
onCheckout?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when a line item's link is clicked within the Element. | ||
*/ | ||
onLineItemClick?: (event: stripeJs.StripeCartElementLineItemClickEvent) => any; | ||
} | ||
type CartElementComponent = FunctionComponent<CartElementProps>; | ||
interface FpxBankElementProps extends ElementProps { | ||
@@ -489,2 +521,7 @@ /** | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=cart) for the `CartElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
* Returns `null` if no `CartElement` is rendered in the current `Elements` provider tree. | ||
*/ | ||
getElement(component: CartElementComponent): stripeJs.StripeCartElement | null; | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=fpxBank) for the `FpxBankElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
@@ -667,2 +704,9 @@ * Returns `null` if no `FpxBankElement` is rendered in the current `Elements` provider tree. | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
declare const CartElement: CartElementComponent; | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -679,2 +723,2 @@ */ | ||
declare const AfterpayClearpayMessageElement: AfterpayClearpayMessageElementComponent; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, CartElementProps, CartElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, CartElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; |
@@ -439,3 +439,3 @@ (function (global, factory) { | ||
name: 'react-stripe-js', | ||
version: "1.12.0" | ||
version: "1.13.0" | ||
}); | ||
@@ -445,3 +445,3 @@ | ||
name: 'react-stripe-js', | ||
version: "1.12.0", | ||
version: "1.13.0", | ||
url: 'https://stripe.com/docs/stripe-js/react' | ||
@@ -728,2 +728,10 @@ }); | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
var CartElement = createElementComponent('cart', isServer); | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -752,2 +760,3 @@ */ | ||
exports.CardNumberElement = CardNumberElement; | ||
exports.CartElement = CartElement; | ||
exports.Elements = Elements; | ||
@@ -754,0 +763,0 @@ exports.ElementsConsumer = ElementsConsumer; |
@@ -141,2 +141,34 @@ import { FunctionComponent, PropsWithChildren, ReactNode } from "react"; | ||
type CardCvcElementComponent = FunctionComponent<CardCvcElementProps>; | ||
interface CartElementProps extends ElementProps { | ||
/** | ||
* An object containing [Element configuration options](https://stripe.com/docs/js/elements_object/create_cart_element#cart_element_create-options). | ||
*/ | ||
options?: stripeJs.StripeCartElementOptions; | ||
/** | ||
* Triggered when data exposed by this Element is changed (e.g., when there is an error). | ||
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_change?type=cartElement). | ||
*/ | ||
onChange?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element is fully rendered and can accept imperative `element.focus()` calls. | ||
* Called with a reference to the underlying [Element instance](https://stripe.com/docs/js/element). | ||
*/ | ||
onReady?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element fails to load. | ||
*/ | ||
onLoadError?: (event: { | ||
elementType: "cart"; | ||
error: StripeError; | ||
}) => any; | ||
/** | ||
* Triggered when the "Checkout" button is clicked within the Element. | ||
*/ | ||
onCheckout?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when a line item's link is clicked within the Element. | ||
*/ | ||
onLineItemClick?: (event: stripeJs.StripeCartElementLineItemClickEvent) => any; | ||
} | ||
type CartElementComponent = FunctionComponent<CartElementProps>; | ||
interface FpxBankElementProps extends ElementProps { | ||
@@ -489,2 +521,7 @@ /** | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=cart) for the `CartElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
* Returns `null` if no `CartElement` is rendered in the current `Elements` provider tree. | ||
*/ | ||
getElement(component: CartElementComponent): stripeJs.StripeCartElement | null; | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=fpxBank) for the `FpxBankElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
@@ -667,2 +704,9 @@ * Returns `null` if no `FpxBankElement` is rendered in the current `Elements` provider tree. | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
declare const CartElement: CartElementComponent; | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -679,2 +723,2 @@ */ | ||
declare const AfterpayClearpayMessageElement: AfterpayClearpayMessageElementComponent; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; | ||
export { ElementProps, AuBankAccountElementProps, AuBankAccountElementComponent, CardElementProps, CardElementComponent, CardNumberElementProps, CardNumberElementComponent, CardExpiryElementProps, CardExpiryElementComponent, CardCvcElementProps, CardCvcElementComponent, CartElementProps, CartElementComponent, FpxBankElementProps, FpxBankElementComponent, IbanElementProps, IbanElementComponent, IdealBankElementProps, IdealBankElementComponent, P24BankElementProps, LinkAuthenticationElementProps, LinkAuthenticationElementComponent, P24BankElementComponent, EpsBankElementProps, EpsBankElementComponent, PaymentElementProps, PaymentElementComponent, PaymentRequestButtonElementProps, PaymentRequestButtonElementComponent, AddressElementProps, AddressElementComponent, ShippingAddressElementProps, ShippingAddressElementComponent, PaymentMethodMessagingElementProps, PaymentMethodMessagingElementComponent, AffirmMessageElementProps, AffirmMessageElementComponent, AfterpayClearpayMessageElementProps, AfterpayClearpayMessageElementComponent, useElements, useStripe, Elements, ElementsConsumer, AuBankAccountElement, CardElement, CardNumberElement, CardExpiryElement, CardCvcElement, FpxBankElement, IbanElement, IdealBankElement, P24BankElement, EpsBankElement, PaymentElement, PaymentRequestButtonElement, LinkAuthenticationElement, AddressElement, ShippingAddressElement, CartElement, PaymentMethodMessagingElement, AffirmMessageElement, AfterpayClearpayMessageElement }; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactStripe={},e.React)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function n(){}function r(){}r.resetWarningCache=n;var o=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,u){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==u){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:n};return o.PropTypes=o,o}()}));function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,u=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(u.push(r.value),!t||u.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return u}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},p=function(e){return null!==e&&"object"===c(e)},y=function(e,t,n){return p(e)?Object.keys(e).reduce((function(r,o){var u=!p(t)||!function e(t,n){if(!p(t)||!p(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return t===n;var u=Object.keys(t),a=Object.keys(n);if(u.length!==a.length)return!1;for(var c={},i=0;i<u.length;i+=1)c[u[i]]=!0;for(var s=0;s<a.length;s+=1)c[a[s]]=!0;var l=Object.keys(c);if(l.length!==u.length)return!1;var f=t,y=n;return l.every((function(t){return e(f[t],y[t])}))}(e[o],t[o]);return n.includes(o)?(u&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),r):u?a(a({},r||{}),{},i({},o,e[o])):r}),null):null},m=function(e){if(null===e||p(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},d=function(e){if(function(e){return p(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(m)};var t=m(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},v=t.createContext(null);v.displayName="ElementsContext";var b=function(e){var n=e.stripe,r=e.options,o=e.children,u=t.useMemo((function(){return d(n)}),[n]),a=s(t.useState((function(){return{stripe:"sync"===u.tag?u.stripe:null,elements:"sync"===u.tag?u.stripe.elements(r):null}})),2),c=a[0],i=a[1];t.useEffect((function(){var e=!0,t=function(e){i((function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}}))};return"async"!==u.tag||c.stripe?"sync"!==u.tag||c.stripe||t(u.stripe):u.stripePromise.then((function(n){n&&e&&t(n)})),function(){e=!1}}),[u,c,r]);var l=f(n);t.useEffect((function(){null!==l&&l!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")}),[l,n]);var p=f(r);return t.useEffect((function(){if(c.elements){var e=y(r,p,["clientSecret","fonts"]);e&&c.elements.update(e)}}),[r,p,c.elements]),t.useEffect((function(){var e=c.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.12.0"}),e.registerAppInfo({name:"react-stripe-js",version:"1.12.0",url:"https://stripe.com/docs/stripe-js/react"}))}),[c.stripe]),t.createElement(v.Provider,{value:c},o)};b.propTypes={stripe:o.any,options:o.object};var h=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(v),e)},g=function(e){return(0,e.children)(h("mounts <ElementsConsumer>"))};g.propTypes={children:o.func.isRequired};var E=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},O=function(){},j=function(e,n){var r,u="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),a=n?function(e){h("mounts <".concat(u,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,a=n.options,c=void 0===a?{}:a,i=n.onBlur,s=void 0===i?O:i,l=n.onFocus,p=void 0===l?O:l,m=n.onReady,d=void 0===m?O:m,v=n.onChange,b=void 0===v?O:v,g=n.onEscape,j=void 0===g?O:g,k=n.onClick,S=void 0===k?O:k,C=n.onLoadError,P=void 0===C?O:C,w=n.onLoaderStart,A=void 0===w?O:w,x=n.onNetworksChange,R=void 0===x?O:x,T=h("mounts <".concat(u,">")).elements,B=t.useRef(null),_=t.useRef(null),I=E(d),M=E(s),N=E(p),L=E(S),q=E(b),D=E(j),U=E(P),W=E(A),F=E(R);t.useLayoutEffect((function(){if(null==B.current&&T&&null!=_.current){var t=T.create(e,c);B.current=t,t.mount(_.current),t.on("ready",(function(){return I(t)})),t.on("change",q),t.on("blur",M),t.on("focus",N),t.on("escape",D),t.on("loaderror",U),t.on("loaderstart",W),t.on("networkschange",F),t.on("click",L)}}));var Y=f(c);return t.useEffect((function(){if(B.current){var e=y(c,Y,["paymentRequest"]);e&&B.current.update(e)}}),[c,Y]),t.useLayoutEffect((function(){return function(){B.current&&(B.current.destroy(),B.current=null)}}),[]),t.createElement("div",{id:r,className:o,ref:_})};return a.propTypes={id:o.string,className:o.string,onChange:o.func,onBlur:o.func,onFocus:o.func,onReady:o.func,onClick:o.func,onLoadError:o.func,onLoaderStart:o.func,onNetworksChange:o.func,options:o.object},a.displayName=u,a.__elementType=e,a},k="undefined"==typeof window,S=j("auBankAccount",k),C=j("card",k),P=j("cardNumber",k),w=j("cardExpiry",k),A=j("cardCvc",k),x=j("fpxBank",k),R=j("iban",k),T=j("idealBank",k),B=j("p24Bank",k),_=j("epsBank",k),I=j("payment",k),M=j("paymentRequestButton",k),N=j("linkAuthentication",k),L=j("address",k),q=j("shippingAddress",k),D=j("paymentMethodMessaging",k),U=j("affirmMessage",k),W=j("afterpayClearpayMessage",k);e.AddressElement=L,e.AffirmMessageElement=U,e.AfterpayClearpayMessageElement=W,e.AuBankAccountElement=S,e.CardCvcElement=A,e.CardElement=C,e.CardExpiryElement=w,e.CardNumberElement=P,e.Elements=b,e.ElementsConsumer=g,e.EpsBankElement=_,e.FpxBankElement=x,e.IbanElement=R,e.IdealBankElement=T,e.LinkAuthenticationElement=N,e.P24BankElement=B,e.PaymentElement=I,e.PaymentMethodMessagingElement=D,e.PaymentRequestButtonElement=M,e.ShippingAddressElement=q,e.useElements=function(){return h("calls useElements()").elements},e.useStripe=function(){return h("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactStripe={},e.React)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function n(){}function r(){}r.resetWarningCache=n;var o=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:n};return o.PropTypes=o,o}()}));function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,a=[],c=!0,u=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(u)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},p=function(e){return null!==e&&"object"===u(e)},y=function(e,t,n){return p(e)?Object.keys(e).reduce((function(r,o){var a=!p(t)||!function e(t,n){if(!p(t)||!p(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return t===n;var a=Object.keys(t),c=Object.keys(n);if(a.length!==c.length)return!1;for(var u={},i=0;i<a.length;i+=1)u[a[i]]=!0;for(var s=0;s<c.length;s+=1)u[c[s]]=!0;var l=Object.keys(u);if(l.length!==a.length)return!1;var f=t,y=n;return l.every((function(t){return e(f[t],y[t])}))}(e[o],t[o]);return n.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),r):a?c(c({},r||{}),{},i({},o,e[o])):r}),null):null},m=function(e){if(null===e||p(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},d=function(e){if(function(e){return p(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(m)};var t=m(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},v=t.createContext(null);v.displayName="ElementsContext";var b=function(e){var n=e.stripe,r=e.options,o=e.children,a=t.useMemo((function(){return d(n)}),[n]),c=s(t.useState((function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(r):null}})),2),u=c[0],i=c[1];t.useEffect((function(){var e=!0,t=function(e){i((function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}}))};return"async"!==a.tag||u.stripe?"sync"!==a.tag||u.stripe||t(a.stripe):a.stripePromise.then((function(n){n&&e&&t(n)})),function(){e=!1}}),[a,u,r]);var l=f(n);t.useEffect((function(){null!==l&&l!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")}),[l,n]);var p=f(r);return t.useEffect((function(){if(u.elements){var e=y(r,p,["clientSecret","fonts"]);e&&u.elements.update(e)}}),[r,p,u.elements]),t.useEffect((function(){var e=u.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.13.0"}),e.registerAppInfo({name:"react-stripe-js",version:"1.13.0",url:"https://stripe.com/docs/stripe-js/react"}))}),[u.stripe]),t.createElement(v.Provider,{value:u},o)};b.propTypes={stripe:o.any,options:o.object};var h=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(v),e)},g=function(e){return(0,e.children)(h("mounts <ElementsConsumer>"))};g.propTypes={children:o.func.isRequired};var E=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},O=function(){},j=function(e,n){var r,a="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),c=n?function(e){h("mounts <".concat(a,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,c=n.options,u=void 0===c?{}:c,i=n.onBlur,s=void 0===i?O:i,l=n.onFocus,p=void 0===l?O:l,m=n.onReady,d=void 0===m?O:m,v=n.onChange,b=void 0===v?O:v,g=n.onEscape,j=void 0===g?O:g,k=n.onClick,C=void 0===k?O:k,S=n.onLoadError,P=void 0===S?O:S,w=n.onLoaderStart,A=void 0===w?O:w,x=n.onNetworksChange,R=void 0===x?O:x,T=h("mounts <".concat(a,">")).elements,B=t.useRef(null),_=t.useRef(null),I=E(d),M=E(s),N=E(p),L=E(C),q=E(b),D=E(j),U=E(P),W=E(A),F=E(R);t.useLayoutEffect((function(){if(null==B.current&&T&&null!=_.current){var t=T.create(e,u);B.current=t,t.mount(_.current),t.on("ready",(function(){return I(t)})),t.on("change",q),t.on("blur",M),t.on("focus",N),t.on("escape",D),t.on("loaderror",U),t.on("loaderstart",W),t.on("networkschange",F),t.on("click",L)}}));var Y=f(u);return t.useEffect((function(){if(B.current){var e=y(u,Y,["paymentRequest"]);e&&B.current.update(e)}}),[u,Y]),t.useLayoutEffect((function(){return function(){B.current&&(B.current.destroy(),B.current=null)}}),[]),t.createElement("div",{id:r,className:o,ref:_})};return c.propTypes={id:o.string,className:o.string,onChange:o.func,onBlur:o.func,onFocus:o.func,onReady:o.func,onClick:o.func,onLoadError:o.func,onLoaderStart:o.func,onNetworksChange:o.func,options:o.object},c.displayName=a,c.__elementType=e,c},k="undefined"==typeof window,C=j("auBankAccount",k),S=j("card",k),P=j("cardNumber",k),w=j("cardExpiry",k),A=j("cardCvc",k),x=j("fpxBank",k),R=j("iban",k),T=j("idealBank",k),B=j("p24Bank",k),_=j("epsBank",k),I=j("payment",k),M=j("paymentRequestButton",k),N=j("linkAuthentication",k),L=j("address",k),q=j("shippingAddress",k),D=j("cart",k),U=j("paymentMethodMessaging",k),W=j("affirmMessage",k),F=j("afterpayClearpayMessage",k);e.AddressElement=L,e.AffirmMessageElement=W,e.AfterpayClearpayMessageElement=F,e.AuBankAccountElement=C,e.CardCvcElement=A,e.CardElement=S,e.CardExpiryElement=w,e.CardNumberElement=P,e.CartElement=D,e.Elements=b,e.ElementsConsumer=g,e.EpsBankElement=_,e.FpxBankElement=x,e.IbanElement=R,e.IdealBankElement=T,e.LinkAuthenticationElement=N,e.P24BankElement=B,e.PaymentElement=I,e.PaymentMethodMessagingElement=U,e.PaymentRequestButtonElement=M,e.ShippingAddressElement=q,e.useElements=function(){return h("calls useElements()").elements},e.useStripe=function(){return h("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@stripe/react-stripe-js", | ||
"version": "1.12.0", | ||
"version": "1.13.0", | ||
"description": "React components for Stripe.js and Stripe Elements", | ||
@@ -109,3 +109,3 @@ "main": "dist/react-stripe.js", | ||
"peerDependencies": { | ||
"@stripe/stripe-js": "^1.38.1", | ||
"@stripe/stripe-js": "^1.41.0", | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
@@ -112,0 +112,0 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" |
@@ -18,2 +18,3 @@ import createElementComponent from './components/createElementComponent'; | ||
AddressElementComponent, | ||
CartElementComponent, | ||
AffirmMessageElementComponent, | ||
@@ -165,2 +166,13 @@ AfterpayClearpayMessageElementComponent, | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* @docs https://stripe.com/docs/elements/cart-element | ||
*/ | ||
export const CartElement: CartElementComponent = createElementComponent( | ||
'cart', | ||
isServer | ||
); | ||
/** | ||
* @docs https://stripe.com/docs/stripe-js/react#element-components | ||
@@ -167,0 +179,0 @@ */ |
@@ -175,2 +175,40 @@ import {FunctionComponent} from 'react'; | ||
export interface CartElementProps extends ElementProps { | ||
/** | ||
* An object containing [Element configuration options](https://stripe.com/docs/js/elements_object/create_cart_element#cart_element_create-options). | ||
*/ | ||
options?: stripeJs.StripeCartElementOptions; | ||
/** | ||
* Triggered when data exposed by this Element is changed (e.g., when there is an error). | ||
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_change?type=cartElement). | ||
*/ | ||
onChange?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element is fully rendered and can accept imperative `element.focus()` calls. | ||
* Called with a reference to the underlying [Element instance](https://stripe.com/docs/js/element). | ||
*/ | ||
onReady?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when the Element fails to load. | ||
*/ | ||
onLoadError?: (event: {elementType: 'cart'; error: StripeError}) => any; | ||
/** | ||
* Triggered when the "Checkout" button is clicked within the Element. | ||
*/ | ||
onCheckout?: (event: stripeJs.StripeCartElementPayloadEvent) => any; | ||
/** | ||
* Triggered when a line item's link is clicked within the Element. | ||
*/ | ||
onLineItemClick?: ( | ||
event: stripeJs.StripeCartElementLineItemClickEvent | ||
) => any; | ||
} | ||
export type CartElementComponent = FunctionComponent<CartElementProps>; | ||
export interface FpxBankElementProps extends ElementProps { | ||
@@ -614,2 +652,10 @@ /** | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=cart) for the `CartElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
* Returns `null` if no `CartElement` is rendered in the current `Elements` provider tree. | ||
*/ | ||
getElement( | ||
component: CartElementComponent | ||
): stripeJs.StripeCartElement | null; | ||
/** | ||
* Returns the underlying [element instance](https://stripe.com/docs/js/elements_object/create_element?type=fpxBank) for the `FpxBankElement` component in the current [Elements](https://stripe.com/docs/stripe-js/react#elements-provider) provider tree. | ||
@@ -616,0 +662,0 @@ * Returns `null` if no `FpxBankElement` is rendered in the current `Elements` provider tree. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
331117
6963
0