baseui
Version:
A React Component library implementing the Base design language
64 lines (61 loc) • 2.57 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Inner = exports.Body = exports.Arrow = void 0;
var _styles = require("../styles");
var _styledComponents = require("../popover/styled-components");
var _utils = require("../popover/utils");
/*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
/**
* We want to reuse the default Popover styles and add our overrides
* for Tooltip. Normally you could do something like
* withStyleDeep(StyledPopoverBody, {...}), however this break the
* ability to use $style properly–the style overrides passed in by
* the customer will override the base styles but not the styles
* specified here.
*
* We could create our own withStyleDeep that also takes the $style
* prop into account
*/
const Body = exports.Body = (0, _styles.styled)('div', props => ({
...(0, _styledComponents.getBodyStyles)(props),
backgroundColor: props.$theme.colors.tooltipBackground,
borderTopLeftRadius: props.$theme.borders.radius300,
borderTopRightRadius: props.$theme.borders.radius300,
borderBottomRightRadius: props.$theme.borders.radius300,
borderBottomLeftRadius: props.$theme.borders.radius300,
boxShadow: props.$theme.lighting.shadow400,
color: props.$theme.colors.tooltipText,
// Reset transition property to opacity only, and static transform
transitionProperty: 'opacity',
transform: (0, _utils.getEndPosition)(props.$popoverOffset)
}));
Body.displayName = "Body";
Body.displayName = 'Body';
const Inner = exports.Inner = (0, _styles.styled)('div', props => ({
...(0, _styledComponents.getInnerStyles)(props),
backgroundColor: props.$theme.colors.tooltipBackground,
borderTopLeftRadius: props.$theme.borders.radius300,
borderTopRightRadius: props.$theme.borders.radius300,
borderBottomRightRadius: props.$theme.borders.radius300,
borderBottomLeftRadius: props.$theme.borders.radius300,
paddingTop: props.$theme.sizing.scale300,
paddingBottom: props.$theme.sizing.scale300,
paddingLeft: props.$theme.sizing.scale600,
paddingRight: props.$theme.sizing.scale600,
...props.$theme.typography.font150,
color: props.$theme.colors.tooltipText
}));
Inner.displayName = "Inner";
Inner.displayName = 'Inner';
const Arrow = exports.Arrow = (0, _styles.styled)('div', props => ({
...(0, _styledComponents.getArrowStyles)(props),
backgroundColor: props.$theme.colors.tooltipBackground
}));
Arrow.displayName = "Arrow";
Arrow.displayName = 'Arrow';