UNPKG

@braineet/ui

Version:

Braineet design system

42 lines 2.75 kB
var _excluded = ["boxShadow", "active", "hover", "focus"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } import styled, { css } from 'styled-components'; var activeStyle = css(["color:", ";background-color:", ";"], function (props) { return props.theme.colors.brand90; }, function (p) { return p.theme.colors.brand10; }); var padding = css(["padding:", ";"], function (p) { return p.$hasIcon ? '4px 0.5rem 4px 4px' : '6px 8px'; }); var fillStyles = function fillStyles(props) { var _props$theme$helpers$ = props.theme.helpers.getFills({ appearance: props.styleType || 'ghost', color: props.color || 'black', reverse: props.reverseColor }), shadow = _props$theme$helpers$.boxShadow, active = _props$theme$helpers$.active, hover = _props$theme$helpers$.hover, focus = _props$theme$helpers$.focus, defaultStyles = _objectWithoutPropertiesLoose(_props$theme$helpers$, _excluded); return _extends({}, defaultStyles, { '&[data-active-item]': hover, '&:active,&[data-active]': hover, '&:not([disabled]):hover': hover, '&:not([disabled]):focus:focus-visible': focus, '&:not([disabled]):active': active, '&:not([disabled]):active:focus:focus-visible': active }); }; export var OptionStyled = styled('div').withConfig({ displayName: "optionsc__OptionStyled", componentId: "sc-1mwejcs-0" })(["position:relative;display:flex;justify-content:space-between;cursor:default;min-height:32px;scroll-margin:0.5rem;align-items:center;gap:0.5rem;border-radius:0.25rem;outline:none !important;scroll-margin:0.5rem;scroll-margin-top:3.5rem;transition:background-color 0.1s ease-in-out;cursor:pointer;", " ", " &:hover,&[data-hovered-item]{background-color:", ";}&[data-active-item]{", "}&[aria-disabled='true']{opacity:0.5;cursor:default;}"], padding, fillStyles, function (p) { return p.theme.colors.blackOpacity10; }, activeStyle); export var OptionLabel = styled('div').withConfig({ displayName: "optionsc__OptionLabel", componentId: "sc-1mwejcs-1" })(["display:flex;align-items:center;flex-grow:1;min-width:0;span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}"]);