import React from "react"; import { MarginProps } from "styled-system"; import { TagProps } from "../../__internal__/utils/helpers/tags/tags"; import { BackgroundShape, BgSize, FontSize, StyledIconProps } from "./icon.style"; import { IconType } from "./icon-type"; import { TooltipPositions } from "../tooltip/tooltip.config"; export type LegacyIconTypes = "help" | "maintenance" | "new" | "success" | "messages"; /** * The size of the Icon. */ export type IconSize = "small" | "medium" | "large"; export interface IconProps extends Pick, MarginProps, TagProps { /** Set whether icon should be recognised by assistive technologies */ "aria-hidden"?: boolean; /** Aria label for accessibility purposes */ ariaLabel?: string; /** Id passed to the icon. */ id?: string; /** The ARIA role to be applied to the Icon */ role?: string; /** * @deprecated Tooltip support has been removed from `Icon` and the use of tooltips * is discouraged. This prop no longer has any effect. */ tooltipMessage?: React.ReactNode; /** @deprecated */ tooltipPosition?: TooltipPositions; /** @deprecated */ tooltipVisible?: boolean; /** @deprecated */ tooltipBgColor?: string; /** @deprecated */ tooltipFontColor?: string; /** @deprecated */ tooltipFlipOverrides?: TooltipPositions[]; /** @deprecated */ tooltipId?: string; /** * Icon type. * * Icons use a `snake_case` naming convention and are organised into the following categories: * * - **Navigation** — `arrow_*`, `chevron_*`, `caret_*`, `caret_large_*` * - **Actions** — `add`, `bin`, `close`, `copy`, `create`, `delete`, `drag`, `download`, * `edit`, `export`, `filter`, `link`, `search`, `settings`, `upload`, and more. * - **Status** — `alert`, `blocked`, `double_tick`, `error`, `error_square`, `info`, * `tick`, `warning`, and more. * - **Communication** — `call`, `chat`, `email`, `fax`, `message`, and more. * - **Finance** — `bank`, `cash`, `coins`, `credit_card`, `euro`, `receipt`, and more. * - **Social / App** — `app_facebook`, `app_instagram`, `app_tiktok`, `app_twitter`, `app_youtube`. * - **Documents & Files** — `attach`, `document_*`, `file_*`, and more. * - **Charts** — `chart_bar`, `chart_bar_arrow_up`, `chart_line`, `chart_pie`. * * The full list of types can be seen [here](https://carbon.sage.com/?path=/docs/icon--list-of-icons#list-of-icons). */ type: IconType | LegacyIconTypes; /** @ignore @private */ focusable?: boolean; /** @ignore @private */ isPartOfInput?: boolean; /** @ignore @private */ inputSize?: "small" | "medium" | "large"; /** @ignore @private */ tabIndex?: number; /** * Size of the Icon. * * - `small` — 24px (default) * - `medium` — 32px * - `large` — 40px */ size?: IconSize; /** Renders the Icon in a light colour, suitable for use on dark backgrounds. */ inverse?: boolean; /** * @deprecated Use the `size` prop instead. The `extra-large` value is no longer * supported and will be mapped to `large`. */ fontSize?: FontSize; /** @deprecated Use CSS or a wrapper element to apply a background colour. */ bg?: string; /** @deprecated Use CSS or a wrapper element to apply a background shape. */ bgShape?: BackgroundShape; /** @deprecated Use CSS or a wrapper element to control background size. */ bgSize?: BgSize; /** @deprecated Use CSS or a wrapper element to control icon colour. */ color?: string; /** @deprecated Applies disabled styling to the icon. */ disabled?: boolean; } declare const Icon: React.ForwardRefExoticComponent>; export default Icon;