UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

80 lines 4.68 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BellIcon = void 0; var lodash_1 = __importDefault(require("lodash")); var react_1 = __importDefault(require("react")); var prop_types_1 = __importDefault(require("react-peek/prop-types")); var Icon_1 = __importStar(require("../Icon")); var style_helpers_1 = require("../../../util/style-helpers"); var component_types_1 = require("../../../util/component-types"); var cx = style_helpers_1.lucidClassNames.bind('&-BellIcon'); var oneOf = prop_types_1.default.oneOf, bool = prop_types_1.default.bool; var BellIcon = function (_a) { var className = _a.className, _b = _a.featuredColor, featuredColor = _b === void 0 ? 'info' : _b, _c = _a.hasDot, hasDot = _c === void 0 ? false : _c, passThroughs = __rest(_a, ["className", "featuredColor", "hasDot"]); var showBellDot = hasDot; return (react_1.default.createElement(Icon_1.default, __assign({}, component_types_1.omitProps(passThroughs, undefined, lodash_1.default.keys(exports.BellIcon.propTypes), false), lodash_1.default.pick(passThroughs, lodash_1.default.keys(Icon_1.propTypes)), { className: cx('&', className) }), showBellDot ? (react_1.default.createElement("g", null, react_1.default.createElement("path", { strokeLinecap: 'butt', d: 'M5.5 12.502v.5c0 1.381 1.119 2.5 2.5 2.5s2.5-1.119 2.5-2.5l.003-.495M3.056 7.432c-.54 2.214-1.556 3.07-1.556 3.07v2h13v-2s-1.884-1.587-1.884-6.024c0-.901-.909-3.976-4.616-3.976-.279 0-.543.017-.791.05' }), react_1.default.createElement("path", { className: cx('&', { '&-is-info': featuredColor === 'info', '&-is-success': featuredColor === 'success', '&-is-warning': featuredColor === 'warning', '&-is-danger': featuredColor === 'danger', }, className), d: 'M3.5-.148c1.737 0 3.15 1.413 3.15 3.15s-1.413 3.15-3.15 3.15S.35 4.739.35 3.002 1.763-.148 3.5-.148' }))) : (react_1.default.createElement("g", null, react_1.default.createElement("path", { d: 'M5.5 12.5v.5a2.5 2.5 0 1 0 5 0l.003-.495M14.5 12.5v-2s-1.884-1.587-1.884-6.024C12.616 3.575 11.707.5 8 .5S3.384 3.575 3.384 4.476C3.384 8.913 1.5 10.5 1.5 10.5v2h13z' }))))); }; exports.BellIcon = BellIcon; exports.BellIcon.displayName = 'BellIcon'; exports.BellIcon.peek = { description: "\n\t\tTypically used for notifications. The dot indicates that there is an unread message.\n\t", categories: ['visual design', 'icons'], extend: 'Icon', madeFrom: ['Icon'], }; exports.BellIcon.propTypes = __assign(__assign({}, Icon_1.propTypes), { hasDot: bool, featuredColor: oneOf(['info', 'success', 'warning', 'danger']) }); exports.BellIcon.defaultProps = Icon_1.default.defaultProps; exports.default = exports.BellIcon; //# sourceMappingURL=BellIcon.js.map