UNPKG

norma-library

Version:

Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.

24 lines 1.02 kB
import { __assign, __rest } from "tslib"; import React from 'react'; import { Chip as MuiTag } from '@mui/material'; import { palette } from '../helpers'; import { styled } from '@mui/material/styles'; var colorMap = { inherit: palette.inherit, primary: palette.primary, secondary: palette.secondary, error: palette.error, warning: palette.warning, info: palette.info, success: palette.success, }; var TagStyled = styled(MuiTag)({}); export var Tag = function (_a) { var label = _a.label, _b = _a.color, color = _b === void 0 ? 'primary' : _b, _c = _a.outlined, outlined = _c === void 0 ? false : _c, props = __rest(_a, ["label", "color", "outlined"]); return (React.createElement(TagStyled, __assign({ label: label, sx: { color: outlined !== true ? '#FFFF' : colorMap[color], backgroundColor: outlined !== true ? colorMap[color] : 'inherit', border: "1px solid ".concat(colorMap[color]), } }, props))); }; //# sourceMappingURL=Tag.js.map