@braineet/ui
Version:
Braineet design system
30 lines • 1.58 kB
JavaScript
/* eslint-disable no-nested-ternary */
import { ComboboxPopover } from 'ariakit/combobox';
import isNumber from 'lodash/isNumber';
import styled from 'styled-components';
import Button from '../button';
var getMaxHeight = function getMaxHeight(p) {
return "min(\n var(\n --popover-available-height,\n " + (p.maxHeight ? isNumber(p.maxHeight) ? p.maxHeight + "px" : p.maxHeight : '320px') + "\n ),\n " + (p.maxHeight ? isNumber(p.maxHeight) ? p.maxHeight + "px" : p.maxHeight : '320px') + "\n)";
};
export var ComboboxPopoverStyled = styled(ComboboxPopover).withConfig({
displayName: "comboboxsc__ComboboxPopoverStyled",
componentId: "sc-yu6nwm-0"
})(["display:block;text-align:left;padding:", ";border:1px solid ", ";border-radius:", ";box-shadow:0px 8px 16px -8px ", ";overflow:auto;overscroll-behavior:contain;max-height:", ";max-width:var(--popover-available-width);background:", ";z-index:", ";"], function (props) {
return props.theme.spaces.md;
}, function (p) {
return p.theme.colors.black10;
}, function (props) {
return props.theme.borderRadius.md;
}, function (props) {
return props.theme.utils.lighten('black', 0.32);
}, function (p) {
return getMaxHeight(p);
}, function (p) {
return p.theme.colors.background.white;
}, function (props) {
return props.$zIndex || (props.modal || props.portal ? props.theme.zIndex.overlay : props.theme.zIndex.dropdown);
});
export var ButtonCancel = styled(Button).withConfig({
displayName: "comboboxsc__ButtonCancel",
componentId: "sc-yu6nwm-1"
})(["position:absolute;right:4px;top:4px;"]);