@asante-org/leybold-design-system 1.3.0 → 1.3.1
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/README.md +163 -163
- package/dist/app/layout.d.ts +9 -0
- package/dist/app/page.d.ts +2 -0
- package/dist/assets/.gitkeep +2 -2
- package/dist/assets/desktop-layout-alt.svg +27 -27
- package/dist/assets/desktop-layout.svg +29 -29
- package/dist/assets/globe.svg +7 -7
- package/dist/assets/leybold-footer-logo.svg +19 -19
- package/dist/assets/leybold-white.svg +18 -18
- package/dist/assets/list-product-overlay-tip-active.svg +3 -3
- package/dist/assets/list-product-overlay-tip.svg +3 -3
- package/dist/assets/logo-example.svg +9 -9
- package/dist/assets/logo.svg +19 -19
- package/dist/assets/phone-layout.svg +14 -14
- package/dist/assets/red-tip.svg +10 -10
- package/dist/assets/tablet-layout.svg +28 -28
- package/dist/index.css +88 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.css +88 -0
- package/dist/index.esm.js +1147 -1359
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.scss +35 -238
- package/dist/index.js +1148 -1361
- package/dist/index.js.map +1 -1
- package/dist/index.scss +35 -238
- package/dist/src/components/Button/Button.d.ts +2 -2
- package/dist/src/components/ContentCardHorizontal/ContentCardHorizontal.d.ts +2 -2
- package/dist/src/experience/algolia-dynamic-search/AlgoliaDynamicSearch.stories.d.ts +0 -2
- package/dist/src/index.d.ts +1 -2
- package/dist/src/stories/foundation/Typography/TypographyComponents.d.ts +0 -1
- package/dist/src/types/cards.d.ts +2 -28
- package/dist/stories/components/Algolia-dynamic-search/algolia-dynamic-search.d.ts +4 -0
- package/dist/stories/components/Algolia-dynamic-search/algolia-dynamic-search.stories.d.ts +7 -0
- package/dist/stories/components/Button/Button.d.ts +35 -0
- package/dist/stories/components/Button/Button.stories.d.ts +15 -0
- package/dist/stories/components/Button/index.d.ts +2 -0
- package/dist/stories/components/QRFormJourney/Qr-form/Qr-form.d.ts +2 -0
- package/dist/stories/components/QRFormJourney/Qr-form/Qr-form.stories.d.ts +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/styles/index.d.ts +1 -0
- package/package.json +115 -115
- package/dist/.next/types/app/layout.d.ts +0 -9
- package/dist/.next/types/app/page.d.ts +0 -9
- package/dist/src/components/ContentCardBase/ContentCardBase.d.ts +0 -3
- package/dist/src/components/ContentCardBase/index.d.ts +0 -2
- package/dist/src/components/ContentCardVertical/ContentCardVertical.d.ts +0 -3
- package/dist/src/components/ContentCardVertical/ContentCardVertical.stories.d.ts +0 -9
package/dist/index.esm.js
CHANGED
|
@@ -15,46 +15,7 @@ function _extends() {
|
|
|
15
15
|
}, _extends.apply(null, arguments);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
Copyright (c) Microsoft Corporation.
|
|
20
|
-
|
|
21
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
-
purpose with or without fee is hereby granted.
|
|
23
|
-
|
|
24
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
33
|
-
|
|
34
|
-
var __assign = function () {
|
|
35
|
-
__assign = Object.assign || function __assign(t) {
|
|
36
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37
|
-
s = arguments[i];
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
39
|
-
}
|
|
40
|
-
return t;
|
|
41
|
-
};
|
|
42
|
-
return __assign.apply(this, arguments);
|
|
43
|
-
};
|
|
44
|
-
function __rest(s, e) {
|
|
45
|
-
var t = {};
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
47
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
48
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
49
|
-
}
|
|
50
|
-
return t;
|
|
51
|
-
}
|
|
52
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
53
|
-
var e = new Error(message);
|
|
54
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var styles$l = {"button":"Button-module__button___18Bed","button--primary":"Button-module__button--primary___VuF-P","button--disabled":"Button-module__button--disabled___IuOY8","button--secondary":"Button-module__button--secondary___lD5E3","button--solid-grey":"Button-module__button--solid-grey___oRbEy","button--solid-black":"Button-module__button--solid-black___1Ma5K","button--solid-white":"Button-module__button--solid-white___bE-Z0","button--outlined-grey":"Button-module__button--outlined-grey___xWGbB","button--outlined-black":"Button-module__button--outlined-black___qfX5o","button--outlined-white":"Button-module__button--outlined-white___QLXNP","button--link-text":"Button-module__button--link-text___R2kun","button__icon":"Button-module__button__icon___hlcHo","button--link-text-alt":"Button-module__button--link-text-alt___1p7wH","button--external-link":"Button-module__button--external-link___Mhxuk","button--carousel-arrow-left":"Button-module__button--carousel-arrow-left___Wx-Jo","button--carousel-arrow-right":"Button-module__button--carousel-arrow-right___3ZtgT","button__icon__default":"Button-module__button__icon__default___0qlF1","button__icon__hover":"Button-module__button__icon__hover___3xPGT","button--extra-small":"Button-module__button--extra-small___R0QTM","button--small":"Button-module__button--small___ADJQe","button--medium":"Button-module__button--medium___ZuR4Z","button--large":"Button-module__button--large___-FaV5","button__icon--left":"Button-module__button__icon--left___wMCeH","button__icon--right":"Button-module__button__icon--right___-pGHl"};
|
|
18
|
+
var styles$k = {"button":"Button-module__button___18Bed","button--primary":"Button-module__button--primary___VuF-P","button--disabled":"Button-module__button--disabled___IuOY8","button--secondary":"Button-module__button--secondary___lD5E3","button--solid-grey":"Button-module__button--solid-grey___oRbEy","button--solid-black":"Button-module__button--solid-black___1Ma5K","button--solid-white":"Button-module__button--solid-white___bE-Z0","button--outlined-grey":"Button-module__button--outlined-grey___xWGbB","button--outlined-black":"Button-module__button--outlined-black___qfX5o","button--outlined-white":"Button-module__button--outlined-white___QLXNP","button--link-text":"Button-module__button--link-text___R2kun","button__icon":"Button-module__button__icon___hlcHo","button--link-text-alt":"Button-module__button--link-text-alt___1p7wH","button--external-link":"Button-module__button--external-link___Mhxuk","button--carousel-arrow-left":"Button-module__button--carousel-arrow-left___Wx-Jo","button--carousel-arrow-right":"Button-module__button--carousel-arrow-right___3ZtgT","button__icon__default":"Button-module__button__icon__default___0qlF1","button__icon__hover":"Button-module__button__icon__hover___3xPGT","button--extra-small":"Button-module__button--extra-small___R0QTM","button--small":"Button-module__button--small___ADJQe","button--medium":"Button-module__button--medium___ZuR4Z","button--large":"Button-module__button--large___-FaV5","button__icon--left":"Button-module__button__icon--left___wMCeH","button__icon--right":"Button-module__button__icon--right___-pGHl"};
|
|
58
19
|
|
|
59
20
|
function getDefaultExportFromCjs (x) {
|
|
60
21
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -131,10 +92,22 @@ function requireClassnames() {
|
|
|
131
92
|
var classnamesExports = requireClassnames();
|
|
132
93
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
133
94
|
|
|
134
|
-
/**
|
|
135
|
-
*
|
|
95
|
+
/**
|
|
96
|
+
* Button variant types
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Icon types for button
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Icon position
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get the icon component based on icon type
|
|
136
109
|
*/
|
|
137
|
-
|
|
110
|
+
const getIcon = icon => {
|
|
138
111
|
switch (icon) {
|
|
139
112
|
case "arrow-right":
|
|
140
113
|
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
@@ -156,10 +129,11 @@ var getIcon = function (icon) {
|
|
|
156
129
|
return null;
|
|
157
130
|
}
|
|
158
131
|
};
|
|
159
|
-
|
|
160
|
-
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get default icon for certain variants
|
|
161
135
|
*/
|
|
162
|
-
|
|
136
|
+
const getDefaultIcon = variant => {
|
|
163
137
|
switch (variant) {
|
|
164
138
|
case "link-text":
|
|
165
139
|
case "link-text-alt":
|
|
@@ -176,10 +150,11 @@ var getDefaultIcon = function (variant) {
|
|
|
176
150
|
return "none";
|
|
177
151
|
}
|
|
178
152
|
};
|
|
179
|
-
|
|
180
|
-
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Map alias variants to their actual CSS class variants
|
|
181
156
|
*/
|
|
182
|
-
|
|
157
|
+
const mapVariantToClass = variant => {
|
|
183
158
|
switch (variant) {
|
|
184
159
|
case "text":
|
|
185
160
|
return "link-text";
|
|
@@ -187,127 +162,130 @@ var mapVariantToClass = function (variant) {
|
|
|
187
162
|
return variant;
|
|
188
163
|
}
|
|
189
164
|
};
|
|
190
|
-
|
|
191
|
-
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Primary UI component for user interaction
|
|
192
168
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
_g = _a.iconPosition,
|
|
208
|
-
iconPosition = _g === void 0 ? "right" : _g,
|
|
209
|
-
ariaLabel = _a.ariaLabel;
|
|
210
|
-
_a.opensInNewTab;
|
|
211
|
-
var props = __rest(_a, ["children", "variant", "size", "disabled", "onClick", "type", "className", "icon", "iconPosition", "ariaLabel", "opensInNewTab"]);
|
|
169
|
+
const Button = ({
|
|
170
|
+
children,
|
|
171
|
+
variant = "primary",
|
|
172
|
+
size = "medium",
|
|
173
|
+
disabled = false,
|
|
174
|
+
onClick,
|
|
175
|
+
type = "button",
|
|
176
|
+
className,
|
|
177
|
+
icon,
|
|
178
|
+
iconPosition = "right",
|
|
179
|
+
ariaLabel,
|
|
180
|
+
opensInNewTab,
|
|
181
|
+
...props
|
|
182
|
+
}) => {
|
|
212
183
|
// Map alias variants to actual class names
|
|
213
|
-
|
|
184
|
+
const cssVariant = mapVariantToClass(variant);
|
|
185
|
+
|
|
214
186
|
// Determine the icon to display
|
|
215
|
-
|
|
216
|
-
|
|
187
|
+
const displayIcon = icon ?? getDefaultIcon(variant);
|
|
188
|
+
const iconElement = getIcon(displayIcon);
|
|
189
|
+
|
|
217
190
|
// Check if this is an icon-only button (carousel arrows)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
191
|
+
const isIconOnly = variant === "carousel-arrow-left" || variant === "carousel-arrow-right";
|
|
192
|
+
const isCarouselLeft = variant === "carousel-arrow-left";
|
|
193
|
+
const isCarouselRight = variant === "carousel-arrow-right";
|
|
194
|
+
const buttonClasses = classNames(styles$k.button, styles$k[`button--${cssVariant}`], styles$k[`button--${size}`], {
|
|
195
|
+
[styles$k["button--disabled"]]: disabled
|
|
196
|
+
}, className);
|
|
197
|
+
const iconClasses = classNames(styles$k.button__icon, styles$k[`button__icon--${iconPosition}`]);
|
|
198
|
+
|
|
223
199
|
// Generate accessible label for icon-only buttons
|
|
224
|
-
|
|
200
|
+
const accessibleLabel = ariaLabel || (isIconOnly ? variant === "carousel-arrow-left" ? "Previous" : "Next" : undefined);
|
|
225
201
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
226
202
|
type: type,
|
|
227
203
|
className: buttonClasses,
|
|
228
204
|
disabled: disabled,
|
|
229
205
|
onClick: onClick,
|
|
230
206
|
"aria-label": accessibleLabel,
|
|
231
|
-
"data-force-state": props[
|
|
207
|
+
"data-force-state": props['data-force-state']
|
|
232
208
|
}, props), !isIconOnly && children, isCarouselLeft && /*#__PURE__*/React.createElement("span", {
|
|
233
209
|
className: iconClasses
|
|
234
210
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
235
211
|
icon: faArrowLeft,
|
|
236
|
-
className: styles$
|
|
212
|
+
className: styles$k.button__icon__default
|
|
237
213
|
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
238
214
|
icon: faArrowLeftLong,
|
|
239
|
-
className: styles$
|
|
215
|
+
className: styles$k.button__icon__hover
|
|
240
216
|
})), isCarouselRight && /*#__PURE__*/React.createElement("span", {
|
|
241
217
|
className: iconClasses
|
|
242
218
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
243
219
|
icon: faArrowRight,
|
|
244
|
-
className: styles$
|
|
220
|
+
className: styles$k.button__icon__default
|
|
245
221
|
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
246
222
|
icon: faArrowRightLong,
|
|
247
|
-
className: styles$
|
|
223
|
+
className: styles$k.button__icon__hover
|
|
248
224
|
})), !isIconOnly && iconElement && /*#__PURE__*/React.createElement("span", {
|
|
249
225
|
className: iconClasses
|
|
250
226
|
}, iconElement));
|
|
251
227
|
};
|
|
252
228
|
|
|
253
|
-
var styles$
|
|
229
|
+
var styles$j = {"footer":"Footer-module__footer___Oavyx","footer--mobile":"Footer-module__footer--mobile___9HQC-","footer__container":"Footer-module__footer__container___ohvnm","footer__links":"Footer-module__footer__links___DdVK8","footer__linkGroup":"Footer-module__footer__linkGroup___1B7JA","footer__linkList":"Footer-module__footer__linkList___j-DWF","footer__linkHeading":"Footer-module__footer__linkHeading___LtE6X","footer__link":"Footer-module__footer__link___G5HPW","footer__cta":"Footer-module__footer__cta___MRJLr","footer__socialIcons":"Footer-module__footer__socialIcons___j0aRp","footer__socialIcon":"Footer-module__footer__socialIcon___1uVTm","footer__countrySelector":"Footer-module__footer__countrySelector___pVtN5","footer__bottom":"Footer-module__footer__bottom___77bPL","footer__bottomLeft":"Footer-module__footer__bottomLeft___tlst1","footer__bottomLinks":"Footer-module__footer__bottomLinks___s22h7","footer__bottomLink":"Footer-module__footer__bottomLink___SLzwY","footer__copyright":"Footer-module__footer__copyright___4bZOF","footer__brandSection":"Footer-module__footer__brandSection___BBr5f","footer__logo":"Footer-module__footer__logo___mv-9M","footer__leftCol":"Footer-module__footer__leftCol___vmKNN","footer__motto":"Footer-module__footer__motto___QtB2m","footer__main":"Footer-module__footer__main___NSU9d","footer__badge":"Footer-module__footer__badge___faejb","footer__badgeIcon":"Footer-module__footer__badgeIcon___xJ519","footer__badgeText":"Footer-module__footer__badgeText___imXgG","footer__linkText":"Footer-module__footer__linkText___Gc18Z","footer__linkIcon":"Footer-module__footer__linkIcon___IZzJM","footer__countrySelectorIcon":"Footer-module__footer__countrySelectorIcon___hhEd4"};
|
|
254
230
|
|
|
255
|
-
/**
|
|
256
|
-
* External link icon (↗) for footer links that open in new tabs
|
|
231
|
+
/**
|
|
232
|
+
* External link icon (↗) for footer links that open in new tabs
|
|
257
233
|
*/
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Atlas Copco Group badge icon (square)
|
|
234
|
+
const ExternalLinkIcon = ({
|
|
235
|
+
className,
|
|
236
|
+
size = 15
|
|
237
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
238
|
+
width: size,
|
|
239
|
+
height: size,
|
|
240
|
+
viewBox: "0 0 15 15",
|
|
241
|
+
fill: "none",
|
|
242
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
243
|
+
className: className,
|
|
244
|
+
"aria-hidden": "true"
|
|
245
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
246
|
+
d: "M11.25 8.125V11.875C11.25 12.2065 11.1183 12.5245 10.8839 12.7589C10.6495 12.9933 10.3315 13.125 10 13.125H3.125C2.79348 13.125 2.47554 12.9933 2.24112 12.7589C2.0067 12.5245 1.875 12.2065 1.875 11.875V5C1.875 4.66848 2.0067 4.35054 2.24112 4.11612C2.47554 3.8817 2.79348 3.75 3.125 3.75H6.875M9.375 1.875H13.125M13.125 1.875V5.625M13.125 1.875L6.25 8.75",
|
|
247
|
+
stroke: "currentColor",
|
|
248
|
+
strokeWidth: "1.5",
|
|
249
|
+
strokeLinecap: "round",
|
|
250
|
+
strokeLinejoin: "round"
|
|
251
|
+
}));
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Atlas Copco Group badge icon (square)
|
|
281
255
|
*/
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
256
|
+
const AtlasCopcoIcon = ({
|
|
257
|
+
className,
|
|
258
|
+
size = 14
|
|
259
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
260
|
+
width: size,
|
|
261
|
+
height: size,
|
|
262
|
+
viewBox: "0 0 14 14",
|
|
263
|
+
fill: "none",
|
|
264
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
265
|
+
className: className,
|
|
266
|
+
"aria-hidden": "true"
|
|
267
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
268
|
+
x: "0.5",
|
|
269
|
+
y: "0.5",
|
|
270
|
+
width: "13",
|
|
271
|
+
height: "13",
|
|
272
|
+
rx: "1.5",
|
|
273
|
+
fill: "#D9D9D9",
|
|
274
|
+
stroke: "#D9D9D9"
|
|
275
|
+
}));
|
|
276
|
+
|
|
277
|
+
// =============================================================================
|
|
278
|
+
// TYPE DEFINITIONS
|
|
279
|
+
// =============================================================================
|
|
304
280
|
|
|
305
281
|
// =============================================================================
|
|
306
282
|
// SOCIAL ICON COMPONENT
|
|
307
283
|
// =============================================================================
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
284
|
+
|
|
285
|
+
const SocialIconComponent = ({
|
|
286
|
+
platform
|
|
287
|
+
}) => {
|
|
288
|
+
const iconMap = {
|
|
311
289
|
facebook: faFacebookF,
|
|
312
290
|
x: faXTwitter,
|
|
313
291
|
linkedin: faLinkedinIn,
|
|
@@ -318,14 +296,19 @@ var SocialIconComponent = function (_a) {
|
|
|
318
296
|
icon: iconMap[platform]
|
|
319
297
|
});
|
|
320
298
|
};
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
299
|
+
|
|
300
|
+
// =============================================================================
|
|
301
|
+
// FOOTER LINK COMPONENT
|
|
302
|
+
// =============================================================================
|
|
303
|
+
|
|
304
|
+
const FooterLink = ({
|
|
305
|
+
item,
|
|
306
|
+
className,
|
|
307
|
+
variant = 'default'
|
|
308
|
+
}) => {
|
|
309
|
+
const baseClass = variant === 'bottom' ? styles$j.footer__bottomLink : styles$j.footer__link;
|
|
310
|
+
const linkClasses = classNames(baseClass, className);
|
|
311
|
+
const handleClick = e => {
|
|
329
312
|
if (item.onClick) {
|
|
330
313
|
e.preventDefault();
|
|
331
314
|
item.onClick();
|
|
@@ -339,151 +322,169 @@ var FooterLink = function (_a) {
|
|
|
339
322
|
target: '_blank',
|
|
340
323
|
rel: 'noopener noreferrer'
|
|
341
324
|
}), /*#__PURE__*/React.createElement("span", {
|
|
342
|
-
className: styles$
|
|
325
|
+
className: styles$j.footer__linkText
|
|
343
326
|
}, item.label), item.external && /*#__PURE__*/React.createElement("span", {
|
|
344
|
-
className: styles$
|
|
327
|
+
className: styles$j.footer__linkIcon
|
|
345
328
|
}, /*#__PURE__*/React.createElement(ExternalLinkIcon, {
|
|
346
329
|
size: 15
|
|
347
330
|
})));
|
|
348
331
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
332
|
+
|
|
333
|
+
// =============================================================================
|
|
334
|
+
// FOOTER LINK GROUP COMPONENT
|
|
335
|
+
// =============================================================================
|
|
336
|
+
|
|
337
|
+
const FooterLinkGroup = ({
|
|
338
|
+
heading,
|
|
339
|
+
links,
|
|
340
|
+
className,
|
|
341
|
+
children
|
|
342
|
+
}) => {
|
|
354
343
|
return /*#__PURE__*/React.createElement("div", {
|
|
355
|
-
className: classNames(styles$
|
|
344
|
+
className: classNames(styles$j.footer__linkGroup, className)
|
|
356
345
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
357
|
-
className: styles$
|
|
346
|
+
className: styles$j.footer__linkHeading
|
|
358
347
|
}, heading), /*#__PURE__*/React.createElement("ul", {
|
|
359
|
-
className: styles$
|
|
360
|
-
}, links.map(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}));
|
|
366
|
-
})), children);
|
|
348
|
+
className: styles$j.footer__linkList
|
|
349
|
+
}, links.map((link, index) => /*#__PURE__*/React.createElement("li", {
|
|
350
|
+
key: index
|
|
351
|
+
}, /*#__PURE__*/React.createElement(FooterLink, {
|
|
352
|
+
item: link
|
|
353
|
+
})))), children);
|
|
367
354
|
};
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
355
|
+
|
|
356
|
+
// =============================================================================
|
|
357
|
+
// FOOTER SOCIAL ICONS COMPONENT
|
|
358
|
+
// =============================================================================
|
|
359
|
+
|
|
360
|
+
const FooterSocialIcons = ({
|
|
361
|
+
links,
|
|
362
|
+
className
|
|
363
|
+
}) => {
|
|
371
364
|
return /*#__PURE__*/React.createElement("div", {
|
|
372
|
-
className: classNames(styles$
|
|
373
|
-
}, links.map(
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}));
|
|
384
|
-
}));
|
|
365
|
+
className: classNames(styles$j.footer__socialIcons, className)
|
|
366
|
+
}, links.map((link, index) => /*#__PURE__*/React.createElement("a", {
|
|
367
|
+
key: index,
|
|
368
|
+
href: link.href,
|
|
369
|
+
className: styles$j.footer__socialIcon,
|
|
370
|
+
"aria-label": link.ariaLabel,
|
|
371
|
+
target: "_blank",
|
|
372
|
+
rel: "noopener noreferrer"
|
|
373
|
+
}, /*#__PURE__*/React.createElement(SocialIconComponent, {
|
|
374
|
+
platform: link.platform
|
|
375
|
+
}))));
|
|
385
376
|
};
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
377
|
+
|
|
378
|
+
// =============================================================================
|
|
379
|
+
// FOOTER SOCIAL ICON (STANDALONE) COMPONENT
|
|
380
|
+
// =============================================================================
|
|
381
|
+
|
|
382
|
+
const FooterSocialIcon = ({
|
|
383
|
+
platform,
|
|
384
|
+
className
|
|
385
|
+
}) => {
|
|
386
|
+
const iconClasses = classNames(styles$j.footer__socialIcon, className);
|
|
390
387
|
return /*#__PURE__*/React.createElement("span", {
|
|
391
388
|
className: iconClasses
|
|
392
389
|
}, /*#__PURE__*/React.createElement(SocialIconComponent, {
|
|
393
390
|
platform: platform
|
|
394
391
|
}));
|
|
395
392
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
393
|
+
|
|
394
|
+
// =============================================================================
|
|
395
|
+
// FOOTER BOTTOM COMPONENT
|
|
396
|
+
// =============================================================================
|
|
397
|
+
|
|
398
|
+
const FooterBottom = ({
|
|
399
|
+
links,
|
|
400
|
+
copyright,
|
|
401
|
+
countrySelector,
|
|
402
|
+
className
|
|
403
|
+
}) => {
|
|
401
404
|
return /*#__PURE__*/React.createElement("div", {
|
|
402
|
-
className: classNames(styles$
|
|
405
|
+
className: classNames(styles$j.footer__bottom, className)
|
|
403
406
|
}, /*#__PURE__*/React.createElement("div", {
|
|
404
|
-
className: styles$
|
|
407
|
+
className: styles$j.footer__bottomLeft
|
|
405
408
|
}, /*#__PURE__*/React.createElement("div", {
|
|
406
|
-
className: styles$
|
|
407
|
-
}, links.map(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
})), /*#__PURE__*/React.createElement("p", {
|
|
414
|
-
className: styles$k.footer__copyright
|
|
409
|
+
className: styles$j.footer__bottomLinks
|
|
410
|
+
}, links.map((link, index) => /*#__PURE__*/React.createElement(FooterLink, {
|
|
411
|
+
key: index,
|
|
412
|
+
item: link,
|
|
413
|
+
variant: "bottom"
|
|
414
|
+
}))), /*#__PURE__*/React.createElement("p", {
|
|
415
|
+
className: styles$j.footer__copyright
|
|
415
416
|
}, copyright)), countrySelector && /*#__PURE__*/React.createElement("a", {
|
|
416
417
|
href: countrySelector.href || '#',
|
|
417
|
-
className: styles$
|
|
418
|
+
className: styles$j.footer__countrySelector
|
|
418
419
|
}, countrySelector.showIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
419
|
-
className: styles$
|
|
420
|
+
className: styles$j.footer__countrySelectorIcon
|
|
420
421
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
421
422
|
icon: faGlobe
|
|
422
423
|
})), countrySelector.label));
|
|
423
424
|
};
|
|
425
|
+
|
|
424
426
|
// =============================================================================
|
|
425
427
|
// MAIN FOOTER COMPONENT
|
|
426
428
|
// =============================================================================
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* -
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Footer component with brand identity, navigation links, social icons, and legal information.
|
|
432
|
+
* Supports two layout variants:
|
|
433
|
+
* - desktop: Logo at top, 3-column main content
|
|
434
|
+
* - mobile: Logo at bottom, stacked layout with CTA button
|
|
432
435
|
*/
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
var LogoWrapper = logo.href ? 'a' : 'div';
|
|
454
|
-
var logoProps = logo.href ? {
|
|
436
|
+
const Footer = ({
|
|
437
|
+
variant = 'desktop',
|
|
438
|
+
logo,
|
|
439
|
+
motto,
|
|
440
|
+
atlasCopcoBadge,
|
|
441
|
+
quickLinks,
|
|
442
|
+
quickLinksHeading = 'Quick links',
|
|
443
|
+
contactLinks,
|
|
444
|
+
contactHeading = 'Contact us',
|
|
445
|
+
socialLinks,
|
|
446
|
+
contactFormButton,
|
|
447
|
+
bottomLinks,
|
|
448
|
+
copyright,
|
|
449
|
+
countrySelector,
|
|
450
|
+
className
|
|
451
|
+
}) => {
|
|
452
|
+
const isMobile = variant === 'mobile';
|
|
453
|
+
const footerClasses = classNames(styles$j.footer, isMobile && styles$j['footer--mobile'], className);
|
|
454
|
+
const LogoWrapper = logo.href ? 'a' : 'div';
|
|
455
|
+
const logoProps = logo.href ? {
|
|
455
456
|
href: logo.href,
|
|
456
|
-
className: styles$
|
|
457
|
+
className: styles$j.footer__logo
|
|
457
458
|
} : {
|
|
458
|
-
className: styles$
|
|
459
|
+
className: styles$j.footer__logo
|
|
459
460
|
};
|
|
461
|
+
|
|
460
462
|
// Logo + Motto + Badge component (used in both layouts)
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
};
|
|
463
|
+
const LogoSection = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LogoWrapper, logoProps, /*#__PURE__*/React.createElement("img", {
|
|
464
|
+
src: logo.src,
|
|
465
|
+
alt: logo.alt
|
|
466
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
467
|
+
className: styles$j.footer__leftCol
|
|
468
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
469
|
+
className: styles$j.footer__motto
|
|
470
|
+
}, motto), atlasCopcoBadge && /*#__PURE__*/React.createElement("div", {
|
|
471
|
+
className: styles$j.footer__badge
|
|
472
|
+
}, atlasCopcoBadge.showIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
473
|
+
className: styles$j.footer__badgeIcon
|
|
474
|
+
}, /*#__PURE__*/React.createElement(AtlasCopcoIcon, {
|
|
475
|
+
size: 14
|
|
476
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
477
|
+
className: styles$j.footer__badgeText
|
|
478
|
+
}, atlasCopcoBadge.text))));
|
|
479
|
+
|
|
479
480
|
// Mobile layout: Links at top, logo/motto at bottom
|
|
480
481
|
if (isMobile) {
|
|
481
482
|
return /*#__PURE__*/React.createElement("footer", {
|
|
482
483
|
className: footerClasses
|
|
483
484
|
}, /*#__PURE__*/React.createElement("div", {
|
|
484
|
-
className: styles$
|
|
485
|
+
className: styles$j.footer__container
|
|
485
486
|
}, /*#__PURE__*/React.createElement("div", {
|
|
486
|
-
className: styles$
|
|
487
|
+
className: styles$j.footer__links
|
|
487
488
|
}, /*#__PURE__*/React.createElement(FooterLinkGroup, {
|
|
488
489
|
heading: quickLinksHeading,
|
|
489
490
|
links: quickLinks
|
|
@@ -491,7 +492,7 @@ var Footer = function (_a) {
|
|
|
491
492
|
heading: contactHeading,
|
|
492
493
|
links: contactLinks
|
|
493
494
|
})), contactFormButton && /*#__PURE__*/React.createElement("div", {
|
|
494
|
-
className: styles$
|
|
495
|
+
className: styles$j.footer__cta
|
|
495
496
|
}, /*#__PURE__*/React.createElement("a", {
|
|
496
497
|
href: contactFormButton.href,
|
|
497
498
|
style: {
|
|
@@ -510,33 +511,34 @@ var Footer = function (_a) {
|
|
|
510
511
|
copyright: copyright,
|
|
511
512
|
countrySelector: countrySelector
|
|
512
513
|
}), /*#__PURE__*/React.createElement("div", {
|
|
513
|
-
className: styles$
|
|
514
|
+
className: styles$j.footer__brandSection
|
|
514
515
|
}, /*#__PURE__*/React.createElement(LogoSection, null))));
|
|
515
516
|
}
|
|
517
|
+
|
|
516
518
|
// Desktop layout: Logo at top, 3-column main content
|
|
517
519
|
return /*#__PURE__*/React.createElement("footer", {
|
|
518
520
|
className: footerClasses
|
|
519
521
|
}, /*#__PURE__*/React.createElement("div", {
|
|
520
|
-
className: styles$
|
|
522
|
+
className: styles$j.footer__container
|
|
521
523
|
}, /*#__PURE__*/React.createElement(LogoWrapper, logoProps, /*#__PURE__*/React.createElement("img", {
|
|
522
524
|
src: logo.src,
|
|
523
525
|
alt: logo.alt
|
|
524
526
|
})), /*#__PURE__*/React.createElement("div", {
|
|
525
|
-
className: styles$
|
|
527
|
+
className: styles$j.footer__main
|
|
526
528
|
}, /*#__PURE__*/React.createElement("div", {
|
|
527
|
-
className: styles$
|
|
529
|
+
className: styles$j.footer__leftCol
|
|
528
530
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
529
|
-
className: styles$
|
|
531
|
+
className: styles$j.footer__motto
|
|
530
532
|
}, motto), atlasCopcoBadge && /*#__PURE__*/React.createElement("div", {
|
|
531
|
-
className: styles$
|
|
533
|
+
className: styles$j.footer__badge
|
|
532
534
|
}, atlasCopcoBadge.showIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
533
|
-
className: styles$
|
|
535
|
+
className: styles$j.footer__badgeIcon
|
|
534
536
|
}, /*#__PURE__*/React.createElement(AtlasCopcoIcon, {
|
|
535
537
|
size: 14
|
|
536
538
|
})), /*#__PURE__*/React.createElement("span", {
|
|
537
|
-
className: styles$
|
|
539
|
+
className: styles$j.footer__badgeText
|
|
538
540
|
}, atlasCopcoBadge.text))), /*#__PURE__*/React.createElement("div", {
|
|
539
|
-
className: styles$
|
|
541
|
+
className: styles$j.footer__links
|
|
540
542
|
}, /*#__PURE__*/React.createElement(FooterLinkGroup, {
|
|
541
543
|
heading: quickLinksHeading,
|
|
542
544
|
links: quickLinks
|
|
@@ -552,46 +554,48 @@ var Footer = function (_a) {
|
|
|
552
554
|
})));
|
|
553
555
|
};
|
|
554
556
|
|
|
555
|
-
var styles$
|
|
557
|
+
var styles$i = {"pagination":"Pagination-module__pagination___Kih79","dividerLine":"Pagination-module__dividerLine___85LAX","paginationList":"Pagination-module__paginationList___-lZpm","paginationItem":"Pagination-module__paginationItem___VsGFa","pageButton":"Pagination-module__pageButton___b6UNF","pageButtonActive":"Pagination-module__pageButtonActive___D9m18","navButton":"Pagination-module__navButton___ZCIai","navButtonDisabled":"Pagination-module__navButtonDisabled___IZK8H","navIcon":"Pagination-module__navIcon___-BVJ3","ellipsis":"Pagination-module__ellipsis___iAsGN","ellipsisText":"Pagination-module__ellipsisText___fd6u1"};
|
|
556
558
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
559
|
+
const PaginationItem = ({
|
|
560
|
+
page,
|
|
561
|
+
isActive,
|
|
562
|
+
onClick,
|
|
563
|
+
className
|
|
564
|
+
}) => {
|
|
565
|
+
const handleClick = () => {
|
|
563
566
|
if (!isActive) {
|
|
564
567
|
onClick(page);
|
|
565
568
|
}
|
|
566
569
|
};
|
|
567
|
-
|
|
570
|
+
const handleKeyDown = event => {
|
|
568
571
|
if (event.key === "Enter" || event.key === " ") {
|
|
569
572
|
event.preventDefault();
|
|
570
573
|
handleClick();
|
|
571
574
|
}
|
|
572
575
|
};
|
|
573
576
|
return /*#__PURE__*/React.createElement("li", {
|
|
574
|
-
className: styles$
|
|
577
|
+
className: styles$i.paginationItem
|
|
575
578
|
}, /*#__PURE__*/React.createElement("button", {
|
|
576
579
|
type: "button",
|
|
577
580
|
onClick: handleClick,
|
|
578
581
|
onKeyDown: handleKeyDown,
|
|
579
|
-
className:
|
|
582
|
+
className: `${styles$i.pageButton} ${isActive ? styles$i.pageButtonActive : ""} ${className || ""}`,
|
|
580
583
|
"aria-current": isActive ? "page" : undefined,
|
|
581
|
-
"aria-label":
|
|
584
|
+
"aria-label": `Page ${page}`,
|
|
582
585
|
disabled: isActive,
|
|
583
586
|
tabIndex: isActive ? -1 : 0
|
|
584
587
|
}, page));
|
|
585
588
|
};
|
|
586
589
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
590
|
+
const PaginationButton = ({
|
|
591
|
+
label,
|
|
592
|
+
disabled,
|
|
593
|
+
onClick,
|
|
594
|
+
direction,
|
|
595
|
+
className,
|
|
596
|
+
ariaLabel
|
|
597
|
+
}) => {
|
|
598
|
+
const handleKeyDown = event => {
|
|
595
599
|
if (event.key === "Enter" || event.key === " ") {
|
|
596
600
|
event.preventDefault();
|
|
597
601
|
if (!disabled) {
|
|
@@ -600,130 +604,130 @@ var PaginationButton = function (_a) {
|
|
|
600
604
|
}
|
|
601
605
|
};
|
|
602
606
|
return /*#__PURE__*/React.createElement("li", {
|
|
603
|
-
className: styles$
|
|
607
|
+
className: styles$i.paginationItem
|
|
604
608
|
}, /*#__PURE__*/React.createElement("button", {
|
|
605
609
|
type: "button",
|
|
606
610
|
onClick: onClick,
|
|
607
611
|
onKeyDown: handleKeyDown,
|
|
608
612
|
disabled: disabled,
|
|
609
|
-
className:
|
|
613
|
+
className: `${styles$i.navButton} ${styles$i[`navButton--${direction}`]} ${disabled ? styles$i.navButtonDisabled : ""} ${className || ""}`,
|
|
610
614
|
"aria-label": ariaLabel || label,
|
|
611
615
|
tabIndex: disabled ? -1 : 0
|
|
612
616
|
}, /*#__PURE__*/React.createElement("span", null, label), direction === "next" && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
613
617
|
icon: faChevronRight$1,
|
|
614
|
-
className: styles$
|
|
618
|
+
className: styles$i.navIcon,
|
|
615
619
|
"aria-hidden": "true"
|
|
616
620
|
})));
|
|
617
621
|
};
|
|
618
622
|
|
|
619
|
-
|
|
620
|
-
|
|
623
|
+
const PaginationEllipsis = ({
|
|
624
|
+
className
|
|
625
|
+
}) => {
|
|
621
626
|
return /*#__PURE__*/React.createElement("li", {
|
|
622
|
-
className:
|
|
627
|
+
className: `${styles$i.paginationItem} ${styles$i.ellipsis}`,
|
|
623
628
|
"aria-hidden": "true"
|
|
624
629
|
}, /*#__PURE__*/React.createElement("span", {
|
|
625
|
-
className:
|
|
630
|
+
className: `${styles$i.ellipsisText} ${className || ""}`
|
|
626
631
|
}, "..."));
|
|
627
632
|
};
|
|
628
633
|
|
|
629
|
-
/**
|
|
630
|
-
* Generate page numbers to display with ellipsis logic
|
|
634
|
+
/**
|
|
635
|
+
* Generate page numbers to display with ellipsis logic
|
|
631
636
|
*/
|
|
632
|
-
|
|
637
|
+
const generatePageNumbers = (currentPage, totalPages, maxVisiblePages) => {
|
|
633
638
|
if (totalPages <= maxVisiblePages) {
|
|
634
639
|
return Array.from({
|
|
635
640
|
length: totalPages
|
|
636
|
-
},
|
|
637
|
-
return i + 1;
|
|
638
|
-
});
|
|
641
|
+
}, (_, i) => i + 1);
|
|
639
642
|
}
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
const pages = [];
|
|
644
|
+
const halfVisible = Math.floor(maxVisiblePages / 2);
|
|
645
|
+
|
|
642
646
|
// Always show first page
|
|
643
647
|
pages.push(1);
|
|
644
|
-
|
|
645
|
-
|
|
648
|
+
let startPage = Math.max(2, currentPage - halfVisible);
|
|
649
|
+
let endPage = Math.min(totalPages - 1, currentPage + halfVisible);
|
|
650
|
+
|
|
646
651
|
// Adjust if we're near the start
|
|
647
652
|
if (currentPage <= halfVisible + 1) {
|
|
648
653
|
endPage = Math.min(maxVisiblePages - 1, totalPages - 1);
|
|
649
654
|
startPage = 2;
|
|
650
655
|
}
|
|
656
|
+
|
|
651
657
|
// Adjust if we're near the end
|
|
652
658
|
if (currentPage >= totalPages - halfVisible) {
|
|
653
659
|
startPage = Math.max(2, totalPages - maxVisiblePages + 2);
|
|
654
660
|
endPage = totalPages - 1;
|
|
655
661
|
}
|
|
662
|
+
|
|
656
663
|
// Add ellipsis after first page if needed
|
|
657
664
|
if (startPage > 2) {
|
|
658
665
|
pages.push("ellipsis-start");
|
|
659
666
|
}
|
|
667
|
+
|
|
660
668
|
// Add middle pages
|
|
661
|
-
for (
|
|
669
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
662
670
|
pages.push(i);
|
|
663
671
|
}
|
|
672
|
+
|
|
664
673
|
// Add ellipsis before last page if needed
|
|
665
674
|
if (endPage < totalPages - 1) {
|
|
666
675
|
pages.push("ellipsis-end");
|
|
667
676
|
}
|
|
677
|
+
|
|
668
678
|
// Always show last page
|
|
669
679
|
if (totalPages > 1) {
|
|
670
680
|
pages.push(totalPages);
|
|
671
681
|
}
|
|
672
682
|
return pages;
|
|
673
683
|
};
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
className = _a.className,
|
|
689
|
-
_g = _a.ariaLabel,
|
|
690
|
-
ariaLabel = _g === void 0 ? "Pagination" : _g;
|
|
691
|
-
var pageNumbers = useMemo(function () {
|
|
692
|
-
return generatePageNumbers(currentPage, totalPages, maxVisiblePages);
|
|
693
|
-
}, [currentPage, totalPages, maxVisiblePages]);
|
|
694
|
-
var handlePageChange = function (page) {
|
|
684
|
+
const Pagination = ({
|
|
685
|
+
currentPage,
|
|
686
|
+
totalPages,
|
|
687
|
+
onPageChange,
|
|
688
|
+
maxVisiblePages = 10,
|
|
689
|
+
showPrevious = true,
|
|
690
|
+
showNext = true,
|
|
691
|
+
previousLabel = "Previous",
|
|
692
|
+
nextLabel = "Next",
|
|
693
|
+
className,
|
|
694
|
+
ariaLabel = "Pagination"
|
|
695
|
+
}) => {
|
|
696
|
+
const pageNumbers = useMemo(() => generatePageNumbers(currentPage, totalPages, maxVisiblePages), [currentPage, totalPages, maxVisiblePages]);
|
|
697
|
+
const handlePageChange = page => {
|
|
695
698
|
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
696
699
|
onPageChange(page);
|
|
697
700
|
}
|
|
698
701
|
};
|
|
699
|
-
|
|
702
|
+
const handlePrevious = () => {
|
|
700
703
|
handlePageChange(currentPage - 1);
|
|
701
704
|
};
|
|
702
|
-
|
|
705
|
+
const handleNext = () => {
|
|
703
706
|
handlePageChange(currentPage + 1);
|
|
704
707
|
};
|
|
708
|
+
|
|
705
709
|
// Don't render if there's only one page or no pages
|
|
706
710
|
if (totalPages <= 1) {
|
|
707
711
|
return null;
|
|
708
712
|
}
|
|
709
713
|
return /*#__PURE__*/React.createElement("nav", {
|
|
710
|
-
className:
|
|
714
|
+
className: `${styles$i.pagination} ${className || ""}`,
|
|
711
715
|
"aria-label": ariaLabel,
|
|
712
716
|
role: "navigation"
|
|
713
717
|
}, /*#__PURE__*/React.createElement("div", {
|
|
714
|
-
className: styles$
|
|
718
|
+
className: styles$i.dividerLine
|
|
715
719
|
}), /*#__PURE__*/React.createElement("ul", {
|
|
716
|
-
className: styles$
|
|
720
|
+
className: styles$i.paginationList
|
|
717
721
|
}, showPrevious && /*#__PURE__*/React.createElement(PaginationButton, {
|
|
718
722
|
label: previousLabel,
|
|
719
723
|
disabled: currentPage === 1,
|
|
720
724
|
onClick: handlePrevious,
|
|
721
725
|
direction: "previous",
|
|
722
726
|
ariaLabel: "Go to previous page"
|
|
723
|
-
}), pageNumbers.map(
|
|
727
|
+
}), pageNumbers.map((page, index) => {
|
|
724
728
|
if (page === "ellipsis-start" || page === "ellipsis-end") {
|
|
725
729
|
return /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
726
|
-
key:
|
|
730
|
+
key: `ellipsis-${index}`
|
|
727
731
|
});
|
|
728
732
|
}
|
|
729
733
|
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
@@ -741,88 +745,83 @@ var Pagination = function (_a) {
|
|
|
741
745
|
})));
|
|
742
746
|
};
|
|
743
747
|
|
|
744
|
-
var styles$
|
|
745
|
-
|
|
746
|
-
var styles$
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
sizes = _a.sizes;
|
|
771
|
-
var _h = useState(true),
|
|
772
|
-
isLoading = _h[0],
|
|
773
|
-
setIsLoading = _h[1];
|
|
774
|
-
var _j = useState(false),
|
|
775
|
-
hasError = _j[0],
|
|
776
|
-
setHasError = _j[1];
|
|
777
|
-
var _k = useState(src),
|
|
778
|
-
currentSrc = _k[0],
|
|
779
|
-
setCurrentSrc = _k[1];
|
|
780
|
-
var handleLoad = useCallback(function () {
|
|
748
|
+
var styles$h = {"productCard":"ProductCardHorizontal-module__productCard___Nl4jK","productWrapper":"ProductCardHorizontal-module__productWrapper___gs8fn","withImage":"ProductCardHorizontal-module__withImage___pPFw2","productTitle":"ProductCardHorizontal-module__productTitle___xBuu7","productPrice":"ProductCardHorizontal-module__productPrice___lf32A","productImage":"ProductCardHorizontal-module__productImage___sQsUO","productId":"ProductCardHorizontal-module__productId___3oOQV","productTitleDescriptionWrapper":"ProductCardHorizontal-module__productTitleDescriptionWrapper___Obv-j","productPriceCtaWrapper":"ProductCardHorizontal-module__productPriceCtaWrapper___Npkfl","productArrowIcon":"ProductCardHorizontal-module__productArrowIcon___1-A76"};
|
|
749
|
+
|
|
750
|
+
var styles$g = {"imageContainer":"Image-module__imageContainer___iD5Kd","loading":"Image-module__loading___Sh1zO","image":"Image-module__image___1pa50","error":"Image-module__error___0LGZ2","skeleton":"Image-module__skeleton___0bGS6","shimmer":"Image-module__shimmer___aanrl","errorState":"Image-module__errorState___TjV-8","errorIcon":"Image-module__errorIcon___QCKvj","errorText":"Image-module__errorText___Q8pnb"};
|
|
751
|
+
|
|
752
|
+
const Image = ({
|
|
753
|
+
src,
|
|
754
|
+
alt,
|
|
755
|
+
width,
|
|
756
|
+
height,
|
|
757
|
+
loading = "lazy",
|
|
758
|
+
decoding = "async",
|
|
759
|
+
objectFit = "cover",
|
|
760
|
+
objectPosition = "center",
|
|
761
|
+
aspectRatio,
|
|
762
|
+
isDecorative = false,
|
|
763
|
+
fallbackSrc,
|
|
764
|
+
onLoad,
|
|
765
|
+
onError,
|
|
766
|
+
className = "",
|
|
767
|
+
srcSet,
|
|
768
|
+
sizes
|
|
769
|
+
}) => {
|
|
770
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
771
|
+
const [hasError, setHasError] = useState(false);
|
|
772
|
+
const [currentSrc, setCurrentSrc] = useState(src);
|
|
773
|
+
const handleLoad = useCallback(() => {
|
|
781
774
|
setIsLoading(false);
|
|
782
775
|
setHasError(false);
|
|
783
|
-
onLoad
|
|
776
|
+
onLoad?.();
|
|
784
777
|
}, [onLoad]);
|
|
785
|
-
|
|
778
|
+
const handleError = useCallback(() => {
|
|
786
779
|
setIsLoading(false);
|
|
787
780
|
setHasError(true);
|
|
781
|
+
|
|
788
782
|
// Try fallback if available and not already using it
|
|
789
783
|
if (fallbackSrc && currentSrc !== fallbackSrc) {
|
|
790
784
|
setCurrentSrc(fallbackSrc);
|
|
791
785
|
setHasError(false);
|
|
792
786
|
setIsLoading(true);
|
|
793
787
|
} else {
|
|
794
|
-
onError
|
|
788
|
+
onError?.();
|
|
795
789
|
}
|
|
796
790
|
}, [fallbackSrc, currentSrc, onError]);
|
|
791
|
+
|
|
797
792
|
// Accessibility: decorative images should have empty alt and be hidden from screen readers
|
|
798
|
-
|
|
793
|
+
const accessibilityProps = isDecorative ? {
|
|
799
794
|
alt: "",
|
|
800
795
|
"aria-hidden": true,
|
|
801
796
|
role: "presentation"
|
|
802
797
|
} : {
|
|
803
|
-
alt
|
|
798
|
+
alt
|
|
804
799
|
};
|
|
805
|
-
|
|
806
|
-
aspectRatio
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
800
|
+
const containerStyle = {
|
|
801
|
+
...(aspectRatio && {
|
|
802
|
+
aspectRatio
|
|
803
|
+
}),
|
|
804
|
+
...(width && {
|
|
805
|
+
width: typeof width === "number" ? `${width}px` : width
|
|
806
|
+
}),
|
|
807
|
+
...(height && {
|
|
808
|
+
height: typeof height === "number" ? `${height}px` : height
|
|
809
|
+
})
|
|
810
|
+
};
|
|
811
|
+
const imageStyle = {
|
|
812
|
+
objectFit,
|
|
813
|
+
objectPosition
|
|
815
814
|
};
|
|
816
815
|
return /*#__PURE__*/React.createElement("div", {
|
|
817
|
-
className:
|
|
816
|
+
className: `${styles$g.imageContainer} ${className} ${isLoading ? styles$g.loading : ""} ${hasError ? styles$g.error : ""}`,
|
|
818
817
|
style: containerStyle
|
|
819
818
|
}, isLoading && /*#__PURE__*/React.createElement("div", {
|
|
820
|
-
className: styles$
|
|
819
|
+
className: styles$g.skeleton,
|
|
821
820
|
"aria-hidden": "true"
|
|
822
821
|
}, /*#__PURE__*/React.createElement("div", {
|
|
823
|
-
className: styles$
|
|
822
|
+
className: styles$g.shimmer
|
|
824
823
|
})), hasError && !fallbackSrc ? /*#__PURE__*/React.createElement("div", {
|
|
825
|
-
className: styles$
|
|
824
|
+
className: styles$g.errorState,
|
|
826
825
|
role: "img",
|
|
827
826
|
"aria-label": alt || "Image failed to load"
|
|
828
827
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
@@ -833,7 +832,7 @@ var Image = function (_a) {
|
|
|
833
832
|
strokeWidth: "1.5",
|
|
834
833
|
strokeLinecap: "round",
|
|
835
834
|
strokeLinejoin: "round",
|
|
836
|
-
className: styles$
|
|
835
|
+
className: styles$g.errorIcon,
|
|
837
836
|
"aria-hidden": "true"
|
|
838
837
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
839
838
|
x: "3",
|
|
@@ -849,7 +848,7 @@ var Image = function (_a) {
|
|
|
849
848
|
}), /*#__PURE__*/React.createElement("polyline", {
|
|
850
849
|
points: "21 15 16 10 5 21"
|
|
851
850
|
})), /*#__PURE__*/React.createElement("span", {
|
|
852
|
-
className: styles$
|
|
851
|
+
className: styles$g.errorText
|
|
853
852
|
}, "Image unavailable")) : /*#__PURE__*/React.createElement("img", _extends({
|
|
854
853
|
src: currentSrc
|
|
855
854
|
}, accessibilityProps, {
|
|
@@ -859,7 +858,7 @@ var Image = function (_a) {
|
|
|
859
858
|
decoding: decoding,
|
|
860
859
|
onLoad: handleLoad,
|
|
861
860
|
onError: handleError,
|
|
862
|
-
className: styles$
|
|
861
|
+
className: styles$g.image,
|
|
863
862
|
style: imageStyle,
|
|
864
863
|
srcSet: srcSet,
|
|
865
864
|
sizes: sizes
|
|
@@ -877,285 +876,144 @@ const faArrowUpRight = {
|
|
|
877
876
|
icon: [384, 512, [], "e09f", "M328 96c13.3 0 24 10.7 24 24l0 240c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-182.1L73 409c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l231-231L88 144c-13.3 0-24-10.7-24-24s10.7-24 24-24l240 0z"]
|
|
878
877
|
};
|
|
879
878
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
title = _a.title;
|
|
893
|
-
_a.description;
|
|
894
|
-
var price = _a.price,
|
|
895
|
-
productId = _a.productId,
|
|
896
|
-
button = _a.button,
|
|
897
|
-
utm = _a.utm,
|
|
898
|
-
_c = _a.className,
|
|
899
|
-
className = _c === void 0 ? "" : _c,
|
|
900
|
-
style = _a.style,
|
|
901
|
-
code = _a.code,
|
|
902
|
-
showProductPrice = _a.showProductPrice;
|
|
879
|
+
const ProductCardHorizontal = ({
|
|
880
|
+
id,
|
|
881
|
+
imageUrl,
|
|
882
|
+
url,
|
|
883
|
+
title,
|
|
884
|
+
description,
|
|
885
|
+
price,
|
|
886
|
+
productId,
|
|
887
|
+
button,
|
|
888
|
+
utm,
|
|
889
|
+
className = ""
|
|
890
|
+
}) => {
|
|
903
891
|
if (!title) {
|
|
904
892
|
return null;
|
|
905
893
|
}
|
|
906
|
-
|
|
907
|
-
showProductPrice: showProductPrice,
|
|
908
|
-
price: price
|
|
909
|
-
});
|
|
910
|
-
var hasPlaceholderImage = showProductImage && (!imageUrl || isPlaceholderImg(imageUrl));
|
|
911
|
-
var productImage = hasPlaceholderImage ? PLACEHOLDER_IMAGE_DATA_URI : imageUrl;
|
|
912
|
-
var href = !utm || url && url.indexOf("utm") > -1 ? url : url + "?utm_source=".concat(utm.utmSource, "&utm_medium=").concat(utm.utmMedium, "&utm_campaign=").concat(utm.utmCampaign);
|
|
894
|
+
const href = !utm || url && url.indexOf("utm") > -1 ? url : url + `?utm_source=${utm.utmSource}&utm_medium=${utm.utmMedium}&utm_campaign=${utm.utmCampaign}`;
|
|
913
895
|
return /*#__PURE__*/React.createElement("a", {
|
|
914
896
|
href: href,
|
|
915
|
-
className:
|
|
916
|
-
"aria-label":
|
|
897
|
+
className: `${styles$h.productCard} ${className}`,
|
|
898
|
+
"aria-label": `View product: ${title}`
|
|
917
899
|
}, /*#__PURE__*/React.createElement("div", {
|
|
918
|
-
className:
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
className: styles$i.productImage
|
|
900
|
+
className: `${styles$h.productWrapper} ${imageUrl ? styles$h.withImage : ""}`
|
|
901
|
+
}, imageUrl && /*#__PURE__*/React.createElement("div", {
|
|
902
|
+
className: styles$h.productImage
|
|
922
903
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
923
|
-
src:
|
|
924
|
-
alt: title
|
|
925
|
-
className: hasPlaceholderImage ? styles$i.placeholderImage : "",
|
|
926
|
-
objectFit: hasPlaceholderImage ? "contain" : "cover",
|
|
927
|
-
fallbackSrc: PLACEHOLDER_IMAGE_DATA_URI
|
|
904
|
+
src: imageUrl,
|
|
905
|
+
alt: title
|
|
928
906
|
})), /*#__PURE__*/React.createElement("div", {
|
|
929
|
-
className: styles$
|
|
907
|
+
className: styles$h.productTitleDescriptionWrapper
|
|
930
908
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
931
|
-
className: styles$
|
|
932
|
-
}, title), productId
|
|
933
|
-
className: styles$
|
|
934
|
-
}, productId
|
|
935
|
-
className: styles$
|
|
909
|
+
className: styles$h.productTitle
|
|
910
|
+
}, title), productId && /*#__PURE__*/React.createElement("p", {
|
|
911
|
+
className: styles$h.productId
|
|
912
|
+
}, productId)), /*#__PURE__*/React.createElement("div", {
|
|
913
|
+
className: styles$h.productPriceCtaWrapper
|
|
936
914
|
}, /*#__PURE__*/React.createElement("p", {
|
|
937
|
-
className: styles$
|
|
938
|
-
},
|
|
939
|
-
className: styles$
|
|
915
|
+
className: styles$h.productPrice
|
|
916
|
+
}, price || " "), button ? /*#__PURE__*/React.createElement(Button, {
|
|
917
|
+
className: styles$h.productButton,
|
|
940
918
|
onClick: button.onClick,
|
|
941
919
|
size: "extra-small"
|
|
942
920
|
}, button.label) : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
943
921
|
icon: faArrowUpRight,
|
|
944
|
-
className: styles$
|
|
922
|
+
className: styles$h.productArrowIcon,
|
|
945
923
|
"aria-hidden": "true"
|
|
946
924
|
}))));
|
|
947
925
|
};
|
|
926
|
+
|
|
948
927
|
// Alias for backward compatibility
|
|
949
|
-
|
|
928
|
+
const ProductCardHorizontalParts = ProductCardHorizontal;
|
|
950
929
|
|
|
951
|
-
var styles$
|
|
930
|
+
var styles$f = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l","spareCard":"ProductCardDetails-module__spareCard___vC1Ju"};
|
|
952
931
|
|
|
953
932
|
// Adapter to map design system props to ProductCardHorizontalParts props
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
933
|
+
const SpareCardAdapter = props => {
|
|
934
|
+
const {
|
|
935
|
+
spare,
|
|
936
|
+
...rest
|
|
937
|
+
} = props;
|
|
957
938
|
return /*#__PURE__*/React.createElement(ProductCardHorizontalParts, {
|
|
958
|
-
className: styles$
|
|
959
|
-
url:
|
|
960
|
-
title:
|
|
961
|
-
description:
|
|
962
|
-
price:
|
|
963
|
-
|
|
964
|
-
,
|
|
939
|
+
className: styles$f.spareCard,
|
|
940
|
+
url: spare?.url || spare?.link || "#",
|
|
941
|
+
title: spare?.name || spare?.title || "",
|
|
942
|
+
description: spare?.description || "",
|
|
943
|
+
price: spare?.priceValue || spare?.price || "",
|
|
944
|
+
imageUrl: spare?.["img-product"] || spare?.image || "",
|
|
965
945
|
utm: props.utm,
|
|
966
|
-
showProductPrice: props.showProductPrice,
|
|
967
|
-
showProductImage: false,
|
|
968
946
|
button: {
|
|
969
947
|
label: rest.cta || "View Product",
|
|
970
|
-
onClick:
|
|
971
|
-
return window.open((spare === null || spare === void 0 ? void 0 : spare.url) || (spare === null || spare === void 0 ? void 0 : spare.link) || "#", "_blank");
|
|
972
|
-
}
|
|
948
|
+
onClick: () => window.open(spare?.url || spare?.link || "#", "_blank")
|
|
973
949
|
}
|
|
974
950
|
});
|
|
975
951
|
};
|
|
952
|
+
|
|
976
953
|
// Re-export the design system component with Leybold styling
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
showProductPrice = _a.showProductPrice,
|
|
992
|
-
_c = _a.showProductImage,
|
|
993
|
-
showProductImage = _c === void 0 ? true : _c;
|
|
954
|
+
const ProductCardDetails = ({
|
|
955
|
+
id,
|
|
956
|
+
imageUrl,
|
|
957
|
+
title,
|
|
958
|
+
description,
|
|
959
|
+
price,
|
|
960
|
+
code,
|
|
961
|
+
facets,
|
|
962
|
+
hit,
|
|
963
|
+
utm,
|
|
964
|
+
className = "",
|
|
965
|
+
ProductCardComponent,
|
|
966
|
+
hidespares
|
|
967
|
+
}) => {
|
|
994
968
|
// Build the hit object expected by ProductDetailsCard
|
|
995
|
-
|
|
996
|
-
id
|
|
997
|
-
title
|
|
998
|
-
description
|
|
999
|
-
price
|
|
1000
|
-
code
|
|
969
|
+
const hitData = hit || {
|
|
970
|
+
id,
|
|
971
|
+
title,
|
|
972
|
+
description,
|
|
973
|
+
price,
|
|
974
|
+
code,
|
|
1001
975
|
image: imageUrl
|
|
1002
976
|
};
|
|
1003
977
|
return /*#__PURE__*/React.createElement("div", {
|
|
1004
|
-
className: styles$
|
|
978
|
+
className: styles$f.productDetails
|
|
1005
979
|
}, /*#__PURE__*/React.createElement(ProductDetailsCard, {
|
|
1006
|
-
className:
|
|
980
|
+
className: `${className}`,
|
|
1007
981
|
title: title,
|
|
1008
|
-
imageUrl:
|
|
982
|
+
imageUrl: imageUrl,
|
|
1009
983
|
imageAlt: title,
|
|
1010
984
|
hit: hitData,
|
|
1011
985
|
utm: utm,
|
|
1012
986
|
facets: facets,
|
|
1013
987
|
usePlainClasses: true,
|
|
1014
988
|
ProductCardComponent: ProductCardComponent || SpareCardAdapter,
|
|
1015
|
-
hidespares: hidespares
|
|
1016
|
-
showProductPrice: showProductPrice,
|
|
1017
|
-
showProductImage: showProductImage
|
|
989
|
+
hidespares: hidespares
|
|
1018
990
|
}));
|
|
1019
991
|
};
|
|
1020
992
|
|
|
1021
|
-
var ContentCardBase = function (_a) {
|
|
1022
|
-
var title = _a.title,
|
|
1023
|
-
variant = _a.variant,
|
|
1024
|
-
url = _a.url,
|
|
1025
|
-
imageUrl = _a.imageUrl,
|
|
1026
|
-
category = _a.category,
|
|
1027
|
-
meta = _a.meta,
|
|
1028
|
-
excerpt = _a.excerpt,
|
|
1029
|
-
_b = _a.className,
|
|
1030
|
-
className = _b === void 0 ? "" : _b,
|
|
1031
|
-
style = _a.style,
|
|
1032
|
-
ariaLabel = _a.ariaLabel,
|
|
1033
|
-
contentMetaClassName = _a.contentMetaClassName,
|
|
1034
|
-
contentCategoryClassName = _a.contentCategoryClassName,
|
|
1035
|
-
contentMetaTextClassName = _a.contentMetaTextClassName,
|
|
1036
|
-
contentTitleClassName = _a.contentTitleClassName,
|
|
1037
|
-
contentExcerptClassName = _a.contentExcerptClassName;
|
|
1038
|
-
console.log("variant in ContentCardBase:", variant);
|
|
1039
|
-
var fallbackImage = "/assets/list-card.png";
|
|
1040
|
-
var isCareerView = variant === "career-view";
|
|
1041
|
-
var defaultAriaLabel = isCareerView ? "View career opportunity: ".concat(title) : "View content: ".concat(title);
|
|
1042
|
-
return /*#__PURE__*/React.createElement("a", {
|
|
1043
|
-
href: url,
|
|
1044
|
-
className: className,
|
|
1045
|
-
style: style,
|
|
1046
|
-
"aria-label": ariaLabel || defaultAriaLabel
|
|
1047
|
-
}, imageUrl && /*#__PURE__*/React.createElement("div", {
|
|
1048
|
-
className: "content-card-image-wrapper"
|
|
1049
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
1050
|
-
src: imageUrl,
|
|
1051
|
-
alt: title,
|
|
1052
|
-
className: "content-card-image",
|
|
1053
|
-
aspectRatio: "16 / 9",
|
|
1054
|
-
loading: "lazy",
|
|
1055
|
-
decoding: "async",
|
|
1056
|
-
fallbackSrc: fallbackImage
|
|
1057
|
-
})), isCareerView ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
1058
|
-
className: contentTitleClassName
|
|
1059
|
-
}, title), category && /*#__PURE__*/React.createElement("span", {
|
|
1060
|
-
className: contentCategoryClassName
|
|
1061
|
-
}, category), meta && /*#__PURE__*/React.createElement("span", {
|
|
1062
|
-
className: contentMetaTextClassName
|
|
1063
|
-
}, meta), /*#__PURE__*/React.createElement(Button, {
|
|
1064
|
-
"aria-label": ariaLabel || defaultAriaLabel,
|
|
1065
|
-
variant: "link-text-alt",
|
|
1066
|
-
className: "career-button"
|
|
1067
|
-
}, "See more")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1068
|
-
className: contentMetaClassName
|
|
1069
|
-
}, category && /*#__PURE__*/React.createElement("span", {
|
|
1070
|
-
className: contentCategoryClassName
|
|
1071
|
-
}, category), meta && /*#__PURE__*/React.createElement("span", {
|
|
1072
|
-
className: contentMetaTextClassName
|
|
1073
|
-
}, meta)), /*#__PURE__*/React.createElement("h3", {
|
|
1074
|
-
className: contentTitleClassName
|
|
1075
|
-
}, title), excerpt && /*#__PURE__*/React.createElement("p", {
|
|
1076
|
-
className: contentExcerptClassName
|
|
1077
|
-
}, excerpt), /*#__PURE__*/React.createElement(Button, {
|
|
1078
|
-
"aria-label": ariaLabel || defaultAriaLabel
|
|
1079
|
-
}, "Read More")));
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
var styles$f = {"contentCard":"ContentCardVertical-module__contentCard___EoYej","contentCard--instant-view":"ContentCardVertical-module__contentCard--instant-view___dsIUf","contentCard--results-view":"ContentCardVertical-module__contentCard--results-view___6mSHQ","contentMeta":"ContentCardVertical-module__contentMeta___l2GtO","contentCategory":"ContentCardVertical-module__contentCategory___78vrj","contentMetaText":"ContentCardVertical-module__contentMetaText___Rl-ln","contentTitle":"ContentCardVertical-module__contentTitle___rEiHm","contentExcerpt":"ContentCardVertical-module__contentExcerpt___5Gb2G"};
|
|
1083
|
-
|
|
1084
|
-
var ContentCardVertical = function (_a) {
|
|
1085
|
-
var id = _a.id,
|
|
1086
|
-
title = _a.title,
|
|
1087
|
-
url = _a.url,
|
|
1088
|
-
imageUrl = _a.imageUrl,
|
|
1089
|
-
category = _a.category,
|
|
1090
|
-
meta = _a.meta,
|
|
1091
|
-
excerpt = _a.excerpt,
|
|
1092
|
-
_b = _a.className,
|
|
1093
|
-
className = _b === void 0 ? "" : _b,
|
|
1094
|
-
variant = _a.variant;
|
|
1095
|
-
var cardClasses = classNames(styles$f.contentCard, styles$f["contentCard--".concat(variant)], className);
|
|
1096
|
-
console.log("Rendering ContentCardVertical with variant:", variant);
|
|
1097
|
-
return /*#__PURE__*/React.createElement(ContentCardBase, {
|
|
1098
|
-
id: id,
|
|
1099
|
-
variant: variant,
|
|
1100
|
-
title: title,
|
|
1101
|
-
url: url,
|
|
1102
|
-
imageUrl: imageUrl,
|
|
1103
|
-
category: category,
|
|
1104
|
-
meta: meta,
|
|
1105
|
-
excerpt: excerpt,
|
|
1106
|
-
className: cardClasses,
|
|
1107
|
-
contentMetaClassName: styles$f.contentMeta,
|
|
1108
|
-
contentCategoryClassName: styles$f.contentCategory,
|
|
1109
|
-
contentMetaTextClassName: styles$f.contentMetaText,
|
|
1110
|
-
contentTitleClassName: styles$f.contentTitle,
|
|
1111
|
-
contentExcerptClassName: styles$f.contentExcerpt
|
|
1112
|
-
});
|
|
1113
|
-
};
|
|
1114
|
-
|
|
1115
993
|
// Adapter component that maps props from AlgoliaDynamicSearchRaw to ProductCardHorizontal
|
|
1116
994
|
// AlgoliaDynamicSearchRaw passes: title, cardLink, productPrice, cta, hit (original data)
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
url: cardLink || (hit === null || hit === void 0 ? void 0 : hit.link) || "#",
|
|
1131
|
-
imageUrl: (hit === null || hit === void 0 ? void 0 : hit.image) || "",
|
|
1132
|
-
category: (hit === null || hit === void 0 ? void 0 : hit.category) || "",
|
|
1133
|
-
meta: showProductPrice ? productPrice || (hit === null || hit === void 0 ? void 0 : hit.price) || "" : "",
|
|
1134
|
-
excerpt: (hit === null || hit === void 0 ? void 0 : hit.description) || "",
|
|
1135
|
-
className: className
|
|
1136
|
-
});
|
|
1137
|
-
};
|
|
1138
|
-
var ProductCardAdapter = function (props) {
|
|
1139
|
-
var hit = props.hit,
|
|
1140
|
-
title = props.title,
|
|
1141
|
-
cardLink = props.cardLink,
|
|
1142
|
-
productPrice = props.productPrice,
|
|
1143
|
-
cta = props.cta,
|
|
1144
|
-
showProductPrice = props.showProductPrice,
|
|
1145
|
-
showProductImage = props.showProductImage,
|
|
1146
|
-
className = props.className,
|
|
1147
|
-
code = props.code,
|
|
1148
|
-
utm = props.utm;
|
|
995
|
+
const ProductCardAdapter = props => {
|
|
996
|
+
const {
|
|
997
|
+
hit,
|
|
998
|
+
title,
|
|
999
|
+
cardLink,
|
|
1000
|
+
productPrice,
|
|
1001
|
+
cta,
|
|
1002
|
+
showProductPrice,
|
|
1003
|
+
className,
|
|
1004
|
+
code,
|
|
1005
|
+
utm
|
|
1006
|
+
} = props;
|
|
1007
|
+
console.log(props);
|
|
1149
1008
|
// Get values from direct props or fallback to hit object
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1009
|
+
const url = cardLink || hit?.link || "#";
|
|
1010
|
+
const imageUrl = "";
|
|
1011
|
+
const price = showProductPrice ? productPrice || hit?.price || "" : "";
|
|
1012
|
+
const productTitle = title || hit?.title || "";
|
|
1013
|
+
const productCode = code || hit?.code || "";
|
|
1014
|
+
const buttonLabel = cta || "View Product";
|
|
1156
1015
|
return /*#__PURE__*/React.createElement(ProductCardHorizontalParts, {
|
|
1157
1016
|
imageUrl: imageUrl,
|
|
1158
|
-
showProductImage: showProductImage,
|
|
1159
1017
|
url: url,
|
|
1160
1018
|
utm: utm,
|
|
1161
1019
|
title: productTitle,
|
|
@@ -1163,99 +1021,69 @@ var ProductCardAdapter = function (props) {
|
|
|
1163
1021
|
price: price,
|
|
1164
1022
|
button: {
|
|
1165
1023
|
label: buttonLabel,
|
|
1166
|
-
onClick:
|
|
1167
|
-
return window.open(url, "_blank");
|
|
1168
|
-
}
|
|
1024
|
+
onClick: () => window.open(url, "_blank")
|
|
1169
1025
|
},
|
|
1170
|
-
className: className
|
|
1171
|
-
style: __assign({}, showProductImage ? {
|
|
1172
|
-
minHeight: "130px"
|
|
1173
|
-
} : {}),
|
|
1174
|
-
code: productCode,
|
|
1175
|
-
showProductPrice: showProductPrice
|
|
1026
|
+
className: className
|
|
1176
1027
|
});
|
|
1177
1028
|
};
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
className
|
|
1187
|
-
code
|
|
1188
|
-
utm
|
|
1189
|
-
facets
|
|
1190
|
-
related_products
|
|
1191
|
-
hidespares
|
|
1029
|
+
const ProductCardDetailsAdapter = props => {
|
|
1030
|
+
const {
|
|
1031
|
+
hit,
|
|
1032
|
+
title,
|
|
1033
|
+
cardLink,
|
|
1034
|
+
productPrice,
|
|
1035
|
+
cta,
|
|
1036
|
+
showProductPrice,
|
|
1037
|
+
className,
|
|
1038
|
+
code,
|
|
1039
|
+
utm,
|
|
1040
|
+
facets,
|
|
1041
|
+
related_products,
|
|
1042
|
+
hidespares
|
|
1043
|
+
} = props;
|
|
1192
1044
|
if (!title) {
|
|
1193
1045
|
return null;
|
|
1194
1046
|
}
|
|
1195
1047
|
return /*#__PURE__*/React.createElement(ProductCardDetails, {
|
|
1196
|
-
imageUrl:
|
|
1048
|
+
imageUrl: hit?.image || "",
|
|
1197
1049
|
title: title,
|
|
1198
|
-
description:
|
|
1199
|
-
price:
|
|
1200
|
-
code:
|
|
1050
|
+
description: hit?.description || "",
|
|
1051
|
+
price: hit?.price || "" || productPrice,
|
|
1052
|
+
code: hit?.code || "" || code,
|
|
1201
1053
|
hit: hit,
|
|
1202
1054
|
utm: utm,
|
|
1203
1055
|
className: className,
|
|
1204
1056
|
facets: facets,
|
|
1205
|
-
relatedProducts:
|
|
1206
|
-
hidespares: hidespares
|
|
1207
|
-
showProductPrice: showProductPrice,
|
|
1208
|
-
showProductImage: showProductImage
|
|
1057
|
+
relatedProducts: hit?.related_products || related_products,
|
|
1058
|
+
hidespares: hidespares
|
|
1209
1059
|
});
|
|
1210
1060
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
1216
|
-
className: className,
|
|
1217
|
-
onClick: onClick
|
|
1218
|
-
}, label);
|
|
1219
|
-
};
|
|
1220
|
-
var AlgoliaDynamicSearchLeybold = function (props) {
|
|
1221
|
-
var parentComponentProps = {
|
|
1222
|
-
queryType: props === null || props === void 0 ? void 0 : props.queryType,
|
|
1223
|
-
showProductPrice: props === null || props === void 0 ? void 0 : props.showProductPrice,
|
|
1224
|
-
showProductImage: props === null || props === void 0 ? void 0 : props.showProductImage,
|
|
1225
|
-
hitCta: props === null || props === void 0 ? void 0 : props.hitCta,
|
|
1226
|
-
hidespares: props === null || props === void 0 ? void 0 : props.hidespares
|
|
1227
|
-
};
|
|
1228
|
-
var innerComponents = {
|
|
1229
|
-
Card: function (innerProps) {
|
|
1230
|
-
return cardAdapter(__assign(__assign({}, parentComponentProps), innerProps));
|
|
1231
|
-
},
|
|
1232
|
-
ProductCard: function (innerProps) {
|
|
1233
|
-
return ProductCardAdapter(__assign(__assign({}, parentComponentProps), innerProps));
|
|
1234
|
-
},
|
|
1235
|
-
ProductDetailsCard: function (innerProps) {
|
|
1236
|
-
return ProductCardDetailsAdapter(__assign(__assign({}, parentComponentProps), innerProps));
|
|
1237
|
-
},
|
|
1238
|
-
Button: ButtonAdapter
|
|
1061
|
+
const AlgoliaDynamicSearchLeybold = props => {
|
|
1062
|
+
const innerComponents = {
|
|
1063
|
+
ProductCard: ProductCardAdapter,
|
|
1064
|
+
ProductDetailsCard: ProductCardDetailsAdapter
|
|
1239
1065
|
};
|
|
1240
1066
|
return /*#__PURE__*/React.createElement(AlgoliaDynamicSearchRaw, _extends({}, props, {
|
|
1241
1067
|
innerComponents: innerComponents
|
|
1242
1068
|
}));
|
|
1243
1069
|
};
|
|
1244
1070
|
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1071
|
+
// Adapter to map QrForm's expected button props to our Button component
|
|
1072
|
+
|
|
1073
|
+
const QrFormButtonAdapter = ({
|
|
1074
|
+
label,
|
|
1075
|
+
onClick,
|
|
1076
|
+
buttonStyle = "primary",
|
|
1077
|
+
href,
|
|
1078
|
+
target,
|
|
1079
|
+
type = "button",
|
|
1080
|
+
element,
|
|
1081
|
+
"data-page_target": pageTarget,
|
|
1082
|
+
className
|
|
1083
|
+
}) => {
|
|
1257
1084
|
// Map buttonStyle to our variant
|
|
1258
|
-
|
|
1085
|
+
const variant = buttonStyle === "secondary" ? "secondary" : "primary";
|
|
1086
|
+
|
|
1259
1087
|
// If it's an anchor element (has href or element='a'), render as link
|
|
1260
1088
|
if (element === "a" || href) {
|
|
1261
1089
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -1274,19 +1102,18 @@ var QrFormButtonAdapter = function (_a) {
|
|
|
1274
1102
|
size: "small"
|
|
1275
1103
|
}, label));
|
|
1276
1104
|
}
|
|
1105
|
+
|
|
1277
1106
|
// Otherwise render as button
|
|
1278
1107
|
return /*#__PURE__*/React.createElement(Button, {
|
|
1279
1108
|
variant: variant,
|
|
1280
1109
|
type: type,
|
|
1281
|
-
onClick: onClick ?
|
|
1282
|
-
return onClick(e);
|
|
1283
|
-
} : undefined,
|
|
1110
|
+
onClick: onClick ? e => onClick(e) : undefined,
|
|
1284
1111
|
className: className,
|
|
1285
1112
|
"data-page_target": pageTarget,
|
|
1286
1113
|
size: "small"
|
|
1287
1114
|
}, label);
|
|
1288
1115
|
};
|
|
1289
|
-
|
|
1116
|
+
const QrFormLeybold = props => {
|
|
1290
1117
|
return /*#__PURE__*/React.createElement("div", {
|
|
1291
1118
|
className: "qr-journey-form-wrapper"
|
|
1292
1119
|
}, /*#__PURE__*/React.createElement(QrForm, _extends({}, props, {
|
|
@@ -1296,17 +1123,16 @@ var QrFormLeybold = function (props) {
|
|
|
1296
1123
|
|
|
1297
1124
|
var styles$e = {"overlay":"SearchModal-module__overlay___Vbvg9","modal":"SearchModal-module__modal___1k5gO","closeButton":"SearchModal-module__closeButton___AN0zt","closeButton__icon":"SearchModal-module__closeButton__icon___vISSw","closeButton__text":"SearchModal-module__closeButton__text___-4EH1","closeButtonDesktop":"SearchModal-module__closeButtonDesktop___Lxxb0","closeButtonMobile":"SearchModal-module__closeButtonMobile___WIIMS","stickyHeader":"SearchModal-module__stickyHeader___wp-gA","scrollableContent":"SearchModal-module__scrollableContent___lrZP3"};
|
|
1298
1125
|
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
className = _c === void 0 ? '' : _c;
|
|
1126
|
+
const ModalCloseButton = ({
|
|
1127
|
+
onClick,
|
|
1128
|
+
ariaLabel = 'Close search',
|
|
1129
|
+
className = ''
|
|
1130
|
+
}) => {
|
|
1305
1131
|
return /*#__PURE__*/React.createElement("button", {
|
|
1306
1132
|
type: "button",
|
|
1307
1133
|
onClick: onClick,
|
|
1308
1134
|
"aria-label": ariaLabel,
|
|
1309
|
-
className:
|
|
1135
|
+
className: `${styles$e.closeButton} ${className}`
|
|
1310
1136
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1311
1137
|
className: styles$e.closeButton__icon
|
|
1312
1138
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
@@ -1333,80 +1159,79 @@ var ModalCloseButton = function (_a) {
|
|
|
1333
1159
|
}, "CLOSE X"));
|
|
1334
1160
|
};
|
|
1335
1161
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
useEffect(function () {
|
|
1162
|
+
const SearchModal = ({
|
|
1163
|
+
isOpen,
|
|
1164
|
+
onClose,
|
|
1165
|
+
title = 'Search',
|
|
1166
|
+
children,
|
|
1167
|
+
className = '',
|
|
1168
|
+
stickyHeaderContent
|
|
1169
|
+
}) => {
|
|
1170
|
+
const modalRef = useRef(null);
|
|
1171
|
+
const previouslyFocusedElement = useRef(null);
|
|
1172
|
+
useEffect(() => {
|
|
1348
1173
|
if (isOpen) {
|
|
1349
1174
|
// Store the previously focused element
|
|
1350
1175
|
previouslyFocusedElement.current = document.activeElement;
|
|
1176
|
+
|
|
1351
1177
|
// Focus the modal
|
|
1352
1178
|
if (modalRef.current) {
|
|
1353
1179
|
modalRef.current.focus();
|
|
1354
1180
|
}
|
|
1181
|
+
|
|
1355
1182
|
// Prevent body scroll
|
|
1356
1183
|
document.body.style.overflow = 'hidden';
|
|
1357
1184
|
} else {
|
|
1358
1185
|
// Restore body scroll
|
|
1359
1186
|
document.body.style.overflow = '';
|
|
1187
|
+
|
|
1360
1188
|
// Return focus to previously focused element
|
|
1361
1189
|
if (previouslyFocusedElement.current) {
|
|
1362
1190
|
previouslyFocusedElement.current.focus();
|
|
1363
1191
|
}
|
|
1364
1192
|
}
|
|
1365
|
-
return
|
|
1193
|
+
return () => {
|
|
1366
1194
|
document.body.style.overflow = '';
|
|
1367
1195
|
};
|
|
1368
1196
|
}, [isOpen]);
|
|
1369
|
-
useEffect(
|
|
1370
|
-
|
|
1197
|
+
useEffect(() => {
|
|
1198
|
+
const handleEscape = event => {
|
|
1371
1199
|
if (event.key === 'Escape' && isOpen) {
|
|
1372
1200
|
onClose();
|
|
1373
1201
|
}
|
|
1374
1202
|
};
|
|
1375
1203
|
document.addEventListener('keydown', handleEscape);
|
|
1376
|
-
return
|
|
1377
|
-
return document.removeEventListener('keydown', handleEscape);
|
|
1378
|
-
};
|
|
1204
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
1379
1205
|
}, [isOpen, onClose]);
|
|
1206
|
+
|
|
1380
1207
|
// Focus trap implementation
|
|
1381
|
-
useEffect(
|
|
1208
|
+
useEffect(() => {
|
|
1382
1209
|
if (!isOpen || !modalRef.current) return;
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1210
|
+
const modal = modalRef.current;
|
|
1211
|
+
const focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1212
|
+
const firstElement = focusableElements[0];
|
|
1213
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
1214
|
+
const handleTab = event => {
|
|
1388
1215
|
if (event.key !== 'Tab') return;
|
|
1389
1216
|
if (event.shiftKey) {
|
|
1390
1217
|
// Shift + Tab
|
|
1391
1218
|
if (document.activeElement === firstElement) {
|
|
1392
1219
|
event.preventDefault();
|
|
1393
|
-
lastElement
|
|
1220
|
+
lastElement?.focus();
|
|
1394
1221
|
}
|
|
1395
1222
|
} else {
|
|
1396
1223
|
// Tab
|
|
1397
1224
|
if (document.activeElement === lastElement) {
|
|
1398
1225
|
event.preventDefault();
|
|
1399
|
-
firstElement
|
|
1226
|
+
firstElement?.focus();
|
|
1400
1227
|
}
|
|
1401
1228
|
}
|
|
1402
1229
|
};
|
|
1403
1230
|
modal.addEventListener('keydown', handleTab);
|
|
1404
|
-
return
|
|
1405
|
-
return modal.removeEventListener('keydown', handleTab);
|
|
1406
|
-
};
|
|
1231
|
+
return () => modal.removeEventListener('keydown', handleTab);
|
|
1407
1232
|
}, [isOpen]);
|
|
1408
1233
|
if (!isOpen) return null;
|
|
1409
|
-
|
|
1234
|
+
const handleOverlayClick = event => {
|
|
1410
1235
|
if (event.target === event.currentTarget) {
|
|
1411
1236
|
onClose();
|
|
1412
1237
|
}
|
|
@@ -1421,7 +1246,7 @@ var SearchModal = function (_a) {
|
|
|
1421
1246
|
"aria-modal": "true",
|
|
1422
1247
|
"aria-label": title,
|
|
1423
1248
|
tabIndex: -1,
|
|
1424
|
-
className:
|
|
1249
|
+
className: `${styles$e.modal} ${className}`
|
|
1425
1250
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1426
1251
|
className: styles$e.stickyHeader
|
|
1427
1252
|
}, /*#__PURE__*/React.createElement(ModalCloseButton, {
|
|
@@ -1437,11 +1262,11 @@ var SearchModal = function (_a) {
|
|
|
1437
1262
|
|
|
1438
1263
|
var styles$d = {"searchBar":"SearchBar-module__searchBar___5ak1g","inputWrapper":"SearchBar-module__inputWrapper___-4wrM","searchIcon":"SearchBar-module__searchIcon___VAuDz","searchInput":"SearchBar-module__searchInput___1K4GN","clearButton":"SearchBar-module__clearButton___JQYg-","submitButton":"SearchBar-module__submitButton___DZWsQ","submitButton__text":"SearchBar-module__submitButton__text___WkUsL","submitButton__icon":"SearchBar-module__submitButton__icon___s-ltv"};
|
|
1439
1264
|
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1265
|
+
const SearchIcon = ({
|
|
1266
|
+
className = ''
|
|
1267
|
+
}) => {
|
|
1443
1268
|
return /*#__PURE__*/React.createElement("svg", {
|
|
1444
|
-
className:
|
|
1269
|
+
className: `${styles$d.searchIcon} ${className}`,
|
|
1445
1270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1446
1271
|
viewBox: "0 0 24 24",
|
|
1447
1272
|
fill: "none",
|
|
@@ -1459,17 +1284,15 @@ var SearchIcon = function (_a) {
|
|
|
1459
1284
|
}));
|
|
1460
1285
|
};
|
|
1461
1286
|
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
className = _d === void 0 ? '' : _d;
|
|
1472
|
-
var handleChange = function (event) {
|
|
1287
|
+
const SearchInput = ({
|
|
1288
|
+
value,
|
|
1289
|
+
onChange,
|
|
1290
|
+
onKeyDown,
|
|
1291
|
+
placeholder = 'Discover products, innovations, and resources...',
|
|
1292
|
+
autoFocus = false,
|
|
1293
|
+
className = ''
|
|
1294
|
+
}) => {
|
|
1295
|
+
const handleChange = event => {
|
|
1473
1296
|
onChange(event.target.value);
|
|
1474
1297
|
};
|
|
1475
1298
|
return /*#__PURE__*/React.createElement("input", {
|
|
@@ -1480,27 +1303,24 @@ var SearchInput = function (_a) {
|
|
|
1480
1303
|
placeholder: placeholder,
|
|
1481
1304
|
autoFocus: autoFocus,
|
|
1482
1305
|
"aria-label": "Search",
|
|
1483
|
-
className:
|
|
1306
|
+
className: `${styles$d.searchInput} ${className}`
|
|
1484
1307
|
});
|
|
1485
1308
|
};
|
|
1486
1309
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
_a.variant;
|
|
1496
|
-
var _f = _a.className,
|
|
1497
|
-
className = _f === void 0 ? '' : _f;
|
|
1310
|
+
const SearchSubmitButton = ({
|
|
1311
|
+
onClick,
|
|
1312
|
+
disabled = false,
|
|
1313
|
+
ariaLabel = 'Search',
|
|
1314
|
+
label = 'Search',
|
|
1315
|
+
variant = 'instant',
|
|
1316
|
+
className = ''
|
|
1317
|
+
}) => {
|
|
1498
1318
|
return /*#__PURE__*/React.createElement("button", {
|
|
1499
1319
|
type: "submit",
|
|
1500
1320
|
onClick: onClick,
|
|
1501
1321
|
disabled: disabled,
|
|
1502
1322
|
"aria-label": ariaLabel,
|
|
1503
|
-
className:
|
|
1323
|
+
className: `${styles$d.submitButton} ${className}`
|
|
1504
1324
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1505
1325
|
className: styles$d.submitButton__text
|
|
1506
1326
|
}, label), /*#__PURE__*/React.createElement("span", {
|
|
@@ -1508,34 +1328,32 @@ var SearchSubmitButton = function (_a) {
|
|
|
1508
1328
|
}, /*#__PURE__*/React.createElement(SearchIcon, null)));
|
|
1509
1329
|
};
|
|
1510
1330
|
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
variant = _d === void 0 ? 'instant' : _d;
|
|
1522
|
-
var handleSubmit = function (event) {
|
|
1331
|
+
const SearchBar = ({
|
|
1332
|
+
value,
|
|
1333
|
+
onChange,
|
|
1334
|
+
onSubmit,
|
|
1335
|
+
placeholder,
|
|
1336
|
+
autoFocus = false,
|
|
1337
|
+
className = '',
|
|
1338
|
+
variant = 'instant'
|
|
1339
|
+
}) => {
|
|
1340
|
+
const handleSubmit = event => {
|
|
1523
1341
|
event.preventDefault();
|
|
1524
1342
|
onSubmit();
|
|
1525
1343
|
};
|
|
1526
|
-
|
|
1344
|
+
const handleKeyDown = event => {
|
|
1527
1345
|
if (event.key === 'Enter') {
|
|
1528
1346
|
event.preventDefault();
|
|
1529
1347
|
onSubmit();
|
|
1530
1348
|
}
|
|
1531
1349
|
};
|
|
1532
|
-
|
|
1350
|
+
const handleClear = () => {
|
|
1533
1351
|
onChange('');
|
|
1534
1352
|
};
|
|
1535
|
-
|
|
1353
|
+
const showClearButton = value.length > 0;
|
|
1536
1354
|
return /*#__PURE__*/React.createElement("form", {
|
|
1537
1355
|
onSubmit: handleSubmit,
|
|
1538
|
-
className:
|
|
1356
|
+
className: `${styles$d.searchBar} ${className}`
|
|
1539
1357
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1540
1358
|
className: styles$d.inputWrapper
|
|
1541
1359
|
}, /*#__PURE__*/React.createElement(SearchIcon, null), /*#__PURE__*/React.createElement(SearchInput, {
|
|
@@ -1558,51 +1376,53 @@ var SearchBar = function (_a) {
|
|
|
1558
1376
|
|
|
1559
1377
|
var styles$c = {"contentCard":"ContentCardHorizontal-module__contentCard___l-Kim","contentCard--instant-view":"ContentCardHorizontal-module__contentCard--instant-view___4wK9-","contentExcerpt":"ContentCardHorizontal-module__contentExcerpt___tqg1v","contentCard--results-view":"ContentCardHorizontal-module__contentCard--results-view___oBP2u","contentMeta":"ContentCardHorizontal-module__contentMeta___rEW-X","contentCategory":"ContentCardHorizontal-module__contentCategory___NssVD","contentMetaText":"ContentCardHorizontal-module__contentMetaText___muYBN","contentTitle":"ContentCardHorizontal-module__contentTitle___54gEo"};
|
|
1560
1378
|
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
id: id,
|
|
1575
|
-
title: title,
|
|
1576
|
-
url: url,
|
|
1577
|
-
category: category,
|
|
1578
|
-
meta: meta,
|
|
1579
|
-
excerpt: excerpt,
|
|
1379
|
+
const ContentCardHorizontal = ({
|
|
1380
|
+
id,
|
|
1381
|
+
title,
|
|
1382
|
+
url,
|
|
1383
|
+
category,
|
|
1384
|
+
meta,
|
|
1385
|
+
excerpt,
|
|
1386
|
+
className = "",
|
|
1387
|
+
variant = "instant-view"
|
|
1388
|
+
}) => {
|
|
1389
|
+
const cardClasses = classNames(styles$c.contentCard, styles$c[`contentCard--${variant}`], className);
|
|
1390
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
1391
|
+
href: url,
|
|
1580
1392
|
className: cardClasses,
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
})
|
|
1393
|
+
"aria-label": `View content: ${title}`
|
|
1394
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1395
|
+
className: styles$c.contentMeta
|
|
1396
|
+
}, category && /*#__PURE__*/React.createElement("span", {
|
|
1397
|
+
className: styles$c.contentCategory
|
|
1398
|
+
}, category), meta && /*#__PURE__*/React.createElement("span", {
|
|
1399
|
+
className: styles$c.contentMetaText
|
|
1400
|
+
}, meta)), /*#__PURE__*/React.createElement("h3", {
|
|
1401
|
+
className: styles$c.contentTitle
|
|
1402
|
+
}, title), excerpt && /*#__PURE__*/React.createElement("p", {
|
|
1403
|
+
className: styles$c.contentExcerpt
|
|
1404
|
+
}, excerpt));
|
|
1587
1405
|
};
|
|
1588
1406
|
|
|
1589
1407
|
var styles$b = {"instantResultsLayout":"InstantResults-module__instantResultsLayout___oy-o4","columnsGrid":"InstantResults-module__columnsGrid___bHRUM","resultsColumn":"InstantResults-module__resultsColumn___ZBSlT","columnHeader":"InstantResults-module__columnHeader___VYYhi","showingText":"InstantResults-module__showingText___lECiA","seeAllButton":"InstantResults-module__seeAllButton___xEDAX","chevronIcon":"InstantResults-module__chevronIcon___bjb3q","resultsList":"InstantResults-module__resultsList___7s3PT","divider":"InstantResults-module__divider___Ky6zK","loadingState":"InstantResults-module__loadingState___l0fMq","errorState":"InstantResults-module__errorState___hTBbE","spinner":"InstantResults-module__spinner___85jF-"};
|
|
1590
1408
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1409
|
+
const FederatedInstantResultsLayout = ({
|
|
1410
|
+
query,
|
|
1411
|
+
products,
|
|
1412
|
+
contents,
|
|
1413
|
+
isLoadingProducts,
|
|
1414
|
+
isLoadingContents,
|
|
1415
|
+
productsError,
|
|
1416
|
+
contentsError,
|
|
1417
|
+
onSeeAllProducts,
|
|
1418
|
+
onSeeAllContents,
|
|
1419
|
+
onSeeAllCombined
|
|
1420
|
+
}) => {
|
|
1602
1421
|
products.length + contents.length;
|
|
1422
|
+
|
|
1603
1423
|
// Show first 3 results from each category
|
|
1604
|
-
|
|
1605
|
-
|
|
1424
|
+
const displayProducts = products.slice(0, 3);
|
|
1425
|
+
const displayContents = contents.slice(0, 3);
|
|
1606
1426
|
return /*#__PURE__*/React.createElement("div", {
|
|
1607
1427
|
className: styles$b.instantResultsLayout
|
|
1608
1428
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1640,13 +1460,11 @@ var FederatedInstantResultsLayout = function (_a) {
|
|
|
1640
1460
|
className: styles$b.errorState
|
|
1641
1461
|
}, /*#__PURE__*/React.createElement("p", null, productsError)) : displayProducts.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
1642
1462
|
className: styles$b.resultsList
|
|
1643
|
-
}, displayProducts.map(
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
}));
|
|
1649
|
-
})) : null), /*#__PURE__*/React.createElement("div", {
|
|
1463
|
+
}, displayProducts.map((product, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
1464
|
+
key: product.id
|
|
1465
|
+
}, /*#__PURE__*/React.createElement(ProductCardHorizontal, product), index < displayProducts.length - 1 && /*#__PURE__*/React.createElement("hr", {
|
|
1466
|
+
className: styles$b.divider
|
|
1467
|
+
})))) : null), /*#__PURE__*/React.createElement("div", {
|
|
1650
1468
|
className: styles$b.resultsColumn
|
|
1651
1469
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1652
1470
|
className: styles$b.columnHeader
|
|
@@ -1679,42 +1497,39 @@ var FederatedInstantResultsLayout = function (_a) {
|
|
|
1679
1497
|
className: styles$b.errorState
|
|
1680
1498
|
}, /*#__PURE__*/React.createElement("p", null, contentsError)) : displayContents.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
1681
1499
|
className: styles$b.resultsList
|
|
1682
|
-
}, displayContents.map(
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
}));
|
|
1690
|
-
})) : null)));
|
|
1500
|
+
}, displayContents.map((content, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
1501
|
+
key: content.id
|
|
1502
|
+
}, /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({}, content, {
|
|
1503
|
+
variant: "instant-view"
|
|
1504
|
+
})), index < displayContents.length - 1 && /*#__PURE__*/React.createElement("hr", {
|
|
1505
|
+
className: styles$b.divider
|
|
1506
|
+
})))) : null)));
|
|
1691
1507
|
};
|
|
1692
1508
|
|
|
1693
1509
|
var styles$a = {"resultsCount":"ResultsCount-module__resultsCount___cNM6f"};
|
|
1694
1510
|
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1511
|
+
const ResultsCount = ({
|
|
1512
|
+
count,
|
|
1513
|
+
type,
|
|
1514
|
+
className = ''
|
|
1515
|
+
}) => {
|
|
1516
|
+
const label = count === 1 ? type.slice(0, -1) : type;
|
|
1701
1517
|
return /*#__PURE__*/React.createElement("span", {
|
|
1702
|
-
className:
|
|
1518
|
+
className: `${styles$a.resultsCount} ${className}`
|
|
1703
1519
|
}, count, " ", label);
|
|
1704
1520
|
};
|
|
1705
1521
|
|
|
1706
1522
|
var styles$9 = {"seeAllButton":"SeeAllLinkButton-module__seeAllButton___eAQqJ"};
|
|
1707
1523
|
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
className = _c === void 0 ? '' : _c;
|
|
1524
|
+
const SeeAllLinkButton = ({
|
|
1525
|
+
onClick,
|
|
1526
|
+
label = 'See all results',
|
|
1527
|
+
className = ''
|
|
1528
|
+
}) => {
|
|
1714
1529
|
return /*#__PURE__*/React.createElement("button", {
|
|
1715
1530
|
type: "button",
|
|
1716
1531
|
onClick: onClick,
|
|
1717
|
-
className:
|
|
1532
|
+
className: `${styles$9.seeAllButton} ${className}`
|
|
1718
1533
|
}, label, /*#__PURE__*/React.createElement("svg", {
|
|
1719
1534
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1720
1535
|
viewBox: "0 0 24 24",
|
|
@@ -1731,17 +1546,17 @@ var SeeAllLinkButton = function (_a) {
|
|
|
1731
1546
|
|
|
1732
1547
|
var styles$8 = {"resultsColumn":"ResultsColumn-module__resultsColumn___AexF5","columnHeader":"ResultsColumn-module__columnHeader___-aUWU","columnTitle":"ResultsColumn-module__columnTitle___Gddr-","resultsList":"ResultsColumn-module__resultsList___BkEie","columnFooter":"ResultsColumn-module__columnFooter___4zJUp","loadingState":"ResultsColumn-module__loadingState___wme5F","errorState":"ResultsColumn-module__errorState___NI4fW","emptyState":"ResultsColumn-module__emptyState___tvefj","spinner":"ResultsColumn-module__spinner___hhntn"};
|
|
1733
1548
|
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1549
|
+
const ResultsColumn = ({
|
|
1550
|
+
title,
|
|
1551
|
+
count,
|
|
1552
|
+
isLoading,
|
|
1553
|
+
error,
|
|
1554
|
+
onSeeAll,
|
|
1555
|
+
children,
|
|
1556
|
+
className = ''
|
|
1557
|
+
}) => {
|
|
1743
1558
|
return /*#__PURE__*/React.createElement("div", {
|
|
1744
|
-
className:
|
|
1559
|
+
className: `${styles$8.resultsColumn} ${className}`
|
|
1745
1560
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1746
1561
|
className: styles$8.columnHeader
|
|
1747
1562
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
@@ -1764,7 +1579,7 @@ var ResultsColumn = function (_a) {
|
|
|
1764
1579
|
className: styles$8.columnFooter
|
|
1765
1580
|
}, /*#__PURE__*/React.createElement(SeeAllLinkButton, {
|
|
1766
1581
|
onClick: onSeeAll,
|
|
1767
|
-
label:
|
|
1582
|
+
label: `See all ${title.toLowerCase()}`
|
|
1768
1583
|
}))));
|
|
1769
1584
|
};
|
|
1770
1585
|
|
|
@@ -1786,23 +1601,23 @@ const faXmark = {
|
|
|
1786
1601
|
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M324.5 411.1c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L214.6 256 347.1 123.5c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L192 233.4 59.6 100.9c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L169.4 256 36.9 388.5c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L192 278.6 324.5 411.1z"]
|
|
1787
1602
|
};
|
|
1788
1603
|
|
|
1789
|
-
/**
|
|
1790
|
-
* FilterSearch - Search input for filtering facet values
|
|
1604
|
+
/**
|
|
1605
|
+
* FilterSearch - Search input for filtering facet values
|
|
1791
1606
|
*/
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1607
|
+
const FilterSearch = ({
|
|
1608
|
+
value,
|
|
1609
|
+
onChange,
|
|
1610
|
+
placeholder = "Search",
|
|
1611
|
+
className
|
|
1612
|
+
}) => {
|
|
1613
|
+
const handleChange = e => {
|
|
1799
1614
|
onChange(e.target.value);
|
|
1800
1615
|
};
|
|
1801
|
-
|
|
1616
|
+
const handleClear = () => {
|
|
1802
1617
|
onChange("");
|
|
1803
1618
|
};
|
|
1804
1619
|
return /*#__PURE__*/React.createElement("div", {
|
|
1805
|
-
className:
|
|
1620
|
+
className: `${styles$7.filterSearch} ${className || ""}`
|
|
1806
1621
|
}, !value && /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
1807
1622
|
icon: faMagnifyingGlass,
|
|
1808
1623
|
className: styles$7.searchIcon,
|
|
@@ -1824,43 +1639,42 @@ var FilterSearch = function (_a) {
|
|
|
1824
1639
|
})));
|
|
1825
1640
|
};
|
|
1826
1641
|
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
* FilterItem - Individual facet item with checkbox and count
|
|
1642
|
+
const CheckIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
1643
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1644
|
+
width: "9",
|
|
1645
|
+
height: "7",
|
|
1646
|
+
viewBox: "0 0 9 7",
|
|
1647
|
+
fill: "none"
|
|
1648
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1649
|
+
d: "M8.73456 0.104504C9.02185 0.279451 9.08614 0.615889 8.8772 0.856441L3.7342 6.77774C3.62371 6.90558 3.45294 6.98465 3.2641 6.99811C3.07525 7.01156 2.89244 6.95269 2.75984 6.84166L0.188342 4.68846C-0.0627808 4.47819 -0.0627808 4.13671 0.188342 3.92643C0.439465 3.71616 0.847289 3.71616 1.09841 3.92643L3.13753 5.63385L7.83856 0.222257C8.04749 -0.0182957 8.44929 -0.0721258 8.73658 0.102822L8.73456 0.104504Z",
|
|
1650
|
+
fill: "#E2001A"
|
|
1651
|
+
}));
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* FilterItem - Individual facet item with checkbox and count
|
|
1841
1655
|
*/
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
var handleChange = function () {
|
|
1656
|
+
const FilterItem = ({
|
|
1657
|
+
value,
|
|
1658
|
+
onToggle,
|
|
1659
|
+
className,
|
|
1660
|
+
variant = 'desktop',
|
|
1661
|
+
showCheckbox = true
|
|
1662
|
+
}) => {
|
|
1663
|
+
const handleChange = () => {
|
|
1851
1664
|
onToggle(value.value);
|
|
1852
1665
|
};
|
|
1853
|
-
|
|
1666
|
+
const handleKeyDown = e => {
|
|
1854
1667
|
if (e.key === "Enter" || e.key === " ") {
|
|
1855
1668
|
e.preventDefault();
|
|
1856
1669
|
onToggle(value.value);
|
|
1857
1670
|
}
|
|
1858
1671
|
};
|
|
1672
|
+
|
|
1859
1673
|
// Mobile variant: Plain button (no checkbox)
|
|
1860
1674
|
if (variant === 'mobile') {
|
|
1861
1675
|
return /*#__PURE__*/React.createElement("button", {
|
|
1862
1676
|
type: "button",
|
|
1863
|
-
className:
|
|
1677
|
+
className: `${styles$7.filterItemMobile} ${value.isRefined ? styles$7.filterItemMobileRefined : ''} ${className || ""}`,
|
|
1864
1678
|
onClick: handleChange,
|
|
1865
1679
|
onKeyDown: handleKeyDown,
|
|
1866
1680
|
"aria-pressed": value.isRefined
|
|
@@ -1870,11 +1684,12 @@ var FilterItem = function (_a) {
|
|
|
1870
1684
|
className: styles$7.filterCount
|
|
1871
1685
|
}, "(", value.count, ")"));
|
|
1872
1686
|
}
|
|
1687
|
+
|
|
1873
1688
|
// Desktop without checkbox (Content tab): Plain button with red text when selected
|
|
1874
1689
|
if (!showCheckbox) {
|
|
1875
1690
|
return /*#__PURE__*/React.createElement("button", {
|
|
1876
1691
|
type: "button",
|
|
1877
|
-
className:
|
|
1692
|
+
className: `${styles$7.filterItemDesktopNoCheckbox} ${value.isRefined ? styles$7.filterItemDesktopRefined : ''} ${className || ""}`,
|
|
1878
1693
|
onClick: handleChange,
|
|
1879
1694
|
onKeyDown: handleKeyDown,
|
|
1880
1695
|
"aria-pressed": value.isRefined
|
|
@@ -1884,16 +1699,17 @@ var FilterItem = function (_a) {
|
|
|
1884
1699
|
className: styles$7.filterCount
|
|
1885
1700
|
}, "(", value.count, ")"));
|
|
1886
1701
|
}
|
|
1702
|
+
|
|
1887
1703
|
// Desktop with checkbox (Products tab): Multi-select checkboxes
|
|
1888
1704
|
return /*#__PURE__*/React.createElement("label", {
|
|
1889
|
-
className:
|
|
1705
|
+
className: `${styles$7.filterItem} ${className || ""}`,
|
|
1890
1706
|
onKeyDown: handleKeyDown
|
|
1891
1707
|
}, /*#__PURE__*/React.createElement("input", {
|
|
1892
1708
|
type: "checkbox",
|
|
1893
1709
|
checked: value.isRefined,
|
|
1894
1710
|
onChange: handleChange,
|
|
1895
1711
|
className: styles$7.filterCheckboxInput,
|
|
1896
|
-
"aria-label":
|
|
1712
|
+
"aria-label": `${value.value} (${value.count} results)`
|
|
1897
1713
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1898
1714
|
className: styles$7.filterCheckbox
|
|
1899
1715
|
}, value.isRefined && /*#__PURE__*/React.createElement(CheckIcon, null)), /*#__PURE__*/React.createElement("span", {
|
|
@@ -1903,61 +1719,57 @@ var FilterItem = function (_a) {
|
|
|
1903
1719
|
}, "(", value.count, ")"));
|
|
1904
1720
|
};
|
|
1905
1721
|
|
|
1906
|
-
/**
|
|
1907
|
-
* FilterAccordion - Collapsible facet section with optional search
|
|
1722
|
+
/**
|
|
1723
|
+
* FilterAccordion - Collapsible facet section with optional search
|
|
1908
1724
|
*/
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
searchQuery = _d[0],
|
|
1921
|
-
setSearchQuery = _d[1];
|
|
1725
|
+
const FilterAccordion = ({
|
|
1726
|
+
facet,
|
|
1727
|
+
isExpanded,
|
|
1728
|
+
onToggle,
|
|
1729
|
+
onValueToggle,
|
|
1730
|
+
className,
|
|
1731
|
+
variant = 'desktop',
|
|
1732
|
+
showCheckbox = true
|
|
1733
|
+
}) => {
|
|
1734
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
1735
|
+
|
|
1922
1736
|
// Filter facet values based on search query
|
|
1923
|
-
|
|
1737
|
+
const filteredValues = useMemo(() => {
|
|
1924
1738
|
if (!searchQuery.trim()) {
|
|
1925
1739
|
return facet.values;
|
|
1926
1740
|
}
|
|
1927
|
-
|
|
1928
|
-
return facet.values.filter(
|
|
1929
|
-
return value.value.toLowerCase().includes(query);
|
|
1930
|
-
});
|
|
1741
|
+
const query = searchQuery.toLowerCase();
|
|
1742
|
+
return facet.values.filter(value => value.value.toLowerCase().includes(query));
|
|
1931
1743
|
}, [facet.values, searchQuery]);
|
|
1932
|
-
|
|
1744
|
+
const handleToggle = () => {
|
|
1933
1745
|
onToggle();
|
|
1934
1746
|
// Clear search when collapsing
|
|
1935
1747
|
if (isExpanded) {
|
|
1936
1748
|
setSearchQuery("");
|
|
1937
1749
|
}
|
|
1938
1750
|
};
|
|
1939
|
-
|
|
1751
|
+
const handleKeyDown = e => {
|
|
1940
1752
|
if (e.key === "Enter" || e.key === " ") {
|
|
1941
1753
|
e.preventDefault();
|
|
1942
1754
|
handleToggle();
|
|
1943
1755
|
}
|
|
1944
1756
|
};
|
|
1945
|
-
|
|
1757
|
+
const handleValueToggle = value => {
|
|
1946
1758
|
onValueToggle(facet.attribute, value);
|
|
1947
1759
|
};
|
|
1948
1760
|
return /*#__PURE__*/React.createElement("div", {
|
|
1949
|
-
className:
|
|
1761
|
+
className: `${styles$7.filterAccordion} ${className || ""}`
|
|
1950
1762
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1951
1763
|
type: "button",
|
|
1952
|
-
className:
|
|
1764
|
+
className: `${styles$7.accordionHeader} ${isExpanded ? styles$7.accordionHeaderExpanded : ""}`,
|
|
1953
1765
|
onClick: handleToggle,
|
|
1954
1766
|
onKeyDown: handleKeyDown,
|
|
1955
1767
|
"aria-expanded": isExpanded,
|
|
1956
|
-
"aria-controls":
|
|
1768
|
+
"aria-controls": `accordion-${facet.id}`
|
|
1957
1769
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1958
1770
|
className: styles$7.accordionTitle
|
|
1959
1771
|
}, facet.label), /*#__PURE__*/React.createElement("svg", {
|
|
1960
|
-
className:
|
|
1772
|
+
className: `${styles$7.accordionIcon} ${isExpanded ? styles$7.accordionIconExpanded : ""}`,
|
|
1961
1773
|
width: "16",
|
|
1962
1774
|
height: "16",
|
|
1963
1775
|
viewBox: "0 0 16 16",
|
|
@@ -1971,7 +1783,7 @@ var FilterAccordion = function (_a) {
|
|
|
1971
1783
|
strokeLinecap: "round",
|
|
1972
1784
|
strokeLinejoin: "round"
|
|
1973
1785
|
}))), isExpanded && /*#__PURE__*/React.createElement("div", {
|
|
1974
|
-
id:
|
|
1786
|
+
id: `accordion-${facet.id}`,
|
|
1975
1787
|
className: styles$7.accordionContent
|
|
1976
1788
|
}, variant === 'desktop' && facet.searchable && facet.values.length > 5 && /*#__PURE__*/React.createElement("div", {
|
|
1977
1789
|
className: styles$7.accordionSearch
|
|
@@ -1981,39 +1793,38 @@ var FilterAccordion = function (_a) {
|
|
|
1981
1793
|
placeholder: "Search"
|
|
1982
1794
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1983
1795
|
className: styles$7.filterList
|
|
1984
|
-
}, filteredValues.length > 0 ? filteredValues.map(
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
});
|
|
1992
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
1796
|
+
}, filteredValues.length > 0 ? filteredValues.map(value => /*#__PURE__*/React.createElement(FilterItem, {
|
|
1797
|
+
key: value.value,
|
|
1798
|
+
value: value,
|
|
1799
|
+
onToggle: handleValueToggle,
|
|
1800
|
+
variant: variant,
|
|
1801
|
+
showCheckbox: showCheckbox
|
|
1802
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
1993
1803
|
className: styles$7.noResults
|
|
1994
1804
|
}, "No results found"))));
|
|
1995
1805
|
};
|
|
1996
1806
|
|
|
1997
|
-
/**
|
|
1998
|
-
* AppliedFilterTag - Individual removable filter tag/chip
|
|
1807
|
+
/**
|
|
1808
|
+
* AppliedFilterTag - Individual removable filter tag/chip
|
|
1999
1809
|
*/
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1810
|
+
const AppliedFilterTag = ({
|
|
1811
|
+
attribute,
|
|
1812
|
+
value,
|
|
1813
|
+
label,
|
|
1814
|
+
onRemove,
|
|
1815
|
+
className
|
|
1816
|
+
}) => {
|
|
1817
|
+
const handleRemove = () => {
|
|
2007
1818
|
onRemove(attribute, value);
|
|
2008
1819
|
};
|
|
2009
|
-
|
|
1820
|
+
const handleKeyDown = e => {
|
|
2010
1821
|
if (e.key === "Enter" || e.key === " ") {
|
|
2011
1822
|
e.preventDefault();
|
|
2012
1823
|
handleRemove();
|
|
2013
1824
|
}
|
|
2014
1825
|
};
|
|
2015
1826
|
return /*#__PURE__*/React.createElement("div", {
|
|
2016
|
-
className:
|
|
1827
|
+
className: `${styles$7.appliedFilterTag} ${className || ""}`
|
|
2017
1828
|
}, /*#__PURE__*/React.createElement("span", {
|
|
2018
1829
|
className: styles$7.tagLabel
|
|
2019
1830
|
}, label || value), /*#__PURE__*/React.createElement("button", {
|
|
@@ -2021,7 +1832,7 @@ var AppliedFilterTag = function (_a) {
|
|
|
2021
1832
|
onClick: handleRemove,
|
|
2022
1833
|
onKeyDown: handleKeyDown,
|
|
2023
1834
|
className: styles$7.tagRemoveButton,
|
|
2024
|
-
"aria-label":
|
|
1835
|
+
"aria-label": `Remove ${label || value} filter`
|
|
2025
1836
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
2026
1837
|
width: "10",
|
|
2027
1838
|
height: "10",
|
|
@@ -2038,19 +1849,20 @@ var AppliedFilterTag = function (_a) {
|
|
|
2038
1849
|
}))));
|
|
2039
1850
|
};
|
|
2040
1851
|
|
|
2041
|
-
/**
|
|
2042
|
-
* AppliedFilters - Shows all active filters as removable tags
|
|
1852
|
+
/**
|
|
1853
|
+
* AppliedFilters - Shows all active filters as removable tags
|
|
2043
1854
|
*/
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
1855
|
+
const AppliedFilters = ({
|
|
1856
|
+
facets,
|
|
1857
|
+
onRemove,
|
|
1858
|
+
onClearAll,
|
|
1859
|
+
className
|
|
1860
|
+
}) => {
|
|
2049
1861
|
// Extract all refined (selected) filters
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
facets.forEach(
|
|
2053
|
-
facet.values.forEach(
|
|
1862
|
+
const appliedFilters = useMemo(() => {
|
|
1863
|
+
const filters = [];
|
|
1864
|
+
facets.forEach(facet => {
|
|
1865
|
+
facet.values.forEach(value => {
|
|
2054
1866
|
if (value.isRefined) {
|
|
2055
1867
|
filters.push({
|
|
2056
1868
|
attribute: facet.attribute,
|
|
@@ -2063,72 +1875,66 @@ var AppliedFilters = function (_a) {
|
|
|
2063
1875
|
});
|
|
2064
1876
|
return filters;
|
|
2065
1877
|
}, [facets]);
|
|
1878
|
+
|
|
2066
1879
|
// Don't render if no filters are applied
|
|
2067
1880
|
if (appliedFilters.length === 0) {
|
|
2068
1881
|
return null;
|
|
2069
1882
|
}
|
|
2070
1883
|
return /*#__PURE__*/React.createElement("div", {
|
|
2071
|
-
className:
|
|
1884
|
+
className: `${styles$7.appliedFilters} ${className || ""}`
|
|
2072
1885
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
2073
1886
|
className: styles$7.appliedFiltersTitle
|
|
2074
1887
|
}, "Applied filters"), /*#__PURE__*/React.createElement("div", {
|
|
2075
1888
|
className: styles$7.appliedFiltersList
|
|
2076
|
-
}, appliedFilters.map(
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
});
|
|
2084
|
-
})));
|
|
1889
|
+
}, appliedFilters.map(filter => /*#__PURE__*/React.createElement(AppliedFilterTag, {
|
|
1890
|
+
key: `${filter.attribute}-${filter.value}`,
|
|
1891
|
+
attribute: filter.attribute,
|
|
1892
|
+
value: filter.value,
|
|
1893
|
+
label: filter.label,
|
|
1894
|
+
onRemove: onRemove
|
|
1895
|
+
}))));
|
|
2085
1896
|
};
|
|
2086
1897
|
|
|
2087
|
-
/**
|
|
2088
|
-
* FiltersPanel - Main container for all filters
|
|
2089
|
-
*
|
|
2090
|
-
* Fully controlled component - renders based on facets prop.
|
|
2091
|
-
* When facets change (e.g., after API refetch), component re-renders with new data.
|
|
2092
|
-
* Accordion expansion state persists across refetches, with new facets respecting defaultExpanded.
|
|
1898
|
+
/**
|
|
1899
|
+
* FiltersPanel - Main container for all filters
|
|
1900
|
+
*
|
|
1901
|
+
* Fully controlled component - renders based on facets prop.
|
|
1902
|
+
* When facets change (e.g., after API refetch), component re-renders with new data.
|
|
1903
|
+
* Accordion expansion state persists across refetches, with new facets respecting defaultExpanded.
|
|
2093
1904
|
*/
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
_d = _a.showCheckbox,
|
|
2103
|
-
showCheckbox = _d === void 0 ? true : _d;
|
|
1905
|
+
const FiltersPanel = ({
|
|
1906
|
+
facets,
|
|
1907
|
+
onFacetToggle,
|
|
1908
|
+
isLoading = false,
|
|
1909
|
+
className,
|
|
1910
|
+
variant = 'desktop',
|
|
1911
|
+
showCheckbox = true
|
|
1912
|
+
}) => {
|
|
2104
1913
|
// Track which accordions are expanded (transient UI state)
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
setExpandedAccordions = _e[1];
|
|
1914
|
+
const [expandedAccordions, setExpandedAccordions] = useState(() => {
|
|
1915
|
+
// Initialize with default expanded facets
|
|
1916
|
+
const expanded = new Set();
|
|
1917
|
+
facets.forEach(facet => {
|
|
1918
|
+
if (facet.defaultExpanded) {
|
|
1919
|
+
expanded.add(facet.id);
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1922
|
+
return expanded;
|
|
1923
|
+
});
|
|
1924
|
+
|
|
2117
1925
|
// Sync expansion state when facets change (e.g., new facets appear after refetch)
|
|
2118
|
-
useEffect(
|
|
2119
|
-
setExpandedAccordions(
|
|
2120
|
-
|
|
1926
|
+
useEffect(() => {
|
|
1927
|
+
setExpandedAccordions(prev => {
|
|
1928
|
+
const next = new Set(prev);
|
|
2121
1929
|
// Add new facets with defaultExpanded
|
|
2122
|
-
facets.forEach(
|
|
1930
|
+
facets.forEach(facet => {
|
|
2123
1931
|
if (facet.defaultExpanded && !next.has(facet.id)) {
|
|
2124
1932
|
next.add(facet.id);
|
|
2125
1933
|
}
|
|
2126
1934
|
});
|
|
2127
1935
|
// Remove facets that no longer exist
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
}));
|
|
2131
|
-
next.forEach(function (id) {
|
|
1936
|
+
const currentFacetIds = new Set(facets.map(f => f.id));
|
|
1937
|
+
next.forEach(id => {
|
|
2132
1938
|
if (!currentFacetIds.has(id)) {
|
|
2133
1939
|
next.delete(id);
|
|
2134
1940
|
}
|
|
@@ -2136,9 +1942,9 @@ var FiltersPanel = function (_a) {
|
|
|
2136
1942
|
return next;
|
|
2137
1943
|
});
|
|
2138
1944
|
}, [facets]);
|
|
2139
|
-
|
|
2140
|
-
setExpandedAccordions(
|
|
2141
|
-
|
|
1945
|
+
const handleAccordionToggle = useCallback(facetId => {
|
|
1946
|
+
setExpandedAccordions(prev => {
|
|
1947
|
+
const next = new Set(prev);
|
|
2142
1948
|
if (next.has(facetId)) {
|
|
2143
1949
|
next.delete(facetId);
|
|
2144
1950
|
} else {
|
|
@@ -2147,16 +1953,16 @@ var FiltersPanel = function (_a) {
|
|
|
2147
1953
|
return next;
|
|
2148
1954
|
});
|
|
2149
1955
|
}, []);
|
|
2150
|
-
|
|
1956
|
+
const handleValueToggle = useCallback((attribute, value) => {
|
|
2151
1957
|
onFacetToggle(attribute, value);
|
|
2152
1958
|
}, [onFacetToggle]);
|
|
2153
|
-
|
|
1959
|
+
const handleRemoveFilter = useCallback((attribute, value) => {
|
|
2154
1960
|
onFacetToggle(attribute, value);
|
|
2155
1961
|
}, [onFacetToggle]);
|
|
2156
|
-
|
|
1962
|
+
const handleClearAll = useCallback(() => {
|
|
2157
1963
|
// Remove all refined facets
|
|
2158
|
-
facets.forEach(
|
|
2159
|
-
facet.values.forEach(
|
|
1964
|
+
facets.forEach(facet => {
|
|
1965
|
+
facet.values.forEach(value => {
|
|
2160
1966
|
if (value.isRefined) {
|
|
2161
1967
|
onFacetToggle(facet.attribute, value.value);
|
|
2162
1968
|
}
|
|
@@ -2165,7 +1971,7 @@ var FiltersPanel = function (_a) {
|
|
|
2165
1971
|
}, [facets, onFacetToggle]);
|
|
2166
1972
|
if (isLoading) {
|
|
2167
1973
|
return /*#__PURE__*/React.createElement("div", {
|
|
2168
|
-
className:
|
|
1974
|
+
className: `${styles$7.filtersPanel} ${className || ""}`
|
|
2169
1975
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2170
1976
|
className: styles$7.loadingState
|
|
2171
1977
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2176,73 +1982,70 @@ var FiltersPanel = function (_a) {
|
|
|
2176
1982
|
return null;
|
|
2177
1983
|
}
|
|
2178
1984
|
return /*#__PURE__*/React.createElement("div", {
|
|
2179
|
-
className:
|
|
1985
|
+
className: `${styles$7.filtersPanel} ${className || ""}`
|
|
2180
1986
|
}, showCheckbox && /*#__PURE__*/React.createElement(AppliedFilters, {
|
|
2181
1987
|
facets: facets,
|
|
2182
1988
|
onRemove: handleRemoveFilter,
|
|
2183
1989
|
onClearAll: handleClearAll
|
|
2184
1990
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2185
1991
|
className: styles$7.filtersList
|
|
2186
|
-
}, facets.map(
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
variant: variant,
|
|
2196
|
-
showCheckbox: showCheckbox
|
|
2197
|
-
});
|
|
2198
|
-
})));
|
|
1992
|
+
}, facets.map(facet => /*#__PURE__*/React.createElement(FilterAccordion, {
|
|
1993
|
+
key: facet.id,
|
|
1994
|
+
facet: facet,
|
|
1995
|
+
isExpanded: expandedAccordions.has(facet.id),
|
|
1996
|
+
onToggle: () => handleAccordionToggle(facet.id),
|
|
1997
|
+
onValueToggle: handleValueToggle,
|
|
1998
|
+
variant: variant,
|
|
1999
|
+
showCheckbox: showCheckbox
|
|
2000
|
+
}))));
|
|
2199
2001
|
};
|
|
2200
2002
|
|
|
2201
2003
|
var styles$6 = {"productCardVertical":"ProductCardVertical-module__productCardVertical___kXgmt","productCardVertical--hover":"ProductCardVertical-module__productCardVertical--hover___8Nsyp","productCardVertical__button":"ProductCardVertical-module__productCardVertical__button___oQPJG","productCardVertical--focus":"ProductCardVertical-module__productCardVertical--focus___8U57I","productCardVertical__imageWrapper":"ProductCardVertical-module__productCardVertical__imageWrapper___SgKoZ","productCardVertical__image":"ProductCardVertical-module__productCardVertical__image___kg-QU","productCardVertical__content":"ProductCardVertical-module__productCardVertical__content___sZdOs","productCardVertical__title":"ProductCardVertical-module__productCardVertical__title___PPKWb","productCardVertical__description":"ProductCardVertical-module__productCardVertical__description___Ai90p","productCardVertical__footer":"ProductCardVertical-module__productCardVertical__footer___rv6BH"};
|
|
2202
2004
|
|
|
2203
|
-
/**
|
|
2204
|
-
* ProductCardVertical - Vertical product card for grid layouts
|
|
2205
|
-
*
|
|
2206
|
-
* Used in full results view with 4-column grid (desktop) or 2-column grid (mobile).
|
|
2207
|
-
* Figma spec: Default (no shadow) → Hover (shadow + grey button) → Focus (border + shadow)
|
|
2208
|
-
*
|
|
2209
|
-
* @example
|
|
2210
|
-
* ```tsx
|
|
2211
|
-
* <ProductCardVertical
|
|
2212
|
-
* title="TURBOVAC i - High vacuum turbopump"
|
|
2213
|
-
* url="/products/turbovac-i"
|
|
2214
|
-
* imageUrl="/assets/search-product.png"
|
|
2215
|
-
* productId="21312VISH"
|
|
2216
|
-
* description="Premium high-performance turbomolecular pump"
|
|
2217
|
-
* buttonLabel="BUY ONLINE"
|
|
2218
|
-
* />
|
|
2219
|
-
* ```
|
|
2005
|
+
/**
|
|
2006
|
+
* ProductCardVertical - Vertical product card for grid layouts
|
|
2007
|
+
*
|
|
2008
|
+
* Used in full results view with 4-column grid (desktop) or 2-column grid (mobile).
|
|
2009
|
+
* Figma spec: Default (no shadow) → Hover (shadow + grey button) → Focus (border + shadow)
|
|
2010
|
+
*
|
|
2011
|
+
* @example
|
|
2012
|
+
* ```tsx
|
|
2013
|
+
* <ProductCardVertical
|
|
2014
|
+
* title="TURBOVAC i - High vacuum turbopump"
|
|
2015
|
+
* url="/products/turbovac-i"
|
|
2016
|
+
* imageUrl="/assets/search-product.png"
|
|
2017
|
+
* productId="21312VISH"
|
|
2018
|
+
* description="Premium high-performance turbomolecular pump"
|
|
2019
|
+
* buttonLabel="BUY ONLINE"
|
|
2020
|
+
* />
|
|
2021
|
+
* ```
|
|
2220
2022
|
*/
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
forceState = _a["data-force-state"];
|
|
2236
|
-
var handleButtonClick = function (e) {
|
|
2023
|
+
const ProductCardVertical = ({
|
|
2024
|
+
id,
|
|
2025
|
+
title,
|
|
2026
|
+
url,
|
|
2027
|
+
imageUrl,
|
|
2028
|
+
productId,
|
|
2029
|
+
description,
|
|
2030
|
+
buttonLabel = 'BUY ONLINE',
|
|
2031
|
+
onButtonClick,
|
|
2032
|
+
className,
|
|
2033
|
+
variant = 'desktop',
|
|
2034
|
+
'data-force-state': forceState
|
|
2035
|
+
}) => {
|
|
2036
|
+
const handleButtonClick = e => {
|
|
2237
2037
|
e.preventDefault(); // Prevent card link navigation
|
|
2238
2038
|
e.stopPropagation(); // Stop event bubbling
|
|
2239
|
-
onButtonClick
|
|
2039
|
+
onButtonClick?.();
|
|
2240
2040
|
};
|
|
2241
|
-
|
|
2041
|
+
const cardClasses = classNames(styles$6.productCardVertical, styles$6[`productCardVertical--${variant}`], {
|
|
2042
|
+
[styles$6['productCardVertical--hover']]: forceState === 'hover',
|
|
2043
|
+
[styles$6['productCardVertical--focus']]: forceState === 'focus'
|
|
2044
|
+
}, className);
|
|
2242
2045
|
return /*#__PURE__*/React.createElement("a", {
|
|
2243
2046
|
href: url,
|
|
2244
2047
|
className: cardClasses,
|
|
2245
|
-
"aria-label":
|
|
2048
|
+
"aria-label": `View product: ${title}`,
|
|
2246
2049
|
"data-product-id": id
|
|
2247
2050
|
}, imageUrl && /*#__PURE__*/React.createElement("div", {
|
|
2248
2051
|
className: styles$6.productCardVertical__imageWrapper
|
|
@@ -2263,7 +2066,7 @@ var ProductCardVertical = function (_a) {
|
|
|
2263
2066
|
type: "button",
|
|
2264
2067
|
onClick: handleButtonClick,
|
|
2265
2068
|
className: styles$6.productCardVertical__button,
|
|
2266
|
-
"aria-label":
|
|
2069
|
+
"aria-label": `${buttonLabel} - ${title}`,
|
|
2267
2070
|
tabIndex: -1
|
|
2268
2071
|
}, /*#__PURE__*/React.createElement("span", null, buttonLabel), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
2269
2072
|
icon: faArrowUpRightFromSquare$1,
|
|
@@ -2273,19 +2076,17 @@ var ProductCardVertical = function (_a) {
|
|
|
2273
2076
|
|
|
2274
2077
|
var styles$5 = {"resultsView":"ResultsView-module__resultsView___S4Wh2","searchBarWrapper":"ResultsView-module__searchBarWrapper___XNtwR","tabsContainer":"ResultsView-module__tabsContainer___mB-Q2","tabs":"ResultsView-module__tabs___rOexd","tabSeparator":"ResultsView-module__tabSeparator___MSq9p","mobileFilterButton":"ResultsView-module__mobileFilterButton___ZrMQY","resultsContainer":"ResultsView-module__resultsContainer___J4URa","sidebar":"ResultsView-module__sidebar___nQq5J","assistanceBanner":"ResultsView-module__assistanceBanner___1r72a","mainContent":"ResultsView-module__mainContent___S9eIG","productsGrid":"ResultsView-module__productsGrid___gnAQ-","contentsList":"ResultsView-module__contentsList___tcfNG","contentDivider":"ResultsView-module__contentDivider___5n6sl","resultsList":"ResultsView-module__resultsList___8eYNX","resultsSection":"ResultsView-module__resultsSection___sCUaO","sectionTitle":"ResultsView-module__sectionTitle___mfvH3","loadingState":"ResultsView-module__loadingState___W5YXx","errorState":"ResultsView-module__errorState___UkkG-","emptyState":"ResultsView-module__emptyState___D0Iyn","spinner":"ResultsView-module__spinner___nk8E5","emptyIcon":"ResultsView-module__emptyIcon___fes8T","paginationWrapper":"ResultsView-module__paginationWrapper___mDTyl","searchBarDesktopOnly":"ResultsView-module__searchBarDesktopOnly___dZHUw","tabsContainerDesktopOnly":"ResultsView-module__tabsContainerDesktopOnly___-MQpa"};
|
|
2275
2078
|
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
_d = _a.className,
|
|
2285
|
-
className = _d === void 0 ? '' : _d;
|
|
2079
|
+
const ResultsList = ({
|
|
2080
|
+
type,
|
|
2081
|
+
products = [],
|
|
2082
|
+
contents = [],
|
|
2083
|
+
isLoading,
|
|
2084
|
+
error,
|
|
2085
|
+
className = ''
|
|
2086
|
+
}) => {
|
|
2286
2087
|
if (isLoading) {
|
|
2287
2088
|
return /*#__PURE__*/React.createElement("div", {
|
|
2288
|
-
className:
|
|
2089
|
+
className: `${styles$5.loadingState} ${className}`
|
|
2289
2090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2290
2091
|
className: styles$5.spinner,
|
|
2291
2092
|
"aria-label": "Loading..."
|
|
@@ -2293,15 +2094,15 @@ var ResultsList = function (_a) {
|
|
|
2293
2094
|
}
|
|
2294
2095
|
if (error) {
|
|
2295
2096
|
return /*#__PURE__*/React.createElement("div", {
|
|
2296
|
-
className:
|
|
2097
|
+
className: `${styles$5.errorState} ${className}`
|
|
2297
2098
|
}, /*#__PURE__*/React.createElement("p", null, error));
|
|
2298
2099
|
}
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2100
|
+
const hasProducts = products.length > 0;
|
|
2101
|
+
const hasContents = contents.length > 0;
|
|
2102
|
+
const hasResults = hasProducts || hasContents;
|
|
2302
2103
|
if (!hasResults) {
|
|
2303
2104
|
return /*#__PURE__*/React.createElement("div", {
|
|
2304
|
-
className:
|
|
2105
|
+
className: `${styles$5.emptyState} ${className}`
|
|
2305
2106
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
2306
2107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2307
2108
|
viewBox: "0 0 24 24",
|
|
@@ -2319,111 +2120,107 @@ var ResultsList = function (_a) {
|
|
|
2319
2120
|
d: "m21 21-4.35-4.35"
|
|
2320
2121
|
})), /*#__PURE__*/React.createElement("h3", null, "No results found"), /*#__PURE__*/React.createElement("p", null, "Try adjusting your search or filters to find what you're looking for."));
|
|
2321
2122
|
}
|
|
2123
|
+
|
|
2322
2124
|
// Render based on type
|
|
2323
2125
|
if (type === 'products') {
|
|
2324
2126
|
return /*#__PURE__*/React.createElement("div", {
|
|
2325
|
-
className:
|
|
2326
|
-
}, products.map(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
}));
|
|
2332
|
-
}));
|
|
2127
|
+
className: `${styles$5.productsGrid} ${className}`
|
|
2128
|
+
}, products.map(product => /*#__PURE__*/React.createElement(ProductCardVertical, _extends({
|
|
2129
|
+
key: product.id
|
|
2130
|
+
}, product, {
|
|
2131
|
+
buttonLabel: "BUY ONLINE"
|
|
2132
|
+
}))));
|
|
2333
2133
|
}
|
|
2334
2134
|
if (type === 'content') {
|
|
2335
2135
|
return /*#__PURE__*/React.createElement("div", {
|
|
2336
|
-
className:
|
|
2337
|
-
}, contents.map(
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
})));
|
|
2345
|
-
}));
|
|
2136
|
+
className: `${styles$5.contentsList} ${className}`
|
|
2137
|
+
}, contents.map((content, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
2138
|
+
key: content.id
|
|
2139
|
+
}, index > 0 && /*#__PURE__*/React.createElement("hr", {
|
|
2140
|
+
className: styles$5.contentDivider
|
|
2141
|
+
}), /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({}, content, {
|
|
2142
|
+
variant: "results-view"
|
|
2143
|
+
})))));
|
|
2346
2144
|
}
|
|
2145
|
+
|
|
2347
2146
|
// type === 'all' - Show mixed results (not in current Figma design, but keep for compatibility)
|
|
2348
2147
|
return /*#__PURE__*/React.createElement("div", {
|
|
2349
|
-
className:
|
|
2148
|
+
className: `${styles$5.resultsList} ${className}`
|
|
2350
2149
|
}, hasProducts && /*#__PURE__*/React.createElement("div", {
|
|
2351
2150
|
className: styles$5.resultsSection
|
|
2352
2151
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
2353
2152
|
className: styles$5.sectionTitle
|
|
2354
2153
|
}, "Products (", products.length, ")"), /*#__PURE__*/React.createElement("div", {
|
|
2355
2154
|
className: styles$5.productsGrid
|
|
2356
|
-
}, products.map(
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
}));
|
|
2362
|
-
}))), hasContents && /*#__PURE__*/React.createElement("div", {
|
|
2155
|
+
}, products.map(product => /*#__PURE__*/React.createElement(ProductCardVertical, _extends({
|
|
2156
|
+
key: product.id
|
|
2157
|
+
}, product, {
|
|
2158
|
+
buttonLabel: "BUY ONLINE"
|
|
2159
|
+
}))))), hasContents && /*#__PURE__*/React.createElement("div", {
|
|
2363
2160
|
className: styles$5.resultsSection
|
|
2364
2161
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
2365
2162
|
className: styles$5.sectionTitle
|
|
2366
2163
|
}, "Content (", contents.length, ")"), /*#__PURE__*/React.createElement("div", {
|
|
2367
2164
|
className: styles$5.contentsList
|
|
2368
|
-
}, contents.map(
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
})));
|
|
2376
|
-
}))));
|
|
2165
|
+
}, contents.map((content, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
2166
|
+
key: content.id
|
|
2167
|
+
}, index > 0 && /*#__PURE__*/React.createElement("hr", {
|
|
2168
|
+
className: styles$5.contentDivider
|
|
2169
|
+
}), /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({}, content, {
|
|
2170
|
+
variant: "results-view"
|
|
2171
|
+
})))))));
|
|
2377
2172
|
};
|
|
2378
2173
|
|
|
2379
2174
|
var styles$4 = {"tabButton":"TabButton-module__tabButton___cMU45","tabButton__count":"TabButton-module__tabButton__count___nlS1p","tabButton__label":"TabButton-module__tabButton__label___YGpiC","tabButton__results":"TabButton-module__tabButton__results___Nr6gr","tabButton--desktop":"TabButton-module__tabButton--desktop___fbAaC","tabButton--active":"TabButton-module__tabButton--active___gj6Jp","tabButton--mobile":"TabButton-module__tabButton--mobile___AnLwy"};
|
|
2380
2175
|
|
|
2381
|
-
/**
|
|
2382
|
-
* TabButton - Tab navigation component with result counts
|
|
2383
|
-
*
|
|
2384
|
-
* Supports two layout variants:
|
|
2385
|
-
* - Desktop: Background colours, top red underline when active, rounded corners
|
|
2386
|
-
* - Mobile: Text-only with bottom border underline when active
|
|
2387
|
-
*
|
|
2388
|
-
* @example
|
|
2389
|
-
* ```tsx
|
|
2390
|
-
* // Desktop variant
|
|
2391
|
-
* <TabButton
|
|
2392
|
-
* label="WEB SHOP RESULTS"
|
|
2393
|
-
* count={542}
|
|
2394
|
-
* isActive={true}
|
|
2395
|
-
* onClick={() => setActiveTab('products')}
|
|
2396
|
-
* variant="desktop"
|
|
2397
|
-
* />
|
|
2398
|
-
*
|
|
2399
|
-
* // Mobile variant
|
|
2400
|
-
* <TabButton
|
|
2401
|
-
* label="WEB SHOP"
|
|
2402
|
-
* isActive={false}
|
|
2403
|
-
* onClick={() => setActiveTab('content')}
|
|
2404
|
-
* variant="mobile"
|
|
2405
|
-
* />
|
|
2406
|
-
* ```
|
|
2176
|
+
/**
|
|
2177
|
+
* TabButton - Tab navigation component with result counts
|
|
2178
|
+
*
|
|
2179
|
+
* Supports two layout variants:
|
|
2180
|
+
* - Desktop: Background colours, top red underline when active, rounded corners
|
|
2181
|
+
* - Mobile: Text-only with bottom border underline when active
|
|
2182
|
+
*
|
|
2183
|
+
* @example
|
|
2184
|
+
* ```tsx
|
|
2185
|
+
* // Desktop variant
|
|
2186
|
+
* <TabButton
|
|
2187
|
+
* label="WEB SHOP RESULTS"
|
|
2188
|
+
* count={542}
|
|
2189
|
+
* isActive={true}
|
|
2190
|
+
* onClick={() => setActiveTab('products')}
|
|
2191
|
+
* variant="desktop"
|
|
2192
|
+
* />
|
|
2193
|
+
*
|
|
2194
|
+
* // Mobile variant
|
|
2195
|
+
* <TabButton
|
|
2196
|
+
* label="WEB SHOP"
|
|
2197
|
+
* isActive={false}
|
|
2198
|
+
* onClick={() => setActiveTab('content')}
|
|
2199
|
+
* variant="mobile"
|
|
2200
|
+
* />
|
|
2201
|
+
* ```
|
|
2407
2202
|
*/
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2203
|
+
const TabButton = ({
|
|
2204
|
+
label,
|
|
2205
|
+
count,
|
|
2206
|
+
isActive,
|
|
2207
|
+
onClick,
|
|
2208
|
+
variant = 'desktop',
|
|
2209
|
+
className
|
|
2210
|
+
}) => {
|
|
2211
|
+
const buttonClasses = classNames(styles$4.tabButton, styles$4[`tabButton--${variant}`], {
|
|
2212
|
+
[styles$4['tabButton--active']]: isActive
|
|
2213
|
+
}, className);
|
|
2214
|
+
|
|
2418
2215
|
// Split label to hide " RESULTS" on mobile
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2216
|
+
const labelParts = label.split(' RESULTS');
|
|
2217
|
+
const mainLabel = labelParts[0];
|
|
2218
|
+
const hasResults = labelParts.length > 1;
|
|
2422
2219
|
return /*#__PURE__*/React.createElement("button", {
|
|
2423
2220
|
type: "button",
|
|
2424
2221
|
role: "tab",
|
|
2425
2222
|
"aria-selected": isActive,
|
|
2426
|
-
"aria-controls":
|
|
2223
|
+
"aria-controls": `tabpanel-${label.toLowerCase().replace(/\s+/g, '-')}`,
|
|
2427
2224
|
onClick: onClick,
|
|
2428
2225
|
className: buttonClasses
|
|
2429
2226
|
}, count !== undefined && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
@@ -2435,7 +2232,7 @@ var TabButton = function (_a) {
|
|
|
2435
2232
|
}, " RESULTS")));
|
|
2436
2233
|
};
|
|
2437
2234
|
|
|
2438
|
-
|
|
2235
|
+
const AssistanceIcon = props => {
|
|
2439
2236
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
2440
2237
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2441
2238
|
width: "87",
|
|
@@ -2450,42 +2247,39 @@ var AssistanceIcon = function (props) {
|
|
|
2450
2247
|
|
|
2451
2248
|
var styles$3 = {"assistanceBanner":"AssistanceBanner-module__assistanceBanner___b97es","assistanceBanner__icon":"AssistanceBanner-module__assistanceBanner__icon___8NzJj","assistanceBanner__title":"AssistanceBanner-module__assistanceBanner__title___Wtkkt","assistanceBanner__description":"AssistanceBanner-module__assistanceBanner__description___AjoOr","assistanceBanner__link":"AssistanceBanner-module__assistanceBanner__link___5L45N","assistanceBanner__chevron":"AssistanceBanner-module__assistanceBanner__chevron___4km-f"};
|
|
2452
2249
|
|
|
2453
|
-
/**
|
|
2454
|
-
* AssistanceBanner - Help widget for search sidebar
|
|
2455
|
-
*
|
|
2456
|
-
* Displays a call-to-action for users who need assistance finding products.
|
|
2457
|
-
* Features chat icon, heading, description, and contact link with chevron.
|
|
2458
|
-
*
|
|
2459
|
-
* Desktop only - hidden on mobile to save space.
|
|
2460
|
-
*
|
|
2461
|
-
* @example
|
|
2462
|
-
* ```tsx
|
|
2463
|
-
* <AssistanceBanner
|
|
2464
|
-
* title="Need Assistance?"
|
|
2465
|
-
* description="Can't find what you're looking for? Our team is ready to help."
|
|
2466
|
-
* linkText="Contact support"
|
|
2467
|
-
* linkUrl="/contact"
|
|
2468
|
-
* />
|
|
2469
|
-
* ```
|
|
2250
|
+
/**
|
|
2251
|
+
* AssistanceBanner - Help widget for search sidebar
|
|
2252
|
+
*
|
|
2253
|
+
* Displays a call-to-action for users who need assistance finding products.
|
|
2254
|
+
* Features chat icon, heading, description, and contact link with chevron.
|
|
2255
|
+
*
|
|
2256
|
+
* Desktop only - hidden on mobile to save space.
|
|
2257
|
+
*
|
|
2258
|
+
* @example
|
|
2259
|
+
* ```tsx
|
|
2260
|
+
* <AssistanceBanner
|
|
2261
|
+
* title="Need Assistance?"
|
|
2262
|
+
* description="Can't find what you're looking for? Our team is ready to help."
|
|
2263
|
+
* linkText="Contact support"
|
|
2264
|
+
* linkUrl="/contact"
|
|
2265
|
+
* />
|
|
2266
|
+
* ```
|
|
2470
2267
|
*/
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
onLinkClick = _a.onLinkClick,
|
|
2481
|
-
className = _a.className;
|
|
2482
|
-
var handleLinkClick = function (e) {
|
|
2268
|
+
const AssistanceBanner = ({
|
|
2269
|
+
title = 'Need Assistance?',
|
|
2270
|
+
description = "Can't find what you're looking for? Our team is ready to help.",
|
|
2271
|
+
linkText = 'Contact support',
|
|
2272
|
+
linkUrl = '/contact',
|
|
2273
|
+
onLinkClick,
|
|
2274
|
+
className
|
|
2275
|
+
}) => {
|
|
2276
|
+
const handleLinkClick = e => {
|
|
2483
2277
|
if (onLinkClick) {
|
|
2484
2278
|
e.preventDefault();
|
|
2485
2279
|
onLinkClick();
|
|
2486
2280
|
}
|
|
2487
2281
|
};
|
|
2488
|
-
|
|
2282
|
+
const bannerClasses = classNames(styles$3.assistanceBanner, className);
|
|
2489
2283
|
return /*#__PURE__*/React.createElement("div", {
|
|
2490
2284
|
className: bannerClasses
|
|
2491
2285
|
}, /*#__PURE__*/React.createElement(AssistanceIcon, {
|
|
@@ -2518,105 +2312,111 @@ var AssistanceBanner = function (_a) {
|
|
|
2518
2312
|
|
|
2519
2313
|
var styles$2 = {"drawerOverlay":"FilterDrawer-module__drawerOverlay___P6M4y","drawerOverlay--open":"FilterDrawer-module__drawerOverlay--open___blJZo","drawerPanel":"FilterDrawer-module__drawerPanel___35h-U","drawerPanel--open":"FilterDrawer-module__drawerPanel--open___Fw1SY","drawerCloseButton":"FilterDrawer-module__drawerCloseButton___cfMmf","drawerContent":"FilterDrawer-module__drawerContent___KBff6"};
|
|
2520
2314
|
|
|
2521
|
-
/**
|
|
2522
|
-
* FilterDrawer - Mobile slide-in filter panel
|
|
2523
|
-
*
|
|
2524
|
-
* Slides in from the right with a dark overlay. Used on mobile to show filters
|
|
2525
|
-
* when screen space is limited. Includes focus trap, escape key handling, and
|
|
2526
|
-
* body scroll prevention.
|
|
2527
|
-
*
|
|
2528
|
-
* Desktop: Hidden (filters shown in sidebar)
|
|
2529
|
-
* Mobile: Slide-in drawer overlay
|
|
2530
|
-
*
|
|
2531
|
-
* @example
|
|
2532
|
-
* ```tsx
|
|
2533
|
-
* <FilterDrawer
|
|
2534
|
-
* isOpen={isFilterDrawerOpen}
|
|
2535
|
-
* onClose={() => setIsFilterDrawerOpen(false)}
|
|
2536
|
-
* >
|
|
2537
|
-
* <FiltersPanel facets={facets} onFacetToggle={handleToggle} />
|
|
2538
|
-
* </FilterDrawer>
|
|
2539
|
-
* ```
|
|
2315
|
+
/**
|
|
2316
|
+
* FilterDrawer - Mobile slide-in filter panel
|
|
2317
|
+
*
|
|
2318
|
+
* Slides in from the right with a dark overlay. Used on mobile to show filters
|
|
2319
|
+
* when screen space is limited. Includes focus trap, escape key handling, and
|
|
2320
|
+
* body scroll prevention.
|
|
2321
|
+
*
|
|
2322
|
+
* Desktop: Hidden (filters shown in sidebar)
|
|
2323
|
+
* Mobile: Slide-in drawer overlay
|
|
2324
|
+
*
|
|
2325
|
+
* @example
|
|
2326
|
+
* ```tsx
|
|
2327
|
+
* <FilterDrawer
|
|
2328
|
+
* isOpen={isFilterDrawerOpen}
|
|
2329
|
+
* onClose={() => setIsFilterDrawerOpen(false)}
|
|
2330
|
+
* >
|
|
2331
|
+
* <FiltersPanel facets={facets} onFacetToggle={handleToggle} />
|
|
2332
|
+
* </FilterDrawer>
|
|
2333
|
+
* ```
|
|
2540
2334
|
*/
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2335
|
+
const FilterDrawer = ({
|
|
2336
|
+
isOpen,
|
|
2337
|
+
onClose,
|
|
2338
|
+
children,
|
|
2339
|
+
className
|
|
2340
|
+
}) => {
|
|
2341
|
+
const drawerRef = useRef(null);
|
|
2342
|
+
const previouslyFocusedElement = useRef(null);
|
|
2343
|
+
|
|
2549
2344
|
// Focus management
|
|
2550
|
-
useEffect(
|
|
2345
|
+
useEffect(() => {
|
|
2551
2346
|
if (isOpen) {
|
|
2552
2347
|
// Store previously focused element
|
|
2553
2348
|
previouslyFocusedElement.current = document.activeElement;
|
|
2349
|
+
|
|
2554
2350
|
// Focus the drawer
|
|
2555
2351
|
if (drawerRef.current) {
|
|
2556
2352
|
drawerRef.current.focus();
|
|
2557
2353
|
}
|
|
2354
|
+
|
|
2558
2355
|
// Prevent body scroll
|
|
2559
2356
|
document.body.style.overflow = 'hidden';
|
|
2560
2357
|
} else {
|
|
2561
2358
|
// Restore body scroll
|
|
2562
2359
|
document.body.style.overflow = '';
|
|
2360
|
+
|
|
2563
2361
|
// Return focus to previously focused element
|
|
2564
2362
|
if (previouslyFocusedElement.current) {
|
|
2565
2363
|
previouslyFocusedElement.current.focus();
|
|
2566
2364
|
}
|
|
2567
2365
|
}
|
|
2568
|
-
return
|
|
2366
|
+
return () => {
|
|
2569
2367
|
document.body.style.overflow = '';
|
|
2570
2368
|
};
|
|
2571
2369
|
}, [isOpen]);
|
|
2370
|
+
|
|
2572
2371
|
// Escape key handler
|
|
2573
|
-
useEffect(
|
|
2574
|
-
|
|
2372
|
+
useEffect(() => {
|
|
2373
|
+
const handleEscape = event => {
|
|
2575
2374
|
if (event.key === 'Escape' && isOpen) {
|
|
2576
2375
|
onClose();
|
|
2577
2376
|
}
|
|
2578
2377
|
};
|
|
2579
2378
|
document.addEventListener('keydown', handleEscape);
|
|
2580
|
-
return
|
|
2581
|
-
return document.removeEventListener('keydown', handleEscape);
|
|
2582
|
-
};
|
|
2379
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
2583
2380
|
}, [isOpen, onClose]);
|
|
2381
|
+
|
|
2584
2382
|
// Focus trap implementation
|
|
2585
|
-
useEffect(
|
|
2383
|
+
useEffect(() => {
|
|
2586
2384
|
if (!isOpen || !drawerRef.current) return;
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2385
|
+
const drawer = drawerRef.current;
|
|
2386
|
+
const focusableElements = drawer.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
2387
|
+
const firstElement = focusableElements[0];
|
|
2388
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
2389
|
+
const handleTab = event => {
|
|
2592
2390
|
if (event.key !== 'Tab') return;
|
|
2593
2391
|
if (event.shiftKey) {
|
|
2594
2392
|
// Shift + Tab
|
|
2595
2393
|
if (document.activeElement === firstElement) {
|
|
2596
2394
|
event.preventDefault();
|
|
2597
|
-
lastElement
|
|
2395
|
+
lastElement?.focus();
|
|
2598
2396
|
}
|
|
2599
2397
|
} else {
|
|
2600
2398
|
// Tab
|
|
2601
2399
|
if (document.activeElement === lastElement) {
|
|
2602
2400
|
event.preventDefault();
|
|
2603
|
-
firstElement
|
|
2401
|
+
firstElement?.focus();
|
|
2604
2402
|
}
|
|
2605
2403
|
}
|
|
2606
2404
|
};
|
|
2607
2405
|
drawer.addEventListener('keydown', handleTab);
|
|
2608
|
-
return
|
|
2609
|
-
return drawer.removeEventListener('keydown', handleTab);
|
|
2610
|
-
};
|
|
2406
|
+
return () => drawer.removeEventListener('keydown', handleTab);
|
|
2611
2407
|
}, [isOpen]);
|
|
2612
2408
|
if (!isOpen) return null;
|
|
2613
|
-
|
|
2409
|
+
const handleOverlayClick = event => {
|
|
2614
2410
|
if (event.target === event.currentTarget) {
|
|
2615
2411
|
onClose();
|
|
2616
2412
|
}
|
|
2617
2413
|
};
|
|
2618
|
-
|
|
2619
|
-
|
|
2414
|
+
const overlayClasses = classNames(styles$2.drawerOverlay, {
|
|
2415
|
+
[styles$2['drawerOverlay--open']]: isOpen
|
|
2416
|
+
});
|
|
2417
|
+
const panelClasses = classNames(styles$2.drawerPanel, {
|
|
2418
|
+
[styles$2['drawerPanel--open']]: isOpen
|
|
2419
|
+
}, className);
|
|
2620
2420
|
return /*#__PURE__*/React.createElement("div", {
|
|
2621
2421
|
className: overlayClasses,
|
|
2622
2422
|
onClick: handleOverlayClick,
|
|
@@ -2640,63 +2440,63 @@ var FilterDrawer = function (_a) {
|
|
|
2640
2440
|
}, children)));
|
|
2641
2441
|
};
|
|
2642
2442
|
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2443
|
+
const FederatedResultsView = ({
|
|
2444
|
+
query,
|
|
2445
|
+
onQueryChange,
|
|
2446
|
+
onSearchSubmit,
|
|
2447
|
+
activeTab,
|
|
2448
|
+
onTabChange,
|
|
2449
|
+
products,
|
|
2450
|
+
contents,
|
|
2451
|
+
isLoadingProducts,
|
|
2452
|
+
isLoadingContents,
|
|
2453
|
+
productsError,
|
|
2454
|
+
contentsError,
|
|
2455
|
+
currentPage,
|
|
2456
|
+
totalPages,
|
|
2457
|
+
onPageChange,
|
|
2458
|
+
facets,
|
|
2459
|
+
onFacetToggle,
|
|
2460
|
+
isFilterDrawerOpen,
|
|
2461
|
+
onFilterDrawerToggle,
|
|
2462
|
+
onFilterDrawerClose
|
|
2463
|
+
}) => {
|
|
2464
|
+
const isLoading = activeTab === "products" && isLoadingProducts || activeTab === "content" && isLoadingContents;
|
|
2465
|
+
const error = activeTab === "products" ? productsError : contentsError;
|
|
2466
|
+
|
|
2665
2467
|
// Filter results based on active tab
|
|
2666
|
-
|
|
2667
|
-
|
|
2468
|
+
const displayProducts = activeTab === "content" ? [] : products;
|
|
2469
|
+
const displayContents = activeTab === "products" ? [] : contents;
|
|
2470
|
+
|
|
2668
2471
|
// Content tab single-select handler (clears all others when selecting)
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
return f.attribute === attribute;
|
|
2672
|
-
});
|
|
2472
|
+
const handleContentCategorySelect = useCallback((attribute, value) => {
|
|
2473
|
+
const facet = facets.find(f => f.attribute === attribute);
|
|
2673
2474
|
if (!facet) return;
|
|
2475
|
+
|
|
2674
2476
|
// Clear ALL values in this facet first
|
|
2675
|
-
facet.values.forEach(
|
|
2477
|
+
facet.values.forEach(v => {
|
|
2676
2478
|
if (v.isRefined) {
|
|
2677
2479
|
onFacetToggle(attribute, v.value); // Unselect
|
|
2678
2480
|
}
|
|
2679
2481
|
});
|
|
2482
|
+
|
|
2680
2483
|
// Then select the clicked value (if not already selected)
|
|
2681
|
-
|
|
2682
|
-
return v.value === value;
|
|
2683
|
-
});
|
|
2484
|
+
const clickedValue = facet.values.find(v => v.value === value);
|
|
2684
2485
|
if (clickedValue && !clickedValue.isRefined) {
|
|
2685
2486
|
onFacetToggle(attribute, value); // Select
|
|
2686
2487
|
}
|
|
2687
2488
|
}, [facets, onFacetToggle]);
|
|
2489
|
+
|
|
2688
2490
|
// Track if any filters applied
|
|
2689
|
-
|
|
2690
|
-
return facets.some(
|
|
2691
|
-
return facet.values.some(function (value) {
|
|
2692
|
-
return value.isRefined;
|
|
2693
|
-
});
|
|
2694
|
-
});
|
|
2491
|
+
const hasAppliedFilters = useMemo(() => {
|
|
2492
|
+
return facets.some(facet => facet.values.some(value => value.isRefined));
|
|
2695
2493
|
}, [facets]);
|
|
2494
|
+
|
|
2696
2495
|
// Track previous filter state to detect transitions
|
|
2697
|
-
|
|
2496
|
+
const prevHasAppliedFilters = useRef(hasAppliedFilters);
|
|
2497
|
+
|
|
2698
2498
|
// Auto-close drawer when transitioning FROM filters applied TO no filters (mobile only)
|
|
2699
|
-
useEffect(
|
|
2499
|
+
useEffect(() => {
|
|
2700
2500
|
// Only close if we HAD filters and now have NONE (not on initial open)
|
|
2701
2501
|
if (prevHasAppliedFilters.current && !hasAppliedFilters && isFilterDrawerOpen && onFilterDrawerClose) {
|
|
2702
2502
|
onFilterDrawerClose();
|
|
@@ -2706,7 +2506,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2706
2506
|
return /*#__PURE__*/React.createElement("div", {
|
|
2707
2507
|
className: styles$5.resultsView
|
|
2708
2508
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2709
|
-
className:
|
|
2509
|
+
className: `${styles$5.searchBarWrapper} ${styles$5.searchBarDesktopOnly}`
|
|
2710
2510
|
}, /*#__PURE__*/React.createElement(SearchBar, {
|
|
2711
2511
|
value: query,
|
|
2712
2512
|
onChange: onQueryChange,
|
|
@@ -2714,7 +2514,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2714
2514
|
placeholder: "Refine your search...",
|
|
2715
2515
|
variant: "results"
|
|
2716
2516
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2717
|
-
className:
|
|
2517
|
+
className: `${styles$5.tabsContainer} ${styles$5.tabsContainerDesktopOnly}`
|
|
2718
2518
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2719
2519
|
className: styles$5.tabs,
|
|
2720
2520
|
role: "tablist"
|
|
@@ -2722,9 +2522,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2722
2522
|
label: "WEB SHOP RESULTS",
|
|
2723
2523
|
count: products.length,
|
|
2724
2524
|
isActive: activeTab === "products",
|
|
2725
|
-
onClick:
|
|
2726
|
-
return onTabChange("products");
|
|
2727
|
-
},
|
|
2525
|
+
onClick: () => onTabChange("products"),
|
|
2728
2526
|
variant: "desktop"
|
|
2729
2527
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2730
2528
|
className: styles$5.tabSeparator
|
|
@@ -2732,9 +2530,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2732
2530
|
label: "WEBSITE RESULTS",
|
|
2733
2531
|
count: contents.length,
|
|
2734
2532
|
isActive: activeTab === "content",
|
|
2735
|
-
onClick:
|
|
2736
|
-
return onTabChange("content");
|
|
2737
|
-
},
|
|
2533
|
+
onClick: () => onTabChange("content"),
|
|
2738
2534
|
variant: "desktop"
|
|
2739
2535
|
})), onFilterDrawerToggle && /*#__PURE__*/React.createElement("button", {
|
|
2740
2536
|
type: "button",
|
|
@@ -2763,9 +2559,9 @@ var FederatedResultsView = function (_a) {
|
|
|
2763
2559
|
})), /*#__PURE__*/React.createElement("main", {
|
|
2764
2560
|
className: styles$5.mainContent
|
|
2765
2561
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2766
|
-
id:
|
|
2562
|
+
id: `tabpanel-${activeTab}`,
|
|
2767
2563
|
role: "tabpanel",
|
|
2768
|
-
"aria-labelledby":
|
|
2564
|
+
"aria-labelledby": `tab-${activeTab}`
|
|
2769
2565
|
}, /*#__PURE__*/React.createElement(ResultsList, {
|
|
2770
2566
|
type: activeTab,
|
|
2771
2567
|
products: displayProducts,
|
|
@@ -2780,7 +2576,7 @@ var FederatedResultsView = function (_a) {
|
|
|
2780
2576
|
onPageChange: onPageChange,
|
|
2781
2577
|
maxVisiblePages: 10,
|
|
2782
2578
|
showPrevious: false,
|
|
2783
|
-
ariaLabel:
|
|
2579
|
+
ariaLabel: `${activeTab === "products" ? "Products" : "Content"} pagination`
|
|
2784
2580
|
}))))), onFilterDrawerClose && /*#__PURE__*/React.createElement(FilterDrawer, {
|
|
2785
2581
|
isOpen: isFilterDrawerOpen || false,
|
|
2786
2582
|
onClose: onFilterDrawerClose
|
|
@@ -2794,76 +2590,73 @@ var FederatedResultsView = function (_a) {
|
|
|
2794
2590
|
|
|
2795
2591
|
var styles$1 = {"searchExperience":"FederatedSearchExperience-module__searchExperience___gug9X","searchBarSection":"FederatedSearchExperience-module__searchBarSection___f0Ykq","searchBarDesktopOnly":"FederatedSearchExperience-module__searchBarDesktopOnly___CetKZ","searchBarMobileOnly":"FederatedSearchExperience-module__searchBarMobileOnly___Ityxp","resultsHeaderMobileOnly":"FederatedSearchExperience-module__resultsHeaderMobileOnly___09ef-","tabsContainerSticky":"FederatedSearchExperience-module__tabsContainerSticky___-HdY5","tabs":"FederatedSearchExperience-module__tabs___Vatv8","tabSeparator":"FederatedSearchExperience-module__tabSeparator___AUjhW","mobileFilterButtonWrapper":"FederatedSearchExperience-module__mobileFilterButtonWrapper___JkRtk","mobileFilterButton":"FederatedSearchExperience-module__mobileFilterButton___sRc-w","filterIndicatorDot":"FederatedSearchExperience-module__filterIndicatorDot___vqVi2","instantResultsSection":"FederatedSearchExperience-module__instantResultsSection___AG3qn","fullResultsSection":"FederatedSearchExperience-module__fullResultsSection___NH16U"};
|
|
2796
2592
|
|
|
2797
|
-
/**
|
|
2798
|
-
* FederatedSearchExperience - Top-level search experience component
|
|
2799
|
-
*
|
|
2800
|
-
* This component orchestrates the entire federated search experience, including:
|
|
2801
|
-
* - Modal container
|
|
2802
|
-
* - Search input
|
|
2803
|
-
* - Instant results (2-column layout)
|
|
2804
|
-
* - Full results view with tabs and filters
|
|
2805
|
-
*
|
|
2806
|
-
* The component is fully controlled and does not contain any data fetching logic.
|
|
2807
|
-
* All data and callbacks are passed in via props, making it suitable for use in AEM
|
|
2808
|
-
* where a controller layer will handle Algolia integration.
|
|
2809
|
-
*
|
|
2810
|
-
* @example
|
|
2811
|
-
* ```tsx
|
|
2812
|
-
* <FederatedSearchExperience
|
|
2813
|
-
* isOpen={isOpen}
|
|
2814
|
-
* onOpen={handleOpen}
|
|
2815
|
-
* onClose={handleClose}
|
|
2816
|
-
* query={query}
|
|
2817
|
-
* onQueryChange={setQuery}
|
|
2818
|
-
* onSearchSubmit={handleSubmit}
|
|
2819
|
-
* products={products}
|
|
2820
|
-
* contents={contents}
|
|
2821
|
-
* isLoadingProducts={isLoadingProducts}
|
|
2822
|
-
* isLoadingContents={isLoadingContents}
|
|
2823
|
-
* onSeeAllProducts={handleSeeAllProducts}
|
|
2824
|
-
* onSeeAllContents={handleSeeAllContents}
|
|
2825
|
-
* onSeeAllCombined={handleSeeAllCombined}
|
|
2826
|
-
* activeView={activeView}
|
|
2827
|
-
* onChangeView={setActiveView}
|
|
2828
|
-
* activeTab={activeTab}
|
|
2829
|
-
* onTabChange={setActiveTab}
|
|
2830
|
-
* />
|
|
2831
|
-
* ```
|
|
2593
|
+
/**
|
|
2594
|
+
* FederatedSearchExperience - Top-level search experience component
|
|
2595
|
+
*
|
|
2596
|
+
* This component orchestrates the entire federated search experience, including:
|
|
2597
|
+
* - Modal container
|
|
2598
|
+
* - Search input
|
|
2599
|
+
* - Instant results (2-column layout)
|
|
2600
|
+
* - Full results view with tabs and filters
|
|
2601
|
+
*
|
|
2602
|
+
* The component is fully controlled and does not contain any data fetching logic.
|
|
2603
|
+
* All data and callbacks are passed in via props, making it suitable for use in AEM
|
|
2604
|
+
* where a controller layer will handle Algolia integration.
|
|
2605
|
+
*
|
|
2606
|
+
* @example
|
|
2607
|
+
* ```tsx
|
|
2608
|
+
* <FederatedSearchExperience
|
|
2609
|
+
* isOpen={isOpen}
|
|
2610
|
+
* onOpen={handleOpen}
|
|
2611
|
+
* onClose={handleClose}
|
|
2612
|
+
* query={query}
|
|
2613
|
+
* onQueryChange={setQuery}
|
|
2614
|
+
* onSearchSubmit={handleSubmit}
|
|
2615
|
+
* products={products}
|
|
2616
|
+
* contents={contents}
|
|
2617
|
+
* isLoadingProducts={isLoadingProducts}
|
|
2618
|
+
* isLoadingContents={isLoadingContents}
|
|
2619
|
+
* onSeeAllProducts={handleSeeAllProducts}
|
|
2620
|
+
* onSeeAllContents={handleSeeAllContents}
|
|
2621
|
+
* onSeeAllCombined={handleSeeAllCombined}
|
|
2622
|
+
* activeView={activeView}
|
|
2623
|
+
* onChangeView={setActiveView}
|
|
2624
|
+
* activeTab={activeTab}
|
|
2625
|
+
* onTabChange={setActiveTab}
|
|
2626
|
+
* />
|
|
2627
|
+
* ```
|
|
2832
2628
|
*/
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2629
|
+
const FederatedSearchExperience = ({
|
|
2630
|
+
isOpen,
|
|
2631
|
+
onClose,
|
|
2632
|
+
query,
|
|
2633
|
+
onQueryChange,
|
|
2634
|
+
onSearchSubmit,
|
|
2635
|
+
products,
|
|
2636
|
+
contents,
|
|
2637
|
+
isLoadingProducts,
|
|
2638
|
+
isLoadingContents,
|
|
2639
|
+
productsError,
|
|
2640
|
+
contentsError,
|
|
2641
|
+
onSeeAllProducts,
|
|
2642
|
+
onSeeAllContents,
|
|
2643
|
+
onSeeAllCombined,
|
|
2644
|
+
activeView,
|
|
2645
|
+
onChangeView,
|
|
2646
|
+
activeTab,
|
|
2647
|
+
onTabChange,
|
|
2648
|
+
currentPage,
|
|
2649
|
+
totalPages,
|
|
2650
|
+
onPageChange,
|
|
2651
|
+
facets,
|
|
2652
|
+
onFacetToggle,
|
|
2653
|
+
isFilterDrawerOpen,
|
|
2654
|
+
onFilterDrawerToggle,
|
|
2655
|
+
onFilterDrawerClose
|
|
2656
|
+
}) => {
|
|
2860
2657
|
// Track if any filters are active (for red dot indicator)
|
|
2861
|
-
|
|
2862
|
-
return facets.some(
|
|
2863
|
-
return facet.values.some(function (value) {
|
|
2864
|
-
return value.isRefined;
|
|
2865
|
-
});
|
|
2866
|
-
});
|
|
2658
|
+
const hasAppliedFilters = useMemo(() => {
|
|
2659
|
+
return facets.some(facet => facet.values.some(value => value.isRefined));
|
|
2867
2660
|
}, [facets]);
|
|
2868
2661
|
return /*#__PURE__*/React.createElement(SearchModal, {
|
|
2869
2662
|
isOpen: isOpen,
|
|
@@ -2895,9 +2688,7 @@ var FederatedSearchExperience = function (_a) {
|
|
|
2895
2688
|
label: "WEB SHOP RESULTS",
|
|
2896
2689
|
count: products.length,
|
|
2897
2690
|
isActive: activeTab === "products",
|
|
2898
|
-
onClick:
|
|
2899
|
-
return onTabChange("products");
|
|
2900
|
-
},
|
|
2691
|
+
onClick: () => onTabChange("products"),
|
|
2901
2692
|
variant: "mobile"
|
|
2902
2693
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2903
2694
|
className: styles$1.tabSeparator
|
|
@@ -2905,9 +2696,7 @@ var FederatedSearchExperience = function (_a) {
|
|
|
2905
2696
|
label: "WEBSITE RESULTS",
|
|
2906
2697
|
count: contents.length,
|
|
2907
2698
|
isActive: activeTab === "content",
|
|
2908
|
-
onClick:
|
|
2909
|
-
return onTabChange("content");
|
|
2910
|
-
},
|
|
2699
|
+
onClick: () => onTabChange("content"),
|
|
2911
2700
|
variant: "mobile"
|
|
2912
2701
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2913
2702
|
className: styles$1.mobileFilterButtonWrapper
|
|
@@ -2932,7 +2721,7 @@ var FederatedSearchExperience = function (_a) {
|
|
|
2932
2721
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2933
2722
|
className: styles$1.searchExperience
|
|
2934
2723
|
}, activeView === "instant" && /*#__PURE__*/React.createElement("div", {
|
|
2935
|
-
className:
|
|
2724
|
+
className: `${styles$1.searchBarSection} ${styles$1.searchBarDesktopOnly}`
|
|
2936
2725
|
}, /*#__PURE__*/React.createElement(SearchBar, {
|
|
2937
2726
|
value: query,
|
|
2938
2727
|
onChange: onQueryChange,
|
|
@@ -3000,14 +2789,13 @@ var FederatedSearchExperience = function (_a) {
|
|
|
3000
2789
|
|
|
3001
2790
|
var styles = {"searchTrigger":"SearchTriggerButton-module__searchTrigger___PDbDB","searchIcon":"SearchTriggerButton-module__searchIcon___izByW","label":"SearchTriggerButton-module__label___mkS7T"};
|
|
3002
2791
|
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
var handleKeyDown = function (event) {
|
|
2792
|
+
const SearchTriggerButton = ({
|
|
2793
|
+
onOpen,
|
|
2794
|
+
ariaLabel = 'Open search',
|
|
2795
|
+
label,
|
|
2796
|
+
className = ''
|
|
2797
|
+
}) => {
|
|
2798
|
+
const handleKeyDown = event => {
|
|
3011
2799
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
3012
2800
|
event.preventDefault();
|
|
3013
2801
|
onOpen();
|
|
@@ -3018,7 +2806,7 @@ var SearchTriggerButton = function (_a) {
|
|
|
3018
2806
|
onClick: onOpen,
|
|
3019
2807
|
onKeyDown: handleKeyDown,
|
|
3020
2808
|
"aria-label": ariaLabel,
|
|
3021
|
-
className:
|
|
2809
|
+
className: `${styles.searchTrigger} ${className}`
|
|
3022
2810
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
3023
2811
|
className: styles.searchIcon,
|
|
3024
2812
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3040,5 +2828,5 @@ var SearchTriggerButton = function (_a) {
|
|
|
3040
2828
|
}, label));
|
|
3041
2829
|
};
|
|
3042
2830
|
|
|
3043
|
-
export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button,
|
|
2831
|
+
export { AlgoliaDynamicSearchLeybold as AlgoliaDynamicSearch, AlgoliaDynamicSearchLeybold, AppliedFilterTag, AppliedFilters, Button, ContentCardHorizontal, FederatedInstantResultsLayout, FederatedResultsView, FederatedSearchExperience, FilterAccordion, FilterItem, FilterSearch, FiltersPanel, Footer, FooterBottom, FooterLink, FooterLinkGroup, FooterSocialIcon, FooterSocialIcons, ModalCloseButton, Pagination, PaginationButton, PaginationEllipsis, PaginationItem, ProductCardHorizontal, ProductCardVertical, QrFormLeybold as QrForm, QrFormLeybold, ResultsColumn, ResultsCount, ResultsList, SearchBar, SearchIcon, SearchInput, SearchModal, SearchSubmitButton, SearchTriggerButton, SeeAllLinkButton };
|
|
3044
2832
|
//# sourceMappingURL=index.esm.js.map
|