@ory/elements-react 1.0.0-next.1 → 1.0.0-next.11

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.
@@ -1,110 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import React__default, { PropsWithChildren, ComponentType, ComponentPropsWithoutRef, FormEventHandler, Dispatch, MouseEventHandler, DetailedHTMLProps, HTMLAttributes } from 'react';
4
- import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiText, ConfigurationParameters, FlowError, LoginFlow, RecoveryFlow, RegistrationFlow, SettingsFlow, VerificationFlow } from '@ory/client-fetch';
2
+ import { OryCardContentProps, OryCardProps, OryFormRootProps, OryMessageContentProps, OryFlowComponents, OryFlowComponentOverrides, OryClientConfiguration } from '@ory/elements-react';
3
+ import * as react from 'react';
4
+ import { PropsWithChildren } from 'react';
5
+ import { FlowError, LoginFlow, RecoveryFlow, RegistrationFlow, SettingsFlow, VerificationFlow } from '@ory/client-fetch';
5
6
 
6
- type OryCardContentProps = PropsWithChildren;
7
- type OryCardFooterProps = Record<string, never>;
8
- type OryCardProps = PropsWithChildren;
9
- /**
10
- * Card components are used to show login, registration, recovery, and verification flows.
11
- */
12
- type OryCardComponents = {
13
- /**
14
- * The card container is the main container of the card.
15
- */
16
- Card: ComponentType<OryCardProps>;
17
- /**
18
- * The card footer is the footer of the card container.
19
- */
20
- CardFooter: ComponentType<OryCardFooterProps>;
21
- /**
22
- * The card header is the header of the card container.
23
- */
24
- CardHeader: ComponentType<OryCardProps>;
25
- /**
26
- * The card content is the main content of the card container.
27
- */
28
- CardContent: ComponentType<OryCardContentProps>;
29
- /**
30
- * The card logo is the logo of the card container.
31
- */
32
- CardLogo: ComponentType;
33
- };
34
-
35
- type HeadlessButtonProps = {
36
- attributes: UiNodeInputAttributes;
37
- node: UiNode;
38
- } & Omit<ComponentPropsWithoutRef<"button">, "children">;
39
- type HeadlessLinkButtonProps = {
40
- attributes: UiNodeAnchorAttributes;
41
- node: UiNode;
42
- } & Omit<ComponentPropsWithoutRef<"a">, "children">;
43
- type HeadlessLabelProps = {
44
- attributes: UiNodeInputAttributes;
45
- node: UiNode;
46
- } & ComponentPropsWithoutRef<"label">;
47
- type HeadlessTextProps = {
48
- attributes: UiNodeTextAttributes;
49
- node: UiNode;
50
- };
51
- type HeadlessAuthMethodListItemProps = {
52
- setGroups: Dispatch<React__default.SetStateAction<string[]>>;
53
- setStep: Dispatch<React__default.SetStateAction<number>>;
54
- group: string;
55
- };
56
- type HeadlessImageProps = {
57
- attributes: UiNodeImageAttributes;
58
- node: UiNode;
59
- };
60
- type HeadlessFormProps = ComponentPropsWithoutRef<"form"> & {
61
- onSubmit: FormEventHandler<HTMLFormElement>;
62
- };
63
- type HeadlessInputProps = {
64
- attributes: UiNodeInputAttributes;
65
- node: UiNode;
66
- onClick: MouseEventHandler;
67
- };
68
- type OryFlowComponents = OryFormComponents & OryCardComponents;
69
-
70
- type HorizontalDividerProps = Record<string, never>;
71
-
72
- type HeadlessGroupContainerProps = PropsWithChildren;
73
-
74
- type HeadlessMessagesProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
75
- type HeadlessMessageProps = {
76
- message: UiText;
77
- };
78
-
79
- type HeadlessSocialButtonContainerProps = PropsWithChildren<{
80
- nodes: UiNode[];
81
- }>;
82
- type HeadlessSocialButtonProps = PropsWithChildren<{
83
- node: UiNode;
84
- attributes: UiNodeInputAttributes;
85
- }>;
86
-
87
- type OryFormComponents = {
88
- Button: ComponentType<HeadlessButtonProps>;
89
- LinkButton: ComponentType<HeadlessLinkButtonProps>;
90
- Input: ComponentType<HeadlessInputProps>;
91
- PinCodeInput: ComponentType<HeadlessInputProps>;
92
- Image: ComponentType<HeadlessImageProps>;
93
- Label: ComponentType<HeadlessLabelProps>;
94
- Checkbox: ComponentType<HeadlessInputProps>;
95
- Text: ComponentType<HeadlessTextProps>;
96
- FormContainer: ComponentType<HeadlessFormProps>;
97
- SocialButton: ComponentType<HeadlessSocialButtonProps>;
98
- SocialButtonContainer: ComponentType<HeadlessSocialButtonContainerProps>;
99
- AuthMethodListItem: ComponentType<HeadlessAuthMethodListItemProps>;
100
- HorizontalDivider: ComponentType<HorizontalDividerProps>;
101
- FormGroup: ComponentType<HeadlessGroupContainerProps>;
102
- MessageContainer: ComponentType<HeadlessMessagesProps>;
103
- Message: ComponentType<HeadlessMessageProps>;
104
- CurrentIdentifierButton: ComponentType<HeadlessButtonProps>;
105
- };
106
-
107
- declare function DefaultCardContent({ children }: OryCardContentProps): React.ReactNode;
7
+ declare function DefaultCardContent({ children }: OryCardContentProps): react.ReactNode;
108
8
 
109
9
  declare function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null;
110
10
 
@@ -114,76 +14,50 @@ declare function DefaultCardLogo(): react_jsx_runtime.JSX.Element;
114
14
 
115
15
  declare function DefaultCard({ children }: OryCardProps): react_jsx_runtime.JSX.Element;
116
16
 
117
- declare function DefaultFormContainer({ children, onSubmit, action, method, }: PropsWithChildren<HeadlessFormProps>): react_jsx_runtime.JSX.Element;
17
+ declare function DefaultFormContainer({ children, onSubmit, action, method, }: PropsWithChildren<OryFormRootProps>): react_jsx_runtime.JSX.Element;
118
18
  declare function DefaultMessageContainer({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element | null;
119
- declare function DefaultMessage({ message }: HeadlessMessageProps): react_jsx_runtime.JSX.Element;
19
+ declare function DefaultMessage({ message }: OryMessageContentProps): react_jsx_runtime.JSX.Element;
120
20
 
121
21
  declare const OryDefaultComponents: OryFlowComponents;
122
22
 
123
- type OryClientConfiguration = {
124
- /**
125
- * The name of the application the user is logging in to.
126
- */
127
- name: string;
128
- /**
129
- * An optional logo URL to display in the UI instead of the name.
130
- */
131
- logoUrl?: string;
132
- stylesheet?: string;
133
- favicon?: string;
134
- sdk: {
135
- url: string;
136
- options?: Partial<ConfigurationParameters>;
137
- };
138
- project: {
139
- registration_enabled: boolean;
140
- verification_enabled: boolean;
141
- recovery_enabled: boolean;
142
- recovery_ui_url: string;
143
- registration_ui_url: string;
144
- verification_ui_url: string;
145
- login_ui_url: string;
146
- };
147
- };
148
-
149
23
  type ErrorFlowContextProps = {
150
24
  error: FlowError;
151
- components?: Partial<OryFlowComponents>;
25
+ components?: OryFlowComponentOverrides;
152
26
  config: OryClientConfiguration;
153
27
  };
154
28
  declare function Error({ error, children, }: PropsWithChildren<ErrorFlowContextProps>): react_jsx_runtime.JSX.Element;
155
29
 
156
30
  type LoginFlowContextProps = {
157
31
  flow: LoginFlow;
158
- components?: Partial<OryFlowComponents>;
32
+ components?: OryFlowComponentOverrides;
159
33
  config: OryClientConfiguration;
160
34
  };
161
35
  declare function Login({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<LoginFlowContextProps>): react_jsx_runtime.JSX.Element;
162
36
 
163
37
  type RecoveryFlowContextProps = {
164
38
  flow: RecoveryFlow;
165
- components?: Partial<OryFlowComponents>;
39
+ components?: OryFlowComponentOverrides;
166
40
  config: OryClientConfiguration;
167
41
  };
168
42
  declare function Recovery({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<RecoveryFlowContextProps>): react_jsx_runtime.JSX.Element;
169
43
 
170
44
  type RegistrationFlowContextProps = {
171
45
  flow: RegistrationFlow;
172
- components?: Partial<OryFlowComponents>;
46
+ components?: OryFlowComponentOverrides;
173
47
  config: OryClientConfiguration;
174
48
  };
175
49
  declare function Registration({ flow, children, components: flowOverrideComponents, config, }: PropsWithChildren<RegistrationFlowContextProps>): react_jsx_runtime.JSX.Element;
176
50
 
177
51
  type SettingsFlowContextProps = {
178
52
  flow: SettingsFlow;
179
- components?: Partial<OryFlowComponents>;
53
+ components?: OryFlowComponentOverrides;
180
54
  config: OryClientConfiguration;
181
55
  };
182
56
  declare function Settings({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<SettingsFlowContextProps>): react_jsx_runtime.JSX.Element;
183
57
 
184
58
  type VerificationFlowContextProps = {
185
59
  flow: VerificationFlow;
186
- components?: Partial<OryFlowComponents>;
60
+ components?: OryFlowComponentOverrides;
187
61
  config: OryClientConfiguration;
188
62
  };
189
63
  declare function Verification({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren<VerificationFlowContextProps>): react_jsx_runtime.JSX.Element;