@ory/elements-react 0.0.0-pr.8e964fc1

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +404 -0
  2. package/DEVELOPMENT.md +79 -0
  3. package/LICENSE +201 -0
  4. package/README.md +254 -0
  5. package/dist/client/config.d.mts +21 -0
  6. package/dist/client/config.d.ts +21 -0
  7. package/dist/client/config.js +77 -0
  8. package/dist/client/config.js.map +1 -0
  9. package/dist/client/config.mjs +51 -0
  10. package/dist/client/config.mjs.map +1 -0
  11. package/dist/client/frontendClient.d.mts +7 -0
  12. package/dist/client/frontendClient.d.ts +7 -0
  13. package/dist/client/frontendClient.js +52 -0
  14. package/dist/client/frontendClient.js.map +1 -0
  15. package/dist/client/frontendClient.mjs +31 -0
  16. package/dist/client/frontendClient.mjs.map +1 -0
  17. package/dist/client/index.d.mts +5 -0
  18. package/dist/client/index.d.ts +5 -0
  19. package/dist/client/index.js +33 -0
  20. package/dist/client/index.js.map +1 -0
  21. package/dist/client/index.mjs +10 -0
  22. package/dist/client/index.mjs.map +1 -0
  23. package/dist/client/session-provider.d.mts +62 -0
  24. package/dist/client/session-provider.d.ts +62 -0
  25. package/dist/client/session-provider.js +96 -0
  26. package/dist/client/session-provider.js.map +1 -0
  27. package/dist/client/session-provider.mjs +71 -0
  28. package/dist/client/session-provider.mjs.map +1 -0
  29. package/dist/client/useSession.d.mts +32 -0
  30. package/dist/client/useSession.d.ts +32 -0
  31. package/dist/client/useSession.js +37 -0
  32. package/dist/client/useSession.js.map +1 -0
  33. package/dist/client/useSession.mjs +13 -0
  34. package/dist/client/useSession.mjs.map +1 -0
  35. package/dist/index.d.mts +585 -0
  36. package/dist/index.d.ts +585 -0
  37. package/dist/index.js +3741 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/index.mjs +3719 -0
  40. package/dist/index.mjs.map +1 -0
  41. package/dist/theme/default/index.css +1510 -0
  42. package/dist/theme/default/index.css.map +1 -0
  43. package/dist/theme/default/index.d.mts +78 -0
  44. package/dist/theme/default/index.d.ts +78 -0
  45. package/dist/theme/default/index.js +2576 -0
  46. package/dist/theme/default/index.js.map +1 -0
  47. package/dist/theme/default/index.mjs +2571 -0
  48. package/dist/theme/default/index.mjs.map +1 -0
  49. package/dist/theme/default/tailwind/defaults.d.mts +737 -0
  50. package/dist/theme/default/tailwind/defaults.d.ts +737 -0
  51. package/dist/theme/default/tailwind/defaults.js +219 -0
  52. package/dist/theme/default/tailwind/defaults.js.map +1 -0
  53. package/dist/theme/default/tailwind/defaults.mjs +196 -0
  54. package/dist/theme/default/tailwind/defaults.mjs.map +1 -0
  55. package/package.json +90 -0
  56. package/tailwind/defaults.ts +34 -0
  57. package/tailwind/generated/README.md +2 -0
  58. package/tailwind/generated/default-variables.css +216 -0
  59. package/tailwind/generated/variables-processed.json +161 -0
  60. package/tsconfig.json +35 -0
  61. package/tsconfig.runtime.json +4 -0
@@ -0,0 +1,585 @@
1
+ import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
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';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import { IntlShape } from 'react-intl';
7
+
8
+ declare const buttonStyles: (props?: ({
9
+ intent?: "primary" | "secondary" | null | undefined;
10
+ defaultVariants?: "intent" | null | undefined;
11
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
12
+ type ButtonVariants = VariantProps<typeof buttonStyles>;
13
+
14
+ type OryNodeButtonProps = {
15
+ attributes: UiNodeInputAttributes;
16
+ node: UiNode;
17
+ } & Omit<ComponentPropsWithoutRef<"button">, "children"> & ButtonVariants;
18
+ type OryNodeAnchorProps = {
19
+ attributes: UiNodeAnchorAttributes;
20
+ node: UiNode;
21
+ } & Omit<ComponentPropsWithoutRef<"a">, "children">;
22
+ type OryNodeLabelProps = {
23
+ attributes: UiNodeInputAttributes;
24
+ node: UiNode;
25
+ } & ComponentPropsWithoutRef<"label">;
26
+ type OryNodeTextProps = {
27
+ attributes: UiNodeTextAttributes;
28
+ node: UiNode;
29
+ };
30
+ type OryCardLogoProps = Record<string, never>;
31
+ /**
32
+ * Props for the AuthMethodListItem component. This component is used
33
+ * to render a single auth method in the AuthMethodList component.
34
+ */
35
+ type OryCardAuthMethodListItemProps = {
36
+ onClick: () => void;
37
+ group: string;
38
+ };
39
+ type OryNodeImageProps = {
40
+ attributes: UiNodeImageAttributes;
41
+ node: UiNode;
42
+ };
43
+ /**
44
+ * A generic type for the form values.
45
+ */
46
+ type FormValues = Record<string, string | boolean | number | undefined>;
47
+ type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
48
+ onSubmit: FormEventHandler<HTMLFormElement>;
49
+ };
50
+ type OryNodeInputProps = {
51
+ attributes: UiNodeInputAttributes;
52
+ node: UiNode;
53
+ onClick?: MouseEventHandler;
54
+ };
55
+ type OryFormSectionContentProps = PropsWithChildren<{
56
+ title?: string;
57
+ description?: string;
58
+ }>;
59
+ type OryFormSectionFooterProps = PropsWithChildren<{
60
+ text?: string;
61
+ }>;
62
+
63
+ type OryCardHeaderProps = Record<string, never>;
64
+ declare function OryCardHeader(): react_jsx_runtime.JSX.Element;
65
+
66
+ type OryCardRootProps = PropsWithChildren;
67
+ /**
68
+ * The root component of the Ory Card.
69
+ *
70
+ * This can be used to build fully custom implementations of the Ory Flows.
71
+ *
72
+ * However, you most likely want to override the individual components instead.
73
+ *
74
+ * @param props - pass children to render instead of the default Ory Card components
75
+ * @returns
76
+ */
77
+ declare function OryCard({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
78
+
79
+ type OryCardFooterProps = Record<string, never>;
80
+ declare function OryCardFooter(): react_jsx_runtime.JSX.Element;
81
+
82
+ /**
83
+ * Props for the OryCardContent component.
84
+ */
85
+ type OryCardContentProps = PropsWithChildren;
86
+ /**
87
+ * A component that renders the content of the Ory Card.
88
+ * This is the main content of the card, such as the flow's form, with it's input fields and messages.
89
+ *
90
+ * You can use this component to build fully custom implementations of the Ory Flows.
91
+ *
92
+ * However, you most likely want to override the individual components instead.
93
+ *
94
+ * @param props - pass children to render instead of the default Ory Card components
95
+ * @returns
96
+ */
97
+ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_runtime.JSX.Element;
98
+
99
+ declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
100
+
101
+ /**
102
+ * Props type for the Form Group Divider component.
103
+ */
104
+ type OryCardDividerProps = Record<string, never>;
105
+ /**
106
+ * Renders the @see Card.Divider between the groups of nodes in the Ory Form.
107
+ *
108
+ * You can use this component to build fully custom implementations of the Ory Flows.
109
+ *
110
+ * However, you most likely want to override the individual components instead.
111
+ *
112
+ * @returns
113
+ */
114
+ declare function OryFormGroupDivider(): react_jsx_runtime.JSX.Element | null;
115
+
116
+ type OryPageHeaderProps = Record<never, never>;
117
+ declare const HeadlessPageHeader: () => react_jsx_runtime.JSX.Element;
118
+
119
+ declare function OrySettingsCard(): react_jsx_runtime.JSX.Element;
120
+
121
+ type OrySettingsRecoveryCodesProps = {
122
+ codes: string[];
123
+ regnerateButton: UiNode | undefined;
124
+ revealButton: UiNode | undefined;
125
+ onRegenerate: () => void;
126
+ onReveal: () => void;
127
+ };
128
+ type OrySettingsTotpProps = {
129
+ totpImage: UiNode | undefined;
130
+ totpSecret: UiNode | undefined;
131
+ totpInput: UiNode | undefined;
132
+ totpUnlink: UiNode | undefined;
133
+ onUnlink: () => void;
134
+ };
135
+ type OrySettingsOidcProps = {
136
+ linkButtons: (UiNode & {
137
+ onClick: () => void;
138
+ })[];
139
+ unlinkButtons: (UiNode & {
140
+ onClick: () => void;
141
+ })[];
142
+ };
143
+ type OrySettingsWebauthnProps = {
144
+ nameInput: UiNode;
145
+ triggerButton: UiNode & {
146
+ onClick: () => void;
147
+ };
148
+ removeButtons: (UiNode & {
149
+ onClick: () => void;
150
+ })[];
151
+ };
152
+ type OrySettingsPasskeyProps = {
153
+ triggerButton: UiNode & {
154
+ onClick: () => void;
155
+ };
156
+ removeButtons: (UiNode & {
157
+ onClick: () => void;
158
+ })[];
159
+ };
160
+
161
+ type OryFormGroupsProps = PropsWithChildren<{
162
+ groups: UiNodeGroupEnum[];
163
+ }>;
164
+ type OryFormGroupProps = PropsWithChildren;
165
+ declare function OryFormGroups({ groups }: OryFormGroupsProps): react_jsx_runtime.JSX.Element;
166
+
167
+ type OryMessageContentProps = {
168
+ message: UiText;
169
+ };
170
+ type OryMessageRootProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
171
+ declare function OryCardValidationMessages({ ...props }: OryMessageRootProps): react_jsx_runtime.JSX.Element | null;
172
+
173
+ type OryFormProps$1 = Omit<ComponentPropsWithoutRef<"form">, "action" | "method" | "onSubmit">;
174
+ type OryFormSectionProps = PropsWithChildren<OryFormProps$1 & {
175
+ nodes?: UiNode[];
176
+ }>;
177
+ type OryCardSettingsSectionProps = PropsWithChildren & {
178
+ action: string;
179
+ method: string;
180
+ onSubmit: FormEventHandler<HTMLFormElement>;
181
+ };
182
+ declare function OryFormSection({ children, nodes, ...rest }: OryFormSectionProps): react_jsx_runtime.JSX.Element;
183
+
184
+ type OryFormOidcRootProps = PropsWithChildren<{
185
+ nodes: UiNode[];
186
+ }>;
187
+ type OryNodeOidcButtonProps = {
188
+ node: UiNode;
189
+ attributes: UiNodeInputAttributes;
190
+ onClick?: () => void;
191
+ };
192
+ declare function OryFormOidcButtons(): react_jsx_runtime.JSX.Element | null;
193
+ declare function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null;
194
+
195
+ /**
196
+ * A record of all the components that are used in the OryForm component.
197
+ */
198
+ type OryFlowComponents = {
199
+ Node: {
200
+ /**
201
+ * Button component, rendered whenever a button is encountered in the Ory UI Nodes.
202
+ */
203
+ Button: ComponentType<OryNodeButtonProps>;
204
+ /**
205
+ * The SocialButton component is rendered whenever a button of group "oidc" node is encountered.
206
+ *
207
+ * It renders the "Login with Google", "Login with Facebook" etc. buttons.
208
+ */
209
+ OidcButton: ComponentType<OryNodeOidcButtonProps>;
210
+ /**
211
+ * Anchor component, rendered whenever an "anchor" node is encountered
212
+ */
213
+ Anchor: ComponentType<OryNodeAnchorProps>;
214
+ /**
215
+ * The Input component is rendered whenever a "input" node is encountered.
216
+ */
217
+ Input: ComponentType<OryNodeInputProps>;
218
+ /**
219
+ * Special version of the Input component for OTP codes.
220
+ */
221
+ CodeInput: ComponentType<OryNodeInputProps>;
222
+ /**
223
+ * The Image component is rendered whenever an "image" node is encountered.
224
+ *
225
+ * For example used in the "Logo" node.
226
+ */
227
+ Image: ComponentType<OryNodeImageProps>;
228
+ /**
229
+ * The Label component is rendered around Input components and is used to render form labels.
230
+ */
231
+ Label: ComponentType<OryNodeLabelProps>;
232
+ /**
233
+ * The Checkbox component is rendered whenever an input node with of boolean type is encountered.
234
+ */
235
+ Checkbox: ComponentType<OryNodeInputProps>;
236
+ /**
237
+ * The Text component is rendered whenever a "text" node is encountered.
238
+ */
239
+ Text: ComponentType<OryNodeTextProps>;
240
+ };
241
+ Card: {
242
+ /**
243
+ * The card container is the main container of the card.
244
+ */
245
+ Root: ComponentType<OryCardRootProps>;
246
+ /**
247
+ * The card footer is the footer of the card container.
248
+ */
249
+ Footer: ComponentType<OryCardFooterProps>;
250
+ /**
251
+ * The card header is the header of the card container.
252
+ */
253
+ Header: ComponentType<OryCardRootProps>;
254
+ /**
255
+ * The card content is the main content of the card container.
256
+ */
257
+ Content: ComponentType<OryCardContentProps>;
258
+ /**
259
+ * The card logo is the logo of the card container.
260
+ */
261
+ Logo: ComponentType<OryCardLogoProps>;
262
+ /**
263
+ * The HorizontalDivider component is rendered between groups.
264
+ */
265
+ Divider: ComponentType<OryCardDividerProps>;
266
+ /**
267
+ * The AuthMethodListContainer component is rendered around the "method" chooser step in the identifier_first login flow.
268
+ *
269
+ * This is only used, if login is configured to use identifier_first authentication.
270
+ */
271
+ AuthMethodListContainer: ComponentType<PropsWithChildren>;
272
+ /**
273
+ * The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow.
274
+ *
275
+ * This is only used, if login is configured to use identifier_first authentication.
276
+ */
277
+ AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>;
278
+ /**
279
+ * The SettingsSection component is rendered around each section of the settings.
280
+ */
281
+ SettingsSection: ComponentType<OryCardSettingsSectionProps>;
282
+ /**
283
+ * The SettingsSectionContent component is rendered around the content of each section of the settings.
284
+ */
285
+ SettingsSectionContent: ComponentType<OryFormSectionContentProps>;
286
+ /**
287
+ * The SettingsSectionFooter component is rendered around the footer of each section of the settings.
288
+ */
289
+ SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
290
+ };
291
+ Form: {
292
+ /**
293
+ * The FormContainer component is the main container of the form.
294
+ *
295
+ * It should render its children.
296
+ *
297
+ * You most likely don't want to override this component directly.
298
+ */
299
+ Root: ComponentType<OryFormRootProps>;
300
+ /**
301
+ * A special form group container for the social buttons.
302
+ *
303
+ * This is required, because the social buttons need to be in its form, to not influence the other form groups.
304
+ *
305
+ * You most likely don't want to override this component directly.
306
+ */
307
+ OidcRoot: ComponentType<OryFormOidcRootProps>;
308
+ /**
309
+ * The FormGroup is rendered around each group of nodes in the UI nodes.
310
+ */
311
+ Group: ComponentType<OryFormGroupProps>;
312
+ /**
313
+ * The section on the settings page, rendering the OIDC settings
314
+ */
315
+ OidcSettings: ComponentType<OrySettingsOidcProps>;
316
+ /**
317
+ * The section on the settings page, rendering the Webauthn settings
318
+ */
319
+ WebauthnSettings: ComponentType<OrySettingsWebauthnProps>;
320
+ /**
321
+ * The section on the settings page, rendering the Passkey settings
322
+ */
323
+ PasskeySettings: ComponentType<OrySettingsPasskeyProps>;
324
+ /**
325
+ * The section on the settings page, rendering the TOTP settings
326
+ */
327
+ TotpSettings: ComponentType<OrySettingsTotpProps>;
328
+ /**
329
+ * The section on the settings page, rendering the recovery code settings
330
+ */
331
+ RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>;
332
+ };
333
+ Message: {
334
+ /**
335
+ * The MessageContainer is rendered around the messages.
336
+ */
337
+ Root: ComponentType<OryMessageRootProps>;
338
+ /**
339
+ * The Message component is rendered whenever a message is encountered.
340
+ */
341
+ Content: ComponentType<OryMessageContentProps>;
342
+ };
343
+ Page: {
344
+ Header: ComponentType<OryPageHeaderProps>;
345
+ };
346
+ };
347
+ type DeepPartialTwoLevels<T> = {
348
+ [P in keyof T]?: T[P] extends object ? {
349
+ [K in keyof T[P]]?: T[P][K];
350
+ } : T[P];
351
+ };
352
+ type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
353
+ type OryFormProps = PropsWithChildren<{
354
+ onAfterSubmit?: (method: string | number | boolean | undefined) => void;
355
+ }>;
356
+ declare function OryForm({ children, onAfterSubmit }: OryFormProps): string | react_jsx_runtime.JSX.Element;
357
+
358
+ declare function useComponents(): OryFlowComponents;
359
+ declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
360
+ flowType: string;
361
+ }) => number;
362
+
363
+ type LocaleMap = Record<string, Record<string, string>>;
364
+ declare const OryLocales: LocaleMap;
365
+
366
+ type Locale = keyof typeof OryLocales;
367
+ type IntlContextProps = {
368
+ locale: Locale;
369
+ customTranslations?: Partial<LocaleMap>;
370
+ };
371
+
372
+ type IntlConfig = IntlContextProps;
373
+ type OryClientConfiguration = {
374
+ /**
375
+ * The name of the application the user is logging in to.
376
+ */
377
+ name: string;
378
+ /**
379
+ * An optional logo URL to display in the UI instead of the name.
380
+ */
381
+ logoUrl?: string;
382
+ stylesheet?: string;
383
+ favicon?: string;
384
+ sdk: {
385
+ url: string;
386
+ options?: Partial<ConfigurationParameters>;
387
+ };
388
+ project: {
389
+ registration_enabled: boolean;
390
+ verification_enabled: boolean;
391
+ recovery_enabled: boolean;
392
+ recovery_ui_url: string;
393
+ registration_ui_url: string;
394
+ verification_ui_url: string;
395
+ login_ui_url: string;
396
+ };
397
+ intl?: IntlConfig;
398
+ };
399
+
400
+ /**
401
+ * A generic flow container, containing a flowType, the flow itself and the config object
402
+ *
403
+ * @see OryClientConfiguration
404
+ */
405
+ type OryFlow<TFlowType, TFlow> = {
406
+ flowType: TFlowType;
407
+ flow: TFlow;
408
+ config: OryClientConfiguration;
409
+ };
410
+ /**
411
+ * A flow container for the login flow
412
+ *
413
+ * @see OryFlow
414
+ * @see LoginFlow
415
+ */
416
+ type LoginFlowContainer = OryFlow<FlowType.Login, LoginFlow>;
417
+ /**
418
+ * A flow container for the registration flow
419
+ *
420
+ * @see OryFlow
421
+ * @see RegistrationFlow
422
+ */
423
+ type RegistrationFlowContainer = OryFlow<FlowType.Registration, RegistrationFlow>;
424
+ /**
425
+ * A flow container for the recovery flow
426
+ *
427
+ * @see OryFlow
428
+ * @see RecoveryFlow
429
+ */
430
+ type RecoveryFlowContainer = OryFlow<FlowType.Recovery, RecoveryFlow>;
431
+ /**
432
+ * A flow container for the verification flow
433
+ *
434
+ * @see OryFlow
435
+ * @see VerificationFlow
436
+ *
437
+ */
438
+ type VerificationFlowContainer = OryFlow<FlowType.Verification, VerificationFlow>;
439
+ /**
440
+ * A flow container for the settings flow
441
+ *
442
+ * @see OryFlow
443
+ * @see SettingsFlow
444
+ */
445
+ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
446
+ /**
447
+ * A flow container for the error flow
448
+ *
449
+ * @see OryFlow
450
+ * @see FlowError (Error flow)
451
+ *
452
+ */
453
+ type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
454
+ /**
455
+ * A union type of all flow containers
456
+ */
457
+ type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
458
+
459
+ /**
460
+ * Converts a UiText to a FormattedMessage.
461
+ * The UiText contains the id of the message and the context.
462
+ * The context is used to inject values into the message from Ory, e.g. a timestamp.
463
+ * For example a UI Node from Ory might look like this:
464
+ *
465
+ * \{
466
+ * "type":"input",
467
+ * "group":"default",
468
+ * "attributes": \{
469
+ * "name":"traits.email",
470
+ * "type":"email",
471
+ * "required":true,
472
+ * "autocomplete":"email",
473
+ * "disabled":false,
474
+ * "node_type":"input"
475
+ * \},
476
+ * "messages":[],
477
+ * "meta": \{
478
+ * "label": \{
479
+ * "id":1070002,
480
+ * "text":"E-Mail",
481
+ * "type":"info",
482
+ * "context":\{
483
+ * "title":"E-Mail"
484
+ * \},
485
+ * \}
486
+ * \}
487
+ * \}
488
+ *
489
+ * The context has the key "title" which matches the formatter template name "\{title\}"
490
+ * An example translation file would look like this:
491
+ * \{
492
+ * "identities.messages.1070002": "\{title\}"
493
+ * \}
494
+ *
495
+ * The formatter would then take the meta.label.id and look for the translation with the key matching the id.
496
+ * It would then replace the template "\{title\}" with the value from the context with the key "title".
497
+ *
498
+ * @param uiText - The UiText is part of the UiNode object sent by Kratos when performing a flow.
499
+ * @param intl - The intl object from react-intl
500
+ */
501
+ declare const uiTextToFormattedMessage: ({ id, context, text }: Omit<UiText, "type">, intl: IntlShape) => string;
502
+
503
+ /**
504
+ * Props for the submit handler
505
+ */
506
+ type OnSubmitHandlerProps<T extends UpdateLoginFlowBody | UpdateRegistrationFlowBody | UpdateVerificationFlowBody | UpdateRecoveryFlowBody | UpdateSettingsFlowBody> = {
507
+ /**
508
+ * This method is used to update the flow container when a validation error occurs, for example.
509
+ */
510
+ setFlowContainer: (flowContainer: OryFlowContainer) => void;
511
+ /**
512
+ * The form values to submit.
513
+ */
514
+ body: T;
515
+ /**
516
+ * This method is used to redirect the user to a different page.
517
+ */
518
+ onRedirect: OnRedirectHandler;
519
+ };
520
+
521
+ /**
522
+ * Helper function to generate a test id for a UiText message.
523
+ *
524
+ * @param message - the UiText message to generate a test id for
525
+ * @returns a unique, stable test id for the message
526
+ */
527
+ declare function messageTestId(message: UiText): {
528
+ "data-testid": string;
529
+ };
530
+
531
+ type FormState = {
532
+ current: "provide_identifier";
533
+ } | {
534
+ current: "select_method";
535
+ } | {
536
+ current: "method_active";
537
+ method: UiNodeGroupEnum;
538
+ } | {
539
+ current: "success_screen";
540
+ } | {
541
+ current: "settings";
542
+ };
543
+ type FormStateAction = {
544
+ type: "action_flow_update";
545
+ flow: OryFlowContainer;
546
+ } | {
547
+ type: "action_select_method";
548
+ method: UiNodeGroupEnum;
549
+ };
550
+
551
+ /**
552
+ * Returns an object that contains the current flow and the flow type, as well as the configuration.
553
+ *
554
+ * @returns The current flow container
555
+ */
556
+ declare function useOryFlow(): FlowContextValue;
557
+ /**
558
+ * Function to set the flow container.
559
+ */
560
+ type FlowContainerSetter = Dispatch<OryFlowContainer>;
561
+ /**
562
+ * The return value of the OryFlowContext.
563
+ */
564
+ type FlowContextValue = OryFlowContainer & {
565
+ /**
566
+ * Function to set the flow container.
567
+ */
568
+ setFlowContainer: FlowContainerSetter;
569
+ /**
570
+ * The current form state.
571
+ * @see FormState
572
+ */
573
+ formState: FormState;
574
+ /**
575
+ * Dispatch function to update the form state.
576
+ */
577
+ dispatchFormState: Dispatch<FormStateAction>;
578
+ };
579
+
580
+ type OryProviderProps = {
581
+ components: OryFlowComponents;
582
+ } & OryFlowContainer & PropsWithChildren;
583
+ declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
584
+
585
+ export { 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, 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 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 };