@storybook/design-system
Version:
Storybook design system
32 lines (27 loc) • 2.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Badge = void 0;
var _theming = require("@storybook/theming");
var _polished = require("polished");
var _styles = require("./shared/styles");
var Badge = (0, _theming.styled)("div", process.env.NODE_ENV === "production" ? {
target: "e1kwid7b0"
} : {
target: "e1kwid7b0",
label: "Badge"
})("display:inline-block;vertical-align:top;font-size:", _styles.typography.size.s1, "px;line-height:12px;padding:4px 12px;border-radius:3em;font-weight:", _styles.typography.weight.bold, ";svg{height:12px;width:12px;margin-right:4px;margin-top:-2px;}", function (props) {
return props.status === 'positive' && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.positive, ";background:", _styles.background.positive, ";box-shadow:", (0, _polished.rgba)(_styles.color.positive, 0.1), " 0 0 0 1px inset;" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";", function (props) {
return props.status === 'negative' && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.negative, ";background:", _styles.background.negative, ";box-shadow:", (0, _polished.rgba)(_styles.color.negative, 0.1), " 0 0 0 1px inset;" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";", function (props) {
return props.status === 'warning' && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.warning, ";background:", _styles.background.warning, ";box-shadow:", (0, _polished.rgba)(_styles.color.warning, 0.1), " 0 0 0 1px inset;" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";", function (props) {
return props.status === 'error' && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.lightest, ";background:", _styles.color.red, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";", function (props) {
return props.status === 'selected' && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.selected, ";background:", _styles.background.calmBlue, ";box-shadow:", (0, _polished.rgba)(_styles.color.selected, 0.1), " 0 0 0 1px inset;" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";", function (props) {
return (props.status === 'neutral' || props.status === undefined) && /*#__PURE__*/(0, _theming.css)("color:", _styles.color.darker, ";background:", _styles.color.mediumlight, ";box-shadow:", (0, _polished.rgba)(_styles.color.darker, 0.1), " 0 0 0 1px inset;" + (process.env.NODE_ENV === "production" ? "" : ";label:Badge;"));
}, ";");
exports.Badge = Badge;