@depict-ai/react-ui 0.0.48 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,21 +1,10 @@
1
1
  import React, { PropsWithChildren, ReactNode } from "react";
2
- // @ts-ignore -- react-router is optional and only used for typing the reactRouterUseNavigate property
3
- import { useNavigate } from "react-router";
4
2
  import { Locale } from "@depict-ai/ui/locales";
5
3
  import { Display } from "@depict-ai/utilishared";
6
4
  import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui";
7
5
  export function DepictSearchField(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
8
- type BaseSearchConfig = {
9
- /**
10
- * The merchant to use for the search.
11
- * @example "YOUR_MERCHANT", "stronger"
12
- */
13
- merchant: string;
14
- /**
15
- * The market to use for the search.
16
- * @example "YOUR_MARKET", "no", "en-de"
17
- */
18
- market: string;
6
+ type NavigateFunction = (href: string) => void;
7
+ type DepictSearchConfig = {
19
8
  /**
20
9
  * The path to the search page.
21
10
  * @example "/search", "/sok"
@@ -32,49 +21,66 @@ type BaseSearchConfig = {
32
21
  * @default false
33
22
  */
34
23
  enableCategorySuggestions?: boolean;
24
+ };
25
+ type DepictBaseConfig = {
26
+ /**
27
+ * The merchant to use for the search.
28
+ * @example "YOUR_MERCHANT", "stronger"
29
+ */
30
+ merchant: string;
31
+ /**
32
+ * The market to use for the search.
33
+ * @example "YOUR_MARKET", "no", "en-de"
34
+ */
35
+ market: string;
36
+ /**
37
+ * The function to use for navigating to a new page.
38
+ * This function will be used internally by our components to navigate.
39
+ *
40
+ * You don't need to provide any in a Next.js context.
41
+ *
42
+ * @example
43
+ * Here is how you would use it with react-router, using our helper function.
44
+ * ```tsx
45
+ * import { DepictProvider, Navigation } from "@depict-ai/react-ui";
46
+ *
47
+ * function Router() {
48
+ * const navigate = useNavigate();
49
+ * return (
50
+ * <DepictProvider
51
+ * merchant="houdini"
52
+ * market="en-de"
53
+ * navigateFunction={Navigation.reactRouterNavigation(navigate)}
54
+ * search={{
55
+ * searchPagePath: "/search",
56
+ * }}
57
+ * >
58
+ * <Routes>[...]</Routes>
59
+ * </DepictProvider>
60
+ * );
61
+ * }
62
+ * ```
63
+ * @example
64
+ * If you're using another library, you can define your own navigate function, that's compatible with the `NavigateFunction` type.
65
+ * ```tsx
66
+ * const navigateFunction = (href: string) => {
67
+ * router.push(href);
68
+ * };
69
+ * ```
70
+ */
71
+ navigateFunction?: NavigateFunction;
72
+ /**
73
+ * The locale to use for the Depict components.
74
+ * @default en
75
+ */
35
76
  locale: Locale;
36
77
  };
37
78
  /**
38
- * You can pass the function you use to navigate to a new page.
39
- *
40
- * Currently only works with react-router's useNavigate hook.
41
- * @example
42
- * ```tsx
43
- * import { useNavigate } from "react-router-dom";
44
- *
45
- * const App = () => {
46
- * return (
47
- * <DepictProvider
48
- * merchant="YOUR_MERCHANT"
49
- * market="YOUR_MARKET"
50
- * searchPagePath="/search"
51
- * reactRouterUseNavigate={useNavigate}
52
- * >
53
- * <App />
54
- * </DepictProvider>
55
- * );
56
- * };
57
- * ```
58
- */
59
- type DepictConfigInReactRouterContext = {
60
- /** Expects useNavigate hook from react-router */
61
- reactRouterUseNavigate: ReactRouterUseNavigate;
62
- /** Not to be used in this context */
63
- onNavigation?: undefined;
64
- } & BaseSearchConfig;
65
- type DepictConfigInOtherContext = {
66
- /** Expects a function that takes a url and navigates to it */
67
- onNavigation: (href: string, shallow?: boolean) => unknown;
68
- /** Not to be used in this context */
69
- reactRouterUseNavigate?: undefined;
70
- } & BaseSearchConfig;
71
- type DepictConfig = BaseSearchConfig | DepictConfigInReactRouterContext | DepictConfigInOtherContext;
72
- /**
73
- *
74
- If react-router does not exist, useNavigate will fall back to "any".
75
- In that case, the ReactRouterUseNavigate type becomes "never" and cannot be used.
79
+ * The config for the DepictProvider.
76
80
  */
77
- type ReactRouterUseNavigate = any extends typeof useNavigate ? never : typeof useNavigate;
81
+ type DepictConfig = DepictBaseConfig & {
82
+ search: DepictSearchConfig;
83
+ };
78
84
  /**
79
85
  * The DepictProvider is a wrapper component that should be used to wrap any component that uses Depict components.
80
86
  *
@@ -89,7 +95,9 @@ type ReactRouterUseNavigate = any extends typeof useNavigate ? never : typeof us
89
95
  * <DepictProvider
90
96
  * merchant="YOUR_MERCHANT"
91
97
  * market="YOUR_MARKET"
92
- * searchPagePath="/search"
98
+ * search={{
99
+ * searchPagePath: "/search",
100
+ * }}
93
101
  * >
94
102
  * <App />
95
103
  * </DepictProvider>
@@ -225,5 +233,12 @@ interface TextPlaceholderProps {
225
233
  }
226
234
  /** A placeholder text that can be used in place of a text that is loading. */
227
235
  export const TextPlaceholder: React.FC<TextPlaceholderProps>;
228
- export const version = "0.0.48";
236
+ export const version = "0.0.52";
237
+ /**
238
+ * Helper function to navigate to a new page depending on the navigation library used.
239
+ */
240
+ export const Navigation: {
241
+ nextRouterNavigation: (router: import("next/router").NextRouter) => (href: string) => void;
242
+ reactRouterNavigation: (navigateFunction: import("react-router").NavigateFunction) => (href: string) => void;
243
+ };
229
244
  export type { Locale } from "@depict-ai/ui";
package/dist/main.js CHANGED
@@ -19,6 +19,7 @@ $parcel$export(module.exports, "DepictSearchPage", () => $a6bedbe4b4d6d027$expor
19
19
  $parcel$export(module.exports, "ImagePlaceholder", () => $308b2c6db21be2eb$export$3f37af283f8fb843);
20
20
  $parcel$export(module.exports, "TextPlaceholder", () => $afce04c26b0c4208$export$89c6019e4baa40b1);
21
21
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
22
+ $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
22
23
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
23
24
  // Note, if you add an export here, also add one in src-server/main.ts
24
25
 
@@ -136,9 +137,20 @@ function $6319748b4f0426f0$var$removeLotsOfPadding() {
136
137
 
137
138
 
138
139
 
140
+
141
+ const $bc389476eeb2b615$export$599d4515591ef232 = (href)=>{
142
+ const shallow = (0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location);
143
+ window.next.router.push(href, undefined, {
144
+ shallow: shallow,
145
+ scroll: true
146
+ });
147
+ };
148
+
149
+
139
150
  function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
140
- const { children: children , searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions , market: market , merchant: merchant , locale: locale } = props;
151
+ const { children: children , market: market , merchant: merchant , navigateFunction: navigateFunction , locale: locale } = props;
141
152
  const usedLocale = locale ?? (0, $4GYXz$depictaiuilocales.en);
153
+ const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
142
154
  if (!market || !merchant) {
143
155
  (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](false);
144
156
  return (0, $4GYXz$react.createElement)((0, $4GYXz$react.Fragment), null, children);
@@ -148,11 +160,6 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
148
160
  const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
149
161
  set_search_page_path(searchPagePath);
150
162
  if (!search) {
151
- let react_router_navigate;
152
- if ("reactRouterUseNavigate" in props) {
153
- const { reactRouterUseNavigate: reactRouterUseNavigate } = props;
154
- if (typeof reactRouterUseNavigate === "function") react_router_navigate = reactRouterUseNavigate();
155
- }
156
163
  (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
157
164
  search_query_url_param_name: urlParamName,
158
165
  market: market,
@@ -160,22 +167,12 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
160
167
  enable_category_suggestions: enableCategorySuggestions ?? false,
161
168
  // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
162
169
  localization: usedLocale,
163
- on_navigation: (new_href)=>{
164
- const shallow = (0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location);
165
- if ("onNavigation" in props) {
166
- const { onNavigation: onNavigation } = props;
167
- if (typeof onNavigation === "function") return onNavigation(new_href, shallow);
168
- }
169
- if (react_router_navigate) {
170
- const url_object = new URL(new_href);
171
- return react_router_navigate(url_object.pathname + url_object.search + url_object.hash);
170
+ ...typeof window?.next?.router !== "undefined" || navigateFunction ? {
171
+ on_navigation: (new_href)=>{
172
+ if (navigateFunction) navigateFunction(new_href);
173
+ else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_href);
172
174
  }
173
- if (window.next) window.next.router.push(new_href, undefined, {
174
- shallow: shallow,
175
- scroll: true
176
- });
177
- else location.href = new_href;
178
- },
175
+ } : {},
179
176
  url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path)
180
177
  });
181
178
  (0, $6319748b4f0426f0$export$6453cbc34515a94d)((0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43));
@@ -346,9 +343,40 @@ const $afce04c26b0c4208$export$89c6019e4baa40b1 = ({ width: width , height: heig
346
343
  };
347
344
 
348
345
 
349
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.48";
346
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.52";
347
+
348
+
350
349
 
351
350
 
351
+ const $e387bd534de10acd$export$804fac5697cfbe35 = (router)=>(href)=>{
352
+ const shallow = (0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location);
353
+ router.push(href, undefined, {
354
+ shallow: shallow,
355
+ scroll: true
356
+ });
357
+ };
358
+
359
+
360
+ /**
361
+ * Helper function that creates a function that can be used as the
362
+ * navigateFunction callback for DepictProvider when using react-router.
363
+ *
364
+ * React-router expect relative URLs, so this function will strip the
365
+ * protocol, hostname and port from the URL.
366
+ *
367
+ * @param navigateFunction what useNavigate() returns
368
+ * @returns a function that can be used as the navigateFunction callback for DepictProvider
369
+ */ const $201a023b63de7d2f$export$d53481656a62aebe = (navigateFunction)=>(href)=>{
370
+ const url_object = new URL(href);
371
+ return navigateFunction(url_object.pathname + url_object.search + url_object.hash);
372
+ };
373
+
374
+
375
+ const $b742053c966024b4$export$b8a61e5c71402559 = {
376
+ nextRouterNavigation: $e387bd534de10acd$export$804fac5697cfbe35,
377
+ reactRouterNavigation: $201a023b63de7d2f$export$d53481656a62aebe
378
+ };
379
+
352
380
 
353
381
  const $b03e4eee8610ebbe$var$package_name = "@depict-ai/react-ui";
354
382
  (0, $4GYXz$depictaiutilishared.dlog)($b03e4eee8610ebbe$var$package_name + " version", (0, $db7b67857900028b$export$83d89fbfd8236492));
package/dist/module.js CHANGED
@@ -124,9 +124,20 @@ function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
124
124
 
125
125
 
126
126
 
127
+
128
+ const $7216ca4c8308a0f9$export$599d4515591ef232 = (href)=>{
129
+ const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
130
+ window.next.router.push(href, undefined, {
131
+ shallow: shallow,
132
+ scroll: true
133
+ });
134
+ };
135
+
136
+
127
137
  function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
128
- const { children: children , searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions , market: market , merchant: merchant , locale: locale } = props;
138
+ const { children: children , market: market , merchant: merchant , navigateFunction: navigateFunction , locale: locale } = props;
129
139
  const usedLocale = locale ?? (0, $TZSbU$en);
140
+ const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
130
141
  if (!market || !merchant) {
131
142
  (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[1](false);
132
143
  return (0, $TZSbU$createElement)((0, $TZSbU$Fragment), null, children);
@@ -136,11 +147,6 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
136
147
  const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
137
148
  set_search_page_path(searchPagePath);
138
149
  if (!search) {
139
- let react_router_navigate;
140
- if ("reactRouterUseNavigate" in props) {
141
- const { reactRouterUseNavigate: reactRouterUseNavigate } = props;
142
- if (typeof reactRouterUseNavigate === "function") react_router_navigate = reactRouterUseNavigate();
143
- }
144
150
  (0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
145
151
  search_query_url_param_name: urlParamName,
146
152
  market: market,
@@ -148,22 +154,12 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
148
154
  enable_category_suggestions: enableCategorySuggestions ?? false,
149
155
  // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
150
156
  localization: usedLocale,
151
- on_navigation: (new_href)=>{
152
- const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
153
- if ("onNavigation" in props) {
154
- const { onNavigation: onNavigation } = props;
155
- if (typeof onNavigation === "function") return onNavigation(new_href, shallow);
156
- }
157
- if (react_router_navigate) {
158
- const url_object = new URL(new_href);
159
- return react_router_navigate(url_object.pathname + url_object.search + url_object.hash);
157
+ ...typeof window?.next?.router !== "undefined" || navigateFunction ? {
158
+ on_navigation: (new_href)=>{
159
+ if (navigateFunction) navigateFunction(new_href);
160
+ else (0, $7216ca4c8308a0f9$export$599d4515591ef232)(new_href);
160
161
  }
161
- if (window.next) window.next.router.push(new_href, undefined, {
162
- shallow: shallow,
163
- scroll: true
164
- });
165
- else location.href = new_href;
166
- },
162
+ } : {},
167
163
  url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path)
168
164
  });
169
165
  (0, $8071251ee4e9ffa1$export$6453cbc34515a94d)((0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43));
@@ -334,9 +330,40 @@ const $8aa3ab31237c8dc9$export$89c6019e4baa40b1 = ({ width: width , height: heig
334
330
  };
335
331
 
336
332
 
337
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.48";
333
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.52";
334
+
335
+
338
336
 
339
337
 
338
+ const $a92aa2beb560b8af$export$804fac5697cfbe35 = (router)=>(href)=>{
339
+ const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
340
+ router.push(href, undefined, {
341
+ shallow: shallow,
342
+ scroll: true
343
+ });
344
+ };
345
+
346
+
347
+ /**
348
+ * Helper function that creates a function that can be used as the
349
+ * navigateFunction callback for DepictProvider when using react-router.
350
+ *
351
+ * React-router expect relative URLs, so this function will strip the
352
+ * protocol, hostname and port from the URL.
353
+ *
354
+ * @param navigateFunction what useNavigate() returns
355
+ * @returns a function that can be used as the navigateFunction callback for DepictProvider
356
+ */ const $01e1970add53d62a$export$d53481656a62aebe = (navigateFunction)=>(href)=>{
357
+ const url_object = new URL(href);
358
+ return navigateFunction(url_object.pathname + url_object.search + url_object.hash);
359
+ };
360
+
361
+
362
+ const $97603d19204ec48d$export$b8a61e5c71402559 = {
363
+ nextRouterNavigation: $a92aa2beb560b8af$export$804fac5697cfbe35,
364
+ reactRouterNavigation: $01e1970add53d62a$export$d53481656a62aebe
365
+ };
366
+
340
367
 
341
368
  const $43099132aad1ceb6$var$package_name = "@depict-ai/react-ui";
342
369
  (0, $TZSbU$dlog)($43099132aad1ceb6$var$package_name + " version", (0, $c9c4d066f9a5b51b$export$83d89fbfd8236492));
@@ -345,4 +372,4 @@ const $43099132aad1ceb6$var$package_name = "@depict-ai/react-ui";
345
372
  });
346
373
 
347
374
 
348
- export {$54b0d21b77e719c4$export$d2c02478244f91f7 as DepictSearchField, $faf794495ff8b304$export$9fac37a9c21c2f3b as DepictProvider, $f41a371216eff80b$export$a7f6cffb6b8ba11c as openModal, $f41a371216eff80b$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $9f8d5ef3c016c493$export$210723f5a54a7028 as DepictSearchPage, $c95f83f01e99fc18$export$3f37af283f8fb843 as ImagePlaceholder, $8aa3ab31237c8dc9$export$89c6019e4baa40b1 as TextPlaceholder, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
375
+ export {$54b0d21b77e719c4$export$d2c02478244f91f7 as DepictSearchField, $faf794495ff8b304$export$9fac37a9c21c2f3b as DepictProvider, $f41a371216eff80b$export$a7f6cffb6b8ba11c as openModal, $f41a371216eff80b$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $9f8d5ef3c016c493$export$210723f5a54a7028 as DepictSearchPage, $c95f83f01e99fc18$export$3f37af283f8fb843 as ImagePlaceholder, $8aa3ab31237c8dc9$export$89c6019e4baa40b1 as TextPlaceholder, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
@@ -2,39 +2,50 @@
2
2
  @use "../../helpers/supports-hover";
3
3
  @use "../../helpers/utils";
4
4
  @use "sass:color";
5
+ @use "sass:map";
5
6
 
6
- $primary-button-background: variables.$brand-black;
7
- $primary-button-color: #fff;
8
- $primary-button-border: 1px solid transparent; // 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)
9
- $primary-button-border-radius: variables.$border-radius;
10
- $primary-button-hover-filter: drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25))
11
- drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15));
12
- $primary-button-active-filter: drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25))
13
- drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15));
14
- $primary-button-focus-visible-filter: drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))
15
- drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8));
7
+ $primary-button-overrides: ();
8
+ $secondary-button-overrides: ();
16
9
 
17
- $secondary-button-background: variables.$brand-lightest-grey;
18
- $secondary-button-color: variables.$brand-dark-grey;
19
- $secondary-button-border: 1px solid variables.$brand-black;
20
- $secondary-button-border-radius: variables.$border-radius;
21
- $secondary-button-hover-filter: drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25))
22
- drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15));
23
- $secondary-button-active-filter: drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25))
24
- drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15));
25
- $secondary-button-focus-visible-filter: drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))
26
- drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8));
10
+ @function get-primary-button-properties() {
11
+ $primary-button-properties: (
12
+ "background": variables.$brand-black,
13
+ "color": #fff,
14
+ // 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)
15
+ "border": 1px solid transparent,
16
+ "border-radius": variables.$border-radius,
17
+ "hover-filter": drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15)),
18
+ "active-filter": drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15)),
19
+ "focus-visible-filter": drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8))
20
+ drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8)),
21
+ );
22
+ @return map.merge($primary-button-properties, $primary-button-overrides);
23
+ }
24
+
25
+ @function get-secondary-button-properties() {
26
+ $secondary-button-properties: (
27
+ "background": variables.$brand-lightest-grey,
28
+ "color": variables.$brand-dark-grey,
29
+ "border": 1px solid variables.$brand-black,
30
+ "border-radius": variables.$border-radius,
31
+ "hover-filter": drop-shadow(-2px -2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15)),
32
+ "active-filter": drop-shadow(2px 2px 4px rgba(255, 255, 255, 0.25)) drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.15)),
33
+ "focus-visible-filter": drop-shadow(-2px -2px 4px rgba(65, 143, 195, 0.8))
34
+ drop-shadow(2px 2px 4px rgba(65, 143, 195, 0.8)),
35
+ );
36
+ @return map.merge($secondary-button-properties, $secondary-button-overrides);
37
+ }
27
38
 
28
39
  @mixin PrimaryButton(
29
- $background: $primary-button-background,
30
- $color: $primary-button-color,
31
- $border: $primary-button-border,
32
- $border-radius: $primary-button-border-radius,
33
- $hover-filter: $primary-button-hover-filter,
34
- $active-filter: $primary-button-active-filter,
35
- $focus-visible-filter: $primary-button-focus-visible-filter
40
+ $background: map.get(get-primary-button-properties(), "background"),
41
+ $color: map.get(get-primary-button-properties(), "color"),
42
+ $border: map.get(get-primary-button-properties(), "border"),
43
+ $border-radius: map.get(get-primary-button-properties(), "border-radius"),
44
+ $hover-filter: map.get(get-primary-button-properties(), "hover-filter"),
45
+ $active-filter: map.get(get-primary-button-properties(), "active-filter"),
46
+ $focus-visible-filter: map.get(get-primary-button-properties(), "focus-visible-filter")
36
47
  ) {
37
- // not using .primary since that's 100% going to conflict with existing declarations on sites
48
+ // not using button.primary since that's 100% going to conflict with existing declarations on sites
38
49
  button.major {
39
50
  @include Button(
40
51
  $background,
@@ -51,15 +62,15 @@ $secondary-button-focus-visible-filter: drop-shadow(-2px -2px 4px rgba(65, 143,
51
62
  }
52
63
 
53
64
  @mixin SecondaryButton(
54
- $background: $secondary-button-background,
55
- $color: $secondary-button-color,
56
- $border: $secondary-button-border,
57
- $border-radius: $secondary-button-border-radius,
58
- $hover-filter: $secondary-button-hover-filter,
59
- $active-filter: $secondary-button-active-filter,
60
- $focus-visible-filter: $secondary-button-focus-visible-filter
65
+ $background: map.get(get-secondary-button-properties(), "background"),
66
+ $color: map.get(get-secondary-button-properties(), "color"),
67
+ $border: map.get(get-secondary-button-properties(), "border"),
68
+ $border-radius: map.get(get-secondary-button-properties(), "border-radius"),
69
+ $hover-filter: map.get(get-secondary-button-properties(), "hover-filter"),
70
+ $active-filter: map.get(get-secondary-button-properties(), "active-filter"),
71
+ $focus-visible-filter: map.get(get-secondary-button-properties(), "focus-visible-filter")
61
72
  ) {
62
- // not using .secondary since that's 100% going to conflict with existing declarations on sites
73
+ // not using button.secondary since that's 100% going to conflict with existing declarations on sites
63
74
  button.minor {
64
75
  @include Button(
65
76
  $background,
@@ -2,6 +2,7 @@
2
2
  @use "../../helpers/utils";
3
3
  @use "../../helpers/supports-hover";
4
4
  @use "./Buttons";
5
+ @use "sass:map";
5
6
 
6
7
  @mixin SelectedFilters(
7
8
  $border-radius: variables.$border-radius,
@@ -40,7 +41,7 @@
40
41
 
41
42
  .clear-filter {
42
43
  @if $set-border-on-crumbs {
43
- border: 1px solid Buttons.$primary-button-background;
44
+ border: 1px solid map.get(Buttons.get-primary-button-properties(), "background");
44
45
  }
45
46
  svg {
46
47
  width: 12.64px;
@@ -49,7 +50,7 @@
49
50
  }
50
51
  .clear-all-filters {
51
52
  @if $set-border-on-crumbs {
52
- border: Buttons.$secondary-button-border;
53
+ border: map.get(Buttons.get-secondary-button-properties(), "border");
53
54
  }
54
55
  }
55
56
 
@@ -1,7 +1,9 @@
1
1
  // @use "../../../rendering/slider_button_positioning";
2
2
  @use "../../helpers/utils";
3
+ @use "../../components/PLP/Buttons";
3
4
  @use "../../variables";
4
5
  @use "../../helpers/supports-hover";
6
+ @use "sass:map";
5
7
 
6
8
  @mixin button_positioning {
7
9
  .d-navbutton {
@@ -80,6 +82,10 @@
80
82
  justify-content: flex-end;
81
83
  border: none;
82
84
 
85
+ & > div {
86
+ display: flex;
87
+ }
88
+
83
89
  @include supports-hover.supports-hover() {
84
90
  &:hover {
85
91
  svg {
@@ -87,6 +93,14 @@
87
93
  }
88
94
  }
89
95
  }
96
+ &:focus-visible {
97
+ svg {
98
+ transform: scale(1.5);
99
+ path {
100
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
101
+ }
102
+ }
103
+ }
90
104
  svg {
91
105
  transition-duration: 150ms;
92
106
  }
@@ -6,6 +6,7 @@
6
6
  @use "../../../helpers/supports-hover";
7
7
  @use "../Buttons";
8
8
  @use "sass:color";
9
+ @use "sass:map";
9
10
 
10
11
  @mixin SortAndFilter(
11
12
  $mobile-top-level-collapse-color: variables.$brand-black,
@@ -381,7 +382,7 @@
381
382
  }
382
383
  &:focus-visible {
383
384
  outline: none;
384
- filter: Buttons.$secondary-button-focus-visible-filter;
385
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
385
386
  }
386
387
  }
387
388
  }
@@ -16,6 +16,7 @@
16
16
  .title {
17
17
  margin-right: 10px;
18
18
  font-weight: $title-font-weight;
19
+ font-size: inherit;
19
20
  }
20
21
  .explanation {
21
22
  color: $title-color;
@@ -3,11 +3,12 @@
3
3
  @use "../../helpers/supports-hover";
4
4
  @use "../PLP/Buttons";
5
5
  @use "sass:color";
6
+ @use "sass:map";
6
7
 
7
8
  @mixin QuickLinks(
8
9
  $background: white,
9
10
  $border-radius: false,
10
- $selected-background: Buttons.$primary-button-background,
11
+ $selected-background: map.get(Buttons.get-primary-button-properties(), "background"),
11
12
  $hovered-background: false
12
13
  ) {
13
14
  .quicklinks {
@@ -40,7 +41,7 @@
40
41
  } @else {
41
42
  @include utils.highlight-background($normal-background: $background);
42
43
  }
43
- filter: Buttons.$secondary-button-focus-visible-filter;
44
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
44
45
  }
45
46
  &:active {
46
47
  @include utils.highlight-background($normal-background: $background, $darken-factor: 10%, $lighten-factor: 20%);
@@ -56,7 +57,7 @@
56
57
  }
57
58
  &:focus-visible {
58
59
  @include utils.highlight-background($normal-background: $selected-background);
59
- filter: Buttons.$primary-button-focus-visible-filter;
60
+ filter: map.get(Buttons.get-primary-button-properties(), "focus-visible-filter");
60
61
  }
61
62
  &:active {
62
63
  @include utils.highlight-background(
@@ -2,6 +2,7 @@
2
2
  @use "../../helpers/utils";
3
3
  @use "PreviousSearches";
4
4
  @use "../PLP/Buttons";
5
+ @use "sass:map";
5
6
 
6
7
  @mixin Autocomplete(
7
8
  $background: white,
@@ -40,7 +41,7 @@
40
41
 
41
42
  &:focus-visible {
42
43
  outline: none;
43
- filter: Buttons.$secondary-button-focus-visible-filter;
44
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
44
45
  }
45
46
  }
46
47
  }
@@ -1,6 +1,7 @@
1
1
  @use "../../variables";
2
2
  @use "../../helpers/utils";
3
3
  @use "../PLP/Buttons";
4
+ @use "sass:map";
4
5
 
5
6
  @mixin PreviousSearches($icon-color: variables.$brand-black, $item-color: variables.$brand-black) {
6
7
  .previous-searches {
@@ -62,7 +63,7 @@
62
63
  }
63
64
  }
64
65
  &:focus-visible {
65
- filter: Buttons.$secondary-button-focus-visible-filter;
66
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
66
67
  svg {
67
68
  transform: scale(1.2);
68
69
  path {
@@ -1,6 +1,7 @@
1
1
  @use "../../variables";
2
2
  @use "../../helpers/supports-hover";
3
3
  @use "../PLP/Buttons";
4
+ @use "sass:map";
4
5
 
5
6
  @mixin QueryInput(
6
7
  $border-radius: calc(#{variables.$border-radius} * 2.5),
@@ -90,7 +91,7 @@
90
91
  outline: none;
91
92
  }
92
93
  &:focus-visible {
93
- filter: Buttons.$secondary-button-focus-visible-filter;
94
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
94
95
  svg path {
95
96
  fill: $hovered-back-color;
96
97
  }
@@ -125,7 +126,7 @@
125
126
  outline: none;
126
127
  }
127
128
  &:focus-visible {
128
- filter: Buttons.$secondary-button-focus-visible-filter;
129
+ filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
129
130
  svg path {
130
131
  fill: $hovered-clear-color;
131
132
  }