|
| 1 | +.search__control { |
| 2 | + overflow: hidden; |
| 3 | + display: inline-flex; |
| 4 | + justify-content: space-between; |
| 5 | + width: 250px; |
| 6 | + border-radius: 6px; |
| 7 | + font-size: 16px; |
| 8 | + line-height: 1; |
| 9 | + outline: none; |
| 10 | + background-color: white; |
| 11 | + border: 1px solid hsl(240 6% 90%); |
| 12 | + color: hsl(240 4% 16%); |
| 13 | + transition: |
| 14 | + border-color 250ms, |
| 15 | + color 250ms; |
| 16 | +} |
| 17 | + |
| 18 | +.search__control_multi { |
| 19 | + width: 100%; |
| 20 | + min-width: 250px; |
| 21 | + max-width: 300px; |
| 22 | +} |
| 23 | + |
| 24 | +.search__input { |
| 25 | + appearance: none; |
| 26 | + display: inline-flex; |
| 27 | + width: 100%; |
| 28 | + min-height: 40px; |
| 29 | + padding-left: 16px; |
| 30 | + font-size: 16px; |
| 31 | + background: transparent; |
| 32 | + border-top-left-radius: 6px; |
| 33 | + border-bottom-left-radius: 6px; |
| 34 | + outline: none; |
| 35 | +} |
| 36 | + |
| 37 | +.search__input::placeholder { |
| 38 | + color: hsl(240 4% 46%); |
| 39 | +} |
| 40 | + |
| 41 | +.search__indicator { |
| 42 | + appearance: none; |
| 43 | + display: inline-flex; |
| 44 | + justify-content: center; |
| 45 | + align-items: center; |
| 46 | + width: auto; |
| 47 | + outline: none; |
| 48 | + padding: 0 10px; |
| 49 | + background-color: hsl(240 5% 96%); |
| 50 | + border-right: 1px solid hsl(240 6% 90%); |
| 51 | + color: hsl(240 4% 16%); |
| 52 | + font-size: 16px; |
| 53 | + line-height: 0; |
| 54 | + transition: 250ms background-color; |
| 55 | +} |
| 56 | + |
| 57 | +.search__icon { |
| 58 | + height: 20px; |
| 59 | + width: 20px; |
| 60 | + flex: 0 0 16px; |
| 61 | + display: grid; |
| 62 | + justify-items: center; |
| 63 | +} |
| 64 | + |
| 65 | +.load__icon { |
| 66 | + height: 20px; |
| 67 | + width: 20px; |
| 68 | + display: grid; |
| 69 | + justify-items: center; |
| 70 | + flex: 0 0 14px; |
| 71 | +} |
| 72 | + |
| 73 | +.center__icon { |
| 74 | + margin: auto; |
| 75 | +} |
| 76 | + |
| 77 | +.spin__icon { |
| 78 | + animation: spin 600ms linear; |
| 79 | + animation-iteration-count: infinite; |
| 80 | + margin: auto; |
| 81 | +} |
| 82 | + |
| 83 | +.search__description { |
| 84 | + margin-top: 8px; |
| 85 | + color: hsl(240 5% 26%); |
| 86 | + font-size: 12px; |
| 87 | + user-select: none; |
| 88 | +} |
| 89 | + |
| 90 | +.search__content { |
| 91 | + background-color: white; |
| 92 | + border-radius: 6px; |
| 93 | + border: 1px solid hsl(240 6% 90%); |
| 94 | + box-shadow: |
| 95 | + 0 4px 6px -1px rgb(0 0 0 / 0.1), |
| 96 | + 0 2px 4px -2px rgb(0 0 0 / 0.1); |
| 97 | + transform-origin: var(--kb-search-content-transform-origin); |
| 98 | + animation: contentHide 250ms ease-in forwards; |
| 99 | +} |
| 100 | + |
| 101 | +.search__content[data-expanded] { |
| 102 | + animation: contentShow 250ms ease-out; |
| 103 | +} |
| 104 | + |
| 105 | +.search__listbox { |
| 106 | + overflow-y: auto; |
| 107 | + max-height: 360px; |
| 108 | + padding: 8px; |
| 109 | + display: grid; |
| 110 | + grid-template-columns: 1fr 1fr 1fr 1fr 1fr; |
| 111 | + row-gap: 6px; |
| 112 | + column-gap: 6px; |
| 113 | + line-height: 1; |
| 114 | +} |
| 115 | + |
| 116 | +.search__listbox:focus { |
| 117 | + outline: none; |
| 118 | +} |
| 119 | + |
| 120 | +.search__item { |
| 121 | + font-size: 24px; |
| 122 | + line-height: 1; |
| 123 | + color: hsl(240 4% 16%); |
| 124 | + border-radius: 16px; |
| 125 | + padding: 8px; |
| 126 | + position: relative; |
| 127 | + user-select: none; |
| 128 | + outline: none; |
| 129 | + display: grid; |
| 130 | + justify-items: center; |
| 131 | +} |
| 132 | + |
| 133 | +.search__item[data-disabled] { |
| 134 | + color: hsl(240 5% 65%); |
| 135 | + opacity: 0.5; |
| 136 | + pointer-events: none; |
| 137 | +} |
| 138 | + |
| 139 | +.search__item[data-highlighted] { |
| 140 | + outline: none; |
| 141 | + box-sizing: border-box; |
| 142 | + box-shadow: inset 0 0 0 2px hsl(200 98% 39%); |
| 143 | +} |
| 144 | + |
| 145 | +.search__section { |
| 146 | + padding: 8px 0 0 8px; |
| 147 | + font-size: 14px; |
| 148 | + line-height: 32px; |
| 149 | + color: hsl(240 4% 46%); |
| 150 | +} |
| 151 | + |
| 152 | +.search__no_result { |
| 153 | + text-align: center; |
| 154 | + padding: 8px; |
| 155 | + padding-bottom: 24px; |
| 156 | + margin: auto; |
| 157 | + color: hsl(240 4% 46%); |
| 158 | +} |
| 159 | + |
| 160 | +@keyframes spin { |
| 161 | + from { |
| 162 | + transform: rotate(0deg); |
| 163 | + } |
| 164 | + to { |
| 165 | + transform: rotate(360deg); |
| 166 | + } |
| 167 | +} |
| 168 | + |
| 169 | +@keyframes contentShow { |
| 170 | + from { |
| 171 | + opacity: 0; |
| 172 | + transform: translateY(-8px); |
| 173 | + } |
| 174 | + to { |
| 175 | + opacity: 1; |
| 176 | + transform: translateY(0); |
| 177 | + } |
| 178 | +} |
| 179 | + |
| 180 | +@keyframes contentHide { |
| 181 | + from { |
| 182 | + opacity: 1; |
| 183 | + transform: translateY(0); |
| 184 | + } |
| 185 | + to { |
| 186 | + opacity: 0; |
| 187 | + transform: translateY(-8px); |
| 188 | + } |
| 189 | +} |
| 190 | + |
| 191 | +[data-kb-theme="dark"] .search__control { |
| 192 | + background-color: hsl(240 4% 16%); |
| 193 | + border: 1px solid hsl(240 5% 34%); |
| 194 | + color: hsl(0 100% 100% / 0.9); |
| 195 | +} |
| 196 | + |
| 197 | +[data-kb-theme="dark"] .search__control:hover { |
| 198 | + border-color: hsl(240 4% 46%); |
| 199 | +} |
| 200 | + |
| 201 | +[data-kb-theme="dark"] .search__input::placeholder { |
| 202 | + color: hsl(0 100% 100% / 0.5); |
| 203 | +} |
| 204 | + |
| 205 | +[data-kb-theme="dark"] .search__indicator { |
| 206 | + background: hsl(240 5% 26%); |
| 207 | + border-right: 1px solid hsl(240 5% 34%); |
| 208 | + color: hsl(0 100% 100% / 0.9); |
| 209 | +} |
| 210 | + |
| 211 | +[data-kb-theme="dark"] .search__content { |
| 212 | + border: 1px solid hsl(240 5% 26%); |
| 213 | + background-color: hsl(240 4% 16%); |
| 214 | + box-shadow: none; |
| 215 | +} |
| 216 | + |
| 217 | +[data-kb-theme="dark"] .search__section { |
| 218 | + color: hsl(0 100% 100% / 0.7); |
| 219 | +} |
| 220 | + |
| 221 | +[data-kb-theme="dark"] .search__item { |
| 222 | + color: hsl(0 100% 100% / 0.9); |
| 223 | +} |
| 224 | + |
| 225 | +[data-kb-theme="dark"] .search__description { |
| 226 | + color: hsl(0 100% 100% / 0.7); |
| 227 | +} |
| 228 | + |
| 229 | +.result__content { |
| 230 | + margin-top: 16px; |
| 231 | + font-size: 16px; |
| 232 | + line-height: 1; |
| 233 | +} |
| 234 | + |
| 235 | +.search__root_cmdk { |
| 236 | + min-height: 240px; |
| 237 | + min-width: 250px; |
| 238 | + display: flex; |
| 239 | + flex-direction: column; |
| 240 | +} |
| 241 | + |
| 242 | +.search__control_cmdk { |
| 243 | + overflow: hidden; |
| 244 | + display: inline-flex; |
| 245 | + justify-content: space-between; |
| 246 | + border-radius: 12px 12px 0 0; |
| 247 | + font-size: 16px; |
| 248 | + line-height: 1; |
| 249 | + outline: none; |
| 250 | + background-color: white; |
| 251 | + border: 1px solid hsl(240 6% 90%); |
| 252 | + color: hsl(240 4% 16%); |
| 253 | + transition: |
| 254 | + border-color 250ms, |
| 255 | + color 250ms; |
| 256 | +} |
| 257 | + |
| 258 | +.search__content_cmdk { |
| 259 | + height: 100%; |
| 260 | + flex-grow: 1; |
| 261 | + background-color: white; |
| 262 | + border-radius: 0 0 12px 12px; |
| 263 | + border: 1px solid hsl(240 6% 90%); |
| 264 | + border-top: none; |
| 265 | + display: flex; |
| 266 | + flex-direction: column; |
| 267 | +} |
| 268 | + |
| 269 | +.search__no_result_cmdk { |
| 270 | + text-align: center; |
| 271 | + margin: auto; |
| 272 | + padding-bottom: 24px; |
| 273 | + color: hsl(240 4% 46%); |
| 274 | +} |
| 275 | + |
| 276 | +[data-kb-theme="dark"] .search__control_cmdk { |
| 277 | + background-color: hsl(240 4% 16%); |
| 278 | + border: 1px solid hsl(240 5% 34%); |
| 279 | + color: hsl(0 100% 100% / 0.9); |
| 280 | +} |
| 281 | + |
| 282 | +[data-kb-theme="dark"] .search__content_cmdk { |
| 283 | + background-color: hsl(240 4% 16%); |
| 284 | + border: 1px solid hsl(240 5% 34%); |
| 285 | +} |
0 commit comments