@leancodepl/kratos 8.3.5 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leancodepl/kratos",
3
- "version": "8.3.5",
3
+ "version": "8.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
6
  "@ory/client": ">=1.14.3",
@@ -9,11 +9,9 @@
9
9
  "rxjs": ">=7.0.0",
10
10
  "yn": ">=5.0.0"
11
11
  },
12
- "devDependencies": {
13
- "react": "18.3.1"
14
- },
15
12
  "peerDependencies": {
16
- "react": "*"
13
+ "react": "*",
14
+ "react-dom": "*"
17
15
  },
18
16
  "exports": {
19
17
  "./package.json": "./package.json",
@@ -1,20 +1,20 @@
1
1
  import { LoginFlow, RecoveryFlow, RegistrationFlow, UpdateLoginFlowBody, UpdateRecoveryFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, VerificationFlow } from "@ory/client";
2
2
  import { UserAuthFormAdditionalProps } from "../helpers/userAuthForm";
3
- type UserAuthCardProps<TBody> = {
3
+ type UserAuthCardProps<TBody> = UserAuthFormAdditionalProps<TBody> & {
4
4
  className?: string;
5
5
  flow: LoginFlow | RecoveryFlow | RegistrationFlow | VerificationFlow;
6
6
  flowType: "login" | "recovery" | "registration" | "verification";
7
- } & UserAuthFormAdditionalProps<TBody>;
8
- export declare const LoginCard: ({ ...props }: {
7
+ };
8
+ export declare const LoginCard: ({ ...props }: Omit<UserAuthCardProps<UpdateLoginFlowBody>, "flow" | "flowType"> & {
9
9
  flow: LoginFlow;
10
- } & Omit<UserAuthCardProps<UpdateLoginFlowBody>, "flow" | "flowType">) => import("react/jsx-runtime").JSX.Element;
11
- export declare const VerificationCard: ({ ...props }: {
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const VerificationCard: ({ ...props }: Omit<UserAuthCardProps<UpdateVerificationFlowBody>, "flow" | "flowType"> & {
12
12
  flow: VerificationFlow;
13
- } & Omit<UserAuthCardProps<UpdateVerificationFlowBody>, "flow" | "flowType">) => import("react/jsx-runtime").JSX.Element;
14
- export declare const RegistrationCard: ({ ...props }: {
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const RegistrationCard: ({ ...props }: Omit<UserAuthCardProps<UpdateRegistrationFlowBody>, "flow" | "flowType"> & {
15
15
  flow: RegistrationFlow;
16
- } & Omit<UserAuthCardProps<UpdateRegistrationFlowBody>, "flow" | "flowType">) => import("react/jsx-runtime").JSX.Element;
17
- export declare const RecoveryCard: ({ ...props }: {
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const RecoveryCard: ({ ...props }: Omit<UserAuthCardProps<UpdateRecoveryFlowBody>, "flow" | "flowType"> & {
18
18
  flow: RecoveryFlow;
19
- } & Omit<UserAuthCardProps<UpdateRecoveryFlowBody>, "flow" | "flowType">) => import("react/jsx-runtime").JSX.Element;
19
+ }) => import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -2,9 +2,9 @@ import { JSX } from "react";
2
2
  import { SettingsFlow, UiNodeGroupEnum, UpdateSettingsFlowBody } from "@ory/client";
3
3
  import { UserAuthFormAdditionalProps } from "../helpers/userAuthForm";
4
4
  export type UserSettingsFlowType = typeof UiNodeGroupEnum.LookupSecret | typeof UiNodeGroupEnum.Oidc | typeof UiNodeGroupEnum.Passkey | typeof UiNodeGroupEnum.Password | typeof UiNodeGroupEnum.Profile | typeof UiNodeGroupEnum.Totp;
5
- export type UserSettingsCardProps = {
5
+ export type UserSettingsCardProps = UserAuthFormAdditionalProps<UpdateSettingsFlowBody> & {
6
6
  flow: SettingsFlow;
7
7
  flowType: UserSettingsFlowType;
8
8
  className?: string;
9
- } & UserAuthFormAdditionalProps<UpdateSettingsFlowBody>;
9
+ };
10
10
  export declare function UserSettingsCard({ flow, flowType, onSubmit, className }: UserSettingsCardProps): JSX.Element | null;
@@ -14,13 +14,13 @@ export type UserAuthFormAdditionalProps<TBody> = {
14
14
  event?: React.FormEvent<HTMLFormElement>;
15
15
  }) => void;
16
16
  };
17
- export type UserAuthFormProps<TBody> = {
17
+ export type UserAuthFormProps<TBody> = Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & UserAuthFormAdditionalProps<TBody> & {
18
18
  flow: SelfServiceFlow;
19
19
  children: ReactNode;
20
20
  formFilterOverride?: FilterNodesByGroups;
21
21
  submitOnEnter?: boolean;
22
22
  className?: string;
23
- } & Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & UserAuthFormAdditionalProps<TBody>;
23
+ };
24
24
  /**
25
25
  * UserAuthForm is a component that renders a form for a given Ory flow.
26
26
  * It automatically adds the form action and method and adds csrf tokens to the form.
@@ -6,6 +6,6 @@ export type KratosContextData = {
6
6
  excludeScripts: boolean;
7
7
  };
8
8
  export declare const kratosContext: import("react").Context<KratosContextData>;
9
- export declare function useKratosContext(): {
9
+ export declare function useKratosContext(): KratosContextData & {
10
10
  components: KratosComponents;
11
- } & KratosContextData;
11
+ };
@@ -3,27 +3,27 @@ import { UiNode, UiNodeTextAttributes, UiText, UiTextTypeEnum } from "@ory/clien
3
3
  type Node = {
4
4
  node: UiNode;
5
5
  };
6
- export type ImageComponentProps = {
6
+ export type ImageComponentProps = Node & React.ImgHTMLAttributes<HTMLImageElement> & {
7
7
  header?: ReactNode;
8
8
  className?: string;
9
- } & Node & React.ImgHTMLAttributes<HTMLImageElement>;
10
- export type TextComponentProps = {
9
+ };
10
+ export type TextComponentProps = Node & {
11
11
  label?: ReactNode;
12
12
  id: string;
13
13
  codes?: UiText[];
14
14
  attributes: UiNodeTextAttributes;
15
- } & Node;
16
- export type LinkComponentProps = {
15
+ };
16
+ export type LinkComponentProps = Node & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
17
17
  children?: ReactNode;
18
18
  href?: string;
19
19
  icon?: string;
20
20
  className?: string;
21
- } & Node & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">;
22
- export type InputComponentProps = {
21
+ };
22
+ export type InputComponentProps = Node & React.InputHTMLAttributes<HTMLInputElement> & {
23
23
  header: ReactNode;
24
24
  helperMessage?: ReactNode;
25
25
  isError?: boolean;
26
- } & Node & React.InputHTMLAttributes<HTMLInputElement>;
26
+ };
27
27
  export type MessageComponentProps = {
28
28
  message: UiText;
29
29
  key: string;
@@ -31,16 +31,16 @@ export type MessageComponentProps = {
31
31
  children?: ReactNode;
32
32
  };
33
33
  export type Severity = "default" | "disabled" | UiTextTypeEnum;
34
- export type ButtonComponentProps = {
34
+ export type ButtonComponentProps = Node & React.ButtonHTMLAttributes<HTMLButtonElement> & {
35
35
  header?: ReactNode;
36
36
  fullWidth?: boolean;
37
37
  social?: string;
38
- } & Node & React.ButtonHTMLAttributes<HTMLButtonElement>;
39
- export type CheckboxComponentProps = {
38
+ };
39
+ export type CheckboxComponentProps = Node & React.InputHTMLAttributes<HTMLInputElement> & {
40
40
  label?: ReactNode;
41
41
  helperMessage?: ReactNode;
42
42
  isError?: boolean;
43
- } & Node & React.InputHTMLAttributes<HTMLInputElement>;
43
+ };
44
44
  export type MessageFormatComponentProps = {
45
45
  id: number;
46
46
  text: string;
@@ -1,24 +1,24 @@
1
1
  import { UiNodeAnchorAttributes, UiNodeAttributes, UiNodeImageAttributes, UiNodeInputAttributes, UiNodeScriptAttributes, UiNodeTextAttributes, UiText } from "@ory/client";
2
- export declare function isUiNodeAnchorAttributes(attrs: UiNodeAttributes): attrs is {
2
+ export declare function isUiNodeAnchorAttributes(attrs: UiNodeAttributes): attrs is UiNodeAnchorAttributes & {
3
3
  node_type: "a";
4
- } & UiNodeAnchorAttributes;
5
- export declare function isUiNodeImageAttributes(attrs: UiNodeAttributes): attrs is {
4
+ };
5
+ export declare function isUiNodeImageAttributes(attrs: UiNodeAttributes): attrs is UiNodeImageAttributes & {
6
6
  node_type: "img";
7
- } & UiNodeImageAttributes;
8
- export declare function isUiNodeInputAttributes(attrs: UiNodeAttributes): attrs is {
7
+ };
8
+ export declare function isUiNodeInputAttributes(attrs: UiNodeAttributes): attrs is UiNodeInputAttributes & {
9
9
  node_type: "input";
10
- } & UiNodeInputAttributes;
11
- export declare function isUiNodeTextAttributes(attrs: UiNodeAttributes): attrs is {
10
+ };
11
+ export declare function isUiNodeTextAttributes(attrs: UiNodeAttributes): attrs is UiNodeTextAttributes & {
12
12
  node_type: "text";
13
- } & UiNodeTextAttributes;
14
- export declare function isUiNodeScriptAttributes(attrs: UiNodeAttributes): attrs is {
13
+ };
14
+ export declare function isUiNodeScriptAttributes(attrs: UiNodeAttributes): attrs is UiNodeScriptAttributes & {
15
15
  node_type: "script";
16
- } & UiNodeScriptAttributes;
17
- export type UiNodeTextSecretsAttributes = {
18
- text: {
16
+ };
17
+ export type UiNodeTextSecretsAttributes = Omit<UiNodeTextAttributes, "text"> & {
18
+ text: Omit<UiText, "context"> & {
19
19
  context: {
20
20
  secrets: UiText[];
21
21
  };
22
- } & Omit<UiText, "context">;
23
- } & Omit<UiNodeTextAttributes, "text">;
22
+ };
23
+ };
24
24
  export declare function isUiNodeTextSecretsAttributes(attributes: UiNodeTextAttributes): attributes is UiNodeTextSecretsAttributes;