@depict-ai/react-ui 0.0.56 → 0.0.59

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 (29) hide show
  1. package/dist/index.d.ts +130 -21
  2. package/dist/main.js +187 -86
  3. package/dist/module.js +179 -82
  4. package/dist/styles/components/PLP/Buttons.scss +3 -3
  5. package/dist/styles/components/PLP/MorphingSign.scss +2 -3
  6. package/dist/styles/components/PLP/ScrollStatus.scss +1 -1
  7. package/dist/styles/components/PLP/SlidableItems.scss +1 -1
  8. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +35 -21
  9. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +2 -4
  10. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +2 -2
  11. package/dist/styles/components/PLP/index.scss +0 -2
  12. package/dist/styles/components/category/index.scss +3 -3
  13. package/dist/styles/components/search/Autocomplete.scss +97 -18
  14. package/dist/styles/components/search/CategorySuggestions.scss +8 -0
  15. package/dist/styles/components/search/InstantCard.scss +5 -0
  16. package/dist/styles/components/search/InstantResults.scss +2 -0
  17. package/dist/styles/components/search/PreviousSearches.scss +15 -3
  18. package/dist/styles/components/search/QueryInput.scss +19 -7
  19. package/dist/styles/components/search/SearchModal.scss +0 -1
  20. package/dist/styles/components/search/index.scss +3 -3
  21. package/dist/styles/default.css +1 -1
  22. package/dist/styles/helpers/custom_input.scss +38 -6
  23. package/dist/styles/helpers/supports-hover.scss +2 -0
  24. package/dist/styles/helpers/utils.scss +9 -1
  25. package/dist/styles/variables.scss +4 -2
  26. package/dist-server/index.d.ts +12 -2
  27. package/dist-server/main.js +25 -4
  28. package/dist-server/module.js +22 -4
  29. package/package.json +8 -5
package/dist/module.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {dlog as $TZSbU$dlog, href_change_ipns as $TZSbU$href_change_ipns, catchify as $TZSbU$catchify, observer as $TZSbU$observer, history_replacer as $TZSbU$history_replacer, queueMacroTask as $TZSbU$queueMacroTask, ContainedPlaceholderImage as $TZSbU$ContainedPlaceholderImage, Placeholder as $TZSbU$Placeholder} from "@depict-ai/utilishared";
2
- import {add_to_version_info as $TZSbU$add_to_version_info, SearchField as $TZSbU$SearchField, 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, embedded_num_products as $TZSbU$embedded_num_products} from "@depict-ai/ui";
3
- import {untrack as $TZSbU$untrack, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, onCleanup as $TZSbU$onCleanup, createSignal as $TZSbU$createSignal, createComputed as $TZSbU$createComputed} from "solid-js";
2
+ import {add_to_version_info as $TZSbU$add_to_version_info, CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, SearchField as $TZSbU$SearchField, 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, styles_to_valid_css_string as $TZSbU$styles_to_valid_css_string, align_field as $TZSbU$align_field} from "@depict-ai/ui";
3
+ import {untrack as $TZSbU$untrack, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, onCleanup as $TZSbU$onCleanup, createSignal as $TZSbU$createSignal, createRoot as $TZSbU$createRoot, createComputed as $TZSbU$createComputed} from "solid-js";
4
4
  import {render as $TZSbU$render} from "solid-js/web";
5
- import {useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment} from "react";
5
+ import {useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, forwardRef as $TZSbU$forwardRef} from "react";
6
6
  import {jsx as $TZSbU$jsx} from "react/jsx-runtime";
7
7
  import {createPortal as $TZSbU$createPortal} from "react-dom";
8
8
  import {en as $TZSbU$en} from "@depict-ai/ui/locales";
@@ -15,7 +15,7 @@ import {en as $TZSbU$en} from "@depict-ai/ui/locales";
15
15
  const $42858f023ef23dab$export$8e769ad4338a911e = {
16
16
  search: null,
17
17
  category: null,
18
- header_alignment: null,
18
+ category_path: null,
19
19
  search_page_path_: (0, $TZSbU$createSignal)(),
20
20
  required_state_set_: (0, $TZSbU$createSignal)(false)
21
21
  };
@@ -33,8 +33,11 @@ function $c83ba9ab79386687$export$74f3924c5027fe1d(cb) {
33
33
  (async ()=>{
34
34
  for await (const href of (0, $TZSbU$href_change_ipns))$c83ba9ab79386687$var$run_on_href_change?.(href);
35
35
  })();
36
- const $c83ba9ab79386687$export$6cb4d3a5c1ac9b43 = (url)=>url.pathname == (0, $TZSbU$untrack)((0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
37
- function $c83ba9ab79386687$export$f6e64e17bd69eeef(solid_component, props, wrapper_type = "div", wrapper_style = {}, render_cb) {
36
+ const $c83ba9ab79386687$export$775e6b3892b5ad52 = (url)=>url.pathname == (0, $TZSbU$untrack)((0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
37
+ const $c83ba9ab79386687$export$92a8f8b3c630fa0d = (url)=>{
38
+ return $c83ba9ab79386687$export$775e6b3892b5ad52(url) || url.pathname === (0, $42858f023ef23dab$export$8e769ad4338a911e).category_path;
39
+ };
40
+ function $c83ba9ab79386687$export$f6e64e17bd69eeef(solid_component, props, wrapper_type = "div", wrapper_style = {}, react_render_handler) {
38
41
  const [portals, set_portals] = (0, $TZSbU$useState)([]);
39
42
  const wrapper_element_ref = (0, $TZSbU$useRef)();
40
43
  (0, $TZSbU$useEffect)(()=>{
@@ -42,17 +45,17 @@ function $c83ba9ab79386687$export$f6e64e17bd69eeef(solid_component, props, wrapp
42
45
  const dispose = (0, $TZSbU$render)(()=>solid_component(props, set_portals), wrapper_element);
43
46
  return dispose;
44
47
  }, []);
45
- render_cb?.(props);
48
+ react_render_handler?.(props);
46
49
  return (0, $TZSbU$createElement)(wrapper_type, {
47
50
  ref: wrapper_element_ref,
48
51
  style: wrapper_style
49
52
  }, portals);
50
53
  }
51
- function $c83ba9ab79386687$export$e5139bbbb9a05035(component) {
54
+ function $c83ba9ab79386687$export$e5139bbbb9a05035(component, is_set = (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[0]) {
52
55
  return (...args)=>{
53
56
  return (0, $TZSbU$createComponent)((0, $TZSbU$Show), {
54
57
  get when () {
55
- return (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[0]();
58
+ return is_set();
56
59
  },
57
60
  get children () {
58
61
  return component(...args);
@@ -96,7 +99,7 @@ async function $c83ba9ab79386687$export$79c79419c1ef0081({ display: display , in
96
99
 
97
100
 
98
101
 
99
- function $54b0d21b77e719c4$export$d2c02478244f91f7() {
102
+ function $02e2452814b6e7d6$export$4c0fa313cf50c4ad() {
100
103
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
101
104
  depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search
102
105
  })), {});
@@ -160,9 +163,8 @@ function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
160
163
 
161
164
 
162
165
 
163
-
164
166
  const $7216ca4c8308a0f9$export$599d4515591ef232 = (href)=>{
165
- const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
167
+ const shallow = (0, $c83ba9ab79386687$export$92a8f8b3c630fa0d)(location);
166
168
  window.next.router.push(href, undefined, {
167
169
  shallow: shallow,
168
170
  scroll: true
@@ -170,7 +172,8 @@ const $7216ca4c8308a0f9$export$599d4515591ef232 = (href)=>{
170
172
  };
171
173
 
172
174
 
173
- function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
175
+
176
+ function $5376eb2a386cd90d$export$9fac37a9c21c2f3b(props) {
174
177
  const { children: children , navigateFunction: navigateFunction , market: market , merchant: merchant , locale: locale } = props;
175
178
  const usedLocale = locale ?? (0, $TZSbU$en);
176
179
  const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
@@ -186,8 +189,7 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
186
189
  if (navigateFunction) navigateFunction(new_href);
187
190
  else (0, $7216ca4c8308a0f9$export$599d4515591ef232)(new_href);
188
191
  } : undefined;
189
- if (!search) {
190
- (0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
192
+ if (!search) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
191
193
  search_query_url_param_name: urlParamName,
192
194
  market: market,
193
195
  merchant: merchant,
@@ -196,24 +198,24 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
196
198
  localization: usedLocale,
197
199
  url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path),
198
200
  on_navigation: on_navigation
199
- });
200
- (0, $8071251ee4e9ffa1$export$6453cbc34515a94d)((0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43));
201
- } else {
201
+ }));
202
+ else {
202
203
  search.market = market;
203
204
  search.merchant = merchant;
204
205
  search.localization = usedLocale;
205
206
  }
206
- if (!category) (0, $42858f023ef23dab$export$8e769ad4338a911e).category = new (0, $TZSbU$DepictCategory)({
207
- market: market,
208
- merchant: merchant,
209
- localization: usedLocale,
210
- on_navigation: on_navigation
211
- });
207
+ if (!category) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).category = new (0, $TZSbU$DepictCategory)({
208
+ market: market,
209
+ merchant: merchant,
210
+ localization: usedLocale,
211
+ on_navigation: on_navigation
212
+ }));
212
213
  else {
213
214
  category.market = market;
214
215
  category.merchant = merchant;
215
216
  category.localization = usedLocale;
216
217
  }
218
+ (0, $8071251ee4e9ffa1$export$6453cbc34515a94d)((0, $c83ba9ab79386687$export$92a8f8b3c630fa0d));
217
219
  (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[1](true);
218
220
  } catch (e) {
219
221
  // Make sure to not break the users app if we throw
@@ -225,42 +227,33 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
225
227
  }
226
228
 
227
229
 
228
- // PoC maybe-component
229
- // Idea is to always give a nice "modal input in header" look with no more config than adding this component to the page header to where it can absolute-size
230
- // and cover the entire height of the header. Then we know where to put the modal input top and bottom, and the left and right we just center.
231
-
232
230
 
233
- function $f41a371216eff80b$export$cbcd1ecdb41b1d0a() {
234
- return (0, $TZSbU$createElement)("div", {
231
+ const $4db0e2f013fc5124$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $TZSbU$forwardRef)((_, ref)=>{
232
+ return /*#__PURE__*/ (0, $TZSbU$createElement)("div", {
235
233
  className: "depict aligner",
236
- ref: (e)=>(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment = e
234
+ style: {
235
+ height: "100%"
236
+ },
237
+ ref: ref
237
238
  });
238
- }
239
- let $f41a371216eff80b$var$sheet;
240
- function $f41a371216eff80b$export$a7f6cffb6b8ba11c() {
241
- if (!(0, $42858f023ef23dab$export$8e769ad4338a911e).search) {
242
- console.error("No active search in the app!");
243
- return;
244
- }
245
- (0, $42858f023ef23dab$export$8e769ad4338a911e).search.modal_open = true;
246
- }
239
+ });
247
240
 
248
241
 
249
242
 
250
243
 
251
244
 
252
245
 
253
- function $9f8d5ef3c016c493$export$210723f5a54a7028(props) {
254
- return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($9f8d5ef3c016c493$var$SolidSearchPage), props);
246
+ function $4a678f0c87b12e78$export$210723f5a54a7028(props) {
247
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($4a678f0c87b12e78$var$SolidSearchPage), props);
255
248
  }
256
- function $9f8d5ef3c016c493$var$SolidSearchPage(props, set_portals) {
249
+ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
257
250
  const depict_search = (0, $42858f023ef23dab$export$8e769ad4338a911e).search;
258
251
  if (!depict_search) throw Error("No depict_search instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
259
252
  const search_query_updating_blocked_signal = (0, $TZSbU$get_search_query_updating_blocked_signal)(depict_search);
260
253
  if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
261
254
  const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
262
255
  const update_updating_blocked_signal = ()=>{
263
- set_search_query_updating_blocked_signal(!(0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location));
256
+ set_search_query_updating_blocked_signal(!(0, $c83ba9ab79386687$export$775e6b3892b5ad52)(location));
264
257
  };
265
258
  // react is really slow with disposing components, we want to avoid a flash of another search query when you click on a product and navigate away
266
259
  (0, $c83ba9ab79386687$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
@@ -303,51 +296,87 @@ function $9f8d5ef3c016c493$var$SolidSearchPage(props, set_portals) {
303
296
 
304
297
 
305
298
 
306
- let $f2cd62bf5f14ad67$var$render_cb;
307
- function $f2cd62bf5f14ad67$export$d87c61cecb2edf0d(props) {
308
- return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($f2cd62bf5f14ad67$var$SolidCategoryPage), props, "div", {}, (props)=>$f2cd62bf5f14ad67$var$render_cb?.(props));
299
+
300
+ let $48d7f568740a317d$var$render_cb;
301
+ function $48d7f568740a317d$export$d87c61cecb2edf0d(props) {
302
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($48d7f568740a317d$var$SolidCategoryPage), props, "div", {}, (props)=>$48d7f568740a317d$var$render_cb?.(props));
309
303
  }
310
- function $f2cd62bf5f14ad67$var$SolidCategoryPage(props, set_portals) {
304
+ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
311
305
  const depict_category = (0, $42858f023ef23dab$export$8e769ad4338a911e).category;
312
306
  if (!depict_category) throw Error("No depict_category instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
313
- $f2cd62bf5f14ad67$var$render_cb = (props)=>depict_category.category_id = props.categoryId;
314
- $f2cd62bf5f14ad67$var$render_cb(props);
307
+ const [category_state_set, set_category_state_set] = (0, $TZSbU$createSignal)(false);
308
+ $48d7f568740a317d$var$render_cb = (props)=>{
309
+ depict_category.category_id = props.categoryId;
310
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).category_path = location.pathname;
311
+ if (props.categoryId) set_category_state_set(true);
312
+ };
313
+ $48d7f568740a317d$var$render_cb(props);
315
314
  const component_portals = new Set();
316
- return (0, $TZSbU$CategoryPage)({
317
- depict_category: depict_category,
318
- cols_at_size: props.columnsAtSize ?? [
319
- [
320
- 4
315
+ const category = ()=>(0, $TZSbU$CategoryPage)({
316
+ depict_category: depict_category,
317
+ cols_at_size: props.columnsAtSize ?? [
318
+ [
319
+ 4
320
+ ],
321
+ [
322
+ 3,
323
+ 1024
324
+ ],
325
+ [
326
+ 2,
327
+ 901
328
+ ]
321
329
  ],
322
- [
323
- 3,
324
- 1024
325
- ],
326
- [
327
- 2,
328
- 901
329
- ]
330
- ],
331
- grid_spacing: props.gridSpacing ?? "2%",
332
- // Todo: Do we need this?
333
- get_product_id: ()=>"",
334
- category_title: (0, $TZSbU$embedded_num_products),
335
- show_breadcrumbs: props.showBreadcrumbs || false,
336
- show_quicklinks: props.showQuicklinks || false,
337
- product_card_template: (display, info)=>(0, $c83ba9ab79386687$export$79c79419c1ef0081)({
338
- display: display,
339
- info: info,
340
- react_template: props.productCard,
341
- component_portals: component_portals,
342
- set_portals: set_portals
343
- })
330
+ grid_spacing: props.gridSpacing ?? "2%",
331
+ get_product_id: ()=>"",
332
+ category_title: props.categoryTitlePlugin || (0, $43099132aad1ceb6$re_export$CategoryTitle),
333
+ show_breadcrumbs: props.showBreadcrumbs === undefined ? true : props.showBreadcrumbs,
334
+ show_quicklinks: props.showQuicklinks === undefined ? true : props.showQuicklinks,
335
+ product_card_template: (display, info)=>(0, $c83ba9ab79386687$export$79c79419c1ef0081)({
336
+ display: display,
337
+ info: info,
338
+ react_template: props.productCard,
339
+ component_portals: component_portals,
340
+ set_portals: set_portals
341
+ })
342
+ });
343
+ return (0, $c83ba9ab79386687$export$e5139bbbb9a05035)(category, category_state_set);
344
+ }
345
+
346
+
347
+
348
+
349
+
350
+ function $f866f7ed9f751af4$export$5646050d516e06bc() {
351
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($f866f7ed9f751af4$var$vanilla_breadcrumbs), {});
352
+ }
353
+ function $f866f7ed9f751af4$var$vanilla_breadcrumbs() {
354
+ const depict_category = (0, $42858f023ef23dab$export$8e769ad4338a911e).category;
355
+ if (!depict_category) throw Error("No depict_category instance when rendering BreadCrumbs. Did you forget to wrap your app in DepictProvider?");
356
+ return (0, $TZSbU$BreadCrumbs)({
357
+ depict_category: depict_category
358
+ });
359
+ }
360
+
361
+
362
+
363
+
364
+
365
+ function $b68a14248b7ef667$export$466cdc317043f6cb() {
366
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($b68a14248b7ef667$var$vanilla_quick_links), {});
367
+ }
368
+ function $b68a14248b7ef667$var$vanilla_quick_links() {
369
+ const depict_category = (0, $42858f023ef23dab$export$8e769ad4338a911e).category;
370
+ if (!depict_category) throw Error("No depict_category instance when rendering QuickLinks. Did you forget to wrap your app in DepictProvider?");
371
+ return (0, $TZSbU$QuickLinks)({
372
+ depict_category: depict_category
344
373
  });
345
374
  }
346
375
 
347
376
 
348
377
 
349
378
 
350
- const $c95f83f01e99fc18$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio })=>{
379
+ const $f446a84f85ba06f6$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio })=>{
351
380
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)(()=>(0, $TZSbU$ContainedPlaceholderImage)({
352
381
  aspect_ratio: aspectRatio
353
382
  }), {}, "div", {
@@ -358,7 +387,7 @@ const $c95f83f01e99fc18$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio }
358
387
 
359
388
 
360
389
 
361
- const $8aa3ab31237c8dc9$export$89c6019e4baa40b1 = ({ width: width , height: height })=>{
390
+ const $cbd250061abf11cb$export$89c6019e4baa40b1 = ({ width: width , height: height })=>{
362
391
  return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)(()=>(0, $TZSbU$Placeholder)({
363
392
  width: width,
364
393
  height: height
@@ -368,13 +397,81 @@ const $8aa3ab31237c8dc9$export$89c6019e4baa40b1 = ({ width: width , height: heig
368
397
  };
369
398
 
370
399
 
371
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.56";
400
+
401
+
402
+
403
+
404
+
405
+
406
+ const $5e26376d86621891$export$d69d8daa20eae175 = (createOpenModalParams)=>{
407
+ const { globalState: globalState , location: location , alignerRef: alignerRef } = createOpenModalParams;
408
+ const openModal = ()=>{
409
+ const headerAligner = alignerRef?.current;
410
+ if (!globalState.search) throw new Error("No active search in the app!");
411
+ if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
412
+ const alignment_height = headerAligner?.clientHeight;
413
+ if (location !== "aligned" || isNaN(alignment_height)) {
414
+ // Open centered modal
415
+ globalState.search.modal_open = true;
416
+ return;
417
+ }
418
+ const style_element = document.createElement("style");
419
+ document.head.append(style_element);
420
+ const resize_observer = new ResizeObserver((0, $TZSbU$catchify)(()=>{
421
+ const styles = (0, $TZSbU$styles_to_valid_css_string)({
422
+ ".depict.plp .depict-search-modal .query-input": {
423
+ "height": `${headerAligner?.clientHeight}px`
424
+ }
425
+ });
426
+ style_element.replaceChildren(styles);
427
+ }));
428
+ resize_observer.observe(headerAligner);
429
+ let dispose_aligner;
430
+ /**
431
+ * Setting position to fixed is important to make the modal work with align_field.
432
+ */ const style_props_ = (0, $TZSbU$createSignal)({
433
+ position: "fixed"
434
+ });
435
+ (0, $TZSbU$createRoot)((dispose)=>{
436
+ dispose_aligner = ()=>{
437
+ resize_observer.disconnect();
438
+ style_element.remove();
439
+ dispose();
440
+ };
441
+ (0, $TZSbU$align_field)(style_props_, headerAligner, undefined, false, "top");
442
+ });
443
+ globalState.search.modal_open = [
444
+ {
445
+ style_props_: style_props_
446
+ },
447
+ dispose_aligner
448
+ ];
449
+ };
450
+ return openModal;
451
+ };
452
+
453
+
454
+ function $cfa72c75e6cf6901$export$cc1e9aaf280afdcb(params) {
455
+ const open = (0, $5e26376d86621891$export$d69d8daa20eae175)({
456
+ globalState: $42858f023ef23dab$export$8e769ad4338a911e,
457
+ ...params
458
+ });
459
+ return {
460
+ open: open
461
+ };
462
+ }
463
+
464
+
465
+
466
+
467
+
468
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.59";
372
469
 
373
470
 
374
471
 
375
472
 
376
473
  const $a92aa2beb560b8af$export$804fac5697cfbe35 = (router)=>(href)=>{
377
- const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
474
+ const shallow = (0, $c83ba9ab79386687$export$92a8f8b3c630fa0d)(location);
378
475
  router.push(href, undefined, {
379
476
  shallow: shallow,
380
477
  scroll: true
@@ -410,4 +507,4 @@ const $43099132aad1ceb6$var$package_name = "@depict-ai/react-ui";
410
507
  });
411
508
 
412
509
 
413
- 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, $f2cd62bf5f14ad67$export$d87c61cecb2edf0d as DepictCategoryPage, $c95f83f01e99fc18$export$3f37af283f8fb843 as ImagePlaceholder, $8aa3ab31237c8dc9$export$89c6019e4baa40b1 as TextPlaceholder, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
510
+ 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, $02e2452814b6e7d6$export$4c0fa313cf50c4ad as DepictSearchField, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $cfa72c75e6cf6901$export$cc1e9aaf280afdcb as useDepictSearchModal, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
@@ -25,7 +25,7 @@ $secondary-button-overrides: ();
25
25
  @return map.merge($primary-button-properties, $primary-button-overrides);
26
26
  }
27
27
 
28
- /// 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.
28
+ /// 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.
29
29
  /// @example
30
30
  /// filter: map.get(Buttons.get-secondary-button-properties(), "focus-visible-filter");
31
31
  @function get-secondary-button-properties() {
@@ -46,7 +46,7 @@ $secondary-button-overrides: ();
46
46
  ///
47
47
  /// *Please only provide options to this mixin if you want to create styling for just a specific button.*
48
48
  ///
49
- /// This mixin and the SecondaryButton mixin are specialties that are trying out a way of styling that we'll probably switch to in the future where you configure the styling of different components using maps instead of calling mixins yourself with different properties, as that will reduce boilerplate. The reason we had to change these already is that the values defined here are also used in other mixins and they can't be accessed if they are only provided as arguments in mixin calls.
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
50
  ////
51
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
52
  /// See the example below.
@@ -91,7 +91,7 @@ $secondary-button-overrides: ();
91
91
  ///
92
92
  /// *Please only provide options to this mixin if you want to create styling for just a specific button.*
93
93
  ///
94
- /// This mixin and the SecondaryButton mixin are specialties that are trying out a way of styling that we'll probably switch to in the future where you configure the styling of different components using maps instead of calling mixins yourself with different properties, as that will reduce boilerplate. The reason we had to change these already is that the values defined here are also used in other mixins and they can't be accessed if they are only provided as arguments in mixin calls.
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
95
  ////
96
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
97
  /// See the example below.
@@ -2,10 +2,9 @@
2
2
  .morphing-sign {
3
3
  /* https://stackoverflow.com/a/38136283 */
4
4
  border: 0;
5
- font-size: 1.5em;
6
5
  position: relative;
7
- width: 1em;
8
- height: 1em;
6
+ width: 1.5em;
7
+ height: 1.5em;
9
8
 
10
9
  span {
11
10
  position: absolute;
@@ -2,7 +2,7 @@
2
2
 
3
3
  /// ScrollStatus shows the user how many items are left to scroll through, if they scroll at a speed that indicates that they are no longer looking at each product but rather just trying to see how many there are.
4
4
  ///
5
- /// Making the background slightly frosted is something I'd love to do, but there's a bug in chrome that it doesn't work. I'd appreciate if you starred my bug report so it maybe gets fixed one day: https://bugs.chromium.org/p/chromium/issues/detail?id=1382360
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
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
8
  /// @param {Number with size unit} $border-radius [variables.$border-radius * 5] - The border-radius of the scroll status.
@@ -49,7 +49,7 @@
49
49
  }
50
50
 
51
51
  /// Styling for sliders used in the PLP.
52
- /// Most of the times slider is used for items laid out horizontally that do not fit the screen width.
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
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.
@@ -9,8 +9,7 @@
9
9
  @use "sass:map";
10
10
 
11
11
  /// Mixin that styles the sorting and filtering menus.
12
- /// We probably want to refactor this quite soon so sorry for not writing descriptions
13
- /// You'll have to look at the code to see what the params do - I hope the names are somewhat descriptive.
12
+ /// The way this is configured is soon going to be subject to change, therefore the parameters are not argumented.
14
13
  /// @param {Color} $mobile-top-level-collapse-color [variables.$brand-black] -
15
14
  /// @param {Color} $mobile-top-level-collapse-background [#fff] -
16
15
  /// @param {Color} $custom-input-checked-background [#fff] -
@@ -20,10 +19,10 @@
20
19
  /// @param {Color} $checkbox-checked-background-color [variables.$brand-black] -
21
20
  /// @param {Color} $checkbox-checkmark-color [#fff] -
22
21
  /// @param {Number with size unit} $checkbox-border-radius [if(variables.$border-radius == 0, 0, if(variables.$border-radius == 0px, 0, 2px))] -
23
- /// @param {Border} $checkbox-border [1px solid variables.$brand-black] -
22
+ /// @param {Border} $checkbox-border [1px solid variables.$brand-dark-grey] -
24
23
  /// @param {Number with size unit} $checkbox-top-offset [0px] -
25
24
  /// @param {Number with size unit} $checkbox-left-offset [0px] -
26
- /// @param {Border} $radio-border [1px solid variables.$brand-black] -
25
+ /// @param {Border} $radio-border [1px solid variables.$brand-dark-grey] -
27
26
  /// @param {Color} $radio-background-color [#fff] -
28
27
  /// @param {Color} $radio-selected-dot-color [variables.$brand-black] -
29
28
  /// @param {Number with size unit} $radio-selected-dot-size [14px] -
@@ -76,10 +75,10 @@
76
75
  $checkbox-checkmark-color: #fff,
77
76
  $checkbox-border-radius: if(variables.$border-radius == 0, 0, if(variables.$border-radius == 0px, 0, 2px)),
78
77
  // if global border radius is 0 or 0px, don't round input fields in their default value
79
- $checkbox-border: 1px solid variables.$brand-black,
78
+ $checkbox-border: 1px solid variables.$brand-dark-grey,
80
79
  $checkbox-top-offset: 0px,
81
80
  $checkbox-left-offset: 0px,
82
- $radio-border: 1px solid variables.$brand-black,
81
+ $radio-border: 1px solid variables.$brand-dark-grey,
83
82
  $radio-background-color: #fff,
84
83
  $radio-selected-dot-color: variables.$brand-black,
85
84
  $radio-selected-dot-size: 14px,
@@ -121,7 +120,8 @@
121
120
  $sort-and-filter-modal-section-title-font-weight: false,
122
121
  $sort-and-filter-modal-section-expanded-title-font-weight: $sort-and-filter-modal-section-title-font-weight
123
122
  ) {
124
- $input-row-height-goal: 20px;
123
+ $input-row-height-goal: max(21px, 1em); // if text gets bigger we have to get bigger too to not cut off the text
124
+ // it was meant to be 20px but there was a bug so I'm setting it to 21px now so it doesn't change
125
125
  $count-distance-to-right: 30px;
126
126
  $largest-border-on-custom-input: max(
127
127
  custom_input.get_border_width($checkbox-border),
@@ -209,7 +209,7 @@
209
209
  align-items: center;
210
210
  transition: opacity 250ms ease-in-out;
211
211
  font-size: 12px;
212
- z-index: calc(variables.$search-page-base-z-index + 1);
212
+ z-index: calc(#{variables.$search-page-base-z-index} + 1);
213
213
  }
214
214
  .open-filters-button-container {
215
215
  position: relative;
@@ -249,7 +249,8 @@
249
249
  $hovered-checkbox-checked-background-color,
250
250
  $hovered-checkbox-border,
251
251
  $hovered-radio-border,
252
- $width-and-height: calc(#{$input-row-height-goal} - #{$largest-border-on-custom-input})
252
+ $input-row-height-goal,
253
+ $largest-border-on-custom-input
253
254
  );
254
255
  }
255
256
  .filters {
@@ -276,9 +277,7 @@
276
277
  }
277
278
  .text {
278
279
  //line-height: 1.8; /** Fix for ÅÄÖ getting cut-off **/
279
- line-height: calc(
280
- #{$input-row-height-goal} + #{$largest-border-on-custom-input}
281
- ); // Sorry ÅÄÖ, hope you survive this
280
+ line-height: $input-row-height-goal; // Sorry ÅÄÖ, hope you survive this
282
281
  display: -webkit-box;
283
282
  text-overflow: ellipsis;
284
283
  white-space: pre-line;
@@ -581,7 +580,7 @@
581
580
  }
582
581
  & > .summary {
583
582
  justify-content: flex-end;
584
- $morphing-sign-width: calc(#{$input-row-height-goal} + #{$largest-border-on-custom-input});
583
+ $morphing-sign-width: #{$input-row-height-goal};
585
584
  .count {
586
585
  margin-right: calc(#{$count-distance-to-right} - #{$morphing-sign-width});
587
586
  }
@@ -742,6 +741,7 @@
742
741
  }
743
742
  }
744
743
  }
744
+ @include CheckboxColor();
745
745
  }
746
746
  }
747
747
  .sorting {
@@ -770,17 +770,31 @@
770
770
  }
771
771
 
772
772
  @mixin default_morphing_sign_in_expandable {
773
- .morphing-sign span {
774
- background: #333333;
773
+ .morphing-sign {
774
+ span {
775
+ background: #333333;
775
776
 
776
- &:first-child {
777
- width: 5%;
778
- left: 47.5%;
777
+ &:first-child {
778
+ width: 5%;
779
+ left: 47.5%;
780
+ }
781
+
782
+ &:last-child {
783
+ height: 5%;
784
+ top: 47.5%;
785
+ }
779
786
  }
787
+ }
788
+ }
789
+
790
+ @mixin CheckboxColor() {
791
+ .checkbox-color {
792
+ display: flex;
793
+ flex-wrap: wrap;
794
+ justify-content: space-between;
780
795
 
781
- &:last-child {
782
- height: 5%;
783
- top: 47.5%;
796
+ .input-row {
797
+ width: calc(50% - 10px);
784
798
  }
785
799
  }
786
800
  }
@@ -1,9 +1,7 @@
1
1
  @use "../../../variables";
2
2
  @use "../../../helpers/utils";
3
3
 
4
- /*
5
- * Mobile modal - taking arguments from SortAndFilter mixin
6
- */
4
+ /// Mobile modal - taking arguments from SortAndFilter mixin so see SortAndFilter docs for more info
7
5
  @mixin SortAndFilterModal(
8
6
  $mobile-top-level-collapse-color,
9
7
  $mobile-top-level-collapse-background,
@@ -39,7 +37,7 @@
39
37
  }
40
38
 
41
39
  .filter-sort-modal {
42
- z-index: calc(variables.$base-z-index + 2);
40
+ z-index: calc(#{variables.$base-z-index} + 2);
43
41
  position: fixed;
44
42
  top: 0;
45
43
  left: 30px;
@@ -21,10 +21,10 @@
21
21
  $checkbox-checkmark-color: #fff,
22
22
  $checkbox-border-radius: if(variables.$border-radius == 0, 0, if(variables.$border-radius == 0px, 0, 2px)),
23
23
  // if global border radius is 0 or 0px, don't round input fields in their default value
24
- $checkbox-border: 1px solid variables.$brand-black,
24
+ $checkbox-border: 1px solid variables.$brand-dark-grey,
25
25
  $checkbox-top-offset: 0px,
26
26
  $checkbox-left-offset: 0px,
27
- $radio-border: 1px solid variables.$brand-black,
27
+ $radio-border: 1px solid variables.$brand-dark-grey,
28
28
  $radio-background-color: #fff,
29
29
  $radio-selected-dot-color: variables.$brand-black,
30
30
  $radio-selected-dot-size: 14px,
@@ -28,8 +28,6 @@
28
28
  @forward "../../variables";
29
29
 
30
30
  /// Load all PLP mixins with default values. PLP encompasses both Search and Category page, so you will always need to include the mixins that this includes somehow. If only minor theming is needed styles in variables.scss can be
31
- ///
32
- ///
33
31
  /// reassigned: https://sass-lang.com/documentation/at-rules/use#reassigning-variables
34
32
  /// If more control is needed use these mixins separately and pass custom params
35
33