Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
AddressElementComponent,
PaymentMethodMessagingElementComponent,
TaxIdElementComponent,
CurrencySelectorElementComponent,
} from './types';
import {isServer} from './utils/isServer';

Expand Down Expand Up @@ -76,6 +77,15 @@ export const CardCvcElement: CardCvcElementComponent = createElementComponent(
isServer
);

/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*/
export const CurrencySelectorElement: CurrencySelectorElementComponent = createElementComponent(
'currencySelector',
isServer
);

/**
* @docs https://stripe.com/docs/stripe-js/react#element-components
*/
Expand Down
30 changes: 30 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,36 @@ export type PaymentMethodMessagingElementComponent = FunctionComponent<
PaymentMethodMessagingElementProps
>;

export interface CurrencySelectorElementProps extends ElementProps {
/**
* 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?: (element: stripeJs.StripeCurrencySelectorElement) => any;

/**
* Triggered when the escape key is pressed within the Element.
*/
onEscape?: () => any;

/**
* Triggered when the Element fails to load.
*/
onLoadError?: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any;

/**
* Triggered when the [loader](https://stripe.com/docs/js/elements_object/create#stripe_elements-options-loader) UI is mounted to the DOM and ready to be displayed.
*/
onLoaderStart?: (event: {elementType: 'currencySelector'}) => any;
}

export type CurrencySelectorElementComponent = FunctionComponent<
CurrencySelectorElementProps
>;

declare module '@stripe/stripe-js' {
interface StripeElements {
/**
Expand Down
Loading