@depict-ai/react-ui 0.0.73 → 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 (41) hide show
  1. package/dist/index.d.ts +2 -3
  2. package/dist/main.js +16 -34
  3. package/dist/module.js +17 -35
  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.js +1 -1
  39. package/locales/require.js +1 -1
  40. package/package.json +4 -4
  41. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +0 -152
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui/dist";
1
+ import { SDKColsAtSize, SDKGridSpacing, CategoryTitle, embedded_num_products } from "@depict-ai/ui";
2
2
  import { Display } from "@depict-ai/utilishared";
3
3
  import React, { ReactNode, PropsWithChildren, ReactElement } from "react";
4
4
  import { Locale } from "@depict-ai/ui/locales";
5
- import { CategoryTitle, embedded_num_products } from "@depict-ai/ui";
6
- export const version = "0.0.73";
5
+ export const version = "0.0.75";
7
6
  interface PLPConfig<T extends Display> {
8
7
  /**
9
8
  * The product card to use for rendering products.
package/dist/main.js CHANGED
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
27
27
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
28
28
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
29
29
  // Note, if you add an export here, also add one in src-server/main.ts
30
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.73";
30
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.75";
31
31
 
32
32
 
33
33
 
@@ -195,10 +195,11 @@ function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
195
195
  const { search: search , category: category } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
196
196
  const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
197
197
  set_search_page_path($24b00503eef73528$var$ensure_correct_formatting(searchPagePath));
198
- const on_navigation = typeof window?.next?.router !== "undefined" || navigateFunction ? (new_relative_url)=>{
198
+ if (typeof window?.next?.router === "undefined" && !navigateFunction) throw new Error("You must provide a navigateFunction when not using Next.js.");
199
+ const on_navigation = (new_relative_url)=>{
199
200
  if (navigateFunction) navigateFunction(new_relative_url);
200
201
  else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_relative_url);
201
- } : undefined;
202
+ };
202
203
  if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
203
204
  search_query_url_param_name: urlParamName,
204
205
  market: market,
@@ -258,6 +259,7 @@ const $d96434e62e08087d$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $4GYXz$react
258
259
 
259
260
 
260
261
 
262
+
261
263
  function $7ad7a3d0011b7b1b$export$210723f5a54a7028(props) {
262
264
  return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($7ad7a3d0011b7b1b$var$SolidSearchPage), props);
263
265
  }
@@ -414,40 +416,20 @@ const $7c8b440edc188ad5$export$89c6019e4baa40b1 = ({ width: width , height: heig
414
416
 
415
417
 
416
418
 
417
-
418
419
  const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
419
420
  const { globalState: globalState , location: location = "centered" , alignerRef: alignerRef } = createOpenModalParams;
420
421
  const openModal = ()=>{
421
- const headerAligner = alignerRef?.current;
422
- if (!globalState.search) throw new Error("No active search in the app!");
423
- if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
424
- const alignment_height = headerAligner?.clientHeight;
425
- if (location !== "aligned" || isNaN(alignment_height)) {
426
- // Open centered modal
427
- globalState.search.modal_open = true;
428
- return;
429
- }
430
- if (!headerAligner) return;
431
- const { cleanup: cleanup } = (0, $4GYXz$depictaiui.connect_search_field_height_to_aligner_height)(headerAligner);
432
- let dispose_aligner;
433
- /**
434
- * Setting position to fixed is important to make the modal work with align_field.
435
- */ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
436
- position: "fixed"
437
- });
438
- (0, $4GYXz$solidjs.createRoot)((dispose)=>{
439
- dispose_aligner = ()=>{
440
- cleanup();
441
- dispose();
442
- };
443
- (0, $4GYXz$depictaiui.align_field)(style_props_, headerAligner, undefined, false, "top");
444
- });
445
- globalState.search.modal_open = [
446
- {
447
- style_props_: style_props_
448
- },
449
- dispose_aligner
450
- ];
422
+ if (globalState.search) {
423
+ if (location === "aligned" && alignerRef?.current) (0, $4GYXz$depictaiui.open_modal_with_alignment)({
424
+ "element": alignerRef.current,
425
+ "location": location,
426
+ "search": globalState.search
427
+ });
428
+ else (0, $4GYXz$depictaiui.open_modal_with_alignment)({
429
+ "location": "centered",
430
+ "search": globalState.search
431
+ });
432
+ } else throw new Error("No search instance was provided.");
451
433
  };
452
434
  return openModal;
453
435
  };
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {add_to_version_info as $TZSbU$add_to_version_info, catchify as $TZSbU$catchify, observer as $TZSbU$observer, history_replacer as $TZSbU$history_replacer, queueMacroTask as $TZSbU$queueMacroTask, href_change_ipns as $TZSbU$href_change_ipns, ContainedPlaceholderImage as $TZSbU$ContainedPlaceholderImage, Placeholder as $TZSbU$Placeholder} from "@depict-ai/utilishared";
2
- import {CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, CategoryPage as $TZSbU$CategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, connect_search_field_height_to_aligner_height as $TZSbU$connect_search_field_height_to_aligner_height, align_field as $TZSbU$align_field, SearchField as $TZSbU$SearchField} from "@depict-ai/ui";
2
+ import {CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, CategoryPage as $TZSbU$CategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, open_modal_with_alignment as $TZSbU$open_modal_with_alignment, SearchField as $TZSbU$SearchField} from "@depict-ai/ui";
3
3
  import {createRoot as $TZSbU$createRoot, untrack as $TZSbU$untrack, createSignal as $TZSbU$createSignal, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, onCleanup as $TZSbU$onCleanup, createComputed as $TZSbU$createComputed} from "solid-js";
4
4
  import {createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, forwardRef as $TZSbU$forwardRef} from "react";
5
5
  import {en as $TZSbU$en} from "@depict-ai/ui/locales";
@@ -9,7 +9,7 @@ import {createPortal as $TZSbU$createPortal} from "react-dom";
9
9
 
10
10
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
11
11
  // Note, if you add an export here, also add one in src-server/main.ts
12
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.73";
12
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.75";
13
13
 
14
14
 
15
15
 
@@ -177,10 +177,11 @@ function $5376eb2a386cd90d$export$9fac37a9c21c2f3b(props) {
177
177
  const { search: search , category: category } = (0, $42858f023ef23dab$export$8e769ad4338a911e);
178
178
  const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
179
179
  set_search_page_path($5376eb2a386cd90d$var$ensure_correct_formatting(searchPagePath));
180
- const on_navigation = typeof window?.next?.router !== "undefined" || navigateFunction ? (new_relative_url)=>{
180
+ if (typeof window?.next?.router === "undefined" && !navigateFunction) throw new Error("You must provide a navigateFunction when not using Next.js.");
181
+ const on_navigation = (new_relative_url)=>{
181
182
  if (navigateFunction) navigateFunction(new_relative_url);
182
183
  else (0, $7216ca4c8308a0f9$export$599d4515591ef232)(new_relative_url);
183
- } : undefined;
184
+ };
184
185
  if (!search) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
185
186
  search_query_url_param_name: urlParamName,
186
187
  market: market,
@@ -240,6 +241,7 @@ const $4db0e2f013fc5124$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $TZSbU$forwa
240
241
 
241
242
 
242
243
 
244
+
243
245
  function $4a678f0c87b12e78$export$210723f5a54a7028(props) {
244
246
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($4a678f0c87b12e78$var$SolidSearchPage), props);
245
247
  }
@@ -396,40 +398,20 @@ const $cbd250061abf11cb$export$89c6019e4baa40b1 = ({ width: width , height: heig
396
398
 
397
399
 
398
400
 
399
-
400
401
  const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
401
402
  const { globalState: globalState , location: location = "centered" , alignerRef: alignerRef } = createOpenModalParams;
402
403
  const openModal = ()=>{
403
- const headerAligner = alignerRef?.current;
404
- if (!globalState.search) throw new Error("No active search in the app!");
405
- if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
406
- const alignment_height = headerAligner?.clientHeight;
407
- if (location !== "aligned" || isNaN(alignment_height)) {
408
- // Open centered modal
409
- globalState.search.modal_open = true;
410
- return;
411
- }
412
- if (!headerAligner) return;
413
- const { cleanup: cleanup } = (0, $TZSbU$connect_search_field_height_to_aligner_height)(headerAligner);
414
- let dispose_aligner;
415
- /**
416
- * Setting position to fixed is important to make the modal work with align_field.
417
- */ const style_props_ = (0, $TZSbU$createSignal)({
418
- position: "fixed"
419
- });
420
- (0, $TZSbU$createRoot)((dispose)=>{
421
- dispose_aligner = ()=>{
422
- cleanup();
423
- dispose();
424
- };
425
- (0, $TZSbU$align_field)(style_props_, headerAligner, undefined, false, "top");
426
- });
427
- globalState.search.modal_open = [
428
- {
429
- style_props_: style_props_
430
- },
431
- dispose_aligner
432
- ];
404
+ if (globalState.search) {
405
+ if (location === "aligned" && alignerRef?.current) (0, $TZSbU$open_modal_with_alignment)({
406
+ "element": alignerRef.current,
407
+ "location": location,
408
+ "search": globalState.search
409
+ });
410
+ else (0, $TZSbU$open_modal_with_alignment)({
411
+ "location": "centered",
412
+ "search": globalState.search
413
+ });
414
+ } else throw new Error("No search instance was provided.");
433
415
  };
434
416
  return openModal;
435
417
  };
@@ -4,17 +4,15 @@
4
4
  @use "sass:color";
5
5
  @use "sass:map";
6
6
 
7
- $primary-button-overrides: ();
8
- $secondary-button-overrides: ();
9
-
10
7
  /// Used to get the current properties of the primary button. (`Buttons.$primary-button-overrides` merged into the default properties.) This is so that parts of the button styling can be re-used in other mixins in the state they were in as the mixins get called.
11
8
  /// @example
12
9
  /// filter: map.get(Buttons.get-primary-button-properties(), "focus-visible-filter");
13
10
  @function get-primary-button-properties() {
14
11
  $primary-button-properties: (
15
- "background": variables.$brand-black,
16
- "color": #fff,
17
- // so that the page doesn't jump when there's half a border when switching between having sort and filters open (the buttons switch between pimary and secondary)
12
+ "background": variables.get-background-color("inverse", "default"),
13
+ "hover-background": variables.get-background-color("inverse", "hover"),
14
+ "active-background": variables.get-background-color("inverse", "pressed"),
15
+ "color": variables.get-text-color("inverse", "default"),
18
16
  "border": 1px solid transparent,
19
17
  "border-radius": variables.$border-radius,
20
18
  "hover-filter": drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15)),
@@ -22,7 +20,7 @@ $secondary-button-overrides: ();
22
20
  "focus-visible-filter": drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))
23
21
  drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8)),
24
22
  );
25
- @return map.merge($primary-button-properties, $primary-button-overrides);
23
+ @return map.deep-merge($primary-button-properties, variables.$primary-button);
26
24
  }
27
25
 
28
26
  /// Used to get the current properties of the secondary button. (`Buttons.$secondary-button-overrides` merged into the default properties.) This is so that parts of the button styling can be re-used in other mixins in the state they were in as the mixins get called.
@@ -30,40 +28,25 @@ $secondary-button-overrides: ();
30
28
  /// filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
31
29
  @function get-secondary-button-properties() {
32
30
  $secondary-button-properties: (
33
- "background": variables.$brand-lightest-grey,
34
- "color": variables.$brand-dark-grey,
35
- "border": 1px solid variables.$brand-black,
31
+ "background": variables.get-background-color("base", "default"),
32
+ "hover-background": variables.get-background-color("base", "hover"),
33
+ "active-background": variables.get-background-color("base", "pressed"),
34
+ "color": variables.get-text-color("base", "default"),
35
+ "border": variables.get-border-color("base", "default") 1px solid,
36
36
  "border-radius": variables.$border-radius,
37
37
  "hover-filter": drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15)),
38
38
  "active-filter": drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15)),
39
39
  "focus-visible-filter": drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))
40
40
  drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8)),
41
41
  );
42
- @return map.merge($secondary-button-properties, $secondary-button-overrides);
42
+ @return map.deep-merge($secondary-button-properties, variables.$secondary-button);
43
43
  }
44
44
 
45
45
  /// Generates styling for our primary buttons, including hover, active and focus-visible states
46
- ///
47
- /// *Please only provide options to this mixin if you want to create styling for just a specific button.*
48
- ///
49
- /// This mixin and the SecondaryButton mixin are currently specialties in how they get customised using maps. Everything that isn't customised using maps is subject to change in the future.
50
- ////
51
- /// *For generally changing how the buttons look, override the $primary-button-overrides map with a custom map containing the properties you want to change.*
52
- /// See the example below.
53
- /// @example
54
- /// // To override styling (see explanation in description)
55
- /// Buttons.$primary-button-overrides: ("background": #3f322a, "color": rgb(240,240,240));
56
- /// @param {Color} $background [map.get(get-primary-button-properties(), "background")] - The background color of the button. From this color other button states will be automatically inferred by lightening or darkening it.
57
- ///
58
- /// @param {Color} $color [map.get(get-primary-button-properties(), "color")] - The color of the button text
59
- /// @param {Border} $border [map.get(get-primary-button-properties(), "border")] - The button border
60
- /// @param {Number with unit} $border-radius [map.get(get-primary-button-properties(), "border-radius")] - The button border radius
61
- /// @param {Filter} $hover-filter [map.get(get-primary-button-properties(), "hover-filter")] - The filter to apply on hover
62
- /// @param {Filter} $active-filter [map.get(get-primary-button-properties(), "active-filter")] - The filter to apply on active
63
- /// @param {Filter} $focus-visible-filter [map.get(get-primary-button-properties(), "focus-visible-filter")] - The filter to apply on focus-visible (when the button is focused using keyboard navigation)
64
-
65
46
  @mixin PrimaryButton(
66
47
  $background: map.get(get-primary-button-properties(), "background"),
48
+ $hover-background: map.get(get-primary-button-properties(), "hover-background"),
49
+ $active-background: map.get(get-primary-button-properties(), "active-background"),
67
50
  $color: map.get(get-primary-button-properties(), "color"),
68
51
  $border: map.get(get-primary-button-properties(), "border"),
69
52
  $border-radius: map.get(get-primary-button-properties(), "border-radius"),
@@ -71,10 +54,11 @@ $secondary-button-overrides: ();
71
54
  $active-filter: map.get(get-primary-button-properties(), "active-filter"),
72
55
  $focus-visible-filter: map.get(get-primary-button-properties(), "focus-visible-filter")
73
56
  ) {
74
- // not using button.primary since that's 100% going to conflict with existing declarations on sites
75
57
  button.major {
76
58
  @include Button(
77
59
  $background,
60
+ $hover-background,
61
+ $active-background,
78
62
  $color,
79
63
  $border,
80
64
  $border-radius,
@@ -88,27 +72,11 @@ $secondary-button-overrides: ();
88
72
  }
89
73
 
90
74
  /// Generates styling for our secondary buttons, including hover, active and focus-visible states
91
- ///
92
- /// *Please only provide options to this mixin if you want to create styling for just a specific button.*
93
- ///
94
- /// This mixin and the SecondaryButton mixin are currently specialties in how they get customised using maps. Everything that isn't customised using maps is subject to change in the future.
95
- ////
96
- /// *For generally changing how the buttons look, override the $secondary-button-overrides map with a custom map containing the properties you want to change.*
97
- /// See the example below.
98
- /// @example
99
- /// // To override styling (see explanation in description)
100
- /// Buttons.$secondary-button-overrides: ("border": 1px solid #afafaf, "background": white);
101
- /// @param {Color} $background [map.get(get-secondary-button-properties(), "background")] - The background color of the button. From this color other button states will be automatically inferred by lightening or darkening it.
102
- ///
103
- /// @param {Color} $color [map.get(get-secondary-button-properties(), "color")] - The color of the button text
104
- /// @param {Border} $border [map.get(get-secondary-button-properties(), "border")] - The button border
105
- /// @param {Number with unit} $border-radius [map.get(get-secondary-button-properties(), "border-radius")] - The button border radius
106
- /// @param {Filter} $hover-filter [map.get(get-secondary-button-properties(), "hover-filter")] - The filter to apply on hover
107
- /// @param {Filter} $active-filter [map.get(get-secondary-button-properties(), "active-filter")] - The filter to apply on active
108
- /// @param {Filter} $focus-visible-filter [map.get(get-secondary-button-properties(), "focus-visible-filter")] - The filter to apply on focus-visible (when the button is focused using keyboard navigation)
109
75
 
110
76
  @mixin SecondaryButton(
111
77
  $background: map.get(get-secondary-button-properties(), "background"),
78
+ $hover-background: map.get(get-secondary-button-properties(), "hover-background"),
79
+ $active-background: map.get(get-secondary-button-properties(), "active-background"),
112
80
  $color: map.get(get-secondary-button-properties(), "color"),
113
81
  $border: map.get(get-secondary-button-properties(), "border"),
114
82
  $border-radius: map.get(get-secondary-button-properties(), "border-radius"),
@@ -116,10 +84,11 @@ $secondary-button-overrides: ();
116
84
  $active-filter: map.get(get-secondary-button-properties(), "active-filter"),
117
85
  $focus-visible-filter: map.get(get-secondary-button-properties(), "focus-visible-filter")
118
86
  ) {
119
- // not using button.secondary since that's 100% going to conflict with existing declarations on sites
120
87
  button.minor {
121
88
  @include Button(
122
89
  $background,
90
+ $hover-background,
91
+ $active-background,
123
92
  $color,
124
93
  $border,
125
94
  $border-radius,
@@ -134,6 +103,8 @@ $secondary-button-overrides: ();
134
103
 
135
104
  @mixin Button(
136
105
  $background,
106
+ $hover-background,
107
+ $active-background,
137
108
  $color,
138
109
  $border,
139
110
  $border-radius,
@@ -163,19 +134,19 @@ $secondary-button-overrides: ();
163
134
  @include supports-hover.supports-hover() {
164
135
  &:hover {
165
136
  filter: $hover-filter;
166
- @include utils.highlight-background($normal-background: $background);
137
+ background: $hover-background;
167
138
  }
168
139
  }
169
140
  &:active {
170
141
  filter: $active-filter;
171
- @include utils.highlight-background($normal-background: $background, $darken-factor: 10%, $lighten-factor: 20%);
142
+ background: $active-background;
172
143
  }
173
144
  &:focus {
174
145
  outline-style: none;
175
146
  }
176
147
  &:focus-visible {
177
148
  filter: $focus-visible-filter;
178
- @include utils.highlight-background($normal-background: $background);
149
+ background: $hover-background;
179
150
  }
180
151
  @content;
181
152
  }
@@ -1,4 +1,6 @@
1
- @mixin MorphingSign($color: #fff) {
1
+ @use "../../variables";
2
+
3
+ @mixin MorphingSign() {
2
4
  .morphing-sign {
3
5
  /* https://stackoverflow.com/a/38136283 */
4
6
  border: 0;
@@ -8,7 +10,7 @@
8
10
 
9
11
  span {
10
12
  position: absolute;
11
- background: $color;
13
+ background: variables.get-text-color("neutral", "default");
12
14
  border-radius: 2px;
13
15
  }
14
16
 
@@ -10,7 +10,7 @@
10
10
  flex-direction: column;
11
11
 
12
12
  .no-results {
13
- background: white;
13
+ background: variables.$page-background-color;
14
14
  padding: 40px;
15
15
  display: flex;
16
16
  justify-content: flex-start;
@@ -1,14 +1,15 @@
1
1
  @use "../../helpers/utils";
2
+ @use "../../variables";
3
+ @use "sass:map";
2
4
 
3
5
  /// Styling that ties together the different components that are common to both Category and Search pages. Mainly takes care of margins and paddings but also sets the styling for .cards which is in both PLPResults and SearchRecommendations.
4
6
  ///
5
7
  /// Note that for the gaps not the exact values will always be used but often multiples for different places where it's appropriate.
6
- ///
7
- /// @param {Number with size unit} $spacing-to-filters [12px] - The spacing between the filters and content.
8
- /// @param {Number with size unit} $desktop-item-gap [20px] - The vertical gap between the different items on desktop.
9
- /// @param {Number with size unit} $mobile-item-gap [16px] - The vertical gap between the different items on mobile.
10
8
 
11
- @mixin ProductListingPage($spacing-to-filters: 12px, $desktop-item-gap: 20px, $mobile-item-gap: 16px) {
9
+ @mixin ProductListingPage() {
10
+ $spacing-to-filters: map.get(variables.get-gap("listing-page"), "spacing-to-filters");
11
+ $desktop-item-gap: map.get(variables.get-gap("listing-page"), "desktop-item-gap");
12
+ $mobile-item-gap: map.get(variables.get-gap("listing-page"), "mobile-item-gap");
12
13
  .listing-page {
13
14
  padding: $desktop-item-gap calc(#{$desktop-item-gap} / 2);
14
15
  @include mobile_sizes() {
@@ -65,24 +66,21 @@
65
66
  ///
66
67
  /// Note that for the gaps not the exact values will always be used but often multiples for different places where it's appropriate.
67
68
  ///
68
- /// @param {Number with size unit} $spacing-to-filters [12px] - The spacing between the filters and content.
69
- /// @param {Number with size unit} $desktop-item-gap [20px] - The vertical gap between the different items on desktop.
70
- /// @param {Number with size unit} $mobile-item-gap [16px] - The vertical gap between the different items on mobile.
71
- /// @param {Boolean} $spacing-above-search-field [true] - Whether to add equal spacing above the search field as below.
72
- /// @param {Number with size unit} $search-field-width [800px] - The max width of the search field field (if present)
73
- /// @param {Number} $gaps-to-recs-factor [3] - The factor to multiply the gaps with to get the spacing above the recommendations.
74
69
 
75
- @mixin SearchPage(
76
- $spacing-to-filters: 12px,
77
- $desktop-item-gap: 20px,
78
- $mobile-item-gap: 16px,
79
- $spacing-above-search-field: true,
80
- $search-field-width: 800px,
81
- $gap-to-recs-factor: 3
82
- ) {
70
+ @mixin SearchPage() {
71
+ $spacing-to-filters: map.get(variables.get-gap("listing-page"), "spacing-to-filters");
72
+ $desktop-item-gap: map.get(variables.get-gap("listing-page"), "desktop-item-gap");
73
+ $mobile-item-gap: map.get(variables.get-gap("listing-page"), "mobile-item-gap");
74
+ $gap-to-recs-factor: map.get(map.get(variables.get-gap("listing-page"), "search"), "gap-to-recs-factor");
75
+ $spacing-above-search-field: map.get(
76
+ map.get(variables.get-gap("listing-page"), "search"),
77
+ "spacing-above-search-field"
78
+ );
79
+
83
80
  .listing-page {
84
81
  .search-field {
85
- width: min(100%, $search-field-width);
82
+ $max-width: variables.get-merged(variables.$search-modal-defaults, variables.$search-modal, "max-width");
83
+ width: min(100%, $max-width);
86
84
  align-self: center;
87
85
 
88
86
  @if $spacing-above-search-field {
@@ -143,11 +141,10 @@
143
141
 
144
142
  /// Styling that ties together the different components on the CategoryPage. Mainly takes care of margins and paddings.
145
143
  ///
146
- /// @param {Number with size unit} $spacing-to-filters [12px] - The spacing between the filters and content.
147
- /// @param {Number with size unit} $desktop-item-gap [20px] - The vertical gap between the different items on desktop.
148
- /// @param {Number with size unit} $mobile-item-gap [16px] - The vertical gap between the different items on mobile.
149
144
 
150
- @mixin CategoryPage($spacing-to-filters: 12px, $desktop-item-gap: 20px, $mobile-item-gap: 16px) {
145
+ @mixin CategoryPage() {
146
+ $desktop-item-gap: map.get(variables.get-gap("listing-page"), "desktop-item-gap");
147
+ $mobile-item-gap: map.get(variables.get-gap("listing-page"), "mobile-item-gap");
151
148
  .listing-page {
152
149
  .quicklinks,
153
150
  .crumbs {
@@ -4,13 +4,9 @@
4
4
  ///
5
5
  /// If you too think that blurring the background would look great here, please take a minute to upvote this chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1382360
6
6
  ///
7
- /// @param {Color} $scroll-status-background [rgba(100, 100, 100, 0.9)] - The background color of the scroll status. I recommend setting a slightly transparent color.
8
7
  /// @param {Number with size unit} $border-radius [variables.$border-radius * 5] - The border-radius of the scroll status.
9
8
 
10
- @mixin ScrollStatus(
11
- $scroll-status-background: rgba(100, 100, 100, 0.9),
12
- $border-radius: calc(#{variables.$border-radius} * 5)
13
- ) {
9
+ @mixin ScrollStatus() {
14
10
  .scroll-status {
15
11
  pointer-events: none;
16
12
  position: sticky;
@@ -21,11 +17,12 @@
21
17
  z-index: calc(#{variables.$base-z-index} + 4);
22
18
  align-items: center;
23
19
  opacity: 0;
20
+
24
21
  .text {
25
- background: $scroll-status-background;
26
- color: white;
22
+ background: rgba(variables.get-background-color("inverse", "hover"), 0.75);
23
+ color: variables.get-text-color("inverse", "default");
27
24
  padding: 10px 20px;
28
- border-radius: $border-radius;
25
+ border-radius: calc(#{variables.$border-radius} * 5);
29
26
  }
30
27
  }
31
28
  }
@@ -2,35 +2,35 @@
2
2
  @use "../../helpers/utils";
3
3
  @use "../../helpers/supports-hover";
4
4
  @use "./Buttons";
5
+ @use "./ProductListingPage";
5
6
  @use "sass:map";
6
7
 
7
8
  /// Mixin that styles the SelectedFilters component, which is the component that shows the selected filters if both the sorting and filtering menus are currently hidden.
8
- /// @param {Number with size unit} $border-radius [variables.$border-radius] - A local override of the border-radius variable.
9
- /// @param {String} $title-color [variables.$brand-black] - The color of the text that says "Filters:" (the key of this string is `selected_filters_title_` in the locale files).
10
- /// @param {String} $filter-title-transform [uppercase] - text-transform for the aforementioned "Filters:" string
11
- /// @param {Number with size unit} $margin-on-desktop [0px] - Margin above/below SelectedFilters on desktop. This is set here because ExpandingContainer, our expanding component, gets confused when the margin isn't precisely on this element. Otherwise this value would be in ProductListingPage.scss.
12
- /// @param {Boolean} $set-border-on-crumbs [true] - Whether to set a border on the "crumbs" (a crumb is one selected filter).
13
9
 
14
- @mixin SelectedFilters(
15
- $border-radius: variables.$border-radius,
16
- $title-color: variables.$brand-black,
17
- $filter-title-transform: uppercase,
18
- $margin-on-desktop: 0px,
19
- $set-border-on-crumbs: true
20
- ) {
10
+ @mixin SelectedFilters() {
21
11
  .listing-page .selected-filters {
22
12
  .inner {
23
13
  // this is in here because it's an ExpandingContainer and the animation gets borked otherwise
24
- margin-top: 10px;
25
- margin-bottom: 10px;
14
+ $margin-on-desktop: map.get(
15
+ map.get(variables.get-gap("listing-page"), "above-and-below-selected-filters"),
16
+ "desktop"
17
+ );
18
+ $margin-on-mobile: map.get(
19
+ map.get(variables.get-gap("listing-page"), "above-and-below-selected-filters"),
20
+ "mobile"
21
+ );
22
+ margin-top: $margin-on-desktop;
23
+ margin-bottom: $margin-on-desktop;
26
24
  display: flex;
27
25
  align-items: center;
26
+
28
27
  .title {
29
28
  margin-right: 10px;
30
29
  }
31
- @media (min-width: 652px) {
32
- margin-top: $margin-on-desktop;
33
- margin-bottom: $margin-on-desktop;
30
+
31
+ @include ProductListingPage.mobile_sizes() {
32
+ margin-top: $margin-on-mobile;
33
+ margin-bottom: $margin-on-mobile;
34
34
  }
35
35
 
36
36
  .title {
@@ -38,8 +38,8 @@
38
38
  display: none;
39
39
  }
40
40
  font-size: 1.1em;
41
- text-transform: $filter-title-transform;
42
- color: $title-color;
41
+ text-transform: variables.$uppercase-text-transform;
42
+ color: variables.get-text-color("base", "default");
43
43
  }
44
44
 
45
45
  .depict-slider {
@@ -47,18 +47,16 @@
47
47
  width: unset;
48
48
 
49
49
  .clear-filter {
50
- @if $set-border-on-crumbs {
51
- border: 1px solid map.get(Buttons.get-primary-button-properties(), "background");
52
- }
50
+ border: 1px solid map.get(Buttons.get-primary-button-properties(), "background");
51
+
53
52
  svg {
54
53
  width: 12.64px;
55
54
  height: 12.64px;
56
55
  }
57
56
  }
57
+
58
58
  .clear-all-filters {
59
- @if $set-border-on-crumbs {
60
- border: map.get(Buttons.get-secondary-button-properties(), "border");
61
- }
59
+ border: map.get(Buttons.get-secondary-button-properties(), "border");
62
60
  }
63
61
 
64
62
  .clear-filter,
@@ -70,12 +68,13 @@
70
68
  display: flex;
71
69
  @include utils.flex-gap(5px, "row nowrap");
72
70
  align-items: center;
73
- border-radius: $border-radius;
71
+ border-radius: variables.$border-radius;
74
72
  font-size: 1em;
75
73
  line-height: 1;
76
74
  cursor: pointer;
77
75
  }
78
76
  }
77
+
79
78
  @content;
80
79
  }
81
80
  }
@@ -52,10 +52,7 @@
52
52
  /// Most of the times SlidableItems is used for items laid out horizontally that do not fit the screen width.
53
53
  ///
54
54
  /// Examples are the QuickLinks (used to navigate sideways or downwards in the category tree) and the SelectedFilters (if not all selected filters fit on the screen).
55
- /// @param {Color} $fade-to [variables.$brand-lighter-grey] - The color the slider buttons fade to, set this to the background color behind the slider.
56
- /// @param {Color} @fade-from [transparent] - The color the slider buttons fade from, you probably want to leave this at transparent.
57
- @mixin SlidableItems($fade-to: variables.$brand-lighter-grey, $fade-from: rgba(238, 238, 240, 0)) {
58
- // TODO: we could probably infer these colours (and maybe some more) if we add some global background color variable
55
+ @mixin SlidableItems() {
59
56
  .depict-slider {
60
57
  width: 100%;
61
58
  position: relative;
@@ -84,7 +81,7 @@
84
81
  padding-left: 0;
85
82
  padding-bottom: 0;
86
83
  width: 26px;
87
- background: linear-gradient(270deg, $fade-to 50%, $fade-from 105%);
84
+ background: linear-gradient(270deg, variables.$page-background-color 50%, transparent 105%);
88
85
  display: flex;
89
86
  align-items: center;
90
87
  justify-content: flex-end;