@ericbutera/kaleido 0.7.0 → 0.8.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.
@@ -1,7 +1,6 @@
1
1
  import { User } from '../../../users/useUsers';
2
2
  interface ListProps {
3
- onCreateUser: () => void;
4
3
  onSelectUser: (user: User) => void;
5
4
  }
6
- export default function List({ onCreateUser, onSelectUser }: ListProps): import("react").JSX.Element;
5
+ export default function List({ onSelectUser }: ListProps): import("react").JSX.Element;
7
6
  export {};
@@ -1,8 +1,7 @@
1
1
  import { User } from '../../../users/useUsers';
2
2
  interface ModalProps {
3
- mode: "create" | "edit" | null;
4
3
  selectedUser: User | null;
5
4
  onClose: () => void;
6
5
  }
7
- export default function Modal({ mode, selectedUser, onClose }: ModalProps): import("react").JSX.Element | null;
6
+ export default function Modal({ selectedUser, onClose }: ModalProps): import("react").JSX.Element | null;
8
7
  export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export default function OAuthProviderControls({ text, prefix, unavailable, }: {
3
+ text?: string;
4
+ prefix?: ReactNode;
5
+ unavailable?: ReactNode;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export default function SsoOnlyNotice({ title, message, buttonText, }: {
2
+ title?: string;
3
+ message?: string;
4
+ buttonText?: string;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ export default function SsoProviderButtons({ apiUrl, providersUrl, text, prefix, unavailable, }: {
3
+ apiUrl: string;
4
+ providersUrl?: string;
5
+ text?: string;
6
+ prefix?: ReactNode;
7
+ unavailable?: ReactNode;
8
+ }): import("react").JSX.Element | null;
9
+ export declare function createOAuthProviderButtons(apiUrl: string): ComponentType<{
10
+ text?: string;
11
+ prefix?: ReactNode;
12
+ unavailable?: ReactNode;
13
+ }>;
@@ -1,10 +1,13 @@
1
1
  export { AuthProvider, useAuthApi, useAuthConfig } from './lib/AuthContext';
2
2
  export { useAuth } from './lib/useAuth';
3
- export type { ApiError, AuthApiClient, AuthConfig, LoginRequest, RegisterRequest, ResendConfirmationRequest, ResetRequest, User, } from './lib/types';
3
+ export type { ApiError, AuthApiClient, AuthConfig, LoginRequest, OAuthProviderOption, RegisterRequest, ResendConfirmationRequest, ResolvedAuthConfig, ResetRequest, User, } from './lib/types';
4
4
  export { handleFormError } from './lib/form';
5
5
  export { redirectToOrigin } from './lib/utils';
6
6
  export { default as AuthLayout } from './components/auth/Layout';
7
+ export { createOAuthProviderButtons, default as SsoProviderButtons, } from './components/SsoProviderButtons';
8
+ export { default as OAuthProviderControls } from './components/OAuthProviderControls';
7
9
  export { default as ProtectedRoute } from './components/ProtectedRoute';
10
+ export { default as SsoOnlyNotice } from './components/SsoOnlyNotice';
8
11
  export { default as ConfirmEmail } from './pages/auth/ConfirmEmail';
9
12
  export { default as ForgotPassword } from './pages/auth/ForgotPassword';
10
13
  export { default as Login } from './pages/auth/Login';
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { AuthApiClient, AuthConfig } from './types';
2
+ import { AuthApiClient, AuthConfig, ResolvedAuthConfig } from './types';
3
3
  export declare function AuthProvider({ client, config, children, }: {
4
4
  client: AuthApiClient;
5
5
  config?: AuthConfig;
@@ -14,4 +14,4 @@ export declare function useAuthApi(): AuthApiClient;
14
14
  * Hook to access the auth configuration.
15
15
  * Must be used within an AuthProvider.
16
16
  */
17
- export declare function useAuthConfig(): Required<AuthConfig>;
17
+ export declare function useAuthConfig(): ResolvedAuthConfig;
@@ -1,3 +1,4 @@
1
+ import { ComponentType, ReactNode } from 'react';
1
2
  import { UseFormSetError } from 'react-hook-form';
2
3
  export interface LoginRequest {
3
4
  email: string;
@@ -28,12 +29,27 @@ export interface ApiError {
28
29
  errors?: Record<string, string[]>;
29
30
  }
30
31
  export interface AuthConfig {
31
- oauthEnabled?: boolean;
32
+ passwordAuthEnabled?: boolean;
32
33
  registrationEnabled?: boolean;
33
- OAuthButton?: React.ComponentType<{
34
- text: string;
34
+ OAuthProviderButtons?: ComponentType<{
35
+ text?: string;
36
+ prefix?: ReactNode;
37
+ unavailable?: ReactNode;
35
38
  }>;
36
39
  }
40
+ export interface ResolvedAuthConfig {
41
+ passwordAuthEnabled: boolean;
42
+ registrationEnabled: boolean;
43
+ OAuthProviderButtons?: ComponentType<{
44
+ text?: string;
45
+ prefix?: ReactNode;
46
+ unavailable?: ReactNode;
47
+ }>;
48
+ }
49
+ export interface OAuthProviderOption {
50
+ id: string;
51
+ label: string;
52
+ }
37
53
  export interface AuthApiClient {
38
54
  useLoginUser(): {
39
55
  mutateAsync: (data: LoginRequest, setError?: UseFormSetError<any>) => Promise<void>;
@@ -1,3 +1 @@
1
- export default function SignUp({ redirectUrl }: {
2
- redirectUrl?: string;
3
- }): import("react").JSX.Element;
1
+ export default function SignUp(): import("react").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  export declare const FLAG_REGISTRATION = "registration";
2
- export declare const FLAG_OAUTH = "oauth";
3
2
  export declare const FLAG_API_CLIENTS = "api_clients";