@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
12 lines (11 loc) • 923 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { clsx } from 'clsx';
import { forwardRef } from 'react';
export const iconSizes = ['small', 'large', 'heading-1', 'heading-2', 'heading-3', 'heading-4', 'heading-5'];
/**
* @see {@link https://designsystem.amsterdam/?path=/docs/components-media-icon--docs Icon docs at Amsterdam Design System}
* @see {@link https://designsystem.amsterdam/?path=/docs/brand-assets-icons--docs Icons overview at Amsterdam Design System}
*/
export const Icon = forwardRef(({ className, color, size, square, svg, ...restProps }, ref) => (_jsx("span", { className: clsx('ams-icon', color && `ams-icon--${color}`, size && `ams-icon--${size}`, square && 'ams-icon--square', className), hidden // The icon is only shown when the CSS loads, so we hide it by default.
: true, ref: ref, ...restProps, children: typeof svg === 'function' ? svg({}) : svg })));
Icon.displayName = 'Icon';