UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

90 lines (89 loc) 3.02 kB
import React from 'react'; import { StandardProps, Overwrite } from '../../util/component-types'; export declare enum Color { 'neutral-dark' = "neutral-dark", 'neutral-light' = "neutral-light", primary = "primary", white = "white", success = "success", warning = "warning", 'secondary-one' = "secondary-one", 'secondary-two' = "secondary-two", 'secondary-three' = "secondary-three" } export interface IIconPropsRaw extends StandardProps { /** Size variations of the icons. `size` directly effects height and width but the developer should also be conscious of the relationship with `viewBox`. */ size?: number; /** Size handles width and height, whereas `width` can manually override the width that would be set by size. */ width?: number | string; /** Size handles width and height, whereas `height` can manually override the height that would be set by size. */ height?: number | string; /** `viewBox` is very important for SVGs. You can think of `viewBox` as the "artboard" for our SVG while `size` is the presented height and width. */ viewBox?: string; /** Any valid SVG aspect ratio. */ aspectRatio?: string; /** Adds styling that makes the icon appear clickable. */ isClickable?: boolean; /** Adds styling that makes the icon appear disabled. Also forces isClickable to be false. */ isDisabled?: boolean; /** Called when the user clicks the `Icon`. */ onClick?: ({ event, props, }: { event: React.MouseEvent; props: IIconProps; }) => void; /** Called when the user clicks an active, clickable `Icon`. */ onSelect?: ({ event, props, }: { event: React.MouseEvent; props: IIconProps; }) => void; /** Sets the color of the Icon. May not be applicable for icons that are tied to specific colors (e.g. DangerIcon). */ color?: keyof typeof Color; } export declare type IIconProps = Overwrite<React.HTMLProps<SVGSVGElement>, IIconPropsRaw>; export declare const Icon: { (props: IIconProps): React.ReactElement; displayName: string; defaultProps: { size: number; aspectRatio: string; viewBox: string; isDisabled: boolean; isClickable: boolean; color: Color; onClick: (...args: any[]) => void; onSelect: (...args: any[]) => void; }; peek: { description: string; categories: string[]; }; propTypes: { className: any; size: any; width: any; height: any; viewBox: any; aspectRatio: any; isClickable: any; isDisabled: any; onClick: any; onSelect: any; children: any; color: any; }; }; export declare const propTypes: { className: any; size: any; width: any; height: any; viewBox: any; aspectRatio: any; isClickable: any; isDisabled: any; onClick: any; onSelect: any; children: any; color: any; }; export default Icon;