UNPKG

@atlaskit/icon

Version:

An icon is a symbol representing a command, device, directory, or common action.

86 lines (84 loc) 3.12 kB
/* icon-tile-old.tsx generated by @compiled/babel-plugin v0.39.1 */ "use strict"; var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = IconTile; require("./icon-tile-old.compiled.css"); var React = _interopRequireWildcard(require("react")); var _runtime = require("@compiled/react/runtime"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } var sizeCrossCompatibleMap = { // Size mapping from new t-shirt sizes to old pixel sizes xsmall: '20', small: '24', medium: '32', large: '40', xlarge: '48', '16': '16', '24': '24', '32': '32', '40': '40', '48': '48' }; var sizeMap = { '16': "_1bsb7vkz _4t3i7vkz", '20': "_1bsbgktf _4t3igktf", '24': "_1bsb1tcg _4t3i1tcg", '32': "_1bsbzwfg _4t3izwfg", '40': "_1bsb1ylp _4t3i1ylp", '48': "_1bsbckbl _4t3ickbl" }; var appearanceMap = { grayBold: "_bfhk1i45 _syaz5w2r", limeBold: "_bfhktde4 _syaz5w2r", greenBold: "_bfhk1e5c _syaz5w2r", blueBold: "_bfhk16e3 _syaz5w2r", redBold: "_bfhkuibq _syaz5w2r", purpleBold: "_bfhkya33 _syaz5w2r", magentaBold: "_bfhkc3uk _syaz5w2r", tealBold: "_bfhk2c8p _syaz5w2r", orangeBold: "_bfhk1qg1 _syaz5w2r", yellowBold: "_bfhk1vop _syaz5w2r", gray: "_bfhk7qp0 _syaz1diz", lime: "_bfhkz2ec _syaz8645", orange: "_bfhk165s _syaz1j6y", magenta: "_bfhkv9ra _syazv8hk", green: "_bfhk1wnw _syaz17hp", blue: "_bfhk1dy8 _syaz6txe", red: "_bfhk1rtt _syaznbxb", purple: "_bfhk1nm4 _syazuq3u", teal: "_bfhk1a17 _syaz8uof", yellow: "_bfhk1773 _syaz1oqg" }; var shapeMap = { square: "_2rko12b0", circle: "_2rko1rr0" }; var iconTileStyles = null; /** * __IconTile__ * * An icon with background shape, color, and size properties determined by Tile. */ function IconTile(props) { var Icon = props.icon, label = props.label, appearance = props.appearance, _props$size = props.size, size = _props$size === void 0 ? '24' : _props$size, _props$shape = props.shape, shape = _props$shape === void 0 ? 'square' : _props$shape, testId = props.testId; var ExpandedIcon = Icon; return /*#__PURE__*/React.createElement("span", { "data-testid": testId, className: (0, _runtime.ax)(["_1e0c116y _vchhusvi _4cvr1h6o _1bah1h6o _1wybidpf", appearanceMap[appearance], sizeMap[sizeCrossCompatibleMap[size]], shapeMap[shape]]) }, /*#__PURE__*/React.createElement(ExpandedIcon, { color: "currentColor", label: label, spacing: "spacious", shouldScale: true })); }