2023-07-07 21:26:12 +00:00
|
|
|
@import '../variables.less';
|
|
|
|
@import '../mixins.less';
|
|
|
|
|
2021-05-17 20:34:14 +00:00
|
|
|
.citizen-typeahead {
|
2024-09-26 21:47:19 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: var( --space-xs );
|
2024-09-26 23:29:56 +00:00
|
|
|
margin: 0;
|
2024-09-26 19:51:36 +00:00
|
|
|
list-style: none;
|
2024-07-05 17:24:31 +00:00
|
|
|
border-bottom-right-radius: var( --border-radius-medium );
|
|
|
|
border-bottom-left-radius: var( --border-radius-medium );
|
2024-09-26 18:55:49 +00:00
|
|
|
|
2024-09-26 23:29:56 +00:00
|
|
|
> li {
|
|
|
|
&:first-of-type {
|
2024-09-27 02:00:13 +00:00
|
|
|
margin-top: var( --space-xxs );
|
2024-09-26 23:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:last-of-type {
|
2024-09-27 02:00:13 +00:00
|
|
|
margin-bottom: var( --space-xxs );
|
2024-09-26 23:29:56 +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;
|
2024-06-30 05:04:30 +00:00
|
|
|
caret-color: var( --color-emphasized );
|
2023-08-29 01:22:16 +00:00
|
|
|
|
|
|
|
&-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;
|
|
|
|
white-space: nowrap;
|
2023-09-06 21:34:47 +00:00
|
|
|
pointer-events: none;
|
2023-08-29 01:22:16 +00:00
|
|
|
|
|
|
|
&-query {
|
2024-06-30 05:04:30 +00:00
|
|
|
color: var( --color-emphasized );
|
2023-08-29 01:22:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 );
|
|
|
|
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 {
|
2024-07-01 00:41:31 +00:00
|
|
|
background-color: var( --background-color-button-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;
|
2024-07-05 17:24:31 +00:00
|
|
|
border-radius: var( --border-radius-medium );
|
2023-11-03 21:25:30 +00:00
|
|
|
|
|
|
|
.citizen-typeahead {
|
|
|
|
&__content {
|
2024-09-27 02:00:13 +00:00
|
|
|
gap: var( --space-xs );
|
2024-09-27 02:18:29 +00:00
|
|
|
padding-right: var( --space-sm );
|
|
|
|
padding-left: var( --space-sm );
|
2023-11-03 21:25:30 +00:00
|
|
|
margin: 0;
|
2024-07-15 06:07:25 +00:00
|
|
|
border: var( --border-width-base ) solid var( --border-color-base );
|
2024-07-05 17:24:31 +00:00
|
|
|
border-radius: var( --border-radius-medium );
|
2023-11-03 21:25:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__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 {
|
2024-09-26 21:58:53 +00:00
|
|
|
padding-top: var( --space-sm );
|
|
|
|
padding-bottom: var( --space-sm );
|
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;
|
2024-07-05 17:24:31 +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 );
|
|
|
|
|
2024-07-05 20:28:33 +00:00
|
|
|
.citizen-typeahead &::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;
|
2024-09-26 21:58:53 +00:00
|
|
|
padding-top: var( --space-xl );
|
|
|
|
padding-bottom: var( --space-xl );
|
2023-03-01 21:31:42 +00:00
|
|
|
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 {
|
2024-09-26 18:55:49 +00:00
|
|
|
font-size: var( --font-size-medium );
|
2023-08-29 08:50:55 +00:00
|
|
|
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;
|
2024-09-27 02:18:29 +00:00
|
|
|
padding: var( --space-xs ) var( --space-md );
|
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
|
|
|
|
2024-07-05 20:28:33 +00:00
|
|
|
// Needed the specificity, we should refactor this
|
|
|
|
.citizen-typeahead &.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;
|
2024-06-30 05:04:30 +00:00
|
|
|
color: var( --color-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 );
|
2024-06-30 05:04:30 +00:00
|
|
|
color: var( --color-subtle );
|
2022-12-04 07:13:37 +00:00
|
|
|
}
|
|
|
|
|
2022-12-13 23:25:14 +00:00
|
|
|
&__query {
|
|
|
|
font-weight: var( --font-weight-semibold );
|
2024-06-30 05:04:30 +00:00
|
|
|
color: var( --color-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 );
|
2024-09-26 19:51:36 +00:00
|
|
|
font-size: var( --font-size-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
|
|
|
&__labelItem {
|
|
|
|
display: flex;
|
2024-09-26 19:51:36 +00:00
|
|
|
gap: var( --space-xxs );
|
2022-12-04 07:13:37 +00:00
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2024-09-26 19:51:36 +00:00
|
|
|
&__description,
|
|
|
|
&__labelItem {
|
2024-02-26 22:14:19 +00:00
|
|
|
font-size: var( --font-size-x-small );
|
2024-06-30 05:04:30 +00:00
|
|
|
color: var( --color-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 );
|
2024-07-05 17:24:31 +00:00
|
|
|
border-radius: var( --border-radius-base );
|
2022-12-05 20:52:36 +00:00
|
|
|
}
|
2021-05-17 20:34:14 +00:00
|
|
|
}
|
2022-09-28 21:02:15 +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
|
|
|
}
|