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

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.
@@ -4,6 +4,7 @@
4
4
 
5
5
  ```ts
6
6
 
7
+ import * as class_variance_authority_types from 'class-variance-authority/types';
7
8
  import { ComponentPropsWithoutRef } from 'react';
8
9
  import { ComponentType } from 'react';
9
10
  import { ConfigurationParameters } from '@ory/client-fetch';
@@ -35,6 +36,7 @@ import { UpdateRecoveryFlowBody } from '@ory/client-fetch';
35
36
  import { UpdateRegistrationFlowBody } from '@ory/client-fetch';
36
37
  import { UpdateSettingsFlowBody } from '@ory/client-fetch';
37
38
  import { UpdateVerificationFlowBody } from '@ory/client-fetch';
39
+ import { VariantProps } from 'class-variance-authority';
38
40
  import { VerificationFlow } from '@ory/client-fetch';
39
41
 
40
42
  // Warning: (ae-forgotten-export) The symbol "OryFlow" needs to be exported by the entry point index.d.ts
@@ -53,6 +55,9 @@ export type FlowContextValue = OryFlowContainer & {
53
55
  // @public
54
56
  export type FormValues = Record<string, string | boolean | number | undefined>;
55
57
 
58
+ // @public (undocumented)
59
+ export const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
60
+
56
61
  // Warning: (ae-forgotten-export) The symbol "IntlContextProps" needs to be exported by the entry point index.d.ts
57
62
  //
58
63
  // @public (undocumented)
@@ -169,23 +174,34 @@ export type OryFlowComponents = {
169
174
  Logo: ComponentType<OryCardLogoProps>;
170
175
  Divider: ComponentType<OryCardDividerProps>;
171
176
  AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
177
+ SettingsSection: ComponentType<OryFormSectionProps>;
178
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
179
+ SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
172
180
  };
173
181
  Form: {
174
182
  Root: ComponentType<OryFormRootProps>;
175
183
  OidcRoot: ComponentType<OryFormOidcRootProps>;
176
184
  Group: ComponentType<OryFormGroupProps>;
185
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
186
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
187
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
188
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
189
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
177
190
  };
178
191
  Message: {
179
192
  Root: ComponentType<OryMessageRootProps>;
180
193
  Content: ComponentType<OryMessageContentProps>;
181
194
  };
195
+ Page: {
196
+ Header: ComponentType<OryPageHeaderProps>;
197
+ };
182
198
  };
183
199
 
184
200
  // @public
185
201
  export type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
186
202
 
187
203
  // @public (undocumented)
188
- export function OryForm({ children }: OryFormProps): string | react_jsx_runtime.JSX.Element;
204
+ export function OryForm({ children, onAfterSubmit, nodes }: OryFormProps): string | react_jsx_runtime.JSX.Element;
189
205
 
190
206
  // @public
191
207
  export function OryFormGroupDivider(): react_jsx_runtime.JSX.Element | null;
@@ -215,13 +231,33 @@ export type OryFormOidcRootProps = PropsWithChildren<{
215
231
  }>;
216
232
 
217
233
  // @public (undocumented)
218
- export type OryFormProps = PropsWithChildren;
234
+ export type OryFormProps = PropsWithChildren<{
235
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
236
+ nodes?: UiNode[];
237
+ }>;
219
238
 
220
239
  // @public (undocumented)
221
240
  export type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
222
241
  onSubmit: FormEventHandler<HTMLFormElement>;
223
242
  };
224
243
 
244
+ // @public (undocumented)
245
+ export function OryFormSection({ children, nodes }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
246
+
247
+ // @public (undocumented)
248
+ export type OryFormSectionContentProps = PropsWithChildren<{
249
+ title?: string;
250
+ description?: string;
251
+ }>;
252
+
253
+ // @public (undocumented)
254
+ export type OryFormSectionFooterProps = PropsWithChildren;
255
+
256
+ // @public (undocumented)
257
+ export type OryFormSectionProps = PropsWithChildren<{
258
+ nodes?: UiNode[];
259
+ }>;
260
+
225
261
  // @public (undocumented)
226
262
  export function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
227
263
 
@@ -244,11 +280,13 @@ export type OryNodeAnchorProps = {
244
280
  node: UiNode;
245
281
  } & Omit<ComponentPropsWithoutRef<"a">, "children">;
246
282
 
283
+ // Warning: (ae-forgotten-export) The symbol "ButtonVariants" needs to be exported by the entry point index.d.ts
284
+ //
247
285
  // @public (undocumented)
248
286
  export type OryNodeButtonProps = {
249
287
  attributes: UiNodeInputAttributes;
250
288
  node: UiNode;
251
- } & Omit<ComponentPropsWithoutRef<"button">, "children">;
289
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
252
290
 
253
291
  // @public (undocumented)
254
292
  export type OryNodeImageProps = {
@@ -282,6 +320,9 @@ export type OryNodeTextProps = {
282
320
  node: UiNode;
283
321
  };
284
322
 
323
+ // @public (undocumented)
324
+ export type OryPageHeaderProps = Record<never, never>;
325
+
285
326
  // @public (undocumented)
286
327
  export function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
287
328
 
@@ -290,6 +331,48 @@ export type OryProviderProps = {
290
331
  components: OryFlowComponents;
291
332
  } & OryFlowContainer & PropsWithChildren;
292
333
 
334
+ // @public (undocumented)
335
+ export function OrySettingsCard(): react_jsx_runtime.JSX.Element;
336
+
337
+ // @public (undocumented)
338
+ export type OrySettingsOidcProps = {
339
+ linkButtons: UiNode[];
340
+ unlinkButtons: UiNode[];
341
+ };
342
+
343
+ // @public (undocumented)
344
+ export type OrySettingsPasskeyProps = {
345
+ triggerButton: UiNode & {
346
+ onClick: () => void;
347
+ };
348
+ removeButtons: UiNode[];
349
+ };
350
+
351
+ // @public (undocumented)
352
+ export type OrySettingsRecoveryCodesProps = {
353
+ codes: string[];
354
+ regnerateButton?: UiNode;
355
+ revealButton?: UiNode;
356
+ };
357
+
358
+ // @public (undocumented)
359
+ export type OrySettingsTotpProps = {
360
+ totpImage: UiNode;
361
+ totpSecret: UiNode;
362
+ totpInput: UiNode;
363
+ } | {
364
+ totpUnlink: UiNode;
365
+ };
366
+
367
+ // @public (undocumented)
368
+ export type OrySettingsWebauthnProps = {
369
+ nameInput: UiNode;
370
+ triggerButton: UiNode & {
371
+ onClick: () => void;
372
+ };
373
+ removeButtons: UiNode[];
374
+ };
375
+
293
376
  // @public (undocumented)
294
377
  export function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
295
378
 
@@ -25,6 +25,7 @@ import { UiNodeImageAttributes } from '@ory/client-fetch';
25
25
  import { UiNodeInputAttributes } from '@ory/client-fetch';
26
26
  import { UiNodeTextAttributes } from '@ory/client-fetch';
27
27
  import { UiText } from '@ory/client-fetch';
28
+ import { VariantProps } from 'class-variance-authority';
28
29
  import { VerificationFlow } from '@ory/client-fetch';
29
30
 
30
31
  // Warning: (ae-forgotten-export) The symbol "OryCardRootProps" needs to be exported by the entry point index.d.ts
@@ -4,6 +4,7 @@
4
4
 
5
5
  ```ts
6
6
 
7
+ import * as class_variance_authority_types from 'class-variance-authority/types';
7
8
  import { ComponentPropsWithoutRef } from 'react';
8
9
  import { ComponentType } from 'react';
9
10
  import { ConfigurationParameters } from '@ory/client-fetch';
@@ -35,6 +36,7 @@ import { UpdateRecoveryFlowBody } from '@ory/client-fetch';
35
36
  import { UpdateRegistrationFlowBody } from '@ory/client-fetch';
36
37
  import { UpdateSettingsFlowBody } from '@ory/client-fetch';
37
38
  import { UpdateVerificationFlowBody } from '@ory/client-fetch';
39
+ import { VariantProps } from 'class-variance-authority';
38
40
  import { VerificationFlow } from '@ory/client-fetch';
39
41
 
40
42
  // Warning: (ae-forgotten-export) The symbol "OryFlow" needs to be exported by the entry point index.d.ts
@@ -53,6 +55,9 @@ export type FlowContextValue = OryFlowContainer & {
53
55
  // @public
54
56
  export type FormValues = Record<string, string | boolean | number | undefined>;
55
57
 
58
+ // @public (undocumented)
59
+ export const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
60
+
56
61
  // Warning: (ae-forgotten-export) The symbol "IntlContextProps" needs to be exported by the entry point index.d.ts
57
62
  //
58
63
  // @public (undocumented)
@@ -169,23 +174,34 @@ export type OryFlowComponents = {
169
174
  Logo: ComponentType<OryCardLogoProps>;
170
175
  Divider: ComponentType<OryCardDividerProps>;
171
176
  AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
177
+ SettingsSection: ComponentType<OryFormSectionProps>;
178
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
179
+ SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
172
180
  };
173
181
  Form: {
174
182
  Root: ComponentType<OryFormRootProps>;
175
183
  OidcRoot: ComponentType<OryFormOidcRootProps>;
176
184
  Group: ComponentType<OryFormGroupProps>;
185
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
186
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
187
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
188
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
189
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
177
190
  };
178
191
  Message: {
179
192
  Root: ComponentType<OryMessageRootProps>;
180
193
  Content: ComponentType<OryMessageContentProps>;
181
194
  };
195
+ Page: {
196
+ Header: ComponentType<OryPageHeaderProps>;
197
+ };
182
198
  };
183
199
 
184
200
  // @public
185
201
  export type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
186
202
 
187
203
  // @public (undocumented)
188
- export function OryForm({ children }: OryFormProps): string | react_jsx_runtime.JSX.Element;
204
+ export function OryForm({ children, onAfterSubmit, nodes }: OryFormProps): string | react_jsx_runtime.JSX.Element;
189
205
 
190
206
  // @public
191
207
  export function OryFormGroupDivider(): react_jsx_runtime.JSX.Element | null;
@@ -215,13 +231,33 @@ export type OryFormOidcRootProps = PropsWithChildren<{
215
231
  }>;
216
232
 
217
233
  // @public (undocumented)
218
- export type OryFormProps = PropsWithChildren;
234
+ export type OryFormProps = PropsWithChildren<{
235
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
236
+ nodes?: UiNode[];
237
+ }>;
219
238
 
220
239
  // @public (undocumented)
221
240
  export type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
222
241
  onSubmit: FormEventHandler<HTMLFormElement>;
223
242
  };
224
243
 
244
+ // @public (undocumented)
245
+ export function OryFormSection({ children, nodes }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
246
+
247
+ // @public (undocumented)
248
+ export type OryFormSectionContentProps = PropsWithChildren<{
249
+ title?: string;
250
+ description?: string;
251
+ }>;
252
+
253
+ // @public (undocumented)
254
+ export type OryFormSectionFooterProps = PropsWithChildren;
255
+
256
+ // @public (undocumented)
257
+ export type OryFormSectionProps = PropsWithChildren<{
258
+ nodes?: UiNode[];
259
+ }>;
260
+
225
261
  // @public (undocumented)
226
262
  export function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
227
263
 
@@ -244,11 +280,13 @@ export type OryNodeAnchorProps = {
244
280
  node: UiNode;
245
281
  } & Omit<ComponentPropsWithoutRef<"a">, "children">;
246
282
 
283
+ // Warning: (ae-forgotten-export) The symbol "ButtonVariants" needs to be exported by the entry point index.d.ts
284
+ //
247
285
  // @public (undocumented)
248
286
  export type OryNodeButtonProps = {
249
287
  attributes: UiNodeInputAttributes;
250
288
  node: UiNode;
251
- } & Omit<ComponentPropsWithoutRef<"button">, "children">;
289
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
252
290
 
253
291
  // @public (undocumented)
254
292
  export type OryNodeImageProps = {
@@ -282,6 +320,9 @@ export type OryNodeTextProps = {
282
320
  node: UiNode;
283
321
  };
284
322
 
323
+ // @public (undocumented)
324
+ export type OryPageHeaderProps = Record<never, never>;
325
+
285
326
  // @public (undocumented)
286
327
  export function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
287
328
 
@@ -290,6 +331,48 @@ export type OryProviderProps = {
290
331
  components: OryFlowComponents;
291
332
  } & OryFlowContainer & PropsWithChildren;
292
333
 
334
+ // @public (undocumented)
335
+ export function OrySettingsCard(): react_jsx_runtime.JSX.Element;
336
+
337
+ // @public (undocumented)
338
+ export type OrySettingsOidcProps = {
339
+ linkButtons: UiNode[];
340
+ unlinkButtons: UiNode[];
341
+ };
342
+
343
+ // @public (undocumented)
344
+ export type OrySettingsPasskeyProps = {
345
+ triggerButton: UiNode & {
346
+ onClick: () => void;
347
+ };
348
+ removeButtons: UiNode[];
349
+ };
350
+
351
+ // @public (undocumented)
352
+ export type OrySettingsRecoveryCodesProps = {
353
+ codes: string[];
354
+ regnerateButton?: UiNode;
355
+ revealButton?: UiNode;
356
+ };
357
+
358
+ // @public (undocumented)
359
+ export type OrySettingsTotpProps = {
360
+ totpImage: UiNode;
361
+ totpSecret: UiNode;
362
+ totpInput: UiNode;
363
+ } | {
364
+ totpUnlink: UiNode;
365
+ };
366
+
367
+ // @public (undocumented)
368
+ export type OrySettingsWebauthnProps = {
369
+ nameInput: UiNode;
370
+ triggerButton: UiNode & {
371
+ onClick: () => void;
372
+ };
373
+ removeButtons: UiNode[];
374
+ };
375
+
293
376
  // @public (undocumented)
294
377
  export function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
295
378
 
package/dist/index.d.mts CHANGED
@@ -1,12 +1,21 @@
1
1
  import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler, Session } from '@ory/client-fetch';
2
2
  import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
3
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
6
  import { IntlShape } from 'react-intl';
5
7
 
8
+ declare const buttonStyles: (props?: ({
9
+ intent?: "primary" | "secondary" | null | undefined;
10
+ size?: "default" | "large" | null | undefined;
11
+ defaultVariants?: "intent" | "size" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+ type ButtonVariants = VariantProps<typeof buttonStyles>;
14
+
6
15
  type OryNodeButtonProps = {
7
16
  attributes: UiNodeInputAttributes;
8
17
  node: UiNode;
9
- } & Omit<ComponentPropsWithoutRef<"button">, "children">;
18
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
10
19
  type OryCurrentIdentifierProps = {
11
20
  attributes: UiNodeInputAttributes;
12
21
  node: UiNode;
@@ -50,6 +59,11 @@ type OryNodeInputProps = {
50
59
  node: UiNode;
51
60
  onClick?: MouseEventHandler;
52
61
  };
62
+ type OryFormSectionContentProps = PropsWithChildren<{
63
+ title?: string;
64
+ description?: string;
65
+ }>;
66
+ type OryFormSectionFooterProps = PropsWithChildren;
53
67
 
54
68
  type OryCardHeaderProps = Record<string, never>;
55
69
  declare function OryCardHeader(): react_jsx_runtime.JSX.Element;
@@ -130,6 +144,46 @@ type OryNodeOidcButtonProps = {
130
144
  declare function OryFormOidcButtons({ children, hideDivider, }: OryFormOidcButtonsProps): react_jsx_runtime.JSX.Element | null;
131
145
  declare function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
132
146
 
147
+ type OryPageHeaderProps = Record<never, never>;
148
+ declare const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
149
+
150
+ type OryFormSectionProps = PropsWithChildren<{
151
+ nodes?: UiNode[];
152
+ }>;
153
+ declare function OryFormSection({ children, nodes }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
154
+
155
+ declare function OrySettingsCard(): react_jsx_runtime.JSX.Element;
156
+
157
+ type OrySettingsRecoveryCodesProps = {
158
+ codes: string[];
159
+ regnerateButton?: UiNode;
160
+ revealButton?: UiNode;
161
+ };
162
+ type OrySettingsTotpProps = {
163
+ totpImage: UiNode;
164
+ totpSecret: UiNode;
165
+ totpInput: UiNode;
166
+ } | {
167
+ totpUnlink: UiNode;
168
+ };
169
+ type OrySettingsOidcProps = {
170
+ linkButtons: UiNode[];
171
+ unlinkButtons: UiNode[];
172
+ };
173
+ type OrySettingsWebauthnProps = {
174
+ nameInput: UiNode;
175
+ triggerButton: UiNode & {
176
+ onClick: () => void;
177
+ };
178
+ removeButtons: UiNode[];
179
+ };
180
+ type OrySettingsPasskeyProps = {
181
+ triggerButton: UiNode & {
182
+ onClick: () => void;
183
+ };
184
+ removeButtons: UiNode[];
185
+ };
186
+
133
187
  /**
134
188
  * A record of all the components that are used in the OryForm component.
135
189
  */
@@ -213,6 +267,18 @@ type OryFlowComponents = {
213
267
  * This is only used, if login is configured to use identifier_first authentication.
214
268
  */
215
269
  AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
270
+ /**
271
+ * The SettingsSection component is rendered around each section of the settings.
272
+ */
273
+ SettingsSection: ComponentType<OryFormSectionProps>;
274
+ /**
275
+ * The SettingsSectionContent component is rendered around the content of each section of the settings.
276
+ */
277
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
278
+ /**
279
+ * The SettingsSectionFooter component is rendered around the footer of each section of the settings.
280
+ */
281
+ SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
216
282
  };
217
283
  Form: {
218
284
  /**
@@ -235,6 +301,26 @@ type OryFlowComponents = {
235
301
  * The FormGroup is rendered around each group of nodes in the UI nodes.
236
302
  */
237
303
  Group: ComponentType<OryFormGroupProps>;
304
+ /**
305
+ * The section on the settings page, rendering the OIDC settings
306
+ */
307
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
308
+ /**
309
+ * The section on the settings page, rendering the Webauthn settings
310
+ */
311
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
312
+ /**
313
+ * The section on the settings page, rendering the Passkey settings
314
+ */
315
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
316
+ /**
317
+ * The section on the settings page, rendering the TOTP settings
318
+ */
319
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
320
+ /**
321
+ * The section on the settings page, rendering the recovery code settings
322
+ */
323
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
238
324
  };
239
325
  Message: {
240
326
  /**
@@ -246,6 +332,9 @@ type OryFlowComponents = {
246
332
  */
247
333
  Content: ComponentType<OryMessageContentProps>;
248
334
  };
335
+ Page: {
336
+ Header: ComponentType<OryPageHeaderProps>;
337
+ };
249
338
  };
250
339
  type DeepPartialTwoLevels<T> = {
251
340
  [P in keyof T]?: T[P] extends object ? {
@@ -253,8 +342,11 @@ type DeepPartialTwoLevels<T> = {
253
342
  } : T[P];
254
343
  };
255
344
  type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
256
- type OryFormProps = PropsWithChildren;
257
- declare function OryForm({ children }: OryFormProps): string | react_jsx_runtime.JSX.Element;
345
+ type OryFormProps = PropsWithChildren<{
346
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
347
+ nodes?: UiNode[];
348
+ }>;
349
+ declare function OryForm({ children, onAfterSubmit, nodes }: OryFormProps): string | react_jsx_runtime.JSX.Element;
258
350
 
259
351
  declare function useComponents(): OryFlowComponents;
260
352
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -470,4 +562,4 @@ declare const useSession: () => {
470
562
  isLoading: boolean;
471
563
  };
472
564
 
473
- export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormValues, 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, OryCardValidationMessages, type OryClientConfiguration, type OryCurrentIdentifierProps, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcButtonsProps, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSocialButtonsForm, locales as OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, OryProvider, type OryProviderProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow, useSession };
565
+ export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, 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, OryCardValidationMessages, type OryClientConfiguration, type OryCurrentIdentifierProps, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcButtonsProps, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, locales as OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, 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, useSession };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,21 @@
1
1
  import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler, Session } from '@ory/client-fetch';
2
2
  import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
3
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
6
  import { IntlShape } from 'react-intl';
5
7
 
8
+ declare const buttonStyles: (props?: ({
9
+ intent?: "primary" | "secondary" | null | undefined;
10
+ size?: "default" | "large" | null | undefined;
11
+ defaultVariants?: "intent" | "size" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+ type ButtonVariants = VariantProps<typeof buttonStyles>;
14
+
6
15
  type OryNodeButtonProps = {
7
16
  attributes: UiNodeInputAttributes;
8
17
  node: UiNode;
9
- } & Omit<ComponentPropsWithoutRef<"button">, "children">;
18
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
10
19
  type OryCurrentIdentifierProps = {
11
20
  attributes: UiNodeInputAttributes;
12
21
  node: UiNode;
@@ -50,6 +59,11 @@ type OryNodeInputProps = {
50
59
  node: UiNode;
51
60
  onClick?: MouseEventHandler;
52
61
  };
62
+ type OryFormSectionContentProps = PropsWithChildren<{
63
+ title?: string;
64
+ description?: string;
65
+ }>;
66
+ type OryFormSectionFooterProps = PropsWithChildren;
53
67
 
54
68
  type OryCardHeaderProps = Record<string, never>;
55
69
  declare function OryCardHeader(): react_jsx_runtime.JSX.Element;
@@ -130,6 +144,46 @@ type OryNodeOidcButtonProps = {
130
144
  declare function OryFormOidcButtons({ children, hideDivider, }: OryFormOidcButtonsProps): react_jsx_runtime.JSX.Element | null;
131
145
  declare function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
132
146
 
147
+ type OryPageHeaderProps = Record<never, never>;
148
+ declare const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
149
+
150
+ type OryFormSectionProps = PropsWithChildren<{
151
+ nodes?: UiNode[];
152
+ }>;
153
+ declare function OryFormSection({ children, nodes }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
154
+
155
+ declare function OrySettingsCard(): react_jsx_runtime.JSX.Element;
156
+
157
+ type OrySettingsRecoveryCodesProps = {
158
+ codes: string[];
159
+ regnerateButton?: UiNode;
160
+ revealButton?: UiNode;
161
+ };
162
+ type OrySettingsTotpProps = {
163
+ totpImage: UiNode;
164
+ totpSecret: UiNode;
165
+ totpInput: UiNode;
166
+ } | {
167
+ totpUnlink: UiNode;
168
+ };
169
+ type OrySettingsOidcProps = {
170
+ linkButtons: UiNode[];
171
+ unlinkButtons: UiNode[];
172
+ };
173
+ type OrySettingsWebauthnProps = {
174
+ nameInput: UiNode;
175
+ triggerButton: UiNode & {
176
+ onClick: () => void;
177
+ };
178
+ removeButtons: UiNode[];
179
+ };
180
+ type OrySettingsPasskeyProps = {
181
+ triggerButton: UiNode & {
182
+ onClick: () => void;
183
+ };
184
+ removeButtons: UiNode[];
185
+ };
186
+
133
187
  /**
134
188
  * A record of all the components that are used in the OryForm component.
135
189
  */
@@ -213,6 +267,18 @@ type OryFlowComponents = {
213
267
  * This is only used, if login is configured to use identifier_first authentication.
214
268
  */
215
269
  AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
270
+ /**
271
+ * The SettingsSection component is rendered around each section of the settings.
272
+ */
273
+ SettingsSection: ComponentType<OryFormSectionProps>;
274
+ /**
275
+ * The SettingsSectionContent component is rendered around the content of each section of the settings.
276
+ */
277
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
278
+ /**
279
+ * The SettingsSectionFooter component is rendered around the footer of each section of the settings.
280
+ */
281
+ SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
216
282
  };
217
283
  Form: {
218
284
  /**
@@ -235,6 +301,26 @@ type OryFlowComponents = {
235
301
  * The FormGroup is rendered around each group of nodes in the UI nodes.
236
302
  */
237
303
  Group: ComponentType<OryFormGroupProps>;
304
+ /**
305
+ * The section on the settings page, rendering the OIDC settings
306
+ */
307
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
308
+ /**
309
+ * The section on the settings page, rendering the Webauthn settings
310
+ */
311
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
312
+ /**
313
+ * The section on the settings page, rendering the Passkey settings
314
+ */
315
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
316
+ /**
317
+ * The section on the settings page, rendering the TOTP settings
318
+ */
319
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
320
+ /**
321
+ * The section on the settings page, rendering the recovery code settings
322
+ */
323
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
238
324
  };
239
325
  Message: {
240
326
  /**
@@ -246,6 +332,9 @@ type OryFlowComponents = {
246
332
  */
247
333
  Content: ComponentType<OryMessageContentProps>;
248
334
  };
335
+ Page: {
336
+ Header: ComponentType<OryPageHeaderProps>;
337
+ };
249
338
  };
250
339
  type DeepPartialTwoLevels<T> = {
251
340
  [P in keyof T]?: T[P] extends object ? {
@@ -253,8 +342,11 @@ type DeepPartialTwoLevels<T> = {
253
342
  } : T[P];
254
343
  };
255
344
  type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
256
- type OryFormProps = PropsWithChildren;
257
- declare function OryForm({ children }: OryFormProps): string | react_jsx_runtime.JSX.Element;
345
+ type OryFormProps = PropsWithChildren<{
346
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
347
+ nodes?: UiNode[];
348
+ }>;
349
+ declare function OryForm({ children, onAfterSubmit, nodes }: OryFormProps): string | react_jsx_runtime.JSX.Element;
258
350
 
259
351
  declare function useComponents(): OryFlowComponents;
260
352
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -470,4 +562,4 @@ declare const useSession: () => {
470
562
  isLoading: boolean;
471
563
  };
472
564
 
473
- export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormValues, 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, OryCardValidationMessages, type OryClientConfiguration, type OryCurrentIdentifierProps, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcButtonsProps, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSocialButtonsForm, locales as OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, OryProvider, type OryProviderProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow, useSession };
565
+ export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, 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, OryCardValidationMessages, type OryClientConfiguration, type OryCurrentIdentifierProps, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcButtonsProps, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, locales as OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, 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, useSession };