UNPKG

ultra-design

Version:
32 lines (29 loc) 3.3 kB
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral'; import { css } from '@emotion/react'; import { fade } from '../utils/fade.js'; import { transitionSlide } from '../styles/transition/slide.js'; var _templateObject, _templateObject2; var selectLayerStyles = function selectLayerStyles(props) { var theme = props.theme; var _theme$style = theme.style, radius = _theme$style.radius, boxShadow = _theme$style.boxShadow; var _theme$theme$mode = theme[theme.mode], textColor = _theme$theme$mode.textColor, thirdBackgroundColor = _theme$theme$mode.thirdBackgroundColor; return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-layer-wrapper {\n .", " {\n transform-origin: top;\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n border-radius: ", "px;\n &__content {\n padding: 8px 0;\n }\n }\n\n .", "__content {\n width: 100%;\n max-height: 300px;\n }\n ", "\n }\n "])), props.name, props.name, thirdBackgroundColor, textColor, boxShadow, radius, props.name, transitionSlide('ultra-select-layer-slide')); }; var selectStyles = function selectStyles(props) { var theme = props.theme; var _theme$style2 = theme.style, primaryColor = _theme$style2.primaryColor, radius = _theme$style2.radius; var _theme$theme$mode2 = theme[theme.mode], borderColor = _theme$theme$mode2.borderColor, backgroundColor = _theme$theme$mode2.backgroundColor, textColor = _theme$theme$mode2.textColor, disabledBgColor = _theme$theme$mode2.disabledBgColor, disabledTextColor = _theme$theme$mode2.disabledTextColor; return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n height: 32px;\n min-width: 140px;\n margin: 0;\n list-style: none;\n position: relative;\n color: ", ";\n font-size: 14px;\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n transition: all 0.3s;\n cursor: pointer;\n user-select: none;\n :focus {\n outline: 0;\n }\n &.ultra-select--focused {\n border-color: ", ";\n box-shadow: 0 0 0 2px ", ";\n }\n &.ultra-select--disabled {\n cursor: not-allowed;\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n }\n .ultra-select__selection {\n margin-left: 12px;\n flex: 1;\n display: flex;\n align-items: center;\n white-space: nowrap;\n }\n\n .ultra-select__placeholder {\n color: ", ";\n }\n\n &:not(&.ultra-input--disabled):hover {\n border-color: ", ";\n }\n\n .ultra-icon {\n display: inline-flex;\n }\n\n .ultra-select__icon {\n width: 32px;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n input {\n margin-left: 12px;\n border: 0;\n outline: 0;\n flex: 1;\n }\n "])), textColor, backgroundColor, borderColor, radius, primaryColor, fade(primaryColor, 0.2), disabledBgColor, disabledTextColor, fade(textColor, 0.3), primaryColor); }; export { selectLayerStyles, selectStyles };