@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
41 lines (40 loc) • 1.33 kB
TypeScript
import React from "react";
import { CarbonIconProps, CarbonIconType } from "@carbon/react/icons";
import { IntentTypes } from "../../common/Intent";
import { TooltipProps } from "./../Tooltip/Tooltip";
export interface BaseIconProps extends Omit<CarbonIconProps, "icon" | "description" | "name"> {
/**
* Carbon icon component that is used.
*/
iconComponent: CarbonIconType;
/**
* Add tooltip text to icon
*/
tooltipText?: string;
/**
* Intent state of icon.
* Currently only `success`, `info`, `warning` and `danger` are implemented for icons, even there are more states available.
*/
intent?: IntentTypes;
/**
* Display large icon version.
*/
large?: boolean;
/**
* Display small icon version.
*/
small?: boolean;
/**
* Additional CSS classes.
*/
className?: string;
/**
* Additonal tooltip properties, e.g. `hoverOpenDelay`.
*/
tooltipProps?: Partial<Omit<TooltipProps, "content" | "children">>;
}
/**
* The base icon provides the basic functionality that is necessary to wrap the Carbon icon component.
*/
declare function BaseIcon({ iconComponent, className, large, small, tooltipText, tooltipProps, intent, tabIndex, ...restProps }: BaseIconProps): React.JSX.Element;
export default BaseIcon;