@ory/elements-react 1.0.0-rc.0 → 1.0.0-rc.2

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 CHANGED
@@ -1,3 +1,49 @@
1
+ ## 1.0.0-rc.2 (2025-04-30)
2
+
3
+ ### 🚀 Features
4
+
5
+ - method translation for totp, code, webauthn ([#500](https://github.com/ory/elements/pull/500))
6
+ - add all missing stories ([#480](https://github.com/ory/elements/pull/480))
7
+ - preview deployments for example apps ([#488](https://github.com/ory/elements/pull/488))
8
+ - add back button to settings page ([#464](https://github.com/ory/elements/pull/464))
9
+
10
+ ### 🩹 Fixes
11
+
12
+ - ⚠️ align configuration types to Ory Network APIs ([#423](https://github.com/ory/elements/pull/423))
13
+ - sort captcha before submit button ([#507](https://github.com/ory/elements/pull/507))
14
+ - cors credentials in default client ([#508](https://github.com/ory/elements/pull/508))
15
+ - back button should return to application ([#465](https://github.com/ory/elements/pull/465))
16
+ - adjust design of generic OIDC provider ([#492](https://github.com/ory/elements/pull/492))
17
+ - use proper id for react element arrays ([#495](https://github.com/ory/elements/pull/495))
18
+ - add test id to header messages ([#489](https://github.com/ory/elements/pull/489))
19
+ - re-add missing error message when no methods provided ([#460](https://github.com/ory/elements/pull/460))
20
+ - resend not working for registration ([#468](https://github.com/ory/elements/pull/468))
21
+ - add missing color class to registration footer ([#473](https://github.com/ory/elements/pull/473))
22
+ - resend not working for registration ([#467](https://github.com/ory/elements/pull/467))
23
+
24
+ ### ⚠️ Breaking Changes
25
+
26
+ - ⚠️ align configuration types to Ory Network APIs ([#423](https://github.com/ory/elements/pull/423))
27
+
28
+ ### ❤️ Thank You
29
+
30
+ - hackerman @aeneasr
31
+ - Jonas Hungershausen
32
+
33
+ ## 1.0.0-rc.1 (2025-04-21)
34
+
35
+ ### 🩹 Fixes
36
+
37
+ - re-add missing error message when no methods provided ([#460](https://github.com/ory/elements/pull/460))
38
+ - resend not working for registration ([#468](https://github.com/ory/elements/pull/468))
39
+ - add missing color class to registration footer ([#473](https://github.com/ory/elements/pull/473))
40
+ - resend not working for registration ([#467](https://github.com/ory/elements/pull/467))
41
+
42
+ ### ❤️ Thank You
43
+
44
+ - hackerman @aeneasr
45
+ - Jonas Hungershausen
46
+
1
47
  ## 1.0.0-rc.0 (2025-04-17)
2
48
 
3
49
  ### 🚀 Features
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
1
+ import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, AccountExperienceConfiguration, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } 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';
@@ -394,33 +394,60 @@ type IntlContextProps = {
394
394
  };
395
395
 
396
396
  type IntlConfig = IntlContextProps;
397
+ /**
398
+ * The configuration for Ory Elements.
399
+ *
400
+ * This configuration is used to customize the behavior and appearance of Ory Elements.
401
+ *
402
+ * By setting UI urls, you can override the default URLs for the login, registration, recovery, and verification flows.
403
+ *
404
+ * You can also set the name of the application, the logo URL, and the SDK configuration.
405
+ * By default, the name and logo are displayed in the card's header.
406
+ */
397
407
  type OryClientConfiguration = {
398
- /**
399
- * The name of the application the user is logging in to.
400
- */
401
- name: string;
402
408
  /**
403
409
  * An optional logo URL to display in the UI instead of the name.
410
+ * @deprecated Use `project.logo_light_url` instead.
404
411
  */
405
412
  logoUrl?: string;
406
- stylesheet?: string;
407
- favicon?: string;
413
+ /**
414
+ * The SDK configuration.
415
+ * This configuration is used to set the URL of the Ory SDK and any additional options used for the SDK client.
416
+ */
408
417
  sdk: {
409
418
  url: string;
410
419
  options?: Partial<ConfigurationParameters>;
411
420
  };
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
- };
421
+ /**
422
+ * The internationalization configuration.
423
+ * This configuration is used to set the locale and any additional options used for the i18n library.
424
+ * The locale is used to determine the language of the UI.
425
+ * The default locale is "en".
426
+ */
422
427
  intl?: IntlConfig;
423
- };
428
+ } & ({
429
+ /**
430
+ * The name of the application the user is logging in to.
431
+ * @deprecated Use `project.name` instead.
432
+ */
433
+ name: string;
434
+ /**
435
+ * The configuration for the project.
436
+ */
437
+ project: Omit<AccountExperienceConfiguration, "name"> & {
438
+ name?: string;
439
+ };
440
+ } | {
441
+ /**
442
+ * The name of the application the user is logging in to.
443
+ * @deprecated Use `project.name` instead.
444
+ */
445
+ name?: string;
446
+ /**
447
+ * The configuration for the project.
448
+ */
449
+ project: AccountExperienceConfiguration;
450
+ });
424
451
 
425
452
  /**
426
453
  * A generic flow container, containing a flowType, the flow itself and the config object
@@ -486,6 +513,7 @@ type ConsentFlow = {
486
513
  ui: UiContainer;
487
514
  consent_request: OAuth2ConsentRequest;
488
515
  session: Session;
516
+ return_to?: string;
489
517
  };
490
518
  type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
491
519
  /**
@@ -561,18 +589,23 @@ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlow
561
589
  * @param message - the UiText message to generate a test id for
562
590
  * @returns a unique, stable test id for the message
563
591
  */
564
- declare function messageTestId(message: UiText): {
592
+ declare function messageTestId(message: {
593
+ id: number | string;
594
+ }): {
565
595
  "data-testid": string;
566
596
  };
567
597
 
568
- type FormState = {
569
- current: "provide_identifier";
570
- } | {
598
+ type FormStateSelectMethod = {
571
599
  current: "select_method";
572
- } | {
600
+ };
601
+ type FormStateProvideIdentifier = {
602
+ current: "provide_identifier";
603
+ };
604
+ type FormStateMethodActive = {
573
605
  current: "method_active";
574
606
  method: UiNodeGroupEnum;
575
- } | {
607
+ };
608
+ type FormState = FormStateSelectMethod | FormStateProvideIdentifier | FormStateMethodActive | {
576
609
  current: "success_screen";
577
610
  } | {
578
611
  current: "settings";
@@ -619,4 +652,4 @@ type OryProviderProps = {
619
652
  } & OryFlowContainer & PropsWithChildren;
620
653
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
621
654
 
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 };
655
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
1
+ import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, AccountExperienceConfiguration, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } 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';
@@ -394,33 +394,60 @@ type IntlContextProps = {
394
394
  };
395
395
 
396
396
  type IntlConfig = IntlContextProps;
397
+ /**
398
+ * The configuration for Ory Elements.
399
+ *
400
+ * This configuration is used to customize the behavior and appearance of Ory Elements.
401
+ *
402
+ * By setting UI urls, you can override the default URLs for the login, registration, recovery, and verification flows.
403
+ *
404
+ * You can also set the name of the application, the logo URL, and the SDK configuration.
405
+ * By default, the name and logo are displayed in the card's header.
406
+ */
397
407
  type OryClientConfiguration = {
398
- /**
399
- * The name of the application the user is logging in to.
400
- */
401
- name: string;
402
408
  /**
403
409
  * An optional logo URL to display in the UI instead of the name.
410
+ * @deprecated Use `project.logo_light_url` instead.
404
411
  */
405
412
  logoUrl?: string;
406
- stylesheet?: string;
407
- favicon?: string;
413
+ /**
414
+ * The SDK configuration.
415
+ * This configuration is used to set the URL of the Ory SDK and any additional options used for the SDK client.
416
+ */
408
417
  sdk: {
409
418
  url: string;
410
419
  options?: Partial<ConfigurationParameters>;
411
420
  };
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
- };
421
+ /**
422
+ * The internationalization configuration.
423
+ * This configuration is used to set the locale and any additional options used for the i18n library.
424
+ * The locale is used to determine the language of the UI.
425
+ * The default locale is "en".
426
+ */
422
427
  intl?: IntlConfig;
423
- };
428
+ } & ({
429
+ /**
430
+ * The name of the application the user is logging in to.
431
+ * @deprecated Use `project.name` instead.
432
+ */
433
+ name: string;
434
+ /**
435
+ * The configuration for the project.
436
+ */
437
+ project: Omit<AccountExperienceConfiguration, "name"> & {
438
+ name?: string;
439
+ };
440
+ } | {
441
+ /**
442
+ * The name of the application the user is logging in to.
443
+ * @deprecated Use `project.name` instead.
444
+ */
445
+ name?: string;
446
+ /**
447
+ * The configuration for the project.
448
+ */
449
+ project: AccountExperienceConfiguration;
450
+ });
424
451
 
425
452
  /**
426
453
  * A generic flow container, containing a flowType, the flow itself and the config object
@@ -486,6 +513,7 @@ type ConsentFlow = {
486
513
  ui: UiContainer;
487
514
  consent_request: OAuth2ConsentRequest;
488
515
  session: Session;
516
+ return_to?: string;
489
517
  };
490
518
  type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
491
519
  /**
@@ -561,18 +589,23 @@ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlow
561
589
  * @param message - the UiText message to generate a test id for
562
590
  * @returns a unique, stable test id for the message
563
591
  */
564
- declare function messageTestId(message: UiText): {
592
+ declare function messageTestId(message: {
593
+ id: number | string;
594
+ }): {
565
595
  "data-testid": string;
566
596
  };
567
597
 
568
- type FormState = {
569
- current: "provide_identifier";
570
- } | {
598
+ type FormStateSelectMethod = {
571
599
  current: "select_method";
572
- } | {
600
+ };
601
+ type FormStateProvideIdentifier = {
602
+ current: "provide_identifier";
603
+ };
604
+ type FormStateMethodActive = {
573
605
  current: "method_active";
574
606
  method: UiNodeGroupEnum;
575
- } | {
607
+ };
608
+ type FormState = FormStateSelectMethod | FormStateProvideIdentifier | FormStateMethodActive | {
576
609
  current: "success_screen";
577
610
  } | {
578
611
  current: "settings";
@@ -619,4 +652,4 @@ type OryProviderProps = {
619
652
  } & OryFlowContainer & PropsWithChildren;
620
653
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
621
654
 
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 };
655
+ 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, 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 };