@sonic-equipment/ui 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/algolia/algolia-active-filters.d.ts +1 -0
  2. package/dist/algolia/algolia-filter-panel.d.ts +1 -0
  3. package/dist/algolia/algolia-multi-select.d.ts +5 -0
  4. package/dist/algolia/algolia-pagination.d.ts +1 -0
  5. package/dist/algolia/algolia-product-list.d.ts +1 -0
  6. package/dist/algolia/algolia-results-count.d.ts +1 -0
  7. package/dist/algolia/algolia-searchclient-mock.d.ts +4 -0
  8. package/dist/algolia/algolia-sort-by.d.ts +1 -0
  9. package/dist/algolia/algolia.stories.d.ts +17 -0
  10. package/dist/buttons/button/button.d.ts +5 -4
  11. package/dist/buttons/button/button.stories.d.ts +1 -0
  12. package/dist/buttons/link-button/link-button.d.ts +10 -0
  13. package/dist/buttons/link-button/link-button.stories.d.ts +19 -0
  14. package/dist/collapsables/accordion/accordion.stories.d.ts +0 -1
  15. package/dist/collapsables/show-all/show-all.d.ts +9 -0
  16. package/dist/collapsables/show-all/show-all.stories.d.ts +17 -0
  17. package/dist/filters/active-filters/active-filters.d.ts +13 -0
  18. package/dist/filters/active-filters/active-filters.stories.d.ts +15 -0
  19. package/dist/filters/multi-select/multi-select.d.ts +19 -0
  20. package/dist/filters/multi-select/multi-select.stories.d.ts +20 -0
  21. package/dist/forms/color-checkbox/color-checkbox.stories.d.ts +1 -0
  22. package/dist/forms/select/select.d.ts +5 -5
  23. package/dist/forms/select/select.stories.d.ts +10 -3
  24. package/dist/icons/close/close-filled-icon.d.ts +2 -0
  25. package/dist/icons/filter/filter-outlined-icon.d.ts +2 -0
  26. package/dist/index.d.ts +66 -25
  27. package/dist/index.js +128 -52
  28. package/dist/intl/translation-id.d.ts +1 -5
  29. package/dist/product-listing/product-listing.d.ts +12 -10
  30. package/dist/product-listing/product-listing.stories.d.ts +1 -1
  31. package/dist/shared/hooks/use-device.d.ts +5 -0
  32. package/dist/shared/hooks/use-disclosure.d.ts +9 -0
  33. package/dist/shared/hooks/use-scroll-lock.d.ts +1 -0
  34. package/dist/sidebar/sidebar-context.d.ts +6 -0
  35. package/dist/sidebar/sidebar-provider.d.ts +6 -0
  36. package/dist/sidebar/sidebar.d.ts +5 -0
  37. package/dist/sidebar/sidebar.stories.d.ts +8 -0
  38. package/dist/sidebar/toggle-sidebar-button.d.ts +1 -0
  39. package/dist/sidebar/use-sidebar.d.ts +2 -0
  40. package/dist/styles.css +218 -7
  41. package/package.json +34 -30
package/dist/index.js CHANGED
@@ -1,27 +1,27 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { forwardRef, useState, useEffect, createContext, useContext, Children, cloneElement, useRef, useCallback } from 'react';
3
- import { Button as Button$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1 } from 'react-aria-components';
3
+ import { Button as Button$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Link, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1 } from 'react-aria-components';
4
4
  import clsx from 'clsx';
5
5
 
6
6
  function RightArrowFilledIcon(props) {
7
7
  return (jsx("svg", { height: "11", viewBox: "0 0 6 11", width: "6", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M.267 11a.263.263 0 0 1-.226-.402l3.463-5.467a1.2 1.2 0 0 0-.103-1.43L.602.432A.262.262 0 0 1 .805 0h2.181c.078 0 .153.034.203.093l2.081 2.43a3 3 0 0 1 .259 3.575L2.5 10.877a.267.267 0 0 1-.225.123H.266z", fill: "currentColor", fillRule: "evenodd" }) }));
8
8
  }
9
9
 
10
- var styles$i = {"button":"button-module-V4meK","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
10
+ var styles$n = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
11
11
 
12
- function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, isDisabled, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
12
+ function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
13
13
  if (children && icon)
14
14
  console.warn('Button should not have both children and icon. Icon has precedence.');
15
- return (jsx(Button$1, { className: clsx(className, styles$i.button, styles$i[variant], styles$i[size], styles$i[color], { [styles$i.condensed]: condensed }, { [styles$i.icon]: icon }, styles$i[_pseudo]), isDisabled: isDisabled, onPress: onPress, type: type, children: icon ? (icon) : (jsxs(Fragment, { children: [children, withArrow && (jsx(RightArrowFilledIcon, { className: styles$i['right-arrow-icon'] }))] })) }));
15
+ return (jsxs(Button$1, { className: clsx(className, styles$n.button, styles$n[variant], styles$n[size], styles$n[color], { [styles$n.condensed]: condensed }, { [styles$n.icon]: icon }, styles$n[_pseudo]), isDisabled: isDisabled, onPress: onPress, type: type, children: [icon && iconPosition === 'left' && (jsx("span", { className: styles$n.icon, children: icon })), children, withArrow && (jsx(RightArrowFilledIcon, { className: styles$n['right-arrow-icon'] })), icon && iconPosition === 'right' && (jsx("span", { className: styles$n.icon, children: icon }))] }));
16
16
  }
17
17
 
18
- var styles$h = {"field-error":"field-error-module-FXnIg"};
18
+ var styles$m = {"field-error":"field-error-module-FXnIg"};
19
19
 
20
20
  function FieldError({ children }) {
21
- return (jsx(FieldError$1, { className: styles$h['field-error'], children: children }));
21
+ return (jsx(FieldError$1, { className: styles$m['field-error'], children: children }));
22
22
  }
23
23
 
24
- var styles$g = {"input-container":"input-module-2woJR","shadow-input":"input-module-pNKEt","lg":"input-module-Dx2qC","md":"input-module-sH6e7","focus":"input-module-hEEuy","growing-input":"input-module-6HwY4"};
24
+ var styles$l = {"input-container":"input-module-2woJR","shadow-input":"input-module-pNKEt","lg":"input-module-Dx2qC","md":"input-module-sH6e7","focus":"input-module-hEEuy","growing-input":"input-module-6HwY4"};
25
25
 
26
26
  /**
27
27
  * This component is used to create an input that grows as the user types.
@@ -36,33 +36,33 @@ const Input = forwardRef(({ _pseudo = 'none', autoGrow, size = 'lg', ...inputPro
36
36
  const handleChange = (event) => isControlled
37
37
  ? onChange?.(event)
38
38
  : setUncontrolledValue(event.target.value);
39
- return (jsx("div", { className: clsx(styles$g['input-container'], styles$g[size], styles$g[_pseudo]), children: jsxs("div", { className: clsx({ [styles$g['growing-input']]: autoGrow }), children: [jsx(Input$1, { size: autoGrow ? 1 : undefined, ...props, ref: ref, onChange: handleChange }), autoGrow && jsx("span", { className: styles$g['shadow-input'], children: value })] }) }));
39
+ return (jsx("div", { className: clsx(styles$l['input-container'], styles$l[size], styles$l[_pseudo]), children: jsxs("div", { className: clsx({ [styles$l['growing-input']]: autoGrow }), children: [jsx(Input$1, { size: autoGrow ? 1 : undefined, ...props, ref: ref, onChange: handleChange }), autoGrow && jsx("span", { className: styles$l['shadow-input'], children: value })] }) }));
40
40
  });
41
41
  Input.displayName = 'Input';
42
42
 
43
- var styles$f = {"label":"label-module-LGfJt","required":"label-module-oTWaS"};
43
+ var styles$k = {"label":"label-module-LGfJt","required":"label-module-oTWaS"};
44
44
 
45
45
  function Label({ children, isRequired }) {
46
46
  if (!children)
47
47
  return null;
48
- return (jsxs(Label$1, { className: styles$f.label, children: [children, isRequired && jsx("span", { className: styles$f.required, children: "*" })] }));
48
+ return (jsxs(Label$1, { className: styles$k.label, children: [children, isRequired && jsx("span", { className: styles$k.required, children: "*" })] }));
49
49
  }
50
50
 
51
- var styles$e = {"field":"number-field-module-gmnog","button-input-container":"number-field-module-8Lvgh"};
51
+ var styles$j = {"field":"number-field-module-gmnog","button-input-container":"number-field-module-8Lvgh"};
52
52
 
53
53
  /**
54
54
  * This component is used to create a number field.
55
55
  * This field can also grow when a user types in text.
56
56
  */
57
57
  function NumberField({ autoFocus, autoGrow, defaultValue, formatOptions = { style: 'decimal', useGrouping: false }, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel = true, size = 'lg', value, withButtons, }) {
58
- return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$e.field, styles$e[size]), defaultValue: defaultValue, formatOptions: formatOptions, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxValue: maxValue, minValue: minValue, name: name, onChange: onChange, onInput: onInput, onKeyUp: e => onKeyUp?.(e), value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs("div", { className: styles$e['button-input-container'], children: [withButtons && jsx(Button$1, { slot: "decrement", children: "-" }), jsx(Input, { autoGrow: autoGrow, maxLength: maxLength, placeholder: placeholder, size: size }), withButtons && jsx(Button$1, { slot: "increment", children: "+" })] }), jsx(FieldError, {})] }));
58
+ return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$j.field, styles$j[size]), defaultValue: defaultValue, formatOptions: formatOptions, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxValue: maxValue, minValue: minValue, name: name, onChange: onChange, onInput: onInput, onKeyUp: e => onKeyUp?.(e), value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs("div", { className: styles$j['button-input-container'], children: [withButtons && jsx(Button$1, { slot: "decrement", children: "-" }), jsx(Input, { autoGrow: autoGrow, maxLength: maxLength, placeholder: placeholder, size: size }), withButtons && jsx(Button$1, { slot: "increment", children: "+" })] }), jsx(FieldError, {})] }));
59
59
  }
60
60
 
61
61
  function CartFilledIcon(props) {
62
62
  return (jsx("svg", { height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M7.896 16.666a2.603 2.603 0 1 1 0 5.207 2.603 2.603 0 0 1 0-5.207zm8.925 0a2.603 2.603 0 1 1 0 5.207 2.603 2.603 0 0 1 0-5.207zM7.896 18.1c-.645 0-1.17.524-1.17 1.169s.525 1.17 1.17 1.17a1.171 1.171 0 0 0 0-2.34zm8.925 0c-.645 0-1.17.524-1.17 1.169s.525 1.17 1.17 1.17a1.171 1.171 0 0 0 0-2.34zM4.589 3c.016 0 .032.004.048.005a.714.714 0 0 1 .146.025l.05.016a.7.7 0 0 1 .083.037l.04.021a.712.712 0 0 1 .076.053l.035.03a.699.699 0 0 1 .168.223.703.703 0 0 1 .061.209c.002.014.007.027.008.042l.207 2.646h15.776c.027.001.05.006.073.008.026.003.052.004.077.01.022.004.036.011.05.016.03.008.058.016.085.028.02.009.037.02.056.03.022.012.044.024.065.038.019.013.035.029.053.044.017.015.036.029.052.046.015.016.028.034.042.051.015.019.03.037.044.057.011.018.02.038.03.057.012.021.024.042.033.065.009.022.014.044.021.067.006.022.014.043.018.066.006.027.007.054.009.081.001.018.005.035.005.053-.001.031-.005.054-.008.077-.003.026-.004.052-.01.077l-1.39 6.054-.004.017a.698.698 0 0 1-.033.1l-.008.024a.716.716 0 0 1-.06.11l-.024.03a.707.707 0 0 1-.057.07l-.035.033a.695.695 0 0 1-.175.117l-.048.022a.723.723 0 0 1-.083.026c-.014.003-.027.008-.041.01a.707.707 0 0 1-.134.014H6.096l.112 1.427H19.41a.717.717 0 0 1 0 1.434H5.544a.714.714 0 0 1-.14-.015c-.015-.003-.03-.008-.044-.012-.03-.008-.06-.016-.087-.027-.018-.008-.034-.017-.05-.026-.024-.012-.048-.023-.07-.037-.016-.011-.03-.024-.046-.036-.02-.016-.04-.03-.058-.048-.015-.014-.027-.03-.04-.044-.017-.02-.033-.038-.048-.058-.012-.017-.021-.034-.032-.052a.678.678 0 0 1-.035-.065c-.009-.02-.016-.04-.023-.06a.715.715 0 0 1-.033-.136l-.008-.045-.904-11.571H2.717a.717.717 0 1 1 0-1.434z", fill: "currentColor", fillRule: "evenodd" }) }));
63
63
  }
64
64
 
65
- var styles$d = {"manual-input-container":"add-to-cart-button-module-AWFvQ","left-button-spacer":"add-to-cart-button-module-SS7WM"};
65
+ var styles$i = {"manual-input-container":"add-to-cart-button-module-AWFvQ","left-button-spacer":"add-to-cart-button-module-SS7WM"};
66
66
 
67
67
  function AddToCartButton({ initialState = 'initial', onChange, quantity, }) {
68
68
  const [currentState, setState] = useState(initialState);
@@ -124,17 +124,17 @@ function ManualInputState({ onCancel, onConfirm, quantity, }) {
124
124
  e.key === 'Enter' && onConfirm(updatedQuantity);
125
125
  e.key === 'Escape' && onCancel();
126
126
  };
127
- return (jsxs("div", { className: styles$d['manual-input-container'], children: [jsx("div", { className: styles$d['left-button-spacer'] }), jsx(NumberField, { autoFocus: true, autoGrow: true, defaultValue: quantity, formatOptions: {
127
+ return (jsxs("div", { className: styles$i['manual-input-container'], children: [jsx("div", { className: styles$i['left-button-spacer'] }), jsx(NumberField, { autoFocus: true, autoGrow: true, defaultValue: quantity, formatOptions: {
128
128
  maximumFractionDigits: 0,
129
129
  style: 'decimal',
130
130
  useGrouping: false,
131
131
  }, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, name: "quantity", onChange: setQuantity, onKeyUp: onKeyUp, showLabel: false, size: "md" }), jsx(Button, { condensed: true, onPress: () => onConfirm(updatedQuantity), size: "md", children: "OK" })] }));
132
132
  }
133
133
 
134
- var styles$c = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
134
+ var styles$h = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
135
135
 
136
136
  function IconButton({ children, className, color = 'primary', onPress, size = 'md', }) {
137
- return (jsx(Button$1, { className: clsx(styles$c['icon-button'], styles$c[size], styles$c[color], className), onPress: onPress, children: children }));
137
+ return (jsx(Button$1, { className: clsx(styles$h['icon-button'], styles$h[size], styles$h[color], className), onPress: onPress, children: children }));
138
138
  }
139
139
 
140
140
  function FavoriteFilledIcon(props) {
@@ -145,20 +145,29 @@ function FavoriteOutlinedIcon(props) {
145
145
  return (jsx("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M7.333 3.33c-2.206 0-4 1.793-4 3.997 0 .857.316 1.71.967 2.604L12 20.223l7.705-10.299c.646-.888.962-1.74.962-2.597a4.003 4.003 0 0 0-4-3.996c-1.813 0-3.545 1.232-4.028 2.865a.666.666 0 0 1-1.278 0C10.878 4.563 9.146 3.33 7.333 3.33M12 22c-.21 0-.408-.1-.534-.267L3.227 10.72C2.411 9.599 2 8.46 2 7.327A5.336 5.336 0 0 1 7.333 2c1.892 0 3.669.982 4.667 2.468C12.998 2.982 14.775 2 16.667 2 19.607 2 22 4.39 22 7.327c0 1.133-.411 2.272-1.222 3.387l-8.245 11.019A.667.667 0 0 1 12 22", fill: "currentColor", fillRule: "evenodd" }) }));
146
146
  }
147
147
 
148
- var styles$b = {"favorite-button":"favorite-button-module-tXSS3","is-favorite":"favorite-button-module-l557q"};
148
+ var styles$g = {"favorite-button":"favorite-button-module-tXSS3","is-favorite":"favorite-button-module-l557q"};
149
149
 
150
150
  function FavoriteButton({ isFavorite, onPress }) {
151
- return (jsx(IconButton, { className: clsx(styles$b['favorite-button'], {
152
- [styles$b['is-favorite']]: isFavorite,
151
+ return (jsx(IconButton, { className: clsx(styles$g['favorite-button'], {
152
+ [styles$g['is-favorite']]: isFavorite,
153
153
  }), color: "secondary", onPress: onPress, children: isFavorite ? jsx(FavoriteFilledIcon, {}) : jsx(FavoriteOutlinedIcon, {}) }));
154
154
  }
155
155
 
156
- var styles$a = {"tag":"tag-module-B7r15","body":"tag-module-4cfCf","shape":"tag-module-c7CRb"};
156
+ var styles$f = {"link-button":"link-button-module-6i75g"};
157
+
158
+ function LinkButton({ children, className, href, isDisabled, onPress, target, }) {
159
+ if (href) {
160
+ return (jsx(Link, { className: clsx(styles$f['link-button'], className), href: href, isDisabled: isDisabled, onPress: onPress, target: target, children: children }));
161
+ }
162
+ return (jsx(Button$1, { className: clsx(styles$f['link-button'], className), isDisabled: isDisabled, onPress: onPress, type: "button", children: children }));
163
+ }
164
+
165
+ var styles$e = {"tag":"tag-module-B7r15","body":"tag-module-4cfCf","shape":"tag-module-c7CRb"};
157
166
 
158
167
  function Tag({ children }) {
159
168
  if (!children)
160
169
  return null;
161
- return (jsxs("div", { className: styles$a.tag, children: [jsx("div", { className: styles$a.body, children: children }), jsx("svg", { className: styles$a.shape, height: "16", viewBox: "0 0 8 16", width: "8", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M.925 0H0v16h5.412l2.463-8.429c.362-1.238-.08-2.576-1.094-3.315L.925 0z", fill: "currentColor", fillRule: "nonzero" }) })] }));
170
+ return (jsxs("div", { className: styles$e.tag, children: [jsx("div", { className: styles$e.body, children: children }), jsx("svg", { className: styles$e.shape, height: "16", viewBox: "0 0 8 16", width: "8", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M.925 0H0v16h5.412l2.463-8.429c.362-1.238-.08-2.576-1.094-3.315L.925 0z", fill: "currentColor", fillRule: "nonzero" }) })] }));
162
171
  }
163
172
 
164
173
  const IntlContext = createContext({
@@ -184,7 +193,7 @@ const useFormattedMessage = () => {
184
193
 
185
194
  const FormattedMessage = ({ id, replacementValues, }) => useFormattedMessage()(id, replacementValues);
186
195
 
187
- var styles$9 = {"product-price":"product-price-module-oIU1K","original-price":"product-price-module-til0s","current-price-wrapper":"product-price-module-FfVhl","current-price":"product-price-module-pvy2w","wholes":"product-price-module-GCw07","dot":"product-price-module-N56iV","decimals":"product-price-module-eWOOF","vat":"product-price-module-96DoG"};
196
+ var styles$d = {"product-price":"product-price-module-oIU1K","original-price":"product-price-module-til0s","current-price-wrapper":"product-price-module-FfVhl","current-price":"product-price-module-pvy2w","wholes":"product-price-module-GCw07","dot":"product-price-module-N56iV","decimals":"product-price-module-eWOOF","vat":"product-price-module-96DoG"};
188
197
 
189
198
  const formatPrice = (price) => new Intl.NumberFormat('en-US', {
190
199
  maximumFractionDigits: 2,
@@ -196,16 +205,16 @@ function ProductPrice({ className, current, includeVat, original, }) {
196
205
  const originalPriceCurrency = original ? formatPrice(original) : null;
197
206
  const currentPriceCurrency = formatPrice(current);
198
207
  const [wholes, decimals] = currentPriceCurrency.split('.');
199
- return (jsxs("div", { className: clsx(className, styles$9['product-price']), children: [!!original && (jsx("span", { className: styles$9['original-price'], children: originalPriceCurrency })), jsxs("div", { className: styles$9['current-price-wrapper'], children: [jsxs("div", { className: styles$9['current-price'], children: [jsx("span", { className: styles$9.wholes, children: wholes }), jsx("span", { className: styles$9.dot, children: "." }), jsx("span", { className: styles$9.decimals, children: decimals })] }), jsx("span", { className: styles$9.vat, children: includeVat ? (jsx(FormattedMessage, { id: "Incl. VAT" })) : (jsx(FormattedMessage, { id: "Excl. VAT" })) })] })] }));
208
+ return (jsxs("div", { className: clsx(className, styles$d['product-price']), children: [!!original && (jsx("span", { className: styles$d['original-price'], children: originalPriceCurrency })), jsxs("div", { className: styles$d['current-price-wrapper'], children: [jsxs("div", { className: styles$d['current-price'], children: [jsx("span", { className: styles$d.wholes, children: wholes }), jsx("span", { className: styles$d.dot, children: "." }), jsx("span", { className: styles$d.decimals, children: decimals })] }), jsx("span", { className: styles$d.vat, children: includeVat ? (jsx(FormattedMessage, { id: "Incl. VAT" })) : (jsx(FormattedMessage, { id: "Excl. VAT" })) })] })] }));
200
209
  }
201
210
 
202
- var styles$8 = {"product-sku":"product-sku-module-ITb8x"};
211
+ var styles$c = {"product-sku":"product-sku-module-ITb8x"};
203
212
 
204
213
  function ProductSku({ sku }) {
205
- return jsx("p", { className: styles$8['product-sku'], children: sku });
214
+ return jsx("p", { className: styles$c['product-sku'], children: sku });
206
215
  }
207
216
 
208
- var styles$7 = {"image":"image-module-lg7Kj","contain":"image-module-KFEgG","cover":"image-module-tVKFe"};
217
+ var styles$b = {"image":"image-module-lg7Kj","contain":"image-module-KFEgG","cover":"image-module-tVKFe"};
209
218
 
210
219
  const breakpointToWidth = {
211
220
  lg: 1440,
@@ -230,47 +239,71 @@ function Image({ alt, className, fallbackSrc = '/images/fallback.svg', fit = 'co
230
239
  const handleError = () => {
231
240
  setCurrentSrc(fallbackSrc);
232
241
  };
233
- return (jsx("img", { alt: alt, className: clsx(styles$7.image, styles$7[fit], className), height: height, loading: loading, onError: handleError, sizes: sizes, src: currentSrc, srcSet: srcSet, title: title, width: width }));
242
+ return (jsx("img", { alt: alt, className: clsx(styles$b.image, styles$b[fit], className), height: height, loading: loading, onError: handleError, sizes: sizes, src: currentSrc, srcSet: srcSet, title: title, width: width }));
234
243
  }
235
244
 
236
- var styles$6 = {"product-card":"product-card-module-pLaiB","favorite-button":"product-card-module-tvEdz","content":"product-card-module-e0kMu","top":"product-card-module-Q0VvF","tag":"product-card-module-HkWBE","title":"product-card-module-CStNi","bottom":"product-card-module-kD2tU","image":"product-card-module-p-zoi","price":"product-card-module-irW0D","add-to-cart-button":"product-card-module-SnCvX"};
245
+ var styles$a = {"product-card":"product-card-module-pLaiB","favorite-button":"product-card-module-tvEdz","content":"product-card-module-e0kMu","top":"product-card-module-Q0VvF","tag":"product-card-module-HkWBE","title":"product-card-module-CStNi","bottom":"product-card-module-kD2tU","image":"product-card-module-p-zoi","price":"product-card-module-irW0D","add-to-cart-button":"product-card-module-SnCvX"};
237
246
 
238
247
  function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, image: { alt, fit, src, title: imageTitle }, onClick, price, sku, tag, title, }) {
239
- return (jsxs("div", { className: styles$6['product-card'], onClick: onClick, children: [jsx("div", { className: styles$6.image, children: jsx(Image, { alt: alt, fit: fit, src: src, title: imageTitle }) }), jsx("div", { className: styles$6['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles$6.content, children: [jsxs("div", { className: styles$6.top, children: [jsx("div", { className: styles$6.tag, children: tag && jsx(Tag, { children: tag }) }), jsx("h2", { className: styles$6.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles$6.bottom, children: [jsx("div", { className: styles$6.price, children: jsx(ProductPrice, { current: price.current, includeVat: price.includeVat, original: price.original }) }), jsx("div", { className: styles$6['add-to-cart-button'], children: AddToCartButton })] })] })] }));
248
+ return (jsxs("div", { className: styles$a['product-card'], onClick: onClick, children: [jsx("div", { className: styles$a.image, children: jsx(Image, { alt: alt, fit: fit, src: src, title: imageTitle }) }), jsx("div", { className: styles$a['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles$a.content, children: [jsxs("div", { className: styles$a.top, children: [jsx("div", { className: styles$a.tag, children: tag && jsx(Tag, { children: tag }) }), jsx("h2", { className: styles$a.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles$a.bottom, children: [jsx("div", { className: styles$a.price, children: jsx(ProductPrice, { current: price.current, includeVat: price.includeVat, original: price.original }) }), jsx("div", { className: styles$a['add-to-cart-button'], children: AddToCartButton })] })] })] }));
240
249
  }
241
250
 
242
- var styles$5 = {"accordion":"accordion-module-9WvAH","white":"accordion-module-CaVdG","accordion-item":"accordion-module-lf9d-","lg":"accordion-module-0qnae","with-seperators":"accordion-module-yOLrW","button":"accordion-module--Rwpb","icon":"accordion-module-Y50uq","focus":"accordion-module-M4BZs","panel":"accordion-module-KZjMo","content":"accordion-module-ejMH3","is-open":"accordion-module-W0F1z"};
251
+ var styles$9 = {"accordion":"accordion-module-9WvAH","white":"accordion-module-CaVdG","accordion-item":"accordion-module-lf9d-","lg":"accordion-module-0qnae","with-seperators":"accordion-module-yOLrW","button":"accordion-module--Rwpb","icon":"accordion-module-Y50uq","focus":"accordion-module-M4BZs","panel":"accordion-module-KZjMo","content":"accordion-module-ejMH3","is-open":"accordion-module-W0F1z"};
243
252
 
244
253
  function Accordion({ children, color = 'black', hasLineSeparator = true, size = 'md', }) {
245
- return (jsx("div", { className: clsx(styles$5.accordion, styles$5[color], styles$5[size], hasLineSeparator && styles$5['with-seperators']), children: children &&
254
+ return (jsx("div", { className: clsx(styles$9.accordion, styles$9[color], styles$9[size], hasLineSeparator && styles$9['with-seperators']), children: children &&
246
255
  Children.map(children, child => {
247
256
  return cloneElement(child, { size });
248
257
  }) }));
249
258
  }
250
259
 
251
- var styles$4 = {"checkbox":"checkbox-module-YNVdd","box":"checkbox-module-UKoyf","checkmark":"checkbox-module-pHIwh","focus":"checkbox-module-v23jy","active":"checkbox-module-7UG-b","color-checkbox":"checkbox-module-nEhvW"};
260
+ function ChevronDownSlim(props) {
261
+ return (jsx("svg", { viewBox: "0 0 16 17", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "m8 12.648-6.667-6.7a3.11 3.11 0 0 1 .466-.75c.202-.245.444-.477.726-.698l5.459 5.546L13.328 4.5c.288.226.543.459.764.699.222.24.413.489.575.75L8 12.648z", fill: "currentColor", fillRule: "evenodd" }) }));
262
+ }
263
+
264
+ var styles$8 = {"show-all":"show-all-module-BDp21","panel":"show-all-module-bEdda","content":"show-all-module-RF--F","has-transparency":"show-all-module-30y7l","button":"show-all-module-58e7Q","icon":"show-all-module-fqncI","is-open":"show-all-module-hQeGI"};
265
+
266
+ const ShowAll = ({ children, hasTransparency = true, initialHeight = 0, isOpen, onToggle, }) => {
267
+ const showAllRef = useRef(null);
268
+ useEffect(() => {
269
+ if (!showAllRef.current)
270
+ return;
271
+ showAllRef.current.style.setProperty('--initital-height', `${initialHeight}px`);
272
+ }, [initialHeight]);
273
+ return (jsxs("div", { ref: showAllRef, className: clsx(styles$8['show-all'], {
274
+ [styles$8['is-open']]: isOpen,
275
+ }), children: [jsx("div", { className: styles$8.panel, children: jsx("div", { className: clsx(styles$8.content, {
276
+ [styles$8['has-transparency']]: hasTransparency,
277
+ }), children: children }) }), jsxs(LinkButton, { className: styles$8.button, onPress: () => onToggle(!isOpen), children: [jsx(ChevronDownSlim, { className: styles$8.icon }), isOpen ? (jsx(FormattedMessage, { id: "Show less" })) : (jsx(FormattedMessage, { id: "Show all" }))] })] }));
278
+ };
279
+
280
+ var styles$7 = {"multi-select":"multi-select-module-DC7Ix","filter-items":"multi-select-module-cwVFb","hidden":"multi-select-module-o7yHU","filter-item":"multi-select-module-OW-NK"};
281
+
282
+ function MultiSelect({ amountShown = 3, isOpen = false, onChange, onToggleOpen, options, render, }) {
283
+ const shownOptions = options.slice(0, amountShown);
284
+ const hiddenOptions = options.slice(amountShown);
285
+ return (jsxs("div", { className: styles$7['multi-select'], children: [jsx("div", { className: styles$7['filter-items'], children: shownOptions.map(option => (jsxs("div", { className: styles$7['filter-item'], children: [render({ onChange: () => onChange(option), option }), jsxs("span", { children: ["(", option.amount, ")"] })] }, option.value))) }), hiddenOptions?.length > 0 && (jsx(ShowAll, { hasTransparency: false, isOpen: isOpen, onToggle: onToggleOpen, children: jsx("div", { className: clsx(styles$7['filter-items'], styles$7['hidden']), children: hiddenOptions.map(option => (jsxs("div", { className: styles$7['filter-item'], children: [render({ onChange: () => onChange(option), option }), jsxs("span", { children: ["(", option.amount, ")"] })] }, option.value))) }) }))] }));
286
+ }
287
+
288
+ var styles$6 = {"checkbox":"checkbox-module-YNVdd","box":"checkbox-module-UKoyf","checkmark":"checkbox-module-pHIwh","focus":"checkbox-module-v23jy","active":"checkbox-module-7UG-b","color-checkbox":"checkbox-module-nEhvW"};
252
289
 
253
290
  function Checkbox({ _pseudo = 'none', children, className, isDisabled, isSelected, onChange, value, }) {
254
- return (jsxs(Checkbox$1, { className: clsx(className, styles$4.checkbox, styles$4[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, value: value, children: [jsx("div", { className: styles$4.box, children: jsx("svg", { "aria-hidden": "true", className: styles$4.checkmark, viewBox: "0 0 18 18", children: jsx("polyline", { points: "1 9 7 14 15 4" }) }) }), children] }));
291
+ return (jsxs(Checkbox$1, { className: clsx(className, styles$6.checkbox, styles$6[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, value: value, children: [jsx("div", { className: styles$6.box, children: jsx("svg", { "aria-hidden": "true", className: styles$6.checkmark, viewBox: "0 0 18 18", children: jsx("polyline", { points: "1 9 7 14 15 4" }) }) }), children] }));
255
292
  }
256
293
 
257
294
  function ColorCheckbox({ _pseudo = 'none', children, className, color, isDisabled, isSelected, onChange, value, }) {
258
- return (jsxs(Checkbox$1, { className: clsx(className, styles$4.checkbox, styles$4['color-checkbox'], styles$4[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, style: {
295
+ return (jsxs(Checkbox$1, { className: clsx(className, styles$6.checkbox, styles$6['color-checkbox'], styles$6[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, style: {
259
296
  '--selected-color': color,
260
- }, value: value, children: [jsx("div", { className: styles$4.box }), children] }));
261
- }
262
-
263
- function ChevronDownSlim(props) {
264
- return (jsx("svg", { viewBox: "0 0 16 17", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "m8 12.648-6.667-6.7a3.11 3.11 0 0 1 .466-.75c.202-.245.444-.477.726-.698l5.459 5.546L13.328 4.5c.288.226.543.459.764.699.222.24.413.489.575.75L8 12.648z", fill: "currentColor", fillRule: "evenodd" }) }));
297
+ }, value: value, children: [jsx("div", { className: styles$6.box }), children] }));
265
298
  }
266
299
 
267
300
  function CheckmarkFilledIcon(props) {
268
301
  return (jsx("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M10.864 17c-.2 0-.378-.045-.534-.135a1.588 1.588 0 0 1-.446-.407L6.278 12.22c-.185-.233-.278-.474-.278-.722 0-.264.087-.488.262-.672a.86.86 0 0 1 .651-.276c.156 0 .299.033.429.101s.258.188.384.361l3.094 3.71 5.42-8.19c.216-.354.483-.531.802-.531.245 0 .466.08.663.243A.785.785 0 0 1 18 6.88c0 .12-.028.243-.084.367a2.53 2.53 0 0 1-.194.356l-5.934 8.844c-.23.369-.538.553-.924.553z", fill: "currentColor", fillRule: "evenodd" }) }));
269
302
  }
270
303
 
271
- var styles$3 = {"select":"select-module-ui-Wc","button":"select-module-aMQIQ","chevron":"select-module-00uRU","focus":"select-module-XMc0P","popover":"select-module-z8cWq","listbox":"select-module-S21ba","item":"select-module-LgEJO","check":"select-module-lQFw3"};
304
+ var styles$5 = {"select":"select-module-ui-Wc","button":"select-module-aMQIQ","chevron":"select-module-00uRU","focus":"select-module-XMc0P","popover":"select-module-z8cWq","listbox":"select-module-S21ba","item":"select-module-LgEJO","check":"select-module-lQFw3"};
272
305
 
273
- const Select = ({ disabled = false, label, onChange, options, selectedOption, showLabel = true, }) => {
306
+ function Select({ disabled = false, label, onChange, options, selectedOption, showLabel = true, }) {
274
307
  const selectRef = useRef(null);
275
308
  useEffect(() => {
276
309
  const updateWidth = () => {
@@ -283,10 +316,10 @@ const Select = ({ disabled = false, label, onChange, options, selectedOption, sh
283
316
  window.addEventListener('resize', updateWidth);
284
317
  return () => window.removeEventListener('resize', updateWidth);
285
318
  }, []);
286
- return (jsxs(Select$1, { ref: selectRef, "aria-label": label, className: styles$3.select, isDisabled: disabled, onSelectionChange: selected => onChange(String(selected)), selectedKey: selectedOption, children: [showLabel && jsx(Label, { children: label }), jsxs(Button$1, { className: styles$3.button, children: [jsx(SelectValue, {}), jsx(ChevronDownSlim, { "aria-hidden": "true", className: styles$3.chevron })] }), jsx(Popover, { className: styles$3.popover, placement: "bottom left", triggerRef: selectRef, children: jsx(ListBox, { className: styles$3.listbox, children: Object.entries(options).map(([key, value]) => (jsxs(ListBoxItem, { "aria-label": value, className: styles$3.item, id: key, textValue: value, children: [selectedOption === key && (jsx("span", { slot: "description", children: jsx(CheckmarkFilledIcon, { className: styles$3.check }) })), jsx("span", { slot: "label", children: value })] }, key))) }) })] }));
287
- };
319
+ return (jsxs(Select$1, { ref: selectRef, "aria-label": label, className: styles$5.select, isDisabled: disabled, onSelectionChange: selected => onChange(selected), selectedKey: String(selectedOption), children: [showLabel && jsx(Label, { children: label }), jsxs(Button$1, { className: styles$5.button, children: [jsx(SelectValue, {}), jsx(ChevronDownSlim, { "aria-hidden": "true", className: styles$5.chevron })] }), jsx(Popover, { className: styles$5.popover, placement: "bottom left", triggerRef: selectRef, children: jsx(ListBox, { className: styles$5.listbox, children: Object.entries(options).map(([key, value]) => (jsxs(ListBoxItem, { "aria-label": value, className: styles$5.item, id: key, textValue: value, children: [selectedOption === key && (jsx("span", { slot: "description", children: jsx(CheckmarkFilledIcon, { className: styles$5.check }) })), jsx("span", { slot: "label", children: value })] }, key))) }) })] }));
320
+ }
288
321
 
289
- var styles$2 = {"input-container":"textarea-module-C6Xr1","lg":"textarea-module-vksG-","md":"textarea-module-6JrQJ"};
322
+ var styles$4 = {"input-container":"textarea-module-C6Xr1","lg":"textarea-module-vksG-","md":"textarea-module-6JrQJ"};
290
323
 
291
324
  /**
292
325
  * This component is used to create a textarea that can grow as the user types.
@@ -321,7 +354,7 @@ const TextArea = forwardRef(({ autoGrow, size, ...textAreaProps }, _ref) => {
321
354
  }
322
355
  updateHeight();
323
356
  }, [ref, autoGrow, updateHeight, size]);
324
- return (jsx("div", { className: styles$2['input-container'], children: jsx(TextArea$1, { ...textAreaProps, ref: node => {
357
+ return (jsx("div", { className: styles$4['input-container'], children: jsx(TextArea$1, { ...textAreaProps, ref: node => {
325
358
  ref.current =
326
359
  node;
327
360
  textAreaRef.current = node;
@@ -332,7 +365,7 @@ const TextArea = forwardRef(({ autoGrow, size, ...textAreaProps }, _ref) => {
332
365
  });
333
366
  TextArea.displayName = 'TextArea';
334
367
 
335
- var styles$1 = {"field":"text-field-module-JeaK0"};
368
+ var styles$3 = {"field":"text-field-module-JeaK0"};
336
369
 
337
370
  /**
338
371
  * This component is used to create a text field.
@@ -340,7 +373,7 @@ var styles$1 = {"field":"text-field-module-JeaK0"};
340
373
  * This field can also grow when a user types in text.
341
374
  */
342
375
  function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, onChange, onInput, onKeyUp, placeholder, rows, showLabel = true, size = 'lg', value, }) {
343
- return (jsxs(TextField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$1.field, styles$1[size]), defaultValue: defaultValue, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxLength: maxLength, onChange: value => {
376
+ return (jsxs(TextField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$3.field, styles$3[size]), defaultValue: defaultValue, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxLength: maxLength, onChange: value => {
344
377
  onChange?.(value);
345
378
  }, onInput: onInput, onKeyUp: e => onKeyUp?.(e), value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), isMultiline ? (jsx(TextArea, { autoGrow: autoGrow, placeholder: placeholder, rows: rows, size: size })) : (jsx(Input, { autoGrow: autoGrow, placeholder: placeholder, size: size })), jsx(FieldError, {})] }));
346
379
  }
@@ -361,12 +394,45 @@ function IntlProvider({ children, formatMessage }) {
361
394
  return (jsx(IntlContext.Provider, { value: { formatMessage }, children: children }));
362
395
  }
363
396
 
364
- var styles = {"product-grid":"product-overview-grid-module-bzys-","grid-item":"product-overview-grid-module-MlUVA"};
397
+ var styles$2 = {"product-grid":"product-overview-grid-module-bzys-","grid-item":"product-overview-grid-module-MlUVA"};
365
398
 
366
399
  function ProductOverviewGrid({ children }) {
367
- return (jsx("div", { className: styles['product-grid'], children: Children.map(children, (child, index) => (jsx("div", { className: styles['grid-item'], children: child }, index))) }));
400
+ return (jsx("div", { className: styles$2['product-grid'], children: Children.map(children, (child, index) => (jsx("div", { className: styles$2['grid-item'], children: child }, index))) }));
401
+ }
402
+
403
+ function CloseFilledIcon(props) {
404
+ return (jsx("svg", { viewBox: "0 0 32 33", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "m10.667 11.14 10.666 10.58m0-10.58L10.667 21.72", fill: "none", fillRule: "evenodd", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.867" }) }));
368
405
  }
369
406
 
407
+ const SidebarContext = createContext({
408
+ isOpen: false,
409
+ toggle: () => { },
410
+ });
411
+
412
+ const useSidebar = () => {
413
+ const context = useContext(SidebarContext);
414
+ if (!context) {
415
+ throw new Error('useSidebar must be used within a SidebarProvider');
416
+ }
417
+ return context;
418
+ };
419
+
420
+ var styles$1 = {"sidebar":"sidebar-module-fSa9Q","close":"sidebar-module-2puGC","is-open":"sidebar-module-lV7wp"};
421
+
422
+ function Sidebar({ children }) {
423
+ const { isOpen, toggle } = useSidebar();
424
+ return (jsxs("aside", { className: clsx(styles$1.sidebar, { [styles$1['is-open']]: isOpen }), children: [jsx("div", { className: styles$1.close, children: jsx(IconButton, { color: "secondary", onPress: toggle, children: jsx(CloseFilledIcon, {}) }) }), jsx("div", { children: children })] }));
425
+ }
426
+
427
+ function FilterOutlinedIcon(props) {
428
+ return (jsx("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M9.323 12.59c1.427 0 2.623 1.01 2.976 2.388h6.888c.46 0 .813.368.813.833 0 .465-.353.85-.813.85h-6.903C11.916 18.005 10.734 19 9.324 19c-1.412 0-2.593-.994-2.962-2.34h-1.58c-.43 0-.782-.384-.782-.85 0-.464.353-.832.782-.832h1.565c.353-1.379 1.55-2.388 2.976-2.388zm0 1.41c-.951 0-1.703.77-1.703 1.779 0 1.01.752 1.795 1.703 1.795.951 0 1.703-.786 1.703-1.795 0-1.01-.752-1.779-1.703-1.779zm5.37-8c1.41 0 2.607 1.026 2.96 2.404h1.58c.414 0 .767.368.767.833 0 .465-.353.834-.767.834h-1.595c-.353 1.362-1.55 2.355-2.946 2.355-1.411 0-2.592-.993-2.96-2.355H4.813A.814.814 0 0 1 4 9.237c0-.465.353-.833.813-.833h6.903C12.07 7.026 13.266 6 14.692 6zm0 1.426c-.967 0-1.704.77-1.704 1.78 0 1.009.737 1.794 1.703 1.794.951 0 1.703-.785 1.703-1.795 0-1.01-.752-1.779-1.703-1.779z", fill: "currentColor", fillRule: "evenodd" }) }));
429
+ }
430
+
431
+ const ToggleSidebarButton = () => {
432
+ const { toggle } = useSidebar();
433
+ return (jsx(Button, { color: "secondary", icon: jsx(FilterOutlinedIcon, {}), onPress: toggle, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Show filters" }) }));
434
+ };
435
+
370
436
  function Filter({ children, title }) {
371
437
  return (jsxs("div", { children: [jsx("div", { children: jsx("h3", { children: title }) }), jsx("div", { children: children })] }));
372
438
  }
@@ -377,8 +443,18 @@ function ColorFilter({ onChange, options, value }) {
377
443
  : value.filter(v => v !== option.value)), value: option.value, children: option.label }) }, option.value))) }) }));
378
444
  }
379
445
 
446
+ var styles = {"product-listing":"product-listing-module-EmEFw","action-bar":"product-listing-module-rFNcR","count":"product-listing-module-1seez","product-grid-container":"product-listing-module-hZuKD"};
447
+
448
+ const sortOptions = {
449
+ new: 'New',
450
+ popular: 'Popular',
451
+ price_asc: 'Price: Low - High',
452
+ price_desc: 'Price: High - Low',
453
+ recommended: 'Recommended',
454
+ };
380
455
  function ProductListing({ activeFilters, filters, isLoading = false, onFilterChange, onSortChange, productCard: ProductCard, products, }) {
381
- return (jsxs("div", { children: [jsx("h1", { children: "Product listing" }), jsxs("aside", { children: [jsx("h2", { children: "Filter" }), jsx("div", { children: jsx(ColorFilter, { onChange: colors => onFilterChange({ colors }), options: filters.color.options, value: activeFilters.colors }) })] }), jsx("main", { children: jsxs("select", { onChange: e => onSortChange({ by: e.target.value, direction: 'asc' }), children: [jsx("option", { value: "", children: "Sort By" }), jsx("option", { value: "price", children: "Price" }), jsx("option", { value: "title", children: "Title" })] }) }), isLoading ? (jsx("p", { children: "Loading..." })) : (jsx("ul", { children: products.map(product => (jsx("li", { children: jsx(ProductCard, {}) }, product.id))) }))] }));
456
+ const t = useFormattedMessage();
457
+ return (jsxs("div", { className: styles['product-listing'], children: [jsx("h1", { children: "Product listing" }), jsxs("section", { className: styles['action-bar'], children: [jsx(ToggleSidebarButton, {}), jsx("span", { className: styles.count, children: "124 articles" }), jsx(Select, { label: t('Sort'), onChange: key => onSortChange(key), options: sortOptions, selectedOption: "new", showLabel: false })] }), jsx("section", { children: isLoading ? (jsx("p", { children: "Loading..." })) : (jsxs("div", { className: styles['product-grid-container'], children: [jsx(Sidebar, { children: jsxs("div", { children: [jsx("h2", { children: "Filter" }), jsx(ColorFilter, { onChange: colors => onFilterChange({ colors }), options: filters.color.options, value: activeFilters.colors })] }) }), jsx(ProductOverviewGrid, { children: products.map(product => (jsx(ProductCard, {}, product.id))) })] })) })] }));
382
458
  }
383
459
 
384
460
  function createProductListingSearchParams(state) {
@@ -400,4 +476,4 @@ function parseProductListingSearchParams(params) {
400
476
  };
401
477
  }
402
478
 
403
- export { Accordion, AddToCartButton, Button, CartFilledIcon, CartOutlinedIcon, Checkbox, ColorCheckbox, DehashedOutlinedIcon, FavoriteButton, FavoriteFilledIcon, FavoriteOutlinedIcon, FormattedMessage, HashedOutlinedIcon, IconButton, Image, IntlProvider, NumberField, ProductCard, ProductListing, ProductOverviewGrid, ProductPrice, ProductSku, RightArrowFilledIcon, Select, TextField, createProductListingSearchParams, parseProductListingSearchParams, useFormattedMessage };
479
+ export { Accordion, AddToCartButton, Button, CartFilledIcon, CartOutlinedIcon, Checkbox, ColorCheckbox, DehashedOutlinedIcon, FavoriteButton, FavoriteFilledIcon, FavoriteOutlinedIcon, FormattedMessage, HashedOutlinedIcon, IconButton, Image, IntlProvider, LinkButton, MultiSelect, NumberField, ProductCard, ProductListing, ProductOverviewGrid, ProductPrice, ProductSku, RightArrowFilledIcon, Select, ShowAll, Sidebar, TextField, createProductListingSearchParams, parseProductListingSearchParams, useFormattedMessage };
@@ -1,5 +1 @@
1
- export interface Translations {
2
- 'Excl. VAT': string;
3
- 'Incl. VAT': string;
4
- }
5
- export type TranslationId = keyof Translations;
1
+ export type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article';
@@ -8,28 +8,30 @@ export interface Filters {
8
8
  }[];
9
9
  };
10
10
  }
11
+ declare const sortOptions: {
12
+ readonly new: "New";
13
+ readonly popular: "Popular";
14
+ readonly price_asc: "Price: Low - High";
15
+ readonly price_desc: "Price: High - Low";
16
+ readonly recommended: "Recommended";
17
+ };
18
+ type SortKey = keyof typeof sortOptions;
11
19
  export type ActiveFilters = {
12
20
  colors: string[];
13
21
  };
14
- export type Sort = {
15
- by: string;
16
- direction: string;
17
- };
18
22
  export type ProductListingProps = {
19
23
  activeFilters: ActiveFilters;
20
24
  filters: Filters;
21
25
  isLoading?: boolean;
22
26
  onFilterChange: (filters: ActiveFilters) => void;
23
- onSortChange: (sort: Sort) => void;
24
- productCard: ComponentType<any>;
27
+ onSortChange: (sort: SortKey) => void;
28
+ productCard: ComponentType;
25
29
  products: {
26
30
  id: string;
27
31
  title: string;
28
32
  }[];
29
- sort: {
30
- by: string;
31
- direction: string;
32
- };
33
+ sort: SortKey;
33
34
  total: number;
34
35
  };
35
36
  export declare function ProductListing({ activeFilters, filters, isLoading, onFilterChange, onSortChange, productCard: ProductCard, products, }: ProductListingProps): import("react/jsx-runtime").JSX.Element;
37
+ export {};
@@ -3,7 +3,7 @@ import { ProductListing } from './product-listing';
3
3
  declare const meta: {
4
4
  args: {
5
5
  onFilterChange: import("@vitest/spy").Mock<[filters: import("./product-listing").ActiveFilters], void>;
6
- onSortChange: import("@vitest/spy").Mock<[sort: import("./product-listing").Sort], void>;
6
+ onSortChange: import("@vitest/spy").Mock<[sort: "new" | "popular" | "price_asc" | "price_desc" | "recommended"], void>;
7
7
  };
8
8
  component: typeof ProductListing;
9
9
  tags: string[];
@@ -0,0 +1,5 @@
1
+ export declare const useDevice: () => {
2
+ isDesktop: boolean;
3
+ isMobile: boolean;
4
+ isTablet: boolean;
5
+ };
@@ -0,0 +1,9 @@
1
+ interface UseDisclosureReturnType {
2
+ close: () => void;
3
+ isClosed: boolean;
4
+ isOpen: boolean;
5
+ open: () => void;
6
+ toggle: () => void;
7
+ }
8
+ export declare const useDisclosure: () => UseDisclosureReturnType;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useScrollLock: (lock: boolean) => void;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface SidebarContextType {
3
+ isOpen: boolean;
4
+ toggle: () => void;
5
+ }
6
+ export declare const SidebarContext: React.Context<SidebarContextType>;
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from 'react';
2
+ interface SidebarProviderProps {
3
+ children: ReactElement;
4
+ }
5
+ export declare function SidebarProvider({ children }: SidebarProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface SidebarProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare function Sidebar({ children }: SidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { SidebarProvider } from './sidebar-provider';
3
+ declare const meta: Meta<typeof SidebarProvider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const SmallViewport: Story;
7
+ export declare const MediumViewport: Story;
8
+ export declare const LargeViewport: Story;
@@ -0,0 +1 @@
1
+ export declare const ToggleSidebarButton: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SidebarContextType } from './sidebar-context';
2
+ export declare const useSidebar: () => SidebarContextType;