UNPKG

calcite-react

Version:
110 lines (102 loc) 5.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledComboButtonDropdown = exports.StyledComboButton = exports.StyledComboButtonContainer = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _helpers = require("../utils/helpers"); var _CalciteThemeProvider = require("../CalciteThemeProvider"); var _ButtonStyled = require("../Button/Button-styled"); 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 StyledComboButtonContainer = _styledComponents.default.div.withConfig({ displayName: "StyledComboButtonContainer", componentId: "sc-1r8iho2-0" })(["display:flex;flex-wrap:nowrap;", ";"], function (props) { return props.half && (0, _styledComponents.css)(["width:50%;text-align:center;& ", "{flex:1;}"], _ButtonStyled.StyledButton); }); exports.StyledComboButtonContainer = StyledComboButtonContainer; StyledComboButtonContainer.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledComboButton = (0, _styledComponents.default)(_ButtonStyled.StyledButton).withConfig({ displayName: "StyledComboButton", componentId: "sc-1r8iho2-1" })(["border-right-width:0;border-top-right-radius:0;border-bottom-right-radius:0;html[dir='rtl'] &{border-right-width:1px;border-top-right-radius:", ";border-bottom-right-radius:", ";border-left-width:0;border-top-left-radius:0;border-bottom-left-radius:0;}"], function (props) { return props.theme.borderRadius; }, function (props) { return props.theme.borderRadius; }); exports.StyledComboButton = StyledComboButton; StyledComboButton.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledComboButtonDropdown = (0, _styledComponents.default)(_ButtonStyled.StyledButton).withConfig({ displayName: "StyledComboButtonDropdown", componentId: "sc-1r8iho2-2" })(["height:100%;fill:currentColor;padding-left:", ";padding-right:", ";display:flex;border-left:1px solid ", ";border-top-left-radius:0;border-bottom-left-radius:0;html[dir='rtl'] &{border-left-color:", ";border-top-left-radius:", ";border-bottom-left-radius:", ";border-right:1px solid ", ";border-top-right-radius:0;border-bottom-right-radius:0;}", ";", ";", ";", ";"], function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 3, '/'); }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 3, '/'); }, function (props) { return props.theme.palette.darkBlue; }, function (props) { return props.theme.palette.blue; }, function (props) { return props.theme.borderRadius; }, function (props) { return props.theme.borderRadius; }, function (props) { return props.theme.palette.darkBlue; }, function (props) { return props.clear && (0, _styledComponents.css)(["border-left-color:", ";html[dir='rtl'] &{border-left-color:", ";border-right-color:", ";}"], function (props) { return props.theme.palette.blue; }, function (props) { return props.theme.palette.blue; }, function (props) { return props.theme.palette.blue; }); }, function (props) { return props.clearGray && (0, _styledComponents.css)(["border-left-color:", ";html[dir='rtl'] &{border-left-color:", ";border-right-color:", ";}"], function (props) { return props.theme.palette.gray; }, function (props) { return props.theme.palette.gray; }, function (props) { return props.theme.palette.gray; }); }, function (props) { return props.red && (0, _styledComponents.css)(["border-left-color:", ";html[dir='rtl'] &{border-left-color:", ";border-right-color:", ";}"], function (props) { return props.theme.palette.red; }, function (props) { return props.theme.palette.red; }, function (props) { return props.theme.palette.red; }); }, function (props) { return props.green && (0, _styledComponents.css)(["border-left-color:", ";html[dir='rtl'] &{border-left-color:", ";border-right-color:", ";}"], function (props) { return props.theme.palette.darkGreen; }, function (props) { return props.theme.palette.darkGreen; }, function (props) { return props.theme.palette.darkGreen; }); }); exports.StyledComboButtonDropdown = StyledComboButtonDropdown; StyledComboButtonDropdown.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme };