@depict-ai/react-ui 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/dist/styles/index.scss +1 -54
- package/dist/styles/plain-css-fallback-styling.css +1 -0
- package/dist-server/index.d.ts +1 -1
- package/dist-server/main.js +1 -1
- package/dist-server/module.js +1 -1
- package/package.json +18 -11
- package/dist/styles/components/PLP/Buttons.scss +0 -152
- package/dist/styles/components/PLP/MorphingSign.scss +0 -32
- package/dist/styles/components/PLP/PLPResults.scss +0 -26
- package/dist/styles/components/PLP/ProductListingPage.scss +0 -165
- package/dist/styles/components/PLP/ScrollStatus.scss +0 -28
- package/dist/styles/components/PLP/SelectedFilters.scss +0 -81
- package/dist/styles/components/PLP/SlidableItems.scss +0 -118
- package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +0 -76
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +0 -802
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +0 -157
- package/dist/styles/components/PLP/Toast.scss +0 -61
- package/dist/styles/components/PLP/index.scss +0 -15
- package/dist/styles/components/category/BreadCrumbs.scss +0 -25
- package/dist/styles/components/category/CategoryTitle.scss +0 -33
- package/dist/styles/components/category/QuickLinks.scss +0 -57
- package/dist/styles/components/category/index.scss +0 -7
- package/dist/styles/components/search/Autocomplete.scss +0 -182
- package/dist/styles/components/search/CategorySuggestions.scss +0 -53
- package/dist/styles/components/search/InstantCard.scss +0 -119
- package/dist/styles/components/search/InstantResults.scss +0 -12
- package/dist/styles/components/search/PreviousSearches.scss +0 -83
- package/dist/styles/components/search/SearchField.scss +0 -141
- package/dist/styles/components/search/SearchModal.scss +0 -86
- package/dist/styles/components/search/SearchRecommendations.scss +0 -28
- package/dist/styles/components/search/ShowingResultsFor.scss +0 -7
- package/dist/styles/components/search/index.scss +0 -12
- package/dist/styles/default.css +0 -1
- package/dist/styles/helpers/custom_input.scss +0 -194
- package/dist/styles/helpers/supports-hover.scss +0 -7
- package/dist/styles/helpers/utils.scss +0 -96
- package/dist/styles/package.json +0 -30
- package/dist/styles/variables.scss +0 -295
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
@use "../../../variables";
|
|
2
|
-
@use "../../../helpers/utils";
|
|
3
|
-
@use "sass:map";
|
|
4
|
-
|
|
5
|
-
/// Mobile modal - taking arguments from SortAndFilter mixin so see SortAndFilter docs for more info
|
|
6
|
-
@mixin SortAndFilterModal() {
|
|
7
|
-
$title-font-weight: variables.get-merged(variables.$font-weights-defaults, variables.$font-weights, 400);
|
|
8
|
-
$expanded-title-font-weight: variables.get-merged(variables.$font-weights-defaults, variables.$font-weights, 600);
|
|
9
|
-
$sort-and-filter-modal-background: #fff;
|
|
10
|
-
$mobile-top-level-collapse-background: $sort-and-filter-modal-background;
|
|
11
|
-
$mobile-top-level-collapse-color: variables.get-text-color("base", "default");
|
|
12
|
-
|
|
13
|
-
.depict-filter-sort-modal-backdrop {
|
|
14
|
-
@include utils.modal-backdrop($background: rgba(0, 0, 0, 0.7), $z-index: variables.$base-z-index);
|
|
15
|
-
will-change: opacity;
|
|
16
|
-
opacity: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.dismiss-modal {
|
|
20
|
-
background: transparent;
|
|
21
|
-
padding: 0;
|
|
22
|
-
line-height: 0;
|
|
23
|
-
border: none;
|
|
24
|
-
position: fixed;
|
|
25
|
-
top: 14px;
|
|
26
|
-
transform: translateY(calc(-100% - 14px));
|
|
27
|
-
left: 4px;
|
|
28
|
-
z-index: variables.$base-z-index + 3;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
svg {
|
|
31
|
-
transform: scale(0.6646);
|
|
32
|
-
path {
|
|
33
|
-
fill: #fff;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.filter-sort-modal {
|
|
39
|
-
z-index: calc(#{variables.$base-z-index} + 2);
|
|
40
|
-
position: fixed;
|
|
41
|
-
top: 0;
|
|
42
|
-
left: 30px;
|
|
43
|
-
width: calc(100% - 30px);
|
|
44
|
-
height: 100%;
|
|
45
|
-
background: $sort-and-filter-modal-background;
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
will-change: transform;
|
|
50
|
-
transform: translateY(100%);
|
|
51
|
-
|
|
52
|
-
// the toggles that close/expand the whole sorting and filter section on mobile
|
|
53
|
-
details {
|
|
54
|
-
&.sorting,
|
|
55
|
-
&.filters {
|
|
56
|
-
& > summary {
|
|
57
|
-
list-style: none;
|
|
58
|
-
&::-webkit-details-marker {
|
|
59
|
-
display: none;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
.sort-filter-summary > .summary {
|
|
63
|
-
border-top: 1px solid #f4f4f4;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
|
|
66
|
-
color: $mobile-top-level-collapse-color;
|
|
67
|
-
padding: 13px 20px;
|
|
68
|
-
background: $mobile-top-level-collapse-background;
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: space-between;
|
|
71
|
-
@if $title-font-weight {
|
|
72
|
-
font-weight: $title-font-weight;
|
|
73
|
-
}
|
|
74
|
-
.left-els {
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
@include utils.flex-gap(10px, "row nowrap");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
&[open] {
|
|
82
|
-
.sort-filter-summary > .summary {
|
|
83
|
-
@if $expanded-title-font-weight {
|
|
84
|
-
font-weight: $expanded-title-font-weight;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
.filter-icon,
|
|
90
|
-
.sort-icon {
|
|
91
|
-
fill: $mobile-top-level-collapse-color;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
& > .body {
|
|
95
|
-
overflow-y: auto;
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
@include utils.flex-gap(2px, "column nowrap");
|
|
99
|
-
}
|
|
100
|
-
.filters,
|
|
101
|
-
.sorting {
|
|
102
|
-
.body {
|
|
103
|
-
color: variables.get-text-color("neutral", "default");
|
|
104
|
-
}
|
|
105
|
-
& > summary {
|
|
106
|
-
.morphing-sign span {
|
|
107
|
-
background: $mobile-top-level-collapse-color;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.filters {
|
|
113
|
-
.filter-collapsible-body {
|
|
114
|
-
background: transparent;
|
|
115
|
-
}
|
|
116
|
-
.body {
|
|
117
|
-
padding: 10px;
|
|
118
|
-
background: unset;
|
|
119
|
-
|
|
120
|
-
.filter-part,
|
|
121
|
-
.view-more-clear {
|
|
122
|
-
background: rgb(253, 253, 253);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
.sorting .body {
|
|
127
|
-
margin: 10px;
|
|
128
|
-
background: rgb(238, 238, 240);
|
|
129
|
-
border-radius: variables.$border-radius;
|
|
130
|
-
padding: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.bottom-row {
|
|
134
|
-
flex-shrink: 0;
|
|
135
|
-
padding: 10px;
|
|
136
|
-
display: flex;
|
|
137
|
-
justify-content: space-between;
|
|
138
|
-
@include utils.flex-gap(10px, "row nowrap");
|
|
139
|
-
|
|
140
|
-
& > button {
|
|
141
|
-
padding-top: 12px;
|
|
142
|
-
padding-bottom: 12px;
|
|
143
|
-
border-radius: variables.$border-radius;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.show-results {
|
|
147
|
-
flex-grow: 1;
|
|
148
|
-
font-weight: 500;
|
|
149
|
-
font-size: 1.1em;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.clear {
|
|
153
|
-
font-size: 1.1em;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
@use "../../variables";
|
|
2
|
-
@use "../../helpers/utils";
|
|
3
|
-
|
|
4
|
-
/// Toast is a small, unobtrusive, banner that appears at the bottom of the page when we clear their filters when going sideways in the category tree (or they do it manually). The Toast has a button that allows them to get their filters back (restore them) in case they want it back.
|
|
5
|
-
/// It's a general component otherwise and might also be used for other messages.
|
|
6
|
-
|
|
7
|
-
@mixin Toast() {
|
|
8
|
-
.depict.plp.toast {
|
|
9
|
-
position: fixed;
|
|
10
|
-
bottom: 10px;
|
|
11
|
-
left: 50%;
|
|
12
|
-
transform: translateX(-50%);
|
|
13
|
-
z-index: calc(#{variables.$base-z-index} + 5);
|
|
14
|
-
background: white;
|
|
15
|
-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
|
|
16
|
-
padding: 10px 20px;
|
|
17
|
-
border-radius: variables.$border-radius;
|
|
18
|
-
border-image-source: linear-gradient(
|
|
19
|
-
90deg,
|
|
20
|
-
variables.$toast-progress-bar-color 0%,
|
|
21
|
-
variables.$toast-progress-bar-color 100%
|
|
22
|
-
);
|
|
23
|
-
border-image-slice: 0 0 100% 0;
|
|
24
|
-
border-bottom-style: solid;
|
|
25
|
-
border-bottom-width: 2px; // doesn't show in chrome sometimes without
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
|
|
28
|
-
*,
|
|
29
|
-
& * {
|
|
30
|
-
user-select: none;
|
|
31
|
-
-webkit-user-select: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media (min-width: 1000px) {
|
|
35
|
-
padding: 10px 40px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&,
|
|
39
|
-
& .buttons {
|
|
40
|
-
display: flex;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
align-items: center;
|
|
43
|
-
@media (max-width: 999px) {
|
|
44
|
-
@include utils.flex-gap(10px, "row nowrap");
|
|
45
|
-
}
|
|
46
|
-
@media (min-width: 1000px) {
|
|
47
|
-
@include utils.flex-gap(30px, "row nowrap");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
& {
|
|
52
|
-
color: variables.get-text-color("base", "default");
|
|
53
|
-
}
|
|
54
|
-
button {
|
|
55
|
-
padding: 5px 20px;
|
|
56
|
-
border-radius: variables.$border-radius;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
}
|
|
59
|
-
@content;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@use "sass:meta";
|
|
2
|
-
|
|
3
|
-
/// Component style mixins for PLP
|
|
4
|
-
/// PLP encompasses both Search and Category page, so you will always need to include these mixins.
|
|
5
|
-
|
|
6
|
-
@forward "SelectedFilters";
|
|
7
|
-
@forward "ScrollStatus";
|
|
8
|
-
@forward "SlidableItems";
|
|
9
|
-
@forward "PLPResults";
|
|
10
|
-
@forward "SortAndFilter/SortAndFilter";
|
|
11
|
-
@forward "SortAndFilter/SortAndFilterModal";
|
|
12
|
-
@forward "SortAndFilter/FloatingButtons";
|
|
13
|
-
@forward "Toast";
|
|
14
|
-
@forward "ProductListingPage";
|
|
15
|
-
@forward "Buttons";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@use "../../variables";
|
|
2
|
-
|
|
3
|
-
/// BreadCrumbs is the trail of links that shows the user where they are in the site hierarchy and allows them to go back up the tree. Often BreadCrumbs are located at the top of the page.
|
|
4
|
-
|
|
5
|
-
@mixin BreadCrumbs() {
|
|
6
|
-
.crumbs {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-wrap: wrap;
|
|
9
|
-
.crumb {
|
|
10
|
-
color: variables.get-text-color("neutral", "default");
|
|
11
|
-
&:hover {
|
|
12
|
-
text-decoration: underline;
|
|
13
|
-
}
|
|
14
|
-
&:last-of-type {
|
|
15
|
-
color: variables.get-text-color("base", "default");
|
|
16
|
-
font-weight: 500;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.separator {
|
|
20
|
-
margin-left: 10px;
|
|
21
|
-
margin-right: 10px;
|
|
22
|
-
color: variables.get-text-color("subtle", "default");
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@use "../../variables";
|
|
2
|
-
@use "../../helpers/utils";
|
|
3
|
-
@use "../../helpers/supports-hover";
|
|
4
|
-
|
|
5
|
-
/// CategoryTitle is the component that shows the title of the current category along with the number of products in it.
|
|
6
|
-
/// This component is optional. When setting up the SDK in TypeScript you can choose between using this component (CategoryTitle) or embedded_num_products which will just show the number of products in the category and allow you to add a title outside of the category page yourself.
|
|
7
|
-
/// You only need to call the mixin if you're using the CategoryTitle component.
|
|
8
|
-
|
|
9
|
-
@mixin CategoryTitle() {
|
|
10
|
-
.category-title {
|
|
11
|
-
overflow-wrap: anywhere;
|
|
12
|
-
font-size: 1.5em;
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
* {
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
}
|
|
20
|
-
.title {
|
|
21
|
-
margin-right: 10px;
|
|
22
|
-
font-weight: 700;
|
|
23
|
-
font-size: inherit;
|
|
24
|
-
}
|
|
25
|
-
.explanation {
|
|
26
|
-
color: variables.get-text-color("subtle", "default");
|
|
27
|
-
font-weight: 500;
|
|
28
|
-
.product-count {
|
|
29
|
-
margin-left: 10px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
@use "../../variables";
|
|
2
|
-
@use "../../helpers/utils";
|
|
3
|
-
@use "../../helpers/supports-hover";
|
|
4
|
-
@use "../PLP/Buttons";
|
|
5
|
-
@use "sass:color";
|
|
6
|
-
@use "sass:map";
|
|
7
|
-
|
|
8
|
-
/// The QuickLinks show the quick links to the subcategories or sibling categories of the current category.
|
|
9
|
-
/// It enables to user to navigate to a subcategory or sibling category without having to go back to the category page.
|
|
10
|
-
|
|
11
|
-
@mixin QuickLinks() {
|
|
12
|
-
.quicklinks {
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
.quicklink {
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
padding: 10px 20px;
|
|
17
|
-
background: variables.get-background-color("base", "default");
|
|
18
|
-
color: variables.get-text-color("base", "default");
|
|
19
|
-
transition: all 75ms ease-in-out;
|
|
20
|
-
border-radius: variables.$border-radius;
|
|
21
|
-
border: 1px solid variables.get-border-color("neutral", "default");
|
|
22
|
-
&:focus {
|
|
23
|
-
outline: none;
|
|
24
|
-
}
|
|
25
|
-
@include supports-hover.supports-hover() {
|
|
26
|
-
&:hover {
|
|
27
|
-
background: variables.get-background-color("base", "hover");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
&:focus-visible {
|
|
31
|
-
background: variables.get-background-color("base", "hover");
|
|
32
|
-
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
33
|
-
}
|
|
34
|
-
&:active {
|
|
35
|
-
background: variables.get-background-color("base", "pressed");
|
|
36
|
-
}
|
|
37
|
-
&.selected {
|
|
38
|
-
color: variables.get-text-color("inverse", "default");
|
|
39
|
-
background: variables.get-background-color("inverse", "default");
|
|
40
|
-
border: 1px solid transparent;
|
|
41
|
-
@include supports-hover.supports-hover() {
|
|
42
|
-
&:hover {
|
|
43
|
-
// should we have this? since it's selected, nothing will happen when clicked
|
|
44
|
-
background: variables.get-background-color("inverse", "hover");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
&:focus-visible {
|
|
48
|
-
background: variables.get-background-color("inverse", "hover");
|
|
49
|
-
filter: map.get(Buttons.get-primary-button-properties(), "focus-visible-filter");
|
|
50
|
-
}
|
|
51
|
-
&:active {
|
|
52
|
-
background: variables.get-background-color("inverse", "pressed");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
@use "../../variables";
|
|
2
|
-
@use "../../helpers/utils";
|
|
3
|
-
@use "PreviousSearches";
|
|
4
|
-
@use "../PLP/Buttons";
|
|
5
|
-
@use "sass:map";
|
|
6
|
-
|
|
7
|
-
/// Autocomplete is the component that displays suggested Categories and Products in the SearchModal, both under the "Suggestions" heading (i18n key `suggestions_`) when the customer hasn't typed anything, and once the customer has started typing.
|
|
8
|
-
/// It also includes previous searches inside of the suggestions provided from the API - when the user hasn't typed though, the PreviousSearches component is shown instead.
|
|
9
|
-
///
|
|
10
|
-
/// ### Explanation of "entries without highlight" and "entries with highlight"
|
|
11
|
-
///
|
|
12
|
-
/// When the user is typing in the input field, we show query and category suggestions from the API and suggestions from the previous searches of the user (which are saved in localStorage).
|
|
13
|
-
/// While the user is typing, we highlight the *new* parts of the query that we are suggesting (what the user hasn't typed). This only happens *if* the suggestion contains the query the user has typed.
|
|
14
|
-
///
|
|
15
|
-
/// The most flexible yet simple way we could come up with to style this is by breaking it down as follows:
|
|
16
|
-
/// Note: "entry" refers to a suggestion from the API or a previous search.
|
|
17
|
-
/// <ol>
|
|
18
|
-
/// <li><b>Entries without highlight:</b><br />
|
|
19
|
-
/// This is the styling for the entries where nothing is highlighted. This is the case when the user hasn't typed anything yet, or when the suggestion doesn't contain the query the user has typed.</li>
|
|
20
|
-
/// <li><b>Entries with highlight:</b><br />
|
|
21
|
-
/// Something is highlighted in this suggestion. This is the case when the user has typed something and the suggestion contains the query the user has typed.
|
|
22
|
-
/// There are two things you can style here:
|
|
23
|
-
/// <ol><li><b>Highlighted part:</b><br />
|
|
24
|
-
/// The styling for the highlighted part of the suggestion.</li>
|
|
25
|
-
/// <li><b>Toned down part:</b><br />
|
|
26
|
-
/// The styling for the part of the suggestion that is not highlighted. This is the part of the suggestion that the user has already typed.</li></ol></li></ol>
|
|
27
|
-
///
|
|
28
|
-
/// @param {Map} $entries-without-highlight [("color": variables.$brand-dark-grey, "font-weight": 400)] - Map between *any* CSS property key to CSS value. The styling for the entries where nothing is highlighted, see the explanation above.
|
|
29
|
-
/// @param {Map} $entries-with-highlight [(
|
|
30
|
-
/// "highlighted-part": (
|
|
31
|
-
/// "color": variables.$brand-dark-grey,
|
|
32
|
-
/// "font-weight": 500
|
|
33
|
-
/// ),
|
|
34
|
-
/// "toned-down-part": (
|
|
35
|
-
/// "color": variables.$brand-dark-grey,
|
|
36
|
-
/// "font-weight": 400
|
|
37
|
-
/// )
|
|
38
|
-
/// )] - Map containing either "toned-down-part" which is a map and/or "highlighted-part" which is also a map. Both of the aforementioned maps can contain *any* CSS property key to CSS value. See the explanation above in the `Explanation of "entries without highlight" and "entries with highlight"`-section.
|
|
39
|
-
/// @example scss - Simple example adding a custom font for the highlighted part of the suggestions
|
|
40
|
-
/// @include search.Autocomplete(
|
|
41
|
-
/// $entries-with-highlight: (
|
|
42
|
-
/// "highlighted-part": (
|
|
43
|
-
/// "font-family": "Gotham Medium",
|
|
44
|
-
/// ),
|
|
45
|
-
/// )
|
|
46
|
-
/// );
|
|
47
|
-
/// @example scss - Example if having bold text doesn't fit your brand and you instead want to make what the user typed "light" but keep the rest "regular":
|
|
48
|
-
/// @include search.Autocomplete(
|
|
49
|
-
/// $entries-without-highlight: (
|
|
50
|
-
/// "font-weight": 400
|
|
51
|
-
/// ),
|
|
52
|
-
/// $entries-with-highlight: (
|
|
53
|
-
/// "highlighted-part": (
|
|
54
|
-
/// "font-weight": 400
|
|
55
|
-
/// ),
|
|
56
|
-
/// "toned-down-part": (
|
|
57
|
-
/// "font-weight": 300
|
|
58
|
-
/// )
|
|
59
|
-
/// )
|
|
60
|
-
/// );
|
|
61
|
-
|
|
62
|
-
@mixin Autocomplete(
|
|
63
|
-
$entries-without-highlight: variables.$autocomplete-entries-without-highlight,
|
|
64
|
-
$entries-with-highlight: variables.$autocomplete-entries-with-highlight
|
|
65
|
-
) {
|
|
66
|
-
$entries-without-highlight-defaults: (
|
|
67
|
-
"color": variables.get-text-color("neutral", "default"),
|
|
68
|
-
"font-weight": variables.get-font-weight(400),
|
|
69
|
-
);
|
|
70
|
-
$entries-with-highlight-defaults: (
|
|
71
|
-
"highlighted-part": (
|
|
72
|
-
"color": variables.get-text-color("neutral", "default"),
|
|
73
|
-
"font-weight": variables.get-font-weight(500),
|
|
74
|
-
),
|
|
75
|
-
"toned-down-part": (
|
|
76
|
-
"color": variables.get-text-color("neutral", "default") y,
|
|
77
|
-
"font-weight": variables.get-font-weight(400),
|
|
78
|
-
),
|
|
79
|
-
);
|
|
80
|
-
$merged-entries-without-highlight: map.deep-merge($entries-without-highlight-defaults, $entries-without-highlight);
|
|
81
|
-
$merged-entries-with-highlight: map.deep-merge($entries-with-highlight-defaults, $entries-with-highlight);
|
|
82
|
-
@include PreviousSearches.PreviousSearches();
|
|
83
|
-
.previous-searches,
|
|
84
|
-
.suggestions {
|
|
85
|
-
.text {
|
|
86
|
-
font-size: 16px;
|
|
87
|
-
font-weight: variables.get-font-weight(700);
|
|
88
|
-
color: variables.get-text-color("neutral", "default");
|
|
89
|
-
margin-top: 0;
|
|
90
|
-
}
|
|
91
|
-
.item,
|
|
92
|
-
.suggestion {
|
|
93
|
-
background: variables.get-background-color("base", "default");
|
|
94
|
-
&.selected {
|
|
95
|
-
background: variables.get-background-color("neutral", "default");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:focus-visible {
|
|
99
|
-
outline: none;
|
|
100
|
-
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&:active {
|
|
104
|
-
background: variables.get-background-color("subtle", "pressed");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@each $property, $value in $merged-entries-without-highlight {
|
|
108
|
-
#{$property}: $value;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
.suggestions {
|
|
113
|
-
display: flex;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
@include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-category-and-other"), "column nowrap");
|
|
116
|
-
|
|
117
|
-
&:not(.compact) > .suggestion-container,
|
|
118
|
-
&.compact > .suggestion-container:not(.query) {
|
|
119
|
-
@include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-items-in-row-mode"), "column nowrap");
|
|
120
|
-
}
|
|
121
|
-
.suggestion-container {
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-direction: column;
|
|
124
|
-
.suggestion {
|
|
125
|
-
svg {
|
|
126
|
-
flex-shrink: 0;
|
|
127
|
-
}
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: space-between;
|
|
130
|
-
overflow-wrap: anywhere;
|
|
131
|
-
align-items: center;
|
|
132
|
-
border-radius: variables.$border-radius;
|
|
133
|
-
|
|
134
|
-
padding: 10px 20px;
|
|
135
|
-
|
|
136
|
-
.search-icon {
|
|
137
|
-
max-width: 12px;
|
|
138
|
-
max-height: 13px;
|
|
139
|
-
svg {
|
|
140
|
-
transform: scale(0.6) translate(-6.9px, -7.2px);
|
|
141
|
-
path {
|
|
142
|
-
fill: variables.get-text-color("neutral", "default");
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.has-history-match {
|
|
148
|
-
@each $property, $value in map.get($merged-entries-with-highlight, "toned-down-part") {
|
|
149
|
-
#{$property}: $value;
|
|
150
|
-
}
|
|
151
|
-
.highlighted-part {
|
|
152
|
-
@each $property, $value in map.get($merged-entries-with-highlight, "highlighted-part") {
|
|
153
|
-
#{$property}: $value;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.category {
|
|
159
|
-
margin-right: 20px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.type {
|
|
163
|
-
color: #868689;
|
|
164
|
-
text-transform: capitalize;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&.query {
|
|
169
|
-
flex-direction: column;
|
|
170
|
-
.suggestion {
|
|
171
|
-
justify-content: flex-start;
|
|
172
|
-
@include utils.flex-gap(8px, "row nowrap");
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
&.compact > .suggestion-container.query {
|
|
177
|
-
flex-direction: row;
|
|
178
|
-
flex-wrap: wrap;
|
|
179
|
-
@include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-compact-suggestions"), "row wrap");
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@use "../../helpers/supports-hover";
|
|
2
|
-
@use "../../helpers/utils";
|
|
3
|
-
@use "../../variables";
|
|
4
|
-
|
|
5
|
-
/// CategorySuggestions is the component that displays suggested Categories on the SearchPage, above the results.
|
|
6
|
-
@mixin CategorySuggestions() {
|
|
7
|
-
.category-suggestions {
|
|
8
|
-
display: flex;
|
|
9
|
-
|
|
10
|
-
.sliding {
|
|
11
|
-
padding-bottom: 2px;
|
|
12
|
-
margin-bottom: -2px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.title {
|
|
16
|
-
font-weight: variables.get-font-weight(500);
|
|
17
|
-
}
|
|
18
|
-
.category-suggestion {
|
|
19
|
-
background: variables.get-background-color("base", "default");
|
|
20
|
-
transition: background 100ms ease-in-out;
|
|
21
|
-
|
|
22
|
-
&:focus-visible {
|
|
23
|
-
background: variables.get-background-color("base", "hover");
|
|
24
|
-
}
|
|
25
|
-
@include supports-hover.supports-hover() {
|
|
26
|
-
&:hover {
|
|
27
|
-
background: variables.get-background-color("base", "hover");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
&:active {
|
|
31
|
-
background: variables.get-background-color("base", "pressed");
|
|
32
|
-
}
|
|
33
|
-
border: 1px solid variables.get-border-color("subtle", "default");
|
|
34
|
-
padding: 10px 20px;
|
|
35
|
-
color: variables.get-text-color("base", "default");
|
|
36
|
-
display: flex;
|
|
37
|
-
height: 100%;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: space-between;
|
|
40
|
-
@include utils.flex-gap(10px, "row nowrap");
|
|
41
|
-
|
|
42
|
-
.parent-title {
|
|
43
|
-
font-weight: variables.get-font-weight(300);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
& > * {
|
|
47
|
-
white-space: nowrap;
|
|
48
|
-
font-size: 0.85em;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
@content;
|
|
52
|
-
}
|
|
53
|
-
}
|