@ory/elements-react 0.0.0-pr.e3d2b7e1 → 0.0.0-pr.f1435f4
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 +210 -0
- package/DEVELOPMENT.md +19 -4
- package/README.md +253 -4
- package/babel.config.js +10 -0
- package/dist/client/frontendClient.d.mts +5 -2
- package/dist/client/frontendClient.d.ts +5 -2
- package/dist/client/frontendClient.js +25 -2
- package/dist/client/frontendClient.js.map +1 -1
- package/dist/client/frontendClient.mjs +25 -2
- package/dist/client/frontendClient.mjs.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/index.d.mts +48 -5
- package/dist/index.d.ts +48 -5
- package/dist/index.js +807 -316
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +810 -320
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +175 -119
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.d.mts +31 -5
- package/dist/theme/default/index.d.ts +31 -5
- package/dist/theme/default/index.js +4012 -670
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +4046 -629
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +22 -15
- package/tailwind/generated/default-variables.css +1 -1
- package/tsconfig.json +3 -2
- package/.storybook/global.css +0 -7
- package/.storybook/main.ts +0 -50
- package/.storybook/preview-head.html +0 -15
- package/.storybook/preview.tsx +0 -68
- package/.storybook/public/InterVariable.woff2 +0 -0
- package/.storybook/public/inter.css +0 -8
- package/.stub-responses/login/1fa/all-methods/initial-form.json +0 -245
- package/.stub-responses/login/1fa/all-methods/missing-email.json +0 -263
- package/.stub-responses/login/1fa/all-methods/wrong-credentials.json +0 -252
- package/.stub-responses/login/1fa/code/code-input.json +0 -135
- package/.stub-responses/login/1fa/code/initial-form.json +0 -173
- package/.stub-responses/login/1fa/code/invalid-account.json +0 -182
- package/.stub-responses/login/1fa/code/missing-email.json +0 -182
- package/.stub-responses/login/1fa/code/wrong-credentials.json +0 -124
- package/.stub-responses/login/1fa/none/initial-form.json +0 -33
- package/.stub-responses/login/1fa/oidc/credential-select-password.json +0 -120
- package/.stub-responses/login/1fa/oidc/credential-select.json +0 -81
- package/.stub-responses/login/1fa/oidc/initial-form.json +0 -279
- package/.stub-responses/login/1fa/passkey/initial-form.json +0 -122
- package/.stub-responses/login/1fa/password/initial-form.json +0 -154
- package/.stub-responses/login/1fa/password/missing-email.json +0 -172
- package/.stub-responses/login/1fa/password/wrong-credentials.json +0 -163
- package/.stub-responses/login/1fa/webauthn/initial-form.json +0 -76
- package/.stub-responses/login/1fa/webauthn/invalid-account.json +0 -83
- package/.stub-responses/login/1fa/webauthn/show-trigger.json +0 -105
- package/.stub-responses/recovery/disabled/initial-form.json +0 -9
- package/.stub-responses/recovery/none/initial-form.json +0 -9
- package/.stub-responses/registration/one-step/all-methods/initial-form.json +0 -334
- package/.stub-responses/registration/one-step/all-methods/missing-fields.json +0 -343
- package/.stub-responses/registration/one-step/disabled/initial-form.json +0 -10
- package/.stub-responses/registration/one-step/none/initial-form.json +0 -14
- package/.stub-responses/registration/one-step/oidc/initial-form.json +0 -338
- package/.stub-responses/registration/one-step/passkey/initial-form.json +0 -177
- package/.stub-responses/registration/one-step/password/initial-form.json +0 -154
- package/.stub-responses/registration/one-step/password/missing-fields.json +0 -172
- package/.stub-responses/registration/one-step/password/second-step.json +0 -164
- package/.stub-responses/registration/one-step/webauthn/initial-form.json +0 -185
- package/.stub-responses/registration/two-step/all-methods/enter-password.json +0 -242
- package/.stub-responses/registration/two-step/all-methods/initial-form.json +0 -180
- package/.stub-responses/registration/two-step/all-methods/missing-fields.json +0 -189
- package/.stub-responses/registration/two-step/all-methods/password-validation-error.json +0 -244
- package/.stub-responses/registration/two-step/password/enter-password.json +0 -108
- package/.stub-responses/registration/two-step/password/initial-form.json +0 -134
- package/.stub-responses/registration/two-step/password/missing-fields.json +0 -143
- package/.stub-responses/registration/two-step/password/password-validation-error.json +0 -110
- package/.stub-responses/settings/all-methods/change-password.json +0 -381
- package/.stub-responses/settings/all-methods/change-trait.json +0 -377
- package/.stub-responses/settings/all-methods/initial-form.json +0 -368
- package/.stub-responses/settings/oidc/with-provider.json +0 -229
- package/.stub-responses/settings/passkey/initial-form.json +0 -256
- package/.stub-responses/settings/webauthn/initial-form.json +0 -263
- package/.stub-responses/verification/disabled/initial-form.json +0 -9
- package/.stub-responses/verification/none/initial-form.json +0 -9
- package/stories/components/login/1fa/all.stories.ts +0 -46
- package/stories/components/login/1fa/code.stories.ts +0 -64
- package/stories/components/login/1fa/custom.stories.tsx +0 -74
- package/stories/components/login/1fa/none.stories.tsx +0 -28
- package/stories/components/login/1fa/oidc.stories.tsx +0 -140
- package/stories/components/login/1fa/passkey.stories.ts +0 -28
- package/stories/components/login/1fa/password.stories.ts +0 -46
- package/stories/components/login/1fa/webauthn.stories.ts +0 -46
- package/stories/components/registration/one-step/all-methods.stories.ts +0 -37
- package/stories/components/registration/one-step/password.stories.ts +0 -37
- package/stories/components/registration/one-step/webauthn.stories.ts +0 -28
- package/stories/components/registration/two-step/all-methods.stories.ts +0 -55
- package/stories/components/registration/two-step/password.stories.ts +0 -55
- package/stories/components/settings/all.stories.ts +0 -46
- package/stories/components/settings/oidc.stories.ts +0 -28
- package/stories/components/settings/passkey.stories.ts +0 -28
- package/stories/components/settings/webauthn.stories.ts +0 -28
- package/stories/pages/error.tsx +0 -29
- package/stories/utils.ts +0 -20
- package/storybook-static/InterVariable.woff2 +0 -0
- package/storybook-static/assets/Color-ERTF36HU-BdkKyVuV.js +0 -1
- package/storybook-static/assets/DocsRenderer-CFRXHY34-YqKt61zP.js +0 -595
- package/storybook-static/assets/all-methods.stories-B-rqPBX2.js +0 -11
- package/storybook-static/assets/all-methods.stories-CmMlhzsx.js +0 -21
- package/storybook-static/assets/all.stories-CtQ0yCQi.js +0 -16
- package/storybook-static/assets/all.stories-DgIVCzcZ.js +0 -16
- package/storybook-static/assets/chunk-H6MOWX77-DTQOW814.js +0 -1
- package/storybook-static/assets/code.stories-BbEryDcA.js +0 -26
- package/storybook-static/assets/custom.stories-DH2zHar9.js +0 -6
- package/storybook-static/assets/entry-preview-CcFGVifh.js +0 -10
- package/storybook-static/assets/entry-preview-docs-CyY-8bLe.js +0 -54
- package/storybook-static/assets/iframe-C5GAfuxh.js +0 -2
- package/storybook-static/assets/index-BVoBHvaS.js +0 -8
- package/storybook-static/assets/index-CfOt2XX2.js +0 -24
- package/storybook-static/assets/index-DPRSEdy-.js +0 -1
- package/storybook-static/assets/index-DrFu-skq.js +0 -6
- package/storybook-static/assets/index-FeUjBnvO.js +0 -1
- package/storybook-static/assets/index-uubelm5h.js +0 -9
- package/storybook-static/assets/initial-form-DWp_1F-f.js +0 -1
- package/storybook-static/assets/jsx-runtime-QvZ8i92b.js +0 -9
- package/storybook-static/assets/none.stories-TAeRhzd5.js +0 -6
- package/storybook-static/assets/oidc.stories-CniWBy7t.js +0 -58
- package/storybook-static/assets/oidc.stories-jhWzAyoQ.js +0 -6
- package/storybook-static/assets/passkey.stories-CBtjoVSN.js +0 -6
- package/storybook-static/assets/passkey.stories-CQU2Xw_t.js +0 -6
- package/storybook-static/assets/password.stories-0s6cDl0o.js +0 -11
- package/storybook-static/assets/password.stories-B2Wtckz_.js +0 -16
- package/storybook-static/assets/password.stories-DX0gkWjH.js +0 -21
- package/storybook-static/assets/preview-BBWR9nbA.js +0 -1
- package/storybook-static/assets/preview-BPAmP-pY.js +0 -2
- package/storybook-static/assets/preview-BWzBA1C2.js +0 -396
- package/storybook-static/assets/preview-BXtF2ySE.js +0 -234
- package/storybook-static/assets/preview-Cur_8nCX.css +0 -1
- package/storybook-static/assets/preview-D77C14du.js +0 -34
- package/storybook-static/assets/preview-DCjDUH0w.js +0 -27
- package/storybook-static/assets/preview-DFmD0pui.js +0 -1
- package/storybook-static/assets/preview-DGUiP6tS.js +0 -7
- package/storybook-static/assets/preview-aVwhiz9X.js +0 -1
- package/storybook-static/assets/react-18-CtsMCmcS.js +0 -1
- package/storybook-static/assets/settings-BqEFC2-V.css +0 -1
- package/storybook-static/assets/settings-Bx4osEmB.js +0 -2304
- package/storybook-static/assets/webauthn.stories-BzodmV0c.js +0 -6
- package/storybook-static/assets/webauthn.stories-DglGm7Ys.js +0 -6
- package/storybook-static/assets/webauthn.stories-G9E76Wjj.js +0 -16
- package/storybook-static/favicon.svg +0 -1
- package/storybook-static/iframe.html +0 -654
- package/storybook-static/index.html +0 -173
- package/storybook-static/index.json +0 -1
- package/storybook-static/inter.css +0 -8
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/preview-stats.json +0 -2344
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +0 -394
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js +0 -211
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/favicon.svg +0 -1
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +0 -1006
- package/storybook-static/sb-manager/globals-runtime.js +0 -54400
- package/storybook-static/sb-manager/globals.js +0 -48
- package/storybook-static/sb-manager/runtime.js +0 -12089
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -9498
package/dist/client/index.js
CHANGED
|
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
SessionProvider: () => import_session_provider.SessionProvider,
|
|
23
23
|
useSession: () => import_useSession.useSession
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var import_session_provider = require("./session-provider");
|
|
27
27
|
var import_useSession = require("./useSession");
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
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, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
|
|
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';
|
|
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';
|
|
@@ -28,6 +28,9 @@ type OryNodeTextProps = {
|
|
|
28
28
|
node: UiNode;
|
|
29
29
|
};
|
|
30
30
|
type OryCardLogoProps = Record<string, never>;
|
|
31
|
+
type OryNodeCaptchaProps = {
|
|
32
|
+
node: UiNode;
|
|
33
|
+
};
|
|
31
34
|
/**
|
|
32
35
|
* Props for the AuthMethodListItem component. This component is used
|
|
33
36
|
* to render a single auth method in the AuthMethodList component.
|
|
@@ -35,6 +38,10 @@ type OryCardLogoProps = Record<string, never>;
|
|
|
35
38
|
type OryCardAuthMethodListItemProps = {
|
|
36
39
|
onClick: () => void;
|
|
37
40
|
group: string;
|
|
41
|
+
title?: {
|
|
42
|
+
id: string;
|
|
43
|
+
values?: Record<string, string>;
|
|
44
|
+
};
|
|
38
45
|
};
|
|
39
46
|
type OryNodeImageProps = {
|
|
40
47
|
attributes: UiNodeImageAttributes;
|
|
@@ -46,12 +53,18 @@ type OryNodeImageProps = {
|
|
|
46
53
|
type FormValues = Record<string, string | boolean | number | undefined>;
|
|
47
54
|
type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
|
|
48
55
|
onSubmit: FormEventHandler<HTMLFormElement>;
|
|
56
|
+
"data-testid"?: string;
|
|
49
57
|
};
|
|
50
58
|
type OryNodeInputProps = {
|
|
51
59
|
attributes: UiNodeInputAttributes;
|
|
52
60
|
node: UiNode;
|
|
53
61
|
onClick?: MouseEventHandler;
|
|
54
62
|
};
|
|
63
|
+
type OryNodeConsentScopeCheckboxProps = {
|
|
64
|
+
attributes: UiNodeInputAttributes;
|
|
65
|
+
node: UiNode;
|
|
66
|
+
onCheckedChange: (checked: boolean) => void;
|
|
67
|
+
};
|
|
55
68
|
type OryFormSectionContentProps = PropsWithChildren<{
|
|
56
69
|
title?: string;
|
|
57
70
|
description?: string;
|
|
@@ -98,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
|
|
|
98
111
|
|
|
99
112
|
declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
|
|
100
113
|
|
|
114
|
+
declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
101
116
|
/**
|
|
102
117
|
* Props type for the Form Group Divider component.
|
|
103
118
|
*/
|
|
@@ -237,6 +252,14 @@ type OryFlowComponents = {
|
|
|
237
252
|
* The Text component is rendered whenever a "text" node is encountered.
|
|
238
253
|
*/
|
|
239
254
|
Text: ComponentType<OryNodeTextProps>;
|
|
255
|
+
/**
|
|
256
|
+
* The Captcha component is rendered whenever a "captcha" group is encountered.
|
|
257
|
+
*/
|
|
258
|
+
Captcha: ComponentType<OryNodeCaptchaProps>;
|
|
259
|
+
/**
|
|
260
|
+
* Special version of the Input component for scopes in OAuth2 flows.
|
|
261
|
+
*/
|
|
262
|
+
ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
|
|
240
263
|
};
|
|
241
264
|
Card: {
|
|
242
265
|
/**
|
|
@@ -263,6 +286,12 @@ type OryFlowComponents = {
|
|
|
263
286
|
* The HorizontalDivider component is rendered between groups.
|
|
264
287
|
*/
|
|
265
288
|
Divider: ComponentType<OryCardDividerProps>;
|
|
289
|
+
/**
|
|
290
|
+
* The AuthMethodListContainer component is rendered around the "method" chooser step in the identifier_first login flow.
|
|
291
|
+
*
|
|
292
|
+
* This is only used, if login is configured to use identifier_first authentication.
|
|
293
|
+
*/
|
|
294
|
+
AuthMethodListContainer: ComponentType<PropsWithChildren>;
|
|
266
295
|
/**
|
|
267
296
|
* The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow.
|
|
268
297
|
*
|
|
@@ -346,8 +375,9 @@ type DeepPartialTwoLevels<T> = {
|
|
|
346
375
|
type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
|
|
347
376
|
type OryFormProps = PropsWithChildren<{
|
|
348
377
|
onAfterSubmit?: (method: string | number | boolean | undefined) => void;
|
|
378
|
+
"data-testid"?: string;
|
|
349
379
|
}>;
|
|
350
|
-
declare function OryForm({ children, onAfterSubmit }: OryFormProps):
|
|
380
|
+
declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
351
381
|
|
|
352
382
|
declare function useComponents(): OryFlowComponents;
|
|
353
383
|
declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
|
|
@@ -387,6 +417,7 @@ type OryClientConfiguration = {
|
|
|
387
417
|
registration_ui_url: string;
|
|
388
418
|
verification_ui_url: string;
|
|
389
419
|
login_ui_url: string;
|
|
420
|
+
default_redirect_url?: string;
|
|
390
421
|
};
|
|
391
422
|
intl?: IntlConfig;
|
|
392
423
|
};
|
|
@@ -396,7 +427,7 @@ type OryClientConfiguration = {
|
|
|
396
427
|
*
|
|
397
428
|
* @see OryClientConfiguration
|
|
398
429
|
*/
|
|
399
|
-
type OryFlow<TFlowType, TFlow> = {
|
|
430
|
+
type OryFlow<TFlowType extends FlowType, TFlow> = {
|
|
400
431
|
flowType: TFlowType;
|
|
401
432
|
flow: TFlow;
|
|
402
433
|
config: OryClientConfiguration;
|
|
@@ -445,10 +476,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
|
|
|
445
476
|
*
|
|
446
477
|
*/
|
|
447
478
|
type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
|
|
479
|
+
type ConsentFlow = {
|
|
480
|
+
created_at: Date;
|
|
481
|
+
expires_at: Date;
|
|
482
|
+
id: string;
|
|
483
|
+
issued_at: Date;
|
|
484
|
+
state: "show_form" | "rejected" | "accepted";
|
|
485
|
+
active: string;
|
|
486
|
+
ui: UiContainer;
|
|
487
|
+
consent_request: OAuth2ConsentRequest;
|
|
488
|
+
session: Session;
|
|
489
|
+
};
|
|
490
|
+
type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
448
491
|
/**
|
|
449
492
|
* A union type of all flow containers
|
|
450
493
|
*/
|
|
451
|
-
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
|
|
494
|
+
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
|
|
452
495
|
|
|
453
496
|
/**
|
|
454
497
|
* Converts a UiText to a FormattedMessage.
|
|
@@ -576,4 +619,4 @@ type OryProviderProps = {
|
|
|
576
619
|
} & OryFlowContainer & PropsWithChildren;
|
|
577
620
|
declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
578
621
|
|
|
579
|
-
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 };
|
|
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 };
|
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, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
|
|
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';
|
|
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';
|
|
@@ -28,6 +28,9 @@ type OryNodeTextProps = {
|
|
|
28
28
|
node: UiNode;
|
|
29
29
|
};
|
|
30
30
|
type OryCardLogoProps = Record<string, never>;
|
|
31
|
+
type OryNodeCaptchaProps = {
|
|
32
|
+
node: UiNode;
|
|
33
|
+
};
|
|
31
34
|
/**
|
|
32
35
|
* Props for the AuthMethodListItem component. This component is used
|
|
33
36
|
* to render a single auth method in the AuthMethodList component.
|
|
@@ -35,6 +38,10 @@ type OryCardLogoProps = Record<string, never>;
|
|
|
35
38
|
type OryCardAuthMethodListItemProps = {
|
|
36
39
|
onClick: () => void;
|
|
37
40
|
group: string;
|
|
41
|
+
title?: {
|
|
42
|
+
id: string;
|
|
43
|
+
values?: Record<string, string>;
|
|
44
|
+
};
|
|
38
45
|
};
|
|
39
46
|
type OryNodeImageProps = {
|
|
40
47
|
attributes: UiNodeImageAttributes;
|
|
@@ -46,12 +53,18 @@ type OryNodeImageProps = {
|
|
|
46
53
|
type FormValues = Record<string, string | boolean | number | undefined>;
|
|
47
54
|
type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
|
|
48
55
|
onSubmit: FormEventHandler<HTMLFormElement>;
|
|
56
|
+
"data-testid"?: string;
|
|
49
57
|
};
|
|
50
58
|
type OryNodeInputProps = {
|
|
51
59
|
attributes: UiNodeInputAttributes;
|
|
52
60
|
node: UiNode;
|
|
53
61
|
onClick?: MouseEventHandler;
|
|
54
62
|
};
|
|
63
|
+
type OryNodeConsentScopeCheckboxProps = {
|
|
64
|
+
attributes: UiNodeInputAttributes;
|
|
65
|
+
node: UiNode;
|
|
66
|
+
onCheckedChange: (checked: boolean) => void;
|
|
67
|
+
};
|
|
55
68
|
type OryFormSectionContentProps = PropsWithChildren<{
|
|
56
69
|
title?: string;
|
|
57
70
|
description?: string;
|
|
@@ -98,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
|
|
|
98
111
|
|
|
99
112
|
declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
|
|
100
113
|
|
|
114
|
+
declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
101
116
|
/**
|
|
102
117
|
* Props type for the Form Group Divider component.
|
|
103
118
|
*/
|
|
@@ -237,6 +252,14 @@ type OryFlowComponents = {
|
|
|
237
252
|
* The Text component is rendered whenever a "text" node is encountered.
|
|
238
253
|
*/
|
|
239
254
|
Text: ComponentType<OryNodeTextProps>;
|
|
255
|
+
/**
|
|
256
|
+
* The Captcha component is rendered whenever a "captcha" group is encountered.
|
|
257
|
+
*/
|
|
258
|
+
Captcha: ComponentType<OryNodeCaptchaProps>;
|
|
259
|
+
/**
|
|
260
|
+
* Special version of the Input component for scopes in OAuth2 flows.
|
|
261
|
+
*/
|
|
262
|
+
ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
|
|
240
263
|
};
|
|
241
264
|
Card: {
|
|
242
265
|
/**
|
|
@@ -263,6 +286,12 @@ type OryFlowComponents = {
|
|
|
263
286
|
* The HorizontalDivider component is rendered between groups.
|
|
264
287
|
*/
|
|
265
288
|
Divider: ComponentType<OryCardDividerProps>;
|
|
289
|
+
/**
|
|
290
|
+
* The AuthMethodListContainer component is rendered around the "method" chooser step in the identifier_first login flow.
|
|
291
|
+
*
|
|
292
|
+
* This is only used, if login is configured to use identifier_first authentication.
|
|
293
|
+
*/
|
|
294
|
+
AuthMethodListContainer: ComponentType<PropsWithChildren>;
|
|
266
295
|
/**
|
|
267
296
|
* The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow.
|
|
268
297
|
*
|
|
@@ -346,8 +375,9 @@ type DeepPartialTwoLevels<T> = {
|
|
|
346
375
|
type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
|
|
347
376
|
type OryFormProps = PropsWithChildren<{
|
|
348
377
|
onAfterSubmit?: (method: string | number | boolean | undefined) => void;
|
|
378
|
+
"data-testid"?: string;
|
|
349
379
|
}>;
|
|
350
|
-
declare function OryForm({ children, onAfterSubmit }: OryFormProps):
|
|
380
|
+
declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
|
|
351
381
|
|
|
352
382
|
declare function useComponents(): OryFlowComponents;
|
|
353
383
|
declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
|
|
@@ -387,6 +417,7 @@ type OryClientConfiguration = {
|
|
|
387
417
|
registration_ui_url: string;
|
|
388
418
|
verification_ui_url: string;
|
|
389
419
|
login_ui_url: string;
|
|
420
|
+
default_redirect_url?: string;
|
|
390
421
|
};
|
|
391
422
|
intl?: IntlConfig;
|
|
392
423
|
};
|
|
@@ -396,7 +427,7 @@ type OryClientConfiguration = {
|
|
|
396
427
|
*
|
|
397
428
|
* @see OryClientConfiguration
|
|
398
429
|
*/
|
|
399
|
-
type OryFlow<TFlowType, TFlow> = {
|
|
430
|
+
type OryFlow<TFlowType extends FlowType, TFlow> = {
|
|
400
431
|
flowType: TFlowType;
|
|
401
432
|
flow: TFlow;
|
|
402
433
|
config: OryClientConfiguration;
|
|
@@ -445,10 +476,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
|
|
|
445
476
|
*
|
|
446
477
|
*/
|
|
447
478
|
type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
|
|
479
|
+
type ConsentFlow = {
|
|
480
|
+
created_at: Date;
|
|
481
|
+
expires_at: Date;
|
|
482
|
+
id: string;
|
|
483
|
+
issued_at: Date;
|
|
484
|
+
state: "show_form" | "rejected" | "accepted";
|
|
485
|
+
active: string;
|
|
486
|
+
ui: UiContainer;
|
|
487
|
+
consent_request: OAuth2ConsentRequest;
|
|
488
|
+
session: Session;
|
|
489
|
+
};
|
|
490
|
+
type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
|
|
448
491
|
/**
|
|
449
492
|
* A union type of all flow containers
|
|
450
493
|
*/
|
|
451
|
-
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
|
|
494
|
+
type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
|
|
452
495
|
|
|
453
496
|
/**
|
|
454
497
|
* Converts a UiText to a FormattedMessage.
|
|
@@ -576,4 +619,4 @@ type OryProviderProps = {
|
|
|
576
619
|
} & OryFlowContainer & PropsWithChildren;
|
|
577
620
|
declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
|
|
578
621
|
|
|
579
|
-
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 };
|
|
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 };
|