@frank-auth/react
Version:
Flexible and customizable React UI components for Frank Authentication
51 lines (50 loc) • 2.08 kB
TypeScript
'use client';
import { default as React } from 'react';
import { Organization } from '@frank-auth/client';
import { OrganizationBranding, ThemeContextValue, ThemeProviderProps } from './types';
declare const ThemeContext: React.Context<ThemeContextValue | null>;
export declare function ThemeProvider({ children, theme: initialTheme, mode: initialMode, organizationBranding, onThemeChange, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useTheme(): ThemeContextValue;
export declare function useThemeMode(): {
mode: "light" | "dark" | "system";
effectiveMode: "light" | "dark";
isSystemMode: boolean;
setMode: (mode: "light" | "dark" | "system") => void;
toggleMode: () => void;
setLightMode: () => void;
setDarkMode: () => void;
setSystemMode: () => void;
};
export declare function useOrganizationBranding(): {
branding: {
primaryColor?: string;
secondaryColor?: string;
logo?: string;
customCSS?: string;
} | undefined;
isCustomBranded: boolean;
applyOrganizationBranding: (organization: Organization) => void;
applyBranding: (branding: OrganizationBranding) => void;
hasLogo: boolean;
hasCustomCSS: boolean;
primaryColor: string | undefined;
secondaryColor: string | undefined;
};
export declare function useThemeVariables(): {
variables: Record<string, string>;
getVariable: (name: string) => string;
generateCSS: () => string;
applyToElement: (element: HTMLElement) => void;
};
export declare function withTheme<T extends object>(Component: React.ComponentType<T>): {
(props: T): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export declare function ThemeSwitcher({ className, iconClassName, showLabel, ...props }: {
className?: string;
iconClassName?: string;
showLabel?: boolean;
} & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
export { ThemeContext };
export type { ThemeContextValue };
//# sourceMappingURL=theme-provider.d.ts.map