UNPKG

@chayns-components/core

Version:

A set of beautiful React components for developing your own applications with chayns.

110 lines (105 loc) 4.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledComboBoxItemImage = exports.StyledComboBoxItemIconsWrapper = exports.StyledComboBoxItemContentSubtext = exports.StyledComboBoxItemContentHeaderWrapperText = exports.StyledComboBoxItemContentHeaderWrapper = exports.StyledComboBoxItemContentHeaderRightElement = exports.StyledComboBoxItemContentHeader = exports.StyledComboBoxItemContent = exports.StyledComboBoxItem = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } const StyledComboBoxItem = exports.StyledComboBoxItem = _styledComponents.default.div` align-items: center; background-color: ${({ theme, $isSelected }) => $isSelected && theme['secondary-102']}; color: ${({ theme }) => theme.text}; display: flex; flex: 0 0 auto; gap: 10px; min-height: 38px; padding: 8px 10px; transition: background-color 0.2s ease-in-out; ${({ $isDisabled }) => $isDisabled && (0, _styledComponents.css)` opacity: 0.5; pointer-events: none; `} ${({ $isDisabled, $isTouch, theme }) => !$isDisabled && !$isTouch && (0, _styledComponents.css)` &:hover { background-color: ${theme['secondary-101']}; } &:focus { background-color: ${theme['secondary-101']}; } `} `; const StyledComboBoxItemImage = exports.StyledComboBoxItemImage = _styledComponents.default.img` ${({ $shouldShowRoundImage }) => $shouldShowRoundImage && (0, _styledComponents.css)` border-radius: 50%; `} background: ${({ $background, theme }) => $background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`}; box-shadow: 0 0 0 1px rgba(${({ theme }) => theme['009-rgb']}, 0.15); flex: 0 0 auto; height: ${({ $shouldShowBigImage }) => $shouldShowBigImage ? '40px' : '22px'}; object-fit: cover; width: ${({ $shouldShowBigImage }) => $shouldShowBigImage ? '40px' : '22px'}; `; const StyledComboBoxItemIconsWrapper = exports.StyledComboBoxItemIconsWrapper = _styledComponents.default.div` align-items: center; display: flex; flex: 0 0 auto; height: 100%; justify-content: center; width: 20px; `; const StyledComboBoxItemContent = exports.StyledComboBoxItemContent = _styledComponents.default.div` display: flex; flex: 1 1 auto; flex-direction: column; line-height: normal; min-width: 0; width: 100%; `; const StyledComboBoxItemContentHeader = exports.StyledComboBoxItemContentHeader = _styledComponents.default.div` align-items: center; display: flex; justify-content: space-between; `; const StyledComboBoxItemContentHeaderWrapper = exports.StyledComboBoxItemContentHeaderWrapper = _styledComponents.default.div` display: flex; flex: 1 1 auto; gap: 4px; min-width: 0; `; const StyledComboBoxItemContentHeaderWrapperText = exports.StyledComboBoxItemContentHeaderWrapperText = _styledComponents.default.div` overflow: hidden; text-overflow: ellipsis; white-space: nowrap; `; const StyledComboBoxItemContentHeaderRightElement = exports.StyledComboBoxItemContentHeaderRightElement = _styledComponents.default.div` align-items: center; display: flex; `; const StyledComboBoxItemContentSubtext = exports.StyledComboBoxItemContentSubtext = _styledComponents.default.div` font-size: 85%; margin-top: 2px; `; //# sourceMappingURL=ComboBoxItem.styles.js.map