@ory/elements-react 0.0.0-pr.6b3fe62 → 0.0.0-pr.75b46aac
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 +113 -0
- package/README.md +253 -4
- package/dist/index.d.mts +85 -48
- package/dist/index.d.ts +85 -48
- package/dist/index.js +594 -395
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +595 -398
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +12 -6
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.js +3532 -3277
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +3576 -3309
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +7 -6
- package/tsconfig.json +2 -1
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';
|
|
@@ -384,44 +384,6 @@ declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
|
|
|
384
384
|
flowType: string;
|
|
385
385
|
}) => number;
|
|
386
386
|
|
|
387
|
-
type LocaleMap = Record<string, Record<string, string>>;
|
|
388
|
-
declare const OryLocales: LocaleMap;
|
|
389
|
-
|
|
390
|
-
type Locale = keyof typeof OryLocales;
|
|
391
|
-
type IntlContextProps = {
|
|
392
|
-
locale: Locale;
|
|
393
|
-
customTranslations?: Partial<LocaleMap>;
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
type IntlConfig = IntlContextProps;
|
|
397
|
-
type OryClientConfiguration = {
|
|
398
|
-
/**
|
|
399
|
-
* The name of the application the user is logging in to.
|
|
400
|
-
*/
|
|
401
|
-
name: string;
|
|
402
|
-
/**
|
|
403
|
-
* An optional logo URL to display in the UI instead of the name.
|
|
404
|
-
*/
|
|
405
|
-
logoUrl?: string;
|
|
406
|
-
stylesheet?: string;
|
|
407
|
-
favicon?: string;
|
|
408
|
-
sdk: {
|
|
409
|
-
url: string;
|
|
410
|
-
options?: Partial<ConfigurationParameters>;
|
|
411
|
-
};
|
|
412
|
-
project: {
|
|
413
|
-
registration_enabled: boolean;
|
|
414
|
-
verification_enabled: boolean;
|
|
415
|
-
recovery_enabled: boolean;
|
|
416
|
-
recovery_ui_url: string;
|
|
417
|
-
registration_ui_url: string;
|
|
418
|
-
verification_ui_url: string;
|
|
419
|
-
login_ui_url: string;
|
|
420
|
-
default_redirect_url?: string;
|
|
421
|
-
};
|
|
422
|
-
intl?: IntlConfig;
|
|
423
|
-
};
|
|
424
|
-
|
|
425
387
|
/**
|
|
426
388
|
* A generic flow container, containing a flowType, the flow itself and the config object
|
|
427
389
|
*
|
|
@@ -430,7 +392,6 @@ type OryClientConfiguration = {
|
|
|
430
392
|
type OryFlow<TFlowType extends FlowType, TFlow> = {
|
|
431
393
|
flowType: TFlowType;
|
|
432
394
|
flow: TFlow;
|
|
433
|
-
config: OryClientConfiguration;
|
|
434
395
|
};
|
|
435
396
|
/**
|
|
436
397
|
* A flow container for the login flow
|
|
@@ -486,6 +447,7 @@ type ConsentFlow = {
|
|
|
486
447
|
ui: UiContainer;
|
|
487
448
|
consent_request: OAuth2ConsentRequest;
|
|
488
449
|
session: Session;
|
|
450
|
+
return_to?: string;
|
|
489
451
|
};
|
|
490
452
|
type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
491
453
|
/**
|
|
@@ -493,6 +455,48 @@ type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
|
493
455
|
*/
|
|
494
456
|
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
|
|
495
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
|
+
};
|
|
499
|
+
|
|
496
500
|
/**
|
|
497
501
|
* Converts a UiText to a FormattedMessage.
|
|
498
502
|
* The UiText contains the id of the message and the context.
|
|
@@ -561,18 +565,23 @@ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlow
|
|
|
561
565
|
* @param message - the UiText message to generate a test id for
|
|
562
566
|
* @returns a unique, stable test id for the message
|
|
563
567
|
*/
|
|
564
|
-
declare function messageTestId(message:
|
|
568
|
+
declare function messageTestId(message: {
|
|
569
|
+
id: number | string;
|
|
570
|
+
}): {
|
|
565
571
|
"data-testid": string;
|
|
566
572
|
};
|
|
567
573
|
|
|
568
|
-
type
|
|
569
|
-
current: "provide_identifier";
|
|
570
|
-
} | {
|
|
574
|
+
type FormStateSelectMethod = {
|
|
571
575
|
current: "select_method";
|
|
572
|
-
}
|
|
576
|
+
};
|
|
577
|
+
type FormStateProvideIdentifier = {
|
|
578
|
+
current: "provide_identifier";
|
|
579
|
+
};
|
|
580
|
+
type FormStateMethodActive = {
|
|
573
581
|
current: "method_active";
|
|
574
582
|
method: UiNodeGroupEnum;
|
|
575
|
-
}
|
|
583
|
+
};
|
|
584
|
+
type FormState = FormStateSelectMethod | FormStateProvideIdentifier | FormStateMethodActive | {
|
|
576
585
|
current: "success_screen";
|
|
577
586
|
} | {
|
|
578
587
|
current: "settings";
|
|
@@ -583,6 +592,8 @@ type FormStateAction = {
|
|
|
583
592
|
} | {
|
|
584
593
|
type: "action_select_method";
|
|
585
594
|
method: UiNodeGroupEnum;
|
|
595
|
+
} | {
|
|
596
|
+
type: "action_method_selector";
|
|
586
597
|
};
|
|
587
598
|
|
|
588
599
|
/**
|
|
@@ -616,7 +627,33 @@ type FlowContextValue = OryFlowContainer & {
|
|
|
616
627
|
|
|
617
628
|
type OryProviderProps = {
|
|
618
629
|
components: OryFlowComponents;
|
|
630
|
+
config: OryClientConfiguration;
|
|
619
631
|
} & OryFlowContainer & PropsWithChildren;
|
|
620
|
-
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;
|
|
621
658
|
|
|
622
|
-
export { type ConsentFlow, type ConsentFlowContainer, 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, OryConsentCard, 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, 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 };
|