@ory/elements-react 1.2.0-rc.2 → 1.3.0-rc.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/dist/index.d.mts CHANGED
@@ -3,9 +3,26 @@ import { ComponentPropsWithoutRef, MouseEventHandler, PropsWithChildren, FormEve
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { useIntl, IntlShape } from 'react-intl';
5
5
 
6
+ /**
7
+ * A single selectable value for an input node backed by a JSON schema `enum`.
8
+ *
9
+ * TODO: remove this type widening once `@ory/client-fetch` publishes a release
10
+ * that ships `options` on `UiNodeInputAttributes`.
11
+ */
12
+ type UiNodeInputAttributesOption = {
13
+ value: unknown;
14
+ };
15
+ /**
16
+ * Same as `UiNodeInputAttributes`, but additionally carries the optional
17
+ * `options` field used to render enum traits as a dropdown. The Kratos server
18
+ * populates this field whenever a JSON schema property declares an `enum`.
19
+ */
20
+ type UiNodeInputAttributesWithOptions = UiNodeInputAttributes & {
21
+ options?: UiNodeInputAttributesOption[];
22
+ };
6
23
  type UiNodeInput = UiNode & {
7
24
  type: "input";
8
- attributes: UiNodeInputAttributes;
25
+ attributes: UiNodeInputAttributesWithOptions;
9
26
  };
10
27
  declare function isUiNodeInput(node: UiNode): node is UiNodeInput;
11
28
  type UiNodeImage = UiNode & {
@@ -151,6 +168,14 @@ type OryNodeInputProps = {
151
168
  onClick?: MouseEventHandler;
152
169
  inputProps: OryNodeInputInputProps;
153
170
  };
171
+ type OryNodeSelectInputProps = Omit<OryNodeInputInputProps, "onClick" | "maxLength" | "autoComplete" | "type">;
172
+ type OryNodeSelectProps = {
173
+ /** @deprecated - use node.attributes */
174
+ attributes: UiNodeInputAttributesWithOptions;
175
+ node: UiNodeInput;
176
+ inputProps: OryNodeSelectInputProps;
177
+ options: UiNodeInputAttributesOption[];
178
+ };
154
179
  type OryNodeConsentScopeCheckboxProps = {
155
180
  attributes: UiNodeInputAttributes;
156
181
  node: UiNode;
@@ -452,6 +477,15 @@ type OryFlowComponents = {
452
477
  * The Input component is rendered whenever a "input" node is encountered.
453
478
  */
454
479
  Input: ComponentType<OryNodeInputProps>;
480
+ /**
481
+ * The Select component is rendered whenever an "input" node declares a
482
+ * non-empty `options` list, typically the result of an `enum` constraint
483
+ * in the identity schema. Optional for backward compatibility: when not
484
+ * provided, the dispatch falls back to the regular `Input` renderer so
485
+ * older consumers that constructed `OryFlowComponents` by hand keep
486
+ * compiling and rendering.
487
+ */
488
+ Select?: ComponentType<OryNodeSelectProps>;
455
489
  /**
456
490
  * Special version of the Input component for OTP codes.
457
491
  */
@@ -634,6 +668,11 @@ interface OryFormProps extends PropsWithChildren {
634
668
  */
635
669
  declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
636
670
 
671
+ type SelectRendererProps = {
672
+ node: UiNodeInput;
673
+ };
674
+ declare function SelectRenderer({ node }: SelectRendererProps): react_jsx_runtime.JSX.Element;
675
+
637
676
  type TextRendererProps = {
638
677
  node: UiNodeText;
639
678
  };
@@ -695,6 +734,7 @@ declare const Node: (({ node }: NodeProps) => ReactNode) & {
695
734
  Checkbox: typeof CheckboxRenderer;
696
735
  Image: typeof ImageRenderer;
697
736
  Text: typeof TextRenderer;
737
+ Select: typeof SelectRenderer;
698
738
  };
699
739
 
700
740
  /**
@@ -1121,12 +1161,24 @@ interface ProjectConfiguration {
1121
1161
  * The URL for the recovery UI.
1122
1162
  */
1123
1163
  recovery_ui_url: string;
1164
+ /**
1165
+ * Whether to hide the Ory branding badge on the account experience card.
1166
+ *
1167
+ * Defaults to `false`. Customers on qualifying plans can opt into hiding it.
1168
+ */
1169
+ hide_ory_branding?: boolean;
1124
1170
  /**
1125
1171
  * Whether registration is enabled.
1126
1172
  *
1127
1173
  * Used to determine if the "Sign Up" link is shown on the login card.
1128
1174
  */
1129
1175
  registration_enabled: boolean;
1176
+ /**
1177
+ * When true, hides the "Sign up" link on the login card footer even
1178
+ * if registration is enabled. Cosmetic only; does not affect the
1179
+ * registration flow itself. Defaults to false.
1180
+ */
1181
+ hide_registration_link?: boolean;
1130
1182
  /**
1131
1183
  * The URL for the registration UI.
1132
1184
  */
@@ -1640,4 +1692,4 @@ interface OryConfigurationProviderProps extends PropsWithChildren {
1640
1692
  */
1641
1693
  declare function OryConfigurationProvider({ children, sdk: initialConfig, project, }: OryConfigurationProviderProps): react_jsx_runtime.JSX.Element;
1642
1694
 
1643
- export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, type IntlConfig, type LoginFlowContainer, Node, type NodeProps, 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 OryCardValidationMessagesProps, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryConsentSuccessEvent, type OryElementsConfiguration, type OryErrorEvent, type OryErrorHandler, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, type OryFormProps, type OryFormRootProps, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSsoButtons, OryFormSsoForm, type OryFormSsoRootProps, OryLocales, type OryLoginSuccessEvent, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonButtonProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeCheckboxInputProps, type OryNodeCheckboxProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputInputProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeSettingsButton, type OryNodeSsoButtonProps, type OryNodeTextProps, OryPageHeader, type OryPageHeaderProps, OryProvider, type OryProviderProps, type OryRecoverySuccessEvent, type OryRegistrationSuccessEvent, OrySelfServiceFlowCard, OrySettingsCard, type OrySettingsFormProps, OrySettingsFormSection, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsSsoProps, type OrySettingsSuccessEvent, type OrySettingsTotpProps, type OrySettingsWebauthnProps, type OrySuccessEvent, type OrySuccessHandler, type OryToastProps, type OryTransientPayload, type OryValidationErrorEvent, type OryValidationErrorHandler, type OryVerificationSuccessEvent, type ProjectConfiguration, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type UiNodeAnchor, type UiNodeDiv, type UiNodeFixed, type UiNodeImage, type UiNodeInput, type UiNodeScript, type UiNodeText, type VerificationFlowContainer, isUiNodeAnchor, isUiNodeDiv, isUiNodeImage, isUiNodeInput, isUiNodeScript, isUiNodeText, messageTestId, resolvePlaceholder, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow, useResendCode };
1695
+ export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, type IntlConfig, type LoginFlowContainer, Node, type NodeProps, 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 OryCardValidationMessagesProps, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryConsentSuccessEvent, type OryElementsConfiguration, type OryErrorEvent, type OryErrorHandler, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, type OryFormProps, type OryFormRootProps, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSsoButtons, OryFormSsoForm, type OryFormSsoRootProps, OryLocales, type OryLoginSuccessEvent, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonButtonProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeCheckboxInputProps, type OryNodeCheckboxProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputInputProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeSelectInputProps, type OryNodeSelectProps, type OryNodeSettingsButton, type OryNodeSsoButtonProps, type OryNodeTextProps, OryPageHeader, type OryPageHeaderProps, OryProvider, type OryProviderProps, type OryRecoverySuccessEvent, type OryRegistrationSuccessEvent, OrySelfServiceFlowCard, OrySettingsCard, type OrySettingsFormProps, OrySettingsFormSection, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsSsoProps, type OrySettingsSuccessEvent, type OrySettingsTotpProps, type OrySettingsWebauthnProps, type OrySuccessEvent, type OrySuccessHandler, type OryToastProps, type OryTransientPayload, type OryValidationErrorEvent, type OryValidationErrorHandler, type OryVerificationSuccessEvent, type ProjectConfiguration, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type UiNodeAnchor, type UiNodeDiv, type UiNodeFixed, type UiNodeImage, type UiNodeInput, type UiNodeInputAttributesOption, type UiNodeInputAttributesWithOptions, type UiNodeScript, type UiNodeText, type VerificationFlowContainer, isUiNodeAnchor, isUiNodeDiv, isUiNodeImage, isUiNodeInput, isUiNodeScript, isUiNodeText, messageTestId, resolvePlaceholder, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow, useResendCode };
package/dist/index.d.ts CHANGED
@@ -3,9 +3,26 @@ import { ComponentPropsWithoutRef, MouseEventHandler, PropsWithChildren, FormEve
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { useIntl, IntlShape } from 'react-intl';
5
5
 
6
+ /**
7
+ * A single selectable value for an input node backed by a JSON schema `enum`.
8
+ *
9
+ * TODO: remove this type widening once `@ory/client-fetch` publishes a release
10
+ * that ships `options` on `UiNodeInputAttributes`.
11
+ */
12
+ type UiNodeInputAttributesOption = {
13
+ value: unknown;
14
+ };
15
+ /**
16
+ * Same as `UiNodeInputAttributes`, but additionally carries the optional
17
+ * `options` field used to render enum traits as a dropdown. The Kratos server
18
+ * populates this field whenever a JSON schema property declares an `enum`.
19
+ */
20
+ type UiNodeInputAttributesWithOptions = UiNodeInputAttributes & {
21
+ options?: UiNodeInputAttributesOption[];
22
+ };
6
23
  type UiNodeInput = UiNode & {
7
24
  type: "input";
8
- attributes: UiNodeInputAttributes;
25
+ attributes: UiNodeInputAttributesWithOptions;
9
26
  };
10
27
  declare function isUiNodeInput(node: UiNode): node is UiNodeInput;
11
28
  type UiNodeImage = UiNode & {
@@ -151,6 +168,14 @@ type OryNodeInputProps = {
151
168
  onClick?: MouseEventHandler;
152
169
  inputProps: OryNodeInputInputProps;
153
170
  };
171
+ type OryNodeSelectInputProps = Omit<OryNodeInputInputProps, "onClick" | "maxLength" | "autoComplete" | "type">;
172
+ type OryNodeSelectProps = {
173
+ /** @deprecated - use node.attributes */
174
+ attributes: UiNodeInputAttributesWithOptions;
175
+ node: UiNodeInput;
176
+ inputProps: OryNodeSelectInputProps;
177
+ options: UiNodeInputAttributesOption[];
178
+ };
154
179
  type OryNodeConsentScopeCheckboxProps = {
155
180
  attributes: UiNodeInputAttributes;
156
181
  node: UiNode;
@@ -452,6 +477,15 @@ type OryFlowComponents = {
452
477
  * The Input component is rendered whenever a "input" node is encountered.
453
478
  */
454
479
  Input: ComponentType<OryNodeInputProps>;
480
+ /**
481
+ * The Select component is rendered whenever an "input" node declares a
482
+ * non-empty `options` list, typically the result of an `enum` constraint
483
+ * in the identity schema. Optional for backward compatibility: when not
484
+ * provided, the dispatch falls back to the regular `Input` renderer so
485
+ * older consumers that constructed `OryFlowComponents` by hand keep
486
+ * compiling and rendering.
487
+ */
488
+ Select?: ComponentType<OryNodeSelectProps>;
455
489
  /**
456
490
  * Special version of the Input component for OTP codes.
457
491
  */
@@ -634,6 +668,11 @@ interface OryFormProps extends PropsWithChildren {
634
668
  */
635
669
  declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
636
670
 
671
+ type SelectRendererProps = {
672
+ node: UiNodeInput;
673
+ };
674
+ declare function SelectRenderer({ node }: SelectRendererProps): react_jsx_runtime.JSX.Element;
675
+
637
676
  type TextRendererProps = {
638
677
  node: UiNodeText;
639
678
  };
@@ -695,6 +734,7 @@ declare const Node: (({ node }: NodeProps) => ReactNode) & {
695
734
  Checkbox: typeof CheckboxRenderer;
696
735
  Image: typeof ImageRenderer;
697
736
  Text: typeof TextRenderer;
737
+ Select: typeof SelectRenderer;
698
738
  };
699
739
 
700
740
  /**
@@ -1121,12 +1161,24 @@ interface ProjectConfiguration {
1121
1161
  * The URL for the recovery UI.
1122
1162
  */
1123
1163
  recovery_ui_url: string;
1164
+ /**
1165
+ * Whether to hide the Ory branding badge on the account experience card.
1166
+ *
1167
+ * Defaults to `false`. Customers on qualifying plans can opt into hiding it.
1168
+ */
1169
+ hide_ory_branding?: boolean;
1124
1170
  /**
1125
1171
  * Whether registration is enabled.
1126
1172
  *
1127
1173
  * Used to determine if the "Sign Up" link is shown on the login card.
1128
1174
  */
1129
1175
  registration_enabled: boolean;
1176
+ /**
1177
+ * When true, hides the "Sign up" link on the login card footer even
1178
+ * if registration is enabled. Cosmetic only; does not affect the
1179
+ * registration flow itself. Defaults to false.
1180
+ */
1181
+ hide_registration_link?: boolean;
1130
1182
  /**
1131
1183
  * The URL for the registration UI.
1132
1184
  */
@@ -1640,4 +1692,4 @@ interface OryConfigurationProviderProps extends PropsWithChildren {
1640
1692
  */
1641
1693
  declare function OryConfigurationProvider({ children, sdk: initialConfig, project, }: OryConfigurationProviderProps): react_jsx_runtime.JSX.Element;
1642
1694
 
1643
- export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, type IntlConfig, type LoginFlowContainer, Node, type NodeProps, 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 OryCardValidationMessagesProps, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryConsentSuccessEvent, type OryElementsConfiguration, type OryErrorEvent, type OryErrorHandler, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, type OryFormProps, type OryFormRootProps, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSsoButtons, OryFormSsoForm, type OryFormSsoRootProps, OryLocales, type OryLoginSuccessEvent, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonButtonProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeCheckboxInputProps, type OryNodeCheckboxProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputInputProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeSettingsButton, type OryNodeSsoButtonProps, type OryNodeTextProps, OryPageHeader, type OryPageHeaderProps, OryProvider, type OryProviderProps, type OryRecoverySuccessEvent, type OryRegistrationSuccessEvent, OrySelfServiceFlowCard, OrySettingsCard, type OrySettingsFormProps, OrySettingsFormSection, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsSsoProps, type OrySettingsSuccessEvent, type OrySettingsTotpProps, type OrySettingsWebauthnProps, type OrySuccessEvent, type OrySuccessHandler, type OryToastProps, type OryTransientPayload, type OryValidationErrorEvent, type OryValidationErrorHandler, type OryVerificationSuccessEvent, type ProjectConfiguration, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type UiNodeAnchor, type UiNodeDiv, type UiNodeFixed, type UiNodeImage, type UiNodeInput, type UiNodeScript, type UiNodeText, type VerificationFlowContainer, isUiNodeAnchor, isUiNodeDiv, isUiNodeImage, isUiNodeInput, isUiNodeScript, isUiNodeText, messageTestId, resolvePlaceholder, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow, useResendCode };
1695
+ export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormStateMethodActive, type FormStateProvideIdentifier, type FormStateSelectMethod, type FormValues, type IntlConfig, type LoginFlowContainer, Node, type NodeProps, 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 OryCardValidationMessagesProps, type OryClientConfiguration, OryConfigurationProvider, OryConsentCard, type OryConsentSuccessEvent, type OryElementsConfiguration, type OryErrorEvent, type OryErrorHandler, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, type OryFormProps, type OryFormRootProps, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSsoButtons, OryFormSsoForm, type OryFormSsoRootProps, OryLocales, type OryLoginSuccessEvent, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonButtonProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeCheckboxInputProps, type OryNodeCheckboxProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputInputProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeSelectInputProps, type OryNodeSelectProps, type OryNodeSettingsButton, type OryNodeSsoButtonProps, type OryNodeTextProps, OryPageHeader, type OryPageHeaderProps, OryProvider, type OryProviderProps, type OryRecoverySuccessEvent, type OryRegistrationSuccessEvent, OrySelfServiceFlowCard, OrySettingsCard, type OrySettingsFormProps, OrySettingsFormSection, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsSsoProps, type OrySettingsSuccessEvent, type OrySettingsTotpProps, type OrySettingsWebauthnProps, type OrySuccessEvent, type OrySuccessHandler, type OryToastProps, type OryTransientPayload, type OryValidationErrorEvent, type OryValidationErrorHandler, type OryVerificationSuccessEvent, type ProjectConfiguration, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type UiNodeAnchor, type UiNodeDiv, type UiNodeFixed, type UiNodeImage, type UiNodeInput, type UiNodeInputAttributesOption, type UiNodeInputAttributesWithOptions, type UiNodeScript, type UiNodeText, type VerificationFlowContainer, isUiNodeAnchor, isUiNodeDiv, isUiNodeImage, isUiNodeInput, isUiNodeScript, isUiNodeText, messageTestId, resolvePlaceholder, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow, useResendCode };