@asante-org/atlascopco-vt-litesitegenerator 3.0.18 → 3.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +356 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.scss +1087 -21
- package/dist/index.js +359 -34
- package/dist/index.js.map +1 -1
- package/dist/index.scss +1087 -21
- package/dist/src/components/lsg/LsgBreadcrumb/LsgBreadcrumb.d.ts +20 -0
- package/dist/src/components/lsg/LsgBreadcrumb/LsgBreadcrumb.stories.d.ts +10 -0
- package/dist/src/components/lsg/LsgBreadcrumb/index.d.ts +2 -0
- package/dist/src/components/lsg/LsgHeader/LsgHeaderInSitu.stories.d.ts +8 -0
- package/dist/src/components/lsg/LsgTabs/LsgTabs.d.ts +19 -0
- package/dist/src/components/lsg/LsgTabs/LsgTabs.stories.d.ts +12 -0
- package/dist/src/components/lsg/LsgTabs/index.d.ts +2 -0
- package/dist/src/components/lsg/index.d.ts +4 -0
- package/dist/src/components/lsg/lsg-clientlib-runtime.d.ts +1 -0
- package/dist/src/index.d.ts +5 -5
- package/dist/src/themes/createThemeComponents.d.ts +2 -0
- package/dist/src/themes/theme-1/components.d.ts +3 -1
- package/dist/src/themes/theme-2/components.d.ts +3 -1
- package/dist/src/themes/theme-3/components.d.ts +3 -1
- package/dist/themes/theme-1.css +598 -10
- package/dist/themes/theme-1.css.map +1 -1
- package/dist/themes/theme-1.js +184 -0
- package/dist/themes/theme-1.js.map +1 -1
- package/dist/themes/theme-2.css +732 -16
- package/dist/themes/theme-2.css.map +1 -1
- package/dist/themes/theme-2.js +184 -0
- package/dist/themes/theme-2.js.map +1 -1
- package/dist/themes/theme-3.css +840 -14
- package/dist/themes/theme-3.css.map +1 -1
- package/dist/themes/theme-3.js +184 -0
- package/dist/themes/theme-3.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -192,6 +192,105 @@ var LsgCards = function (_a) {
|
|
|
192
192
|
}));
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
+
var LSG_ICON_PATHS = {
|
|
196
|
+
bars: "M96 160C96 142.3 110.3 128 128 128L512 128C529.7 128 544 142.3 544 160C544 177.7 529.7 192 512 192L128 192C110.3 192 96 177.7 96 160zM96 320C96 302.3 110.3 288 128 288L512 288C529.7 288 544 302.3 544 320C544 337.7 529.7 352 512 352L128 352C110.3 352 96 337.7 96 320zM544 480C544 497.7 529.7 512 512 512L128 512C110.3 512 96 497.7 96 480C96 462.3 110.3 448 128 448L512 448C529.7 448 544 462.3 544 480z",
|
|
197
|
+
chevronLeft: "M169.4 297.4C156.9 309.9 156.9 330.2 169.4 342.7L361.4 534.7C373.9 547.2 394.2 547.2 406.7 534.7C419.2 522.2 419.2 501.9 406.7 489.4L237.3 320L406.6 150.6C419.1 138.1 419.1 117.8 406.6 105.3C394.1 92.8 373.8 92.8 361.3 105.3L169.3 297.3z",
|
|
198
|
+
chevronRight: "M471.1 297.4C483.6 309.9 483.6 330.2 471.1 342.7L279.1 534.7C266.6 547.2 246.3 547.2 233.8 534.7C221.3 522.2 221.3 501.9 233.8 489.4L403.2 320L233.9 150.6C221.4 138.1 221.4 117.8 233.9 105.3C246.4 92.8 266.7 92.8 279.2 105.3L471.2 297.3z",
|
|
199
|
+
close: "M504.6 148.5C515.9 134.9 514.1 114.7 500.5 103.4C486.9 92.1 466.7 93.9 455.4 107.5L320 270L184.6 107.5C173.3 93.9 153.1 92.1 139.5 103.4C125.9 114.7 124.1 134.9 135.4 148.5L278.3 320L135.4 491.5C124.1 505.1 125.9 525.3 139.5 536.6C153.1 547.9 173.3 546.1 184.6 532.5L320 370L455.4 532.5C466.7 546.1 486.9 547.9 500.5 536.6C514.1 525.3 515.9 505.1 504.6 491.5L361.7 320L504.6 148.5z",
|
|
200
|
+
globe: "M367.2 477C345.7 520.7 325.8 528 320 528C314.2 528 294.3 520.7 272.8 477C255.8 442.5 243.6 395.4 240.7 344L399.3 344C396.3 395.5 384.1 442.6 367.2 477zM399.3 296L240.7 296C243.7 244.5 255.9 197.4 272.8 163C294.3 119.3 314.2 112 320 112C325.8 112 345.7 119.3 367.2 163C384.2 197.5 396.4 244.6 399.3 296zM447.4 344L526.6 344C518 418.6 469.9 481.3 403.8 510.4C427.8 467.6 444.1 408 447.4 344zM526.6 296L447.4 296C444.1 232 427.8 172.4 403.8 129.6C469.9 158.8 518 221.4 526.6 296zM192.6 296L113.4 296C122 221.4 170.1 158.7 236.2 129.6C212.2 172.4 195.9 232 192.6 296zM113.4 344L192.6 344C195.9 408 212.2 467.6 236.2 510.4C170.1 481.2 122 418.6 113.4 344zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576z",
|
|
201
|
+
home: "M96 320L320 128L544 320H480V528H352V384H288V528H160V320H96z",
|
|
202
|
+
search: "M480 272C480 317.9 465.1 360.3 440 394.7L566.6 521.4C579.1 533.9 579.1 554.2 566.6 566.7C554.1 579.2 533.8 579.2 521.3 566.7L394.7 440C360.3 465.1 317.9 480 272 480C157.1 480 64 386.9 64 272C64 157.1 157.1 64 272 64C386.9 64 480 157.1 480 272zM272 416C351.5 416 416 351.5 416 272C416 192.5 351.5 128 272 128C192.5 128 128 192.5 128 272C128 351.5 192.5 416 272 416z"
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
var LsgIcon = function (_a) {
|
|
206
|
+
var name = _a.name,
|
|
207
|
+
className = _a.className;
|
|
208
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
209
|
+
className: className,
|
|
210
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
211
|
+
viewBox: "0 0 640 640",
|
|
212
|
+
"aria-hidden": "true",
|
|
213
|
+
focusable: "false"
|
|
214
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
215
|
+
d: LSG_ICON_PATHS[name]
|
|
216
|
+
}));
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
function isSafeHref(href) {
|
|
220
|
+
if (!href) return false;
|
|
221
|
+
var value = href.trim().toLowerCase();
|
|
222
|
+
if (value.startsWith("javascript:") || value.startsWith("data:") || value.startsWith("vbscript:")) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
return value.startsWith("/") || value.startsWith("#") || value.startsWith("http://") || value.startsWith("https://") || !value.includes(":");
|
|
226
|
+
}
|
|
227
|
+
var BreadcrumbSeparator = function () {
|
|
228
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
229
|
+
className: "lsg-breadcrumb__separator",
|
|
230
|
+
"aria-hidden": "true"
|
|
231
|
+
}, /*#__PURE__*/React.createElement(LsgIcon, {
|
|
232
|
+
name: "chevronRight",
|
|
233
|
+
className: "lsg-breadcrumb__separator-icon"
|
|
234
|
+
}));
|
|
235
|
+
};
|
|
236
|
+
var LsgBreadcrumb = function (_a) {
|
|
237
|
+
var _b = _a.items,
|
|
238
|
+
items = _b === void 0 ? [] : _b,
|
|
239
|
+
_c = _a.showBreadcrumbs,
|
|
240
|
+
showBreadcrumbs = _c === void 0 ? true : _c,
|
|
241
|
+
_d = _a.includeHome,
|
|
242
|
+
includeHome = _d === void 0 ? true : _d,
|
|
243
|
+
_e = _a.homeHref,
|
|
244
|
+
homeHref = _e === void 0 ? "/" : _e,
|
|
245
|
+
_f = _a.homeLabel,
|
|
246
|
+
homeLabel = _f === void 0 ? "Home" : _f,
|
|
247
|
+
_g = _a.className,
|
|
248
|
+
className = _g === void 0 ? "" : _g;
|
|
249
|
+
if (!showBreadcrumbs) return null;
|
|
250
|
+
var visibleItems = Array.isArray(items) ? items.filter(function (item) {
|
|
251
|
+
return Boolean(item) && typeof item.label === "string" && item.label.trim().length > 0;
|
|
252
|
+
}) : [];
|
|
253
|
+
if (!includeHome && visibleItems.length === 0) return null;
|
|
254
|
+
var rootClassName = ["lsg-breadcrumb", className].filter(Boolean).join(" ");
|
|
255
|
+
var safeHomeHref = isSafeHref(homeHref) ? homeHref : "/";
|
|
256
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
257
|
+
className: rootClassName,
|
|
258
|
+
"aria-label": "Breadcrumb"
|
|
259
|
+
}, /*#__PURE__*/React.createElement("ol", {
|
|
260
|
+
className: "lsg-breadcrumb__list"
|
|
261
|
+
}, includeHome && /*#__PURE__*/React.createElement("li", {
|
|
262
|
+
className: "lsg-breadcrumb__item lsg-breadcrumb__item--home"
|
|
263
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
264
|
+
className: "lsg-breadcrumb__home",
|
|
265
|
+
href: safeHomeHref,
|
|
266
|
+
"aria-label": homeLabel
|
|
267
|
+
}, /*#__PURE__*/React.createElement(LsgIcon, {
|
|
268
|
+
name: "home",
|
|
269
|
+
className: "lsg-breadcrumb__home-icon"
|
|
270
|
+
}))), visibleItems.map(function (item, index) {
|
|
271
|
+
var isCurrent = index === visibleItems.length - 1;
|
|
272
|
+
var safeHref = isSafeHref(item.href) ? item.href : undefined;
|
|
273
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
274
|
+
key: "".concat(item.label, "-").concat(index)
|
|
275
|
+
}, (includeHome || index > 0) && /*#__PURE__*/React.createElement(BreadcrumbSeparator, null), /*#__PURE__*/React.createElement("li", {
|
|
276
|
+
className: ["lsg-breadcrumb__item", isCurrent ? "lsg-breadcrumb__item--current" : "lsg-breadcrumb__item--ancestor"].join(" ")
|
|
277
|
+
}, isCurrent ? /*#__PURE__*/React.createElement("span", {
|
|
278
|
+
className: "lsg-breadcrumb__current",
|
|
279
|
+
"aria-current": "page"
|
|
280
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
281
|
+
className: "lsg-breadcrumb__current-marker",
|
|
282
|
+
"aria-hidden": "true"
|
|
283
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
284
|
+
className: "lsg-breadcrumb__label"
|
|
285
|
+
}, item.label)) : safeHref ? /*#__PURE__*/React.createElement("a", {
|
|
286
|
+
className: "lsg-breadcrumb__link",
|
|
287
|
+
href: safeHref
|
|
288
|
+
}, item.label) : /*#__PURE__*/React.createElement("span", {
|
|
289
|
+
className: "lsg-breadcrumb__ancestor"
|
|
290
|
+
}, item.label)));
|
|
291
|
+
})));
|
|
292
|
+
};
|
|
293
|
+
|
|
195
294
|
var LsgLogo = function (_a) {
|
|
196
295
|
var src = _a.src,
|
|
197
296
|
_b = _a.alt,
|
|
@@ -273,30 +372,6 @@ var LsgNavigation = function (_a) {
|
|
|
273
372
|
}, renderItems(items));
|
|
274
373
|
};
|
|
275
374
|
|
|
276
|
-
var LSG_ICON_PATHS = {
|
|
277
|
-
bars: "M96 160C96 142.3 110.3 128 128 128L512 128C529.7 128 544 142.3 544 160C544 177.7 529.7 192 512 192L128 192C110.3 192 96 177.7 96 160zM96 320C96 302.3 110.3 288 128 288L512 288C529.7 288 544 302.3 544 320C544 337.7 529.7 352 512 352L128 352C110.3 352 96 337.7 96 320zM544 480C544 497.7 529.7 512 512 512L128 512C110.3 512 96 497.7 96 480C96 462.3 110.3 448 128 448L512 448C529.7 448 544 462.3 544 480z",
|
|
278
|
-
chevronLeft: "M169.4 297.4C156.9 309.9 156.9 330.2 169.4 342.7L361.4 534.7C373.9 547.2 394.2 547.2 406.7 534.7C419.2 522.2 419.2 501.9 406.7 489.4L237.3 320L406.6 150.6C419.1 138.1 419.1 117.8 406.6 105.3C394.1 92.8 373.8 92.8 361.3 105.3L169.3 297.3z",
|
|
279
|
-
chevronRight: "M471.1 297.4C483.6 309.9 483.6 330.2 471.1 342.7L279.1 534.7C266.6 547.2 246.3 547.2 233.8 534.7C221.3 522.2 221.3 501.9 233.8 489.4L403.2 320L233.9 150.6C221.4 138.1 221.4 117.8 233.9 105.3C246.4 92.8 266.7 92.8 279.2 105.3L471.2 297.3z",
|
|
280
|
-
close: "M504.6 148.5C515.9 134.9 514.1 114.7 500.5 103.4C486.9 92.1 466.7 93.9 455.4 107.5L320 270L184.6 107.5C173.3 93.9 153.1 92.1 139.5 103.4C125.9 114.7 124.1 134.9 135.4 148.5L278.3 320L135.4 491.5C124.1 505.1 125.9 525.3 139.5 536.6C153.1 547.9 173.3 546.1 184.6 532.5L320 370L455.4 532.5C466.7 546.1 486.9 547.9 500.5 536.6C514.1 525.3 515.9 505.1 504.6 491.5L361.7 320L504.6 148.5z",
|
|
281
|
-
globe: "M367.2 477C345.7 520.7 325.8 528 320 528C314.2 528 294.3 520.7 272.8 477C255.8 442.5 243.6 395.4 240.7 344L399.3 344C396.3 395.5 384.1 442.6 367.2 477zM399.3 296L240.7 296C243.7 244.5 255.9 197.4 272.8 163C294.3 119.3 314.2 112 320 112C325.8 112 345.7 119.3 367.2 163C384.2 197.5 396.4 244.6 399.3 296zM447.4 344L526.6 344C518 418.6 469.9 481.3 403.8 510.4C427.8 467.6 444.1 408 447.4 344zM526.6 296L447.4 296C444.1 232 427.8 172.4 403.8 129.6C469.9 158.8 518 221.4 526.6 296zM192.6 296L113.4 296C122 221.4 170.1 158.7 236.2 129.6C212.2 172.4 195.9 232 192.6 296zM113.4 344L192.6 344C195.9 408 212.2 467.6 236.2 510.4C170.1 481.2 122 418.6 113.4 344zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576z",
|
|
282
|
-
home: "M96 320L320 128L544 320H480V528H352V384H288V528H160V320H96z",
|
|
283
|
-
search: "M480 272C480 317.9 465.1 360.3 440 394.7L566.6 521.4C579.1 533.9 579.1 554.2 566.6 566.7C554.1 579.2 533.8 579.2 521.3 566.7L394.7 440C360.3 465.1 317.9 480 272 480C157.1 480 64 386.9 64 272C64 157.1 157.1 64 272 64C386.9 64 480 157.1 480 272zM272 416C351.5 416 416 351.5 416 272C416 192.5 351.5 128 272 128C192.5 128 128 192.5 128 272C128 351.5 192.5 416 272 416z"
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
var LsgIcon = function (_a) {
|
|
287
|
-
var name = _a.name,
|
|
288
|
-
className = _a.className;
|
|
289
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
290
|
-
className: className,
|
|
291
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
292
|
-
viewBox: "0 0 640 640",
|
|
293
|
-
"aria-hidden": "true",
|
|
294
|
-
focusable: "false"
|
|
295
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
296
|
-
d: LSG_ICON_PATHS[name]
|
|
297
|
-
}));
|
|
298
|
-
};
|
|
299
|
-
|
|
300
375
|
var ChevronIcon = function () {
|
|
301
376
|
return /*#__PURE__*/React.createElement("svg", {
|
|
302
377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -871,7 +946,14 @@ var LsgHeader = function (_a) {
|
|
|
871
946
|
})));
|
|
872
947
|
}))));
|
|
873
948
|
};
|
|
874
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
949
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LsgSearchOverlay, {
|
|
950
|
+
id: SEARCH_OVERLAY_ID,
|
|
951
|
+
isOpen: searchOpen,
|
|
952
|
+
onClose: function () {
|
|
953
|
+
return setSearchOpen(false);
|
|
954
|
+
},
|
|
955
|
+
placeholder: searchPlaceholder
|
|
956
|
+
}), /*#__PURE__*/React.createElement("header", {
|
|
875
957
|
ref: headerRef,
|
|
876
958
|
className: ["lsg-header", "lsg-header--".concat(variant), menuOpen ? "lsg-header--menu-open" : "", "lsg-header--mobile-level-".concat(mobileLevel)].filter(Boolean).join(" ")
|
|
877
959
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -917,14 +999,7 @@ var LsgHeader = function (_a) {
|
|
|
917
999
|
"data-lsg-menu-trigger": true
|
|
918
1000
|
}, /*#__PURE__*/React.createElement(LsgHeaderIcon, {
|
|
919
1001
|
name: mobileOpen ? "close" : "bars"
|
|
920
|
-
})))), variant === "mega" && menuOpen && (children || renderMegaPanel()), mobileOpen && renderMobileMenu())
|
|
921
|
-
id: SEARCH_OVERLAY_ID,
|
|
922
|
-
isOpen: searchOpen,
|
|
923
|
-
onClose: function () {
|
|
924
|
-
return setSearchOpen(false);
|
|
925
|
-
},
|
|
926
|
-
placeholder: searchPlaceholder
|
|
927
|
-
}));
|
|
1002
|
+
})))), variant === "mega" && menuOpen && (children || renderMegaPanel()), mobileOpen && renderMobileMenu()));
|
|
928
1003
|
};
|
|
929
1004
|
|
|
930
1005
|
var LsgQuickLinks = function (_a) {
|
|
@@ -3548,6 +3623,244 @@ var LsgHero = function (_a) {
|
|
|
3548
3623
|
}))));
|
|
3549
3624
|
};
|
|
3550
3625
|
|
|
3626
|
+
// Matches $lsg-tabs-accordion-breakpoint in LsgTabs.scss ($breakpoint-sm - 1px)
|
|
3627
|
+
// and MOBILE_MEDIA_QUERY in lsg-clientlib-runtime.ts.
|
|
3628
|
+
var MOBILE_MEDIA_QUERY = "(max-width: 767px)";
|
|
3629
|
+
// Sub-pixel layout rounding when comparing scroll offsets against extents
|
|
3630
|
+
var SCROLL_EPSILON = 1;
|
|
3631
|
+
var CHEVRON_SVG = /*#__PURE__*/React.createElement("svg", {
|
|
3632
|
+
className: "lsg-tabs__tab-icon-svg",
|
|
3633
|
+
width: "16",
|
|
3634
|
+
height: "16",
|
|
3635
|
+
viewBox: "0 0 16 16",
|
|
3636
|
+
fill: "none",
|
|
3637
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3638
|
+
"aria-hidden": "true",
|
|
3639
|
+
focusable: "false"
|
|
3640
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3641
|
+
d: "M3 6L8 11L13 6",
|
|
3642
|
+
stroke: "currentColor",
|
|
3643
|
+
strokeWidth: "1.5",
|
|
3644
|
+
strokeLinecap: "round",
|
|
3645
|
+
strokeLinejoin: "round"
|
|
3646
|
+
}));
|
|
3647
|
+
var LsgTabs = function (_a) {
|
|
3648
|
+
var _b, _c;
|
|
3649
|
+
var items = _a.items,
|
|
3650
|
+
activeId = _a.activeId,
|
|
3651
|
+
_d = _a.variant,
|
|
3652
|
+
variant = _d === void 0 ? "default" : _d,
|
|
3653
|
+
accessibilityLabel = _a.accessibilityLabel,
|
|
3654
|
+
_e = _a.className,
|
|
3655
|
+
className = _e === void 0 ? "" : _e;
|
|
3656
|
+
var _f = useState((_c = activeId !== null && activeId !== void 0 ? activeId : (_b = items[0]) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""),
|
|
3657
|
+
selectedId = _f[0],
|
|
3658
|
+
setSelectedId = _f[1];
|
|
3659
|
+
// Below the breakpoint the tabs render as a single-open accordion and the open
|
|
3660
|
+
// header can be collapsed. Tracked separately from selection so exactly one tab
|
|
3661
|
+
// stays selected at every width — resizing back to desktop just reveals it again.
|
|
3662
|
+
var _g = useState(false),
|
|
3663
|
+
collapsed = _g[0],
|
|
3664
|
+
setCollapsed = _g[1];
|
|
3665
|
+
var _h = useState(false),
|
|
3666
|
+
isMobile = _h[0],
|
|
3667
|
+
setIsMobile = _h[1];
|
|
3668
|
+
// Scroll-arrow state. The arrows themselves are ::before / ::after on the root
|
|
3669
|
+
// (see LsgTabs.scss) — these only say whether there is more to reveal.
|
|
3670
|
+
var _j = useState(false),
|
|
3671
|
+
scrollStart = _j[0],
|
|
3672
|
+
setScrollStart = _j[1];
|
|
3673
|
+
var _k = useState(false),
|
|
3674
|
+
scrollEnd = _k[0],
|
|
3675
|
+
setScrollEnd = _k[1];
|
|
3676
|
+
var tabRefs = useRef({});
|
|
3677
|
+
var stripRef = useRef(null);
|
|
3678
|
+
var isVertical = variant === "vertical";
|
|
3679
|
+
var selectedIndex = Math.max(0, items.findIndex(function (item) {
|
|
3680
|
+
return item.id === selectedId;
|
|
3681
|
+
}));
|
|
3682
|
+
useEffect(function () {
|
|
3683
|
+
var mql = window.matchMedia(MOBILE_MEDIA_QUERY);
|
|
3684
|
+
var sync = function () {
|
|
3685
|
+
return setIsMobile(mql.matches);
|
|
3686
|
+
};
|
|
3687
|
+
sync();
|
|
3688
|
+
mql.addEventListener("change", sync);
|
|
3689
|
+
return function () {
|
|
3690
|
+
return mql.removeEventListener("change", sync);
|
|
3691
|
+
};
|
|
3692
|
+
}, []);
|
|
3693
|
+
var updateArrows = function () {
|
|
3694
|
+
var strip = stripRef.current;
|
|
3695
|
+
// Below the breakpoint this is an accordion — nothing scrolls, so the arrows
|
|
3696
|
+
// must not be offered.
|
|
3697
|
+
if (!strip || isMobile) {
|
|
3698
|
+
setScrollStart(false);
|
|
3699
|
+
setScrollEnd(false);
|
|
3700
|
+
return;
|
|
3701
|
+
}
|
|
3702
|
+
var offset = isVertical ? strip.scrollTop : strip.scrollLeft;
|
|
3703
|
+
var visible = isVertical ? strip.clientHeight : strip.clientWidth;
|
|
3704
|
+
var total = isVertical ? strip.scrollHeight : strip.scrollWidth;
|
|
3705
|
+
setScrollStart(offset > SCROLL_EPSILON);
|
|
3706
|
+
setScrollEnd(offset + visible < total - SCROLL_EPSILON);
|
|
3707
|
+
};
|
|
3708
|
+
useEffect(function () {
|
|
3709
|
+
updateArrows();
|
|
3710
|
+
}, [isMobile, isVertical, items, selectedIndex]);
|
|
3711
|
+
useEffect(function () {
|
|
3712
|
+
var strip = stripRef.current;
|
|
3713
|
+
if (!strip || typeof ResizeObserver === "undefined") return;
|
|
3714
|
+
// The strip can start overflowing because its container changed, with no
|
|
3715
|
+
// viewport resize at all.
|
|
3716
|
+
var observer = new ResizeObserver(function () {
|
|
3717
|
+
return updateArrows();
|
|
3718
|
+
});
|
|
3719
|
+
observer.observe(strip);
|
|
3720
|
+
return function () {
|
|
3721
|
+
return observer.disconnect();
|
|
3722
|
+
};
|
|
3723
|
+
}, [isMobile, isVertical]);
|
|
3724
|
+
useEffect(function () {
|
|
3725
|
+
var _a;
|
|
3726
|
+
// A late web-font swap widens the labels, growing scrollWidth without changing
|
|
3727
|
+
// the strip's own box — so ResizeObserver may never fire. Re-measure once the
|
|
3728
|
+
// fonts have settled, otherwise the arrows can be stale on first paint.
|
|
3729
|
+
var cancelled = false;
|
|
3730
|
+
(_a = document.fonts) === null || _a === void 0 ? void 0 : _a.ready.then(function () {
|
|
3731
|
+
if (!cancelled) updateArrows();
|
|
3732
|
+
});
|
|
3733
|
+
return function () {
|
|
3734
|
+
cancelled = true;
|
|
3735
|
+
};
|
|
3736
|
+
}, [isMobile, isVertical]);
|
|
3737
|
+
var scrollStrip = function (direction) {
|
|
3738
|
+
var strip = stripRef.current;
|
|
3739
|
+
if (!strip) return;
|
|
3740
|
+
// A step just under one viewport keeps a sliver of context in view
|
|
3741
|
+
var visible = isVertical ? strip.clientHeight : strip.clientWidth;
|
|
3742
|
+
var step = Math.max(visible * 0.8, 1);
|
|
3743
|
+
if (isVertical) {
|
|
3744
|
+
strip.scrollTop += direction * step;
|
|
3745
|
+
} else {
|
|
3746
|
+
strip.scrollLeft += direction * step;
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3749
|
+
// The arrows are pseudo-elements painted above the strip, so a click on one
|
|
3750
|
+
// hit-tests to the root rather than to a tab or panel. Nothing else on the root
|
|
3751
|
+
// is clickable, which is what makes this unambiguous.
|
|
3752
|
+
var onRootClick = function (event) {
|
|
3753
|
+
if (event.target !== event.currentTarget) return;
|
|
3754
|
+
var strip = stripRef.current;
|
|
3755
|
+
if (!strip) return;
|
|
3756
|
+
var rect = strip.getBoundingClientRect();
|
|
3757
|
+
var beforeMidpoint = isVertical ? event.clientY < rect.top + rect.height / 2 : event.clientX < rect.left + rect.width / 2;
|
|
3758
|
+
scrollStrip(beforeMidpoint ? -1 : 1);
|
|
3759
|
+
};
|
|
3760
|
+
var select = function (index, moveFocus) {
|
|
3761
|
+
var item = items[index];
|
|
3762
|
+
if (!item) return;
|
|
3763
|
+
setSelectedId(item.id);
|
|
3764
|
+
setCollapsed(false);
|
|
3765
|
+
var tab = tabRefs.current[item.id];
|
|
3766
|
+
// Arrow-key navigation can land on a tab that is scrolled out of the strip
|
|
3767
|
+
tab === null || tab === void 0 ? void 0 : tab.scrollIntoView({
|
|
3768
|
+
block: "nearest",
|
|
3769
|
+
inline: "nearest"
|
|
3770
|
+
});
|
|
3771
|
+
if (moveFocus) tab === null || tab === void 0 ? void 0 : tab.focus();
|
|
3772
|
+
};
|
|
3773
|
+
var press = function (index) {
|
|
3774
|
+
if (isMobile && index === selectedIndex) {
|
|
3775
|
+
setCollapsed(function (prev) {
|
|
3776
|
+
return !prev;
|
|
3777
|
+
});
|
|
3778
|
+
return;
|
|
3779
|
+
}
|
|
3780
|
+
select(index, false);
|
|
3781
|
+
};
|
|
3782
|
+
// Roving tabindex keyboard model for role="tab" — see bootLsgTabs for the AEM twin.
|
|
3783
|
+
var onKeyDown = function (event, index) {
|
|
3784
|
+
var last = items.length - 1;
|
|
3785
|
+
switch (event.key) {
|
|
3786
|
+
case "ArrowRight":
|
|
3787
|
+
case "ArrowDown":
|
|
3788
|
+
event.preventDefault();
|
|
3789
|
+
select(selectedIndex === last ? 0 : selectedIndex + 1, true);
|
|
3790
|
+
break;
|
|
3791
|
+
case "ArrowLeft":
|
|
3792
|
+
case "ArrowUp":
|
|
3793
|
+
event.preventDefault();
|
|
3794
|
+
select(selectedIndex === 0 ? last : selectedIndex - 1, true);
|
|
3795
|
+
break;
|
|
3796
|
+
case "Home":
|
|
3797
|
+
event.preventDefault();
|
|
3798
|
+
select(0, true);
|
|
3799
|
+
break;
|
|
3800
|
+
case "End":
|
|
3801
|
+
event.preventDefault();
|
|
3802
|
+
select(last, true);
|
|
3803
|
+
break;
|
|
3804
|
+
case "Enter":
|
|
3805
|
+
case " ":
|
|
3806
|
+
event.preventDefault();
|
|
3807
|
+
press(index);
|
|
3808
|
+
break;
|
|
3809
|
+
}
|
|
3810
|
+
};
|
|
3811
|
+
var rootClass = ["lsg-tabs", isVertical ? "lsg-tabs--vertical" : "", scrollStart ? "lsg-tabs--scroll-start" : "", scrollEnd ? "lsg-tabs--scroll-end" : "", className].filter(Boolean).join(" ");
|
|
3812
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3813
|
+
className: rootClass,
|
|
3814
|
+
onClick: onRootClick
|
|
3815
|
+
}, /*#__PURE__*/React.createElement("ol", {
|
|
3816
|
+
ref: stripRef,
|
|
3817
|
+
className: "lsg-tabs__tablist",
|
|
3818
|
+
role: "tablist",
|
|
3819
|
+
"aria-label": accessibilityLabel,
|
|
3820
|
+
"aria-multiselectable": "false",
|
|
3821
|
+
onScroll: updateArrows
|
|
3822
|
+
}, items.map(function (item, index) {
|
|
3823
|
+
var isActive = index === selectedIndex;
|
|
3824
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
3825
|
+
key: item.id,
|
|
3826
|
+
ref: function (node) {
|
|
3827
|
+
tabRefs.current[item.id] = node;
|
|
3828
|
+
},
|
|
3829
|
+
role: "tab",
|
|
3830
|
+
id: "lsg-tab-".concat(item.id),
|
|
3831
|
+
className: "lsg-tabs__tab".concat(isActive ? " lsg-tabs__tab--active" : ""),
|
|
3832
|
+
"aria-controls": "lsg-tabpanel-".concat(item.id),
|
|
3833
|
+
"aria-selected": isActive
|
|
3834
|
+
// Desktop is a tab strip — aria-selected carries the state there, and
|
|
3835
|
+
// the collapsed class has no styling, so aria-expanded would mislead.
|
|
3836
|
+
,
|
|
3837
|
+
"aria-expanded": isMobile ? isActive && !collapsed : undefined,
|
|
3838
|
+
tabIndex: isActive ? 0 : -1,
|
|
3839
|
+
onClick: function () {
|
|
3840
|
+
return press(index);
|
|
3841
|
+
},
|
|
3842
|
+
onKeyDown: function (event) {
|
|
3843
|
+
return onKeyDown(event, index);
|
|
3844
|
+
}
|
|
3845
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
3846
|
+
className: "lsg-tabs__tab-label"
|
|
3847
|
+
}, item.title), /*#__PURE__*/React.createElement("span", {
|
|
3848
|
+
className: "lsg-tabs__tab-icon",
|
|
3849
|
+
"aria-hidden": "true"
|
|
3850
|
+
}, CHEVRON_SVG));
|
|
3851
|
+
})), items.map(function (item, index) {
|
|
3852
|
+
var isActive = index === selectedIndex;
|
|
3853
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3854
|
+
key: item.id,
|
|
3855
|
+
id: "lsg-tabpanel-".concat(item.id),
|
|
3856
|
+
role: "tabpanel",
|
|
3857
|
+
"aria-labelledby": "lsg-tab-".concat(item.id),
|
|
3858
|
+
tabIndex: 0,
|
|
3859
|
+
className: ["lsg-tabs__panel", isActive ? "lsg-tabs__panel--active" : "", isActive && collapsed ? "lsg-tabs__panel--collapsed" : ""].filter(Boolean).join(" ")
|
|
3860
|
+
}, item.content);
|
|
3861
|
+
}));
|
|
3862
|
+
};
|
|
3863
|
+
|
|
3551
3864
|
var LsgFormFieldText = function (_a) {
|
|
3552
3865
|
var _b = _a.id,
|
|
3553
3866
|
id = _b === void 0 ? "field-text" : _b,
|
|
@@ -4281,6 +4594,7 @@ var BASE_COMPONENTS = {
|
|
|
4281
4594
|
LsgBanner: LsgBanner,
|
|
4282
4595
|
LsgCard: LsgCard,
|
|
4283
4596
|
LsgCards: LsgCards,
|
|
4597
|
+
LsgBreadcrumb: LsgBreadcrumb,
|
|
4284
4598
|
LsgLogo: LsgLogo,
|
|
4285
4599
|
LsgNavigation: LsgNavigation,
|
|
4286
4600
|
LsgLanguageSwitcher: LsgLanguageSwitcher,
|
|
@@ -4291,6 +4605,7 @@ var BASE_COMPONENTS = {
|
|
|
4291
4605
|
LsgSocialMediaIcons: LsgSocialMediaIcons,
|
|
4292
4606
|
LsgFooter: LsgFooter,
|
|
4293
4607
|
LsgHero: LsgHero,
|
|
4608
|
+
LsgTabs: LsgTabs,
|
|
4294
4609
|
LsgFormContainer: LsgFormContainer,
|
|
4295
4610
|
LsgFormFieldText: LsgFormFieldText,
|
|
4296
4611
|
LsgFormFieldEmail: LsgFormFieldEmail,
|
|
@@ -4316,6 +4631,7 @@ function createThemeComponents(themeName) {
|
|
|
4316
4631
|
LsgBanner: createThemeComponent(themeName, "banner", BASE_COMPONENTS.LsgBanner),
|
|
4317
4632
|
LsgCard: createThemeComponent(themeName, "card", BASE_COMPONENTS.LsgCard),
|
|
4318
4633
|
LsgCards: createThemeComponent(themeName, "cards", BASE_COMPONENTS.LsgCards),
|
|
4634
|
+
LsgBreadcrumb: createThemeComponent(themeName, "breadcrumb", BASE_COMPONENTS.LsgBreadcrumb),
|
|
4319
4635
|
LsgLogo: createThemeComponent(themeName, "logo", BASE_COMPONENTS.LsgLogo),
|
|
4320
4636
|
LsgNavigation: createThemeComponent(themeName, "navigation", BASE_COMPONENTS.LsgNavigation),
|
|
4321
4637
|
LsgLanguageSwitcher: createThemeComponent(themeName, "language-switcher", BASE_COMPONENTS.LsgLanguageSwitcher),
|
|
@@ -4334,7 +4650,8 @@ function createThemeComponents(themeName) {
|
|
|
4334
4650
|
LsgFormFieldCountry: createThemeComponent(themeName, "form-field-country", BASE_COMPONENTS.LsgFormFieldCountry),
|
|
4335
4651
|
LsgFormFieldTextarea: createThemeComponent(themeName, "form-field-textarea", BASE_COMPONENTS.LsgFormFieldTextarea),
|
|
4336
4652
|
LsgFormFieldConsent: createThemeComponent(themeName, "form-field-consent", BASE_COMPONENTS.LsgFormFieldConsent),
|
|
4337
|
-
LsgFormStep: createThemeComponent(themeName, "form-step", BASE_COMPONENTS.LsgFormStep)
|
|
4653
|
+
LsgFormStep: createThemeComponent(themeName, "form-step", BASE_COMPONENTS.LsgFormStep),
|
|
4654
|
+
LsgTabs: createThemeComponent(themeName, "tabs", BASE_COMPONENTS.LsgTabs)
|
|
4338
4655
|
};
|
|
4339
4656
|
}
|
|
4340
4657
|
|
|
@@ -4343,6 +4660,7 @@ var Theme1LsgButton = theme1Components.LsgButton,
|
|
|
4343
4660
|
Theme1LsgBanner = theme1Components.LsgBanner,
|
|
4344
4661
|
Theme1LsgCard = theme1Components.LsgCard,
|
|
4345
4662
|
Theme1LsgCards = theme1Components.LsgCards,
|
|
4663
|
+
Theme1LsgBreadcrumb = theme1Components.LsgBreadcrumb,
|
|
4346
4664
|
Theme1LsgLogo = theme1Components.LsgLogo,
|
|
4347
4665
|
Theme1LsgNavigation = theme1Components.LsgNavigation,
|
|
4348
4666
|
Theme1LsgLanguageSwitcher = theme1Components.LsgLanguageSwitcher,
|
|
@@ -4353,6 +4671,7 @@ var Theme1LsgButton = theme1Components.LsgButton,
|
|
|
4353
4671
|
Theme1LsgSocialMediaIcons = theme1Components.LsgSocialMediaIcons,
|
|
4354
4672
|
Theme1LsgFooter = theme1Components.LsgFooter,
|
|
4355
4673
|
Theme1LsgHero = theme1Components.LsgHero;
|
|
4674
|
+
theme1Components.LsgTabs;
|
|
4356
4675
|
// Form components
|
|
4357
4676
|
theme1Components.LsgFormContainer;
|
|
4358
4677
|
theme1Components.LsgFormFieldText;
|
|
@@ -4369,6 +4688,7 @@ var Theme2LsgButton = theme2Components.LsgButton,
|
|
|
4369
4688
|
Theme2LsgBanner = theme2Components.LsgBanner,
|
|
4370
4689
|
Theme2LsgCard = theme2Components.LsgCard,
|
|
4371
4690
|
Theme2LsgCards = theme2Components.LsgCards,
|
|
4691
|
+
Theme2LsgBreadcrumb = theme2Components.LsgBreadcrumb,
|
|
4372
4692
|
Theme2LsgLogo = theme2Components.LsgLogo,
|
|
4373
4693
|
Theme2LsgNavigation = theme2Components.LsgNavigation,
|
|
4374
4694
|
Theme2LsgLanguageSwitcher = theme2Components.LsgLanguageSwitcher,
|
|
@@ -4395,6 +4715,7 @@ var Theme3LsgButton = theme3Components.LsgButton,
|
|
|
4395
4715
|
Theme3LsgBanner = theme3Components.LsgBanner,
|
|
4396
4716
|
Theme3LsgCard = theme3Components.LsgCard,
|
|
4397
4717
|
Theme3LsgCards = theme3Components.LsgCards,
|
|
4718
|
+
Theme3LsgBreadcrumb = theme3Components.LsgBreadcrumb,
|
|
4398
4719
|
Theme3LsgLogo = theme3Components.LsgLogo,
|
|
4399
4720
|
Theme3LsgNavigation = theme3Components.LsgNavigation,
|
|
4400
4721
|
Theme3LsgLanguageSwitcher = theme3Components.LsgLanguageSwitcher,
|
|
@@ -4416,5 +4737,5 @@ var Theme3LsgButton = theme3Components.LsgButton,
|
|
|
4416
4737
|
theme3Components.LsgFormFieldConsent;
|
|
4417
4738
|
theme3Components.LsgFormStep;
|
|
4418
4739
|
|
|
4419
|
-
export { LsgBanner, LsgButton, LsgCard, LsgCards, LsgFooter, LsgHeader, LsgHero, LsgHeroCard, LsgHeroController, LsgLanguageSwitcher, LsgLogo, LsgNavigation, LsgQuickLinks, LsgSearchOverlay, LsgSearchTrigger, LsgSocialMediaIcons, Theme1LsgBanner, Theme1LsgButton, Theme1LsgCard, Theme1LsgCards, Theme1LsgFooter, Theme1LsgHeader, Theme1LsgHero, Theme1LsgLanguageSwitcher, Theme1LsgLogo, Theme1LsgNavigation, Theme1LsgQuickLinks, Theme1LsgSearchOverlay, Theme1LsgSearchTrigger, Theme1LsgSocialMediaIcons, Theme2LsgBanner, Theme2LsgButton, Theme2LsgCard, Theme2LsgCards, Theme2LsgFooter, Theme2LsgHeader, Theme2LsgHero, Theme2LsgLanguageSwitcher, Theme2LsgLogo, Theme2LsgNavigation, Theme2LsgQuickLinks, Theme2LsgSearchOverlay, Theme2LsgSearchTrigger, Theme2LsgSocialMediaIcons, Theme3LsgBanner, Theme3LsgButton, Theme3LsgCard, Theme3LsgCards, Theme3LsgFooter, Theme3LsgHeader, Theme3LsgHero, Theme3LsgLanguageSwitcher, Theme3LsgLogo, Theme3LsgNavigation, Theme3LsgQuickLinks, Theme3LsgSearchOverlay, Theme3LsgSearchTrigger, Theme3LsgSocialMediaIcons, getTelValue, initTelPickers, theme1Components, theme2Components, theme3Components };
|
|
4740
|
+
export { LsgBanner, LsgBreadcrumb, LsgButton, LsgCard, LsgCards, LsgFooter, LsgHeader, LsgHero, LsgHeroCard, LsgHeroController, LsgLanguageSwitcher, LsgLogo, LsgNavigation, LsgQuickLinks, LsgSearchOverlay, LsgSearchTrigger, LsgSocialMediaIcons, Theme1LsgBanner, Theme1LsgBreadcrumb, Theme1LsgButton, Theme1LsgCard, Theme1LsgCards, Theme1LsgFooter, Theme1LsgHeader, Theme1LsgHero, Theme1LsgLanguageSwitcher, Theme1LsgLogo, Theme1LsgNavigation, Theme1LsgQuickLinks, Theme1LsgSearchOverlay, Theme1LsgSearchTrigger, Theme1LsgSocialMediaIcons, Theme2LsgBanner, Theme2LsgBreadcrumb, Theme2LsgButton, Theme2LsgCard, Theme2LsgCards, Theme2LsgFooter, Theme2LsgHeader, Theme2LsgHero, Theme2LsgLanguageSwitcher, Theme2LsgLogo, Theme2LsgNavigation, Theme2LsgQuickLinks, Theme2LsgSearchOverlay, Theme2LsgSearchTrigger, Theme2LsgSocialMediaIcons, Theme3LsgBanner, Theme3LsgBreadcrumb, Theme3LsgButton, Theme3LsgCard, Theme3LsgCards, Theme3LsgFooter, Theme3LsgHeader, Theme3LsgHero, Theme3LsgLanguageSwitcher, Theme3LsgLogo, Theme3LsgNavigation, Theme3LsgQuickLinks, Theme3LsgSearchOverlay, Theme3LsgSearchTrigger, Theme3LsgSocialMediaIcons, getTelValue, initTelPickers, theme1Components, theme2Components, theme3Components };
|
|
4420
4741
|
//# sourceMappingURL=index.esm.js.map
|