UNPKG

3.69 kBSource Map (JSON)View Raw
1{"version":3,"file":"Icon.types.js","sourceRoot":"../src/","sources":["components/Icon/Icon.types.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,CAAN,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAClB;;;OAGG;IACH,6CAAW,CAAA;IAEX;;;OAGG;IACH,yCAAS,CAAA;IAET;;;OAGG;IACH,kDAAgB,CAAA;IAEhB;;;OAGG;IACH,8CAAc,CAAA;AAChB,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB","sourcesContent":["import * as React from 'react';\nimport { IImageProps } from '../Image/Image.types';\nimport { IStyle, ITheme } from '../../Styling';\nimport { IBaseProps, IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * @deprecated Icon type is inferred based on presence of `IIconProps.imageProps`\n * {@docCategory Icon}\n */\nexport enum IconType {\n /**\n * Render using the fabric icon font.\n * @deprecated Icon type is inferred based on presence of `IIconProps.imageProps`\n */\n default = 0,\n\n /**\n * Render using an image, where imageProps would be used.\n * @deprecated Icon type is inferred based on presence of `IIconProps.imageProps`\n */\n image = 1,\n\n /**\n * Deprecated, use `default`.\n * @deprecated Use `default`.\n */\n Default = 100000,\n\n /**\n * Deprecated, use `image`.\n * @deprecated Use `image`.\n */\n Image = 100001,\n}\n\n/**\n * {@docCategory Icon}\n */\nexport interface IIconProps extends IBaseProps, React.HTMLAttributes<HTMLElement> {\n /**\n * The name of the icon to use from the icon font.\n * If string is empty, a placeholder icon will be rendered the same width as an icon.\n */\n iconName?: string;\n\n /**\n * The aria label of the icon for the benefit of screen readers.\n * @deprecated Use the native prop `aria-label`\n */\n ariaLabel?: string;\n\n /**\n * The type of icon to render (image or icon font).\n * @deprecated Inferred based on the presence of `imageProps`\n */\n // eslint-disable-next-line deprecation/deprecation\n iconType?: IconType;\n\n /**\n * If rendering an image icon, these props will be passed to the Image component.\n */\n imageProps?: IImageProps;\n\n /**\n * If rendering an image icon, this component will be rendered in the event that loading the image fails.\n */\n imageErrorAs?: React.ComponentType<IImageProps>;\n\n /**\n * Gets the styles for an Icon.\n */\n styles?: IStyleFunctionOrObject<IIconStyleProps, IIconStyles>;\n theme?: ITheme;\n}\n\n/**\n * {@docCategory Icon}\n */\nexport interface IIconStyleProps {\n className?: string;\n iconClassName?: string;\n isPlaceholder: boolean;\n isImage: boolean;\n styles?: Partial<IIconStyles>;\n theme?: ITheme;\n}\n\n/**\n * {@docCategory Icon}\n */\nexport interface IIconStyles {\n root?: IStyle;\n\n /**\n * Deprecated. Use `root`.\n * @deprecated Use `root`.\n */\n imageContainer?: IStyle;\n}\n\n/**\n * Props for a basic icon component which only supports font glyphs and can't be targeted by customizations.\n * {@docCategory Icon}\n */\nexport interface IFontIconProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * The name of the icon to use from the icon font.\n * If string is empty, a placeholder icon will be rendered the same width as an icon.\n */\n iconName?: string;\n\n /**\n * Custom class to style the icon.\n */\n className?: string;\n}\n\n/**\n * Props for a basic image icon component which doesn't directly provide image load error handling\n * and can't be targeted by customizations.\n * {@docCategory Icon}\n */\nexport interface IImageIconProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Props passed to the Image component.\n */\n imageProps: IImageProps;\n\n /**\n * Custom class to style the icon.\n */\n className?: string;\n}\n"]}
\No newline at end of file