@denali-design/react
Version:
React.JS component library for the Denali CSS Framework
85 lines • 3.53 kB
JavaScript
;
/**
* Copyright 2020, Verizon Media
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DnChipShades = exports.DnChipColors = exports.DnChipSizes = exports.DnChip = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
exports.DnChip = function (_a) {
var _b;
var size = _a.size, bgColor = _a.bgColor, bgShade = _a.bgShade, color = _a.color, shade = _a.shade, children = _a.children, className = _a.className, rest = __rest(_a, ["size", "bgColor", "bgShade", "color", "shade", "children", "className"]);
return (react_1.default.createElement("span", __assign({ className: classnames_1.default('chips', (_b = {},
_b["is-" + size] = size,
_b["has-bg-" + bgColor + "-" + bgShade] = bgColor && bgShade,
_b["is-" + color + "-" + shade] = color && shade,
_b), className) }, rest), children));
};
var DnChipSizes;
(function (DnChipSizes) {
DnChipSizes["small"] = "small";
DnChipSizes["medium"] = "medium";
DnChipSizes["default"] = "default";
DnChipSizes["large"] = "large";
})(DnChipSizes = exports.DnChipSizes || (exports.DnChipSizes = {}));
var DnChipColors;
(function (DnChipColors) {
DnChipColors["brand"] = "brand";
DnChipColors["grey"] = "grey";
DnChipColors["red"] = "red";
DnChipColors["orange"] = "orange";
DnChipColors["yellow"] = "yellow";
DnChipColors["lime"] = "lime";
DnChipColors["green"] = "green";
DnChipColors["sky"] = "sky";
DnChipColors["blue"] = "blue";
DnChipColors["purple"] = "purple";
DnChipColors["violet"] = "violet";
DnChipColors["pink"] = "pink";
})(DnChipColors = exports.DnChipColors || (exports.DnChipColors = {}));
var DnChipShades;
(function (DnChipShades) {
DnChipShades["shade100"] = "100";
DnChipShades["shade200"] = "200";
DnChipShades["shade300"] = "300";
DnChipShades["shade400"] = "400";
DnChipShades["shade500"] = "500";
DnChipShades["shade600"] = "600";
DnChipShades["shade700"] = "700";
DnChipShades["shade800"] = "800";
})(DnChipShades = exports.DnChipShades || (exports.DnChipShades = {}));
exports.DnChip.defaultProps = {
size: DnChipSizes.default,
bgColor: undefined,
bgShade: DnChipShades.shade500,
color: undefined,
shade: DnChipShades.shade500,
className: '',
};
//# sourceMappingURL=DnChip.js.map