@forgerock/login-widget 2.0.0 → 2.2.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.
package/README.md CHANGED
@@ -36,10 +36,11 @@
36
36
  - [Journey](#journey)
37
37
  - [Component](#component)
38
38
  - [User](#user)
39
- - [Request](#request)
40
39
  - [Styling Configuration](#styling-configuration)
41
40
  - [Links Configuration](#links-configuration)
42
41
  - [Content Configuration](#content-configuration)
42
+ - [CAPTCHA Configuration](#captcha-configuration)
43
+ - [Scripted Text Output](#scripted-text-output)
43
44
  - [Supported Callbacks](#supported-callbacks)
44
45
  - [Disclaimer](#disclaimer)
45
46
  - [License](#license)
@@ -48,7 +49,7 @@
48
49
 
49
50
  The Login Widget is an all-inclusive UI component for handling login, registration, and related user flows in any modern JavaScript app. It works with React, Vue, Angular, Svelte, or vanilla JavaScript — it does not currently support Node.js or server-side rendering (SSR).
50
51
 
51
- The widget uses [Journey Client](https://developer.pingidentity.com/orchsdks/journey/usage/javascript/index.html) for journey execution, and the [ForgeRock SDK for JavaScript](https://docs.pingidentity.com/sdks/latest/sdks/tutorials/javascript/index.html) for OAuth/OIDC tokens, user info, and request utilities. It adds a UI rendering layer on top of these SDKs to eliminate the need to develop and maintain UI components for complex authentication flows. Although this rendering layer is developed with Svelte and Tailwind, both are "compiled away" and have no runtime dependencies. The resulting widget is library- and framework-agnostic.
52
+ The widget uses [Journey Client](https://developer.pingidentity.com/orchsdks/journey/usage/javascript/index.html) for journey execution, and [OIDC Client](https://developer.pingidentity.com/orchsdks/oidc/usage/javascript-centralized-login.html) for OAuth/OIDC tokens and user info. It adds a UI rendering layer on top of these SDKs to eliminate the need to develop and maintain UI components for complex authentication flows. Although this rendering layer is developed with Svelte and Tailwind, both are "compiled away" and have no runtime dependencies. The resulting widget is library- and framework-agnostic.
52
53
 
53
54
  The widget can be rendered in two form factors:
54
55
 
@@ -139,12 +140,15 @@ import Widget, { configure, journey } from '@forgerock/login-widget';
139
140
  // 1. Configure — async; awaiting it ensures both clients are ready before use
140
141
  await configure({
141
142
  // REQUIRED — the well-known URL, shared by the journey and OIDC clients
142
- wellknown: 'https://your-tenant.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
143
+ serverConfig: {
144
+ wellknown:
145
+ 'https://your-tenant.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
146
+ },
143
147
  // REQUIRED if you use OAuth/OIDC tokens, user info, or logout
144
148
  oidcClient: {
145
149
  clientId: 'YourOauthClient',
146
150
  redirectUri: `${window.location.origin}/callback`,
147
- scope: 'openid profile email',
151
+ scope: 'openid profile email', // OPTIONAL — defaults to 'openid'
148
152
  },
149
153
  });
150
154
 
@@ -259,14 +263,23 @@ import { configure } from '@forgerock/login-widget';
259
263
  // configure() is async — await it before calling any other Widget API
260
264
  await configure({
261
265
  // REQUIRED — the well-known URL, shared by the journey and OIDC clients
262
- wellknown:
263
- 'https://your-tenant.forgeblocks.com/am/oauth2/realms/root/realms/alpha/.well-known/openid-configuration',
266
+ serverConfig: {
267
+ wellknown:
268
+ 'https://your-tenant.forgeblocks.com/am/oauth2/realms/root/realms/alpha/.well-known/openid-configuration',
269
+ },
264
270
  // REQUIRED if you use OAuth/OIDC tokens, user info, or logout
265
271
  oidcClient: {
266
272
  clientId: 'WebOAuthClient',
267
273
  redirectUri: `${window.location.origin}/callback`,
268
274
  scope: 'openid profile email',
269
275
  },
276
+ // OPTIONAL — logger for both clients; `level` gates verbosity and `custom`
277
+ // redirects SDK log output to your own sink. See the full example below.
278
+ logger: { level: 'warn' },
279
+ // OPTIONAL — request middleware for both clients; see the full example below
280
+ middleware: [],
281
+ // OPTIONAL — token storage config; see Storage section below
282
+ storage: { type: 'sessionStorage', name: 'tokens' },
270
283
  // OPTIONAL — see dedicated sections below
271
284
  content: {},
272
285
  links: {},
@@ -275,9 +288,115 @@ await configure({
275
288
  ```
276
289
 
277
290
  > **Migration note (2.0.0):** The `forgerock` config object has been replaced by `oidcClient`.
278
- > Endpoint discovery is now driven by a single top-level `wellknown` URL, shared by the
279
- > journey and OIDC clients — `baseUrl`, `realmPath`, `timeout`, and `support` are no longer
280
- > used. `clientId`, `redirectUri`, and `scope` are now required when configuring `oidcClient`.
291
+ > Endpoint discovery is now driven by `serverConfig.wellknown`, shared by the journey and OIDC
292
+ > clients — `baseUrl`, `realmPath`, `timeout`, and `support` are no longer used. `clientId` and
293
+ > `redirectUri` are required when configuring `oidcClient`; `scope` defaults to `'openid'`. `tokenStore` has
294
+ > moved to a top-level `storage` option.
295
+
296
+ #### Logger
297
+
298
+ The top-level `logger` option is forwarded to both the journey and OIDC clients.
299
+
300
+ | Property | Type | Default | Description |
301
+ | -------- | -------------------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
302
+ | `level` | `'none' \| 'error' \| 'warn' \| 'info' \| 'debug'` | `'error'` | Gates SDK log verbosity. `'none'` silences all SDK logs. |
303
+ | `custom` | `{ error, warn, info, debug }` | — | Sink for SDK log output. When set, the SDK calls your methods instead of the `console`. |
304
+
305
+ ```js
306
+ await configure({
307
+ serverConfig: {
308
+ wellknown:
309
+ 'https://your-tenant.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
310
+ },
311
+ logger: {
312
+ level: 'debug',
313
+ // OPTIONAL — route SDK logs to your own sink instead of the console.
314
+ custom: {
315
+ error: (...args) => myLogger.error(...args),
316
+ warn: (...args) => myLogger.warn(...args),
317
+ info: (...args) => myLogger.info(...args),
318
+ debug: (...args) => myLogger.debug(...args),
319
+ },
320
+ },
321
+ oidcClient: {
322
+ clientId: 'WebOAuthClient',
323
+ redirectUri: `${window.location.origin}/callback`,
324
+ scope: 'openid profile email',
325
+ },
326
+ });
327
+ ```
328
+
329
+ #### OIDC Client Options
330
+
331
+ All properties are nested inside `oidcClient`.
332
+
333
+ | Property | Type | Default | Description |
334
+ | ---------------- | ------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
335
+ | `clientId` | `string` | — | **Required.** OAuth 2.0 client ID. |
336
+ | `redirectUri` | `string` | — | **Required.** URI AM redirects to after authorization. |
337
+ | `scope` | `string` | `'openid'` | OAuth 2.0 scopes. |
338
+ | `oauthThreshold` | `number` | `30000` | Milliseconds before expiry to trigger background renewal. |
339
+ | `par` | `boolean` | auto | Use Pushed Authorization Requests. When omitted, the SDK auto-detects from the authorization server's `require_pushed_authorization_requests` metadata. Setting `false` while the server requires PAR is an error. |
340
+ | `loginHint` | `string` | — | Pre-fills the login identifier; bridged onto silent token renewal. |
341
+ | `acrValues` | `string` | — | Requested ACR values; bridged onto silent token renewal. |
342
+ | `query` | `Record<string, string>` | — | Extra authorize query params; bridged onto silent token renewal. |
343
+
344
+ Example with all optional OIDC options:
345
+
346
+ ```js
347
+ await configure({
348
+ serverConfig: {
349
+ wellknown:
350
+ 'https://your-tenant.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
351
+ },
352
+ logger: { level: 'debug' },
353
+ middleware: [
354
+ (req, action, next) => {
355
+ console.log('[middleware]', action.type, req.url);
356
+ next();
357
+ },
358
+ ],
359
+ storage: { type: 'sessionStorage', name: 'tokens', prefix: 'myapp' },
360
+ oidcClient: {
361
+ clientId: 'WebOAuthClient',
362
+ redirectUri: `${window.location.origin}/callback`,
363
+ scope: 'openid profile email',
364
+ oauthThreshold: 60000,
365
+ par: true,
366
+ loginHint: 'user@example.com',
367
+ acrValues: 'urn:acr:2fa',
368
+ query: { ui_locales: 'en-US' },
369
+ },
370
+ });
371
+ ```
372
+
373
+ #### Storage
374
+
375
+ The top-level `storage` option configures where the OIDC client persists tokens. It mirrors
376
+ the SDK's `StorageConfig` union — `type` selects a browser store or a custom sink.
377
+
378
+ | Property | Type | Default | Description |
379
+ | -------- | ------------------------------------------------ | ---------------- | ----------------------------------------------------------------------- |
380
+ | `type` | `'localStorage' \| 'sessionStorage' \| 'custom'` | `'localStorage'` | Storage backend. `'custom'` requires a `custom` sink. |
381
+ | `name` | `string` | — | **Required.** Storage key name. |
382
+ | `prefix` | `string` | `'pic'` | Key prefix for storage entries. |
383
+ | `custom` | `{ get, set, remove }` | — | **Required when `type: 'custom'`.** Async functions for your own store. |
384
+
385
+ ```js
386
+ // Browser store
387
+ storage: { type: 'sessionStorage', name: 'tokens', prefix: 'myapp' },
388
+
389
+ // Custom store
390
+ storage: {
391
+ type: 'custom',
392
+ name: 'tokens',
393
+ custom: {
394
+ get: async (key) => myStore.read(key),
395
+ set: async (key, value) => myStore.write(key, value),
396
+ remove: async (key) => myStore.delete(key),
397
+ },
398
+ },
399
+ ```
281
400
 
282
401
  ### Journey
283
402
 
@@ -441,7 +560,6 @@ await configure({
441
560
  checksAndRadios: 'animated', // OPTIONAL; 'animated' or 'standard'
442
561
  labels: 'floating', // OPTIONAL; 'floating' or 'stacked'
443
562
  logo: {
444
- // OPTIONAL; modal only
445
563
  dark: 'https://example.com/img/white-logo.png',
446
564
  light: 'https://example.com/img/black-logo.png', // REQUIRED if logo provided
447
565
  height: 300,
@@ -454,11 +572,33 @@ await configure({
454
572
  stage: {
455
573
  icon: true, // OPTIONAL; display generic stage icons
456
574
  },
575
+ callbacks: {
576
+ // OPTIONAL; per-callback style rules, keyed by AM callback type name
577
+ // — see "Scripted Text Output"; rules are plain string dictionaries
578
+ TextOutputCallback: [{ type: '4', display: 'hidden' }],
579
+ },
457
580
  },
458
581
  });
459
582
  ```
460
583
 
461
- > **Note**: The `logo` and `sections` properties only apply to the modal form factor.
584
+ > **Note**: The `sections.header` property only applies to the modal form factor. The `logo`
585
+ > property applies to all form factors.
586
+
587
+ #### Logo CSS custom properties
588
+
589
+ The logo configuration is applied as root-level CSS custom properties on the widget root
590
+ element, re-applied after every theme pass. These are the _fallback_ slots; an IDM page-node
591
+ theme sets the primary `--logo-light` / `--logo-dark` slots and takes precedence over them.
592
+
593
+ | Property | CSS custom property | Notes |
594
+ | -------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
595
+ | `light` | `--fr-logo-light-fallback` | Consumed via `var(--logo-light, var(--fr-logo-light-fallback))` |
596
+ | `dark` | `--fr-logo-dark-fallback` | Consumed via `var(--logo-dark, var(--fr-logo-dark-fallback))` |
597
+ | `height` | `--fr-logo-height` | Falls back to `72px` when unset; the dialog header logo stretches to the header height instead |
598
+ | `width` | `--fr-logo-width` | Falls back to `200px` on stages, `100%` in the dialog; the dialog header logo stretches to the header height when unset |
599
+
600
+ Valid `light` / `dark` values are `https://` URLs, `data:image/` URIs, or root-relative paths
601
+ (leading `/`). Invalid values are dropped by config validation.
462
602
 
463
603
  ### Links Configuration
464
604
 
@@ -498,6 +638,25 @@ await configure({
498
638
 
499
639
  **Script loading:** The widget automatically injects the required CAPTCHA script at mount time — no manual `<script>` tag is needed. If the provider API (`window.grecaptcha` / `window.hcaptcha`) is already present on the page when the widget mounts, injection is skipped.
500
640
 
641
+ ### Scripted Text Output
642
+
643
+ A journey can return client-side JavaScript as a `TextOutputCallback` with `messageType` `4` — for example a tracking or device-fingerprinting snippet. The widget does not execute these scripts, so by default it prints the script source to the screen as text.
644
+
645
+ Hide them with a per-callback rule list under `callbacks`:
646
+
647
+ ```js
648
+ await configure({
649
+ style: {
650
+ callbacks: {
651
+ // omit for default: prints the script source
652
+ TextOutputCallback: [{ type: '4', display: 'hidden' }],
653
+ },
654
+ },
655
+ });
656
+ ```
657
+
658
+ Each rule is a plain string dictionary passed through to that callback's renderer. `type` selects a `TextOutputCallback` message type and `display: 'hidden'` suppresses it. Informational (`0`), warning (`1`), and error (`2`) messages render as usual. The scripts are still not executed either way — the option only controls whether their source is displayed.
659
+
501
660
  ## Supported Callbacks
502
661
 
503
662
  The widget supports the following ForgeRock callbacks:
@@ -30,6 +30,7 @@ export interface JourneyStore extends Pick<Writable<JourneyStoreValue>, 'subscri
30
30
  pop: () => Promise<void>;
31
31
  push: (changeOptions: StartParam) => Promise<void>;
32
32
  reset: () => void;
33
+ restart: () => Promise<void>;
33
34
  resume: (url: string, resumeOptions?: ResumeOptions) => Promise<void>;
34
35
  start: (startOptions?: StartParam, recaptchaAction?: string) => Promise<void>;
35
36
  redirect: (step: JourneyStep) => Promise<void>;
@@ -45,6 +46,7 @@ export interface StageJourneyObject {
45
46
  pop: () => void;
46
47
  push: (options: StartParam) => void;
47
48
  redirect: (step: JourneyStep) => Promise<void>;
49
+ restart: () => Promise<void>;
48
50
  stack: StackStore;
49
51
  }
50
52
  export type StageComponent = new (options: ComponentConstructorOptions<never>) => SvelteComponent;
@@ -84,6 +86,7 @@ export interface StepMetadata {
84
86
  numOfSelfSubmittableCbs: number;
85
87
  numOfUserInputCbs: number;
86
88
  stageName?: string;
89
+ themeId?: string;
87
90
  };
88
91
  platform?: Record<string, unknown>;
89
92
  }
@@ -98,6 +98,7 @@ export declare const stringsSchema: z.ZodObject<{
98
98
  registerHeader: z.ZodString;
99
99
  registerSuccess: z.ZodString;
100
100
  registerYourDevice: z.ZodString;
101
+ startOver: z.ZodString;
101
102
  requiredField: z.ZodString;
102
103
  securityAnswer: z.ZodString;
103
104
  setupTwoStepVerification: z.ZodString;
@@ -231,6 +232,7 @@ export declare const partialStringsSchema: z.ZodObject<{
231
232
  registerHeader: z.ZodOptional<z.ZodString>;
232
233
  registerSuccess: z.ZodOptional<z.ZodString>;
233
234
  registerYourDevice: z.ZodOptional<z.ZodString>;
235
+ startOver: z.ZodOptional<z.ZodString>;
234
236
  requiredField: z.ZodOptional<z.ZodString>;
235
237
  securityAnswer: z.ZodOptional<z.ZodString>;
236
238
  setupTwoStepVerification: z.ZodOptional<z.ZodString>;
@@ -372,6 +374,7 @@ export declare function initialize(userLocale?: z.infer<typeof partialStringsSch
372
374
  registerHeader: z.ZodString;
373
375
  registerSuccess: z.ZodString;
374
376
  registerYourDevice: z.ZodString;
377
+ startOver: z.ZodString;
375
378
  requiredField: z.ZodString;
376
379
  securityAnswer: z.ZodString;
377
380
  setupTwoStepVerification: z.ZodString;
@@ -6,10 +6,13 @@
6
6
  * of the MIT license. See the LICENSE file for details.
7
7
  *
8
8
  **/
9
- import type { GetTokensOptions, OauthTokens, OidcClient } from '@forgerock/oidc-client/types';
9
+ import type { GetAuthorizationUrlOptions, GetTokensOptions, OauthTokens, OidcClient, StorageConfig } from '@forgerock/oidc-client/types';
10
10
  import type { Readable, Writable } from 'svelte/store';
11
11
  import type { Maybe } from '../interfaces';
12
+ import type { OidcClientConfig } from '../oidc/oidc.store';
12
13
  export interface OAuthStore extends Pick<Writable<OAuthTokenStoreValue>, 'subscribe'> {
14
+ background: (options?: GetAuthorizationUrlOptions) => void;
15
+ exchange: (options?: Partial<StorageConfig>) => void;
13
16
  get: (getOptions?: GetTokensOptions) => Promise<OAuthTokenStoreValue>;
14
17
  reset: () => void;
15
18
  }
@@ -22,12 +25,14 @@ export interface OAuthTokenStoreValue {
22
25
  }>;
23
26
  loading: boolean;
24
27
  successful: boolean;
28
+ code: Maybe<string>;
29
+ state: Maybe<string>;
25
30
  response: Maybe<OauthTokens> | void;
26
31
  }
27
32
  /**
28
33
  * @function initialize - Initializes the OAuth store with a get function and a reset function
29
34
  * @param {Readable<OidcClient | null>} oidcClientStore - The OIDC client store to read the client from
30
- * @param {GetTokensOptions} initOptions - Default options to pass to `token.get`
35
+ * @param {OidcClientConfig} oidcConfig - The OIDC client config; used to build authorizeOptions for token.get
31
36
  * @returns {OAuthStore} - The OAuth store
32
37
  */
33
- export declare function initialize(oidcClientStore: Readable<OidcClient | null> | undefined, initOptions?: GetTokensOptions): OAuthStore;
38
+ export declare function initialize(oidcClientStore: Readable<OidcClient | null> | undefined, oidcConfig?: Omit<OidcClientConfig, 'serverConfig'>): OAuthStore;
@@ -7,10 +7,12 @@
7
7
  *
8
8
  **/
9
9
  import { z } from 'zod';
10
- import type { OidcClient } from '@forgerock/oidc-client/types';
10
+ import type { CustomLogger, LogLevel, OidcClient, RequestMiddleware, StorageConfig } from '@forgerock/oidc-client/types';
11
11
  import type { Readable } from 'svelte/store';
12
12
  /**
13
- * Configure the OIDC Client.
13
+ * Validates the OIDC client config passed to the widget. Accepts the fields from
14
+ * OidcConfig that have a clear consumer use case. serverConfig is injected by the
15
+ * widget from its own wellknown; log is omitted in favour of the top-level logger option.
14
16
  */
15
17
  export declare const oidcClientConfigSchema: z.ZodObject<{
16
18
  clientId: z.ZodString;
@@ -19,6 +21,11 @@ export declare const oidcClientConfigSchema: z.ZodObject<{
19
21
  serverConfig: z.ZodObject<{
20
22
  wellknown: z.ZodString;
21
23
  }, z.core.$strict>;
24
+ par: z.ZodOptional<z.ZodBoolean>;
25
+ loginHint: z.ZodOptional<z.ZodString>;
26
+ acrValues: z.ZodOptional<z.ZodString>;
27
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
28
+ oauthThreshold: z.ZodOptional<z.ZodNumber>;
22
29
  }, z.core.$strict>;
23
30
  export type OidcClientConfig = z.infer<typeof oidcClientConfigSchema>;
24
31
  export type OidcClientStore = Readable<OidcClient | null> & {
@@ -40,6 +47,12 @@ export type OidcClientStore = Readable<OidcClient | null> & {
40
47
  * client instance without module-level state.
41
48
  *
42
49
  * @param {OidcClientConfig} config — OIDC client configuration (validated by Zod).
50
+ * @param {RequestMiddleware[]} [requestMiddleware] — optional request middleware forwarded to `oidc()`.
51
+ * @param {{ level: LogLevel; custom?: CustomLogger }} [logger] — optional logger (level + custom sink) forwarded to `oidc()`.
52
+ * @param {StorageConfig} [storage] — optional token storage config forwarded to `oidc()`.
43
53
  * @returns {OidcClientStore}
44
54
  */
45
- export declare function createOidcClientStore(config: OidcClientConfig): OidcClientStore;
55
+ export declare function createOidcClientStore(config: OidcClientConfig, requestMiddleware?: RequestMiddleware[], logger?: {
56
+ level: LogLevel;
57
+ custom?: CustomLogger;
58
+ }, storage?: StorageConfig): OidcClientStore;
@@ -37,19 +37,74 @@ export declare const themeSchema: z.ZodObject<{
37
37
  }, z.core.$strict>;
38
38
  export type ThemeObject = z.infer<typeof themeSchema>;
39
39
  export declare const logoSchema: z.ZodObject<{
40
- dark: z.ZodOptional<z.ZodString>;
40
+ dark: z.ZodCatch<z.ZodOptional<z.ZodString>>;
41
41
  height: z.ZodOptional<z.ZodNumber>;
42
- light: z.ZodOptional<z.ZodString>;
42
+ light: z.ZodCatch<z.ZodOptional<z.ZodString>>;
43
43
  width: z.ZodOptional<z.ZodNumber>;
44
44
  }, z.core.$strict>;
45
+ /** Convenience type alias for the consumer-supplied logo config object. */
46
+ export type LogoObject = z.infer<typeof logoSchema>;
47
+ export declare const callbackStyleRuleSchema: z.ZodRecord<z.ZodString, z.ZodString>;
48
+ export declare const callbackStylesSchema: z.ZodRecord<z.ZodEnum<{
49
+ BooleanAttributeInputCallback: "BooleanAttributeInputCallback";
50
+ ChoiceCallback: "ChoiceCallback";
51
+ ConfirmationCallback: "ConfirmationCallback";
52
+ DeviceProfileCallback: "DeviceProfileCallback";
53
+ HiddenValueCallback: "HiddenValueCallback";
54
+ KbaCreateCallback: "KbaCreateCallback";
55
+ MetadataCallback: "MetadataCallback";
56
+ NameCallback: "NameCallback";
57
+ NumberAttributeInputCallback: "NumberAttributeInputCallback";
58
+ PasswordCallback: "PasswordCallback";
59
+ PingOneProtectEvaluationCallback: "PingOneProtectEvaluationCallback";
60
+ PingOneProtectInitializeCallback: "PingOneProtectInitializeCallback";
61
+ PollingWaitCallback: "PollingWaitCallback";
62
+ ReCaptchaCallback: "ReCaptchaCallback";
63
+ ReCaptchaEnterpriseCallback: "ReCaptchaEnterpriseCallback";
64
+ RedirectCallback: "RedirectCallback";
65
+ SelectIdPCallback: "SelectIdPCallback";
66
+ StringAttributeInputCallback: "StringAttributeInputCallback";
67
+ SuspendedTextOutputCallback: "SuspendedTextOutputCallback";
68
+ TermsAndConditionsCallback: "TermsAndConditionsCallback";
69
+ TextInputCallback: "TextInputCallback";
70
+ TextOutputCallback: "TextOutputCallback";
71
+ ValidatedCreatePasswordCallback: "ValidatedCreatePasswordCallback";
72
+ ValidatedCreateUsernameCallback: "ValidatedCreateUsernameCallback";
73
+ }> & z.core.$partial, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
45
74
  export declare const styleSchema: z.ZodObject<{
75
+ callbacks: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
76
+ BooleanAttributeInputCallback: "BooleanAttributeInputCallback";
77
+ ChoiceCallback: "ChoiceCallback";
78
+ ConfirmationCallback: "ConfirmationCallback";
79
+ DeviceProfileCallback: "DeviceProfileCallback";
80
+ HiddenValueCallback: "HiddenValueCallback";
81
+ KbaCreateCallback: "KbaCreateCallback";
82
+ MetadataCallback: "MetadataCallback";
83
+ NameCallback: "NameCallback";
84
+ NumberAttributeInputCallback: "NumberAttributeInputCallback";
85
+ PasswordCallback: "PasswordCallback";
86
+ PingOneProtectEvaluationCallback: "PingOneProtectEvaluationCallback";
87
+ PingOneProtectInitializeCallback: "PingOneProtectInitializeCallback";
88
+ PollingWaitCallback: "PollingWaitCallback";
89
+ ReCaptchaCallback: "ReCaptchaCallback";
90
+ ReCaptchaEnterpriseCallback: "ReCaptchaEnterpriseCallback";
91
+ RedirectCallback: "RedirectCallback";
92
+ SelectIdPCallback: "SelectIdPCallback";
93
+ StringAttributeInputCallback: "StringAttributeInputCallback";
94
+ SuspendedTextOutputCallback: "SuspendedTextOutputCallback";
95
+ TermsAndConditionsCallback: "TermsAndConditionsCallback";
96
+ TextInputCallback: "TextInputCallback";
97
+ TextOutputCallback: "TextOutputCallback";
98
+ ValidatedCreatePasswordCallback: "ValidatedCreatePasswordCallback";
99
+ ValidatedCreateUsernameCallback: "ValidatedCreateUsernameCallback";
100
+ }> & z.core.$partial, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>>;
46
101
  checksAndRadios: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>;
47
102
  labels: z.ZodOptional<z.ZodUnion<readonly [z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>;
48
103
  showPassword: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>;
49
104
  logo: z.ZodOptional<z.ZodObject<{
50
- dark: z.ZodOptional<z.ZodString>;
105
+ dark: z.ZodCatch<z.ZodOptional<z.ZodString>>;
51
106
  height: z.ZodOptional<z.ZodNumber>;
52
- light: z.ZodOptional<z.ZodString>;
107
+ light: z.ZodCatch<z.ZodOptional<z.ZodString>>;
53
108
  width: z.ZodOptional<z.ZodNumber>;
54
109
  }, z.core.$strict>>;
55
110
  sections: z.ZodOptional<z.ZodObject<{
@@ -84,15 +139,67 @@ export declare const styleSchema: z.ZodObject<{
84
139
  bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
85
140
  buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
86
141
  }, z.core.$strict>>;
142
+ themeCatalog: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
143
+ primaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
144
+ primaryOffColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
145
+ secondaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
146
+ backgroundColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
147
+ linkColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
148
+ linkActiveColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
149
+ logo: z.ZodCatch<z.ZodOptional<z.ZodString>>;
150
+ favicon: z.ZodCatch<z.ZodOptional<z.ZodString>>;
151
+ logoHeight: z.ZodOptional<z.ZodNumber>;
152
+ fontFamily: z.ZodCatch<z.ZodOptional<z.ZodString>>;
153
+ buttonBorderRadius: z.ZodOptional<z.ZodNumber>;
154
+ cardBorderRadius: z.ZodOptional<z.ZodNumber>;
155
+ cardBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
156
+ inputBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
157
+ inputBorderColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
158
+ inputLabelColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
159
+ inputFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
160
+ selectAccentColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
161
+ selectHoverBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
162
+ buttonFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
163
+ inputTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
164
+ cardTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
165
+ bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
166
+ buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
167
+ }, z.core.$strict>>>;
87
168
  }, z.core.$strict>;
88
169
  export declare const partialStyleSchema: z.ZodObject<{
170
+ callbacks: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodEnum<{
171
+ BooleanAttributeInputCallback: "BooleanAttributeInputCallback";
172
+ ChoiceCallback: "ChoiceCallback";
173
+ ConfirmationCallback: "ConfirmationCallback";
174
+ DeviceProfileCallback: "DeviceProfileCallback";
175
+ HiddenValueCallback: "HiddenValueCallback";
176
+ KbaCreateCallback: "KbaCreateCallback";
177
+ MetadataCallback: "MetadataCallback";
178
+ NameCallback: "NameCallback";
179
+ NumberAttributeInputCallback: "NumberAttributeInputCallback";
180
+ PasswordCallback: "PasswordCallback";
181
+ PingOneProtectEvaluationCallback: "PingOneProtectEvaluationCallback";
182
+ PingOneProtectInitializeCallback: "PingOneProtectInitializeCallback";
183
+ PollingWaitCallback: "PollingWaitCallback";
184
+ ReCaptchaCallback: "ReCaptchaCallback";
185
+ ReCaptchaEnterpriseCallback: "ReCaptchaEnterpriseCallback";
186
+ RedirectCallback: "RedirectCallback";
187
+ SelectIdPCallback: "SelectIdPCallback";
188
+ StringAttributeInputCallback: "StringAttributeInputCallback";
189
+ SuspendedTextOutputCallback: "SuspendedTextOutputCallback";
190
+ TermsAndConditionsCallback: "TermsAndConditionsCallback";
191
+ TextInputCallback: "TextInputCallback";
192
+ TextOutputCallback: "TextOutputCallback";
193
+ ValidatedCreatePasswordCallback: "ValidatedCreatePasswordCallback";
194
+ ValidatedCreateUsernameCallback: "ValidatedCreateUsernameCallback";
195
+ }> & z.core.$partial, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>>>;
89
196
  checksAndRadios: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>>;
90
197
  labels: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>>;
91
198
  showPassword: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>>;
92
199
  logo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
93
- dark: z.ZodOptional<z.ZodString>;
200
+ dark: z.ZodCatch<z.ZodOptional<z.ZodString>>;
94
201
  height: z.ZodOptional<z.ZodNumber>;
95
- light: z.ZodOptional<z.ZodString>;
202
+ light: z.ZodCatch<z.ZodOptional<z.ZodString>>;
96
203
  width: z.ZodOptional<z.ZodNumber>;
97
204
  }, z.core.$strict>>>;
98
205
  sections: z.ZodOptional<z.ZodOptional<z.ZodObject<{
@@ -127,6 +234,32 @@ export declare const partialStyleSchema: z.ZodObject<{
127
234
  bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
128
235
  buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
129
236
  }, z.core.$strict>>>;
237
+ themeCatalog: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
238
+ primaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
239
+ primaryOffColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
240
+ secondaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
241
+ backgroundColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
242
+ linkColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
243
+ linkActiveColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
244
+ logo: z.ZodCatch<z.ZodOptional<z.ZodString>>;
245
+ favicon: z.ZodCatch<z.ZodOptional<z.ZodString>>;
246
+ logoHeight: z.ZodOptional<z.ZodNumber>;
247
+ fontFamily: z.ZodCatch<z.ZodOptional<z.ZodString>>;
248
+ buttonBorderRadius: z.ZodOptional<z.ZodNumber>;
249
+ cardBorderRadius: z.ZodOptional<z.ZodNumber>;
250
+ cardBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
251
+ inputBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
252
+ inputBorderColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
253
+ inputLabelColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
254
+ inputFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
255
+ selectAccentColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
256
+ selectHoverBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
257
+ buttonFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
258
+ inputTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
259
+ cardTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
260
+ bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
261
+ buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
262
+ }, z.core.$strict>>>>;
130
263
  }, z.core.$strict>;
131
264
  /** Convenience type alias for the resolved widget style object. */
132
265
  export type StyleObject = z.infer<typeof partialStyleSchema>;
@@ -138,6 +271,7 @@ export declare const styleStore: Writable<z.infer<typeof partialStyleSchema>>;
138
271
  * @example initialize({ checksAndRadios: 'standard' });
139
272
  */
140
273
  export declare function initialize(customStyle?: z.infer<typeof partialStyleSchema>): Writable<{
274
+ callbacks?: Partial<Record<"BooleanAttributeInputCallback" | "ChoiceCallback" | "ConfirmationCallback" | "DeviceProfileCallback" | "HiddenValueCallback" | "KbaCreateCallback" | "MetadataCallback" | "NameCallback" | "NumberAttributeInputCallback" | "PasswordCallback" | "PingOneProtectEvaluationCallback" | "PingOneProtectInitializeCallback" | "PollingWaitCallback" | "ReCaptchaCallback" | "ReCaptchaEnterpriseCallback" | "RedirectCallback" | "SelectIdPCallback" | "StringAttributeInputCallback" | "SuspendedTextOutputCallback" | "TermsAndConditionsCallback" | "TextInputCallback" | "TextOutputCallback" | "ValidatedCreatePasswordCallback" | "ValidatedCreateUsernameCallback", Record<string, string>[]>> | undefined;
141
275
  checksAndRadios?: "animated" | "standard" | undefined;
142
276
  labels?: "floating" | "stacked" | undefined;
143
277
  showPassword?: "none" | "button" | "checkbox" | undefined;
@@ -179,4 +313,30 @@ export declare function initialize(customStyle?: z.infer<typeof partialStyleSche
179
313
  bodyTextColor?: string | undefined;
180
314
  buttonTextColor?: string | undefined;
181
315
  } | undefined;
316
+ themeCatalog?: Record<string, {
317
+ primaryColor?: string | undefined;
318
+ primaryOffColor?: string | undefined;
319
+ secondaryColor?: string | undefined;
320
+ backgroundColor?: string | undefined;
321
+ linkColor?: string | undefined;
322
+ linkActiveColor?: string | undefined;
323
+ logo?: string | undefined;
324
+ favicon?: string | undefined;
325
+ logoHeight?: number | undefined;
326
+ fontFamily?: string | undefined;
327
+ buttonBorderRadius?: number | undefined;
328
+ cardBorderRadius?: number | undefined;
329
+ cardBgColor?: string | undefined;
330
+ inputBgColor?: string | undefined;
331
+ inputBorderColor?: string | undefined;
332
+ inputLabelColor?: string | undefined;
333
+ inputFocusRingColor?: string | undefined;
334
+ selectAccentColor?: string | undefined;
335
+ selectHoverBgColor?: string | undefined;
336
+ buttonFocusRingColor?: string | undefined;
337
+ inputTextColor?: string | undefined;
338
+ cardTextColor?: string | undefined;
339
+ bodyTextColor?: string | undefined;
340
+ buttonTextColor?: string | undefined;
341
+ }> | undefined;
182
342
  }>;