@primer/components
Version:
Primer react components
40 lines (31 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _constants = require("./constants");
var _sx = _interopRequireDefault(require("./sx"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const colorStyles = ({
scheme,
...props
}) => {
return {
color: scheme === 'secondary' ? (0, _constants.get)('colors.fg.default')(props) : scheme === 'primary' ? (0, _constants.get)('colors.fg.onEmphasis')(props) : (0, _constants.get)('colors.fg.default')(props)
};
};
const bgStyles = ({
scheme,
...props
}) => {
return {
backgroundColor: scheme === 'secondary' ? (0, _constants.get)('colors.neutral.muted')(props) : scheme === 'primary' ? (0, _constants.get)('colors.neutral.emphasis')(props) : (0, _constants.get)('colors.neutral.muted')(props)
};
};
const CounterLabel = _styledComponents.default.span.withConfig({
displayName: "CounterLabel",
componentId: "sc-1ubx52d-0"
})(["display:inline-block;padding:2px 5px;font-size:", ";font-weight:", ";line-height:", ";border-radius:20px;", ";", ";", ";&:empty{display:none;}", ";"], (0, _constants.get)('fontSizes.0'), (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('lineHeights.condensedUltra'), colorStyles, bgStyles, _constants.COMMON, _sx.default);
var _default = CounterLabel;
exports.default = _default;