UNPKG

zeplin-extension-style-kit

Version:

Models and utilities to generate CSS-like style code in Zeplin extensions.

60 lines (48 loc) 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _constants = require("../constants"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var FontStyle = /*#__PURE__*/function () { function FontStyle() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : FontStyle.DEFAULT_VALUE; _classCallCheck(this, FontStyle); this.value = value; } _createClass(FontStyle, [{ key: "equals", value: function equals(other) { return this.value === other.value; } }, { key: "hasDefaultValue", value: function hasDefaultValue() { return this.value === FontStyle.DEFAULT_VALUE; } }, { key: "getValue", value: function getValue() { if (this.hasDefaultValue()) { return FontStyle.DEFAULT_VALUE; } return this.value; } }, { key: "name", get: function get() { return _constants.STYLE_PROPS.FONT_STYLE; } }], [{ key: "DEFAULT_VALUE", get: function get() { return "normal"; } }]); return FontStyle; }(); var _default = FontStyle; exports.default = _default;