UNPKG

@atlaskit/object

Version:

An object is an icon that represents an Atlassian-specific content type.

33 lines 951 B
import React from 'react'; import invariant from 'tiny-invariant'; import Tile from '@atlaskit/tile/tile'; /** * __Object tile base__ * * An object tile represents an Atlassian-specific content type. * */ export default function ObjectTileBase({ label = '', size = 'medium', testId, color, backgroundColor, icon: Icon }) { // Validate that size is a valid `ObjectTileSize` (and won't allow Tile's `xxsmall` size to be passed) const validSizes = ['xsmall', 'small', 'medium', 'large', 'xlarge']; invariant(validSizes.includes(size), `ObjectTile: size "${size}" is not valid. Valid sizes are: ${validSizes.join(', ')}`); return /*#__PURE__*/React.createElement(Tile, { label: "", backgroundColor: backgroundColor, size: size }, /*#__PURE__*/React.createElement(Icon, { label: label, color: color, testId: testId // @ts-expect-error - Internal, undocumented prop , shouldScale: true })); }