@niledatabase/react 4.0.0-alpha.5 → 4.0.0-alpha.7

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
@@ -13,7 +13,7 @@ import { BuiltInProviderType, RedirectableProviderType } from 'next-auth/provide
13
13
  type EmailSignInInfo = SignInOptions;
14
14
  type SignInSuccess = (response: Response) => void;
15
15
  type AllowedAny$3 = any;
16
- type Props$4 = {
16
+ type Props$5 = {
17
17
  redirect?: boolean;
18
18
  onSuccess?: SignInSuccess;
19
19
  onError?: (e: Error, info: EmailSignInInfo) => void;
@@ -24,7 +24,7 @@ type Props$4 = {
24
24
  init?: RequestInit;
25
25
  };
26
26
 
27
- declare function EmailSigningIn(props: Props$4): React__default.JSX.Element;
27
+ declare function EmailSigningIn(props: Props$5): React__default.JSX.Element;
28
28
 
29
29
  declare const buttonVariants: (props?: ({
30
30
  variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
@@ -41,6 +41,14 @@ type EmailError = void | {
41
41
  status: number;
42
42
  url: null | string;
43
43
  };
44
+ type AllProps = ButtonProps & {
45
+ callbackUrl?: string;
46
+ redirect?: boolean;
47
+ email: string;
48
+ onSent?: () => void;
49
+ onFailure?: (error: EmailError) => void;
50
+ buttonText?: string;
51
+ };
44
52
  /**
45
53
  * This works when the email identity provider is configured in the admin dashboard.
46
54
  * @param props callbackUrl: the url to send the user to from their email
@@ -50,16 +58,12 @@ type EmailError = void | {
50
58
  * @param props onFailure: called if there was a reportable
51
59
  * @returns a JSX.Element to render
52
60
  */
53
- declare const EmailSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
54
- callbackUrl?: string;
55
- redirect?: boolean;
56
- email: string;
57
- onSent?: () => void;
58
- onFailure?: (error: EmailError) => void;
59
- buttonText?: string;
60
- } & React__default.RefAttributes<HTMLButtonElement>>;
61
+ declare const EmailSignInButton: {
62
+ ({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, ...props }: AllProps): React__default.JSX.Element;
63
+ displayName: string;
64
+ };
61
65
 
62
- declare function useEmailSignIn(params?: Props$4): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
66
+ declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
63
67
 
64
68
  /**
65
69
  * A component for a Google login button, according to their design language.
@@ -67,53 +71,77 @@ declare function useEmailSignIn(params?: Props$4): _tanstack_react_query.UseMuta
67
71
  * @param props callbackUrl: a string to override the URL provided by the context
68
72
  * @returns a JSX.Element to render
69
73
  */
70
- declare const GoogleSSOButton: React__default.ForwardRefExoticComponent<ButtonProps & {
71
- callbackUrl?: string;
72
- buttonText?: string;
73
- init?: RequestInit;
74
- } & React__default.RefAttributes<HTMLButtonElement>>;
74
+ declare const GoogleSSOButton: {
75
+ ({ callbackUrl, className, variant, size, buttonText, asChild, init, ...props }: ButtonProps & {
76
+ callbackUrl?: string;
77
+ buttonText?: string;
78
+ init?: RequestInit;
79
+ }): React__default.JSX.Element;
80
+ displayName: string;
81
+ };
75
82
 
76
- declare const AzureSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
77
- callbackUrl?: string;
78
- buttonText?: string;
79
- init?: RequestInit;
80
- } & React__default.RefAttributes<HTMLButtonElement>>;
83
+ declare const AzureSignInButton: {
84
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
85
+ callbackUrl?: string;
86
+ buttonText?: string;
87
+ init?: RequestInit;
88
+ }): React__default.JSX.Element;
89
+ displayName: string;
90
+ };
81
91
 
82
- declare const DiscordSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
83
- callbackUrl?: string;
84
- buttonText?: string;
85
- init?: RequestInit;
86
- } & React__default.RefAttributes<HTMLButtonElement>>;
92
+ declare const DiscordSignInButton: {
93
+ ({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
94
+ callbackUrl?: string;
95
+ buttonText?: string;
96
+ init?: RequestInit;
97
+ }): React__default.JSX.Element;
98
+ displayName: string;
99
+ };
87
100
 
88
- declare const GitHubSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
89
- callbackUrl?: string;
90
- buttonText?: string;
91
- init?: RequestInit;
92
- } & React__default.RefAttributes<HTMLButtonElement>>;
101
+ declare const GitHubSignInButton: {
102
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
103
+ callbackUrl?: string;
104
+ buttonText?: string;
105
+ init?: RequestInit;
106
+ }): React__default.JSX.Element;
107
+ displayName: string;
108
+ };
93
109
 
94
- declare const HubSpotSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
95
- callbackUrl?: string;
96
- buttonText?: string;
97
- init?: RequestInit;
98
- } & React__default.RefAttributes<HTMLButtonElement>>;
110
+ declare const HubSpotSignInButton: {
111
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
112
+ callbackUrl?: string;
113
+ buttonText?: string;
114
+ init?: RequestInit;
115
+ }): React__default.JSX.Element;
116
+ displayName: string;
117
+ };
99
118
 
100
- declare const LinkedInSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
101
- callbackUrl?: string;
102
- buttonText?: string;
103
- init?: RequestInit;
104
- } & React__default.RefAttributes<HTMLButtonElement>>;
119
+ declare const LinkedInSignInButton: {
120
+ ({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
121
+ callbackUrl?: string;
122
+ buttonText?: string;
123
+ init?: RequestInit;
124
+ }): React__default.JSX.Element;
125
+ displayName: string;
126
+ };
105
127
 
106
- declare const SlackSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
107
- callbackUrl?: string;
108
- buttonText?: string;
109
- init?: ResponseInit;
110
- } & React__default.RefAttributes<HTMLButtonElement>>;
128
+ declare const SlackSignInButton: {
129
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
130
+ callbackUrl?: string;
131
+ buttonText?: string;
132
+ init?: RequestInit;
133
+ }): React__default.JSX.Element;
134
+ displayName: string;
135
+ };
111
136
 
112
- declare const XSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
113
- callbackUrl?: string;
114
- buttonText?: string;
115
- init?: RequestInit;
116
- } & React__default.RefAttributes<HTMLButtonElement>>;
137
+ declare const XSignInButton: {
138
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
139
+ callbackUrl?: string;
140
+ buttonText?: string;
141
+ init?: RequestInit;
142
+ }): React__default.JSX.Element;
143
+ displayName: string;
144
+ };
117
145
 
118
146
  type JWT = {
119
147
  email: string;
@@ -291,7 +319,7 @@ type SignUpInfo = CreateBasicUserRequest & {
291
319
  newTenantName?: string;
292
320
  };
293
321
  type AllowedAny$2 = any;
294
- type Props$3 = PrefetchParams & {
322
+ type Props$4 = PrefetchParams & {
295
323
  onSuccess?: (response: Response, formValues: SignUpInfo) => void;
296
324
  onError?: (e: Error, info: SignUpInfo) => void;
297
325
  beforeMutate?: (data: AllowedAny$2) => AllowedAny$2;
@@ -302,9 +330,9 @@ type Props$3 = PrefetchParams & {
302
330
  redirect?: boolean;
303
331
  };
304
332
 
305
- declare function SigningUp({ className, ...props }: Props$3): React__default.JSX.Element;
333
+ declare function SigningUp({ className, ...props }: Props$4): React__default.JSX.Element;
306
334
 
307
- declare function useSignUp<T extends SignUpInfo>(params: Props$3, client?: QueryClient): _tanstack_react_query.UseMutateFunction<any, Error, SignUpInfo, unknown>;
335
+ declare function useSignUp<T extends SignUpInfo>(params: Props$4, client?: QueryClient): _tanstack_react_query.UseMutateFunction<any, Error, SignUpInfo, unknown>;
308
336
 
309
337
  type AllowedAny$1 = any;
310
338
  type LoginInfo = {
@@ -312,7 +340,7 @@ type LoginInfo = {
312
340
  password: string;
313
341
  };
314
342
  type LoginSuccess = (response: AllowedAny$1, formValues: LoginInfo, ...args: AllowedAny$1) => void;
315
- type Props$2 = ComponentFetchProps & {
343
+ type Props$3 = ComponentFetchProps & {
316
344
  beforeMutate?: (data: AllowedAny$1) => AllowedAny$1;
317
345
  onSuccess?: LoginSuccess;
318
346
  onError?: (error: Error, data: AllowedAny$1) => void;
@@ -323,18 +351,22 @@ type Props$2 = ComponentFetchProps & {
323
351
  fetchUrl?: string;
324
352
  };
325
353
 
326
- declare function SigningIn({ className, ...props }: Props$2): React__default.JSX.Element;
354
+ declare function SigningIn({ className, ...props }: Props$3): React__default.JSX.Element;
327
355
 
328
- declare function useSignIn(params?: Props$2): _tanstack_react_query.UseMutateFunction<next_auth_react.SignInResponse | undefined, Error, LoginInfo, any>;
356
+ declare function useSignIn(params?: Props$3): _tanstack_react_query.UseMutateFunction<next_auth_react.SignInResponse | undefined, Error, LoginInfo, any>;
329
357
 
330
- declare const SignOutButton: React__default.ForwardRefExoticComponent<ButtonProps & ComponentFetchProps & {
358
+ type Props$2 = ButtonProps & ComponentFetchProps & {
331
359
  redirect?: boolean;
332
360
  callbackUrl?: string;
333
361
  buttonText?: string;
334
362
  baseUrl?: string;
335
363
  fetchUrl?: string;
336
364
  basePath?: string;
337
- } & React__default.RefAttributes<HTMLButtonElement>>;
365
+ };
366
+ declare const SignOutButton: {
367
+ ({ callbackUrl, redirect, className, buttonText, variant, size, baseUrl, fetchUrl, basePath, auth, asChild, ...props }: Props$2): React__default.JSX.Element;
368
+ displayName: string;
369
+ };
338
370
 
339
371
  interface SessionProviderProps {
340
372
  children: React__default.ReactNode;
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ import { BuiltInProviderType, RedirectableProviderType } from 'next-auth/provide
13
13
  type EmailSignInInfo = SignInOptions;
14
14
  type SignInSuccess = (response: Response) => void;
15
15
  type AllowedAny$3 = any;
16
- type Props$4 = {
16
+ type Props$5 = {
17
17
  redirect?: boolean;
18
18
  onSuccess?: SignInSuccess;
19
19
  onError?: (e: Error, info: EmailSignInInfo) => void;
@@ -24,7 +24,7 @@ type Props$4 = {
24
24
  init?: RequestInit;
25
25
  };
26
26
 
27
- declare function EmailSigningIn(props: Props$4): React__default.JSX.Element;
27
+ declare function EmailSigningIn(props: Props$5): React__default.JSX.Element;
28
28
 
29
29
  declare const buttonVariants: (props?: ({
30
30
  variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
@@ -41,6 +41,14 @@ type EmailError = void | {
41
41
  status: number;
42
42
  url: null | string;
43
43
  };
44
+ type AllProps = ButtonProps & {
45
+ callbackUrl?: string;
46
+ redirect?: boolean;
47
+ email: string;
48
+ onSent?: () => void;
49
+ onFailure?: (error: EmailError) => void;
50
+ buttonText?: string;
51
+ };
44
52
  /**
45
53
  * This works when the email identity provider is configured in the admin dashboard.
46
54
  * @param props callbackUrl: the url to send the user to from their email
@@ -50,16 +58,12 @@ type EmailError = void | {
50
58
  * @param props onFailure: called if there was a reportable
51
59
  * @returns a JSX.Element to render
52
60
  */
53
- declare const EmailSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
54
- callbackUrl?: string;
55
- redirect?: boolean;
56
- email: string;
57
- onSent?: () => void;
58
- onFailure?: (error: EmailError) => void;
59
- buttonText?: string;
60
- } & React__default.RefAttributes<HTMLButtonElement>>;
61
+ declare const EmailSignInButton: {
62
+ ({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, ...props }: AllProps): React__default.JSX.Element;
63
+ displayName: string;
64
+ };
61
65
 
62
- declare function useEmailSignIn(params?: Props$4): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
66
+ declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
63
67
 
64
68
  /**
65
69
  * A component for a Google login button, according to their design language.
@@ -67,53 +71,77 @@ declare function useEmailSignIn(params?: Props$4): _tanstack_react_query.UseMuta
67
71
  * @param props callbackUrl: a string to override the URL provided by the context
68
72
  * @returns a JSX.Element to render
69
73
  */
70
- declare const GoogleSSOButton: React__default.ForwardRefExoticComponent<ButtonProps & {
71
- callbackUrl?: string;
72
- buttonText?: string;
73
- init?: RequestInit;
74
- } & React__default.RefAttributes<HTMLButtonElement>>;
74
+ declare const GoogleSSOButton: {
75
+ ({ callbackUrl, className, variant, size, buttonText, asChild, init, ...props }: ButtonProps & {
76
+ callbackUrl?: string;
77
+ buttonText?: string;
78
+ init?: RequestInit;
79
+ }): React__default.JSX.Element;
80
+ displayName: string;
81
+ };
75
82
 
76
- declare const AzureSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
77
- callbackUrl?: string;
78
- buttonText?: string;
79
- init?: RequestInit;
80
- } & React__default.RefAttributes<HTMLButtonElement>>;
83
+ declare const AzureSignInButton: {
84
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
85
+ callbackUrl?: string;
86
+ buttonText?: string;
87
+ init?: RequestInit;
88
+ }): React__default.JSX.Element;
89
+ displayName: string;
90
+ };
81
91
 
82
- declare const DiscordSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
83
- callbackUrl?: string;
84
- buttonText?: string;
85
- init?: RequestInit;
86
- } & React__default.RefAttributes<HTMLButtonElement>>;
92
+ declare const DiscordSignInButton: {
93
+ ({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
94
+ callbackUrl?: string;
95
+ buttonText?: string;
96
+ init?: RequestInit;
97
+ }): React__default.JSX.Element;
98
+ displayName: string;
99
+ };
87
100
 
88
- declare const GitHubSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
89
- callbackUrl?: string;
90
- buttonText?: string;
91
- init?: RequestInit;
92
- } & React__default.RefAttributes<HTMLButtonElement>>;
101
+ declare const GitHubSignInButton: {
102
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
103
+ callbackUrl?: string;
104
+ buttonText?: string;
105
+ init?: RequestInit;
106
+ }): React__default.JSX.Element;
107
+ displayName: string;
108
+ };
93
109
 
94
- declare const HubSpotSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
95
- callbackUrl?: string;
96
- buttonText?: string;
97
- init?: RequestInit;
98
- } & React__default.RefAttributes<HTMLButtonElement>>;
110
+ declare const HubSpotSignInButton: {
111
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
112
+ callbackUrl?: string;
113
+ buttonText?: string;
114
+ init?: RequestInit;
115
+ }): React__default.JSX.Element;
116
+ displayName: string;
117
+ };
99
118
 
100
- declare const LinkedInSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
101
- callbackUrl?: string;
102
- buttonText?: string;
103
- init?: RequestInit;
104
- } & React__default.RefAttributes<HTMLButtonElement>>;
119
+ declare const LinkedInSignInButton: {
120
+ ({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
121
+ callbackUrl?: string;
122
+ buttonText?: string;
123
+ init?: RequestInit;
124
+ }): React__default.JSX.Element;
125
+ displayName: string;
126
+ };
105
127
 
106
- declare const SlackSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
107
- callbackUrl?: string;
108
- buttonText?: string;
109
- init?: ResponseInit;
110
- } & React__default.RefAttributes<HTMLButtonElement>>;
128
+ declare const SlackSignInButton: {
129
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
130
+ callbackUrl?: string;
131
+ buttonText?: string;
132
+ init?: RequestInit;
133
+ }): React__default.JSX.Element;
134
+ displayName: string;
135
+ };
111
136
 
112
- declare const XSignInButton: React__default.ForwardRefExoticComponent<ButtonProps & {
113
- callbackUrl?: string;
114
- buttonText?: string;
115
- init?: RequestInit;
116
- } & React__default.RefAttributes<HTMLButtonElement>>;
137
+ declare const XSignInButton: {
138
+ ({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
139
+ callbackUrl?: string;
140
+ buttonText?: string;
141
+ init?: RequestInit;
142
+ }): React__default.JSX.Element;
143
+ displayName: string;
144
+ };
117
145
 
118
146
  type JWT = {
119
147
  email: string;
@@ -291,7 +319,7 @@ type SignUpInfo = CreateBasicUserRequest & {
291
319
  newTenantName?: string;
292
320
  };
293
321
  type AllowedAny$2 = any;
294
- type Props$3 = PrefetchParams & {
322
+ type Props$4 = PrefetchParams & {
295
323
  onSuccess?: (response: Response, formValues: SignUpInfo) => void;
296
324
  onError?: (e: Error, info: SignUpInfo) => void;
297
325
  beforeMutate?: (data: AllowedAny$2) => AllowedAny$2;
@@ -302,9 +330,9 @@ type Props$3 = PrefetchParams & {
302
330
  redirect?: boolean;
303
331
  };
304
332
 
305
- declare function SigningUp({ className, ...props }: Props$3): React__default.JSX.Element;
333
+ declare function SigningUp({ className, ...props }: Props$4): React__default.JSX.Element;
306
334
 
307
- declare function useSignUp<T extends SignUpInfo>(params: Props$3, client?: QueryClient): _tanstack_react_query.UseMutateFunction<any, Error, SignUpInfo, unknown>;
335
+ declare function useSignUp<T extends SignUpInfo>(params: Props$4, client?: QueryClient): _tanstack_react_query.UseMutateFunction<any, Error, SignUpInfo, unknown>;
308
336
 
309
337
  type AllowedAny$1 = any;
310
338
  type LoginInfo = {
@@ -312,7 +340,7 @@ type LoginInfo = {
312
340
  password: string;
313
341
  };
314
342
  type LoginSuccess = (response: AllowedAny$1, formValues: LoginInfo, ...args: AllowedAny$1) => void;
315
- type Props$2 = ComponentFetchProps & {
343
+ type Props$3 = ComponentFetchProps & {
316
344
  beforeMutate?: (data: AllowedAny$1) => AllowedAny$1;
317
345
  onSuccess?: LoginSuccess;
318
346
  onError?: (error: Error, data: AllowedAny$1) => void;
@@ -323,18 +351,22 @@ type Props$2 = ComponentFetchProps & {
323
351
  fetchUrl?: string;
324
352
  };
325
353
 
326
- declare function SigningIn({ className, ...props }: Props$2): React__default.JSX.Element;
354
+ declare function SigningIn({ className, ...props }: Props$3): React__default.JSX.Element;
327
355
 
328
- declare function useSignIn(params?: Props$2): _tanstack_react_query.UseMutateFunction<next_auth_react.SignInResponse | undefined, Error, LoginInfo, any>;
356
+ declare function useSignIn(params?: Props$3): _tanstack_react_query.UseMutateFunction<next_auth_react.SignInResponse | undefined, Error, LoginInfo, any>;
329
357
 
330
- declare const SignOutButton: React__default.ForwardRefExoticComponent<ButtonProps & ComponentFetchProps & {
358
+ type Props$2 = ButtonProps & ComponentFetchProps & {
331
359
  redirect?: boolean;
332
360
  callbackUrl?: string;
333
361
  buttonText?: string;
334
362
  baseUrl?: string;
335
363
  fetchUrl?: string;
336
364
  basePath?: string;
337
- } & React__default.RefAttributes<HTMLButtonElement>>;
365
+ };
366
+ declare const SignOutButton: {
367
+ ({ callbackUrl, redirect, className, buttonText, variant, size, baseUrl, fetchUrl, basePath, auth, asChild, ...props }: Props$2): React__default.JSX.Element;
368
+ displayName: string;
369
+ };
338
370
 
339
371
  interface SessionProviderProps {
340
372
  children: React__default.ReactNode;