UNPKG

@atlaskit/object

Version:

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

34 lines 1.17 kB
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(_ref) { var _ref$label = _ref.label, label = _ref$label === void 0 ? '' : _ref$label, _ref$size = _ref.size, size = _ref$size === void 0 ? 'medium' : _ref$size, testId = _ref.testId, color = _ref.color, backgroundColor = _ref.backgroundColor, Icon = _ref.icon; // Validate that size is a valid `ObjectTileSize` (and won't allow Tile's `xxsmall` size to be passed) var validSizes = ['xsmall', 'small', 'medium', 'large', 'xlarge']; invariant(validSizes.includes(size), "ObjectTile: size \"".concat(size, "\" is not valid. Valid sizes are: ").concat(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 })); }