UNPKG

react-dialogify

Version:

Simple, Fast and Easy to use Dialog Modal component for React

51 lines (33 loc) 2.45 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getTypeColor = exports.TYPES_COLORS = exports.getIcon = exports.ICONS = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _isString2 = _interopRequireDefault(require("lodash/isString")); var _check = _interopRequireDefault(require("react-feather/dist/icons/check")); var _x = _interopRequireDefault(require("react-feather/dist/icons/x")); var _clock = _interopRequireDefault(require("react-feather/dist/icons/clock")); var _alertTriangle = _interopRequireDefault(require("react-feather/dist/icons/alert-triangle")); var _rss = _interopRequireDefault(require("react-feather/dist/icons/rss")); var _constants = require("./constants"); var _ICONS, _TYPES_COLORS; var ICONS = (_ICONS = {}, (0, _defineProperty2.default)(_ICONS, _constants.TYPES.success, _check.default), (0, _defineProperty2.default)(_ICONS, _constants.TYPES.error, _x.default), (0, _defineProperty2.default)(_ICONS, _constants.TYPES.pending, _clock.default), (0, _defineProperty2.default)(_ICONS, _constants.TYPES.warning, _alertTriangle.default), (0, _defineProperty2.default)(_ICONS, _constants.TYPES.info, _rss.default), (0, _defineProperty2.default)(_ICONS, "default", null), _ICONS); exports.ICONS = ICONS; var getIcon = function getIcon(type) { if ((0, _isString2.default)(type)) { return ICONS[type] || ICONS.default; } return null; }; exports.getIcon = getIcon; var TYPES_COLORS = (_TYPES_COLORS = {}, (0, _defineProperty2.default)(_TYPES_COLORS, _constants.TYPES.success, _constants.COLORS.GREEN), (0, _defineProperty2.default)(_TYPES_COLORS, _constants.TYPES.error, _constants.COLORS.RED), (0, _defineProperty2.default)(_TYPES_COLORS, _constants.TYPES.pending, _constants.COLORS.KEPPEL), (0, _defineProperty2.default)(_TYPES_COLORS, _constants.TYPES.warning, _constants.COLORS.GOLD), (0, _defineProperty2.default)(_TYPES_COLORS, _constants.TYPES.info, _constants.COLORS.INDIGO), (0, _defineProperty2.default)(_TYPES_COLORS, "default", _constants.COLORS.PINK), _TYPES_COLORS); exports.TYPES_COLORS = TYPES_COLORS; var getTypeColor = function getTypeColor(type) { if ((0, _isString2.default)(type)) { return TYPES_COLORS[type] || TYPES_COLORS.default; } return null; }; exports.getTypeColor = getTypeColor;