calcite-react
Version:
Calcite components for React
68 lines (61 loc) • 2.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledLabel = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _helpers = require("../utils/helpers");
var _CalciteThemeProvider = require("../CalciteThemeProvider");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
// Copyright 2019 Esri
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// styled-components
// Utils, common elements
// Calcite theme and Esri colors
// Calcite components
// Icons
// Third party libraries
var StyledLabel = _styledComponents.default.mark.withConfig({
displayName: "StyledLabel",
componentId: "sc-19bfcv8-0"
})(["background-color:", ";padding:0.25em 0.5em;border-radius:", ";", ";white-space:nowrap;", ";", ";", ";", ";"], function (props) {
return props.theme.palette.lightestGray;
}, function (props) {
return props.theme.borderRadius || '3px';
}, (0, _helpers.fontSize)(-2), function (props) {
return props.red && (0, _styledComponents.css)(["background-color:", ";color:", ";"], function (props) {
return props.theme.palette.red;
}, function (props) {
return props.theme.palette.white;
});
}, function (props) {
return props.yellow && (0, _styledComponents.css)(["background-color:", ";color:", ";"], function (props) {
return props.theme.palette.lightYellow;
}, function (props) {
return props.theme.palette.offBlack;
});
}, function (props) {
return props.green && (0, _styledComponents.css)(["background-color:", ";color:", ";"], function (props) {
return props.theme.palette.green;
}, function (props) {
return props.theme.palette.white;
});
}, function (props) {
return props.blue && (0, _styledComponents.css)(["background-color:", ";color:", ";"], function (props) {
return props.theme.palette.blue;
}, function (props) {
return props.theme.palette.white;
});
});
exports.StyledLabel = StyledLabel;
StyledLabel.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};