UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

13 lines (12 loc) 751 B
import * as React from 'react'; import join from '../utils/join'; const HUNDRED_PERCENT_SIZE = 24; const DEFAULT_SIZE = 20; export const getSize = (size) => Math.round(size * (DEFAULT_SIZE / HUNDRED_PERCENT_SIZE)); export default ({ children, size = DEFAULT_SIZE, name, tabIndex, color, ...props }) => { size = typeof size === 'number' || parseInt(size) == size ? getSize(size) : size; return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", tabIndex: tabIndex, "data-id": name, "data-name": "AdaptableIcon", ...props, className: join(props.className, `ab-Icon ab-Icon--${name}`), style: { verticalAlign: 'middle', fill: color ?? 'currentColor', ...props.style } }, children)); };