@porsche-design-system/components-react 3.15.0-rc.5 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3255,17 +3255,6 @@ const getOptionAriaAttributes = (isSelected, isDisabled, isHidden, hasValue) =>
3255
3255
  'aria-label': hasValue ? null : 'Empty value',
3256
3256
  });
3257
3257
 
3258
- const attributeMutationMap = new Map();
3259
- hasWindow &&
3260
- new MutationObserver((mutations) => {
3261
- mutations
3262
- // reduce array to only entries that have really a changed value
3263
- .filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
3264
- // remove duplicates so we execute callback only once per node
3265
- .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3266
- .forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
3267
- });
3268
-
3269
3258
  const borderWidthBase = '2px';
3270
3259
 
3271
3260
  const fontFamily = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
@@ -3326,6 +3315,46 @@ const textSmallStyle = {
3326
3315
  ...fontHyphenationStyle,
3327
3316
  };
3328
3317
 
3318
+ // NOTE: handpicked selection of plugins from jss-preset-default
3319
+ createJss({
3320
+ plugins: [
3321
+ jssGlobal(),
3322
+ jssNested(),
3323
+ camelCase(),
3324
+ jssPluginSortMediaQueries({ combineMediaQueries: true }),
3325
+ ],
3326
+ });
3327
+ const supportsConstructableStylesheets = () => {
3328
+ try {
3329
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3330
+ }
3331
+ catch {
3332
+ return false;
3333
+ }
3334
+ };
3335
+ // determine it once
3336
+ supportsConstructableStylesheets();
3337
+ // TODO: Use function from ./jss (Causes bundling issues)
3338
+ (() => {
3339
+ try {
3340
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3341
+ }
3342
+ catch {
3343
+ return false;
3344
+ }
3345
+ })(); // determine it once
3346
+
3347
+ const attributeMutationMap = new Map();
3348
+ hasWindow &&
3349
+ new MutationObserver((mutations) => {
3350
+ mutations
3351
+ // reduce array to only entries that have really a changed value
3352
+ .filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
3353
+ // remove duplicates so we execute callback only once per node
3354
+ .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3355
+ .forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
3356
+ });
3357
+
3329
3358
  const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
3330
3359
  hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
3331
3360
 
@@ -3554,26 +3583,6 @@ const ICONS_MANIFEST = { "360": "360.min.d3b2874981886b5ebece31655f92a3ad.svg",
3554
3583
  const MARQUES_MANIFEST = { "porscheMarqueTrademark": { "medium": { "1x": { "png": "porsche-marque-trademark.medium.min.da075315857e239ff46bf4c150648ff0@1x.png", "webp": "porsche-marque-trademark.medium.min.5c6af9aa7946fea34f60c8f8c95d0188@1x.webp" }, "2x": { "png": "porsche-marque-trademark.medium.min.aa801f42028b1c385a5e26ae115da598@2x.png", "webp": "porsche-marque-trademark.medium.min.fff6e9b91481cc5b1fc6c9b62987ccaf@2x.webp" }, "3x": { "png": "porsche-marque-trademark.medium.min.824818d15eaf445f50e0a2391613f214@3x.png", "webp": "porsche-marque-trademark.medium.min.f67092ff6b5f4ecb4add73d6ae153db0@3x.webp" } }, "small": { "1x": { "png": "porsche-marque-trademark.small.min.020244b41a29323e2a7932a264514cdf@1x.png", "webp": "porsche-marque-trademark.small.min.783639706bead66b2d56e3b8b64bd61f@1x.webp" }, "2x": { "png": "porsche-marque-trademark.small.min.92184fae44511ceda8320443c17110b1@2x.png", "webp": "porsche-marque-trademark.small.min.760a57efa93d4e7e16e26128ec7ead46@2x.webp" }, "3x": { "png": "porsche-marque-trademark.small.min.fd545cea4298f5d797246d5805711646@3x.png", "webp": "porsche-marque-trademark.small.min.1726036a7829347e1e24d1eb54fc0d64@3x.webp" } } }, "porscheMarque": { "medium": { "1x": { "png": "porsche-marque.medium.min.a98627440b05154565f9f9dfc1ad6187@1x.png", "webp": "porsche-marque.medium.min.fa908e4dfdc5536b0e933e1670d20e1f@1x.webp" }, "2x": { "png": "porsche-marque.medium.min.089d6dd560fff7a2bf613ae6d528990e@2x.png", "webp": "porsche-marque.medium.min.7f0893dc57f2607a2cb0b817d96cb985@2x.webp" }, "3x": { "png": "porsche-marque.medium.min.2cb874345ef290831c929f6caabfeef8@3x.png", "webp": "porsche-marque.medium.min.3534cf066b4e2e737dca62de495f9616@3x.webp" } }, "small": { "1x": { "png": "porsche-marque.small.min.ac2042736af5512cf547c89fa7924c4f@1x.png", "webp": "porsche-marque.small.min.005debed5bf72cf0a9a791b1521f5e1d@1x.webp" }, "2x": { "png": "porsche-marque.small.min.22f1e9dc90399d9a5287eda689b60dba@2x.png", "webp": "porsche-marque.small.min.df4317325d04ffef28c7839aa6d499a0@2x.webp" }, "3x": { "png": "porsche-marque.small.min.49209245f04eadef8817b9bbae80d3e1@3x.png", "webp": "porsche-marque.small.min.cfd6149aaa3bc5b3b522538e5f650890@3x.webp" } } }, "porscheMarque75": { "medium": { "1x": { "png": "porsche-marque75.medium.min.0a02e2256062de963f2fef2c02d20200@1x.png", "webp": "porsche-marque75.medium.min.99b2d657558f0531d639782974e8fd06@1x.webp" }, "2x": { "png": "porsche-marque75.medium.min.1d41ecfb8f5277d3f4bd65d25d22eea3@2x.png", "webp": "porsche-marque75.medium.min.e32580cd1ac179e354ed8fcb31694168@2x.webp" }, "3x": { "png": "porsche-marque75.medium.min.373bcb5f89d31c8b6084e66e902b9f4c@3x.png", "webp": "porsche-marque75.medium.min.4a003d1e5e81db062bf92d52ba797087@3x.webp" } }, "small": { "1x": { "png": "porsche-marque75.small.min.f5b37fe12cd4487432ff77fdd8469f7d@1x.png", "webp": "porsche-marque75.small.min.146b06cffe2b11c07f3113a51f337b98@1x.webp" }, "2x": { "png": "porsche-marque75.small.min.20d86908f2190640a6f24fce1ee49035@2x.png", "webp": "porsche-marque75.small.min.025770f8db54857874c130999b370ed8@2x.webp" }, "3x": { "png": "porsche-marque75.small.min.e89b13e14a088a273107bf1057f7f67d@3x.png", "webp": "porsche-marque75.small.min.a725d2ec7bd07be17afd8feb2589b156@3x.webp" } } } };
3555
3584
 
3556
3585
  const MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.min.493a9e3509d6e263fa2207150082def5.svg", "width": 79, "height": 26 }, "911": { "src": "911.min.b68f913216168583298ccf83f1a6b8d5.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.min.c321738789b37fda4bba3f7c587542aa.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.min.25562011631a831516f91ec31d144104.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.min.cc8919694c002873e1bb6a3c1dae5d41.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.min.a1844f4c8d23b75e371745e9b8eb49b9.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.min.6dae8095186567168f85c145845f090c.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.min.df444c6f4cc1f627ceaf1b02584d6bea.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.min.73f1e10731caffe93c07d96fa08546c1.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.min.6a4084a8704a6c47a099b2de56b22aef.svg", "width": 143, "height": 25 } };
3557
-
3558
- // NOTE: handpicked selection of plugins from jss-preset-default
3559
- createJss({
3560
- plugins: [
3561
- jssGlobal(),
3562
- jssNested(),
3563
- camelCase(),
3564
- jssPluginSortMediaQueries({ combineMediaQueries: true }),
3565
- ],
3566
- });
3567
- const supportsConstructableStylesheets = () => {
3568
- try {
3569
- return typeof new CSSStyleSheet().replaceSync === 'function';
3570
- }
3571
- catch {
3572
- return false;
3573
- }
3574
- };
3575
- // determine it once
3576
- supportsConstructableStylesheets();
3577
3586
  const isScrollable = (isPrevHidden, isNextHidden) => {
3578
3587
  return !(isPrevHidden && isNextHidden);
3579
3588
  };
@@ -112,8 +112,9 @@ class DSRCarousel extends react.Component {
112
112
  ? Object.fromEntries(Object.entries(this.props.disablePagination).map(([key, value]) => [key, !value]))
113
113
  : !this.props.disablePagination
114
114
  : this.props.pagination, utilsEntry.isInfinitePagination(this.props.amountOfPages), (alignHeaderDeprecationMap[this.props.alignHeader] || this.props.alignHeader), this.props.theme)));
115
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [hasHeadingPropOrSlot && (this.props.heading ? jsxRuntime.jsx("h2", { id: headingId, children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" })), hasDescriptionPropOrSlot && (this.props.description ? jsxRuntime.jsx("p", { children: this.props.description }) : jsxRuntime.jsx("slot", { name: "description" })), hasControlsSlot && jsxRuntime.jsx("slot", { name: "controls" }), jsxRuntime.jsxs("div", { className: "nav", children: [this.props.skipLinkTarget && (jsxRuntime.jsx(linkPure_wrapper.PLinkPure, { href: this.props.skipLinkTarget, theme: this.props.theme, icon: "arrow-last", className: "btn skip-link", alignLabel: "start", hideLabel: true, children: "Skip carousel entries" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" }))] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", ...utilsEntry.parseAndGetAriaAttributes({
116
- 'aria-label': this.props.heading,
115
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [hasHeadingPropOrSlot &&
116
+ (this.props.heading ? (jsxRuntime.jsx("h2", { className: "heading", id: headingId, children: this.props.heading })) : (jsxRuntime.jsx("div", { className: "heading", id: headingId, children: jsxRuntime.jsx("slot", { name: "heading" }) }))), hasDescriptionPropOrSlot && (this.props.description ? jsxRuntime.jsx("p", { children: this.props.description }) : jsxRuntime.jsx("slot", { name: "description" })), hasControlsSlot && jsxRuntime.jsx("slot", { name: "controls" }), jsxRuntime.jsxs("div", { className: "nav", children: [this.props.skipLinkTarget && (jsxRuntime.jsx(linkPure_wrapper.PLinkPure, { href: this.props.skipLinkTarget, theme: this.props.theme, icon: "arrow-last", className: "btn skip-link", alignLabel: "start", hideLabel: true, children: "Skip carousel entries" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" }))] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", ...utilsEntry.parseAndGetAriaAttributes({
117
+ 'aria-labelledby': hasHeadingPropOrSlot && !this.props.aria ? headingId : undefined,
117
118
  ...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
118
119
  }), children: jsxRuntime.jsx("div", { className: "splide__track", children: jsxRuntime.jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsxRuntime.jsx("div", { className: "splide__slide", children: jsxRuntime.jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), (this.props.disablePagination ? this.props.disablePagination !== true : this.props.pagination) && (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx("div", { className: "pagination-container", "aria-hidden": "true", children: jsxRuntime.jsx("div", { className: "pagination" }) }))] })] }), this.props.children] }));
119
120
  }
@@ -3159,17 +3159,6 @@ const hasWindow = typeof window !== 'undefined';
3159
3159
 
3160
3160
  const isHighContrastMode = hasWindow && window.matchMedia?.('(forced-colors: active)').matches;
3161
3161
 
3162
- const attributeMutationMap = new Map();
3163
- hasWindow &&
3164
- new MutationObserver((mutations) => {
3165
- mutations
3166
- // reduce array to only entries that have really a changed value
3167
- .filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
3168
- // remove duplicates so we execute callback only once per node
3169
- .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3170
- .forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
3171
- });
3172
-
3173
3162
  const parseJSON = (prop) => {
3174
3163
  if (typeof prop === 'string') {
3175
3164
  try {
@@ -3475,217 +3464,6 @@ const textLargeStyle = {
3475
3464
  ...fontHyphenationStyle,
3476
3465
  };
3477
3466
 
3478
- const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
3479
- hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
3480
-
3481
- Object.entries(breakpoint).reduce((result, [key, val]) => ({ ...result, [`${val}px`]: key }), {});
3482
-
3483
- const hasVisibleIcon = (iconName, iconSource) => {
3484
- return iconName !== 'none' || !!iconSource;
3485
- };
3486
-
3487
- /**
3488
- * Map of observed nodes and their corresponding callback functions.
3489
- */
3490
- const observedNodesMap = new Map();
3491
- /**
3492
- * Mutation observer for observing changes in the children of observed nodes.
3493
- */
3494
- hasWindow &&
3495
- new MutationObserver((mutations) => {
3496
- // there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
3497
- if (observedNodesMap.size) {
3498
- const observedNodes = Array.from(observedNodesMap.keys());
3499
- mutations
3500
- // remove duplicates so we execute callback only once per node
3501
- .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3502
- // find all observing parent nodes of mutated node and invoke their callbacks
3503
- .forEach((mutation) => {
3504
- observedNodes
3505
- .filter((node) => node.contains(mutation.target))
3506
- .forEach((node) => observedNodesMap.get(node)?.());
3507
- });
3508
- }
3509
- });
3510
-
3511
- /* eslint-disable no-undefined,no-param-reassign,no-shadow */
3512
-
3513
- /**
3514
- * Throttle execution of a function. Especially useful for rate limiting
3515
- * execution of handlers on events like resize and scroll.
3516
- *
3517
- * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
3518
- * are most useful.
3519
- * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
3520
- * as-is, to `callback` when the throttled-function is executed.
3521
- * @param {object} [options] - An object to configure options.
3522
- * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
3523
- * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
3524
- * one final time after the last throttled-function call. (After the throttled-function has not been called for
3525
- * `delay` milliseconds, the internal counter is reset).
3526
- * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
3527
- * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
3528
- * callback will never executed if both noLeading = true and noTrailing = true.
3529
- * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
3530
- * false (at end), schedule `callback` to execute after `delay` ms.
3531
- *
3532
- * @returns {Function} A new, throttled, function.
3533
- */
3534
- function throttle (delay, callback, options) {
3535
- var _ref = options || {},
3536
- _ref$noTrailing = _ref.noTrailing,
3537
- noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
3538
- _ref$noLeading = _ref.noLeading,
3539
- noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
3540
- _ref$debounceMode = _ref.debounceMode,
3541
- debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
3542
- /*
3543
- * After wrapper has stopped being called, this timeout ensures that
3544
- * `callback` is executed at the proper times in `throttle` and `end`
3545
- * debounce modes.
3546
- */
3547
-
3548
-
3549
- var timeoutID;
3550
- var cancelled = false; // Keep track of the last time `callback` was executed.
3551
-
3552
- var lastExec = 0; // Function to clear existing timeout
3553
-
3554
- function clearExistingTimeout() {
3555
- if (timeoutID) {
3556
- clearTimeout(timeoutID);
3557
- }
3558
- } // Function to cancel next exec
3559
-
3560
-
3561
- function cancel(options) {
3562
- var _ref2 = options || {},
3563
- _ref2$upcomingOnly = _ref2.upcomingOnly,
3564
- upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
3565
-
3566
- clearExistingTimeout();
3567
- cancelled = !upcomingOnly;
3568
- }
3569
- /*
3570
- * The `wrapper` function encapsulates all of the throttling / debouncing
3571
- * functionality and when executed will limit the rate at which `callback`
3572
- * is executed.
3573
- */
3574
-
3575
-
3576
- function wrapper() {
3577
- for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
3578
- arguments_[_key] = arguments[_key];
3579
- }
3580
-
3581
- var self = this;
3582
- var elapsed = Date.now() - lastExec;
3583
-
3584
- if (cancelled) {
3585
- return;
3586
- } // Execute `callback` and update the `lastExec` timestamp.
3587
-
3588
-
3589
- function exec() {
3590
- lastExec = Date.now();
3591
- callback.apply(self, arguments_);
3592
- }
3593
- /*
3594
- * If `debounceMode` is true (at begin) this is used to clear the flag
3595
- * to allow future `callback` executions.
3596
- */
3597
-
3598
-
3599
- function clear() {
3600
- timeoutID = undefined;
3601
- }
3602
-
3603
- if (!noLeading && debounceMode && !timeoutID) {
3604
- /*
3605
- * Since `wrapper` is being called for the first time and
3606
- * `debounceMode` is true (at begin), execute `callback`
3607
- * and noLeading != true.
3608
- */
3609
- exec();
3610
- }
3611
-
3612
- clearExistingTimeout();
3613
-
3614
- if (debounceMode === undefined && elapsed > delay) {
3615
- if (noLeading) {
3616
- /*
3617
- * In throttle mode with noLeading, if `delay` time has
3618
- * been exceeded, update `lastExec` and schedule `callback`
3619
- * to execute after `delay` ms.
3620
- */
3621
- lastExec = Date.now();
3622
-
3623
- if (!noTrailing) {
3624
- timeoutID = setTimeout(debounceMode ? clear : exec, delay);
3625
- }
3626
- } else {
3627
- /*
3628
- * In throttle mode without noLeading, if `delay` time has been exceeded, execute
3629
- * `callback`.
3630
- */
3631
- exec();
3632
- }
3633
- } else if (noTrailing !== true) {
3634
- /*
3635
- * In trailing throttle mode, since `delay` time has not been
3636
- * exceeded, schedule `callback` to execute `delay` ms after most
3637
- * recent execution.
3638
- *
3639
- * If `debounceMode` is true (at begin), schedule `clear` to execute
3640
- * after `delay` ms.
3641
- *
3642
- * If `debounceMode` is false (at end), schedule `callback` to
3643
- * execute after `delay` ms.
3644
- */
3645
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
3646
- }
3647
- }
3648
-
3649
- wrapper.cancel = cancel; // Return the wrapper function.
3650
-
3651
- return wrapper;
3652
- }
3653
-
3654
- /* eslint-disable no-undefined */
3655
- /**
3656
- * Debounce execution of a function. Debouncing, unlike throttling,
3657
- * guarantees that a function is only executed a single time, either at the
3658
- * very beginning of a series of calls, or at the very end.
3659
- *
3660
- * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
3661
- * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
3662
- * to `callback` when the debounced-function is executed.
3663
- * @param {object} [options] - An object to configure options.
3664
- * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
3665
- * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
3666
- * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
3667
- *
3668
- * @returns {Function} A new, debounced function.
3669
- */
3670
-
3671
- function debounce (delay, callback, options) {
3672
- var _ref = options || {},
3673
- _ref$atBegin = _ref.atBegin,
3674
- atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
3675
-
3676
- return throttle(delay, callback, {
3677
- debounceMode: atBegin !== false
3678
- });
3679
- }
3680
-
3681
- debounce(800, (el, ariaElement) => {
3682
- ariaElement.innerText = `You have ${el.maxLength - el.value.length} out of ${el.maxLength} characters left`;
3683
- });
3684
-
3685
- const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
3686
-
3687
- const MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.min.493a9e3509d6e263fa2207150082def5.svg", "width": 79, "height": 26 }, "911": { "src": "911.min.b68f913216168583298ccf83f1a6b8d5.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.min.c321738789b37fda4bba3f7c587542aa.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.min.25562011631a831516f91ec31d144104.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.min.cc8919694c002873e1bb6a3c1dae5d41.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.min.a1844f4c8d23b75e371745e9b8eb49b9.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.min.6dae8095186567168f85c145845f090c.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.min.df444c6f4cc1f627ceaf1b02584d6bea.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.min.73f1e10731caffe93c07d96fa08546c1.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.min.6a4084a8704a6c47a099b2de56b22aef.svg", "width": 143, "height": 25 } };
3688
-
3689
3467
  /* Auto Generated Start */
3690
3468
  const themeLight = {
3691
3469
  primaryColor: '#010205',
@@ -4016,6 +3794,238 @@ const mergeDeep = (...objects) => {
4016
3794
  }, {});
4017
3795
  };
4018
3796
 
3797
+ // TODO: Use function from ./jss (Causes bundling issues)
3798
+ (() => {
3799
+ try {
3800
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3801
+ }
3802
+ catch {
3803
+ return false;
3804
+ }
3805
+ })(); // determine it once
3806
+
3807
+ const attributeMutationMap = new Map();
3808
+ hasWindow &&
3809
+ new MutationObserver((mutations) => {
3810
+ mutations
3811
+ // reduce array to only entries that have really a changed value
3812
+ .filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
3813
+ // remove duplicates so we execute callback only once per node
3814
+ .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3815
+ .forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
3816
+ });
3817
+
3818
+ const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
3819
+ hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
3820
+
3821
+ Object.entries(breakpoint).reduce((result, [key, val]) => ({ ...result, [`${val}px`]: key }), {});
3822
+
3823
+ const hasVisibleIcon = (iconName, iconSource) => {
3824
+ return iconName !== 'none' || !!iconSource;
3825
+ };
3826
+
3827
+ /**
3828
+ * Map of observed nodes and their corresponding callback functions.
3829
+ */
3830
+ const observedNodesMap = new Map();
3831
+ /**
3832
+ * Mutation observer for observing changes in the children of observed nodes.
3833
+ */
3834
+ hasWindow &&
3835
+ new MutationObserver((mutations) => {
3836
+ // there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
3837
+ if (observedNodesMap.size) {
3838
+ const observedNodes = Array.from(observedNodesMap.keys());
3839
+ mutations
3840
+ // remove duplicates so we execute callback only once per node
3841
+ .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
3842
+ // find all observing parent nodes of mutated node and invoke their callbacks
3843
+ .forEach((mutation) => {
3844
+ observedNodes
3845
+ .filter((node) => node.contains(mutation.target))
3846
+ .forEach((node) => observedNodesMap.get(node)?.());
3847
+ });
3848
+ }
3849
+ });
3850
+
3851
+ /* eslint-disable no-undefined,no-param-reassign,no-shadow */
3852
+
3853
+ /**
3854
+ * Throttle execution of a function. Especially useful for rate limiting
3855
+ * execution of handlers on events like resize and scroll.
3856
+ *
3857
+ * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
3858
+ * are most useful.
3859
+ * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
3860
+ * as-is, to `callback` when the throttled-function is executed.
3861
+ * @param {object} [options] - An object to configure options.
3862
+ * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
3863
+ * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
3864
+ * one final time after the last throttled-function call. (After the throttled-function has not been called for
3865
+ * `delay` milliseconds, the internal counter is reset).
3866
+ * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
3867
+ * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
3868
+ * callback will never executed if both noLeading = true and noTrailing = true.
3869
+ * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
3870
+ * false (at end), schedule `callback` to execute after `delay` ms.
3871
+ *
3872
+ * @returns {Function} A new, throttled, function.
3873
+ */
3874
+ function throttle (delay, callback, options) {
3875
+ var _ref = options || {},
3876
+ _ref$noTrailing = _ref.noTrailing,
3877
+ noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
3878
+ _ref$noLeading = _ref.noLeading,
3879
+ noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
3880
+ _ref$debounceMode = _ref.debounceMode,
3881
+ debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
3882
+ /*
3883
+ * After wrapper has stopped being called, this timeout ensures that
3884
+ * `callback` is executed at the proper times in `throttle` and `end`
3885
+ * debounce modes.
3886
+ */
3887
+
3888
+
3889
+ var timeoutID;
3890
+ var cancelled = false; // Keep track of the last time `callback` was executed.
3891
+
3892
+ var lastExec = 0; // Function to clear existing timeout
3893
+
3894
+ function clearExistingTimeout() {
3895
+ if (timeoutID) {
3896
+ clearTimeout(timeoutID);
3897
+ }
3898
+ } // Function to cancel next exec
3899
+
3900
+
3901
+ function cancel(options) {
3902
+ var _ref2 = options || {},
3903
+ _ref2$upcomingOnly = _ref2.upcomingOnly,
3904
+ upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
3905
+
3906
+ clearExistingTimeout();
3907
+ cancelled = !upcomingOnly;
3908
+ }
3909
+ /*
3910
+ * The `wrapper` function encapsulates all of the throttling / debouncing
3911
+ * functionality and when executed will limit the rate at which `callback`
3912
+ * is executed.
3913
+ */
3914
+
3915
+
3916
+ function wrapper() {
3917
+ for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
3918
+ arguments_[_key] = arguments[_key];
3919
+ }
3920
+
3921
+ var self = this;
3922
+ var elapsed = Date.now() - lastExec;
3923
+
3924
+ if (cancelled) {
3925
+ return;
3926
+ } // Execute `callback` and update the `lastExec` timestamp.
3927
+
3928
+
3929
+ function exec() {
3930
+ lastExec = Date.now();
3931
+ callback.apply(self, arguments_);
3932
+ }
3933
+ /*
3934
+ * If `debounceMode` is true (at begin) this is used to clear the flag
3935
+ * to allow future `callback` executions.
3936
+ */
3937
+
3938
+
3939
+ function clear() {
3940
+ timeoutID = undefined;
3941
+ }
3942
+
3943
+ if (!noLeading && debounceMode && !timeoutID) {
3944
+ /*
3945
+ * Since `wrapper` is being called for the first time and
3946
+ * `debounceMode` is true (at begin), execute `callback`
3947
+ * and noLeading != true.
3948
+ */
3949
+ exec();
3950
+ }
3951
+
3952
+ clearExistingTimeout();
3953
+
3954
+ if (debounceMode === undefined && elapsed > delay) {
3955
+ if (noLeading) {
3956
+ /*
3957
+ * In throttle mode with noLeading, if `delay` time has
3958
+ * been exceeded, update `lastExec` and schedule `callback`
3959
+ * to execute after `delay` ms.
3960
+ */
3961
+ lastExec = Date.now();
3962
+
3963
+ if (!noTrailing) {
3964
+ timeoutID = setTimeout(debounceMode ? clear : exec, delay);
3965
+ }
3966
+ } else {
3967
+ /*
3968
+ * In throttle mode without noLeading, if `delay` time has been exceeded, execute
3969
+ * `callback`.
3970
+ */
3971
+ exec();
3972
+ }
3973
+ } else if (noTrailing !== true) {
3974
+ /*
3975
+ * In trailing throttle mode, since `delay` time has not been
3976
+ * exceeded, schedule `callback` to execute `delay` ms after most
3977
+ * recent execution.
3978
+ *
3979
+ * If `debounceMode` is true (at begin), schedule `clear` to execute
3980
+ * after `delay` ms.
3981
+ *
3982
+ * If `debounceMode` is false (at end), schedule `callback` to
3983
+ * execute after `delay` ms.
3984
+ */
3985
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
3986
+ }
3987
+ }
3988
+
3989
+ wrapper.cancel = cancel; // Return the wrapper function.
3990
+
3991
+ return wrapper;
3992
+ }
3993
+
3994
+ /* eslint-disable no-undefined */
3995
+ /**
3996
+ * Debounce execution of a function. Debouncing, unlike throttling,
3997
+ * guarantees that a function is only executed a single time, either at the
3998
+ * very beginning of a series of calls, or at the very end.
3999
+ *
4000
+ * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
4001
+ * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
4002
+ * to `callback` when the debounced-function is executed.
4003
+ * @param {object} [options] - An object to configure options.
4004
+ * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
4005
+ * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
4006
+ * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
4007
+ *
4008
+ * @returns {Function} A new, debounced function.
4009
+ */
4010
+
4011
+ function debounce (delay, callback, options) {
4012
+ var _ref = options || {},
4013
+ _ref$atBegin = _ref.atBegin,
4014
+ atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
4015
+
4016
+ return throttle(delay, callback, {
4017
+ debounceMode: atBegin !== false
4018
+ });
4019
+ }
4020
+
4021
+ debounce(800, (el, ariaElement) => {
4022
+ ariaElement.innerText = `You have ${el.maxLength - el.value.length} out of ${el.maxLength} characters left`;
4023
+ });
4024
+
4025
+ const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
4026
+
4027
+ const MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.min.493a9e3509d6e263fa2207150082def5.svg", "width": 79, "height": 26 }, "911": { "src": "911.min.b68f913216168583298ccf83f1a6b8d5.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.min.c321738789b37fda4bba3f7c587542aa.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.min.25562011631a831516f91ec31d144104.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.min.cc8919694c002873e1bb6a3c1dae5d41.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.min.a1844f4c8d23b75e371745e9b8eb49b9.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.min.6dae8095186567168f85c145845f090c.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.min.df444c6f4cc1f627ceaf1b02584d6bea.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.min.73f1e10731caffe93c07d96fa08546c1.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.min.6a4084a8704a6c47a099b2de56b22aef.svg", "width": 143, "height": 25 } };
4028
+
4019
4029
  const scrollShadowColor = 'rgba(204, 204, 204, 0.35)';
4020
4030
  const scrollShadowColorDark = 'rgba(0, 0, 0, 0.6)';
4021
4031
 
@@ -4235,6 +4245,7 @@ const getBannerPopoverResetStyles = () => {
4235
4245
  position: 'fixed',
4236
4246
  margin: 0,
4237
4247
  padding: 0,
4248
+ inset: 'auto', // ua popover reset
4238
4249
  width: 'auto', // ua popover reset
4239
4250
  height: 'auto', // ua popover reset
4240
4251
  maxWidth: '100%', // If component is wrapped in container with maxWidth
@@ -4261,6 +4272,9 @@ const getComponentCss$14 = (isOpen) => {
4261
4272
  zIndex: `var(${cssVariableZIndex},${BANNER_Z_INDEX})`,
4262
4273
  ...dropShadowHighStyle,
4263
4274
  borderRadius: borderRadiusSmall, // needed for rounded box-shadow
4275
+ '&::backdrop': {
4276
+ display: 'none',
4277
+ },
4264
4278
  ...(isOpen
4265
4279
  ? {
4266
4280
  opacity: 1,
@@ -4840,7 +4854,7 @@ const paginationWidth = `calc(${paginationActiveBulletSize} + ${paginationBullet
4840
4854
  const paginationInset = '8px'; // Used to increase clickable area on touch devices
4841
4855
  const paginationGapLarge = '16px';
4842
4856
  const paginationWidthLarge = `calc(${paginationActiveBulletSize} + ${paginationBulletSize} * ${paginationVisibleBulletCount - 1} + ${paginationGapLarge} * ${paginationVisibleBulletCount - 1} + 2 * ${paginationInset})`; // Width for one active bullet + width of inactive bullets + spacing
4843
- const selectorHeading = 'h2,::slotted([slot="heading"])';
4857
+ const selectorHeading = '.heading';
4844
4858
  const selectorDescription = 'p,::slotted([slot="description"])';
4845
4859
  const mediaQueryS = getMediaQueryMin('s');
4846
4860
  const mediaQueryXXL = getMediaQueryMin('xxl');
@@ -4886,7 +4900,7 @@ const getComponentCss$$ = (hasHeading, hasDescription, hasControlsSlot, headingS
4886
4900
  ...getFocusJssStyle(theme, { slotted: true }),
4887
4901
  },
4888
4902
  // TODO: maybe it's better to style with slot[name="heading"] and slot[name="description"] instead, then styles would be part of shadow dom
4889
- // h2,::slotted([slot=heading]),p,::slotted([slot=description])
4903
+ // .heading,p,::slotted([slot=description])
4890
4904
  ...((hasHeading || hasDescription) && {
4891
4905
  [`${selectorHeading},${selectorDescription}`]: {
4892
4906
  gridColumn: '1/-1',
@@ -4900,13 +4914,16 @@ const getComponentCss$$ = (hasHeading, hasDescription, hasControlsSlot, headingS
4900
4914
  }),
4901
4915
  },
4902
4916
  }),
4903
- // h2,::slotted([slot=heading])
4904
4917
  ...(hasHeading && {
4905
4918
  [selectorHeading]: {
4906
4919
  maxWidth: '56.25rem',
4907
4920
  margin: `0 0 ${!hasDescription ? spacingFluidMedium : 0}`,
4908
4921
  ...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
4909
4922
  },
4923
+ ['::slotted([slot=heading])']: {
4924
+ margin: 0, // reset ua-style
4925
+ ...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
4926
+ },
4910
4927
  }),
4911
4928
  // p,::slotted([slot=description])
4912
4929
  ...(hasDescription && {