calcite-react
Version:
Calcite components for React
79 lines (69 loc) • 3.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledAvatarText = exports.StyledAvatarSvg = exports.StyledAvatarImage = exports.StyledAvatar = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
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 StyledAvatar = _styledComponents.default.div.withConfig({
displayName: "StyledAvatar",
componentId: "kfpfos-0"
})(["width:", "px;height:", "px;display:flex;position:relative;overflow:hidden;background-color:", ";color:", ";font-size:1.25rem;flex-shrink:0;align-items:center;user-select:none;border-radius:50%;justify-content:center;", ";"], function (props) {
return props.aSize;
}, function (props) {
return props.aSize;
}, function (props) {
return props.theme.palette.blue;
}, function (props) {
return props.theme.palette.white;
}, function (props) {
return props.fontSize && (0, _styledComponents.css)(["font-size:", "px;"], props.fontSize);
});
exports.StyledAvatar = StyledAvatar;
StyledAvatar.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};
var StyledAvatarImage = _styledComponents.default.img.withConfig({
displayName: "StyledAvatarImage",
componentId: "kfpfos-1"
})(["width:100%;height:100%;text-align:center;object-fit:cover;"]);
exports.StyledAvatarImage = StyledAvatarImage;
StyledAvatarImage.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};
var StyledAvatarSvg = {
fill: 'currentColor',
display: 'inline-block',
fontSize: '24px',
transition: 'fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
userSelect: 'none',
flexShrink: '0'
};
exports.StyledAvatarSvg = StyledAvatarSvg;
var StyledAvatarText = _styledComponents.default.span.withConfig({
displayName: "StyledAvatarText",
componentId: "kfpfos-2"
})(["font-weight:300;font-family:", ";"], function (props) {
return props.theme.type.avenirFamily;
});
exports.StyledAvatarText = StyledAvatarText;
StyledAvatarText.defaultProps = {
theme: _CalciteThemeProvider.CalciteTheme
};