@asantemedia-org/leybold-design-system 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.next/types/app/layout.d.ts +9 -0
- package/dist/.next/types/app/page.d.ts +9 -0
- package/dist/index.esm.js +775 -750
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +775 -750
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -14,6 +14,45 @@ function _extends() {
|
|
|
14
14
|
}, _extends.apply(null, arguments);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/******************************************************************************
|
|
18
|
+
Copyright (c) Microsoft Corporation.
|
|
19
|
+
|
|
20
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
21
|
+
purpose with or without fee is hereby granted.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
24
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
25
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
26
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
27
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
28
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
29
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
30
|
+
***************************************************************************** */
|
|
31
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
32
|
+
|
|
33
|
+
var __assign = function () {
|
|
34
|
+
__assign = Object.assign || function __assign(t) {
|
|
35
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
+
s = arguments[i];
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
};
|
|
41
|
+
return __assign.apply(this, arguments);
|
|
42
|
+
};
|
|
43
|
+
function __rest(s, e) {
|
|
44
|
+
var t = {};
|
|
45
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
46
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
47
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
}
|
|
51
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
52
|
+
var e = new Error(message);
|
|
53
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
54
|
+
};
|
|
55
|
+
|
|
17
56
|
var styles$g = {"button":"Button-module__button___18Bed","button--primary":"Button-module__button--primary___VuF-P","button--default":"Button-module__button--default___MDa35","button--disabled":"Button-module__button--disabled___IuOY8","button--secondary":"Button-module__button--secondary___lD5E3","button--solid-red":"Button-module__button--solid-red___YPpnL","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-red":"Button-module__button--outlined-red___cgZXa","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
57
|
|
|
19
58
|
function getDefaultExportFromCjs (x) {
|
|
@@ -91,22 +130,10 @@ function requireClassnames() {
|
|
|
91
130
|
var classnamesExports = requireClassnames();
|
|
92
131
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
93
132
|
|
|
94
|
-
/**
|
|
95
|
-
* Button variant types
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Icon types for button
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Icon position
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
133
|
/**
|
|
107
134
|
* Get the icon component based on icon type
|
|
108
135
|
*/
|
|
109
|
-
|
|
136
|
+
var getIcon = function (icon) {
|
|
110
137
|
switch (icon) {
|
|
111
138
|
case "arrow-right":
|
|
112
139
|
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
@@ -128,11 +155,10 @@ const getIcon = icon => {
|
|
|
128
155
|
return null;
|
|
129
156
|
}
|
|
130
157
|
};
|
|
131
|
-
|
|
132
158
|
/**
|
|
133
159
|
* Get default icon for certain variants
|
|
134
160
|
*/
|
|
135
|
-
|
|
161
|
+
var getDefaultIcon = function (variant) {
|
|
136
162
|
switch (variant) {
|
|
137
163
|
case "link-text":
|
|
138
164
|
case "link-text-alt":
|
|
@@ -149,11 +175,10 @@ const getDefaultIcon = variant => {
|
|
|
149
175
|
return "none";
|
|
150
176
|
}
|
|
151
177
|
};
|
|
152
|
-
|
|
153
178
|
/**
|
|
154
179
|
* Map alias variants to their actual CSS class variants
|
|
155
180
|
*/
|
|
156
|
-
|
|
181
|
+
var mapVariantToClass = function (variant) {
|
|
157
182
|
switch (variant) {
|
|
158
183
|
case "outline":
|
|
159
184
|
return "outlined-red";
|
|
@@ -163,42 +188,41 @@ const mapVariantToClass = variant => {
|
|
|
163
188
|
return variant;
|
|
164
189
|
}
|
|
165
190
|
};
|
|
166
|
-
|
|
167
191
|
/**
|
|
168
192
|
* Primary UI component for user interaction
|
|
169
193
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
194
|
+
var Button = function (_a) {
|
|
195
|
+
var _b;
|
|
196
|
+
var children = _a.children,
|
|
197
|
+
_c = _a.variant,
|
|
198
|
+
variant = _c === void 0 ? "primary" : _c,
|
|
199
|
+
_d = _a.size,
|
|
200
|
+
size = _d === void 0 ? "medium" : _d,
|
|
201
|
+
_e = _a.disabled,
|
|
202
|
+
disabled = _e === void 0 ? false : _e,
|
|
203
|
+
onClick = _a.onClick,
|
|
204
|
+
_f = _a.type,
|
|
205
|
+
type = _f === void 0 ? "button" : _f,
|
|
206
|
+
className = _a.className,
|
|
207
|
+
icon = _a.icon,
|
|
208
|
+
_g = _a.iconPosition,
|
|
209
|
+
iconPosition = _g === void 0 ? "right" : _g,
|
|
210
|
+
ariaLabel = _a.ariaLabel;
|
|
211
|
+
_a.opensInNewTab;
|
|
212
|
+
var props = __rest(_a, ["children", "variant", "size", "disabled", "onClick", "type", "className", "icon", "iconPosition", "ariaLabel", "opensInNewTab"]);
|
|
184
213
|
// Map alias variants to actual class names
|
|
185
|
-
|
|
186
|
-
|
|
214
|
+
var cssVariant = mapVariantToClass(variant);
|
|
187
215
|
// Determine the icon to display
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
216
|
+
var displayIcon = icon !== null && icon !== void 0 ? icon : getDefaultIcon(variant);
|
|
217
|
+
var iconElement = getIcon(displayIcon);
|
|
191
218
|
// Check if this is an icon-only button (carousel arrows)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}, className);
|
|
198
|
-
const iconClasses = classNames(styles$g.button__icon, styles$g[`button__icon--${iconPosition}`]);
|
|
199
|
-
|
|
219
|
+
var isIconOnly = variant === "carousel-arrow-left" || variant === "carousel-arrow-right";
|
|
220
|
+
var isCarouselLeft = variant === "carousel-arrow-left";
|
|
221
|
+
var isCarouselRight = variant === "carousel-arrow-right";
|
|
222
|
+
var buttonClasses = classNames(styles$g.button, styles$g["button--".concat(cssVariant)], styles$g["button--".concat(size)], (_b = {}, _b[styles$g["button--disabled"]] = disabled, _b), className);
|
|
223
|
+
var iconClasses = classNames(styles$g.button__icon, styles$g["button__icon--".concat(iconPosition)]);
|
|
200
224
|
// Generate accessible label for icon-only buttons
|
|
201
|
-
|
|
225
|
+
var accessibleLabel = ariaLabel || (isIconOnly ? variant === "carousel-arrow-left" ? "Previous" : "Next" : undefined);
|
|
202
226
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
203
227
|
type: type,
|
|
204
228
|
className: buttonClasses,
|
|
@@ -232,61 +256,59 @@ var styles$f = {"footer":"Footer-module__footer___Oavyx","footer--mobile":"Foote
|
|
|
232
256
|
/**
|
|
233
257
|
* External link icon (↗) for footer links that open in new tabs
|
|
234
258
|
*/
|
|
235
|
-
|
|
236
|
-
className,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
259
|
+
var ExternalLinkIcon = function (_a) {
|
|
260
|
+
var className = _a.className,
|
|
261
|
+
_b = _a.size,
|
|
262
|
+
size = _b === void 0 ? 15 : _b;
|
|
263
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
264
|
+
width: size,
|
|
265
|
+
height: size,
|
|
266
|
+
viewBox: "0 0 15 15",
|
|
267
|
+
fill: "none",
|
|
268
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
269
|
+
className: className,
|
|
270
|
+
"aria-hidden": "true"
|
|
271
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
272
|
+
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",
|
|
273
|
+
stroke: "currentColor",
|
|
274
|
+
strokeWidth: "1.5",
|
|
275
|
+
strokeLinecap: "round",
|
|
276
|
+
strokeLinejoin: "round"
|
|
277
|
+
}));
|
|
278
|
+
};
|
|
253
279
|
|
|
254
280
|
/**
|
|
255
281
|
* Atlas Copco Group badge icon (square)
|
|
256
282
|
*/
|
|
257
|
-
|
|
258
|
-
className,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
// TYPE DEFINITIONS
|
|
280
|
-
// =============================================================================
|
|
283
|
+
var AtlasCopcoIcon = function (_a) {
|
|
284
|
+
var className = _a.className,
|
|
285
|
+
_b = _a.size,
|
|
286
|
+
size = _b === void 0 ? 14 : _b;
|
|
287
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
288
|
+
width: size,
|
|
289
|
+
height: size,
|
|
290
|
+
viewBox: "0 0 14 14",
|
|
291
|
+
fill: "none",
|
|
292
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
293
|
+
className: className,
|
|
294
|
+
"aria-hidden": "true"
|
|
295
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
296
|
+
x: "0.5",
|
|
297
|
+
y: "0.5",
|
|
298
|
+
width: "13",
|
|
299
|
+
height: "13",
|
|
300
|
+
rx: "1.5",
|
|
301
|
+
fill: "#D9D9D9",
|
|
302
|
+
stroke: "#D9D9D9"
|
|
303
|
+
}));
|
|
304
|
+
};
|
|
281
305
|
|
|
282
306
|
// =============================================================================
|
|
283
307
|
// SOCIAL ICON COMPONENT
|
|
284
308
|
// =============================================================================
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}) => {
|
|
289
|
-
const iconMap = {
|
|
309
|
+
var SocialIconComponent = function (_a) {
|
|
310
|
+
var platform = _a.platform;
|
|
311
|
+
var iconMap = {
|
|
290
312
|
facebook: faFacebookF,
|
|
291
313
|
x: faXTwitter,
|
|
292
314
|
linkedin: faLinkedinIn,
|
|
@@ -297,19 +319,14 @@ const SocialIconComponent = ({
|
|
|
297
319
|
icon: iconMap[platform]
|
|
298
320
|
});
|
|
299
321
|
};
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
variant = 'default'
|
|
309
|
-
}) => {
|
|
310
|
-
const baseClass = variant === 'bottom' ? styles$f.footer__bottomLink : styles$f.footer__link;
|
|
311
|
-
const linkClasses = classNames(baseClass, className);
|
|
312
|
-
const handleClick = e => {
|
|
322
|
+
var FooterLink = function (_a) {
|
|
323
|
+
var item = _a.item,
|
|
324
|
+
className = _a.className,
|
|
325
|
+
_b = _a.variant,
|
|
326
|
+
variant = _b === void 0 ? 'default' : _b;
|
|
327
|
+
var baseClass = variant === 'bottom' ? styles$f.footer__bottomLink : styles$f.footer__link;
|
|
328
|
+
var linkClasses = classNames(baseClass, className);
|
|
329
|
+
var handleClick = function (e) {
|
|
313
330
|
if (item.onClick) {
|
|
314
331
|
e.preventDefault();
|
|
315
332
|
item.onClick();
|
|
@@ -330,89 +347,71 @@ const FooterLink = ({
|
|
|
330
347
|
size: 15
|
|
331
348
|
})));
|
|
332
349
|
};
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const FooterLinkGroup = ({
|
|
339
|
-
heading,
|
|
340
|
-
links,
|
|
341
|
-
className,
|
|
342
|
-
children
|
|
343
|
-
}) => {
|
|
350
|
+
var FooterLinkGroup = function (_a) {
|
|
351
|
+
var heading = _a.heading,
|
|
352
|
+
links = _a.links,
|
|
353
|
+
className = _a.className,
|
|
354
|
+
children = _a.children;
|
|
344
355
|
return /*#__PURE__*/React.createElement("div", {
|
|
345
356
|
className: classNames(styles$f.footer__linkGroup, className)
|
|
346
357
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
347
358
|
className: styles$f.footer__linkHeading
|
|
348
359
|
}, heading), /*#__PURE__*/React.createElement("ul", {
|
|
349
360
|
className: styles$f.footer__linkList
|
|
350
|
-
}, links.map((link, index)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
361
|
+
}, links.map(function (link, index) {
|
|
362
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
363
|
+
key: index
|
|
364
|
+
}, /*#__PURE__*/React.createElement(FooterLink, {
|
|
365
|
+
item: link
|
|
366
|
+
}));
|
|
367
|
+
})), children);
|
|
355
368
|
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
// =============================================================================
|
|
360
|
-
|
|
361
|
-
const FooterSocialIcons = ({
|
|
362
|
-
links,
|
|
363
|
-
className
|
|
364
|
-
}) => {
|
|
369
|
+
var FooterSocialIcons = function (_a) {
|
|
370
|
+
var links = _a.links,
|
|
371
|
+
className = _a.className;
|
|
365
372
|
return /*#__PURE__*/React.createElement("div", {
|
|
366
373
|
className: classNames(styles$f.footer__socialIcons, className)
|
|
367
|
-
}, links.map((link, index)
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
}, links.map(function (link, index) {
|
|
375
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
376
|
+
key: index,
|
|
377
|
+
href: link.href,
|
|
378
|
+
className: styles$f.footer__socialIcon,
|
|
379
|
+
"aria-label": link.ariaLabel,
|
|
380
|
+
target: "_blank",
|
|
381
|
+
rel: "noopener noreferrer"
|
|
382
|
+
}, /*#__PURE__*/React.createElement(SocialIconComponent, {
|
|
383
|
+
platform: link.platform
|
|
384
|
+
}));
|
|
385
|
+
}));
|
|
377
386
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const FooterSocialIcon = ({
|
|
384
|
-
platform,
|
|
385
|
-
className
|
|
386
|
-
}) => {
|
|
387
|
-
const iconClasses = classNames(styles$f.footer__socialIcon, className);
|
|
387
|
+
var FooterSocialIcon = function (_a) {
|
|
388
|
+
var platform = _a.platform,
|
|
389
|
+
className = _a.className;
|
|
390
|
+
var iconClasses = classNames(styles$f.footer__socialIcon, className);
|
|
388
391
|
return /*#__PURE__*/React.createElement("span", {
|
|
389
392
|
className: iconClasses
|
|
390
393
|
}, /*#__PURE__*/React.createElement(SocialIconComponent, {
|
|
391
394
|
platform: platform
|
|
392
395
|
}));
|
|
393
396
|
};
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const FooterBottom = ({
|
|
400
|
-
links,
|
|
401
|
-
copyright,
|
|
402
|
-
countrySelector,
|
|
403
|
-
className
|
|
404
|
-
}) => {
|
|
397
|
+
var FooterBottom = function (_a) {
|
|
398
|
+
var links = _a.links,
|
|
399
|
+
copyright = _a.copyright,
|
|
400
|
+
countrySelector = _a.countrySelector,
|
|
401
|
+
className = _a.className;
|
|
405
402
|
return /*#__PURE__*/React.createElement("div", {
|
|
406
403
|
className: classNames(styles$f.footer__bottom, className)
|
|
407
404
|
}, /*#__PURE__*/React.createElement("div", {
|
|
408
405
|
className: styles$f.footer__bottomLeft
|
|
409
406
|
}, /*#__PURE__*/React.createElement("div", {
|
|
410
407
|
className: styles$f.footer__bottomLinks
|
|
411
|
-
}, links.map((link, index)
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
408
|
+
}, links.map(function (link, index) {
|
|
409
|
+
return /*#__PURE__*/React.createElement(FooterLink, {
|
|
410
|
+
key: index,
|
|
411
|
+
item: link,
|
|
412
|
+
variant: "bottom"
|
|
413
|
+
});
|
|
414
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
416
415
|
className: styles$f.footer__copyright
|
|
417
416
|
}, copyright)), countrySelector && /*#__PURE__*/React.createElement("a", {
|
|
418
417
|
href: countrySelector.href || '#',
|
|
@@ -423,61 +422,61 @@ const FooterBottom = ({
|
|
|
423
422
|
icon: faGlobe
|
|
424
423
|
})), countrySelector.label));
|
|
425
424
|
};
|
|
426
|
-
|
|
427
425
|
// =============================================================================
|
|
428
426
|
// MAIN FOOTER COMPONENT
|
|
429
427
|
// =============================================================================
|
|
430
|
-
|
|
431
428
|
/**
|
|
432
429
|
* Footer component with brand identity, navigation links, social icons, and legal information.
|
|
433
430
|
* Supports two layout variants:
|
|
434
431
|
* - desktop: Logo at top, 3-column main content
|
|
435
432
|
* - mobile: Logo at bottom, stacked layout with CTA button
|
|
436
433
|
*/
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
434
|
+
var Footer = function (_a) {
|
|
435
|
+
var _b = _a.variant,
|
|
436
|
+
variant = _b === void 0 ? 'desktop' : _b,
|
|
437
|
+
logo = _a.logo,
|
|
438
|
+
motto = _a.motto,
|
|
439
|
+
atlasCopcoBadge = _a.atlasCopcoBadge,
|
|
440
|
+
quickLinks = _a.quickLinks,
|
|
441
|
+
_c = _a.quickLinksHeading,
|
|
442
|
+
quickLinksHeading = _c === void 0 ? 'Quick links' : _c,
|
|
443
|
+
contactLinks = _a.contactLinks,
|
|
444
|
+
_d = _a.contactHeading,
|
|
445
|
+
contactHeading = _d === void 0 ? 'Contact us' : _d,
|
|
446
|
+
socialLinks = _a.socialLinks,
|
|
447
|
+
contactFormButton = _a.contactFormButton,
|
|
448
|
+
bottomLinks = _a.bottomLinks,
|
|
449
|
+
copyright = _a.copyright,
|
|
450
|
+
countrySelector = _a.countrySelector,
|
|
451
|
+
className = _a.className;
|
|
452
|
+
var isMobile = variant === 'mobile';
|
|
453
|
+
var footerClasses = classNames(styles$f.footer, isMobile && styles$f['footer--mobile'], className);
|
|
454
|
+
var LogoWrapper = logo.href ? 'a' : 'div';
|
|
455
|
+
var logoProps = logo.href ? {
|
|
457
456
|
href: logo.href,
|
|
458
457
|
className: styles$f.footer__logo
|
|
459
458
|
} : {
|
|
460
459
|
className: styles$f.footer__logo
|
|
461
460
|
};
|
|
462
|
-
|
|
463
461
|
// Logo + Motto + Badge component (used in both layouts)
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
462
|
+
var LogoSection = function () {
|
|
463
|
+
return /*#__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$f.footer__leftCol
|
|
468
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
469
|
+
className: styles$f.footer__motto
|
|
470
|
+
}, motto), atlasCopcoBadge && /*#__PURE__*/React.createElement("div", {
|
|
471
|
+
className: styles$f.footer__badge
|
|
472
|
+
}, atlasCopcoBadge.showIcon !== false && /*#__PURE__*/React.createElement("span", {
|
|
473
|
+
className: styles$f.footer__badgeIcon
|
|
474
|
+
}, /*#__PURE__*/React.createElement(AtlasCopcoIcon, {
|
|
475
|
+
size: 14
|
|
476
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
477
|
+
className: styles$f.footer__badgeText
|
|
478
|
+
}, atlasCopcoBadge.text))));
|
|
479
|
+
};
|
|
481
480
|
// Mobile layout: Links at top, logo/motto at bottom
|
|
482
481
|
if (isMobile) {
|
|
483
482
|
return /*#__PURE__*/React.createElement("footer", {
|
|
@@ -515,7 +514,6 @@ const Footer = ({
|
|
|
515
514
|
className: styles$f.footer__brandSection
|
|
516
515
|
}, /*#__PURE__*/React.createElement(LogoSection, null))));
|
|
517
516
|
}
|
|
518
|
-
|
|
519
517
|
// Desktop layout: Logo at top, 3-column main content
|
|
520
518
|
return /*#__PURE__*/React.createElement("footer", {
|
|
521
519
|
className: footerClasses
|
|
@@ -557,18 +555,17 @@ const Footer = ({
|
|
|
557
555
|
|
|
558
556
|
var styles$e = {"pagination":"Pagination-module__pagination___Kih79","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","navIcon":"Pagination-module__navIcon___-BVJ3","navButton--previous":"Pagination-module__navButton--previous___Cy5TE","navButton--next":"Pagination-module__navButton--next___kTmgK","navButtonDisabled":"Pagination-module__navButtonDisabled___IZK8H","ellipsis":"Pagination-module__ellipsis___iAsGN","ellipsisText":"Pagination-module__ellipsisText___fd6u1"};
|
|
559
557
|
|
|
560
|
-
|
|
561
|
-
page,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const handleClick = () => {
|
|
558
|
+
var PaginationItem = function (_a) {
|
|
559
|
+
var page = _a.page,
|
|
560
|
+
isActive = _a.isActive,
|
|
561
|
+
onClick = _a.onClick,
|
|
562
|
+
className = _a.className;
|
|
563
|
+
var handleClick = function () {
|
|
567
564
|
if (!isActive) {
|
|
568
565
|
onClick(page);
|
|
569
566
|
}
|
|
570
567
|
};
|
|
571
|
-
|
|
568
|
+
var handleKeyDown = function (event) {
|
|
572
569
|
if (event.key === "Enter" || event.key === " ") {
|
|
573
570
|
event.preventDefault();
|
|
574
571
|
handleClick();
|
|
@@ -580,23 +577,22 @@ const PaginationItem = ({
|
|
|
580
577
|
type: "button",
|
|
581
578
|
onClick: handleClick,
|
|
582
579
|
onKeyDown: handleKeyDown,
|
|
583
|
-
className:
|
|
580
|
+
className: "".concat(styles$e.pageButton, " ").concat(isActive ? styles$e.pageButtonActive : "", " ").concat(className || ""),
|
|
584
581
|
"aria-current": isActive ? "page" : undefined,
|
|
585
|
-
"aria-label":
|
|
582
|
+
"aria-label": "Page ".concat(page),
|
|
586
583
|
disabled: isActive,
|
|
587
584
|
tabIndex: isActive ? -1 : 0
|
|
588
585
|
}, page));
|
|
589
586
|
};
|
|
590
587
|
|
|
591
|
-
|
|
592
|
-
label,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
const handleKeyDown = event => {
|
|
588
|
+
var PaginationButton = function (_a) {
|
|
589
|
+
var label = _a.label,
|
|
590
|
+
disabled = _a.disabled,
|
|
591
|
+
onClick = _a.onClick,
|
|
592
|
+
direction = _a.direction,
|
|
593
|
+
className = _a.className,
|
|
594
|
+
ariaLabel = _a.ariaLabel;
|
|
595
|
+
var handleKeyDown = function (event) {
|
|
600
596
|
if (event.key === "Enter" || event.key === " ") {
|
|
601
597
|
event.preventDefault();
|
|
602
598
|
if (!disabled) {
|
|
@@ -611,7 +607,7 @@ const PaginationButton = ({
|
|
|
611
607
|
onClick: onClick,
|
|
612
608
|
onKeyDown: handleKeyDown,
|
|
613
609
|
disabled: disabled,
|
|
614
|
-
className:
|
|
610
|
+
className: "".concat(styles$e.navButton, " ").concat(styles$e["navButton--".concat(direction)], " ").concat(disabled ? styles$e.navButtonDisabled : "", " ").concat(className || ""),
|
|
615
611
|
"aria-label": ariaLabel || label,
|
|
616
612
|
tabIndex: disabled ? -1 : 0
|
|
617
613
|
}, direction === "previous" && /*#__PURE__*/React.createElement("svg", {
|
|
@@ -645,98 +641,98 @@ const PaginationButton = ({
|
|
|
645
641
|
}))));
|
|
646
642
|
};
|
|
647
643
|
|
|
648
|
-
|
|
649
|
-
className
|
|
650
|
-
}) => {
|
|
644
|
+
var PaginationEllipsis = function (_a) {
|
|
645
|
+
var className = _a.className;
|
|
651
646
|
return /*#__PURE__*/React.createElement("li", {
|
|
652
|
-
className:
|
|
647
|
+
className: "".concat(styles$e.paginationItem, " ").concat(styles$e.ellipsis),
|
|
653
648
|
"aria-hidden": "true"
|
|
654
649
|
}, /*#__PURE__*/React.createElement("span", {
|
|
655
|
-
className:
|
|
650
|
+
className: "".concat(styles$e.ellipsisText, " ").concat(className || "")
|
|
656
651
|
}, "..."));
|
|
657
652
|
};
|
|
658
653
|
|
|
659
654
|
/**
|
|
660
655
|
* Generate page numbers to display with ellipsis logic
|
|
661
656
|
*/
|
|
662
|
-
|
|
657
|
+
var generatePageNumbers = function (currentPage, totalPages, maxVisiblePages) {
|
|
663
658
|
if (totalPages <= maxVisiblePages) {
|
|
664
659
|
return Array.from({
|
|
665
660
|
length: totalPages
|
|
666
|
-
}, (_, i)
|
|
661
|
+
}, function (_, i) {
|
|
662
|
+
return i + 1;
|
|
663
|
+
});
|
|
667
664
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
665
|
+
var pages = [];
|
|
666
|
+
var halfVisible = Math.floor(maxVisiblePages / 2);
|
|
671
667
|
// Always show first page
|
|
672
668
|
pages.push(1);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
var startPage = Math.max(2, currentPage - halfVisible);
|
|
670
|
+
var endPage = Math.min(totalPages - 1, currentPage + halfVisible);
|
|
676
671
|
// Adjust if we're near the start
|
|
677
672
|
if (currentPage <= halfVisible + 1) {
|
|
678
673
|
endPage = Math.min(maxVisiblePages - 1, totalPages - 1);
|
|
679
674
|
startPage = 2;
|
|
680
675
|
}
|
|
681
|
-
|
|
682
676
|
// Adjust if we're near the end
|
|
683
677
|
if (currentPage >= totalPages - halfVisible) {
|
|
684
678
|
startPage = Math.max(2, totalPages - maxVisiblePages + 2);
|
|
685
679
|
endPage = totalPages - 1;
|
|
686
680
|
}
|
|
687
|
-
|
|
688
681
|
// Add ellipsis after first page if needed
|
|
689
682
|
if (startPage > 2) {
|
|
690
683
|
pages.push("ellipsis-start");
|
|
691
684
|
}
|
|
692
|
-
|
|
693
685
|
// Add middle pages
|
|
694
|
-
for (
|
|
686
|
+
for (var i = startPage; i <= endPage; i++) {
|
|
695
687
|
pages.push(i);
|
|
696
688
|
}
|
|
697
|
-
|
|
698
689
|
// Add ellipsis before last page if needed
|
|
699
690
|
if (endPage < totalPages - 1) {
|
|
700
691
|
pages.push("ellipsis-end");
|
|
701
692
|
}
|
|
702
|
-
|
|
703
693
|
// Always show last page
|
|
704
694
|
if (totalPages > 1) {
|
|
705
695
|
pages.push(totalPages);
|
|
706
696
|
}
|
|
707
697
|
return pages;
|
|
708
698
|
};
|
|
709
|
-
|
|
710
|
-
currentPage,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
699
|
+
var Pagination = function (_a) {
|
|
700
|
+
var currentPage = _a.currentPage,
|
|
701
|
+
totalPages = _a.totalPages,
|
|
702
|
+
onPageChange = _a.onPageChange,
|
|
703
|
+
_b = _a.maxVisiblePages,
|
|
704
|
+
maxVisiblePages = _b === void 0 ? 10 : _b,
|
|
705
|
+
_c = _a.showPrevious,
|
|
706
|
+
showPrevious = _c === void 0 ? true : _c,
|
|
707
|
+
_d = _a.showNext,
|
|
708
|
+
showNext = _d === void 0 ? true : _d,
|
|
709
|
+
_e = _a.previousLabel,
|
|
710
|
+
previousLabel = _e === void 0 ? "Previous" : _e,
|
|
711
|
+
_f = _a.nextLabel,
|
|
712
|
+
nextLabel = _f === void 0 ? "Next" : _f,
|
|
713
|
+
className = _a.className,
|
|
714
|
+
_g = _a.ariaLabel,
|
|
715
|
+
ariaLabel = _g === void 0 ? "Pagination" : _g;
|
|
716
|
+
var pageNumbers = useMemo(function () {
|
|
717
|
+
return generatePageNumbers(currentPage, totalPages, maxVisiblePages);
|
|
718
|
+
}, [currentPage, totalPages, maxVisiblePages]);
|
|
719
|
+
var handlePageChange = function (page) {
|
|
723
720
|
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
724
721
|
onPageChange(page);
|
|
725
722
|
}
|
|
726
723
|
};
|
|
727
|
-
|
|
724
|
+
var handlePrevious = function () {
|
|
728
725
|
handlePageChange(currentPage - 1);
|
|
729
726
|
};
|
|
730
|
-
|
|
727
|
+
var handleNext = function () {
|
|
731
728
|
handlePageChange(currentPage + 1);
|
|
732
729
|
};
|
|
733
|
-
|
|
734
730
|
// Don't render if there's only one page or no pages
|
|
735
731
|
if (totalPages <= 1) {
|
|
736
732
|
return null;
|
|
737
733
|
}
|
|
738
734
|
return /*#__PURE__*/React.createElement("nav", {
|
|
739
|
-
className:
|
|
735
|
+
className: "".concat(styles$e.pagination, " ").concat(className || ""),
|
|
740
736
|
"aria-label": ariaLabel,
|
|
741
737
|
role: "navigation"
|
|
742
738
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
@@ -747,10 +743,10 @@ const Pagination = ({
|
|
|
747
743
|
onClick: handlePrevious,
|
|
748
744
|
direction: "previous",
|
|
749
745
|
ariaLabel: "Go to previous page"
|
|
750
|
-
}), pageNumbers.map((page, index)
|
|
746
|
+
}), pageNumbers.map(function (page, index) {
|
|
751
747
|
if (page === "ellipsis-start" || page === "ellipsis-end") {
|
|
752
748
|
return /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
753
|
-
key:
|
|
749
|
+
key: "ellipsis-".concat(index)
|
|
754
750
|
});
|
|
755
751
|
}
|
|
756
752
|
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
@@ -772,71 +768,76 @@ var styles$d = {"productCard":"ProductCardHorizontal-module__productCard___Nl4jK
|
|
|
772
768
|
|
|
773
769
|
var styles$c = {"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"};
|
|
774
770
|
|
|
775
|
-
|
|
776
|
-
src,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
771
|
+
var Image = function (_a) {
|
|
772
|
+
var src = _a.src,
|
|
773
|
+
alt = _a.alt,
|
|
774
|
+
width = _a.width,
|
|
775
|
+
height = _a.height,
|
|
776
|
+
_b = _a.loading,
|
|
777
|
+
loading = _b === void 0 ? "lazy" : _b,
|
|
778
|
+
_c = _a.decoding,
|
|
779
|
+
decoding = _c === void 0 ? "async" : _c,
|
|
780
|
+
_d = _a.objectFit,
|
|
781
|
+
objectFit = _d === void 0 ? "cover" : _d,
|
|
782
|
+
_e = _a.objectPosition,
|
|
783
|
+
objectPosition = _e === void 0 ? "center" : _e,
|
|
784
|
+
aspectRatio = _a.aspectRatio,
|
|
785
|
+
_f = _a.isDecorative,
|
|
786
|
+
isDecorative = _f === void 0 ? false : _f,
|
|
787
|
+
fallbackSrc = _a.fallbackSrc,
|
|
788
|
+
onLoad = _a.onLoad,
|
|
789
|
+
onError = _a.onError,
|
|
790
|
+
_g = _a.className,
|
|
791
|
+
className = _g === void 0 ? "" : _g,
|
|
792
|
+
srcSet = _a.srcSet,
|
|
793
|
+
sizes = _a.sizes;
|
|
794
|
+
var _h = useState(true),
|
|
795
|
+
isLoading = _h[0],
|
|
796
|
+
setIsLoading = _h[1];
|
|
797
|
+
var _j = useState(false),
|
|
798
|
+
hasError = _j[0],
|
|
799
|
+
setHasError = _j[1];
|
|
800
|
+
var _k = useState(src),
|
|
801
|
+
currentSrc = _k[0],
|
|
802
|
+
setCurrentSrc = _k[1];
|
|
803
|
+
var handleLoad = useCallback(function () {
|
|
797
804
|
setIsLoading(false);
|
|
798
805
|
setHasError(false);
|
|
799
|
-
onLoad
|
|
806
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad();
|
|
800
807
|
}, [onLoad]);
|
|
801
|
-
|
|
808
|
+
var handleError = useCallback(function () {
|
|
802
809
|
setIsLoading(false);
|
|
803
810
|
setHasError(true);
|
|
804
|
-
|
|
805
811
|
// Try fallback if available and not already using it
|
|
806
812
|
if (fallbackSrc && currentSrc !== fallbackSrc) {
|
|
807
813
|
setCurrentSrc(fallbackSrc);
|
|
808
814
|
setHasError(false);
|
|
809
815
|
setIsLoading(true);
|
|
810
816
|
} else {
|
|
811
|
-
onError
|
|
817
|
+
onError === null || onError === void 0 ? void 0 : onError();
|
|
812
818
|
}
|
|
813
819
|
}, [fallbackSrc, currentSrc, onError]);
|
|
814
|
-
|
|
815
820
|
// Accessibility: decorative images should have empty alt and be hidden from screen readers
|
|
816
|
-
|
|
821
|
+
var accessibilityProps = isDecorative ? {
|
|
817
822
|
alt: "",
|
|
818
823
|
"aria-hidden": true,
|
|
819
824
|
role: "presentation"
|
|
820
825
|
} : {
|
|
821
|
-
alt
|
|
822
|
-
};
|
|
823
|
-
const containerStyle = {
|
|
824
|
-
...(aspectRatio && {
|
|
825
|
-
aspectRatio
|
|
826
|
-
}),
|
|
827
|
-
...(width && {
|
|
828
|
-
width: typeof width === "number" ? `${width}px` : width
|
|
829
|
-
}),
|
|
830
|
-
...(height && {
|
|
831
|
-
height: typeof height === "number" ? `${height}px` : height
|
|
832
|
-
})
|
|
826
|
+
alt: alt
|
|
833
827
|
};
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
828
|
+
var containerStyle = __assign(__assign(__assign({}, aspectRatio && {
|
|
829
|
+
aspectRatio: aspectRatio
|
|
830
|
+
}), width && {
|
|
831
|
+
width: typeof width === "number" ? "".concat(width, "px") : width
|
|
832
|
+
}), height && {
|
|
833
|
+
height: typeof height === "number" ? "".concat(height, "px") : height
|
|
834
|
+
});
|
|
835
|
+
var imageStyle = {
|
|
836
|
+
objectFit: objectFit,
|
|
837
|
+
objectPosition: objectPosition
|
|
837
838
|
};
|
|
838
839
|
return /*#__PURE__*/React.createElement("div", {
|
|
839
|
-
className:
|
|
840
|
+
className: "".concat(styles$c.imageContainer, " ").concat(className, " ").concat(isLoading ? styles$c.loading : "", " ").concat(hasError ? styles$c.error : ""),
|
|
840
841
|
style: containerStyle
|
|
841
842
|
}, isLoading && /*#__PURE__*/React.createElement("div", {
|
|
842
843
|
className: styles$c.skeleton,
|
|
@@ -888,25 +889,25 @@ const Image = ({
|
|
|
888
889
|
})));
|
|
889
890
|
};
|
|
890
891
|
|
|
891
|
-
|
|
892
|
-
id
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
892
|
+
var ProductCardHorizontal = function (_a) {
|
|
893
|
+
_a.id;
|
|
894
|
+
var imageUrl = _a.imageUrl,
|
|
895
|
+
url = _a.url,
|
|
896
|
+
title = _a.title,
|
|
897
|
+
description = _a.description,
|
|
898
|
+
price = _a.price,
|
|
899
|
+
button = _a.button,
|
|
900
|
+
_b = _a.className,
|
|
901
|
+
className = _b === void 0 ? "" : _b;
|
|
901
902
|
if (!title) {
|
|
902
903
|
return null;
|
|
903
904
|
}
|
|
904
905
|
return /*#__PURE__*/React.createElement("a", {
|
|
905
906
|
href: url,
|
|
906
|
-
className:
|
|
907
|
-
"aria-label":
|
|
907
|
+
className: "".concat(styles$d.productCard, " ").concat(className),
|
|
908
|
+
"aria-label": "View product: ".concat(title)
|
|
908
909
|
}, /*#__PURE__*/React.createElement("div", {
|
|
909
|
-
className:
|
|
910
|
+
className: "".concat(styles$d.productWrapper, " ").concat(imageUrl ? styles$d.withImage : "")
|
|
910
911
|
}, imageUrl && /*#__PURE__*/React.createElement("div", {
|
|
911
912
|
className: styles$d.productImage
|
|
912
913
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
@@ -928,57 +929,55 @@ const ProductCardHorizontal = ({
|
|
|
928
929
|
size: "extra-small"
|
|
929
930
|
}, button.label))));
|
|
930
931
|
};
|
|
931
|
-
|
|
932
932
|
// Alias for backward compatibility
|
|
933
|
-
|
|
933
|
+
var ProductCardHorizontalParts = ProductCardHorizontal;
|
|
934
934
|
|
|
935
935
|
var styles$b = {"productDetails":"ProductCardDetails-module__productDetails___-sx2l"};
|
|
936
936
|
|
|
937
937
|
// Adapter to map design system props to ProductCardHorizontalParts props
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
spare
|
|
941
|
-
...rest
|
|
942
|
-
} = props;
|
|
938
|
+
var SpareCardAdapter = function (props) {
|
|
939
|
+
var spare = props.spare,
|
|
940
|
+
rest = __rest(props, ["spare"]);
|
|
943
941
|
return /*#__PURE__*/React.createElement(ProductCardHorizontalParts, {
|
|
944
|
-
url: spare
|
|
945
|
-
title: spare
|
|
946
|
-
description: spare
|
|
947
|
-
price: spare
|
|
948
|
-
imageUrl: spare
|
|
942
|
+
url: (spare === null || spare === void 0 ? void 0 : spare.url) || (spare === null || spare === void 0 ? void 0 : spare.link) || "#",
|
|
943
|
+
title: (spare === null || spare === void 0 ? void 0 : spare.name) || (spare === null || spare === void 0 ? void 0 : spare.title) || "",
|
|
944
|
+
description: (spare === null || spare === void 0 ? void 0 : spare.description) || "",
|
|
945
|
+
price: (spare === null || spare === void 0 ? void 0 : spare.priceValue) || (spare === null || spare === void 0 ? void 0 : spare.price) || "",
|
|
946
|
+
imageUrl: (spare === null || spare === void 0 ? void 0 : spare["img-product"]) || (spare === null || spare === void 0 ? void 0 : spare.image) || "",
|
|
949
947
|
button: {
|
|
950
948
|
label: rest.cta || "View Product",
|
|
951
|
-
onClick: ()
|
|
949
|
+
onClick: function () {
|
|
950
|
+
return window.open((spare === null || spare === void 0 ? void 0 : spare.url) || (spare === null || spare === void 0 ? void 0 : spare.link) || "#", "_blank");
|
|
951
|
+
}
|
|
952
952
|
}
|
|
953
953
|
});
|
|
954
954
|
};
|
|
955
|
-
|
|
956
955
|
// Re-export the design system component with Leybold styling
|
|
957
|
-
|
|
958
|
-
id,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
956
|
+
var ProductCardDetails = function (_a) {
|
|
957
|
+
var id = _a.id,
|
|
958
|
+
imageUrl = _a.imageUrl,
|
|
959
|
+
title = _a.title,
|
|
960
|
+
description = _a.description,
|
|
961
|
+
price = _a.price,
|
|
962
|
+
code = _a.code,
|
|
963
|
+
facets = _a.facets,
|
|
964
|
+
hit = _a.hit,
|
|
965
|
+
_b = _a.className,
|
|
966
|
+
className = _b === void 0 ? "" : _b,
|
|
967
|
+
ProductCardComponent = _a.ProductCardComponent;
|
|
969
968
|
// Build the hit object expected by ProductDetailsCard
|
|
970
|
-
|
|
971
|
-
id,
|
|
972
|
-
title,
|
|
973
|
-
description,
|
|
974
|
-
price,
|
|
975
|
-
code,
|
|
969
|
+
var hitData = hit || {
|
|
970
|
+
id: id,
|
|
971
|
+
title: title,
|
|
972
|
+
description: description,
|
|
973
|
+
price: price,
|
|
974
|
+
code: code,
|
|
976
975
|
image: imageUrl
|
|
977
976
|
};
|
|
978
977
|
return /*#__PURE__*/React.createElement("div", {
|
|
979
978
|
className: styles$b.productDetails
|
|
980
979
|
}, /*#__PURE__*/React.createElement(ProductDetailsCard, {
|
|
981
|
-
className:
|
|
980
|
+
className: "".concat(className),
|
|
982
981
|
title: title,
|
|
983
982
|
imageUrl: imageUrl,
|
|
984
983
|
imageAlt: title,
|
|
@@ -991,25 +990,23 @@ const ProductCardDetails = ({
|
|
|
991
990
|
|
|
992
991
|
// Adapter component that maps props from AlgoliaDynamicSearchRaw to ProductCardHorizontal
|
|
993
992
|
// AlgoliaDynamicSearchRaw passes: title, cardLink, productPrice, cta, hit (original data)
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
code
|
|
1004
|
-
} = props;
|
|
993
|
+
var ProductCardAdapter = function (props) {
|
|
994
|
+
var hit = props.hit,
|
|
995
|
+
title = props.title,
|
|
996
|
+
cardLink = props.cardLink,
|
|
997
|
+
productPrice = props.productPrice,
|
|
998
|
+
cta = props.cta,
|
|
999
|
+
showProductPrice = props.showProductPrice,
|
|
1000
|
+
className = props.className,
|
|
1001
|
+
code = props.code;
|
|
1005
1002
|
console.log(props);
|
|
1006
1003
|
// Get values from direct props or fallback to hit object
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1004
|
+
var url = cardLink || (hit === null || hit === void 0 ? void 0 : hit.link) || "#";
|
|
1005
|
+
var imageUrl = "";
|
|
1006
|
+
var price = showProductPrice ? productPrice || (hit === null || hit === void 0 ? void 0 : hit.price) || "" : "";
|
|
1007
|
+
var productTitle = title || (hit === null || hit === void 0 ? void 0 : hit.title) || "";
|
|
1008
|
+
var productCode = code || (hit === null || hit === void 0 ? void 0 : hit.code) || "";
|
|
1009
|
+
var buttonLabel = cta || "View Product";
|
|
1013
1010
|
return /*#__PURE__*/React.createElement(ProductCardHorizontalParts, {
|
|
1014
1011
|
imageUrl: imageUrl,
|
|
1015
1012
|
url: url,
|
|
@@ -1018,41 +1015,41 @@ const ProductCardAdapter = props => {
|
|
|
1018
1015
|
price: price,
|
|
1019
1016
|
button: {
|
|
1020
1017
|
label: buttonLabel,
|
|
1021
|
-
onClick: ()
|
|
1018
|
+
onClick: function () {
|
|
1019
|
+
return window.open(url, "_blank");
|
|
1020
|
+
}
|
|
1022
1021
|
},
|
|
1023
1022
|
className: className
|
|
1024
1023
|
});
|
|
1025
1024
|
};
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
related_products
|
|
1038
|
-
} = props;
|
|
1025
|
+
var ProductCardDetailsAdapter = function (props) {
|
|
1026
|
+
var hit = props.hit,
|
|
1027
|
+
title = props.title;
|
|
1028
|
+
props.cardLink;
|
|
1029
|
+
var productPrice = props.productPrice;
|
|
1030
|
+
props.cta;
|
|
1031
|
+
props.showProductPrice;
|
|
1032
|
+
var className = props.className,
|
|
1033
|
+
code = props.code,
|
|
1034
|
+
facets = props.facets,
|
|
1035
|
+
related_products = props.related_products;
|
|
1039
1036
|
if (!title) {
|
|
1040
1037
|
return null;
|
|
1041
1038
|
}
|
|
1042
1039
|
return /*#__PURE__*/React.createElement(ProductCardDetails, {
|
|
1043
|
-
imageUrl: hit
|
|
1040
|
+
imageUrl: (hit === null || hit === void 0 ? void 0 : hit.image) || "",
|
|
1044
1041
|
title: title,
|
|
1045
|
-
description: hit
|
|
1046
|
-
price: hit
|
|
1047
|
-
code: hit
|
|
1042
|
+
description: (hit === null || hit === void 0 ? void 0 : hit.description) || "",
|
|
1043
|
+
price: (hit === null || hit === void 0 ? void 0 : hit.price) || "" || productPrice,
|
|
1044
|
+
code: (hit === null || hit === void 0 ? void 0 : hit.code) || "" || code,
|
|
1048
1045
|
hit: hit,
|
|
1049
1046
|
className: className,
|
|
1050
1047
|
facets: facets,
|
|
1051
|
-
relatedProducts: hit
|
|
1048
|
+
relatedProducts: (hit === null || hit === void 0 ? void 0 : hit.related_products) || related_products
|
|
1052
1049
|
});
|
|
1053
1050
|
};
|
|
1054
|
-
|
|
1055
|
-
|
|
1051
|
+
var AlgoliaDynamicSearchLeybold = function (props) {
|
|
1052
|
+
var innerComponents = {
|
|
1056
1053
|
ProductCard: ProductCardAdapter,
|
|
1057
1054
|
ProductDetailsCard: ProductCardDetailsAdapter
|
|
1058
1055
|
};
|
|
@@ -1061,22 +1058,20 @@ const AlgoliaDynamicSearchLeybold = props => {
|
|
|
1061
1058
|
}));
|
|
1062
1059
|
};
|
|
1063
1060
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
}) => {
|
|
1061
|
+
var QrFormButtonAdapter = function (_a) {
|
|
1062
|
+
var label = _a.label,
|
|
1063
|
+
onClick = _a.onClick,
|
|
1064
|
+
_b = _a.buttonStyle,
|
|
1065
|
+
buttonStyle = _b === void 0 ? "primary" : _b,
|
|
1066
|
+
href = _a.href,
|
|
1067
|
+
target = _a.target,
|
|
1068
|
+
_c = _a.type,
|
|
1069
|
+
type = _c === void 0 ? "button" : _c,
|
|
1070
|
+
element = _a.element,
|
|
1071
|
+
pageTarget = _a["data-page_target"],
|
|
1072
|
+
className = _a.className;
|
|
1077
1073
|
// Map buttonStyle to our variant
|
|
1078
|
-
|
|
1079
|
-
|
|
1074
|
+
var variant = buttonStyle === "secondary" ? "secondary" : "primary";
|
|
1080
1075
|
// If it's an anchor element (has href or element='a'), render as link
|
|
1081
1076
|
if (element === "a" || href) {
|
|
1082
1077
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -1095,18 +1090,19 @@ const QrFormButtonAdapter = ({
|
|
|
1095
1090
|
size: "small"
|
|
1096
1091
|
}, label));
|
|
1097
1092
|
}
|
|
1098
|
-
|
|
1099
1093
|
// Otherwise render as button
|
|
1100
1094
|
return /*#__PURE__*/React.createElement(Button, {
|
|
1101
1095
|
variant: variant,
|
|
1102
1096
|
type: type,
|
|
1103
|
-
onClick: onClick ?
|
|
1097
|
+
onClick: onClick ? function (e) {
|
|
1098
|
+
return onClick(e);
|
|
1099
|
+
} : undefined,
|
|
1104
1100
|
className: className,
|
|
1105
1101
|
"data-page_target": pageTarget,
|
|
1106
1102
|
size: "small"
|
|
1107
1103
|
}, label);
|
|
1108
1104
|
};
|
|
1109
|
-
|
|
1105
|
+
var QrFormLeybold = function (props) {
|
|
1110
1106
|
return /*#__PURE__*/React.createElement("div", {
|
|
1111
1107
|
className: "qr-journey-form-wrapper"
|
|
1112
1108
|
}, /*#__PURE__*/React.createElement(QrForm, _extends({}, props, {
|
|
@@ -1116,16 +1112,17 @@ const QrFormLeybold = props => {
|
|
|
1116
1112
|
|
|
1117
1113
|
var styles$a = {"overlay":"SearchModal-module__overlay___Vbvg9","modal":"SearchModal-module__modal___1k5gO","header":"SearchModal-module__header___I79uH","title":"SearchModal-module__title___VlmEk","closeButton":"SearchModal-module__closeButton___AN0zt","content":"SearchModal-module__content___I2SdX"};
|
|
1118
1114
|
|
|
1119
|
-
|
|
1120
|
-
onClick,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1115
|
+
var ModalCloseButton = function (_a) {
|
|
1116
|
+
var onClick = _a.onClick,
|
|
1117
|
+
_b = _a.ariaLabel,
|
|
1118
|
+
ariaLabel = _b === void 0 ? 'Close search' : _b,
|
|
1119
|
+
_c = _a.className,
|
|
1120
|
+
className = _c === void 0 ? '' : _c;
|
|
1124
1121
|
return /*#__PURE__*/React.createElement("button", {
|
|
1125
1122
|
type: "button",
|
|
1126
1123
|
onClick: onClick,
|
|
1127
1124
|
"aria-label": ariaLabel,
|
|
1128
|
-
className:
|
|
1125
|
+
className: "".concat(styles$a.closeButton, " ").concat(className)
|
|
1129
1126
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
1130
1127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1131
1128
|
viewBox: "0 0 24 24",
|
|
@@ -1148,78 +1145,79 @@ const ModalCloseButton = ({
|
|
|
1148
1145
|
})));
|
|
1149
1146
|
};
|
|
1150
1147
|
|
|
1151
|
-
|
|
1152
|
-
isOpen,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1148
|
+
var SearchModal = function (_a) {
|
|
1149
|
+
var isOpen = _a.isOpen,
|
|
1150
|
+
onClose = _a.onClose,
|
|
1151
|
+
_b = _a.title,
|
|
1152
|
+
title = _b === void 0 ? 'Search' : _b,
|
|
1153
|
+
children = _a.children,
|
|
1154
|
+
_c = _a.className,
|
|
1155
|
+
className = _c === void 0 ? '' : _c;
|
|
1156
|
+
var modalRef = useRef(null);
|
|
1157
|
+
var previouslyFocusedElement = useRef(null);
|
|
1158
|
+
useEffect(function () {
|
|
1161
1159
|
if (isOpen) {
|
|
1162
1160
|
// Store the previously focused element
|
|
1163
1161
|
previouslyFocusedElement.current = document.activeElement;
|
|
1164
|
-
|
|
1165
1162
|
// Focus the modal
|
|
1166
1163
|
if (modalRef.current) {
|
|
1167
1164
|
modalRef.current.focus();
|
|
1168
1165
|
}
|
|
1169
|
-
|
|
1170
1166
|
// Prevent body scroll
|
|
1171
1167
|
document.body.style.overflow = 'hidden';
|
|
1172
1168
|
} else {
|
|
1173
1169
|
// Restore body scroll
|
|
1174
1170
|
document.body.style.overflow = '';
|
|
1175
|
-
|
|
1176
1171
|
// Return focus to previously focused element
|
|
1177
1172
|
if (previouslyFocusedElement.current) {
|
|
1178
1173
|
previouslyFocusedElement.current.focus();
|
|
1179
1174
|
}
|
|
1180
1175
|
}
|
|
1181
|
-
return ()
|
|
1176
|
+
return function () {
|
|
1182
1177
|
document.body.style.overflow = '';
|
|
1183
1178
|
};
|
|
1184
1179
|
}, [isOpen]);
|
|
1185
|
-
useEffect(()
|
|
1186
|
-
|
|
1180
|
+
useEffect(function () {
|
|
1181
|
+
var handleEscape = function (event) {
|
|
1187
1182
|
if (event.key === 'Escape' && isOpen) {
|
|
1188
1183
|
onClose();
|
|
1189
1184
|
}
|
|
1190
1185
|
};
|
|
1191
1186
|
document.addEventListener('keydown', handleEscape);
|
|
1192
|
-
return ()
|
|
1187
|
+
return function () {
|
|
1188
|
+
return document.removeEventListener('keydown', handleEscape);
|
|
1189
|
+
};
|
|
1193
1190
|
}, [isOpen, onClose]);
|
|
1194
|
-
|
|
1195
1191
|
// Focus trap implementation
|
|
1196
|
-
useEffect(()
|
|
1192
|
+
useEffect(function () {
|
|
1197
1193
|
if (!isOpen || !modalRef.current) return;
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1194
|
+
var modal = modalRef.current;
|
|
1195
|
+
var focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1196
|
+
var firstElement = focusableElements[0];
|
|
1197
|
+
var lastElement = focusableElements[focusableElements.length - 1];
|
|
1198
|
+
var handleTab = function (event) {
|
|
1203
1199
|
if (event.key !== 'Tab') return;
|
|
1204
1200
|
if (event.shiftKey) {
|
|
1205
1201
|
// Shift + Tab
|
|
1206
1202
|
if (document.activeElement === firstElement) {
|
|
1207
1203
|
event.preventDefault();
|
|
1208
|
-
lastElement
|
|
1204
|
+
lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
|
|
1209
1205
|
}
|
|
1210
1206
|
} else {
|
|
1211
1207
|
// Tab
|
|
1212
1208
|
if (document.activeElement === lastElement) {
|
|
1213
1209
|
event.preventDefault();
|
|
1214
|
-
firstElement
|
|
1210
|
+
firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
|
1215
1211
|
}
|
|
1216
1212
|
}
|
|
1217
1213
|
};
|
|
1218
1214
|
modal.addEventListener('keydown', handleTab);
|
|
1219
|
-
return ()
|
|
1215
|
+
return function () {
|
|
1216
|
+
return modal.removeEventListener('keydown', handleTab);
|
|
1217
|
+
};
|
|
1220
1218
|
}, [isOpen]);
|
|
1221
1219
|
if (!isOpen) return null;
|
|
1222
|
-
|
|
1220
|
+
var handleOverlayClick = function (event) {
|
|
1223
1221
|
if (event.target === event.currentTarget) {
|
|
1224
1222
|
onClose();
|
|
1225
1223
|
}
|
|
@@ -1234,7 +1232,7 @@ const SearchModal = ({
|
|
|
1234
1232
|
"aria-modal": "true",
|
|
1235
1233
|
"aria-label": title,
|
|
1236
1234
|
tabIndex: -1,
|
|
1237
|
-
className:
|
|
1235
|
+
className: "".concat(styles$a.modal, " ").concat(className)
|
|
1238
1236
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1239
1237
|
className: styles$a.header
|
|
1240
1238
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
@@ -1248,11 +1246,11 @@ const SearchModal = ({
|
|
|
1248
1246
|
|
|
1249
1247
|
var styles$9 = {"searchBar":"SearchBar-module__searchBar___5ak1g","inputWrapper":"SearchBar-module__inputWrapper___-4wrM","searchIcon":"SearchBar-module__searchIcon___VAuDz","searchInput":"SearchBar-module__searchInput___1K4GN","submitButton":"SearchBar-module__submitButton___DZWsQ"};
|
|
1250
1248
|
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1249
|
+
var SearchIcon = function (_a) {
|
|
1250
|
+
var _b = _a.className,
|
|
1251
|
+
className = _b === void 0 ? '' : _b;
|
|
1254
1252
|
return /*#__PURE__*/React.createElement("svg", {
|
|
1255
|
-
className:
|
|
1253
|
+
className: "".concat(styles$9.searchIcon, " ").concat(className),
|
|
1256
1254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1257
1255
|
viewBox: "0 0 24 24",
|
|
1258
1256
|
fill: "none",
|
|
@@ -1270,15 +1268,17 @@ const SearchIcon = ({
|
|
|
1270
1268
|
}));
|
|
1271
1269
|
};
|
|
1272
1270
|
|
|
1273
|
-
|
|
1274
|
-
value,
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1271
|
+
var SearchInput = function (_a) {
|
|
1272
|
+
var value = _a.value,
|
|
1273
|
+
onChange = _a.onChange,
|
|
1274
|
+
onKeyDown = _a.onKeyDown,
|
|
1275
|
+
_b = _a.placeholder,
|
|
1276
|
+
placeholder = _b === void 0 ? 'Discover products, innovations, and resources...' : _b,
|
|
1277
|
+
_c = _a.autoFocus,
|
|
1278
|
+
autoFocus = _c === void 0 ? false : _c,
|
|
1279
|
+
_d = _a.className,
|
|
1280
|
+
className = _d === void 0 ? '' : _d;
|
|
1281
|
+
var handleChange = function (event) {
|
|
1282
1282
|
onChange(event.target.value);
|
|
1283
1283
|
};
|
|
1284
1284
|
return /*#__PURE__*/React.createElement("input", {
|
|
@@ -1289,39 +1289,43 @@ const SearchInput = ({
|
|
|
1289
1289
|
placeholder: placeholder,
|
|
1290
1290
|
autoFocus: autoFocus,
|
|
1291
1291
|
"aria-label": "Search",
|
|
1292
|
-
className:
|
|
1292
|
+
className: "".concat(styles$9.searchInput, " ").concat(className)
|
|
1293
1293
|
});
|
|
1294
1294
|
};
|
|
1295
1295
|
|
|
1296
|
-
|
|
1297
|
-
onClick,
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1296
|
+
var SearchSubmitButton = function (_a) {
|
|
1297
|
+
var onClick = _a.onClick,
|
|
1298
|
+
_b = _a.disabled,
|
|
1299
|
+
disabled = _b === void 0 ? false : _b,
|
|
1300
|
+
_c = _a.ariaLabel,
|
|
1301
|
+
ariaLabel = _c === void 0 ? 'Search' : _c,
|
|
1302
|
+
_d = _a.label,
|
|
1303
|
+
label = _d === void 0 ? 'Search' : _d,
|
|
1304
|
+
_e = _a.className,
|
|
1305
|
+
className = _e === void 0 ? '' : _e;
|
|
1303
1306
|
return /*#__PURE__*/React.createElement("button", {
|
|
1304
1307
|
type: "submit",
|
|
1305
1308
|
onClick: onClick,
|
|
1306
1309
|
disabled: disabled,
|
|
1307
1310
|
"aria-label": ariaLabel,
|
|
1308
|
-
className:
|
|
1311
|
+
className: "".concat(styles$9.submitButton, " ").concat(className)
|
|
1309
1312
|
}, label);
|
|
1310
1313
|
};
|
|
1311
1314
|
|
|
1312
|
-
|
|
1313
|
-
value,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1315
|
+
var SearchBar = function (_a) {
|
|
1316
|
+
var value = _a.value,
|
|
1317
|
+
onChange = _a.onChange,
|
|
1318
|
+
onSubmit = _a.onSubmit,
|
|
1319
|
+
placeholder = _a.placeholder,
|
|
1320
|
+
_b = _a.autoFocus,
|
|
1321
|
+
autoFocus = _b === void 0 ? false : _b,
|
|
1322
|
+
_c = _a.className,
|
|
1323
|
+
className = _c === void 0 ? '' : _c;
|
|
1324
|
+
var handleSubmit = function (event) {
|
|
1321
1325
|
event.preventDefault();
|
|
1322
1326
|
onSubmit();
|
|
1323
1327
|
};
|
|
1324
|
-
|
|
1328
|
+
var handleKeyDown = function (event) {
|
|
1325
1329
|
if (event.key === 'Enter') {
|
|
1326
1330
|
event.preventDefault();
|
|
1327
1331
|
onSubmit();
|
|
@@ -1329,7 +1333,7 @@ const SearchBar = ({
|
|
|
1329
1333
|
};
|
|
1330
1334
|
return /*#__PURE__*/React.createElement("form", {
|
|
1331
1335
|
onSubmit: handleSubmit,
|
|
1332
|
-
className:
|
|
1336
|
+
className: "".concat(styles$9.searchBar, " ").concat(className)
|
|
1333
1337
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1334
1338
|
className: styles$9.inputWrapper
|
|
1335
1339
|
}, /*#__PURE__*/React.createElement(SearchIcon, null), /*#__PURE__*/React.createElement(SearchInput, {
|
|
@@ -1345,28 +1349,29 @@ const SearchBar = ({
|
|
|
1345
1349
|
|
|
1346
1350
|
var styles$8 = {"resultsCount":"ResultsCount-module__resultsCount___cNM6f"};
|
|
1347
1351
|
|
|
1348
|
-
|
|
1349
|
-
count,
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1352
|
+
var ResultsCount = function (_a) {
|
|
1353
|
+
var count = _a.count,
|
|
1354
|
+
type = _a.type,
|
|
1355
|
+
_b = _a.className,
|
|
1356
|
+
className = _b === void 0 ? '' : _b;
|
|
1357
|
+
var label = count === 1 ? type.slice(0, -1) : type;
|
|
1354
1358
|
return /*#__PURE__*/React.createElement("span", {
|
|
1355
|
-
className:
|
|
1359
|
+
className: "".concat(styles$8.resultsCount, " ").concat(className)
|
|
1356
1360
|
}, count, " ", label);
|
|
1357
1361
|
};
|
|
1358
1362
|
|
|
1359
1363
|
var styles$7 = {"seeAllButton":"SeeAllLinkButton-module__seeAllButton___eAQqJ"};
|
|
1360
1364
|
|
|
1361
|
-
|
|
1362
|
-
onClick,
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1365
|
+
var SeeAllLinkButton = function (_a) {
|
|
1366
|
+
var onClick = _a.onClick,
|
|
1367
|
+
_b = _a.label,
|
|
1368
|
+
label = _b === void 0 ? 'See all results' : _b,
|
|
1369
|
+
_c = _a.className,
|
|
1370
|
+
className = _c === void 0 ? '' : _c;
|
|
1366
1371
|
return /*#__PURE__*/React.createElement("button", {
|
|
1367
1372
|
type: "button",
|
|
1368
1373
|
onClick: onClick,
|
|
1369
|
-
className:
|
|
1374
|
+
className: "".concat(styles$7.seeAllButton, " ").concat(className)
|
|
1370
1375
|
}, label, /*#__PURE__*/React.createElement("svg", {
|
|
1371
1376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1372
1377
|
viewBox: "0 0 24 24",
|
|
@@ -1383,17 +1388,17 @@ const SeeAllLinkButton = ({
|
|
|
1383
1388
|
|
|
1384
1389
|
var styles$6 = {"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"};
|
|
1385
1390
|
|
|
1386
|
-
|
|
1387
|
-
title,
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1391
|
+
var ResultsColumn = function (_a) {
|
|
1392
|
+
var title = _a.title,
|
|
1393
|
+
count = _a.count,
|
|
1394
|
+
isLoading = _a.isLoading,
|
|
1395
|
+
error = _a.error,
|
|
1396
|
+
onSeeAll = _a.onSeeAll,
|
|
1397
|
+
children = _a.children,
|
|
1398
|
+
_b = _a.className,
|
|
1399
|
+
className = _b === void 0 ? '' : _b;
|
|
1395
1400
|
return /*#__PURE__*/React.createElement("div", {
|
|
1396
|
-
className:
|
|
1401
|
+
className: "".concat(styles$6.resultsColumn, " ").concat(className)
|
|
1397
1402
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1398
1403
|
className: styles$6.columnHeader
|
|
1399
1404
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
@@ -1416,25 +1421,25 @@ const ResultsColumn = ({
|
|
|
1416
1421
|
className: styles$6.columnFooter
|
|
1417
1422
|
}, /*#__PURE__*/React.createElement(SeeAllLinkButton, {
|
|
1418
1423
|
onClick: onSeeAll,
|
|
1419
|
-
label:
|
|
1424
|
+
label: "See all ".concat(title.toLowerCase())
|
|
1420
1425
|
}))));
|
|
1421
1426
|
};
|
|
1422
1427
|
|
|
1423
1428
|
var styles$5 = {"contentCard":"ContentCardHorizontal-module__contentCard___l-Kim","contentMeta":"ContentCardHorizontal-module__contentMeta___rEW-X","contentCategory":"ContentCardHorizontal-module__contentCategory___NssVD","contentMetaText":"ContentCardHorizontal-module__contentMetaText___muYBN","contentTitle":"ContentCardHorizontal-module__contentTitle___54gEo","contentExcerpt":"ContentCardHorizontal-module__contentExcerpt___tqg1v"};
|
|
1424
1429
|
|
|
1425
|
-
|
|
1426
|
-
id
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1430
|
+
var ContentCardHorizontal = function (_a) {
|
|
1431
|
+
_a.id;
|
|
1432
|
+
var title = _a.title,
|
|
1433
|
+
url = _a.url,
|
|
1434
|
+
category = _a.category,
|
|
1435
|
+
meta = _a.meta,
|
|
1436
|
+
excerpt = _a.excerpt,
|
|
1437
|
+
_b = _a.className,
|
|
1438
|
+
className = _b === void 0 ? "" : _b;
|
|
1434
1439
|
return /*#__PURE__*/React.createElement("a", {
|
|
1435
1440
|
href: url,
|
|
1436
|
-
className:
|
|
1437
|
-
"aria-label":
|
|
1441
|
+
className: "".concat(styles$5.contentCard, " ").concat(className),
|
|
1442
|
+
"aria-label": "View content: ".concat(title)
|
|
1438
1443
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1439
1444
|
className: styles$5.contentMeta
|
|
1440
1445
|
}, category && /*#__PURE__*/React.createElement("span", {
|
|
@@ -1450,25 +1455,23 @@ const ContentCardHorizontal = ({
|
|
|
1450
1455
|
|
|
1451
1456
|
var styles$4 = {"instantResultsLayout":"InstantResults-module__instantResultsLayout___oy-o4","queryHeader":"InstantResults-module__queryHeader___Vmbul","queryText":"InstantResults-module__queryText___uVCCc","queryHighlight":"InstantResults-module__queryHighlight___C3hP1","columnsGrid":"InstantResults-module__columnsGrid___bHRUM"};
|
|
1452
1457
|
|
|
1453
|
-
|
|
1454
|
-
query,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
const showCombinedButton = hasResults && !isLoadingProducts && !isLoadingContents;
|
|
1468
|
-
|
|
1458
|
+
var FederatedInstantResultsLayout = function (_a) {
|
|
1459
|
+
var query = _a.query,
|
|
1460
|
+
products = _a.products,
|
|
1461
|
+
contents = _a.contents,
|
|
1462
|
+
isLoadingProducts = _a.isLoadingProducts,
|
|
1463
|
+
isLoadingContents = _a.isLoadingContents,
|
|
1464
|
+
productsError = _a.productsError,
|
|
1465
|
+
contentsError = _a.contentsError,
|
|
1466
|
+
onSeeAllProducts = _a.onSeeAllProducts,
|
|
1467
|
+
onSeeAllContents = _a.onSeeAllContents,
|
|
1468
|
+
onSeeAllCombined = _a.onSeeAllCombined;
|
|
1469
|
+
var totalResults = products.length + contents.length;
|
|
1470
|
+
var hasResults = totalResults > 0;
|
|
1471
|
+
var showCombinedButton = hasResults && !isLoadingProducts && !isLoadingContents;
|
|
1469
1472
|
// Show first 3 results from each category
|
|
1470
|
-
|
|
1471
|
-
|
|
1473
|
+
var displayProducts = products.slice(0, 3);
|
|
1474
|
+
var displayContents = contents.slice(0, 3);
|
|
1472
1475
|
return /*#__PURE__*/React.createElement("div", {
|
|
1473
1476
|
className: styles$4.instantResultsLayout
|
|
1474
1477
|
}, query && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1488,17 +1491,21 @@ const FederatedInstantResultsLayout = ({
|
|
|
1488
1491
|
isLoading: isLoadingProducts,
|
|
1489
1492
|
error: productsError,
|
|
1490
1493
|
onSeeAll: onSeeAllProducts
|
|
1491
|
-
}, displayProducts.map(
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
+
}, displayProducts.map(function (product) {
|
|
1495
|
+
return /*#__PURE__*/React.createElement(ProductCardHorizontal, _extends({
|
|
1496
|
+
key: product.id
|
|
1497
|
+
}, product));
|
|
1498
|
+
})), /*#__PURE__*/React.createElement(ResultsColumn, {
|
|
1494
1499
|
title: "Content",
|
|
1495
1500
|
count: contents.length,
|
|
1496
1501
|
isLoading: isLoadingContents,
|
|
1497
1502
|
error: contentsError,
|
|
1498
1503
|
onSeeAll: onSeeAllContents
|
|
1499
|
-
}, displayContents.map(
|
|
1500
|
-
|
|
1501
|
-
|
|
1504
|
+
}, displayContents.map(function (content) {
|
|
1505
|
+
return /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({
|
|
1506
|
+
key: content.id
|
|
1507
|
+
}, content));
|
|
1508
|
+
}))));
|
|
1502
1509
|
};
|
|
1503
1510
|
|
|
1504
1511
|
var styles$3 = {"filtersPanel":"Filters-module__filtersPanel___T3SlK","filtersPanelHeader":"Filters-module__filtersPanelHeader___XOBTi","filtersPanelTitle":"Filters-module__filtersPanelTitle___Mnn10","filtersList":"Filters-module__filtersList___jPgkP","filterAccordion":"Filters-module__filterAccordion___Mf9Oe","accordionHeader":"Filters-module__accordionHeader___DtPJx","accordionTitle":"Filters-module__accordionTitle___YtHXW","accordionIcon":"Filters-module__accordionIcon___zRGrv","accordionIconExpanded":"Filters-module__accordionIconExpanded___pkkjv","accordionContent":"Filters-module__accordionContent___SqhIu","accordionSearch":"Filters-module__accordionSearch___V0A74","filterSearch":"Filters-module__filterSearch___Jc8AX","searchIcon":"Filters-module__searchIcon___pas1t","searchInput":"Filters-module__searchInput___nzOMK","clearButton":"Filters-module__clearButton___tHl6L","filterList":"Filters-module__filterList___TLqBu","filterItem":"Filters-module__filterItem___lA2rv","filterCheckbox":"Filters-module__filterCheckbox___9In3q","filterLabel":"Filters-module__filterLabel___w-M8J","filterCount":"Filters-module__filterCount___XMsmy","noResults":"Filters-module__noResults___ZdZ4V","loadingState":"Filters-module__loadingState___k6olr","spinner":"Filters-module__spinner___hvTaP","appliedFilters":"Filters-module__appliedFilters___hP4x-","appliedFiltersHeader":"Filters-module__appliedFiltersHeader___w-ZBN","appliedFiltersTitle":"Filters-module__appliedFiltersTitle___k6VbJ","appliedFiltersCount":"Filters-module__appliedFiltersCount___UQikX","clearAllButton":"Filters-module__clearAllButton___yviGV","appliedFiltersList":"Filters-module__appliedFiltersList___-fx9D","appliedFilterTag":"Filters-module__appliedFilterTag___hd5yc","tagLabel":"Filters-module__tagLabel___0ImQk","tagRemoveButton":"Filters-module__tagRemoveButton___JaA8M"};
|
|
@@ -1506,20 +1513,20 @@ var styles$3 = {"filtersPanel":"Filters-module__filtersPanel___T3SlK","filtersPa
|
|
|
1506
1513
|
/**
|
|
1507
1514
|
* FilterSearch - Search input for filtering facet values
|
|
1508
1515
|
*/
|
|
1509
|
-
|
|
1510
|
-
value,
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
+
var FilterSearch = function (_a) {
|
|
1517
|
+
var value = _a.value,
|
|
1518
|
+
onChange = _a.onChange,
|
|
1519
|
+
_b = _a.placeholder,
|
|
1520
|
+
placeholder = _b === void 0 ? "Search" : _b,
|
|
1521
|
+
className = _a.className;
|
|
1522
|
+
var handleChange = function (e) {
|
|
1516
1523
|
onChange(e.target.value);
|
|
1517
1524
|
};
|
|
1518
|
-
|
|
1525
|
+
var handleClear = function () {
|
|
1519
1526
|
onChange("");
|
|
1520
1527
|
};
|
|
1521
1528
|
return /*#__PURE__*/React.createElement("div", {
|
|
1522
|
-
className:
|
|
1529
|
+
className: "".concat(styles$3.filterSearch, " ").concat(className || "")
|
|
1523
1530
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
1524
1531
|
className: styles$3.searchIcon,
|
|
1525
1532
|
width: "16",
|
|
@@ -1570,29 +1577,28 @@ const FilterSearch = ({
|
|
|
1570
1577
|
/**
|
|
1571
1578
|
* FilterItem - Individual facet item with checkbox and count
|
|
1572
1579
|
*/
|
|
1573
|
-
|
|
1574
|
-
value,
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
const handleChange = () => {
|
|
1580
|
+
var FilterItem = function (_a) {
|
|
1581
|
+
var value = _a.value,
|
|
1582
|
+
onToggle = _a.onToggle,
|
|
1583
|
+
className = _a.className;
|
|
1584
|
+
var handleChange = function () {
|
|
1579
1585
|
onToggle(value.value);
|
|
1580
1586
|
};
|
|
1581
|
-
|
|
1587
|
+
var handleKeyDown = function (e) {
|
|
1582
1588
|
if (e.key === "Enter" || e.key === " ") {
|
|
1583
1589
|
e.preventDefault();
|
|
1584
1590
|
onToggle(value.value);
|
|
1585
1591
|
}
|
|
1586
1592
|
};
|
|
1587
1593
|
return /*#__PURE__*/React.createElement("label", {
|
|
1588
|
-
className:
|
|
1594
|
+
className: "".concat(styles$3.filterItem, " ").concat(className || ""),
|
|
1589
1595
|
onKeyDown: handleKeyDown
|
|
1590
1596
|
}, /*#__PURE__*/React.createElement("input", {
|
|
1591
1597
|
type: "checkbox",
|
|
1592
1598
|
checked: value.isRefined,
|
|
1593
1599
|
onChange: handleChange,
|
|
1594
1600
|
className: styles$3.filterCheckbox,
|
|
1595
|
-
"aria-label":
|
|
1601
|
+
"aria-label": "".concat(value.value, " (").concat(value.count, " results)")
|
|
1596
1602
|
}), /*#__PURE__*/React.createElement("span", {
|
|
1597
1603
|
className: styles$3.filterLabel
|
|
1598
1604
|
}, value.value), /*#__PURE__*/React.createElement("span", {
|
|
@@ -1603,52 +1609,54 @@ const FilterItem = ({
|
|
|
1603
1609
|
/**
|
|
1604
1610
|
* FilterAccordion - Collapsible facet section with optional search
|
|
1605
1611
|
*/
|
|
1606
|
-
|
|
1607
|
-
facet,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1612
|
+
var FilterAccordion = function (_a) {
|
|
1613
|
+
var facet = _a.facet,
|
|
1614
|
+
isExpanded = _a.isExpanded,
|
|
1615
|
+
onToggle = _a.onToggle,
|
|
1616
|
+
onValueToggle = _a.onValueToggle,
|
|
1617
|
+
className = _a.className;
|
|
1618
|
+
var _b = useState(""),
|
|
1619
|
+
searchQuery = _b[0],
|
|
1620
|
+
setSearchQuery = _b[1];
|
|
1615
1621
|
// Filter facet values based on search query
|
|
1616
|
-
|
|
1622
|
+
var filteredValues = useMemo(function () {
|
|
1617
1623
|
if (!searchQuery.trim()) {
|
|
1618
1624
|
return facet.values;
|
|
1619
1625
|
}
|
|
1620
|
-
|
|
1621
|
-
return facet.values.filter(
|
|
1626
|
+
var query = searchQuery.toLowerCase();
|
|
1627
|
+
return facet.values.filter(function (value) {
|
|
1628
|
+
return value.value.toLowerCase().includes(query);
|
|
1629
|
+
});
|
|
1622
1630
|
}, [facet.values, searchQuery]);
|
|
1623
|
-
|
|
1631
|
+
var handleToggle = function () {
|
|
1624
1632
|
onToggle();
|
|
1625
1633
|
// Clear search when collapsing
|
|
1626
1634
|
if (isExpanded) {
|
|
1627
1635
|
setSearchQuery("");
|
|
1628
1636
|
}
|
|
1629
1637
|
};
|
|
1630
|
-
|
|
1638
|
+
var handleKeyDown = function (e) {
|
|
1631
1639
|
if (e.key === "Enter" || e.key === " ") {
|
|
1632
1640
|
e.preventDefault();
|
|
1633
1641
|
handleToggle();
|
|
1634
1642
|
}
|
|
1635
1643
|
};
|
|
1636
|
-
|
|
1644
|
+
var handleValueToggle = function (value) {
|
|
1637
1645
|
onValueToggle(facet.attribute, value);
|
|
1638
1646
|
};
|
|
1639
1647
|
return /*#__PURE__*/React.createElement("div", {
|
|
1640
|
-
className:
|
|
1648
|
+
className: "".concat(styles$3.filterAccordion, " ").concat(className || "")
|
|
1641
1649
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1642
1650
|
type: "button",
|
|
1643
|
-
className:
|
|
1651
|
+
className: "".concat(styles$3.accordionHeader, " ").concat(isExpanded ? styles$3.accordionHeaderExpanded : ""),
|
|
1644
1652
|
onClick: handleToggle,
|
|
1645
1653
|
onKeyDown: handleKeyDown,
|
|
1646
1654
|
"aria-expanded": isExpanded,
|
|
1647
|
-
"aria-controls":
|
|
1655
|
+
"aria-controls": "accordion-".concat(facet.id)
|
|
1648
1656
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1649
1657
|
className: styles$3.accordionTitle
|
|
1650
1658
|
}, facet.label), /*#__PURE__*/React.createElement("svg", {
|
|
1651
|
-
className:
|
|
1659
|
+
className: "".concat(styles$3.accordionIcon, " ").concat(isExpanded ? styles$3.accordionIconExpanded : ""),
|
|
1652
1660
|
width: "16",
|
|
1653
1661
|
height: "16",
|
|
1654
1662
|
viewBox: "0 0 16 16",
|
|
@@ -1662,7 +1670,7 @@ const FilterAccordion = ({
|
|
|
1662
1670
|
strokeLinecap: "round",
|
|
1663
1671
|
strokeLinejoin: "round"
|
|
1664
1672
|
}))), isExpanded && /*#__PURE__*/React.createElement("div", {
|
|
1665
|
-
id:
|
|
1673
|
+
id: "accordion-".concat(facet.id),
|
|
1666
1674
|
className: styles$3.accordionContent
|
|
1667
1675
|
}, facet.searchable && facet.values.length > 5 && /*#__PURE__*/React.createElement("div", {
|
|
1668
1676
|
className: styles$3.accordionSearch
|
|
@@ -1672,11 +1680,13 @@ const FilterAccordion = ({
|
|
|
1672
1680
|
placeholder: "Search"
|
|
1673
1681
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1674
1682
|
className: styles$3.filterList
|
|
1675
|
-
}, filteredValues.length > 0 ? filteredValues.map(
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1683
|
+
}, filteredValues.length > 0 ? filteredValues.map(function (value) {
|
|
1684
|
+
return /*#__PURE__*/React.createElement(FilterItem, {
|
|
1685
|
+
key: value.value,
|
|
1686
|
+
value: value,
|
|
1687
|
+
onToggle: handleValueToggle
|
|
1688
|
+
});
|
|
1689
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
1680
1690
|
className: styles$3.noResults
|
|
1681
1691
|
}, "No results found"))));
|
|
1682
1692
|
};
|
|
@@ -1684,24 +1694,23 @@ const FilterAccordion = ({
|
|
|
1684
1694
|
/**
|
|
1685
1695
|
* AppliedFilterTag - Individual removable filter tag/chip
|
|
1686
1696
|
*/
|
|
1687
|
-
|
|
1688
|
-
attribute,
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
const handleRemove = () => {
|
|
1697
|
+
var AppliedFilterTag = function (_a) {
|
|
1698
|
+
var attribute = _a.attribute,
|
|
1699
|
+
value = _a.value,
|
|
1700
|
+
label = _a.label,
|
|
1701
|
+
onRemove = _a.onRemove,
|
|
1702
|
+
className = _a.className;
|
|
1703
|
+
var handleRemove = function () {
|
|
1695
1704
|
onRemove(attribute, value);
|
|
1696
1705
|
};
|
|
1697
|
-
|
|
1706
|
+
var handleKeyDown = function (e) {
|
|
1698
1707
|
if (e.key === "Enter" || e.key === " ") {
|
|
1699
1708
|
e.preventDefault();
|
|
1700
1709
|
handleRemove();
|
|
1701
1710
|
}
|
|
1702
1711
|
};
|
|
1703
1712
|
return /*#__PURE__*/React.createElement("div", {
|
|
1704
|
-
className:
|
|
1713
|
+
className: "".concat(styles$3.appliedFilterTag, " ").concat(className || "")
|
|
1705
1714
|
}, /*#__PURE__*/React.createElement("span", {
|
|
1706
1715
|
className: styles$3.tagLabel
|
|
1707
1716
|
}, label || value), /*#__PURE__*/React.createElement("button", {
|
|
@@ -1709,7 +1718,7 @@ const AppliedFilterTag = ({
|
|
|
1709
1718
|
onClick: handleRemove,
|
|
1710
1719
|
onKeyDown: handleKeyDown,
|
|
1711
1720
|
className: styles$3.tagRemoveButton,
|
|
1712
|
-
"aria-label":
|
|
1721
|
+
"aria-label": "Remove ".concat(label || value, " filter")
|
|
1713
1722
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
1714
1723
|
width: "12",
|
|
1715
1724
|
height: "12",
|
|
@@ -1729,17 +1738,16 @@ const AppliedFilterTag = ({
|
|
|
1729
1738
|
/**
|
|
1730
1739
|
* AppliedFilters - Shows all active filters as removable tags
|
|
1731
1740
|
*/
|
|
1732
|
-
|
|
1733
|
-
facets,
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
}) => {
|
|
1741
|
+
var AppliedFilters = function (_a) {
|
|
1742
|
+
var facets = _a.facets,
|
|
1743
|
+
onRemove = _a.onRemove,
|
|
1744
|
+
onClearAll = _a.onClearAll,
|
|
1745
|
+
className = _a.className;
|
|
1738
1746
|
// Extract all refined (selected) filters
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
facets.forEach(facet
|
|
1742
|
-
facet.values.forEach(value
|
|
1747
|
+
var appliedFilters = useMemo(function () {
|
|
1748
|
+
var filters = [];
|
|
1749
|
+
facets.forEach(function (facet) {
|
|
1750
|
+
facet.values.forEach(function (value) {
|
|
1743
1751
|
if (value.isRefined) {
|
|
1744
1752
|
filters.push({
|
|
1745
1753
|
attribute: facet.attribute,
|
|
@@ -1752,23 +1760,22 @@ const AppliedFilters = ({
|
|
|
1752
1760
|
});
|
|
1753
1761
|
return filters;
|
|
1754
1762
|
}, [facets]);
|
|
1755
|
-
|
|
1756
1763
|
// Don't render if no filters are applied
|
|
1757
1764
|
if (appliedFilters.length === 0) {
|
|
1758
1765
|
return null;
|
|
1759
1766
|
}
|
|
1760
|
-
|
|
1767
|
+
var handleClearAll = function () {
|
|
1761
1768
|
if (onClearAll) {
|
|
1762
1769
|
onClearAll();
|
|
1763
1770
|
} else {
|
|
1764
1771
|
// If no clearAll handler, remove each filter individually
|
|
1765
|
-
appliedFilters.forEach(filter
|
|
1772
|
+
appliedFilters.forEach(function (filter) {
|
|
1766
1773
|
onRemove(filter.attribute, filter.value);
|
|
1767
1774
|
});
|
|
1768
1775
|
}
|
|
1769
1776
|
};
|
|
1770
1777
|
return /*#__PURE__*/React.createElement("div", {
|
|
1771
|
-
className:
|
|
1778
|
+
className: "".concat(styles$3.appliedFilters, " ").concat(className || "")
|
|
1772
1779
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1773
1780
|
className: styles$3.appliedFiltersHeader
|
|
1774
1781
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
@@ -1782,38 +1789,42 @@ const AppliedFilters = ({
|
|
|
1782
1789
|
"aria-label": "Clear all filters"
|
|
1783
1790
|
}, "Clear all")), /*#__PURE__*/React.createElement("div", {
|
|
1784
1791
|
className: styles$3.appliedFiltersList
|
|
1785
|
-
}, appliedFilters.map(
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
+
}, appliedFilters.map(function (filter) {
|
|
1793
|
+
return /*#__PURE__*/React.createElement(AppliedFilterTag, {
|
|
1794
|
+
key: "".concat(filter.attribute, "-").concat(filter.value),
|
|
1795
|
+
attribute: filter.attribute,
|
|
1796
|
+
value: filter.value,
|
|
1797
|
+
label: filter.label,
|
|
1798
|
+
onRemove: onRemove
|
|
1799
|
+
});
|
|
1800
|
+
})));
|
|
1792
1801
|
};
|
|
1793
1802
|
|
|
1794
1803
|
/**
|
|
1795
1804
|
* FiltersPanel - Main container for all filters
|
|
1796
1805
|
*/
|
|
1797
|
-
|
|
1798
|
-
facets,
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1806
|
+
var FiltersPanel = function (_a) {
|
|
1807
|
+
var facets = _a.facets,
|
|
1808
|
+
onFacetToggle = _a.onFacetToggle,
|
|
1809
|
+
_b = _a.isLoading,
|
|
1810
|
+
isLoading = _b === void 0 ? false : _b,
|
|
1811
|
+
className = _a.className;
|
|
1803
1812
|
// Track which accordions are expanded
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
setExpandedAccordions
|
|
1816
|
-
|
|
1813
|
+
var _c = useState(function () {
|
|
1814
|
+
// Initialize with default expanded facets
|
|
1815
|
+
var expanded = new Set();
|
|
1816
|
+
facets.forEach(function (facet) {
|
|
1817
|
+
if (facet.defaultExpanded) {
|
|
1818
|
+
expanded.add(facet.id);
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
return expanded;
|
|
1822
|
+
}),
|
|
1823
|
+
expandedAccordions = _c[0],
|
|
1824
|
+
setExpandedAccordions = _c[1];
|
|
1825
|
+
var handleAccordionToggle = useCallback(function (facetId) {
|
|
1826
|
+
setExpandedAccordions(function (prev) {
|
|
1827
|
+
var next = new Set(prev);
|
|
1817
1828
|
if (next.has(facetId)) {
|
|
1818
1829
|
next.delete(facetId);
|
|
1819
1830
|
} else {
|
|
@@ -1822,16 +1833,16 @@ const FiltersPanel = ({
|
|
|
1822
1833
|
return next;
|
|
1823
1834
|
});
|
|
1824
1835
|
}, []);
|
|
1825
|
-
|
|
1836
|
+
var handleValueToggle = useCallback(function (attribute, value) {
|
|
1826
1837
|
onFacetToggle(attribute, value);
|
|
1827
1838
|
}, [onFacetToggle]);
|
|
1828
|
-
|
|
1839
|
+
var handleRemoveFilter = useCallback(function (attribute, value) {
|
|
1829
1840
|
onFacetToggle(attribute, value);
|
|
1830
1841
|
}, [onFacetToggle]);
|
|
1831
|
-
|
|
1842
|
+
var handleClearAll = useCallback(function () {
|
|
1832
1843
|
// Remove all refined facets
|
|
1833
|
-
facets.forEach(facet
|
|
1834
|
-
facet.values.forEach(value
|
|
1844
|
+
facets.forEach(function (facet) {
|
|
1845
|
+
facet.values.forEach(function (value) {
|
|
1835
1846
|
if (value.isRefined) {
|
|
1836
1847
|
onFacetToggle(facet.attribute, value.value);
|
|
1837
1848
|
}
|
|
@@ -1840,7 +1851,7 @@ const FiltersPanel = ({
|
|
|
1840
1851
|
}, [facets, onFacetToggle]);
|
|
1841
1852
|
if (isLoading) {
|
|
1842
1853
|
return /*#__PURE__*/React.createElement("div", {
|
|
1843
|
-
className:
|
|
1854
|
+
className: "".concat(styles$3.filtersPanel, " ").concat(className || "")
|
|
1844
1855
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1845
1856
|
className: styles$3.filtersPanelHeader
|
|
1846
1857
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
@@ -1855,7 +1866,7 @@ const FiltersPanel = ({
|
|
|
1855
1866
|
return null;
|
|
1856
1867
|
}
|
|
1857
1868
|
return /*#__PURE__*/React.createElement("div", {
|
|
1858
|
-
className:
|
|
1869
|
+
className: "".concat(styles$3.filtersPanel, " ").concat(className || "")
|
|
1859
1870
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1860
1871
|
className: styles$3.filtersPanelHeader
|
|
1861
1872
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
@@ -1866,28 +1877,34 @@ const FiltersPanel = ({
|
|
|
1866
1877
|
onClearAll: handleClearAll
|
|
1867
1878
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1868
1879
|
className: styles$3.filtersList
|
|
1869
|
-
}, facets.map(
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1880
|
+
}, facets.map(function (facet) {
|
|
1881
|
+
return /*#__PURE__*/React.createElement(FilterAccordion, {
|
|
1882
|
+
key: facet.id,
|
|
1883
|
+
facet: facet,
|
|
1884
|
+
isExpanded: expandedAccordions.has(facet.id),
|
|
1885
|
+
onToggle: function () {
|
|
1886
|
+
return handleAccordionToggle(facet.id);
|
|
1887
|
+
},
|
|
1888
|
+
onValueToggle: handleValueToggle
|
|
1889
|
+
});
|
|
1890
|
+
})));
|
|
1876
1891
|
};
|
|
1877
1892
|
|
|
1878
1893
|
var styles$2 = {"resultsView":"ResultsView-module__resultsView___S4Wh2","searchBarWrapper":"ResultsView-module__searchBarWrapper___XNtwR","tabsContainer":"ResultsView-module__tabsContainer___mB-Q2","tabs":"ResultsView-module__tabs___rOexd","tab":"ResultsView-module__tab___IWPLf","tabActive":"ResultsView-module__tabActive___YLWB0","tabCount":"ResultsView-module__tabCount___trVav","resultsContainer":"ResultsView-module__resultsContainer___J4URa","sidebar":"ResultsView-module__sidebar___nQq5J","mainContent":"ResultsView-module__mainContent___S9eIG","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"};
|
|
1879
1894
|
|
|
1880
|
-
|
|
1881
|
-
type,
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1895
|
+
var ResultsList = function (_a) {
|
|
1896
|
+
var type = _a.type,
|
|
1897
|
+
_b = _a.products,
|
|
1898
|
+
products = _b === void 0 ? [] : _b,
|
|
1899
|
+
_c = _a.contents,
|
|
1900
|
+
contents = _c === void 0 ? [] : _c,
|
|
1901
|
+
isLoading = _a.isLoading,
|
|
1902
|
+
error = _a.error,
|
|
1903
|
+
_d = _a.className,
|
|
1904
|
+
className = _d === void 0 ? '' : _d;
|
|
1888
1905
|
if (isLoading) {
|
|
1889
1906
|
return /*#__PURE__*/React.createElement("div", {
|
|
1890
|
-
className:
|
|
1907
|
+
className: "".concat(styles$2.loadingState, " ").concat(className)
|
|
1891
1908
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1892
1909
|
className: styles$2.spinner,
|
|
1893
1910
|
"aria-label": "Loading..."
|
|
@@ -1895,15 +1912,15 @@ const ResultsList = ({
|
|
|
1895
1912
|
}
|
|
1896
1913
|
if (error) {
|
|
1897
1914
|
return /*#__PURE__*/React.createElement("div", {
|
|
1898
|
-
className:
|
|
1915
|
+
className: "".concat(styles$2.errorState, " ").concat(className)
|
|
1899
1916
|
}, /*#__PURE__*/React.createElement("p", null, error));
|
|
1900
1917
|
}
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1918
|
+
var hasProducts = products.length > 0;
|
|
1919
|
+
var hasContents = contents.length > 0;
|
|
1920
|
+
var hasResults = hasProducts || hasContents;
|
|
1904
1921
|
if (!hasResults) {
|
|
1905
1922
|
return /*#__PURE__*/React.createElement("div", {
|
|
1906
|
-
className:
|
|
1923
|
+
className: "".concat(styles$2.emptyState, " ").concat(className)
|
|
1907
1924
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
1908
1925
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1909
1926
|
viewBox: "0 0 24 24",
|
|
@@ -1921,60 +1938,65 @@ const ResultsList = ({
|
|
|
1921
1938
|
d: "m21 21-4.35-4.35"
|
|
1922
1939
|
})), /*#__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."));
|
|
1923
1940
|
}
|
|
1924
|
-
|
|
1925
1941
|
// Render based on type
|
|
1926
1942
|
if (type === 'products') {
|
|
1927
1943
|
return /*#__PURE__*/React.createElement("div", {
|
|
1928
|
-
className:
|
|
1929
|
-
}, products.map(
|
|
1930
|
-
|
|
1931
|
-
|
|
1944
|
+
className: "".concat(styles$2.resultsList, " ").concat(className)
|
|
1945
|
+
}, products.map(function (product) {
|
|
1946
|
+
return /*#__PURE__*/React.createElement(ProductCardHorizontal, _extends({
|
|
1947
|
+
key: product.id
|
|
1948
|
+
}, product));
|
|
1949
|
+
}));
|
|
1932
1950
|
}
|
|
1933
1951
|
if (type === 'content') {
|
|
1934
1952
|
return /*#__PURE__*/React.createElement("div", {
|
|
1935
|
-
className:
|
|
1936
|
-
}, contents.map(
|
|
1937
|
-
|
|
1938
|
-
|
|
1953
|
+
className: "".concat(styles$2.resultsList, " ").concat(className)
|
|
1954
|
+
}, contents.map(function (content) {
|
|
1955
|
+
return /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({
|
|
1956
|
+
key: content.id
|
|
1957
|
+
}, content));
|
|
1958
|
+
}));
|
|
1939
1959
|
}
|
|
1940
|
-
|
|
1941
1960
|
// type === 'all' - Show mixed results
|
|
1942
1961
|
return /*#__PURE__*/React.createElement("div", {
|
|
1943
|
-
className:
|
|
1962
|
+
className: "".concat(styles$2.resultsList, " ").concat(className)
|
|
1944
1963
|
}, hasProducts && /*#__PURE__*/React.createElement("div", {
|
|
1945
1964
|
className: styles$2.resultsSection
|
|
1946
1965
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
1947
1966
|
className: styles$2.sectionTitle
|
|
1948
|
-
}, "Products (", products.length, ")"), products.map(
|
|
1949
|
-
|
|
1950
|
-
|
|
1967
|
+
}, "Products (", products.length, ")"), products.map(function (product) {
|
|
1968
|
+
return /*#__PURE__*/React.createElement(ProductCardHorizontal, _extends({
|
|
1969
|
+
key: product.id
|
|
1970
|
+
}, product));
|
|
1971
|
+
})), hasContents && /*#__PURE__*/React.createElement("div", {
|
|
1951
1972
|
className: styles$2.resultsSection
|
|
1952
1973
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
1953
1974
|
className: styles$2.sectionTitle
|
|
1954
|
-
}, "Content (", contents.length, ")"), contents.map(
|
|
1955
|
-
|
|
1956
|
-
|
|
1975
|
+
}, "Content (", contents.length, ")"), contents.map(function (content) {
|
|
1976
|
+
return /*#__PURE__*/React.createElement(ContentCardHorizontal, _extends({
|
|
1977
|
+
key: content.id
|
|
1978
|
+
}, content));
|
|
1979
|
+
})));
|
|
1957
1980
|
};
|
|
1958
1981
|
|
|
1959
|
-
|
|
1960
|
-
query,
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
const tabs = [{
|
|
1982
|
+
var FederatedResultsView = function (_a) {
|
|
1983
|
+
var query = _a.query,
|
|
1984
|
+
onQueryChange = _a.onQueryChange,
|
|
1985
|
+
onSearchSubmit = _a.onSearchSubmit,
|
|
1986
|
+
activeTab = _a.activeTab,
|
|
1987
|
+
onTabChange = _a.onTabChange,
|
|
1988
|
+
products = _a.products,
|
|
1989
|
+
contents = _a.contents,
|
|
1990
|
+
isLoadingProducts = _a.isLoadingProducts,
|
|
1991
|
+
isLoadingContents = _a.isLoadingContents,
|
|
1992
|
+
productsError = _a.productsError,
|
|
1993
|
+
contentsError = _a.contentsError,
|
|
1994
|
+
currentPage = _a.currentPage,
|
|
1995
|
+
totalPages = _a.totalPages,
|
|
1996
|
+
onPageChange = _a.onPageChange,
|
|
1997
|
+
facets = _a.facets,
|
|
1998
|
+
onFacetToggle = _a.onFacetToggle;
|
|
1999
|
+
var tabs = [{
|
|
1978
2000
|
id: "products",
|
|
1979
2001
|
label: "Products",
|
|
1980
2002
|
count: products.length
|
|
@@ -1983,12 +2005,11 @@ const FederatedResultsView = ({
|
|
|
1983
2005
|
label: "Content",
|
|
1984
2006
|
count: contents.length
|
|
1985
2007
|
}];
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2008
|
+
var isLoading = activeTab === "products" && isLoadingProducts || activeTab === "content" && isLoadingContents;
|
|
2009
|
+
var error = activeTab === "products" ? productsError : contentsError;
|
|
1989
2010
|
// Filter results based on active tab
|
|
1990
|
-
|
|
1991
|
-
|
|
2011
|
+
var displayProducts = activeTab === "content" ? [] : products;
|
|
2012
|
+
var displayContents = activeTab === "products" ? [] : contents;
|
|
1992
2013
|
return /*#__PURE__*/React.createElement("div", {
|
|
1993
2014
|
className: styles$2.resultsView
|
|
1994
2015
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2003,17 +2024,21 @@ const FederatedResultsView = ({
|
|
|
2003
2024
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2004
2025
|
className: styles$2.tabs,
|
|
2005
2026
|
role: "tablist"
|
|
2006
|
-
}, tabs.map(
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2027
|
+
}, tabs.map(function (tab) {
|
|
2028
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
2029
|
+
key: tab.id,
|
|
2030
|
+
type: "button",
|
|
2031
|
+
role: "tab",
|
|
2032
|
+
"aria-selected": activeTab === tab.id,
|
|
2033
|
+
"aria-controls": "tabpanel-".concat(tab.id),
|
|
2034
|
+
onClick: function () {
|
|
2035
|
+
return onTabChange(tab.id);
|
|
2036
|
+
},
|
|
2037
|
+
className: "".concat(styles$2.tab, " ").concat(activeTab === tab.id ? styles$2.tabActive : "")
|
|
2038
|
+
}, tab.label, tab.count > 0 && /*#__PURE__*/React.createElement("span", {
|
|
2039
|
+
className: styles$2.tabCount
|
|
2040
|
+
}, tab.count));
|
|
2041
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
2017
2042
|
className: styles$2.resultsContainer
|
|
2018
2043
|
}, /*#__PURE__*/React.createElement("aside", {
|
|
2019
2044
|
className: styles$2.sidebar
|
|
@@ -2023,9 +2048,9 @@ const FederatedResultsView = ({
|
|
|
2023
2048
|
})), /*#__PURE__*/React.createElement("main", {
|
|
2024
2049
|
className: styles$2.mainContent
|
|
2025
2050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2026
|
-
id:
|
|
2051
|
+
id: "tabpanel-".concat(activeTab),
|
|
2027
2052
|
role: "tabpanel",
|
|
2028
|
-
"aria-labelledby":
|
|
2053
|
+
"aria-labelledby": "tab-".concat(activeTab)
|
|
2029
2054
|
}, /*#__PURE__*/React.createElement(ResultsList, {
|
|
2030
2055
|
type: activeTab,
|
|
2031
2056
|
products: displayProducts,
|
|
@@ -2039,7 +2064,7 @@ const FederatedResultsView = ({
|
|
|
2039
2064
|
totalPages: totalPages,
|
|
2040
2065
|
onPageChange: onPageChange,
|
|
2041
2066
|
maxVisiblePages: 10,
|
|
2042
|
-
ariaLabel:
|
|
2067
|
+
ariaLabel: "".concat(activeTab === "products" ? "Products" : "Content", " pagination")
|
|
2043
2068
|
}))))));
|
|
2044
2069
|
};
|
|
2045
2070
|
|
|
@@ -2081,31 +2106,30 @@ var styles$1 = {"searchExperience":"FederatedSearchExperience-module__searchExpe
|
|
|
2081
2106
|
* />
|
|
2082
2107
|
* ```
|
|
2083
2108
|
*/
|
|
2084
|
-
|
|
2085
|
-
isOpen,
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
}) => {
|
|
2109
|
+
var FederatedSearchExperience = function (_a) {
|
|
2110
|
+
var isOpen = _a.isOpen,
|
|
2111
|
+
onClose = _a.onClose,
|
|
2112
|
+
query = _a.query,
|
|
2113
|
+
onQueryChange = _a.onQueryChange,
|
|
2114
|
+
onSearchSubmit = _a.onSearchSubmit,
|
|
2115
|
+
products = _a.products,
|
|
2116
|
+
contents = _a.contents,
|
|
2117
|
+
isLoadingProducts = _a.isLoadingProducts,
|
|
2118
|
+
isLoadingContents = _a.isLoadingContents,
|
|
2119
|
+
productsError = _a.productsError,
|
|
2120
|
+
contentsError = _a.contentsError,
|
|
2121
|
+
onSeeAllProducts = _a.onSeeAllProducts,
|
|
2122
|
+
onSeeAllContents = _a.onSeeAllContents,
|
|
2123
|
+
onSeeAllCombined = _a.onSeeAllCombined,
|
|
2124
|
+
activeView = _a.activeView;
|
|
2125
|
+
_a.onChangeView;
|
|
2126
|
+
var activeTab = _a.activeTab,
|
|
2127
|
+
onTabChange = _a.onTabChange,
|
|
2128
|
+
currentPage = _a.currentPage,
|
|
2129
|
+
totalPages = _a.totalPages,
|
|
2130
|
+
onPageChange = _a.onPageChange,
|
|
2131
|
+
facets = _a.facets,
|
|
2132
|
+
onFacetToggle = _a.onFacetToggle;
|
|
2109
2133
|
return /*#__PURE__*/React.createElement(SearchModal, {
|
|
2110
2134
|
isOpen: isOpen,
|
|
2111
2135
|
onClose: onClose,
|
|
@@ -2177,13 +2201,14 @@ const FederatedSearchExperience = ({
|
|
|
2177
2201
|
|
|
2178
2202
|
var styles = {"searchTrigger":"SearchTriggerButton-module__searchTrigger___PDbDB","searchIcon":"SearchTriggerButton-module__searchIcon___izByW","label":"SearchTriggerButton-module__label___mkS7T"};
|
|
2179
2203
|
|
|
2180
|
-
|
|
2181
|
-
onOpen,
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2204
|
+
var SearchTriggerButton = function (_a) {
|
|
2205
|
+
var onOpen = _a.onOpen,
|
|
2206
|
+
_b = _a.ariaLabel,
|
|
2207
|
+
ariaLabel = _b === void 0 ? 'Open search' : _b,
|
|
2208
|
+
label = _a.label,
|
|
2209
|
+
_c = _a.className,
|
|
2210
|
+
className = _c === void 0 ? '' : _c;
|
|
2211
|
+
var handleKeyDown = function (event) {
|
|
2187
2212
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
2188
2213
|
event.preventDefault();
|
|
2189
2214
|
onOpen();
|
|
@@ -2194,7 +2219,7 @@ const SearchTriggerButton = ({
|
|
|
2194
2219
|
onClick: onOpen,
|
|
2195
2220
|
onKeyDown: handleKeyDown,
|
|
2196
2221
|
"aria-label": ariaLabel,
|
|
2197
|
-
className:
|
|
2222
|
+
className: "".concat(styles.searchTrigger, " ").concat(className)
|
|
2198
2223
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
2199
2224
|
className: styles.searchIcon,
|
|
2200
2225
|
xmlns: "http://www.w3.org/2000/svg",
|