import { ReactElement, SVGProps, DetailedHTMLProps } from 'react'; import { DataAttributes } from '../utils/data-attributes'; export interface IconProps { name: string; inline?: boolean; passthroughProps?: DetailedHTMLProps, SVGElement> & DataAttributes; size?: number | string; } /** * Display an Assembly icon. * * Besides providing a convenient shortcut, this component does the following: * * - Sets some accessibility props. * - Provides an `inline` mode that automatically sizes icons to match their * surrounding text. */ declare function Icon({ name, inline, passthroughProps, size }: IconProps): ReactElement; declare namespace Icon { var propTypes: { /** * The name of the [Assembly icon](https://labs.mapbox.com/assembly/icons/) that * you want to display. */ name: any; /** * The width and height of the icon. All icons fill up a square space, * so this value will be applied to both width and height. * * If `inline: true`, the technical height will be controlled by the * line-height of the container, but the appearance of the icon will still * be in accordance with your `size` value (because it's limited by the * width). */ size: any; /** * If `true`, the icon will be adjusted after mounting so that its height * matches the line-height of its container. The result of this is that * the icon will not displace the text's established line-height and * will be vertically centered with the text alongside it. * * This is most useful when you are inserting the icon within multiline text, * so you can't use a flexbox layout to vertically center the icon and text. * * Be aware that there are edge cases that can cause problems with this * setting. For example, it won't work well if you don't have a `line-height` * set to a pixel value, or if there are dynamic adjustments to the * line-height. */ inline: any; /** * Props to pass directly to the `` element. */ passthroughProps: any; }; } export default Icon;