@navinc/base-react-components
Version:
Nav's Pattern Library
68 lines • 2.53 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pill = void 0;
const styled_components_1 = __importStar(require("styled-components"));
const neutralStyles = (0, styled_components_1.css) `
background: ${({ theme }) => theme.navNeutral100};
`;
const positiveStyles = (0, styled_components_1.css) `
background: ${({ theme }) => theme.navStatusPositive200};
`;
const informationStyles = (0, styled_components_1.css) `
background: ${({ theme }) => theme.navStatusPositive200};
`;
const improvementStyles = (0, styled_components_1.css) `
background: ${({ theme }) => theme.navSecondary300};
`;
const negativeStyles = (0, styled_components_1.css) `
background: ${({ theme }) => theme.navStatusNegative200};
`;
const variantStylesMap = {
neutral: neutralStyles,
positive: positiveStyles,
information: informationStyles,
improvement: improvementStyles,
negative: negativeStyles,
};
// ensure consistent map typing
variantStylesMap;
const variantStyles = ({ variant }) => {
if (!variant) {
return '';
}
return variantStylesMap[variant];
};
exports.Pill = styled_components_1.default.span.withConfig({ displayName: "brc-sc-Pill", componentId: "brc-sc-1dmjic2" }) `
font-family: ${({ theme }) => theme.fontPrimary};
color: ${({ theme }) => theme.scuttleGray600};
font-size: 0.75em;
font-weight: bold;
padding: 0.7em 1em;
text-align: center;
border-radius: 50vh;
${variantStyles}
`;
//# sourceMappingURL=pill.js.map