@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
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { SDKColsAtSize, SDKGridSpacing, CategoryTitle, EmbeddedNumProducts } from "@depict-ai/js-ui";
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
- import { Locale } from "@depict-ai/js-ui/locales";
5
- export const version = "0.0.74";
4
+ import { Locale } from "@depict-ai/ui/locales";
5
+ export const version = "0.0.75";
6
6
  interface PLPConfig<T extends Display> {
7
7
  /**
8
8
  * The product card to use for rendering products.
@@ -245,7 +245,7 @@ interface CategoryPageConfig<T extends Display> extends PLPConfig<T> {
245
245
  * <DepictCategoryPage categoryId="jeans" productCard={MyCustomCategoryProductCard} categoryTitlePlugin={CategoryTitle} />
246
246
  * ```
247
247
  */
248
- categoryTitlePlugin?: typeof CategoryTitle | typeof EmbeddedNumProducts;
248
+ categoryTitlePlugin?: typeof CategoryTitle | typeof embedded_num_products;
249
249
  }
250
250
  /**
251
251
  * DepictCategoryPage is a component that renders a category page.
@@ -459,5 +459,5 @@ export const useDepictSearchField: (props?: SearchFieldProps) => UseDepictSearch
459
459
  export const Navigation: {
460
460
  nextRouterNavigation: (router: import("next/router").NextRouter) => (relativeUrl: string) => void;
461
461
  };
462
- export { CategoryTitle, EmbeddedNumProducts } from "@depict-ai/js-ui";
463
- export type { Locale } from "@depict-ai/js-ui/locales";
462
+ export { CategoryTitle, embedded_num_products as EmbeddedNumProducts } from "@depict-ai/ui";
463
+ export type { Locale } from "@depict-ai/ui/locales";
package/dist/main.js CHANGED
@@ -1,12 +1,11 @@
1
1
  var $4GYXz$depictaiutilishared = require("@depict-ai/utilishared");
2
- var $4GYXz$depictaijsui = require("@depict-ai/js-ui");
2
+ var $4GYXz$depictaiui = require("@depict-ai/ui");
3
3
  var $4GYXz$solidjs = require("solid-js");
4
4
  var $4GYXz$react = require("react");
5
- var $4GYXz$depictaijsuilocales = require("@depict-ai/js-ui/locales");
5
+ var $4GYXz$depictaiuilocales = require("@depict-ai/ui/locales");
6
6
  var $4GYXz$solidjsweb = require("solid-js/web");
7
7
  var $4GYXz$reactjsxruntime = require("react/jsx-runtime");
8
8
  var $4GYXz$reactdom = require("react-dom");
9
- var $4GYXz$depictaiui = require("@depict-ai/ui");
10
9
 
11
10
  function $parcel$export(e, n, v, s) {
12
11
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
@@ -28,7 +27,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
28
27
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
29
28
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
30
29
  // Note, if you add an export here, also add one in src-server/main.ts
31
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.74";
30
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.75";
32
31
 
33
32
 
34
33
 
@@ -186,7 +185,7 @@ const $bc389476eeb2b615$export$599d4515591ef232 = (relativeUrl)=>{
186
185
 
187
186
  function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
188
187
  const { children: children , navigateFunction: navigateFunction , market: market , merchant: merchant , locale: locale } = props;
189
- const usedLocale = locale ?? (0, $4GYXz$depictaijsuilocales.en);
188
+ const usedLocale = locale ?? (0, $4GYXz$depictaiuilocales.en);
190
189
  const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
191
190
  if (!market || !merchant) {
192
191
  (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](false);
@@ -196,11 +195,12 @@ function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
196
195
  const { search: search , category: category } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
197
196
  const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
198
197
  set_search_page_path($24b00503eef73528$var$ensure_correct_formatting(searchPagePath));
199
- 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)=>{
200
200
  if (navigateFunction) navigateFunction(new_relative_url);
201
201
  else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_relative_url);
202
- } : undefined;
203
- if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaijsui.DepictSearch)({
202
+ };
203
+ if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
204
204
  search_query_url_param_name: urlParamName,
205
205
  market: market,
206
206
  merchant: merchant,
@@ -215,7 +215,7 @@ function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
215
215
  search.merchant = merchant;
216
216
  search.localization = usedLocale;
217
217
  }
218
- if (!category) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaijsui.DepictCategory)({
218
+ if (!category) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaiui.DepictCategory)({
219
219
  market: market,
220
220
  merchant: merchant,
221
221
  localization: usedLocale,
@@ -279,7 +279,7 @@ function $7ad7a3d0011b7b1b$var$SolidSearchPage(props, set_portals) {
279
279
  update_updating_blocked_signal();
280
280
  });
281
281
  const component_portals = new Set();
282
- return (0, $4GYXz$depictaijsui.DepictSearchPage)({
282
+ return (0, $4GYXz$depictaiui.SearchPage)({
283
283
  // Default config goes here
284
284
  include_input_field: props.includeInputField ?? true,
285
285
  cols_at_size: props.columnsAtSize ?? [
@@ -328,7 +328,7 @@ function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
328
328
  };
329
329
  $5aa5fcb9f8a2bebc$var$render_cb(props);
330
330
  const component_portals = new Set();
331
- const category = ()=>(0, $4GYXz$depictaijsui.DepictCategoryPage)({
331
+ const category = ()=>(0, $4GYXz$depictaiui.CategoryPage)({
332
332
  depict_category: depict_category,
333
333
  cols_at_size: props.columnsAtSize ?? [
334
334
  [
@@ -345,7 +345,7 @@ function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
345
345
  ],
346
346
  grid_spacing: props.gridSpacing ?? "2%",
347
347
  get_product_id: ()=>"",
348
- category_title: props.categoryTitlePlugin || (0, $4GYXz$depictaijsui.CategoryTitle),
348
+ category_title: props.categoryTitlePlugin || (0, $4GYXz$depictaiui.CategoryTitle),
349
349
  show_breadcrumbs: props.showBreadcrumbs === undefined ? true : props.showBreadcrumbs,
350
350
  show_quicklinks: props.showQuicklinks === undefined ? true : props.showQuicklinks,
351
351
  product_card_template: (display)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
@@ -368,7 +368,7 @@ function $d88e98b11c182b8e$export$5646050d516e06bc() {
368
368
  function $d88e98b11c182b8e$var$vanilla_breadcrumbs() {
369
369
  const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
370
370
  if (!depict_category) throw Error("No depict_category instance when rendering BreadCrumbs. Did you forget to wrap your app in DepictProvider?");
371
- return (0, $4GYXz$depictaijsui.BreadCrumbs)({
371
+ return (0, $4GYXz$depictaiui.BreadCrumbs)({
372
372
  depict_category: depict_category
373
373
  });
374
374
  }
@@ -383,7 +383,7 @@ function $f16af0e861aff3d0$export$466cdc317043f6cb() {
383
383
  function $f16af0e861aff3d0$var$vanilla_quick_links() {
384
384
  const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
385
385
  if (!depict_category) throw Error("No depict_category instance when rendering QuickLinks. Did you forget to wrap your app in DepictProvider?");
386
- return (0, $4GYXz$depictaijsui.QuickLinks)({
386
+ return (0, $4GYXz$depictaiui.QuickLinks)({
387
387
  depict_category: depict_category
388
388
  });
389
389
  }
@@ -420,12 +420,12 @@ const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
420
420
  const { globalState: globalState , location: location = "centered" , alignerRef: alignerRef } = createOpenModalParams;
421
421
  const openModal = ()=>{
422
422
  if (globalState.search) {
423
- if (location === "aligned" && alignerRef?.current) (0, $4GYXz$depictaijsui.OpenModalWithAlignment)({
423
+ if (location === "aligned" && alignerRef?.current) (0, $4GYXz$depictaiui.open_modal_with_alignment)({
424
424
  "element": alignerRef.current,
425
425
  "location": location,
426
426
  "search": globalState.search
427
427
  });
428
- else (0, $4GYXz$depictaijsui.OpenModalWithAlignment)({
428
+ else (0, $4GYXz$depictaiui.open_modal_with_alignment)({
429
429
  "location": "centered",
430
430
  "search": globalState.search
431
431
  });
@@ -451,7 +451,7 @@ function $3647cad61d03b89c$export$cc1e9aaf280afdcb(params = {}) {
451
451
 
452
452
  const $5e06ce09dcfaf030$export$bde46b5bb6287cea = (props)=>{
453
453
  const ReactSearchField = ()=>{
454
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaijsui.SearchField)({
454
+ return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
455
455
  depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search,
456
456
  aligner_ref: props?.alignerRef?.current
457
457
  })), {});
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.75";
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,
@@ -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 ?? [
@@ -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
  [
@@ -402,12 +402,12 @@ const $5e26376d86621891$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
  });
@@ -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;