calcite-react
Version:
Calcite components for React
115 lines (96 loc) • 5.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledHandleVerticalIcon = exports.StyledP = exports.StyledTextWrapper = exports.StyledIconWrapper = exports.StyledOrgAvatar = exports.StyledAvatarContainer = exports.StyledContentWrapper = exports.StyledAccountTile = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _helpers = require("../utils/helpers");
var _CalciteThemeProvider = require("../CalciteThemeProvider");
var _Elements = require("../Elements");
var _HandleVerticalIcon = _interopRequireDefault(require("calcite-ui-icons-react/HandleVerticalIcon"));
var _Avatar = _interopRequireDefault(require("../Avatar"));
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
var StyledAccountTile = _styledComponents.default.div.withConfig({
displayName: "StyledAccountTile",
componentId: "sc-8hzfuf-0"
})(["max-width:100%;height:60px;display:flex;justify-content:space-between;padding:", ";transition:", ";background-color:", ";", ";"], function (props) {
return (0, _helpers.unitCalc)(props.theme.baseline, 1.5, '/');
}, function (props) {
return props.theme.transition;
}, function (props) {
return props.open ? props.theme.palette.offWhite : props.theme.palette.white;
}, function (props) {
return props.clickable && (0, _styledComponents.css)(["&:hover{background-color:", ";cursor:pointer;}"], props.theme.palette.offWhite);
});
exports.StyledAccountTile = StyledAccountTile;
StyledAccountTile.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};
var StyledContentWrapper = _styledComponents.default.div.withConfig({
displayName: "StyledContentWrapper",
componentId: "sc-8hzfuf-1"
})(["max-width:100%;display:flex;margin-right:", ";white-space:nowrap;overflow:hidden;"], function (props) {
return props.theme.baseline;
});
exports.StyledContentWrapper = StyledContentWrapper;
var StyledAvatarContainer = _styledComponents.default.div.withConfig({
displayName: "StyledAvatarContainer",
componentId: "sc-8hzfuf-2"
})(["margin-right:", ";"], function (props) {
return props.theme.baseline;
});
exports.StyledAvatarContainer = StyledAvatarContainer;
StyledAvatarContainer.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};
var StyledOrgAvatar = (0, _styledComponents.default)(_Avatar.default).withConfig({
displayName: "StyledOrgAvatar",
componentId: "sc-8hzfuf-3"
})(["position:absolute;transform:translate(120%,-60px);border:2px solid;border-color:", ";"], function (props) {
return props.theme.palette.white;
});
exports.StyledOrgAvatar = StyledOrgAvatar;
StyledOrgAvatar.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};
var StyledP = (0, _styledComponents.default)(_Elements.CalciteP).withConfig({
displayName: "StyledP",
componentId: "sc-8hzfuf-4"
})(["font-weight:", ";font-size:", ";margin-bottom:-4px;max-width:100%;overflow:hidden;text-overflow:ellipsis;"], function (props) {
return props.demi ? '500' : '300';
}, function (props) {
return props.small ? '0.75rem' : '1rem';
});
exports.StyledP = StyledP;
var StyledIconWrapper = _styledComponents.default.span.withConfig({
displayName: "StyledIconWrapper",
componentId: "sc-8hzfuf-5"
})(["display:flex;align-items:center;justify-content:space-between;"]);
exports.StyledIconWrapper = StyledIconWrapper;
var StyledTextWrapper = _styledComponents.default.span.withConfig({
displayName: "StyledTextWrapper",
componentId: "sc-8hzfuf-6"
})(["max-width:100%;display:flex;flex-direction:column;overflow:hidden;"]);
exports.StyledTextWrapper = StyledTextWrapper;
var StyledHandleVerticalIcon = (0, _styledComponents.default)(_HandleVerticalIcon.default).withConfig({
displayName: "StyledHandleVerticalIcon",
componentId: "sc-8hzfuf-7"
})(["margin-left:", ";"], function (props) {
return props.marginLeft ? '0.5rem' : '0';
});
exports.StyledHandleVerticalIcon = StyledHandleVerticalIcon;