2023-07-07 21:26:12 +00:00
|
|
|
@import '../variables.less';
|
|
|
|
@import '../mixins.less';
|
|
|
|
|
2021-05-17 20:34:14 +00:00
|
|
|
.citizen-typeahead {
|
|
|
|
position: absolute;
|
2023-07-10 19:13:21 +00:00
|
|
|
top: 100%;
|
2024-05-28 02:47:46 +00:00
|
|
|
left: -1px; // IDK why is it off by 1px
|
2023-07-28 01:19:27 +00:00
|
|
|
box-sizing: content-box; // Magic to align with search input
|
2021-05-17 20:34:14 +00:00
|
|
|
width: 100%;
|
2023-01-16 22:36:45 +00:00
|
|
|
max-height: ~'calc( var( --header-card-maxheight ) - var( --height-search-bar ) )';
|
2024-05-28 02:47:46 +00:00
|
|
|
margin: 0; // Reset <ol> styles
|
2023-07-28 01:19:27 +00:00
|
|
|
overflow: auto;
|
2022-12-18 06:09:42 +00:00
|
|
|
overscroll-behavior: contain;
|
2024-05-28 02:47:46 +00:00
|
|
|
border-top-color: transparent;
|
2023-07-28 01:19:27 +00:00
|
|
|
border-bottom-right-radius: var( --border-radius--medium );
|
|
|
|
border-bottom-left-radius: var( --border-radius--medium );
|
2023-03-01 20:02:34 +00:00
|
|
|
.citizen-card( false );
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2023-06-15 18:37:07 +00:00
|
|
|
a {
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 01:22:16 +00:00
|
|
|
&-input {
|
|
|
|
// Display overlay instead of the input, but keep the caret
|
|
|
|
color: transparent;
|
|
|
|
caret-color: var( --color-base--emphasized );
|
|
|
|
|
|
|
|
&-group {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-overlay {
|
|
|
|
position: absolute;
|
2023-08-30 14:31:26 +00:00
|
|
|
inset: 0 var( --height-search-bar ) 0 0; // clear button
|
2023-08-29 01:22:16 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2023-08-29 19:32:28 +00:00
|
|
|
overflow: hidden;
|
2024-02-26 22:16:07 +00:00
|
|
|
font-size: var( --font-size-small );
|
2023-08-29 19:32:28 +00:00
|
|
|
white-space: nowrap;
|
2023-09-06 21:34:47 +00:00
|
|
|
pointer-events: none;
|
2023-08-29 01:22:16 +00:00
|
|
|
|
|
|
|
// HACK: Target mobile Safari only to prevent auto zooming the input field
|
|
|
|
@supports (-webkit-touch-callout: none) {
|
|
|
|
font-size: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-query {
|
|
|
|
color: var( --color-base--emphasized );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 08:50:55 +00:00
|
|
|
&-item {
|
|
|
|
&-group {
|
|
|
|
&-list {
|
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
|
|
|
}
|
2023-11-03 21:25:30 +00:00
|
|
|
|
|
|
|
// FIXME: Use a generic attribute
|
2024-05-22 02:14:58 +00:00
|
|
|
&[ data-mw-citizen-typeahead-group='action' ] .citizen-typeahead-item-group-list {
|
2023-11-03 21:25:30 +00:00
|
|
|
display: flex;
|
|
|
|
gap: var( --space-xxs );
|
|
|
|
padding-right: var( --space-sm );
|
|
|
|
padding-left: var( --space-sm );
|
|
|
|
margin-top: var( --space-xs );
|
|
|
|
margin-bottom: var( --space-xs );
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
2023-08-29 08:50:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-14 04:52:54 +00:00
|
|
|
&__item {
|
2022-12-04 07:13:37 +00:00
|
|
|
&--active {
|
2023-08-26 00:03:38 +00:00
|
|
|
background-color: var( --background-color-quiet--hover );
|
2021-05-17 20:34:14 +00:00
|
|
|
}
|
2022-12-06 17:01:47 +00:00
|
|
|
|
2022-12-14 04:52:54 +00:00
|
|
|
&--hidden {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-12-06 19:27:08 +00:00
|
|
|
|
2023-11-03 21:25:30 +00:00
|
|
|
&-chip {
|
2023-11-06 03:41:42 +00:00
|
|
|
white-space: nowrap;
|
2023-11-06 03:42:30 +00:00
|
|
|
border-radius: var( --border-radius--medium );
|
2023-11-03 21:25:30 +00:00
|
|
|
|
|
|
|
.citizen-typeahead {
|
|
|
|
&__content {
|
|
|
|
padding: var( --space-xs ) var( --space-sm );
|
|
|
|
margin: 0;
|
|
|
|
border: 1px solid var( --border-color-base );
|
|
|
|
border-radius: var( --border-radius--medium );
|
|
|
|
}
|
|
|
|
|
|
|
|
&__thumbnail {
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-01 21:31:42 +00:00
|
|
|
&-sm {
|
2024-02-26 22:16:07 +00:00
|
|
|
font-size: var( --font-size-small );
|
2023-08-29 08:50:55 +00:00
|
|
|
|
2022-12-14 04:52:54 +00:00
|
|
|
.citizen-typeahead {
|
|
|
|
&__content {
|
2023-03-01 21:31:42 +00:00
|
|
|
padding: var( --space-sm ) 0;
|
2022-12-14 04:52:54 +00:00
|
|
|
}
|
2022-12-06 17:01:47 +00:00
|
|
|
|
2022-12-14 04:52:54 +00:00
|
|
|
&__thumbnail {
|
2023-03-01 21:31:42 +00:00
|
|
|
height: var( --size-icon );
|
|
|
|
background-color: transparent;
|
|
|
|
|
2023-08-29 08:50:55 +00:00
|
|
|
&.citizen-ui-icon {
|
|
|
|
width: var( --size-icon );
|
|
|
|
}
|
2023-03-01 21:31:42 +00:00
|
|
|
}
|
|
|
|
}
|
2022-12-14 04:52:54 +00:00
|
|
|
}
|
2022-12-06 18:52:14 +00:00
|
|
|
|
2023-03-01 21:31:42 +00:00
|
|
|
&-md {
|
2022-12-14 04:52:54 +00:00
|
|
|
.citizen-typeahead {
|
|
|
|
&__thumbnail {
|
|
|
|
background-color: #eaecf0;
|
|
|
|
background-position: center;
|
|
|
|
background-size: cover;
|
2023-09-06 21:41:42 +00:00
|
|
|
border-radius: var( --border-radius--medium );
|
2022-12-14 04:52:54 +00:00
|
|
|
|
|
|
|
&.citizen-ui-icon {
|
2023-08-30 14:31:26 +00:00
|
|
|
width: 100%;
|
2022-12-14 04:52:54 +00:00
|
|
|
height: 60px;
|
|
|
|
background-color: var( --color-surface-3 );
|
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
&::before {
|
2022-12-14 04:52:54 +00:00
|
|
|
background-size: 20px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-06 18:52:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-01 21:31:42 +00:00
|
|
|
&-lg {
|
2022-12-14 04:52:54 +00:00
|
|
|
.citizen-typeahead {
|
|
|
|
&__content {
|
2023-03-01 21:31:42 +00:00
|
|
|
flex-direction: column;
|
|
|
|
padding: var( --space-xl ) 0;
|
|
|
|
text-align: center;
|
2022-12-14 04:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__thumbnail {
|
2023-03-01 21:31:42 +00:00
|
|
|
margin-bottom: var( --space-sm );
|
2022-12-14 15:28:45 +00:00
|
|
|
}
|
2022-12-14 04:52:54 +00:00
|
|
|
}
|
2022-12-06 17:01:47 +00:00
|
|
|
}
|
2023-08-26 23:48:28 +00:00
|
|
|
|
2023-08-29 19:32:28 +00:00
|
|
|
&-sm,
|
|
|
|
&-md {
|
|
|
|
.citizen-typeahead {
|
|
|
|
&__thumbnail {
|
|
|
|
margin-right: var( --space-sm );
|
|
|
|
}
|
|
|
|
|
|
|
|
&__text {
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 08:50:55 +00:00
|
|
|
&-md,
|
|
|
|
&-lg {
|
|
|
|
.citizen-typeahead {
|
|
|
|
&__title {
|
|
|
|
font-weight: var( --font-weight-semibold );
|
|
|
|
}
|
2023-08-26 23:48:28 +00:00
|
|
|
|
2023-08-29 08:50:55 +00:00
|
|
|
&__description {
|
|
|
|
margin-top: 0.1rem;
|
2023-08-26 23:48:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2022-12-05 20:29:17 +00:00
|
|
|
padding: var( --space-xs ) 0;
|
|
|
|
margin: 0 var( --space-sm );
|
2022-12-04 07:13:37 +00:00
|
|
|
color: var( --color-base );
|
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__thumbnail {
|
2023-07-28 01:19:27 +00:00
|
|
|
flex-shrink: 0;
|
2022-12-06 17:01:47 +00:00
|
|
|
width: 100%;
|
2023-08-24 22:23:46 +00:00
|
|
|
max-width: 60px;
|
2022-12-04 07:13:37 +00:00
|
|
|
height: 60px;
|
2023-07-28 01:19:27 +00:00
|
|
|
overflow: hidden;
|
2022-12-03 19:12:01 +00:00
|
|
|
|
2023-02-28 21:59:36 +00:00
|
|
|
&.citizen-ui-icon::before {
|
2022-12-06 19:27:08 +00:00
|
|
|
background-size: contain;
|
2022-05-20 23:10:36 +00:00
|
|
|
}
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__text {
|
|
|
|
flex-grow: 1;
|
2023-07-28 01:19:27 +00:00
|
|
|
overflow: hidden;
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
2022-05-20 23:10:36 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
2022-12-03 19:12:01 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__title {
|
|
|
|
flex-shrink: 0;
|
2023-07-28 01:19:27 +00:00
|
|
|
color: var( --color-base--emphasized );
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__highlight {
|
|
|
|
font-weight: var( --font-weight-medium );
|
2023-07-28 01:19:27 +00:00
|
|
|
color: var( --color-base--subtle );
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
|
|
|
|
2022-12-13 23:25:14 +00:00
|
|
|
&__query {
|
|
|
|
font-weight: var( --font-weight-semibold );
|
2023-07-28 01:19:27 +00:00
|
|
|
color: var( --color-base--emphasized );
|
2022-12-13 23:25:14 +00:00
|
|
|
}
|
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__label {
|
|
|
|
display: flex;
|
2023-07-28 01:19:27 +00:00
|
|
|
gap: var( --space-xxs );
|
2022-12-04 07:13:37 +00:00
|
|
|
margin-left: var( --space-xs );
|
2024-02-26 22:14:19 +00:00
|
|
|
font-size: var( --font-size-x-small );
|
2023-07-28 01:19:27 +00:00
|
|
|
color: var( --color-base );
|
2021-05-17 20:34:14 +00:00
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
.citizen-ui-icon {
|
|
|
|
width: 0.8125rem;
|
|
|
|
height: 0.8125rem;
|
|
|
|
margin-right: var( --space-xxs );
|
2021-05-17 20:34:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-04 07:13:37 +00:00
|
|
|
&__labelItem {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__description {
|
2024-02-26 22:14:19 +00:00
|
|
|
font-size: var( --font-size-x-small );
|
2023-07-28 01:19:27 +00:00
|
|
|
color: var( --color-base--subtle );
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__title,
|
|
|
|
&__description {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
2022-12-06 17:01:47 +00:00
|
|
|
&__actions {
|
|
|
|
position: absolute;
|
|
|
|
right: var( --space-sm );
|
2021-05-17 20:34:14 +00:00
|
|
|
}
|
|
|
|
|
2022-12-05 20:52:36 +00:00
|
|
|
&__keyboard {
|
|
|
|
display: none;
|
|
|
|
padding: 0 8px;
|
|
|
|
background-color: var( --color-surface-1 );
|
2023-07-28 01:19:27 +00:00
|
|
|
border-radius: var( --border-radius--small );
|
2022-12-05 20:52:36 +00:00
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
}
|
2022-09-28 21:02:15 +00:00
|
|
|
|
2024-05-28 02:47:46 +00:00
|
|
|
.citizen-search__card:has( .citizen-typeahead ) {
|
|
|
|
border-bottom-color: transparent;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
2023-03-01 20:27:29 +00:00
|
|
|
|
2024-05-28 02:47:46 +00:00
|
|
|
.citizen-typeahead {
|
|
|
|
border-top-color: transparent;
|
2023-03-01 20:27:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-05 20:52:36 +00:00
|
|
|
// HACK: This is as close as we can to detect whether there is a keyboard in CSS
|
|
|
|
@media ( hover: hover ) and ( pointer: fine ) {
|
|
|
|
.citizen-typeahead {
|
|
|
|
&__item--active {
|
|
|
|
.citizen-typeahead__keyboard {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-28 21:02:15 +00:00
|
|
|
// HACK: Hide default MW search suggestion if it somehow loaded
|
|
|
|
// This should be removed when we switch to vue search
|
|
|
|
.suggestions {
|
2022-11-08 05:25:40 +00:00
|
|
|
display: none !important;
|
2022-09-28 21:02:15 +00:00
|
|
|
}
|