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.

25 lines 1.11 kB
import { __assign, __rest } from "tslib"; import { Chip as MuiTag } from '@mui/material'; import { styled, useTheme } from '@mui/material/styles'; import React from 'react'; var TagStyled = styled(MuiTag)({ color: '#FFFF', }); 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"]); var theme = useTheme(); var colorMap = { primary: theme.palette.primary.main, secondary: theme.palette.secondary.main, error: theme.palette.error.main, warning: theme.palette.warning.main, info: theme.palette.info.main, success: theme.palette.success.main, }; 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