|
| 1 | +import styled, { css } from 'styled-components' |
| 2 | + |
| 3 | +export const ComboboxItem = styled.div` |
| 4 | + display: flex; |
| 5 | + align-items: center; |
| 6 | + font-size: 14px; |
| 7 | + gap: ${({ theme }) => theme.spacing.tiny}; |
| 8 | +
|
| 9 | + :first-child { |
| 10 | + border-radius: 6px 6px 0 0; |
| 11 | + } |
| 12 | +
|
| 13 | + :last-child { |
| 14 | + border-radius: 0 0 6px 6px; |
| 15 | + } |
| 16 | +
|
| 17 | + font-weight: 400; |
| 18 | + padding: 0 8px; |
| 19 | + min-height: 36px; |
| 20 | + user-select: none; |
| 21 | + width: 300px; |
| 22 | + color: ${({ theme }) => theme.colors.text.default}; |
| 23 | + &.highlight { |
| 24 | + background: ${({ theme }) => theme.colors.background.highlight}; |
| 25 | + } |
| 26 | + cursor: pointer; |
| 27 | +
|
| 28 | + :hover { |
| 29 | + background-color: ${({ theme }) => theme.colors.background.highlight}; |
| 30 | + } |
| 31 | +
|
| 32 | + & > svg { |
| 33 | + color: ${({ theme }) => theme.colors.gray[4]}; |
| 34 | + } |
| 35 | +` |
| 36 | +export const ComboboxRoot = styled.div<{ isOpen: boolean }>` |
| 37 | + :hover { |
| 38 | + ${ComboboxItem} { |
| 39 | + &.highlight { |
| 40 | + &:hover { |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | + /* &.reversed { |
| 46 | + transform: rotate(180deg); |
| 47 | + ${ComboboxItem} { |
| 48 | + transform: rotate(-180deg); |
| 49 | + } |
| 50 | + } */ |
| 51 | +
|
| 52 | + ${({ isOpen, theme }) => |
| 53 | + isOpen && |
| 54 | + css` |
| 55 | + top: -9999px; |
| 56 | + left: -9999px; |
| 57 | + position: absolute; |
| 58 | + padding: 0; |
| 59 | + background: none !important; |
| 60 | + display: flex; |
| 61 | + margin: 0; |
| 62 | + z-index: 11; |
| 63 | + height: fit-content; |
| 64 | +
|
| 65 | + > div { |
| 66 | + background: ${theme.colors.background.modal}; |
| 67 | + height: fit-content; |
| 68 | + /* max-height: 400px; */ |
| 69 | + box-shadow: rgba(0, 0, 0, 0.133) 0 3.2px 7.2px 0, rgba(0, 0, 0, 0.11) 0 0.6px 1.8px 0; |
| 70 | + border-radius: ${theme.borderRadius.small}; |
| 71 | +
|
| 72 | + > section { |
| 73 | + max-height: 30vh; |
| 74 | + overflow-y: auto; |
| 75 | + overflow-x: hidden; |
| 76 | + } |
| 77 | + } |
| 78 | + `} |
| 79 | +` |
| 80 | + |
| 81 | +export const ItemTitle = styled.div` |
| 82 | + text-overflow: ellipsis; |
| 83 | + white-space: nowrap; |
| 84 | + overflow: hidden; |
| 85 | + /* width: 200px; */ |
| 86 | +` |
| 87 | + |
| 88 | +export const ItemRightIcons = styled.div` |
| 89 | + display: flex; |
| 90 | + flex-gap: ${({ theme }) => theme.spacing.tiny}; |
| 91 | +` |
| 92 | + |
| 93 | +export const ItemDesc = styled.div` |
| 94 | + margin: ${({ theme }) => theme.spacing.tiny} 0; |
| 95 | + color: ${({ theme }) => theme.colors.text.fade}; |
| 96 | + font-size: 0.8rem; |
| 97 | + white-space: nowrap; |
| 98 | + overflow: hidden; |
| 99 | + text-overflow: ellipsis; |
| 100 | +` |
| 101 | +export const ItemCenterWrapper = styled.div` |
| 102 | + width: 90%; |
| 103 | +` |
0 commit comments