@depict-ai/react-ui 0.0.74 → 0.0.76

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 (43) hide show
  1. package/dist/index.d.ts +46 -107
  2. package/dist/main.js +32 -32
  3. package/dist/module.js +21 -21
  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 +26 -27
  10. package/dist/styles/components/PLP/SlidableItems.scss +3 -6
  11. package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +16 -24
  12. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +184 -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 +5 -5
  32. package/dist/styles/helpers/utils.scss +8 -2
  33. package/dist/styles/index.scss +54 -3
  34. package/dist/styles/package.json +30 -0
  35. package/dist/styles/variables.scss +286 -52
  36. package/dist-server/index.d.ts +8 -8
  37. package/dist-server/main.js +12 -12
  38. package/dist-server/module.js +8 -8
  39. package/locales/index.d.ts +2 -2
  40. package/locales/index.js +1 -1
  41. package/locales/require.js +1 -1
  42. package/package.json +4 -5
  43. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +0 -152
package/dist/module.js CHANGED
@@ -1,16 +1,15 @@
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, EmbeddedNumProducts as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, DepictSearchPage as $TZSbU$DepictSearchPage, DepictCategoryPage as $TZSbU$DepictCategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, OpenModalWithAlignment as $TZSbU$OpenModalWithAlignment, SearchField as $TZSbU$SearchField} from "@depict-ai/js-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
- import {en as $TZSbU$en} from "@depict-ai/js-ui/locales";
5
+ import {en as $TZSbU$en} from "@depict-ai/ui/locales";
6
6
  import {render as $TZSbU$render} from "solid-js/web";
7
7
  import {jsx as $TZSbU$jsx} from "react/jsx-runtime";
8
8
  import {createPortal as $TZSbU$createPortal} from "react-dom";
9
- import {get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal} from "@depict-ai/ui";
10
9
 
11
10
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
12
11
  // Note, if you add an export here, also add one in src-server/main.ts
13
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.74";
12
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.76";
14
13
 
15
14
 
16
15
 
@@ -178,10 +177,11 @@ function $5376eb2a386cd90d$export$9fac37a9c21c2f3b(props) {
178
177
  const { search: search , category: category } = (0, $42858f023ef23dab$export$8e769ad4338a911e);
179
178
  const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
180
179
  set_search_page_path($5376eb2a386cd90d$var$ensure_correct_formatting(searchPagePath));
181
- 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)=>{
182
182
  if (navigateFunction) navigateFunction(new_relative_url);
183
183
  else (0, $7216ca4c8308a0f9$export$599d4515591ef232)(new_relative_url);
184
- } : undefined;
184
+ };
185
185
  if (!search) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
186
186
  search_query_url_param_name: urlParamName,
187
187
  market: market,
@@ -226,7 +226,7 @@ function $5376eb2a386cd90d$var$ensure_correct_formatting(path) {
226
226
 
227
227
 
228
228
 
229
- const $4db0e2f013fc5124$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $TZSbU$forwardRef)((_, ref)=>{
229
+ const $421f32789b6f111f$export$80e99ee6b29cadd2 = /*#__PURE__*/ (0, $TZSbU$forwardRef)((_, ref)=>{
230
230
  return /*#__PURE__*/ (0, $TZSbU$createElement)("div", {
231
231
  className: "depict aligner",
232
232
  style: {
@@ -242,7 +242,7 @@ const $4db0e2f013fc5124$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $TZSbU$forwa
242
242
 
243
243
 
244
244
 
245
- function $4a678f0c87b12e78$export$210723f5a54a7028(props) {
245
+ function $4a678f0c87b12e78$export$a54ec244c8863715(props) {
246
246
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($4a678f0c87b12e78$var$SolidSearchPage), props);
247
247
  }
248
248
  function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
@@ -261,7 +261,7 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
261
261
  update_updating_blocked_signal();
262
262
  });
263
263
  const component_portals = new Set();
264
- return (0, $TZSbU$DepictSearchPage)({
264
+ return (0, $TZSbU$SearchPage)({
265
265
  // Default config goes here
266
266
  include_input_field: props.includeInputField ?? true,
267
267
  cols_at_size: props.columnsAtSize ?? [
@@ -296,7 +296,7 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
296
296
 
297
297
 
298
298
  let $48d7f568740a317d$var$render_cb;
299
- function $48d7f568740a317d$export$d87c61cecb2edf0d(props) {
299
+ function $48d7f568740a317d$export$f7d2f673fc2f091d(props) {
300
300
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($48d7f568740a317d$var$SolidCategoryPage), props, "div", {}, (props)=>$48d7f568740a317d$var$render_cb?.(props));
301
301
  }
302
302
  function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
@@ -310,7 +310,7 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
310
310
  };
311
311
  $48d7f568740a317d$var$render_cb(props);
312
312
  const component_portals = new Set();
313
- const category = ()=>(0, $TZSbU$DepictCategoryPage)({
313
+ const category = ()=>(0, $TZSbU$CategoryPage)({
314
314
  depict_category: depict_category,
315
315
  cols_at_size: props.columnsAtSize ?? [
316
316
  [
@@ -398,16 +398,16 @@ const $cbd250061abf11cb$export$89c6019e4baa40b1 = ({ width: width , height: heig
398
398
 
399
399
 
400
400
 
401
- const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
401
+ const $41cab674edff4277$export$d69d8daa20eae175 = (createOpenModalParams)=>{
402
402
  const { globalState: globalState , location: location = "centered" , alignerRef: alignerRef } = createOpenModalParams;
403
403
  const openModal = ()=>{
404
404
  if (globalState.search) {
405
- if (location === "aligned" && alignerRef?.current) (0, $TZSbU$OpenModalWithAlignment)({
405
+ if (location === "aligned" && alignerRef?.current) (0, $TZSbU$open_modal_with_alignment)({
406
406
  "element": alignerRef.current,
407
407
  "location": location,
408
408
  "search": globalState.search
409
409
  });
410
- else (0, $TZSbU$OpenModalWithAlignment)({
410
+ else (0, $TZSbU$open_modal_with_alignment)({
411
411
  "location": "centered",
412
412
  "search": globalState.search
413
413
  });
@@ -417,8 +417,8 @@ const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
417
417
  };
418
418
 
419
419
 
420
- function $cfa72c75e6cf6901$export$cc1e9aaf280afdcb(params = {}) {
421
- const open = (0, $5e26376d86621891$export$d69d8daa20eae175)({
420
+ function $70344e5e0d0fea06$export$912994940e660d32(params = {}) {
421
+ const open = (0, $41cab674edff4277$export$d69d8daa20eae175)({
422
422
  globalState: $42858f023ef23dab$export$8e769ad4338a911e,
423
423
  ...params
424
424
  });
@@ -431,7 +431,7 @@ function $cfa72c75e6cf6901$export$cc1e9aaf280afdcb(params = {}) {
431
431
 
432
432
 
433
433
 
434
- const $a732d80ca44c466d$export$bde46b5bb6287cea = (props)=>{
434
+ const $cdd7408b22d1586a$export$bde46b5bb6287cea = (props)=>{
435
435
  const ReactSearchField = ()=>{
436
436
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
437
437
  depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search,
@@ -442,12 +442,12 @@ const $a732d80ca44c466d$export$bde46b5bb6287cea = (props)=>{
442
442
  };
443
443
 
444
444
 
445
- const $e3ccaca62718bae4$export$45080d603eda647c = (props)=>{
446
- const SearchField = (0, $a732d80ca44c466d$export$bde46b5bb6287cea)({
445
+ const $2b886cf548a4775c$export$9bb30bbe003b82e0 = (props)=>{
446
+ const SearchField = (0, $cdd7408b22d1586a$export$bde46b5bb6287cea)({
447
447
  alignerRef: props?.alignerRef
448
448
  });
449
449
  return {
450
- DepictSearchField: SearchField
450
+ SearchField: SearchField
451
451
  };
452
452
  };
453
453
 
@@ -473,4 +473,4 @@ const $97603d19204ec48d$export$b8a61e5c71402559 = {
473
473
  (0, $TZSbU$add_to_version_info)("react-ui", (0, $c9c4d066f9a5b51b$export$83d89fbfd8236492));
474
474
 
475
475
 
476
- export {$b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $4db0e2f013fc5124$export$3f4580d6398c5027 as DepictAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $48d7f568740a317d$export$d87c61cecb2edf0d as DepictCategoryPage, $4a678f0c87b12e78$export$210723f5a54a7028 as DepictSearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $cfa72c75e6cf6901$export$cc1e9aaf280afdcb as useDepictSearchModal, $e3ccaca62718bae4$export$45080d603eda647c as useDepictSearchField, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
476
+ export {$b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $421f32789b6f111f$export$80e99ee6b29cadd2 as ComponentAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $48d7f568740a317d$export$f7d2f673fc2f091d as CategoryPage, $4a678f0c87b12e78$export$a54ec244c8863715 as SearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $70344e5e0d0fea06$export$912994940e660d32 as useSearchModal, $2b886cf548a4775c$export$9bb30bbe003b82e0 as useSearchField, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
@@ -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
  }
@@ -1,36 +1,36 @@
1
1
  @use "../../variables";
2
2
  @use "../../helpers/utils";
3
3
  @use "../../helpers/supports-hover";
4
- @use "./Buttons";
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
  }
@@ -1,6 +1,6 @@
1
1
  // @use "../../../rendering/slider_button_positioning";
2
2
  @use "../../helpers/utils";
3
- @use "../../components/PLP/Buttons";
3
+ @use "Buttons";
4
4
  @use "../../variables";
5
5
  @use "../../helpers/supports-hover";
6
6
  @use "sass:map";
@@ -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;