@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
25 lines (24 loc) • 1.19 kB
TypeScript
import React from 'react';
import { getStyleScopeHash } from '../plugins/postcss-isolated-style-scope/plugin-scope-hash.js';
export { getStyleScopeHash };
export type IsolatedStyleScopeProps = {
scopeHash?: string | 'auto';
disableCoreStyleWrapper?: boolean;
uniqueKey?: string | false;
innerRef?: React.MutableRefObject<HTMLDivElement>;
children: React.ReactNode;
style?: React.CSSProperties & {
[key: `--${string}`]: string | number;
};
};
export declare const IsolatedStyleScopeContext: React.Context<{
generatedScopeHash: string;
scopeElementRef: React.RefObject<HTMLDivElement>;
internalKeys: Set<string>;
parentContextMap?: Map<string, any>;
} & Pick<IsolatedStyleScopeProps, "style" | "scopeHash" | "disableCoreStyleWrapper">>;
export default function IsolatedStyleScope(props: IsolatedStyleScopeProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode>;
export declare function getCurrentStyleScopeElement(currentElement: HTMLElement, scopeHash?: string, fallback?: any): any;
export declare function useIsolatedStyleScope(scopeHash?: string): {
getScopeElement: () => any;
};