@clubmed/trident-icons
Version:
Shared ClubMed Icons library
37 lines (36 loc) • 1.6 kB
TypeScript
import { AriaRole, ComponentPropsWithoutRef, FunctionComponent, PropsWithChildren } from 'react';
import { IconOrientationProps } from '../hooks/useIconOrientation';
export interface IconProps extends IconOrientationProps, Omit<ComponentPropsWithoutRef<'span'>, 'role' | 'aria-label'> {
name: string;
type?: string;
/**
* Width of the icon
*/
width?: string | null;
/**
* Color
*/
color?: string;
'aria-label'?: string | null;
role?: AriaRole | null;
}
export type IconsRegistryValue<Props extends IconProps = IconProps> = IconResolverProps<Props> & {
key: string;
};
export type IconResolverProps<Props extends IconProps = IconProps> = Props & {
name: string;
group?: string;
withOrientation?: boolean;
component: FunctionComponent<Props>;
};
export declare const IconTypesRegistry: Map<string, Map<string, IconsRegistryValue<IconProps>>>;
export declare function loadIcons<Props extends IconProps = IconProps>(icons: IconResolverProps<Props>[] | IconResolverProps<Props>[][]): Map<string, Map<string, IconsRegistryValue<IconProps>>>;
export declare const IconsContext: import('react').Context<{
locale?: string;
container: Map<string, Map<string, IconsRegistryValue>>;
updateContainer: (_: IconResolverProps[] | IconResolverProps[][]) => void;
}>;
export declare function IconsProvider<Props extends IconProps = IconProps>({ icons, locale, children, }: PropsWithChildren<{
locale?: string;
icons: IconResolverProps<Props>[] | IconResolverProps<Props>[][];
}>): import("react/jsx-runtime").JSX.Element;