@depict-ai/react-ui 2.0.9 → 2.0.11
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/ES10/index.cjs +22 -7
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +23 -8
- package/dist/main.js +374 -140
- package/dist/module.js +364 -139
- package/dist/styles/components/PLP/Buttons.scss +93 -36
- package/dist/styles/components/PLP/MorphingSign.scss +2 -3
- package/dist/styles/components/PLP/PLPResults.scss +6 -0
- package/dist/styles/components/PLP/ProductListingPage.scss +28 -2
- package/dist/styles/components/PLP/ScrollStatus.scss +8 -1
- package/dist/styles/components/PLP/SelectedFilters.scss +10 -2
- package/dist/styles/components/PLP/SlidableItems.scss +22 -0
- package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +9 -0
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +90 -18
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +2 -4
- package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +6 -2
- package/dist/styles/components/PLP/Toast.scss +5 -0
- package/dist/styles/components/PLP/index.scss +12 -6
- package/dist/styles/components/category/BreadCrumbs.scss +13 -4
- package/dist/styles/components/category/CategoryTitle.scss +14 -2
- package/dist/styles/components/category/QuickLinks.scss +16 -7
- package/dist/styles/components/category/index.scss +5 -5
- package/dist/styles/components/search/Autocomplete.scss +99 -19
- package/dist/styles/components/search/CategorySuggestions.scss +8 -0
- package/dist/styles/components/search/InstantCard.scss +7 -2
- package/dist/styles/components/search/InstantResults.scss +2 -0
- package/dist/styles/components/search/PreviousSearches.scss +17 -4
- package/dist/styles/components/search/QueryInput.scss +28 -6
- package/dist/styles/components/search/SearchModal.scss +16 -10
- package/dist/styles/components/search/SearchRecommendations.scss +3 -0
- package/dist/styles/components/search/ShowingResultsFor.scss +3 -0
- package/dist/styles/components/search/index.scss +5 -5
- package/dist/styles/default.css +1 -1
- package/dist/styles/helpers/custom_input.scss +38 -6
- package/dist/styles/helpers/supports-hover.scss +2 -0
- package/dist/styles/helpers/utils.scss +9 -1
- package/dist/styles/variables.scss +17 -3
- package/latest/index.cjs +17 -7
- package/latest/index.d.ts +1 -1
- package/latest/index.js +18 -8
- package/package.json +2 -2
- package/server/ES10/index.cjs +17 -4
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +18 -5
- package/server/latest/index.cjs +14 -4
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +15 -5
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
/// @param {Color} $color [variables.$brand-dark-grey] - The color of the text.
|
|
5
|
+
/// @param {Color} $separator-color [variables.$brand-grey] - The color of the separator between the links.
|
|
6
|
+
/// @param {Color} $selected-color [variables.$brand-black] - The color of the last link in the trail (the one that is selected).
|
|
7
|
+
|
|
8
|
+
@mixin BreadCrumbs(
|
|
9
|
+
$color: variables.$brand-dark-grey,
|
|
10
|
+
$separator-color: variables.$brand-grey,
|
|
11
|
+
$selected-color: variables.$brand-black
|
|
12
|
+
) {
|
|
4
13
|
.crumbs {
|
|
5
14
|
display: flex;
|
|
6
15
|
flex-wrap: wrap;
|
|
7
16
|
.crumb {
|
|
8
|
-
color:
|
|
17
|
+
color: $color;
|
|
9
18
|
&:hover {
|
|
10
19
|
text-decoration: underline;
|
|
11
20
|
}
|
|
12
21
|
&:last-of-type {
|
|
13
|
-
color:
|
|
22
|
+
color: $selected-color;
|
|
14
23
|
font-weight: 500;
|
|
15
24
|
}
|
|
16
25
|
}
|
|
17
26
|
.separator {
|
|
18
27
|
margin-left: 10px;
|
|
19
28
|
margin-right: 10px;
|
|
20
|
-
color:
|
|
29
|
+
color: $separator-color;
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
32
|
}
|
|
@@ -2,7 +2,18 @@
|
|
|
2
2
|
@use "../../helpers/utils";
|
|
3
3
|
@use "../../helpers/supports-hover";
|
|
4
4
|
|
|
5
|
-
|
|
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
|
+
/// @param {Number} $title-font-weight [700] - The font weight of the title
|
|
9
|
+
/// @param {Number} $explanation-font-weight [500] - The font weight of the dash, number of products and "products" string
|
|
10
|
+
/// @param {Color} $explanation-color [variables.$brand-grey] - The color of the dash, number of products and "products" string
|
|
11
|
+
|
|
12
|
+
@mixin CategoryTitle(
|
|
13
|
+
$title-font-weight: 700,
|
|
14
|
+
$explanation-font-weight: 500,
|
|
15
|
+
$explanation-color: variables.$brand-grey
|
|
16
|
+
) {
|
|
6
17
|
.category-title {
|
|
7
18
|
overflow-wrap: anywhere;
|
|
8
19
|
font-size: 1.5em;
|
|
@@ -16,9 +27,10 @@
|
|
|
16
27
|
.title {
|
|
17
28
|
margin-right: 10px;
|
|
18
29
|
font-weight: $title-font-weight;
|
|
30
|
+
font-size: inherit;
|
|
19
31
|
}
|
|
20
32
|
.explanation {
|
|
21
|
-
color: $
|
|
33
|
+
color: $explanation-color;
|
|
22
34
|
font-weight: $explanation-font-weight;
|
|
23
35
|
.product-count {
|
|
24
36
|
margin-left: 10px;
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
@use "../../helpers/supports-hover";
|
|
4
4
|
@use "../PLP/Buttons";
|
|
5
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
|
+
/// @param {Color} $background [white] - The background color of the individual quick links
|
|
11
|
+
/// @param {Border | false} $border-radius [false] - Border radius override of the individual quick links. Set to false to use default border radius.
|
|
12
|
+
/// @param {Color} $selected-background [map.get(Buttons.get-primary-button-properties(), "background")] - Background of the currently selected quick link
|
|
13
|
+
/// @param {Color | false} $hovered-background [false] - Override background of the quick link when hovered. Set to false to automatically infer it.
|
|
6
14
|
|
|
7
15
|
@mixin QuickLinks(
|
|
8
16
|
$background: white,
|
|
9
17
|
$border-radius: false,
|
|
10
|
-
$selected-background: Buttons
|
|
18
|
+
$selected-background: map.get(Buttons.get-primary-button-properties(), "background"),
|
|
11
19
|
$hovered-background: false
|
|
12
20
|
) {
|
|
13
21
|
.quicklinks {
|
|
@@ -15,15 +23,16 @@
|
|
|
15
23
|
.quicklink {
|
|
16
24
|
white-space: nowrap;
|
|
17
25
|
padding: 10px 20px;
|
|
18
|
-
border-radius: variables.$border-radius;
|
|
19
26
|
background: $background;
|
|
20
27
|
color: variables.$brand-black;
|
|
21
28
|
transition: all 75ms ease-in-out;
|
|
22
|
-
&:focus {
|
|
23
|
-
outline: none;
|
|
24
|
-
}
|
|
25
29
|
@if $border-radius {
|
|
26
30
|
border-radius: $border-radius;
|
|
31
|
+
} @else {
|
|
32
|
+
border-radius: variables.$border-radius;
|
|
33
|
+
}
|
|
34
|
+
&:focus {
|
|
35
|
+
outline: none;
|
|
27
36
|
}
|
|
28
37
|
@include supports-hover.supports-hover() {
|
|
29
38
|
&:hover {
|
|
@@ -40,7 +49,7 @@
|
|
|
40
49
|
} @else {
|
|
41
50
|
@include utils.highlight-background($normal-background: $background);
|
|
42
51
|
}
|
|
43
|
-
filter: Buttons
|
|
52
|
+
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
44
53
|
}
|
|
45
54
|
&:active {
|
|
46
55
|
@include utils.highlight-background($normal-background: $background, $darken-factor: 10%, $lighten-factor: 20%);
|
|
@@ -56,7 +65,7 @@
|
|
|
56
65
|
}
|
|
57
66
|
&:focus-visible {
|
|
58
67
|
@include utils.highlight-background($normal-background: $selected-background);
|
|
59
|
-
filter: Buttons
|
|
68
|
+
filter: map.get(Buttons.get-primary-button-properties(), "focus-visible-filter");
|
|
60
69
|
}
|
|
61
70
|
&:active {
|
|
62
71
|
@include utils.highlight-background(
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
@forward "CategoryTitle";
|
|
10
10
|
@forward "../PLP/ProductListingPage";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@mixin all-components() {
|
|
12
|
+
/// Load all category page mixins with default values. If only minor theming is needed styles in variables.scss can be
|
|
13
|
+
/// reassigned: https://sass-lang.com/documentation/at-rules/use#reassigning-variables.
|
|
14
|
+
/// The variables are forwarded from PLP/index.scss.
|
|
15
|
+
/// If more control is needed use these mixins separately and pass custom params.
|
|
16
|
+
@mixin all-category-components() {
|
|
17
17
|
.depict.category {
|
|
18
18
|
@include BreadCrumbs.BreadCrumbs();
|
|
19
19
|
@include QuickLinks.QuickLinks();
|
|
@@ -2,26 +2,103 @@
|
|
|
2
2
|
@use "../../helpers/utils";
|
|
3
3
|
@use "PreviousSearches";
|
|
4
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 {Color} $background [white] background color on the individual suggestion items
|
|
29
|
+
/// @param {Color} $selected-background [#ffffff80] background color on the individual suggestion items when they are selected (hovered or selected by keyboard navigating (up/down arrows))
|
|
30
|
+
/// @param {Color} $icon-color [variables.$brand-black] - color of the clock, search and clear icon
|
|
31
|
+
/// @param {Number with size unit} $autocomplete-gap-between-items-in-row-mode [5px] - The vertical gap between the "list-style items", the individual suggestions that have the full width.
|
|
32
|
+
/// @param {Number with size unit} $autocomplete-gap-between-category-and-other [20px]- The vertical gap between the category and query suggestion sections
|
|
33
|
+
/// @param {Number with size unit} $autocomplete-gap-between-compact-suggestions [$autocomplete-gap-between-items-in-row-mode] - The horizontal gap between the individual query suggestions that show up in "compact" mode (multiple in the same row) when no query has been entered
|
|
34
|
+
/// @param {Color} $heading-color [variables.$brand-dark-grey] - The color of the heading of both the previous searches and the suggestions (all headings in the Autocomplete section)
|
|
35
|
+
/// @param {Number} $heading-font-weight [700] - The font weight of all headings in the Autocomplete section
|
|
36
|
+
/// @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.
|
|
37
|
+
/// @param {Map} $entries-with-highlight [(
|
|
38
|
+
/// "highlighted-part": (
|
|
39
|
+
/// "color": variables.$brand-dark-grey,
|
|
40
|
+
/// "font-weight": 500
|
|
41
|
+
/// ),
|
|
42
|
+
/// "toned-down-part": (
|
|
43
|
+
/// "color": variables.$brand-dark-grey,
|
|
44
|
+
/// "font-weight": 400
|
|
45
|
+
/// )
|
|
46
|
+
/// )] - 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.
|
|
47
|
+
/// @example scss - Simple example adding a custom font for the highlighted part of the suggestions
|
|
48
|
+
/// @include search.Autocomplete(
|
|
49
|
+
/// $entries-with-highlight: (
|
|
50
|
+
/// "highlighted-part": (
|
|
51
|
+
/// "font-family": "Gotham Medium",
|
|
52
|
+
/// ),
|
|
53
|
+
/// )
|
|
54
|
+
/// );
|
|
55
|
+
/// @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":
|
|
56
|
+
/// @include search.Autocomplete(
|
|
57
|
+
/// $entries-without-highlight: (
|
|
58
|
+
/// "font-weight": 400
|
|
59
|
+
/// ),
|
|
60
|
+
/// $entries-with-highlight: (
|
|
61
|
+
/// "highlighted-part": (
|
|
62
|
+
/// "font-weight": 400
|
|
63
|
+
/// ),
|
|
64
|
+
/// "toned-down-part": (
|
|
65
|
+
/// "font-weight": 300
|
|
66
|
+
/// )
|
|
67
|
+
/// )
|
|
68
|
+
/// );
|
|
5
69
|
|
|
6
70
|
@mixin Autocomplete(
|
|
7
71
|
$background: white,
|
|
8
72
|
$selected-background: #ffffff80,
|
|
9
|
-
$
|
|
10
|
-
$history-icon-color: variables.$brand-black,
|
|
73
|
+
$icon-color: variables.$brand-black,
|
|
11
74
|
$autocomplete-gap-between-items-in-row-mode: 5px,
|
|
12
75
|
$autocomplete-gap-between-category-and-other: 20px,
|
|
76
|
+
$autocomplete-gap-between-compact-suggestions: $autocomplete-gap-between-items-in-row-mode,
|
|
13
77
|
$heading-color: variables.$brand-dark-grey,
|
|
14
78
|
$heading-font-weight: 700,
|
|
15
|
-
$entries-without-highlight
|
|
16
|
-
$entries-
|
|
17
|
-
$entries-with-highlight-highlighted-part-color: variables.$brand-dark-grey,
|
|
18
|
-
$entries-with-highlight-highlighted-part-font-weight: 500,
|
|
19
|
-
$entries-with-highlight-toned-down-part-color: variables.$brand-dark-grey,
|
|
20
|
-
$entries-with-highlight-toned-down-part-font-weight: 400
|
|
79
|
+
$entries-without-highlight: (),
|
|
80
|
+
$entries-with-highlight: ()
|
|
21
81
|
) {
|
|
82
|
+
$entries-without-highlight-defaults: (
|
|
83
|
+
"color": variables.$brand-dark-grey,
|
|
84
|
+
"font-weight": 400,
|
|
85
|
+
);
|
|
86
|
+
$entries-with-highlight-defaults: (
|
|
87
|
+
"highlighted-part": (
|
|
88
|
+
"color": variables.$brand-dark-grey,
|
|
89
|
+
"font-weight": 500,
|
|
90
|
+
),
|
|
91
|
+
"toned-down-part": (
|
|
92
|
+
"color": variables.$brand-dark-grey,
|
|
93
|
+
"font-weight": 400,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
$merged-entries-without-highlight: map.merge($entries-without-highlight-defaults, $entries-without-highlight);
|
|
97
|
+
$merged-entries-with-highlight: map.merge($entries-with-highlight-defaults, $entries-with-highlight);
|
|
22
98
|
@include PreviousSearches.PreviousSearches(
|
|
23
|
-
$icon-color: $
|
|
24
|
-
$item-color: $entries-without-highlight
|
|
99
|
+
$icon-color: $icon-color,
|
|
100
|
+
$item-color: map.get($merged-entries-without-highlight, "color"),
|
|
101
|
+
$gap-between-items: $autocomplete-gap-between-items-in-row-mode
|
|
25
102
|
);
|
|
26
103
|
.previous-searches,
|
|
27
104
|
.suggestions {
|
|
@@ -40,7 +117,7 @@
|
|
|
40
117
|
|
|
41
118
|
&:focus-visible {
|
|
42
119
|
outline: none;
|
|
43
|
-
filter: Buttons
|
|
120
|
+
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
44
121
|
}
|
|
45
122
|
}
|
|
46
123
|
}
|
|
@@ -65,8 +142,9 @@
|
|
|
65
142
|
overflow-wrap: anywhere;
|
|
66
143
|
align-items: center;
|
|
67
144
|
border-radius: variables.$border-radius;
|
|
68
|
-
|
|
69
|
-
|
|
145
|
+
@each $property, $value in $merged-entries-without-highlight {
|
|
146
|
+
#{$property}: $value;
|
|
147
|
+
}
|
|
70
148
|
|
|
71
149
|
padding: 10px 20px;
|
|
72
150
|
|
|
@@ -76,17 +154,19 @@
|
|
|
76
154
|
svg {
|
|
77
155
|
transform: scale(0.6) translate(-6.9px, -7.2px);
|
|
78
156
|
path {
|
|
79
|
-
fill: $
|
|
157
|
+
fill: $icon-color;
|
|
80
158
|
}
|
|
81
159
|
}
|
|
82
160
|
}
|
|
83
161
|
|
|
84
162
|
.has-history-match {
|
|
85
|
-
|
|
86
|
-
|
|
163
|
+
@each $property, $value in map.get($merged-entries-with-highlight, "toned-down-part") {
|
|
164
|
+
#{$property}: $value;
|
|
165
|
+
}
|
|
87
166
|
.highlighted-part {
|
|
88
|
-
|
|
89
|
-
|
|
167
|
+
@each $property, $value in map.get($merged-entries-with-highlight, "highlighted-part") {
|
|
168
|
+
#{$property}: $value;
|
|
169
|
+
}
|
|
90
170
|
}
|
|
91
171
|
}
|
|
92
172
|
|
|
@@ -111,7 +191,7 @@
|
|
|
111
191
|
&.compact > .suggestion-container.query {
|
|
112
192
|
flex-direction: row;
|
|
113
193
|
flex-wrap: wrap;
|
|
114
|
-
@include utils.flex-gap(
|
|
194
|
+
@include utils.flex-gap($autocomplete-gap-between-compact-suggestions, "row wrap");
|
|
115
195
|
}
|
|
116
196
|
}
|
|
117
197
|
}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
@use "../../helpers/utils";
|
|
3
3
|
@use "../../variables";
|
|
4
4
|
|
|
5
|
+
/// CategorySuggestions is the component that displays suggested Categories on the SearchPage, above the results.
|
|
6
|
+
/// @param {Color} $card-background [white] - The background color of individual category "cards"
|
|
7
|
+
/// @param {false | Color} $hovered-card-background [false] - The background color of individual category "cards" when hovered. If false, a color is automatically obtained by lightening or darkening `$card-background`.
|
|
8
|
+
/// @param {Border | false} $card-border [false] - The border of individual category "cards". If false, no border is applied.
|
|
9
|
+
/// @param {Number with size unit} $card-border-radius [variables.$border-radius] - The border radius of individual category "cards"
|
|
10
|
+
/// @param {Number} $title-font-weight [420] - The font weight of the text on the category "cards"
|
|
11
|
+
/// @param {Number} $parent-title-font-weight [400] - The font weight of the text on the category "cards" that is the parent of proposed category (not always displayed)
|
|
12
|
+
/// @param {Boolean} $thin [true] - If true, the category title and parent category title are displayed besides each other (in the same row).
|
|
5
13
|
@mixin CategorySuggestions(
|
|
6
14
|
$card-background: white,
|
|
7
15
|
$hovered-card-background: false,
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
@use "../../helpers/utils";
|
|
2
2
|
@use "../../variables";
|
|
3
3
|
|
|
4
|
+
/// Mixin that styles the idividual product cards in the InstantResults in the SearchModal
|
|
5
|
+
/// @param {Color} $instant-card-sales-price-color [$instant-card-sales-price-color] - The color of the sales price
|
|
6
|
+
/// @param {Boolean} $instant-card-show-price [true] - Whether to show the price
|
|
7
|
+
/// @param {Boolean} $instant-card-show-tagline [true] - Whether to show the tagline (this can be different things depending on what backend sends)
|
|
8
|
+
|
|
4
9
|
@mixin InstantCard(
|
|
5
|
-
$instant-card-
|
|
10
|
+
$instant-card-sales-price-color: variables.$instant-card-sales-price-color,
|
|
6
11
|
$instant-card-show-price: variables.$instant-card-show-price,
|
|
7
12
|
$instant-card-show-tagline: variables.$instant-card-show-tagline
|
|
8
13
|
) {
|
|
@@ -92,7 +97,7 @@
|
|
|
92
97
|
color: #868689;
|
|
93
98
|
}
|
|
94
99
|
&.sales-price {
|
|
95
|
-
color: $instant-card-
|
|
100
|
+
color: $instant-card-sales-price-color;
|
|
96
101
|
}
|
|
97
102
|
}
|
|
98
103
|
@media (max-width: 600px) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@use "../../helpers/utils";
|
|
2
2
|
|
|
3
|
+
/// Mixin that styles the container of the InstantResults in the SearchModal
|
|
4
|
+
/// @param {Number with size unit} $gap [5px] - The gap between the InstantResults
|
|
3
5
|
@mixin InstantResults($gap: 5px) {
|
|
4
6
|
.instant-results {
|
|
5
7
|
display: flex;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
@use "../../helpers/utils";
|
|
3
3
|
@use "../PLP/Buttons";
|
|
4
|
+
@use "sass:map";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
/// PreviousSearches is the component that shows the previous searches of the user in its own section, with a heading that says "Your previous searches" (key of the string is `previous_searches_text_` in the locales).
|
|
7
|
+
/// The component is only shown if the user has previous searches and the search field is empty.
|
|
8
|
+
///
|
|
9
|
+
/// PreviousSearches is a sub-component of Autocomplete so you probably don't want to use it on its own. It can also be configured by configuring Autocomplete.
|
|
10
|
+
/// @param {Color} $icon-color [variables.$brand-black] - The color of the clock icon and clear icon. Keep in mind that it needs to have contrast with the hovered state of the delete icon
|
|
11
|
+
/// @param {Color} $item-color [variables.$brand-black] - The color of the text of the previous searches item
|
|
12
|
+
/// @param {Number with size unit} $gap-between-items [5px] - The gap between the individual previous searches items
|
|
13
|
+
|
|
14
|
+
@mixin PreviousSearches(
|
|
15
|
+
$icon-color: variables.$brand-dark-grey,
|
|
16
|
+
$item-color: variables.$brand-black,
|
|
17
|
+
$gap-between-items: 5px
|
|
18
|
+
) {
|
|
6
19
|
.previous-searches {
|
|
7
20
|
display: flex;
|
|
8
21
|
flex-direction: column;
|
|
@@ -11,7 +24,7 @@
|
|
|
11
24
|
.list {
|
|
12
25
|
display: flex;
|
|
13
26
|
flex-direction: column;
|
|
14
|
-
@include utils.flex-gap(
|
|
27
|
+
@include utils.flex-gap($gap-between-items, "column nowrap");
|
|
15
28
|
.item {
|
|
16
29
|
color: $item-color;
|
|
17
30
|
display: flex;
|
|
@@ -52,7 +65,7 @@
|
|
|
52
65
|
width: 13px;
|
|
53
66
|
height: 13px;
|
|
54
67
|
path {
|
|
55
|
-
fill:
|
|
68
|
+
fill: $icon-color;
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
&:hover svg {
|
|
@@ -62,7 +75,7 @@
|
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
77
|
&:focus-visible {
|
|
65
|
-
filter: Buttons
|
|
78
|
+
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
66
79
|
svg {
|
|
67
80
|
transform: scale(1.2);
|
|
68
81
|
path {
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
@use "../../variables";
|
|
2
2
|
@use "../../helpers/supports-hover";
|
|
3
3
|
@use "../PLP/Buttons";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
|
|
6
|
+
/// QueryInput is the component that shows the search input, sometimes back button, clear button and the search button.
|
|
7
|
+
/// The version exported in the SDK it is called SearchField
|
|
8
|
+
/// @param {Number with size unit} $border-radius [variables.$border-radius * 2.5] - Border radius of the search input
|
|
9
|
+
/// @param {Number with size unit} $input-font-size [initial] - Font size of the `<input>` element
|
|
10
|
+
/// @param {Number} $input-font-weight [initial] - Font weight of the `<input>` element
|
|
11
|
+
/// @param {Color} $input-placeholder-color [initial] - Color of the placeholder text in the `<input>` element (the text that's visible when no search query has been entered)
|
|
12
|
+
/// @param {Color | false} $submit-background [false] If not false: the background color of the submit button
|
|
13
|
+
/// @param {Number} $submit-icon-size [1] - The scaling factor of the submit icon
|
|
14
|
+
/// @param {Color} $back-color [variables.$brand-dark-grey] - The color of the path of the back icon
|
|
15
|
+
/// @param {Color} $back-background [#fff] - The background color of the back button
|
|
16
|
+
/// @param {Color} $clear-color [variables.$brand-dark-grey] - The color of the path of the clear icon
|
|
17
|
+
/// @param {Color} $hovered-clear-color [variables.$brand-black] - The color of the path of the clear icon when hovered
|
|
18
|
+
/// @param {Color} $query-text-color [variables.$brand-dark-grey] - The color of the text in the search input
|
|
19
|
+
/// @param {Color} $query-background-color [#fff] - The background color of the `<input>` element
|
|
20
|
+
/// @param {Border} $query-border [none] - The border of the `<input>` element
|
|
21
|
+
/// @param {Color} $hovered-back-color [variables.$brand-black] - The color of the path of the back icon when hovered
|
|
22
|
+
/// @param {false | Color} $hovered-submit-color [false] - If not false: the color of the path of the submit icon when hovered
|
|
23
|
+
/// @param {Color} $focused-query-text-color [#000] - The color of the text in the search input when focused or hovered
|
|
24
|
+
/// @param {Shadow} $box-shadow [0px 4px 4px rgba(0, 0, 0, 0.05)] - The box shadow of the whole QueryInput component (including buttons, etc)
|
|
4
25
|
|
|
5
26
|
@mixin QueryInput(
|
|
6
27
|
$border-radius: calc(#{variables.$border-radius} * 2.5),
|
|
@@ -21,6 +42,7 @@
|
|
|
21
42
|
$focused-query-text-color: #000,
|
|
22
43
|
$box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05)
|
|
23
44
|
) {
|
|
45
|
+
// TODO: Probably rename to SearchField?
|
|
24
46
|
.query-input {
|
|
25
47
|
input,
|
|
26
48
|
button {
|
|
@@ -90,7 +112,7 @@
|
|
|
90
112
|
outline: none;
|
|
91
113
|
}
|
|
92
114
|
&:focus-visible {
|
|
93
|
-
filter: Buttons
|
|
115
|
+
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
94
116
|
svg path {
|
|
95
117
|
fill: $hovered-back-color;
|
|
96
118
|
}
|
|
@@ -125,7 +147,7 @@
|
|
|
125
147
|
outline: none;
|
|
126
148
|
}
|
|
127
149
|
&:focus-visible {
|
|
128
|
-
filter: Buttons
|
|
150
|
+
filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
|
|
129
151
|
svg path {
|
|
130
152
|
fill: $hovered-clear-color;
|
|
131
153
|
}
|
|
@@ -152,10 +174,10 @@
|
|
|
152
174
|
background: $submit-background;
|
|
153
175
|
}
|
|
154
176
|
|
|
155
|
-
@
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
177
|
+
@if $hovered-submit-color {
|
|
178
|
+
@include supports-hover.supports-hover() {
|
|
179
|
+
&:hover {
|
|
180
|
+
svg path {
|
|
159
181
|
fill: $hovered-submit-color;
|
|
160
182
|
}
|
|
161
183
|
}
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
@use "../../variables";
|
|
3
3
|
@use "../../helpers/supports-hover";
|
|
4
4
|
|
|
5
|
+
/// SearchModal is the component that shows the search modal when the user clicks on the search icon/into the search field in the header.
|
|
6
|
+
/// @param {Color} $background [variables.$brand-lighter-grey] - The background color of the search modal
|
|
7
|
+
/// @param {Number with size unit} $border-radius [variables.$border-radius * 2.5] - The border radius of the edges of the search modal.
|
|
8
|
+
/// @param {String} $discover-more-text-transform [uppercase] - The text transform applied to the "Discover more" button in the modal.
|
|
9
|
+
/// @param {Boolean} $top-snapping [true] - If the modal should snap to the top of the page when the viewport has a very reduced height and it would utilise the space better if it snapped to the top of the page.
|
|
10
|
+
/// @param {Number with size unit} $max-width [800px] - The max width of the modal
|
|
11
|
+
|
|
5
12
|
@mixin SearchModal(
|
|
6
13
|
$background: variables.$brand-lighter-grey,
|
|
7
14
|
$border-radius: calc(#{variables.$border-radius} * 2.5),
|
|
@@ -28,38 +35,37 @@
|
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
.body {
|
|
38
|
+
// this also has position:absolute and width: 80vw set as default styling from the javascript, inside of SearchModal.tsx
|
|
31
39
|
display: flex;
|
|
32
40
|
flex-direction: column;
|
|
33
41
|
background: $background;
|
|
34
|
-
width: 80vw;
|
|
35
42
|
max-width: $max-width;
|
|
36
43
|
z-index: calc(#{variables.$base-z-index} + 1);
|
|
37
|
-
position: absolute;
|
|
38
44
|
border-radius: $border-radius;
|
|
39
45
|
@media (hover: hover) and (pointer: fine) {
|
|
40
46
|
@media (max-height: 790px) {
|
|
41
47
|
@if $top-snapping {
|
|
42
|
-
max-height: 100
|
|
43
|
-
top: 0
|
|
48
|
+
max-height: 100%;
|
|
49
|
+
top: 0;
|
|
44
50
|
position: fixed;
|
|
45
51
|
}
|
|
46
52
|
@media (max-width: 600px) {
|
|
47
|
-
left: 30px
|
|
48
|
-
width: calc(100% - 30px)
|
|
53
|
+
left: 30px;
|
|
54
|
+
width: calc(100% - 30px);
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
@media not all and (hover: hover) and (pointer: fine) {
|
|
53
59
|
@if $top-snapping {
|
|
54
60
|
@media (max-height: 1000px) {
|
|
55
|
-
max-height: 100
|
|
56
|
-
top: 0
|
|
61
|
+
max-height: 100%;
|
|
62
|
+
top: 0;
|
|
57
63
|
position: fixed;
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
@media (max-height: 1000px) and (max-width: 600px) {
|
|
61
|
-
left: 30px
|
|
62
|
-
width: calc(100% - 30px)
|
|
67
|
+
left: 30px;
|
|
68
|
+
width: calc(100% - 30px);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
@use "../../helpers/utils";
|
|
3
3
|
@use "../../helpers/supports-hover";
|
|
4
4
|
|
|
5
|
+
/// SearchRecommendations is the component that shows the search recommendations below the SearchResults once the user has reached the end of the results.
|
|
6
|
+
/// @param {Border} $border-top [2px solid variables.$brand-light-grey] - The border separating the results and recommendations
|
|
7
|
+
|
|
5
8
|
@mixin SearchRecommendations($border-top: 2px solid variables.$brand-light-grey) {
|
|
6
9
|
.listing-page {
|
|
7
10
|
.search-recs {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/// This is the styling for the text that says "Showing __30__ result(s) for __falk__"
|
|
2
|
+
/// @param {Number with unit} $results-for-font-size [1.5em] - The font size of the text
|
|
3
|
+
/// @param {Boolean} $mobile-centered [false] - Whether the text should be centered on mobile sizes
|
|
1
4
|
@mixin ShowingResultsFor($results-for-font-size: 1.5em, $mobile-centered: false) {
|
|
2
5
|
.results-for {
|
|
3
6
|
font-size: $results-for-font-size;
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
@forward "SearchModal";
|
|
22
22
|
@forward "../PLP/ProductListingPage";
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@mixin all-components() {
|
|
24
|
+
/// Load all search mixins with default values. If only minor theming is needed styles in variables.scss can be
|
|
25
|
+
/// reassigned: https://sass-lang.com/documentation/at-rules/use#reassigning-variables.
|
|
26
|
+
/// The variables are forwarded from PLP/index.scss.
|
|
27
|
+
/// If more control is needed use these mixins separately and pass custom params.
|
|
28
|
+
@mixin all-search-components() {
|
|
29
29
|
.depict.search {
|
|
30
30
|
@include Autocomplete.Autocomplete();
|
|
31
31
|
@include CategorySuggestions.CategorySuggestions();
|