UNPKG

calcite-react

Version:
86 lines (76 loc) 3.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledCloseButton = exports.StyledToaster = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _helpers = require("../utils/helpers"); var _CalciteThemeProvider = require("../CalciteThemeProvider"); var _AlertStyled = require("../Alert/Alert-styled"); var _Button = _interopRequireDefault(require("../Button")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 StyledToaster = _styledComponents.default.div.withConfig({ displayName: "StyledToaster", componentId: "sc-7zry6g-0" })(["display:flex;", "{flex:1 0 50%;box-sizing:border-box;padding:", ";padding-right:0;}", "{padding:0 ", ";svg{fill:", ";}}", ";", ";", ";"], _AlertStyled.StyledAlertContent, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 3, '/'); }, _AlertStyled.StyledAlertIcon, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 3, '/'); }, function (props) { return props.theme.palette.blue; }, function (props) { return props.type === 'error' && (0, _styledComponents.css)(["border-top-color:", ";", " svg{fill:", ";}"], function (props) { return props.theme.palette.red; }, _AlertStyled.StyledAlertIcon, function (props) { return props.theme.palette.red; }); }, function (props) { return props.type === 'warning' && (0, _styledComponents.css)(["border-top-color:", ";", " svg{fill:", ";}"], function (props) { return props.theme.palette.yellow; }, _AlertStyled.StyledAlertIcon, function (props) { return props.theme.palette.yellow; }); }, function (props) { return props.type === 'success' && (0, _styledComponents.css)(["border-top-color:", ";", " svg{fill:", ";}"], function (props) { return props.theme.palette.green; }, _AlertStyled.StyledAlertIcon, function (props) { return props.theme.palette.green; }); }); exports.StyledToaster = StyledToaster; StyledToaster.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledCloseButton = (0, _styledComponents.default)(_Button.default).withConfig({ displayName: "StyledCloseButton", componentId: "sc-7zry6g-1" })(["color:currentColor;margin:-", ";margin-left:0;padding:", ";html[dir='rtl'] &{margin-left:", ";margin-right:0;}&:hover{color:currentColor;background:", ";}"], function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 2, '/'); }, function (props) { return props.theme.baseline; }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 2, '/'); }, function (props) { return props.theme.palette.offWhite; }); exports.StyledCloseButton = StyledCloseButton; StyledCloseButton.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme };