@ory/elements-react 0.0.0-pr.4a28a8f → 0.0.0-pr.6a36702c
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/CHANGELOG.md +151 -0
- package/README.md +253 -4
- package/dist/client/frontendClient.d.mts +5 -2
- package/dist/client/frontendClient.d.ts +5 -2
- package/dist/client/frontendClient.js +25 -2
- package/dist/client/frontendClient.js.map +1 -1
- package/dist/client/frontendClient.mjs +25 -2
- package/dist/client/frontendClient.mjs.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/index.d.mts +113 -51
- package/dist/index.d.ts +113 -51
- package/dist/index.js +978 -418
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +975 -418
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +60 -10
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.d.mts +15 -3
- package/dist/theme/default/index.d.ts +15 -3
- package/dist/theme/default/index.js +3767 -2963
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +3800 -2973
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +17 -15
- package/tailwind/generated/default-variables.css +1 -1
- package/tsconfig.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText,
|
|
1
|
+
import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, ConfigurationParameters, AccountExperienceConfiguration, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler, FrontendApi } from '@ory/client-fetch';
|
|
2
2
|
import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -53,12 +53,18 @@ type OryNodeImageProps = {
|
|
|
53
53
|
type FormValues = Record<string, string | boolean | number | undefined>;
|
|
54
54
|
type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
|
|
55
55
|
onSubmit: FormEventHandler<HTMLFormElement>;
|
|
56
|
+
"data-testid"?: string;
|
|
56
57
|
};
|
|
57
58
|
type OryNodeInputProps = {
|
|
58
59
|
attributes: UiNodeInputAttributes;
|
|
59
60
|
node: UiNode;
|
|
60
61
|
onClick?: MouseEventHandler;
|
|
61
62
|
};
|
|
63
|
+
type OryNodeConsentScopeCheckboxProps = {
|
|
64
|
+
attributes: UiNodeInputAttributes;
|
|
65
|
+
node: UiNode;
|
|
66
|
+
onCheckedChange: (checked: boolean) => void;
|
|
67
|
+
};
|
|
62
68
|
type OryFormSectionContentProps = PropsWithChildren<{
|
|
63
69
|
title?: string;
|
|
64
70
|
description?: string;
|
|
@@ -105,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
|
|
|
105
111
|
|
|
106
112
|
declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
|
|
107
113
|
|
|
114
|
+
declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
108
116
|
/**
|
|
109
117
|
* Props type for the Form Group Divider component.
|
|
110
118
|
*/
|
|
@@ -248,6 +256,10 @@ type OryFlowComponents = {
|
|
|
248
256
|
* The Captcha component is rendered whenever a "captcha" group is encountered.
|
|
249
257
|
*/
|
|
250
258
|
Captcha: ComponentType<OryNodeCaptchaProps>;
|
|
259
|
+
/**
|
|
260
|
+
* Special version of the Input component for scopes in OAuth2 flows.
|
|
261
|
+
*/
|
|
262
|
+
ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
|
|
251
263
|
};
|
|
252
264
|
Card: {
|
|
253
265
|
/**
|
|
@@ -363,61 +375,23 @@ type DeepPartialTwoLevels<T> = {
|
|
|
363
375
|
type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
|
|
364
376
|
type OryFormProps = PropsWithChildren<{
|
|
365
377
|
onAfterSubmit?: (method: string | number | boolean | undefined) => void;
|
|
378
|
+
"data-testid"?: string;
|
|
366
379
|
}>;
|
|
367
|
-
declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
368
381
|
|
|
369
382
|
declare function useComponents(): OryFlowComponents;
|
|
370
383
|
declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
|
|
371
384
|
flowType: string;
|
|
372
385
|
}) => number;
|
|
373
386
|
|
|
374
|
-
type LocaleMap = Record<string, Record<string, string>>;
|
|
375
|
-
declare const OryLocales: LocaleMap;
|
|
376
|
-
|
|
377
|
-
type Locale = keyof typeof OryLocales;
|
|
378
|
-
type IntlContextProps = {
|
|
379
|
-
locale: Locale;
|
|
380
|
-
customTranslations?: Partial<LocaleMap>;
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
type IntlConfig = IntlContextProps;
|
|
384
|
-
type OryClientConfiguration = {
|
|
385
|
-
/**
|
|
386
|
-
* The name of the application the user is logging in to.
|
|
387
|
-
*/
|
|
388
|
-
name: string;
|
|
389
|
-
/**
|
|
390
|
-
* An optional logo URL to display in the UI instead of the name.
|
|
391
|
-
*/
|
|
392
|
-
logoUrl?: string;
|
|
393
|
-
stylesheet?: string;
|
|
394
|
-
favicon?: string;
|
|
395
|
-
sdk: {
|
|
396
|
-
url: string;
|
|
397
|
-
options?: Partial<ConfigurationParameters>;
|
|
398
|
-
};
|
|
399
|
-
project: {
|
|
400
|
-
registration_enabled: boolean;
|
|
401
|
-
verification_enabled: boolean;
|
|
402
|
-
recovery_enabled: boolean;
|
|
403
|
-
recovery_ui_url: string;
|
|
404
|
-
registration_ui_url: string;
|
|
405
|
-
verification_ui_url: string;
|
|
406
|
-
login_ui_url: string;
|
|
407
|
-
default_redirect_url?: string;
|
|
408
|
-
};
|
|
409
|
-
intl?: IntlConfig;
|
|
410
|
-
};
|
|
411
|
-
|
|
412
387
|
/**
|
|
413
388
|
* A generic flow container, containing a flowType, the flow itself and the config object
|
|
414
389
|
*
|
|
415
390
|
* @see OryClientConfiguration
|
|
416
391
|
*/
|
|
417
|
-
type OryFlow<TFlowType, TFlow> = {
|
|
392
|
+
type OryFlow<TFlowType extends FlowType, TFlow> = {
|
|
418
393
|
flowType: TFlowType;
|
|
419
394
|
flow: TFlow;
|
|
420
|
-
config: OryClientConfiguration;
|
|
421
395
|
};
|
|
422
396
|
/**
|
|
423
397
|
* A flow container for the login flow
|
|
@@ -463,10 +437,65 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
|
|
|
463
437
|
*
|
|
464
438
|
*/
|
|
465
439
|
type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
|
|
440
|
+
type ConsentFlow = {
|
|
441
|
+
created_at: Date;
|
|
442
|
+
expires_at: Date;
|
|
443
|
+
id: string;
|
|
444
|
+
issued_at: Date;
|
|
445
|
+
state: "show_form" | "rejected" | "accepted";
|
|
446
|
+
active: string;
|
|
447
|
+
ui: UiContainer;
|
|
448
|
+
consent_request: OAuth2ConsentRequest;
|
|
449
|
+
session: Session;
|
|
450
|
+
return_to?: string;
|
|
451
|
+
};
|
|
452
|
+
type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
466
453
|
/**
|
|
467
454
|
* A union type of all flow containers
|
|
468
455
|
*/
|
|
469
|
-
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
|
|
456
|
+
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
|
|
457
|
+
|
|
458
|
+
type LocaleMap = Record<string, Record<string, string>>;
|
|
459
|
+
declare const OryLocales: LocaleMap;
|
|
460
|
+
|
|
461
|
+
type Locale = keyof typeof OryLocales;
|
|
462
|
+
type IntlContextProps = {
|
|
463
|
+
locale: Locale;
|
|
464
|
+
customTranslations?: Partial<LocaleMap>;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
type IntlConfig = IntlContextProps;
|
|
468
|
+
/**
|
|
469
|
+
* The configuration for Ory Elements.
|
|
470
|
+
*
|
|
471
|
+
* This configuration is used to customize the behavior and appearance of Ory Elements.
|
|
472
|
+
*
|
|
473
|
+
* By setting UI urls, you can override the default URLs for the login, registration, recovery, and verification flows.
|
|
474
|
+
*
|
|
475
|
+
* You can also set the name of the application, the logo URL, and the SDK configuration.
|
|
476
|
+
* By default, the name and logo are displayed in the card's header.
|
|
477
|
+
*/
|
|
478
|
+
type OryClientConfiguration = {
|
|
479
|
+
/**
|
|
480
|
+
* The SDK configuration.
|
|
481
|
+
* This configuration is used to set the URL of the Ory SDK and any additional options used for the SDK client.
|
|
482
|
+
*/
|
|
483
|
+
sdk?: {
|
|
484
|
+
url?: string;
|
|
485
|
+
options?: Partial<ConfigurationParameters>;
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* The internationalization configuration.
|
|
489
|
+
* This configuration is used to set the locale and any additional options used for the i18n library.
|
|
490
|
+
* The locale is used to determine the language of the UI.
|
|
491
|
+
* The default locale is "en".
|
|
492
|
+
*/
|
|
493
|
+
intl?: IntlConfig;
|
|
494
|
+
/**
|
|
495
|
+
* The configuration for the project.
|
|
496
|
+
*/
|
|
497
|
+
project: AccountExperienceConfiguration;
|
|
498
|
+
};
|
|
470
499
|
|
|
471
500
|
/**
|
|
472
501
|
* Converts a UiText to a FormattedMessage.
|
|
@@ -536,18 +565,23 @@ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlow
|
|
|
536
565
|
* @param message - the UiText message to generate a test id for
|
|
537
566
|
* @returns a unique, stable test id for the message
|
|
538
567
|
*/
|
|
539
|
-
declare function messageTestId(message:
|
|
568
|
+
declare function messageTestId(message: {
|
|
569
|
+
id: number | string;
|
|
570
|
+
}): {
|
|
540
571
|
"data-testid": string;
|
|
541
572
|
};
|
|
542
573
|
|
|
543
|
-
type
|
|
544
|
-
current: "provide_identifier";
|
|
545
|
-
} | {
|
|
574
|
+
type FormStateSelectMethod = {
|
|
546
575
|
current: "select_method";
|
|
547
|
-
}
|
|
576
|
+
};
|
|
577
|
+
type FormStateProvideIdentifier = {
|
|
578
|
+
current: "provide_identifier";
|
|
579
|
+
};
|
|
580
|
+
type FormStateMethodActive = {
|
|
548
581
|
current: "method_active";
|
|
549
582
|
method: UiNodeGroupEnum;
|
|
550
|
-
}
|
|
583
|
+
};
|
|
584
|
+
type FormState = FormStateSelectMethod | FormStateProvideIdentifier | FormStateMethodActive | {
|
|
551
585
|
current: "success_screen";
|
|
552
586
|
} | {
|
|
553
587
|
current: "settings";
|
|
@@ -558,6 +592,8 @@ type FormStateAction = {
|
|
|
558
592
|
} | {
|
|
559
593
|
type: "action_select_method";
|
|
560
594
|
method: UiNodeGroupEnum;
|
|
595
|
+
} | {
|
|
596
|
+
type: "action_clear_active_method";
|
|
561
597
|
};
|
|
562
598
|
|
|
563
599
|
/**
|
|
@@ -591,7 +627,33 @@ type FlowContextValue = OryFlowContainer & {
|
|
|
591
627
|
|
|
592
628
|
type OryProviderProps = {
|
|
593
629
|
components: OryFlowComponents;
|
|
630
|
+
config: OryClientConfiguration;
|
|
594
631
|
} & OryFlowContainer & PropsWithChildren;
|
|
595
|
-
declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
632
|
+
declare function OryProvider({ children, components: Components, config, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
633
|
+
|
|
634
|
+
type OryElementsConfiguration = {
|
|
635
|
+
sdk: OrySDK;
|
|
636
|
+
project: AccountExperienceConfiguration;
|
|
637
|
+
};
|
|
638
|
+
declare function useOryConfiguration(): OryElementsConfiguration;
|
|
639
|
+
type OrySDK = SDKConfig & {
|
|
640
|
+
/**
|
|
641
|
+
* The frontend client for the Ory SDK.
|
|
642
|
+
* This client is used to interact with the Ory SDK and should be used to make API calls.
|
|
643
|
+
*/
|
|
644
|
+
frontend: FrontendApi;
|
|
645
|
+
};
|
|
646
|
+
type SDKConfig = {
|
|
647
|
+
/**
|
|
648
|
+
* The URL of the Ory SDK.
|
|
649
|
+
* This URL is used to connect to the Ory SDK and should be set to the base URL of your Ory instance.
|
|
650
|
+
*/
|
|
651
|
+
url: string;
|
|
652
|
+
options?: Partial<ConfigurationParameters>;
|
|
653
|
+
};
|
|
654
|
+
declare function OryConfigurationProvider({ children, sdk: initialConfig, project, }: PropsWithChildren<{
|
|
655
|
+
sdk?: Partial<OryClientConfiguration["sdk"]>;
|
|
656
|
+
project?: Partial<AccountExperienceConfiguration>;
|
|
657
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
596
658
|
|
|
597
|
-
export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
|
|
659
|
+
export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryElementsConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText,
|
|
1
|
+
import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, ConfigurationParameters, AccountExperienceConfiguration, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler, FrontendApi } from '@ory/client-fetch';
|
|
2
2
|
import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -53,12 +53,18 @@ type OryNodeImageProps = {
|
|
|
53
53
|
type FormValues = Record<string, string | boolean | number | undefined>;
|
|
54
54
|
type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
|
|
55
55
|
onSubmit: FormEventHandler<HTMLFormElement>;
|
|
56
|
+
"data-testid"?: string;
|
|
56
57
|
};
|
|
57
58
|
type OryNodeInputProps = {
|
|
58
59
|
attributes: UiNodeInputAttributes;
|
|
59
60
|
node: UiNode;
|
|
60
61
|
onClick?: MouseEventHandler;
|
|
61
62
|
};
|
|
63
|
+
type OryNodeConsentScopeCheckboxProps = {
|
|
64
|
+
attributes: UiNodeInputAttributes;
|
|
65
|
+
node: UiNode;
|
|
66
|
+
onCheckedChange: (checked: boolean) => void;
|
|
67
|
+
};
|
|
62
68
|
type OryFormSectionContentProps = PropsWithChildren<{
|
|
63
69
|
title?: string;
|
|
64
70
|
description?: string;
|
|
@@ -105,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
|
|
|
105
111
|
|
|
106
112
|
declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
|
|
107
113
|
|
|
114
|
+
declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
108
116
|
/**
|
|
109
117
|
* Props type for the Form Group Divider component.
|
|
110
118
|
*/
|
|
@@ -248,6 +256,10 @@ type OryFlowComponents = {
|
|
|
248
256
|
* The Captcha component is rendered whenever a "captcha" group is encountered.
|
|
249
257
|
*/
|
|
250
258
|
Captcha: ComponentType<OryNodeCaptchaProps>;
|
|
259
|
+
/**
|
|
260
|
+
* Special version of the Input component for scopes in OAuth2 flows.
|
|
261
|
+
*/
|
|
262
|
+
ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
|
|
251
263
|
};
|
|
252
264
|
Card: {
|
|
253
265
|
/**
|
|
@@ -363,61 +375,23 @@ type DeepPartialTwoLevels<T> = {
|
|
|
363
375
|
type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
|
|
364
376
|
type OryFormProps = PropsWithChildren<{
|
|
365
377
|
onAfterSubmit?: (method: string | number | boolean | undefined) => void;
|
|
378
|
+
"data-testid"?: string;
|
|
366
379
|
}>;
|
|
367
|
-
declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
368
381
|
|
|
369
382
|
declare function useComponents(): OryFlowComponents;
|
|
370
383
|
declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
|
|
371
384
|
flowType: string;
|
|
372
385
|
}) => number;
|
|
373
386
|
|
|
374
|
-
type LocaleMap = Record<string, Record<string, string>>;
|
|
375
|
-
declare const OryLocales: LocaleMap;
|
|
376
|
-
|
|
377
|
-
type Locale = keyof typeof OryLocales;
|
|
378
|
-
type IntlContextProps = {
|
|
379
|
-
locale: Locale;
|
|
380
|
-
customTranslations?: Partial<LocaleMap>;
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
type IntlConfig = IntlContextProps;
|
|
384
|
-
type OryClientConfiguration = {
|
|
385
|
-
/**
|
|
386
|
-
* The name of the application the user is logging in to.
|
|
387
|
-
*/
|
|
388
|
-
name: string;
|
|
389
|
-
/**
|
|
390
|
-
* An optional logo URL to display in the UI instead of the name.
|
|
391
|
-
*/
|
|
392
|
-
logoUrl?: string;
|
|
393
|
-
stylesheet?: string;
|
|
394
|
-
favicon?: string;
|
|
395
|
-
sdk: {
|
|
396
|
-
url: string;
|
|
397
|
-
options?: Partial<ConfigurationParameters>;
|
|
398
|
-
};
|
|
399
|
-
project: {
|
|
400
|
-
registration_enabled: boolean;
|
|
401
|
-
verification_enabled: boolean;
|
|
402
|
-
recovery_enabled: boolean;
|
|
403
|
-
recovery_ui_url: string;
|
|
404
|
-
registration_ui_url: string;
|
|
405
|
-
verification_ui_url: string;
|
|
406
|
-
login_ui_url: string;
|
|
407
|
-
default_redirect_url?: string;
|
|
408
|
-
};
|
|
409
|
-
intl?: IntlConfig;
|
|
410
|
-
};
|
|
411
|
-
|
|
412
387
|
/**
|
|
413
388
|
* A generic flow container, containing a flowType, the flow itself and the config object
|
|
414
389
|
*
|
|
415
390
|
* @see OryClientConfiguration
|
|
416
391
|
*/
|
|
417
|
-
type OryFlow<TFlowType, TFlow> = {
|
|
392
|
+
type OryFlow<TFlowType extends FlowType, TFlow> = {
|
|
418
393
|
flowType: TFlowType;
|
|
419
394
|
flow: TFlow;
|
|
420
|
-
config: OryClientConfiguration;
|
|
421
395
|
};
|
|
422
396
|
/**
|
|
423
397
|
* A flow container for the login flow
|
|
@@ -463,10 +437,65 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
|
|
|
463
437
|
*
|
|
464
438
|
*/
|
|
465
439
|
type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
|
|
440
|
+
type ConsentFlow = {
|
|
441
|
+
created_at: Date;
|
|
442
|
+
expires_at: Date;
|
|
443
|
+
id: string;
|
|
444
|
+
issued_at: Date;
|
|
445
|
+
state: "show_form" | "rejected" | "accepted";
|
|
446
|
+
active: string;
|
|
447
|
+
ui: UiContainer;
|
|
448
|
+
consent_request: OAuth2ConsentRequest;
|
|
449
|
+
session: Session;
|
|
450
|
+
return_to?: string;
|
|
451
|
+
};
|
|
452
|
+
type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
466
453
|
/**
|
|
467
454
|
* A union type of all flow containers
|
|
468
455
|
*/
|
|
469
|
-
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
|
|
456
|
+
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
|
|
457
|
+
|
|
458
|
+
type LocaleMap = Record<string, Record<string, string>>;
|
|
459
|
+
declare const OryLocales: LocaleMap;
|
|
460
|
+
|
|
461
|
+
type Locale = keyof typeof OryLocales;
|
|
462
|
+
type IntlContextProps = {
|
|
463
|
+
locale: Locale;
|
|
464
|
+
customTranslations?: Partial<LocaleMap>;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
type IntlConfig = IntlContextProps;
|
|
468
|
+
/**
|
|
469
|
+
* The configuration for Ory Elements.
|
|
470
|
+
*
|
|
471
|
+
* This configuration is used to customize the behavior and appearance of Ory Elements.
|
|
472
|
+
*
|
|
473
|
+
* By setting UI urls, you can override the default URLs for the login, registration, recovery, and verification flows.
|
|
474
|
+
*
|
|
475
|
+
* You can also set the name of the application, the logo URL, and the SDK configuration.
|
|
476
|
+
* By default, the name and logo are displayed in the card's header.
|
|
477
|
+
*/
|
|
478
|
+
type OryClientConfiguration = {
|
|
479
|
+
/**
|
|
480
|
+
* The SDK configuration.
|
|
481
|
+
* This configuration is used to set the URL of the Ory SDK and any additional options used for the SDK client.
|
|
482
|
+
*/
|
|
483
|
+
sdk?: {
|
|
484
|
+
url?: string;
|
|
485
|
+
options?: Partial<ConfigurationParameters>;
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* The internationalization configuration.
|
|
489
|
+
* This configuration is used to set the locale and any additional options used for the i18n library.
|
|
490
|
+
* The locale is used to determine the language of the UI.
|
|
491
|
+
* The default locale is "en".
|
|
492
|
+
*/
|
|
493
|
+
intl?: IntlConfig;
|
|
494
|
+
/**
|
|
495
|
+
* The configuration for the project.
|
|
496
|
+
*/
|
|
497
|
+
project: AccountExperienceConfiguration;
|
|
498
|
+
};
|
|
470
499
|
|
|
471
500
|
/**
|
|
472
501
|
* Converts a UiText to a FormattedMessage.
|
|
@@ -536,18 +565,23 @@ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlow
|
|
|
536
565
|
* @param message - the UiText message to generate a test id for
|
|
537
566
|
* @returns a unique, stable test id for the message
|
|
538
567
|
*/
|
|
539
|
-
declare function messageTestId(message:
|
|
568
|
+
declare function messageTestId(message: {
|
|
569
|
+
id: number | string;
|
|
570
|
+
}): {
|
|
540
571
|
"data-testid": string;
|
|
541
572
|
};
|
|
542
573
|
|
|
543
|
-
type
|
|
544
|
-
current: "provide_identifier";
|
|
545
|
-
} | {
|
|
574
|
+
type FormStateSelectMethod = {
|
|
546
575
|
current: "select_method";
|
|
547
|
-
}
|
|
576
|
+
};
|
|
577
|
+
type FormStateProvideIdentifier = {
|
|
578
|
+
current: "provide_identifier";
|
|
579
|
+
};
|
|
580
|
+
type FormStateMethodActive = {
|
|
548
581
|
current: "method_active";
|
|
549
582
|
method: UiNodeGroupEnum;
|
|
550
|
-
}
|
|
583
|
+
};
|
|
584
|
+
type FormState = FormStateSelectMethod | FormStateProvideIdentifier | FormStateMethodActive | {
|
|
551
585
|
current: "success_screen";
|
|
552
586
|
} | {
|
|
553
587
|
current: "settings";
|
|
@@ -558,6 +592,8 @@ type FormStateAction = {
|
|
|
558
592
|
} | {
|
|
559
593
|
type: "action_select_method";
|
|
560
594
|
method: UiNodeGroupEnum;
|
|
595
|
+
} | {
|
|
596
|
+
type: "action_clear_active_method";
|
|
561
597
|
};
|
|
562
598
|
|
|
563
599
|
/**
|
|
@@ -591,7 +627,33 @@ type FlowContextValue = OryFlowContainer & {
|
|
|
591
627
|
|
|
592
628
|
type OryProviderProps = {
|
|
593
629
|
components: OryFlowComponents;
|
|
630
|
+
config: OryClientConfiguration;
|
|
594
631
|
} & OryFlowContainer & PropsWithChildren;
|
|
595
|
-
declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
632
|
+
declare function OryProvider({ children, components: Components, config, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
633
|
+
|
|
634
|
+
type OryElementsConfiguration = {
|
|
635
|
+
sdk: OrySDK;
|
|
636
|
+
project: AccountExperienceConfiguration;
|
|
637
|
+
};
|
|
638
|
+
declare function useOryConfiguration(): OryElementsConfiguration;
|
|
639
|
+
type OrySDK = SDKConfig & {
|
|
640
|
+
/**
|
|
641
|
+
* The frontend client for the Ory SDK.
|
|
642
|
+
* This client is used to interact with the Ory SDK and should be used to make API calls.
|
|
643
|
+
*/
|
|
644
|
+
frontend: FrontendApi;
|
|
645
|
+
};
|
|
646
|
+
type SDKConfig = {
|
|
647
|
+
/**
|
|
648
|
+
* The URL of the Ory SDK.
|
|
649
|
+
* This URL is used to connect to the Ory SDK and should be set to the base URL of your Ory instance.
|
|
650
|
+
*/
|
|
651
|
+
url: string;
|
|
652
|
+
options?: Partial<ConfigurationParameters>;
|
|
653
|
+
};
|
|
654
|
+
declare function OryConfigurationProvider({ children, sdk: initialConfig, project, }: PropsWithChildren<{
|
|
655
|
+
sdk?: Partial<OryClientConfiguration["sdk"]>;
|
|
656
|
+
project?: Partial<AccountExperienceConfiguration>;
|
|
657
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
596
658
|
|
|
597
|
-
export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
|
|
659
|
+
export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryElementsConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow };
|