@depict-ai/react-ui 0.0.74 → 0.0.75

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.
Files changed (42) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/main.js +17 -17
  3. package/dist/module.js +10 -10
  4. package/dist/styles/components/PLP/Buttons.scss +24 -53
  5. package/dist/styles/components/PLP/MorphingSign.scss +4 -2
  6. package/dist/styles/components/PLP/PLPResults.scss +1 -1
  7. package/dist/styles/components/PLP/ProductListingPage.scss +21 -24
  8. package/dist/styles/components/PLP/ScrollStatus.scss +5 -8
  9. package/dist/styles/components/PLP/SelectedFilters.scss +25 -26
  10. package/dist/styles/components/PLP/SlidableItems.scss +2 -5
  11. package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +16 -24
  12. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +186 -182
  13. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +11 -12
  14. package/dist/styles/components/PLP/Toast.scss +8 -6
  15. package/dist/styles/components/PLP/index.scss +3 -39
  16. package/dist/styles/components/category/BreadCrumbs.scss +4 -11
  17. package/dist/styles/components/category/CategoryTitle.scss +4 -11
  18. package/dist/styles/components/category/QuickLinks.scss +14 -37
  19. package/dist/styles/components/category/index.scss +2 -18
  20. package/dist/styles/components/search/Autocomplete.scss +27 -42
  21. package/dist/styles/components/search/CategorySuggestions.scss +13 -42
  22. package/dist/styles/components/search/InstantCard.scss +8 -11
  23. package/dist/styles/components/search/InstantResults.scss +3 -3
  24. package/dist/styles/components/search/PreviousSearches.scss +6 -13
  25. package/dist/styles/components/search/SearchField.scss +26 -72
  26. package/dist/styles/components/search/SearchModal.scss +8 -23
  27. package/dist/styles/components/search/SearchRecommendations.scss +2 -2
  28. package/dist/styles/components/search/ShowingResultsFor.scss +2 -8
  29. package/dist/styles/components/search/index.scss +2 -30
  30. package/dist/styles/default.css +1 -1
  31. package/dist/styles/helpers/custom_input.scss +4 -4
  32. package/dist/styles/helpers/utils.scss +8 -2
  33. package/dist/styles/index.scss +49 -3
  34. package/dist/styles/variables.scss +247 -42
  35. package/dist-server/index.d.ts +1 -1
  36. package/dist-server/main.js +1 -1
  37. package/dist-server/module.js +1 -1
  38. package/locales/index.d.ts +2 -2
  39. package/locales/index.js +1 -1
  40. package/locales/require.js +1 -1
  41. package/package.json +4 -5
  42. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +0 -152
@@ -1,16 +1,15 @@
1
1
  @use "../../../variables";
2
2
  @use "../../../helpers/utils";
3
+ @use "sass:map";
3
4
 
4
5
  /// Mobile modal - taking arguments from SortAndFilter mixin so see SortAndFilter docs for more info
5
- @mixin SortAndFilterModal(
6
- $mobile-top-level-collapse-color,
7
- $mobile-top-level-collapse-background,
8
- $close-icon-color: #fff,
9
- $some-text-color: variables.$brand-dark-grey,
10
- $sort-and-filter-modal-background: variables.$brand-lighter-grey,
11
- $title-font-weight: false,
12
- $expanded-title-font-weight: $title-font-weight
13
- ) {
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
+
14
13
  .depict-filter-sort-modal-backdrop {
15
14
  @include utils.modal-backdrop($background: rgba(0, 0, 0, 0.7), $z-index: variables.$base-z-index);
16
15
  will-change: opacity;
@@ -31,7 +30,7 @@
31
30
  svg {
32
31
  transform: scale(0.6646);
33
32
  path {
34
- fill: $close-icon-color;
33
+ fill: #fff;
35
34
  }
36
35
  }
37
36
  }
@@ -61,6 +60,7 @@
61
60
  }
62
61
  }
63
62
  .sort-filter-summary > .summary {
63
+ border-top: 1px solid #f4f4f4;
64
64
  cursor: pointer;
65
65
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);
66
66
  color: $mobile-top-level-collapse-color;
@@ -95,13 +95,12 @@
95
95
  overflow-y: auto;
96
96
  display: flex;
97
97
  flex-direction: column;
98
- background: $sort-and-filter-modal-background;
99
98
  @include utils.flex-gap(2px, "column nowrap");
100
99
  }
101
100
  .filters,
102
101
  .sorting {
103
102
  .body {
104
- color: $some-text-color;
103
+ color: variables.get-text-color("neutral", "default");
105
104
  }
106
105
  & > summary {
107
106
  .morphing-sign span {
@@ -3,21 +3,23 @@
3
3
 
4
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
5
  /// It's a general component otherwise and might also be used for other messages.
6
- /// @param {Number} $z-index [variables.$base-z-index * 5] - The z-index of the Toast.
7
- /// @param {Color} $progress-bar-color [variables.$brand-dark-grey] - The color of the progress bar below the toast that shows when it will auto-close.
8
6
 
9
- @mixin Toast($z-index: calc(#{variables.$base-z-index} + 5), $progress-bar-color: variables.$brand-dark-grey) {
7
+ @mixin Toast() {
10
8
  .depict.plp.toast {
11
9
  position: fixed;
12
10
  bottom: 10px;
13
11
  left: 50%;
14
12
  transform: translateX(-50%);
15
- z-index: $z-index;
13
+ z-index: calc(#{variables.$base-z-index} + 5);
16
14
  background: white;
17
15
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
18
16
  padding: 10px 20px;
19
17
  border-radius: variables.$border-radius;
20
- border-image-source: linear-gradient(90deg, $progress-bar-color 0%, $progress-bar-color 100%);
18
+ border-image-source: linear-gradient(
19
+ 90deg,
20
+ variables.$toast-progress-bar-color 0%,
21
+ variables.$toast-progress-bar-color 100%
22
+ );
21
23
  border-image-slice: 0 0 100% 0;
22
24
  border-bottom-style: solid;
23
25
  border-bottom-width: 2px; // doesn't show in chrome sometimes without
@@ -47,7 +49,7 @@
47
49
  }
48
50
 
49
51
  & {
50
- color: variables.$brand-dark-grey;
52
+ color: variables.get-text-color("base", "default");
51
53
  }
52
54
  button {
53
55
  padding: 5px 20px;
@@ -1,51 +1,15 @@
1
1
  @use "sass:meta";
2
2
 
3
- // Component style mixins
4
- @use "../../variables";
5
- @use "SelectedFilters";
6
- @use "ScrollStatus";
7
- @use "SlidableItems";
8
- @use "PLPResults";
9
- @use "SortAndFilter/SortAndFilter";
10
- @use "SortAndFilter/WhiteSortAndFilter";
11
- @use "SortAndFilter/FloatingButtons";
12
- @use "Toast";
13
- @use "ProductListingPage";
14
- @use "Buttons";
3
+ /// Component style mixins for PLP
4
+ /// PLP encompasses both Search and Category page, so you will always need to include these mixins.
15
5
 
16
6
  @forward "SelectedFilters";
17
7
  @forward "ScrollStatus";
18
8
  @forward "SlidableItems";
19
9
  @forward "PLPResults";
20
10
  @forward "SortAndFilter/SortAndFilter";
21
- @forward "SortAndFilter/WhiteSortAndFilter";
11
+ @forward "SortAndFilter/SortAndFilterModal";
22
12
  @forward "SortAndFilter/FloatingButtons";
23
13
  @forward "Toast";
24
14
  @forward "ProductListingPage";
25
15
  @forward "Buttons";
26
-
27
- /// Default variables
28
- @forward "../../variables";
29
-
30
- /// Load all PLP mixins with default values. PLP encompasses both Search and Category page, so you will always need to include the mixins that this includes somehow. If only minor theming is needed styles in variables.scss can be
31
- /// reassigned: https://sass-lang.com/documentation/at-rules/use#reassigning-variables
32
- /// If more control is needed use these mixins separately and pass custom params
33
-
34
- @mixin all-PLP-components() {
35
- .depict.plp {
36
- @include PLPResults.PLPResults();
37
- @include ProductListingPage.ProductListingPage();
38
- @include SelectedFilters.SelectedFilters();
39
- @include ScrollStatus.ScrollStatus();
40
- @if variables.$white {
41
- @include WhiteSortAndFilter.WhiteSortAndFilter();
42
- } @else {
43
- @include SortAndFilter.SortAndFilter();
44
- }
45
- @include FloatingButtons.FloatingButtons();
46
- @include SlidableItems.SlidableItems();
47
- @include Buttons.PrimaryButton();
48
- @include Buttons.SecondaryButton();
49
- }
50
- @include Toast.Toast();
51
- }
@@ -1,32 +1,25 @@
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
4
 
8
- @mixin BreadCrumbs(
9
- $color: variables.$brand-dark-grey,
10
- $separator-color: variables.$brand-grey,
11
- $selected-color: variables.$brand-black
12
- ) {
5
+ @mixin BreadCrumbs() {
13
6
  .crumbs {
14
7
  display: flex;
15
8
  flex-wrap: wrap;
16
9
  .crumb {
17
- color: $color;
10
+ color: variables.get-text-color("neutral", "default");
18
11
  &:hover {
19
12
  text-decoration: underline;
20
13
  }
21
14
  &:last-of-type {
22
- color: $selected-color;
15
+ color: variables.get-text-color("base", "default");
23
16
  font-weight: 500;
24
17
  }
25
18
  }
26
19
  .separator {
27
20
  margin-left: 10px;
28
21
  margin-right: 10px;
29
- color: $separator-color;
22
+ color: variables.get-text-color("subtle", "default");
30
23
  }
31
24
  }
32
25
  }
@@ -5,15 +5,8 @@
5
5
  /// CategoryTitle is the component that shows the title of the current category along with the number of products in it.
6
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
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
8
 
12
- @mixin CategoryTitle(
13
- $title-font-weight: 700,
14
- $explanation-font-weight: 500,
15
- $explanation-color: variables.$brand-grey
16
- ) {
9
+ @mixin CategoryTitle() {
17
10
  .category-title {
18
11
  overflow-wrap: anywhere;
19
12
  font-size: 1.5em;
@@ -26,12 +19,12 @@
26
19
  }
27
20
  .title {
28
21
  margin-right: 10px;
29
- font-weight: $title-font-weight;
22
+ font-weight: 700;
30
23
  font-size: inherit;
31
24
  }
32
25
  .explanation {
33
- color: $explanation-color;
34
- font-weight: $explanation-font-weight;
26
+ color: variables.get-text-color("subtle", "default");
27
+ font-weight: 500;
35
28
  .product-count {
36
29
  margin-left: 10px;
37
30
  }
@@ -7,72 +7,49 @@
7
7
 
8
8
  /// The QuickLinks show the quick links to the subcategories or sibling categories of the current category.
9
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.
14
10
 
15
- @mixin QuickLinks(
16
- $background: white,
17
- $border-radius: false,
18
- $selected-background: map.get(Buttons.get-primary-button-properties(), "background"),
19
- $hovered-background: false
20
- ) {
11
+ @mixin QuickLinks() {
21
12
  .quicklinks {
22
13
  overflow: hidden;
23
14
  .quicklink {
24
15
  white-space: nowrap;
25
16
  padding: 10px 20px;
26
- background: $background;
27
- color: variables.$brand-black;
17
+ background: variables.get-background-color("base", "default");
18
+ color: variables.get-text-color("base", "default");
28
19
  transition: all 75ms ease-in-out;
29
- @if $border-radius {
30
- border-radius: $border-radius;
31
- } @else {
32
- border-radius: variables.$border-radius;
33
- }
20
+ border-radius: variables.$border-radius;
21
+ border: 1px solid variables.get-border-color("neutral", "default");
34
22
  &:focus {
35
23
  outline: none;
36
24
  }
37
25
  @include supports-hover.supports-hover() {
38
26
  &:hover {
39
- @if $hovered-background {
40
- background: $hovered-background;
41
- } @else {
42
- @include utils.highlight-background($normal-background: $background);
43
- }
27
+ background: variables.get-background-color("base", "hover");
44
28
  }
45
29
  }
46
30
  &:focus-visible {
47
- @if $hovered-background {
48
- background: $hovered-background;
49
- } @else {
50
- @include utils.highlight-background($normal-background: $background);
51
- }
31
+ background: variables.get-background-color("base", "hover");
52
32
  filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
53
33
  }
54
34
  &:active {
55
- @include utils.highlight-background($normal-background: $background, $darken-factor: 10%, $lighten-factor: 20%);
35
+ background: variables.get-background-color("base", "pressed");
56
36
  }
57
37
  &.selected {
58
- color: white;
59
- background: $selected-background;
38
+ color: variables.get-text-color("inverse", "default");
39
+ background: variables.get-background-color("inverse", "default");
40
+ border: 1px solid transparent;
60
41
  @include supports-hover.supports-hover() {
61
42
  &:hover {
62
43
  // should we have this? since it's selected, nothing will happen when clicked
63
- @include utils.highlight-background($normal-background: $selected-background);
44
+ background: variables.get-background-color("inverse", "hover");
64
45
  }
65
46
  }
66
47
  &:focus-visible {
67
- @include utils.highlight-background($normal-background: $selected-background);
48
+ background: variables.get-background-color("inverse", "hover");
68
49
  filter: map.get(Buttons.get-primary-button-properties(), "focus-visible-filter");
69
50
  }
70
51
  &:active {
71
- @include utils.highlight-background(
72
- $normal-background: $selected-background,
73
- $darken-factor: 10%,
74
- $lighten-factor: 20%
75
- );
52
+ background: variables.get-background-color("inverse", "pressed");
76
53
  }
77
54
  }
78
55
  }
@@ -1,23 +1,7 @@
1
- // Component style mixins
2
- @use "BreadCrumbs";
3
- @use "QuickLinks";
4
- @use "CategoryTitle";
5
- @use "../PLP/ProductListingPage";
1
+ /// Component style mixins for Category styling
2
+ /// Don't forget to also include PLP styling
6
3
 
7
4
  @forward "BreadCrumbs";
8
5
  @forward "QuickLinks";
9
6
  @forward "CategoryTitle";
10
7
  @forward "../PLP/ProductListingPage";
11
-
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
- .depict.category {
18
- @include BreadCrumbs.BreadCrumbs();
19
- @include QuickLinks.QuickLinks();
20
- @include CategoryTitle.CategoryTitle();
21
- @include ProductListingPage.CategoryPage();
22
- }
23
- }
@@ -25,14 +25,6 @@
25
25
  /// <li><b>Toned down part:</b><br />
26
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
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
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.
37
29
  /// @param {Map} $entries-with-highlight [(
38
30
  /// "highlighted-part": (
@@ -68,67 +60,63 @@
68
60
  /// );
69
61
 
70
62
  @mixin Autocomplete(
71
- $background: white,
72
- $selected-background: #ffffff80,
73
- $icon-color: variables.$brand-black,
74
- $autocomplete-gap-between-items-in-row-mode: 5px,
75
- $autocomplete-gap-between-category-and-other: 20px,
76
- $autocomplete-gap-between-compact-suggestions: $autocomplete-gap-between-items-in-row-mode,
77
- $heading-color: variables.$brand-dark-grey,
78
- $heading-font-weight: 700,
79
- $entries-without-highlight: (),
80
- $entries-with-highlight: ()
63
+ $entries-without-highlight: variables.$autocomplete-entries-without-highlight,
64
+ $entries-with-highlight: variables.$autocomplete-entries-with-highlight
81
65
  ) {
82
66
  $entries-without-highlight-defaults: (
83
- "color": variables.$brand-dark-grey,
84
- "font-weight": 400,
67
+ "color": variables.get-text-color("neutral", "default"),
68
+ "font-weight": variables.get-font-weight(400),
85
69
  );
86
70
  $entries-with-highlight-defaults: (
87
71
  "highlighted-part": (
88
- "color": variables.$brand-dark-grey,
89
- "font-weight": 500,
72
+ "color": variables.get-text-color("neutral", "default"),
73
+ "font-weight": variables.get-font-weight(500),
90
74
  ),
91
75
  "toned-down-part": (
92
- "color": variables.$brand-dark-grey,
93
- "font-weight": 400,
76
+ "color": variables.get-text-color("neutral", "default") y,
77
+ "font-weight": variables.get-font-weight(400),
94
78
  ),
95
79
  );
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);
98
- @include PreviousSearches.PreviousSearches(
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
102
- );
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();
103
83
  .previous-searches,
104
84
  .suggestions {
105
85
  .text {
106
86
  font-size: 16px;
107
- font-weight: $heading-font-weight;
108
- color: $heading-color;
87
+ font-weight: variables.get-font-weight(700);
88
+ color: variables.get-text-color("neutral", "default");
109
89
  margin-top: 0;
110
90
  }
111
91
  .item,
112
92
  .suggestion {
113
- background: $background;
93
+ background: variables.get-background-color("base", "default");
114
94
  &.selected {
115
- background: $selected-background;
95
+ background: variables.get-background-color("neutral", "default");
116
96
  }
117
97
 
118
98
  &:focus-visible {
119
99
  outline: none;
120
100
  filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
121
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
+ }
122
110
  }
123
111
  }
124
112
  .suggestions {
125
113
  display: flex;
126
114
  flex-direction: column;
127
- @include utils.flex-gap($autocomplete-gap-between-category-and-other, "column nowrap");
115
+ @include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-category-and-other"), "column nowrap");
128
116
 
129
117
  &:not(.compact) > .suggestion-container,
130
118
  &.compact > .suggestion-container:not(.query) {
131
- @include utils.flex-gap($autocomplete-gap-between-items-in-row-mode, "column nowrap");
119
+ @include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-items-in-row-mode"), "column nowrap");
132
120
  }
133
121
  .suggestion-container {
134
122
  display: flex;
@@ -142,9 +130,6 @@
142
130
  overflow-wrap: anywhere;
143
131
  align-items: center;
144
132
  border-radius: variables.$border-radius;
145
- @each $property, $value in $merged-entries-without-highlight {
146
- #{$property}: $value;
147
- }
148
133
 
149
134
  padding: 10px 20px;
150
135
 
@@ -154,7 +139,7 @@
154
139
  svg {
155
140
  transform: scale(0.6) translate(-6.9px, -7.2px);
156
141
  path {
157
- fill: $icon-color;
142
+ fill: variables.get-text-color("neutral", "default");
158
143
  }
159
144
  }
160
145
  }
@@ -191,7 +176,7 @@
191
176
  &.compact > .suggestion-container.query {
192
177
  flex-direction: row;
193
178
  flex-wrap: wrap;
194
- @include utils.flex-gap($autocomplete-gap-between-compact-suggestions, "row wrap");
179
+ @include utils.flex-gap(map.get(variables.get-gap("autocomplete"), "between-compact-suggestions"), "row wrap");
195
180
  }
196
181
  }
197
182
  }
@@ -3,22 +3,7 @@
3
3
  @use "../../variables";
4
4
 
5
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).
13
- @mixin CategorySuggestions(
14
- $card-background: white,
15
- $hovered-card-background: false,
16
- $card-border: false,
17
- $card-border-radius: variables.$border-radius,
18
- $title-font-weight: 420,
19
- $parent-title-font-weight: 400,
20
- $thin: true
21
- ) {
6
+ @mixin CategorySuggestions() {
22
7
  .category-suggestions {
23
8
  display: flex;
24
9
 
@@ -28,48 +13,34 @@
28
13
  }
29
14
 
30
15
  .title {
31
- font-weight: $title-font-weight;
16
+ font-weight: variables.get-font-weight(500);
32
17
  }
33
18
  .category-suggestion {
34
- background: $card-background;
19
+ background: variables.get-background-color("base", "default");
35
20
  transition: background 100ms ease-in-out;
36
21
 
37
- &:focus {
38
- @if $hovered-card-background {
39
- background: $hovered-card-background;
40
- } @else {
41
- @include utils.highlight-background($normal-background: $card-background);
42
- }
22
+ &:focus-visible {
23
+ background: variables.get-background-color("base", "hover");
43
24
  }
44
25
  @include supports-hover.supports-hover() {
45
26
  &:hover {
46
- @if $hovered-card-background {
47
- background: $hovered-card-background;
48
- } @else {
49
- @include utils.highlight-background($normal-background: $card-background);
50
- }
27
+ background: variables.get-background-color("base", "hover");
51
28
  }
52
29
  }
53
- border-radius: $card-border-radius;
54
- @if $card-border {
55
- border: $card-border;
30
+ &:active {
31
+ background: variables.get-background-color("base", "pressed");
56
32
  }
33
+ border: 1px solid variables.get-border-color("subtle", "default");
57
34
  padding: 10px 20px;
58
- color: black;
35
+ color: variables.get-text-color("base", "default");
59
36
  display: flex;
60
37
  height: 100%;
61
38
  align-items: center;
62
- @if $thin {
63
- justify-content: space-between;
64
- @include utils.flex-gap(10px, "row nowrap");
65
- } @else {
66
- justify-content: center;
67
- flex-direction: column;
68
- @include utils.flex-gap(10px, "column nowrap");
69
- }
39
+ justify-content: space-between;
40
+ @include utils.flex-gap(10px, "row nowrap");
70
41
 
71
42
  .parent-title {
72
- font-weight: $parent-title-font-weight;
43
+ font-weight: variables.get-font-weight(300);
73
44
  }
74
45
 
75
46
  & > * {
@@ -2,15 +2,8 @@
2
2
  @use "../../variables";
3
3
 
4
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
5
 
9
- @mixin InstantCard(
10
- $instant-card-sales-price-color: variables.$instant-card-sales-price-color,
11
- $instant-card-show-price: variables.$instant-card-show-price,
12
- $instant-card-show-tagline: variables.$instant-card-show-tagline
13
- ) {
6
+ @mixin InstantCard() {
14
7
  .instant-results {
15
8
  .instant-card {
16
9
  $card-gap: 1.5vw;
@@ -65,7 +58,7 @@
65
58
  word-break: break-word;
66
59
  }
67
60
 
68
- @if $instant-card-show-tagline {
61
+ @if variables.get-merged(variables.$instant-card-defaults, variables.$instant-card, "show-tagline") {
69
62
  .tagline {
70
63
  font-size: 0.9em;
71
64
  color: #868689;
@@ -78,7 +71,7 @@
78
71
  }
79
72
 
80
73
  .price-container {
81
- @if $instant-card-show-price {
74
+ @if variables.get-merged(variables.$instant-card-defaults, variables.$instant-card, "show-price") {
82
75
  display: flex;
83
76
 
84
77
  justify-content: center;
@@ -97,7 +90,11 @@
97
90
  color: #868689;
98
91
  }
99
92
  &.sales-price {
100
- color: $instant-card-sales-price-color;
93
+ color: variables.get-merged(
94
+ variables.$instant-card-defaults,
95
+ variables.$instant-card,
96
+ "sales-price-color"
97
+ );
101
98
  }
102
99
  }
103
100
  @media (max-width: 600px) {
@@ -1,12 +1,12 @@
1
1
  @use "../../helpers/utils";
2
+ @use "../../variables";
2
3
 
3
4
  /// Mixin that styles the container of the InstantResults in the SearchModal
4
- /// @param {Number with size unit} $gap [5px] - The gap between the InstantResults
5
- @mixin InstantResults($gap: 5px) {
5
+ @mixin InstantResults() {
6
6
  .instant-results {
7
7
  display: flex;
8
8
  flex-direction: column;
9
- @include utils.flex-gap($gap, "column nowrap");
9
+ @include utils.flex-gap(variables.get-gap("between-instant-results"), "column nowrap");
10
10
  @content;
11
11
  }
12
12
  }