DocSpace-buildtools/packages/components/combobox/styled-combobox.js

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-09-15 23:27:47 +00:00
import styled, { css } from "styled-components";
2021-02-25 21:19:45 +00:00
import Base from "../themes/base";
const StyledComboBox = styled.div`
width: ${(props) =>
(props.scaled && "100%") ||
(props.size === "base" && props.theme.comboBox.width.base) ||
(props.size === "middle" && props.theme.comboBox.width.middle) ||
(props.size === "big" && props.theme.comboBox.width.big) ||
(props.size === "huge" && props.theme.comboBox.width.huge) ||
(props.size === "content" && "fit-content")};
position: relative;
outline: 0;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
padding: ${(props) => (props.withoutPadding ? "0" : "4px 0")};
2022-09-15 23:27:47 +00:00
${(props) =>
props.isOpen &&
props.noBorder &&
css`
2022-10-06 09:41:30 +00:00
background: ${(props) => props.theme.comboBox.background};
2022-09-16 07:57:01 +00:00
border-radius: 3px;
2022-09-15 23:27:47 +00:00
`}
.dropdown-container {
padding: ${(props) =>
props.advancedOptions && props.theme.comboBox.padding};
${(props) =>
!props.disableMobileView &&
css`
@media (max-width: 428px) {
position: fixed;
top: unset !important;
right: 0;
left: 0;
bottom: 0 !important;
width: 100%;
width: -moz-available;
width: -webkit-fill-available;
width: fill-available;
border: none;
border-radius: 6px 6px 0px 0px;
}
`}
}
-webkit-user-select: none;
.backdrop-active {
z-index: 210;
}
`;
StyledComboBox.defaultProps = {
theme: Base,
};
export default StyledComboBox;