@equinor/fusion-react-styles
Version:
style lib inspired by @material-ui/styles
62 lines • 2.11 kB
TypeScript
import { type ReactNode } from 'react';
import type { ReactElement } from 'react';
import type { Jss } from 'jss';
/**
* Props for the StylesProvider component
*/
export interface StylesProviderProps {
/** Child components that will receive the JSS context */
children?: ReactNode;
/** Disable automatic class name generation (unused, kept for API compatibility) */
disableGeneration?: boolean;
/** Custom class name generator function */
generateClassName?: (rule: {
key: string;
}, sheet?: unknown) => string;
/** Inject styles first in the document (unused, kept for API compatibility) */
injectFirst?: boolean;
/** Custom JSS instance to use */
jss?: Jss;
/** Seed prefix for generated class names (creates isolated scope) */
seed?: string;
/** Sheets cache (unused, kept for API compatibility) */
sheetsCache?: unknown;
/** Custom sheets manager instance */
sheetsManager?: Map<unknown, Map<unknown, unknown>>;
/** Sheets registry (unused, kept for API compatibility) */
sheetsRegistry?: unknown;
}
/**
* Provides JSS configuration to child components
*
* This component creates an isolated styling scope. When nested, each provider
* can have its own seed prefix, ensuring class names don't collide between scopes.
* This is critical for dynamically loaded modules or micro-frontends.
*
* @param props - Configuration options for the styles provider
* @returns A React element that provides JSS context to children
*
* @example
* ```tsx
* <StylesProvider seed="my-module">
* <App />
* </StylesProvider>
* ```
*
* @example
* ```tsx
* // Nested providers with different seeds for isolation
* <StylesProvider seed="main-app">
* <MainApp />
* <StylesProvider seed="dynamic-module">
* <DynamicModule />
* </StylesProvider>
* </StylesProvider>
* ```
*/
export declare function StylesProvider(props: StylesProviderProps): ReactElement;
export declare namespace StylesProvider {
var displayName: string;
}
export default StylesProvider;
//# sourceMappingURL=StyleProvider.d.ts.map