@primer-io/primer-js 0.3.2 → 0.3.4

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.
@@ -139,7 +139,15 @@ export type CollapsableComponentProps = {
139
139
  "onexpanded-changed"?: (e: CustomEvent<CustomEvent>) => void;
140
140
  };
141
141
 
142
- export type DialogComponentProps = {};
142
+ export type DialogComponentProps = {
143
+ /** */
144
+ size?: "flex" | "large";
145
+ /** */
146
+ showCloseButton?: boolean;
147
+
148
+ /** */
149
+ "onprimer-dialog-close"?: (e: CustomEvent<CustomEvent>) => void;
150
+ };
143
151
 
144
152
  export type ErrorMessageComponentProps = {
145
153
  /** The error message text to display */
@@ -344,6 +352,19 @@ export type PaymentMethodContainerComponentProps = {
344
352
  clientOptions?: ClientOptionsContextType;
345
353
  };
346
354
 
355
+ export type PortalDialogComponentProps = {
356
+ /** */
357
+ size?: "flex" | "large";
358
+ /** */
359
+ showCloseButton?: boolean;
360
+ /** */
361
+ onOpen?: () => void | undefined;
362
+ /** */
363
+ secureHtmlContent?: SecureHtmlContentAccess | undefined;
364
+ /** */
365
+ open?: boolean;
366
+ };
367
+
347
368
  export type PrimerCheckoutCompleteComponentProps = {};
348
369
 
349
370
  export type PrimerCheckoutErrorComponentProps = {
@@ -668,6 +689,12 @@ export type CustomElements = {
668
689
  *
669
690
  * ---
670
691
  *
692
+ *
693
+ * ### **Events:**
694
+ * - **primer-dialog-close**
695
+ *
696
+ * ### **Methods:**
697
+ * - **startExitAnimation(): _void_** - Public method to trigger exit animation programmatically
671
698
  */
672
699
  "primer-dialog": Partial<DialogComponentProps & BaseProps & BaseEvents>;
673
700
 
@@ -849,6 +876,17 @@ export type CustomElements = {
849
876
  */
850
877
  "primer-payment-method-container": Partial<PaymentMethodContainerComponentProps & BaseProps & BaseEvents>;
851
878
 
879
+ /**
880
+ *
881
+ * ---
882
+ *
883
+ *
884
+ * ### **Methods:**
885
+ * - **openDialog(): _void_** - Opens the content dialog
886
+ * - **closeDialog(): _void_** - Closes the dialog with animation
887
+ */
888
+ "primer-portal-dialog": Partial<PortalDialogComponentProps & BaseProps & BaseEvents>;
889
+
852
890
  /**
853
891
  *
854
892
  * ---
@@ -1221,13 +1221,14 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
1221
1221
  private itemController;
1222
1222
  private _vaultManager;
1223
1223
  private _options;
1224
+ private createVaultManagerFn;
1224
1225
  constructor(host: PrimerCheckoutType);
1225
1226
  /**
1226
- * Initialize the vault manager with additional options
1227
- * @param vaultManager - The HeadlessVaultManager instance
1228
- * @param options - Additional initialization options
1227
+ * Initialize the vault manager with a factory function and options
1228
+ * @param createVaultManagerFn - Bound function to create vault manager when needed
1229
+ * @param options - Vault configuration options
1229
1230
  */
1230
- initializeVaultManager(vaultManager: HeadlessVaultManager, options?: VaultManagerInitOptions): void;
1231
+ initializeVaultManager(createVaultManagerFn: PrimerHeadlessCheckout["createVaultManager"] | null, options?: VaultManagerInitOptions): void;
1231
1232
  get vaultManager(): HeadlessVaultManager | null;
1232
1233
  set vaultManager(vaultManager: HeadlessVaultManager | null);
1233
1234
  get options(): VaultManagerInitOptions | null;
@@ -2046,7 +2047,20 @@ declare global {
2046
2047
  }
2047
2048
  declare class DialogComponent extends LitElement {
2048
2049
  static styles: import("lit").CSSResult[];
2050
+ size: "flex" | "large";
2051
+ showCloseButton: boolean;
2052
+ private _animationState;
2053
+ private _isVisible;
2054
+ private _animationTimeout?;
2049
2055
  private _handleCloseClick;
2056
+ /**
2057
+ * Public method to trigger exit animation programmatically
2058
+ */
2059
+ startExitAnimation(): void;
2060
+ connectedCallback(): void;
2061
+ disconnectedCallback(): void;
2062
+ private _startEnterAnimation;
2063
+ private _startExitAnimation;
2050
2064
  render(): import("lit-html").TemplateResult<1>;
2051
2065
  }
2052
2066
  declare global {
@@ -2222,6 +2236,50 @@ declare global {
2222
2236
  "primer-redirect-payment": RedirectPaymentComponent;
2223
2237
  }
2224
2238
  }
2239
+ /**
2240
+ * Interface for secure htmlContent access
2241
+ */
2242
+ export interface SecureHtmlContentAccess {
2243
+ token: symbol;
2244
+ content: string;
2245
+ }
2246
+ export interface PortalDialogData {
2247
+ size?: "flex" | "large";
2248
+ showCloseButton?: boolean;
2249
+ onOpen?: () => void;
2250
+ }
2251
+ export declare class PortalDialogComponent extends LitElement {
2252
+ static styles: import("lit").CSSResult[];
2253
+ size: "flex" | "large";
2254
+ showCloseButton: boolean;
2255
+ onOpen?: () => void;
2256
+ secureHtmlContent?: SecureHtmlContentAccess;
2257
+ open: boolean;
2258
+ /**
2259
+ * Opens the content dialog
2260
+ */
2261
+ openDialog(): void;
2262
+ /**
2263
+ * Closes the dialog with animation
2264
+ */
2265
+ closeDialog(): void;
2266
+ /**
2267
+ * Renders the content inside the dialog
2268
+ */
2269
+ private renderContent;
2270
+ /**
2271
+ * Renders secure HTML content if valid token is provided
2272
+ * Only sdk-core can pass HTML content - Token creation is restricted to sdk-core package
2273
+ */
2274
+ private renderSecureHtmlContent;
2275
+ /**
2276
+ * Renders the dialog with portal
2277
+ */
2278
+ private renderDialog;
2279
+ connectedCallback(): void;
2280
+ updated(changedProperties: Map<string, unknown>): void;
2281
+ render(): import("lit-html").TemplateResult<1>;
2282
+ }
2225
2283
  /**
2226
2284
  * Events emitted by the vault manager components
2227
2285
  */