@primer-io/primer-js 0.1.1 → 0.1.2
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/chunks/ar.5AY75F5J.js +1 -0
- package/dist/chunks/bg.2EL2HTYI.js +1 -0
- package/dist/chunks/ca.WZI7CBFW.js +1 -0
- package/dist/chunks/chunk.G45OCYEN.js +1 -0
- package/dist/chunks/chunk.QMLIEEKM.js +2 -0
- package/dist/chunks/cs.GBLLNC3E.js +1 -0
- package/dist/chunks/da.CDEFQG44.js +1 -0
- package/dist/chunks/de.UHURA2HV.js +1 -0
- package/dist/chunks/el.BY5NGYDF.js +1 -0
- package/dist/chunks/en-GB.UBLLAUVW.js +1 -0
- package/dist/chunks/en.BKAVPUID.js +1 -0
- package/dist/chunks/es-AR.EYNC6EAZ.js +1 -0
- package/dist/chunks/es-MX.OIO2YURF.js +1 -0
- package/dist/chunks/es.CNNIJYLX.js +1 -0
- package/dist/chunks/et-EE.4ZF6CLB6.js +1 -0
- package/dist/chunks/fi-FI.4ZXWRRYI.js +1 -0
- package/dist/chunks/fr.TZM5I4K2.js +1 -0
- package/dist/chunks/he.DWEZBG4A.js +1 -0
- package/dist/chunks/hr.BV4PC324.js +1 -0
- package/dist/chunks/hu.MTEKSS3J.js +1 -0
- package/dist/chunks/id.SJSTOPSC.js +1 -0
- package/dist/chunks/it.IISTMHN5.js +1 -0
- package/dist/chunks/ja.IBQ3ID5C.js +1 -0
- package/dist/chunks/ko.KZVQLI4V.js +1 -0
- package/dist/chunks/lt-LT.RKBB7CZ6.js +1 -0
- package/dist/chunks/lt.TLM7OCXP.js +1 -0
- package/dist/chunks/lv-LV.H5TJC2T4.js +1 -0
- package/dist/chunks/lv.G4SRVBAC.js +1 -0
- package/dist/chunks/ms.ATTITA66.js +1 -0
- package/dist/chunks/nb.5EE7XOA7.js +1 -0
- package/dist/chunks/nl.TY2SYTKZ.js +1 -0
- package/dist/chunks/nl_NL.GB5BQ5PG.js +1 -0
- package/dist/chunks/pl.5PRBSG4K.js +3 -0
- package/dist/chunks/pt-BR.5XRZB5WW.js +1 -0
- package/dist/chunks/pt.TA5H5JUJ.js +1 -0
- package/dist/chunks/ro.PSZKGHRP.js +1 -0
- package/dist/chunks/ru.3QZY7ZIT.js +1 -0
- package/dist/chunks/sk.FAQFYLGM.js +1 -0
- package/dist/chunks/sl.QRSCQXJP.js +1 -0
- package/dist/chunks/sr-RS.TKMMG7FK.js +1 -0
- package/dist/chunks/sv.HZ3E6V5F.js +1 -0
- package/dist/chunks/th.AY6M42B4.js +1 -0
- package/dist/chunks/tr.TFKBPYMO.js +1 -0
- package/dist/chunks/uk-UA.3TU67RSI.js +1 -0
- package/dist/chunks/vi.NLXELMXV.js +1 -0
- package/dist/chunks/zf.U5XPENNR.js +1 -0
- package/dist/chunks/zh-CN.VEOQJ3EU.js +1 -0
- package/dist/chunks/zh-HK.ZEXSW7FF.js +1 -0
- package/dist/chunks/zh-TW.MMVWEQMZ.js +1 -0
- package/dist/custom-elements.json +2012 -355
- package/dist/primer-loader.d.ts +220 -34
- package/dist/primer-loader.js +2286 -4
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
package/dist/primer-loader.d.ts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Injects the CSS loader styles into the page
|
|
3
|
-
* These styles display a loading indicator before JavaScript initializes
|
|
4
|
-
*
|
|
5
|
-
* Unlike theme styles, loader styles should take precedence over merchant styles
|
|
6
|
-
* to ensure the loading indicator is visible. We append them to the end of the head.
|
|
7
|
-
*/
|
|
8
|
-
export declare function injectLoaderStyles(): void;
|
|
9
|
-
/**
|
|
10
|
-
* Injects all required theme CSS variables into the page
|
|
11
|
-
* This should be called before components are rendered to ensure
|
|
12
|
-
* they have access to all design tokens
|
|
13
|
-
*
|
|
14
|
-
* Theme styles are prepended to the document head to allow merchant styles
|
|
15
|
-
* to override our default variables.
|
|
16
|
-
*/
|
|
17
|
-
export declare function injectThemeStyles(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Utility function to inject only the light theme CSS variables
|
|
20
|
-
* @returns {void}
|
|
21
|
-
*/
|
|
22
|
-
export declare function injectLightTheme(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Utility function to inject only the dark theme CSS variables
|
|
25
|
-
* @returns {void}
|
|
26
|
-
*/
|
|
27
|
-
export declare function injectDarkTheme(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Main function to load the Primer SDK with all required dependencies and styles
|
|
30
|
-
* @returns {Promise<void>} A promise that resolves when loading is complete
|
|
31
|
-
*/
|
|
32
|
-
export declare function loadPrimer(): Promise<void>;
|
|
33
1
|
export type CardNetwork = {
|
|
34
2
|
displayName: string;
|
|
35
3
|
network: string;
|
|
@@ -2304,6 +2272,7 @@ export interface InitializedManagersMap extends Map<PaymentMethodType, Initializ
|
|
|
2304
2272
|
get<T extends PaymentMethodType>(key: T): ManagerByType<T> | undefined;
|
|
2305
2273
|
}
|
|
2306
2274
|
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType, typeof PaymentMethodType.STRIPE_ACH | typeof PaymentMethodType.PAYMENT_CARD | typeof PaymentMethodType.KLARNA | typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY>;
|
|
2275
|
+
export type NativePaymentMethodTypes = typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
2307
2276
|
export type RedirectPaymentMethod = {
|
|
2308
2277
|
type: RedirectPaymentMethodTypes;
|
|
2309
2278
|
managerType: HeadlessManagerType.REDIRECT;
|
|
@@ -2333,7 +2302,7 @@ export type PaymentMethodByType<T extends PaymentMethodType> = Extract<Initializ
|
|
|
2333
2302
|
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType, InitializedPaymentMethod> {
|
|
2334
2303
|
get<T extends PaymentMethodType>(key: T): PaymentMethodByType<T> | undefined;
|
|
2335
2304
|
}
|
|
2336
|
-
declare class InitializedPayments {
|
|
2305
|
+
export declare class InitializedPayments {
|
|
2337
2306
|
private readonly _methods;
|
|
2338
2307
|
constructor(map: InitializedPaymentMethodMap);
|
|
2339
2308
|
get<T extends RedirectPaymentMethodTypes>(type: T): RedirectPaymentMethod | undefined;
|
|
@@ -2667,7 +2636,16 @@ declare const targetLocales = [
|
|
|
2667
2636
|
`zh-TW`,
|
|
2668
2637
|
] as const;
|
|
2669
2638
|
export type LocaleCode = typeof sourceLocale | (typeof targetLocales)[number];
|
|
2670
|
-
|
|
2639
|
+
/**
|
|
2640
|
+
* PrimerCheckoutComponent implements the main checkout experience.
|
|
2641
|
+
* This component includes a CSS-only loader that displays before the JavaScript
|
|
2642
|
+
* is fully loaded, ensuring users see a loading indicator immediately.
|
|
2643
|
+
*
|
|
2644
|
+
* The loader can be disabled by:
|
|
2645
|
+
* 1. Adding the 'loader-disabled' attribute to the component
|
|
2646
|
+
* 2. Setting the CSS custom property --primer-loader-disabled: 1
|
|
2647
|
+
*/
|
|
2648
|
+
export declare class PrimerCheckoutComponent extends LitElement implements PrimerCheckoutType {
|
|
2671
2649
|
set jsInitialized(value: boolean);
|
|
2672
2650
|
get jsInitialized(): boolean;
|
|
2673
2651
|
static styles: CSSResult[];
|
|
@@ -2710,6 +2688,10 @@ declare class PrimerCheckoutComponent extends LitElement implements PrimerChecko
|
|
|
2710
2688
|
* Size options for the spinner component
|
|
2711
2689
|
*/
|
|
2712
2690
|
export type SpinnerSize = "small" | "medium" | "large";
|
|
2691
|
+
/**
|
|
2692
|
+
* Spinner component with configurable size and color
|
|
2693
|
+
* Adapted to work both standalone and within input components
|
|
2694
|
+
*/
|
|
2713
2695
|
declare class SpinnerComponent extends LitElement {
|
|
2714
2696
|
/**
|
|
2715
2697
|
* Color of the spinner
|
|
@@ -2738,6 +2720,15 @@ declare global {
|
|
|
2738
2720
|
"primer-spinner": SpinnerComponent;
|
|
2739
2721
|
}
|
|
2740
2722
|
}
|
|
2723
|
+
/**
|
|
2724
|
+
* A wrapper component for input elements that handles focus styling and interactions.
|
|
2725
|
+
* Provides an improved user experience by making the entire wrapper clickable to focus the inner input.
|
|
2726
|
+
*
|
|
2727
|
+
* Features:
|
|
2728
|
+
* - Automatically focuses primer-input elements when wrapper is clicked
|
|
2729
|
+
* - Dispatches wrapper-click events for iframe-based hosted inputs
|
|
2730
|
+
* - Sets proper cursor styling to indicate text input functionality
|
|
2731
|
+
*/
|
|
2741
2732
|
declare class InputWrapperComponent extends LitElement {
|
|
2742
2733
|
static styles: CSSResult[];
|
|
2743
2734
|
focusWithin: boolean;
|
|
@@ -2762,6 +2753,12 @@ declare global {
|
|
|
2762
2753
|
"primer-input-wrapper": InputWrapperComponent;
|
|
2763
2754
|
}
|
|
2764
2755
|
}
|
|
2756
|
+
/**
|
|
2757
|
+
* Input label component for form elements
|
|
2758
|
+
*
|
|
2759
|
+
* @element primer-input-label
|
|
2760
|
+
* @slot - Default slot for label text content
|
|
2761
|
+
*/
|
|
2765
2762
|
declare class InputLabelComponent extends LitElement {
|
|
2766
2763
|
static styles: CSSResult[];
|
|
2767
2764
|
/**
|
|
@@ -2823,6 +2820,12 @@ declare global {
|
|
|
2823
2820
|
"primer-button": ButtonComponent;
|
|
2824
2821
|
}
|
|
2825
2822
|
}
|
|
2823
|
+
/**
|
|
2824
|
+
* Input error component for displaying form validation messages
|
|
2825
|
+
*
|
|
2826
|
+
* @element primer-input-error
|
|
2827
|
+
* @slot - Default slot for error message content
|
|
2828
|
+
*/
|
|
2826
2829
|
declare class InputErrorComponent extends LitElement {
|
|
2827
2830
|
static styles: CSSResult[];
|
|
2828
2831
|
/**
|
|
@@ -2880,6 +2883,20 @@ export type InputEventMap = {
|
|
|
2880
2883
|
blur: FocusEvent;
|
|
2881
2884
|
invalid: Event;
|
|
2882
2885
|
};
|
|
2886
|
+
/**
|
|
2887
|
+
* A fully type-safe input component that wraps the native HTML input element
|
|
2888
|
+
* while providing additional functionality and styling.
|
|
2889
|
+
*
|
|
2890
|
+
* @element primer-input
|
|
2891
|
+
*
|
|
2892
|
+
* @fires input - Fired when the input value changes
|
|
2893
|
+
* @fires change - Fired when the input value is committed
|
|
2894
|
+
* @fires focus - Fired when the input receives focus
|
|
2895
|
+
* @fires blur - Fired when the input loses focus
|
|
2896
|
+
* @fires invalid - Fired when the input fails validation
|
|
2897
|
+
*
|
|
2898
|
+
* @csspart input - The native input element
|
|
2899
|
+
*/
|
|
2883
2900
|
declare class InputComponent extends LitElement {
|
|
2884
2901
|
static styles: CSSResult[];
|
|
2885
2902
|
private inputElement;
|
|
@@ -2969,10 +2986,20 @@ declare global {
|
|
|
2969
2986
|
"primer-input": InputComponent;
|
|
2970
2987
|
}
|
|
2971
2988
|
}
|
|
2989
|
+
/**
|
|
2990
|
+
* Event detail interface for expanded-changed event
|
|
2991
|
+
*/
|
|
2992
|
+
export interface ExpandedChangedDetail {
|
|
2993
|
+
expanded: boolean;
|
|
2994
|
+
}
|
|
2972
2995
|
/**
|
|
2973
2996
|
* Button variant types
|
|
2974
2997
|
*/
|
|
2975
2998
|
export type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
2999
|
+
/**
|
|
3000
|
+
* A collapsable component that smoothly expands and collapses content.
|
|
3001
|
+
* Uses CSS Grid for smooth animation and incorporates the primary button.
|
|
3002
|
+
*/
|
|
2976
3003
|
declare class CollapsableComponent extends LitElement {
|
|
2977
3004
|
static styles: CSSResult[];
|
|
2978
3005
|
/**
|
|
@@ -3030,6 +3057,23 @@ declare global {
|
|
|
3030
3057
|
"primer-collapsable": CollapsableComponent;
|
|
3031
3058
|
}
|
|
3032
3059
|
}
|
|
3060
|
+
/**
|
|
3061
|
+
* A reusable atomic error message component that displays error information
|
|
3062
|
+
* with appropriate styling and accessibility attributes.
|
|
3063
|
+
*
|
|
3064
|
+
* This component is fully accessible and designed to work with screen readers.
|
|
3065
|
+
* It includes animations for visibility transitions.
|
|
3066
|
+
*
|
|
3067
|
+
* @element primer-error-message
|
|
3068
|
+
*
|
|
3069
|
+
* @attr {string} message - The error message text to display
|
|
3070
|
+
* @attr {boolean} visible - Whether the error message is visible
|
|
3071
|
+
* @attr {string} role - Accessibility role (defaults to "alert")
|
|
3072
|
+
*
|
|
3073
|
+
* @csspart error-message - The main error message container
|
|
3074
|
+
* @csspart error-icon - The error icon container
|
|
3075
|
+
* @csspart error-content - The error text content
|
|
3076
|
+
*/
|
|
3033
3077
|
declare class ErrorMessageComponent extends LitElement {
|
|
3034
3078
|
static styles: CSSResult[];
|
|
3035
3079
|
/**
|
|
@@ -3062,6 +3106,15 @@ declare global {
|
|
|
3062
3106
|
"primer-error-message": ErrorMessageComponent;
|
|
3063
3107
|
}
|
|
3064
3108
|
}
|
|
3109
|
+
/**
|
|
3110
|
+
* This component renders Klarna payment method in a card-like (accordion) container with
|
|
3111
|
+
* payment categories options to choose from.
|
|
3112
|
+
*
|
|
3113
|
+
* [ Pay with Klarna v ] --> accordion header
|
|
3114
|
+
*
|
|
3115
|
+
* [ Pay Now ] [ Buy now, pay later ] --> payment categories options from Klarna
|
|
3116
|
+
* [ Continue with Klarna ] --> opens a Klarna popup
|
|
3117
|
+
*/
|
|
3065
3118
|
declare class PrimerKlarnaComponent extends LitElement {
|
|
3066
3119
|
static styles: CSSResult[];
|
|
3067
3120
|
paymentManagers: InitializedManagersMap;
|
|
@@ -3133,6 +3186,10 @@ declare global {
|
|
|
3133
3186
|
"primer-main": PrimerMainComponent;
|
|
3134
3187
|
}
|
|
3135
3188
|
}
|
|
3189
|
+
/**
|
|
3190
|
+
* Component for rendering native payment buttons (Apple Pay, Google Pay, PayPal)
|
|
3191
|
+
* with proper height calculations based on design system variables.
|
|
3192
|
+
*/
|
|
3136
3193
|
declare class NativePaymentComponent extends LitElement {
|
|
3137
3194
|
static styles: CSSResult[];
|
|
3138
3195
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
@@ -3158,6 +3215,10 @@ declare global {
|
|
|
3158
3215
|
"primer-native-payment": NativePaymentComponent;
|
|
3159
3216
|
}
|
|
3160
3217
|
}
|
|
3218
|
+
/**
|
|
3219
|
+
* CardFormComponent serves as a container for card input components.
|
|
3220
|
+
* It handles form submission, validation, and provides context to child components.
|
|
3221
|
+
*/
|
|
3161
3222
|
declare class CardFormComponent extends LitElement {
|
|
3162
3223
|
static styles: CSSResult[];
|
|
3163
3224
|
/**
|
|
@@ -3554,6 +3615,9 @@ declare abstract class AbstractCardInputComponent extends LitElement implements
|
|
|
3554
3615
|
*/
|
|
3555
3616
|
protected renderInput(): typeof nothing | TemplateResult<1>;
|
|
3556
3617
|
}
|
|
3618
|
+
/**
|
|
3619
|
+
* Card number input component with dynamic card network detection and selection
|
|
3620
|
+
*/
|
|
3557
3621
|
declare class InputCardNumberComponent extends AbstractCardInputComponent {
|
|
3558
3622
|
static styles: CSSResult[];
|
|
3559
3623
|
/**
|
|
@@ -3611,6 +3675,10 @@ declare global {
|
|
|
3611
3675
|
}
|
|
3612
3676
|
}
|
|
3613
3677
|
export type ClientOptionsContext = PrimerCheckoutOptions | null;
|
|
3678
|
+
/**
|
|
3679
|
+
* A form submit button component for card forms.
|
|
3680
|
+
* Provides a consistent submit button with translation support.
|
|
3681
|
+
*/
|
|
3614
3682
|
declare class CardFormSubmitComponent extends LitElement {
|
|
3615
3683
|
static styles: CSSResult[];
|
|
3616
3684
|
private readonly _userAssignedProps;
|
|
@@ -3642,6 +3710,12 @@ declare global {
|
|
|
3642
3710
|
"primer-card-form-submit": CardFormSubmitComponent;
|
|
3643
3711
|
}
|
|
3644
3712
|
}
|
|
3713
|
+
/**
|
|
3714
|
+
* Component for displaying and selecting card networks
|
|
3715
|
+
* Uses context directly rather than properties
|
|
3716
|
+
*
|
|
3717
|
+
* @fires network-selected - Dispatched when a network is selected with the network name as detail
|
|
3718
|
+
*/
|
|
3645
3719
|
declare class CardNetworkSelectorComponent extends LitElement {
|
|
3646
3720
|
static styles: CSSResult[];
|
|
3647
3721
|
/**
|
|
@@ -3765,6 +3839,9 @@ export interface VaultManagerEventMap {
|
|
|
3765
3839
|
"close-error": VaultManagerEvents["closeError"];
|
|
3766
3840
|
"primer-vault-payment-error": VaultManagerEvents["vaultPaymentError"];
|
|
3767
3841
|
}
|
|
3842
|
+
/**
|
|
3843
|
+
* VaultManagerComponent - displays and manages saved payment methods
|
|
3844
|
+
*/
|
|
3768
3845
|
declare class VaultManagerComponent extends LitElement {
|
|
3769
3846
|
static styles: CSSResult[];
|
|
3770
3847
|
/**
|
|
@@ -3831,6 +3908,12 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3831
3908
|
private renderPaymentMethodItem;
|
|
3832
3909
|
render(): typeof nothing | TemplateResult<1>;
|
|
3833
3910
|
}
|
|
3911
|
+
/**
|
|
3912
|
+
* VaultPaymentMethodItemComponent - displays a single payment method
|
|
3913
|
+
* Uses the VaultManagerController for display formatting
|
|
3914
|
+
* Now supports selection via the simplified button checked state
|
|
3915
|
+
* Enhanced with smooth transitions between edit and payment modes
|
|
3916
|
+
*/
|
|
3834
3917
|
declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
3835
3918
|
static styles: CSSResult[];
|
|
3836
3919
|
/**
|
|
@@ -3880,6 +3963,9 @@ declare global {
|
|
|
3880
3963
|
"primer-vault-payment-method-item": VaultPaymentMethodItemComponent;
|
|
3881
3964
|
}
|
|
3882
3965
|
}
|
|
3966
|
+
/**
|
|
3967
|
+
* VaultManagerHeaderComponent - displays the header for the vault manager
|
|
3968
|
+
*/
|
|
3883
3969
|
declare class VaultManagerHeaderComponent extends LitElement {
|
|
3884
3970
|
static styles: CSSResult[];
|
|
3885
3971
|
/**
|
|
@@ -3909,6 +3995,9 @@ declare global {
|
|
|
3909
3995
|
"primer-vault-manager-header": VaultManagerHeaderComponent;
|
|
3910
3996
|
}
|
|
3911
3997
|
}
|
|
3998
|
+
/**
|
|
3999
|
+
* VaultDeleteConfirmationComponent - displays confirmation UI for deleting a payment method
|
|
4000
|
+
*/
|
|
3912
4001
|
declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
3913
4002
|
static styles: CSSResult[];
|
|
3914
4003
|
/**
|
|
@@ -3950,6 +4039,9 @@ declare global {
|
|
|
3950
4039
|
"primer-vault-delete-confirmation": VaultDeleteConfirmationComponent;
|
|
3951
4040
|
}
|
|
3952
4041
|
}
|
|
4042
|
+
/**
|
|
4043
|
+
* VaultEmptyStateComponent - displays when no payment methods are available
|
|
4044
|
+
*/
|
|
3953
4045
|
declare class VaultEmptyStateComponent extends LitElement {
|
|
3954
4046
|
static styles: CSSResult[];
|
|
3955
4047
|
/**
|
|
@@ -3962,6 +4054,9 @@ declare global {
|
|
|
3962
4054
|
"primer-vault-empty-state": VaultEmptyStateComponent;
|
|
3963
4055
|
}
|
|
3964
4056
|
}
|
|
4057
|
+
/**
|
|
4058
|
+
* VaultErrorMessageComponent - displays error messages with improved visuals
|
|
4059
|
+
*/
|
|
3965
4060
|
declare class VaultErrorMessageComponent extends LitElement {
|
|
3966
4061
|
static styles: CSSResult[];
|
|
3967
4062
|
/**
|
|
@@ -3987,6 +4082,11 @@ declare global {
|
|
|
3987
4082
|
"primer-vault-error-message": VaultErrorMessageComponent;
|
|
3988
4083
|
}
|
|
3989
4084
|
}
|
|
4085
|
+
/**
|
|
4086
|
+
* A submit button component for vault payment flows.
|
|
4087
|
+
* Provides a consistent submit button with translation support.
|
|
4088
|
+
* Integrates with the vault manager context to handle payment submission.
|
|
4089
|
+
*/
|
|
3990
4090
|
declare class VaultPaymentSubmitComponent extends LitElement {
|
|
3991
4091
|
static styles: CSSResult[];
|
|
3992
4092
|
private readonly _userAssignedProps;
|
|
@@ -4030,6 +4130,11 @@ declare global {
|
|
|
4030
4130
|
"primer-vault-payment-submit": VaultPaymentSubmitComponent;
|
|
4031
4131
|
}
|
|
4032
4132
|
}
|
|
4133
|
+
/**
|
|
4134
|
+
* CVV Input component for vault payment methods
|
|
4135
|
+
* Renders a secure iframe for CVV input when required by the selected payment method
|
|
4136
|
+
* Uses dedicated CVV context to minimize re-renders
|
|
4137
|
+
*/
|
|
4033
4138
|
declare class VaultCvvInputComponent extends LitElement {
|
|
4034
4139
|
static styles: CSSResult[];
|
|
4035
4140
|
/**
|
|
@@ -4074,6 +4179,10 @@ declare global {
|
|
|
4074
4179
|
"primer-vault-manager": VaultManagerComponent;
|
|
4075
4180
|
}
|
|
4076
4181
|
}
|
|
4182
|
+
/**
|
|
4183
|
+
* Component for showing/hiding other payment methods when vault is present
|
|
4184
|
+
* Utilizes the collapsable component for smooth transitions
|
|
4185
|
+
*/
|
|
4077
4186
|
declare class ShowOtherPaymentsComponent extends LitElement {
|
|
4078
4187
|
static styles: CSSResult[];
|
|
4079
4188
|
private isShowingOtherPayments;
|
|
@@ -4110,6 +4219,14 @@ declare global {
|
|
|
4110
4219
|
"primer-checkout-error": PrimerCheckoutErrorComponent;
|
|
4111
4220
|
}
|
|
4112
4221
|
}
|
|
4222
|
+
/**
|
|
4223
|
+
* A container component that connects to the SDK state context
|
|
4224
|
+
* and displays appropriate error messages based on error state.
|
|
4225
|
+
*
|
|
4226
|
+
* This component handles both process errors (typically from backend)
|
|
4227
|
+
* and validation errors (typically from client-side), managing when
|
|
4228
|
+
* and how they are displayed based on the current SDK state.
|
|
4229
|
+
*/
|
|
4113
4230
|
declare class ErrorMessageContainerComponent extends LitElement {
|
|
4114
4231
|
static styles: CSSResult[];
|
|
4115
4232
|
/**
|
|
@@ -4132,10 +4249,79 @@ declare global {
|
|
|
4132
4249
|
"primer-error-message-container": ErrorMessageContainerComponent;
|
|
4133
4250
|
}
|
|
4134
4251
|
}
|
|
4252
|
+
/**
|
|
4253
|
+
* Injects the CSS loader styles into the page
|
|
4254
|
+
* These styles display a loading indicator before JavaScript initializes
|
|
4255
|
+
*
|
|
4256
|
+
* Unlike theme styles, loader styles should take precedence over merchant styles
|
|
4257
|
+
* to ensure the loading indicator is visible. We append them to the end of the head.
|
|
4258
|
+
*/
|
|
4259
|
+
export declare function injectLoaderStyles(): void;
|
|
4260
|
+
/**
|
|
4261
|
+
* Injects all required theme CSS variables into the page
|
|
4262
|
+
* This should be called before components are rendered to ensure
|
|
4263
|
+
* they have access to all design tokens
|
|
4264
|
+
*
|
|
4265
|
+
* Theme styles are prepended to the document head to allow merchant styles
|
|
4266
|
+
* to override our default variables.
|
|
4267
|
+
*/
|
|
4268
|
+
export declare function injectThemeStyles(): void;
|
|
4269
|
+
/**
|
|
4270
|
+
* Utility function to inject only the light theme CSS variables
|
|
4271
|
+
* @returns {void}
|
|
4272
|
+
*/
|
|
4273
|
+
export declare function injectLightTheme(): void;
|
|
4274
|
+
/**
|
|
4275
|
+
* Utility function to inject only the dark theme CSS variables
|
|
4276
|
+
* @returns {void}
|
|
4277
|
+
*/
|
|
4278
|
+
export declare function injectDarkTheme(): void;
|
|
4279
|
+
/**
|
|
4280
|
+
* Main function to load the Primer SDK with all required dependencies and styles
|
|
4281
|
+
* @returns {Promise<void>} A promise that resolves when loading is complete
|
|
4282
|
+
*/
|
|
4283
|
+
export declare function loadPrimer(): Promise<void>;
|
|
4135
4284
|
declare global {
|
|
4136
4285
|
interface HTMLElementTagNameMap {
|
|
4137
4286
|
"primer-checkout": PrimerCheckoutComponent;
|
|
4138
4287
|
}
|
|
4139
4288
|
}
|
|
4140
4289
|
|
|
4290
|
+
export {
|
|
4291
|
+
ButtonComponent as Button,
|
|
4292
|
+
CardFormComponent as CardForm,
|
|
4293
|
+
CardFormSubmitComponent as CardFormSubmit,
|
|
4294
|
+
CardNetworkSelectorComponent as CardFormCardNetworkSelector,
|
|
4295
|
+
CollapsableComponent as Collapsable,
|
|
4296
|
+
ErrorMessageComponent as ErrorMessage,
|
|
4297
|
+
ErrorMessageContainerComponent as ErrorMessageContainer,
|
|
4298
|
+
InputCardExpiryComponent as CardFormExpiry,
|
|
4299
|
+
InputCardHolderNameComponent as CardFormName,
|
|
4300
|
+
InputCardNumberComponent as CardFormCardNumber,
|
|
4301
|
+
InputComponent as Input,
|
|
4302
|
+
InputCvvComponent as CardFormCVV,
|
|
4303
|
+
InputErrorComponent as CardFormError,
|
|
4304
|
+
InputLabelComponent as InputLabel,
|
|
4305
|
+
InputWrapperComponent as InputWrapper,
|
|
4306
|
+
NativePaymentComponent as NativePayment,
|
|
4307
|
+
PaymentMethodComponent as PaymentMethod,
|
|
4308
|
+
PrimerCheckoutCompleteComponent as PrimerCheckoutComplete,
|
|
4309
|
+
PrimerCheckoutErrorComponent as PrimerCheckoutFailure,
|
|
4310
|
+
PrimerCheckoutStateComponent as PrimerCheckoutState,
|
|
4311
|
+
PrimerIconComponent as PrimerIcon,
|
|
4312
|
+
PrimerKlarnaComponent as PrimerKlarna,
|
|
4313
|
+
PrimerMainComponent as PrimerMain,
|
|
4314
|
+
RedirectPaymentComponent as RedirectPayment,
|
|
4315
|
+
ShowOtherPaymentsComponent as ShowOtherPayments,
|
|
4316
|
+
SpinnerComponent as Spinner,
|
|
4317
|
+
VaultCvvInputComponent as VaultCvvInput,
|
|
4318
|
+
VaultDeleteConfirmationComponent as VaultDeleteConfirmation,
|
|
4319
|
+
VaultEmptyStateComponent as VaultEmptyState,
|
|
4320
|
+
VaultErrorMessageComponent as VaultErrorMessage,
|
|
4321
|
+
VaultManagerComponent as VaultManager,
|
|
4322
|
+
VaultManagerHeaderComponent as VaultManagerHeader,
|
|
4323
|
+
VaultPaymentMethodItemComponent as VaultPaymentMethodItem,
|
|
4324
|
+
VaultPaymentSubmitComponent as VaultPaymentSubmit,
|
|
4325
|
+
};
|
|
4326
|
+
|
|
4141
4327
|
export {};
|