@vlinderclimate/net-zero-ui
Version:
<div align="center"> <img src="https://storage.yandexcloud.net/static.vlinderstorage.com/Telegram_VlinderTech.png" width=200 /> </div> <h1 align="center">Net Zero UI kit</h1>
55 lines (48 loc) • 2.51 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var tslib_es6 = require('../tslib.es6-9240d9d1.js');
var jsxRuntime = require('react/jsx-runtime');
var styles = require('@mui/material/styles');
var MuiChip = require('@mui/material/Chip');
var theme_typography = require('../theme/typography.js');
var theme_colors = require('../theme/colors.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var MuiChip__default = /*#__PURE__*/_interopDefaultLegacy(MuiChip);
var backgroundMap = {
default: theme_colors["default"].gray[400],
primary: "#E3EDFF",
secondary: theme_colors["default"].green.pastel,
warning: theme_colors["default"].yellow.light + "55",
success: theme_colors["default"].green.light + "55",
error: theme_colors["default"].red.light + "55",
info: theme_colors["default"].blue.light + "55"
};
var colorMap = {
default: theme_colors["default"].gray[800],
primary: theme_colors["default"].blue.main,
secondary: theme_colors["default"].green.main,
warning: theme_colors["default"].yellow.main,
success: theme_colors["default"].text.positive,
error: theme_colors["default"].text.negative,
info: theme_colors["default"].blue.main
};
var StyledChip = styles.styled(MuiChip__default["default"])(function (_a) {
var theme = _a.theme, color = _a.color;
return (tslib_es6.__assign(tslib_es6.__assign({}, theme_typography["default"].caption.main), { fontWeight: 500, color: colorMap[color !== null && color !== void 0 ? color : "default"], backgroundColor: backgroundMap[color !== null && color !== void 0 ? color : "default"], ".MuiChip-label": {
paddingInline: theme.spacing(2),
position: "relative",
top: "-1px"
}, "&.MuiChip-outlined": {
borderColor: colorMap[color !== null && color !== void 0 ? color : "default"],
backgroundColor: "transparent"
}, ".MuiChip-deleteIcon, .MuiChip-deleteIcon:hover": {
color: colorMap[color !== null && color !== void 0 ? color : "default"]
} }));
});
var Chip = function (_a) {
var _b = _a.color, color = _b === void 0 ? "default" : _b, props = tslib_es6.__rest(_a, ["color"]);
return jsxRuntime.jsx(StyledChip, tslib_es6.__assign({ color: color }, props), void 0);
};
exports.backgroundMap = backgroundMap;
exports.colorMap = colorMap;
exports["default"] = Chip;