@niledatabase/react 3.0.0-alpha.37 → 3.0.0-alpha.39

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/dist/index.d.mts CHANGED
@@ -1,29 +1,106 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
4
- import { VariantProps } from 'class-variance-authority';
5
- import { CreateBasicUserRequest } from '@niledatabase/browser';
6
3
  import * as _tanstack_react_query from '@tanstack/react-query';
7
4
  import { QueryClient } from '@tanstack/react-query';
8
5
  import * as next_auth_react from 'next-auth/react';
9
- export * from 'next-auth/react';
6
+ import { SignInOptions } from 'next-auth/react';
7
+ export { signIn, signOut } from 'next-auth/react';
8
+ import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
9
+ import { VariantProps } from 'class-variance-authority';
10
+ import { CreateBasicUserRequest } from '@niledatabase/browser';
11
+
12
+ type EmailSignInInfo = SignInOptions;
13
+ type SignInSuccess$1 = (response: Response) => void;
14
+ type AllowedAny$2 = any;
15
+ interface Props$2 {
16
+ redirect?: boolean;
17
+ onSuccess?: SignInSuccess$1;
18
+ onError?: (e: Error, info: EmailSignInInfo) => void;
19
+ beforeMutate?: (data: AllowedAny$2) => AllowedAny$2;
20
+ buttonText?: string;
21
+ client?: QueryClient;
22
+ callbackUrl?: string;
23
+ }
24
+
25
+ declare function EmailSigningIn(props: Props$2): React__default.JSX.Element;
10
26
 
11
27
  declare const buttonVariants: (props?: ({
12
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
28
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
13
29
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
14
30
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
15
31
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
16
32
  asChild?: boolean;
17
33
  }
18
34
 
35
+ type EmailError = void | {
36
+ error: string;
37
+ ok: boolean;
38
+ status: number;
39
+ url: null | string;
40
+ };
41
+ /**
42
+ * This works when the email identity provider is configured in the admin dashboard.
43
+ * @param props callbackUrl: the url to send the user to from their email
44
+ * @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
45
+ * @param props email: the email to send to
46
+ * @param props onSent: called if the email was sent
47
+ * @param props onFailure: called if there was a reportable
48
+ * @returns a JSX.Element to render
49
+ */
50
+ declare const EmailSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
51
+ callbackUrl?: string;
52
+ redirect?: boolean;
53
+ email: string;
54
+ onSent?: () => void;
55
+ onFailure?: (error: EmailError) => void;
56
+ } & React__default.RefAttributes<HTMLButtonElement>>;
57
+
58
+ declare function useSignIn$1(params?: Props$2): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
59
+
19
60
  /**
20
61
  * A component for a Google login button, according to their design language.
21
62
  * This works when an identity provider is configured in the admin dashboard.
22
- * @param props href: a string to override the URL provided by the context
63
+ * @param props callbackUrl: a string to override the URL provided by the context
23
64
  * @returns a JSX.Element to render
24
65
  */
25
66
  declare const GoogleSSOButton: React__default.ForwardRefExoticComponent<ButtonProps & {
26
- callbackUrl: string;
67
+ callbackUrl?: string;
68
+ buttonText?: string;
69
+ } & React__default.RefAttributes<HTMLButtonElement>>;
70
+
71
+ declare const AzureSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
72
+ callbackUrl?: string;
73
+ buttonText?: string;
74
+ } & React__default.RefAttributes<HTMLButtonElement>>;
75
+
76
+ declare const DiscordSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
77
+ callbackUrl?: string;
78
+ buttonText?: string;
79
+ } & React__default.RefAttributes<HTMLButtonElement>>;
80
+
81
+ declare const GitHubSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
82
+ callbackUrl?: string;
83
+ buttonText?: string;
84
+ } & React__default.RefAttributes<HTMLButtonElement>>;
85
+
86
+ declare const HubSpotSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
87
+ callbackUrl?: string;
88
+ buttonText?: string;
89
+ } & React__default.RefAttributes<HTMLButtonElement>>;
90
+
91
+ declare const LinkedInSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
92
+ callbackUrl?: string;
93
+ buttonText?: string;
94
+ } & React__default.RefAttributes<HTMLButtonElement>>;
95
+
96
+ declare const SlackSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
97
+ callbackUrl?: string;
98
+ buttonText?: string;
99
+ } & React__default.RefAttributes<HTMLButtonElement>>;
100
+
101
+ declare const XSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
102
+ callbackUrl?: string;
103
+ buttonText?: string;
27
104
  } & React__default.RefAttributes<HTMLButtonElement>>;
28
105
 
29
106
  type SignUpInfo = CreateBasicUserRequest & {
@@ -35,7 +112,7 @@ type SignUpInfo = CreateBasicUserRequest & {
35
112
  type SignInSuccess = (response: Response, formValues: SignUpInfo) => void;
36
113
  type AllowedAny$1 = any;
37
114
  interface Props$1 {
38
- onSuccess: SignInSuccess;
115
+ onSuccess?: SignInSuccess;
39
116
  onError?: (e: Error, info: SignUpInfo) => void;
40
117
  beforeMutate?: (data: AllowedAny$1) => AllowedAny$1;
41
118
  buttonText?: string;
@@ -68,4 +145,4 @@ declare function useSignIn(params?: Props): _tanstack_react_query.UseMutateFunct
68
145
  declare const Email: () => React.JSX.Element;
69
146
  declare const Password: () => React.JSX.Element;
70
147
 
71
- export { Email, GoogleSSOButton as Google, Password, SigningIn as SignInForm, SigningUp as SignUpForm, useSignIn, useSignUp };
148
+ export { AzureSignInButton as Azure, DiscordSignInButton as Discord, Email, EmailSigningIn as EmailSignIn, EmailSignInButton, GitHubSignInButton as GitHub, GoogleSSOButton as Google, HubSpotSignInButton as HubSpot, LinkedInSignInButton as LinkedIn, Password, SigningIn as SignInForm, SigningUp as SignUpForm, SlackSignInButton as Slack, XSignInButton as X, useSignIn$1 as useEmailSignIn, useSignIn, useSignUp };
package/dist/index.d.ts CHANGED
@@ -1,29 +1,106 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
4
- import { VariantProps } from 'class-variance-authority';
5
- import { CreateBasicUserRequest } from '@niledatabase/browser';
6
3
  import * as _tanstack_react_query from '@tanstack/react-query';
7
4
  import { QueryClient } from '@tanstack/react-query';
8
5
  import * as next_auth_react from 'next-auth/react';
9
- export * from 'next-auth/react';
6
+ import { SignInOptions } from 'next-auth/react';
7
+ export { signIn, signOut } from 'next-auth/react';
8
+ import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
9
+ import { VariantProps } from 'class-variance-authority';
10
+ import { CreateBasicUserRequest } from '@niledatabase/browser';
11
+
12
+ type EmailSignInInfo = SignInOptions;
13
+ type SignInSuccess$1 = (response: Response) => void;
14
+ type AllowedAny$2 = any;
15
+ interface Props$2 {
16
+ redirect?: boolean;
17
+ onSuccess?: SignInSuccess$1;
18
+ onError?: (e: Error, info: EmailSignInInfo) => void;
19
+ beforeMutate?: (data: AllowedAny$2) => AllowedAny$2;
20
+ buttonText?: string;
21
+ client?: QueryClient;
22
+ callbackUrl?: string;
23
+ }
24
+
25
+ declare function EmailSigningIn(props: Props$2): React__default.JSX.Element;
10
26
 
11
27
  declare const buttonVariants: (props?: ({
12
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
28
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
13
29
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
14
30
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
15
31
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
16
32
  asChild?: boolean;
17
33
  }
18
34
 
35
+ type EmailError = void | {
36
+ error: string;
37
+ ok: boolean;
38
+ status: number;
39
+ url: null | string;
40
+ };
41
+ /**
42
+ * This works when the email identity provider is configured in the admin dashboard.
43
+ * @param props callbackUrl: the url to send the user to from their email
44
+ * @param props redirect: redirect to the default (unbranded) 'check your email' page. default is false
45
+ * @param props email: the email to send to
46
+ * @param props onSent: called if the email was sent
47
+ * @param props onFailure: called if there was a reportable
48
+ * @returns a JSX.Element to render
49
+ */
50
+ declare const EmailSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
51
+ callbackUrl?: string;
52
+ redirect?: boolean;
53
+ email: string;
54
+ onSent?: () => void;
55
+ onFailure?: (error: EmailError) => void;
56
+ } & React__default.RefAttributes<HTMLButtonElement>>;
57
+
58
+ declare function useSignIn$1(params?: Props$2): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
59
+
19
60
  /**
20
61
  * A component for a Google login button, according to their design language.
21
62
  * This works when an identity provider is configured in the admin dashboard.
22
- * @param props href: a string to override the URL provided by the context
63
+ * @param props callbackUrl: a string to override the URL provided by the context
23
64
  * @returns a JSX.Element to render
24
65
  */
25
66
  declare const GoogleSSOButton: React__default.ForwardRefExoticComponent<ButtonProps & {
26
- callbackUrl: string;
67
+ callbackUrl?: string;
68
+ buttonText?: string;
69
+ } & React__default.RefAttributes<HTMLButtonElement>>;
70
+
71
+ declare const AzureSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
72
+ callbackUrl?: string;
73
+ buttonText?: string;
74
+ } & React__default.RefAttributes<HTMLButtonElement>>;
75
+
76
+ declare const DiscordSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
77
+ callbackUrl?: string;
78
+ buttonText?: string;
79
+ } & React__default.RefAttributes<HTMLButtonElement>>;
80
+
81
+ declare const GitHubSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
82
+ callbackUrl?: string;
83
+ buttonText?: string;
84
+ } & React__default.RefAttributes<HTMLButtonElement>>;
85
+
86
+ declare const HubSpotSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
87
+ callbackUrl?: string;
88
+ buttonText?: string;
89
+ } & React__default.RefAttributes<HTMLButtonElement>>;
90
+
91
+ declare const LinkedInSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
92
+ callbackUrl?: string;
93
+ buttonText?: string;
94
+ } & React__default.RefAttributes<HTMLButtonElement>>;
95
+
96
+ declare const SlackSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
97
+ callbackUrl?: string;
98
+ buttonText?: string;
99
+ } & React__default.RefAttributes<HTMLButtonElement>>;
100
+
101
+ declare const XSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
102
+ callbackUrl?: string;
103
+ buttonText?: string;
27
104
  } & React__default.RefAttributes<HTMLButtonElement>>;
28
105
 
29
106
  type SignUpInfo = CreateBasicUserRequest & {
@@ -35,7 +112,7 @@ type SignUpInfo = CreateBasicUserRequest & {
35
112
  type SignInSuccess = (response: Response, formValues: SignUpInfo) => void;
36
113
  type AllowedAny$1 = any;
37
114
  interface Props$1 {
38
- onSuccess: SignInSuccess;
115
+ onSuccess?: SignInSuccess;
39
116
  onError?: (e: Error, info: SignUpInfo) => void;
40
117
  beforeMutate?: (data: AllowedAny$1) => AllowedAny$1;
41
118
  buttonText?: string;
@@ -68,4 +145,4 @@ declare function useSignIn(params?: Props): _tanstack_react_query.UseMutateFunct
68
145
  declare const Email: () => React.JSX.Element;
69
146
  declare const Password: () => React.JSX.Element;
70
147
 
71
- export { Email, GoogleSSOButton as Google, Password, SigningIn as SignInForm, SigningUp as SignUpForm, useSignIn, useSignUp };
148
+ export { AzureSignInButton as Azure, DiscordSignInButton as Discord, Email, EmailSigningIn as EmailSignIn, EmailSignInButton, GitHubSignInButton as GitHub, GoogleSSOButton as Google, HubSpotSignInButton as HubSpot, LinkedInSignInButton as LinkedIn, Password, SigningIn as SignInForm, SigningUp as SignUpForm, SlackSignInButton as Slack, XSignInButton as X, useSignIn$1 as useEmailSignIn, useSignIn, useSignUp };