UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

13 lines (12 loc) 695 B
import { jsx as _jsx } from "react/jsx-runtime"; /** * @license EUPL-1.2+ * Copyright (c) 2021 Gemeente Utrecht * Copyright (c) 2021 Robbert Broersma * Copyright Gemeente Amsterdam */ import clsx from 'clsx'; import { forwardRef } from 'react'; export const iconSizes = ['small', 'large', 'heading-3', 'heading-4', 'heading-5', 'heading-6']; 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), ref: ref, ...restProps, children: typeof svg === 'function' ? svg() : svg }))); Icon.displayName = 'Icon';