@primer-io/primer-js 0.14.0 → 0.15.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.
@@ -125,6 +125,18 @@ export type PrimerCheckoutStateComponentProps = {
125
125
  description?: string | undefined;
126
126
  };
127
127
 
128
+ export type DialogComponentProps = {
129
+ /** */
130
+ size?: "flex" | "large";
131
+ /** */
132
+ showCloseButton?: boolean;
133
+
134
+ /** */
135
+ "onprimer:dialog-open"?: (e: CustomEvent<CustomEvent>) => void;
136
+ /** */
137
+ "onprimer:dialog-close"?: (e: CustomEvent<CustomEvent>) => void;
138
+ };
139
+
128
140
  export type CollapsableComponentProps = {
129
141
  /** The header text for the collapsable */
130
142
  header?: string;
@@ -144,18 +156,6 @@ export type CollapsableComponentProps = {
144
156
  "onexpanded-changed"?: (e: CustomEvent<CustomEvent>) => void;
145
157
  };
146
158
 
147
- export type DialogComponentProps = {
148
- /** */
149
- size?: "flex" | "large";
150
- /** */
151
- showCloseButton?: boolean;
152
-
153
- /** */
154
- "onprimer:dialog-open"?: (e: CustomEvent<CustomEvent>) => void;
155
- /** */
156
- "onprimer:dialog-close"?: (e: CustomEvent<CustomEvent>) => void;
157
- };
158
-
159
159
  export type ErrorMessageComponentProps = {
160
160
  /** The error message text to display */
161
161
  message?: string;
@@ -564,7 +564,7 @@ Falls back to localized default if not explicitly set. */
564
564
  cardFormContext?: CardFormContext | null;
565
565
  };
566
566
 
567
- export type InputCardNumberComponentProps = {
567
+ export type InputCvvComponentProps = {
568
568
  /** */
569
569
  computedStyles?: CSSStyleDeclaration | null;
570
570
  /** The input label text.
@@ -581,7 +581,7 @@ Falls back to localized default if not explicitly set. */
581
581
  cardFormContext?: CardFormContext | null;
582
582
  };
583
583
 
584
- export type InputCvvComponentProps = {
584
+ export type InputCardNumberComponentProps = {
585
585
  /** */
586
586
  computedStyles?: CSSStyleDeclaration | null;
587
587
  /** The input label text.
@@ -625,11 +625,6 @@ export type PayPalComponentProps = {
625
625
  disabled?: boolean;
626
626
  };
627
627
 
628
- export type PaymentMethodContentComponentProps = {
629
- /** The asset configuration containing icon and display data */
630
- assetConfig?: AssetConfig | null;
631
- };
632
-
633
628
  export type VaultCvvInputComponentProps = {
634
629
  /** */
635
630
  computedStyles?: CSSStyleDeclaration | null;
@@ -642,6 +637,11 @@ Separated to minimize re-renders on frequent CVV input changes */
642
637
  vaultManagerCvvContext?: VaultItemContextType;
643
638
  };
644
639
 
640
+ export type PaymentMethodContentComponentProps = {
641
+ /** The asset configuration containing icon and display data */
642
+ assetConfig?: AssetConfig | null;
643
+ };
644
+
645
645
  export type VaultDeleteConfirmationComponentProps = {
646
646
  /** Whether a delete operation is in progress */
647
647
  isDeleting?: boolean;
@@ -779,33 +779,33 @@ export type CustomElements = {
779
779
  "primer-checkout-state": Partial<PrimerCheckoutStateComponentProps & BaseProps & BaseEvents>;
780
780
 
781
781
  /**
782
- * A collapsable component that smoothly expands and collapses content.
783
- * Uses CSS Grid for smooth animation and incorporates the primary button.
782
+ *
784
783
  * ---
785
784
  *
786
785
  *
787
786
  * ### **Events:**
788
- * - **expanded-changed**
787
+ * - **primer:dialog-open**
788
+ * - **primer:dialog-close**
789
789
  *
790
790
  * ### **Methods:**
791
- * - **expand(): _void_** - Expand the collapsable programmatically
792
- * - **collapse(): _void_** - Collapse the collapsable programmatically
791
+ * - **startExitAnimation(): _void_** - Public method to trigger exit animation programmatically
793
792
  */
794
- "primer-collapsable": Partial<CollapsableComponentProps & BaseProps & BaseEvents>;
793
+ "primer-dialog": Partial<DialogComponentProps & BaseProps & BaseEvents>;
795
794
 
796
795
  /**
797
- *
796
+ * A collapsable component that smoothly expands and collapses content.
797
+ * Uses CSS Grid for smooth animation and incorporates the primary button.
798
798
  * ---
799
799
  *
800
800
  *
801
801
  * ### **Events:**
802
- * - **primer:dialog-open**
803
- * - **primer:dialog-close**
802
+ * - **expanded-changed**
804
803
  *
805
804
  * ### **Methods:**
806
- * - **startExitAnimation(): _void_** - Public method to trigger exit animation programmatically
805
+ * - **expand(): _void_** - Expand the collapsable programmatically
806
+ * - **collapse(): _void_** - Collapse the collapsable programmatically
807
807
  */
808
- "primer-dialog": Partial<DialogComponentProps & BaseProps & BaseEvents>;
808
+ "primer-collapsable": Partial<CollapsableComponentProps & BaseProps & BaseEvents>;
809
809
 
810
810
  /**
811
811
  * A reusable atomic error message component that displays error information
@@ -1148,34 +1148,34 @@ export type CustomElements = {
1148
1148
  "primer-input-card-holder-name": Partial<InputCardHolderNameComponentProps & BaseProps & BaseEvents>;
1149
1149
 
1150
1150
  /**
1151
- * Card number input component with dynamic card network detection and selection
1151
+ *
1152
1152
  * ---
1153
1153
  *
1154
1154
  *
1155
1155
  * ### **Methods:**
1156
1156
  *
1157
- *
1158
1157
  * - **getError(): _string|null_** - Get the error code from the hosted input controller when the input is submitted or touched
1159
1158
  *
1160
1159
  * Can be used instead of the error returned by the `validate()` method since internally `primer-sdk-web`
1161
1160
  * uses the same logic to compute the error code
1161
+ *
1162
1162
  */
1163
- "primer-input-card-number": Partial<InputCardNumberComponentProps & BaseProps & BaseEvents>;
1163
+ "primer-input-cvv": Partial<InputCvvComponentProps & BaseProps & BaseEvents>;
1164
1164
 
1165
1165
  /**
1166
- *
1166
+ * Card number input component with dynamic card network detection and selection
1167
1167
  * ---
1168
1168
  *
1169
1169
  *
1170
1170
  * ### **Methods:**
1171
1171
  *
1172
+ *
1172
1173
  * - **getError(): _string|null_** - Get the error code from the hosted input controller when the input is submitted or touched
1173
1174
  *
1174
1175
  * Can be used instead of the error returned by the `validate()` method since internally `primer-sdk-web`
1175
1176
  * uses the same logic to compute the error code
1176
- *
1177
1177
  */
1178
- "primer-input-cvv": Partial<InputCvvComponentProps & BaseProps & BaseEvents>;
1178
+ "primer-input-card-number": Partial<InputCardNumberComponentProps & BaseProps & BaseEvents>;
1179
1179
 
1180
1180
  /**
1181
1181
  * Apple Pay component with standard button container rendering.
@@ -1216,15 +1216,6 @@ export type CustomElements = {
1216
1216
  */
1217
1217
  "primer-paypal": Partial<PayPalComponentProps & BaseProps & BaseEvents>;
1218
1218
 
1219
- /**
1220
- * PaymentMethodContentComponent - renders payment method information with icon and details
1221
- * This component encapsulates the display logic and styles for payment method content
1222
- * so it can be reused across different containers without style conflicts
1223
- * ---
1224
- *
1225
- */
1226
- "primer-payment-method-content": Partial<PaymentMethodContentComponentProps & BaseProps & BaseEvents>;
1227
-
1228
1219
  /**
1229
1220
  * CVV Input component for vault payment methods
1230
1221
  * Renders a secure iframe for CVV input when required by the selected payment method
@@ -1237,6 +1228,15 @@ export type CustomElements = {
1237
1228
  */
1238
1229
  "primer-vault-cvv-input": Partial<VaultCvvInputComponentProps & BaseProps & BaseEvents>;
1239
1230
 
1231
+ /**
1232
+ * PaymentMethodContentComponent - renders payment method information with icon and details
1233
+ * This component encapsulates the display logic and styles for payment method content
1234
+ * so it can be reused across different containers without style conflicts
1235
+ * ---
1236
+ *
1237
+ */
1238
+ "primer-payment-method-content": Partial<PaymentMethodContentComponentProps & BaseProps & BaseEvents>;
1239
+
1240
1240
  /**
1241
1241
  * VaultDeleteConfirmationComponent - displays confirmation UI for deleting a payment method
1242
1242
  * ---
@@ -810,6 +810,24 @@ export interface CardNetworkChangeEvent {
810
810
  };
811
811
  source: "REMOTE" | "LOCAL" | "LOCAL_FALLBACK";
812
812
  }
813
+ export interface BinDataDetails extends CardNetworkDetails {
814
+ issuerCountryCode?: string;
815
+ issuerName?: string;
816
+ accountFundingType?: string;
817
+ prepaidReloadableIndicator?: string;
818
+ productUsageType?: string;
819
+ productCode?: string;
820
+ productName?: string;
821
+ issuerCurrencyCode?: string;
822
+ regionalRestriction?: string;
823
+ accountNumberType?: string;
824
+ }
825
+ export interface BinDataAvailableEvent {
826
+ preferred?: BinDataDetails;
827
+ alternatives: BinDataDetails[];
828
+ status: "complete" | "partial";
829
+ firstDigits?: string;
830
+ }
813
831
  export interface CardPaymentMethodSubmitValues {
814
832
  cardNetwork?: string;
815
833
  }
@@ -1124,6 +1142,8 @@ export interface HeadlessSDKUtilities {
1124
1142
  setBillingAddress(address: NullableAddress): Promise<void>;
1125
1143
  }
1126
1144
  export interface CardPaymentMethodManagerOptions {
1145
+ onBinDataAvailable?: (event: BinDataAvailableEvent) => void;
1146
+ onBinDataLoadingChange?: (loading: boolean) => void;
1127
1147
  onCardMetadataChange?: (metadata: {
1128
1148
  type: CardNetworkType | null;
1129
1149
  possibleTypes: string[];
@@ -2486,6 +2506,10 @@ export interface PrimerEvents {
2486
2506
  "primer:methods-update": CustomEvent<InitializedPayments>;
2487
2507
  "primer:ready": CustomEvent<PrimerJS>;
2488
2508
  "primer:card-network-change": CustomEvent<CardNetworksContextType>;
2509
+ "primer:bin-data-loading-change": CustomEvent<{
2510
+ loading: boolean;
2511
+ }>;
2512
+ "primer:bin-data-available": CustomEvent<BinDataAvailableEvent>;
2489
2513
  "primer:card-submit": CustomEvent<CardSubmitPayload>;
2490
2514
  "primer:card-success": CustomEvent<CardSubmitSuccessPayload>;
2491
2515
  "primer:card-error": CustomEvent<CardSubmitErrorsPayload>;
@@ -2538,6 +2562,8 @@ declare class PrimerEventsController implements ReactiveController {
2538
2562
  dispatchPaymentMethods(paymentMethods: InitializedPayments): void;
2539
2563
  dispatchCheckoutInitialized(checkoutInstance: PrimerJS): void;
2540
2564
  dispatchCardNetworkChange(network: CardNetworksContextType): void;
2565
+ dispatchBinDataAvailable(data: BinDataAvailableEvent): void;
2566
+ dispatchBinDataLoadingChange(loading: boolean): void;
2541
2567
  dispatchCardSubmit(source?: string): void;
2542
2568
  dispatchFormSubmitSuccess(result: CardSubmitResult): void;
2543
2569
  dispatchFormSubmitErrors(errors: InputValidationError[]): void;
@@ -2766,6 +2792,7 @@ declare class CardNetworkController implements ReactiveController {
2766
2792
  * @param event - The card network change event
2767
2793
  */
2768
2794
  processCardNetworkChangeEvent(event: CardNetworkChangeEvent): void;
2795
+ processBinDataAvailableEvent(event: BinDataAvailableEvent): void;
2769
2796
  }
2770
2797
  declare class StyleProcessingController implements ReactiveController {
2771
2798
  host: ReactiveControllerHost & LitElement;