@porsche-design-system/components-react 4.0.0-beta.1 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +84 -6
  2. package/cjs/lib/components/scroller.wrapper.cjs +3 -3
  3. package/cjs/lib/components/table.wrapper.cjs +3 -3
  4. package/cjs/lib/components/tabs-bar.wrapper.cjs +3 -3
  5. package/cjs/lib/components/tabs.wrapper.cjs +3 -3
  6. package/esm/lib/components/scroller.wrapper.d.ts +20 -4
  7. package/esm/lib/components/scroller.wrapper.mjs +3 -3
  8. package/esm/lib/components/table.wrapper.d.ts +10 -2
  9. package/esm/lib/components/table.wrapper.mjs +3 -3
  10. package/esm/lib/components/tabs-bar.wrapper.d.ts +19 -3
  11. package/esm/lib/components/tabs-bar.wrapper.mjs +3 -3
  12. package/esm/lib/components/tabs.wrapper.d.ts +19 -3
  13. package/esm/lib/components/tabs.wrapper.mjs +3 -3
  14. package/esm/lib/types.d.ts +34 -16
  15. package/package.json +2 -2
  16. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +302 -216
  17. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +3 -12
  18. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/scroller.wrapper.cjs +4 -4
  19. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.cjs +4 -4
  20. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.cjs +4 -4
  21. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/tabs.wrapper.cjs +4 -4
  22. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.cjs +8 -12
  23. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +1 -1
  24. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.cjs +3 -2
  25. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.cjs +1 -1
  26. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.cjs +8 -8
  27. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.cjs +3 -2
  28. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +302 -216
  29. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +4 -11
  30. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/scroller.wrapper.mjs +4 -4
  31. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.mjs +4 -4
  32. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.mjs +4 -4
  33. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/tabs.wrapper.mjs +4 -4
  34. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.mjs +9 -13
  35. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +1 -1
  36. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.mjs +3 -2
  37. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.mjs +1 -1
  38. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.mjs +8 -8
  39. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.mjs +3 -2
  40. package/ssr/esm/lib/components/scroller.wrapper.d.ts +20 -4
  41. package/ssr/esm/lib/components/table.wrapper.d.ts +10 -2
  42. package/ssr/esm/lib/components/tabs-bar.wrapper.d.ts +19 -3
  43. package/ssr/esm/lib/components/tabs.wrapper.d.ts +19 -3
  44. package/ssr/esm/lib/dsr-components/scroller.d.ts +5 -3
  45. package/ssr/esm/lib/dsr-components/stepper-horizontal.d.ts +3 -2
  46. package/ssr/esm/lib/dsr-components/tabs-bar.d.ts +6 -6
  47. package/ssr/esm/lib/dsr-components/tabs.d.ts +2 -1
  48. package/ssr/esm/lib/types.d.ts +34 -16
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const blurFrosted = 'blur(32px)';
3
+ const blurFrosted$1 = 'blur(32px)';
4
4
 
5
5
  /** @deprecated since v4.0.0, will be removed with next major release. Use backdropFilter: blurFrosted instead */
6
6
  const frostedGlassStyle = {
7
- WebkitBackdropFilter: blurFrosted,
8
- backdropFilter: blurFrosted,
7
+ WebkitBackdropFilter: blurFrosted$1,
8
+ backdropFilter: blurFrosted$1,
9
9
  };
10
10
 
11
11
  /** @deprecated since v4.0.0, will be removed with next major release. Use 2px instead. */
@@ -78,7 +78,7 @@ const typescale2Xs = '.75rem';
78
78
  const fontSizeTextXXSmall = typescale2Xs;
79
79
 
80
80
  /** @deprecated since v4.0.0, will be removed with next major release. Use typescale variables instead. */
81
- const fontSizeText = {
81
+ const fontSizeText$1 = {
82
82
  xxSmall: fontSizeTextXXSmall,
83
83
  xSmall: fontSizeTextXSmall,
84
84
  small: fontSizeTextSmall,
@@ -253,15 +253,15 @@ const durationLg = '.6s';
253
253
  /** @deprecated since v4.0.0, will be removed with next major release. Use durationLg instead. */
254
254
  const motionDurationLong = durationLg;
255
255
 
256
- const durationMd = '.4s';
256
+ const durationMd$1 = '.4s';
257
257
 
258
258
  /** @deprecated since v4.0.0, will be removed with next major release. Use durationMd instead. */
259
- const motionDurationModerate = durationMd;
259
+ const motionDurationModerate = durationMd$1;
260
260
 
261
- const durationSm = '.25s';
261
+ const durationSm$1 = '.25s';
262
262
 
263
263
  /** @deprecated since v4.0.0, will be removed with next major release. Use durationSm instead. */
264
- const motionDurationShort = durationSm;
264
+ const motionDurationShort = durationSm$1;
265
265
 
266
266
  const durationXl = '1.2s';
267
267
 
@@ -290,13 +290,6 @@ const dropShadowHighStyle = {
290
290
  boxShadow: shadowLg,
291
291
  };
292
292
 
293
- const shadowSm = '0px 3px 8px rgba(0,0,0,.16)';
294
-
295
- /** @deprecated since v4.0.0, will be removed with next major release. Use boxShadow: shadowSm instead. */
296
- const dropShadowLowStyle = {
297
- boxShadow: shadowSm,
298
- };
299
-
300
293
  const spacingFluidLg = 'clamp(32px, 2.75vw + 23px, 76px)';
301
294
 
302
295
  /** @deprecated since v4.0.0, will be removed with next major release. Use spacingFluidLg instead. */
@@ -312,22 +305,22 @@ const spacingFluidXs = 'clamp(4px, 0.25vw + 3px, 8px)';
312
305
  /** @deprecated since v4.0.0, will be removed with next major release. Use spacingFluidXs instead. */
313
306
  const spacingFluidXSmall = spacingFluidXs;
314
307
 
315
- const spacingStaticMd = '16px';
308
+ const spacingStaticMd$1 = '16px';
316
309
 
317
310
  /** @deprecated since v4.0.0, will be removed with next major release. Use spacingStaticMd instead. */
318
- const spacingStaticMedium = spacingStaticMd;
311
+ const spacingStaticMedium = spacingStaticMd$1;
319
312
 
320
- const spacingStaticSm$1 = '8px';
313
+ const spacingStaticSm$2 = '8px';
321
314
 
322
315
  /** @deprecated since v4.0.0, will be removed with next major release. Use spacingStaticSm instead. */
323
- const spacingStaticSmall = spacingStaticSm$1;
316
+ const spacingStaticSmall = spacingStaticSm$2;
324
317
 
325
- const spacingStaticXs$2 = '4px';
318
+ const spacingStaticXs$3 = '4px';
326
319
 
327
320
  /** @deprecated since v4.0.0, will be removed with next major release. Use spacingStaticXs instead. */
328
- const spacingStaticXSmall = spacingStaticXs$2;
321
+ const spacingStaticXSmall = spacingStaticXs$3;
329
322
 
330
- const spacingStaticXs$1 = spacingStaticXs$2;
323
+ const spacingStaticXs$2 = spacingStaticXs$3;
331
324
 
332
325
  const _displayFontPartA = `${fontStyleNormal} ${fontVariant} ${fontWeightRegular} `;
333
326
  const _displayFontPartB = `/${fontLineHeight} ${fontFamily}`;
@@ -394,6 +387,8 @@ const proseTextSmStyle = {
394
387
 
395
388
  const alphaDisabled = 0.4;
396
389
 
390
+ const blurFrosted = 'var(--p-blur-frosted)';
391
+
397
392
  const legacyRadiusLarge = '--_p-legacy-radius-large';
398
393
 
399
394
  const legacyRadiusMedium = '--_p-legacy-radius-medium';
@@ -476,6 +471,16 @@ const typescaleSm = 'var(--p-typescale-sm)';
476
471
 
477
472
  const fontWeightSemibold = 'var(--p-font-weight-semibold)';
478
473
 
474
+ const durationMd = 'var(--p-duration-md)';
475
+
476
+ const durationSm = 'var(--p-duration-sm)';
477
+
478
+ const spacingStaticMd = 'var(--p-spacing-static-md)';
479
+
480
+ const spacingStaticSm$1 = 'var(--p-spacing-static-sm)';
481
+
482
+ const spacingStaticXs$1 = 'var(--p-spacing-static-xs)';
483
+
479
484
  const forcedColorsMediaQuery = (style) => {
480
485
  return { '@media (forced-colors: active)': style };
481
486
  };
@@ -513,21 +518,22 @@ const addImportantToEachRule = (input) => {
513
518
  typeof value === 'object' ? addImportantToEachRule(value) : addImportantToRule(value)),
514
519
  result), {});
515
520
  };
516
- const getFocusBaseStyles = () => {
521
+ const getFocusBaseStyles = (offset = 2) => {
517
522
  return {
518
523
  outline: `${borderWidthBase} solid ${colorFocus}`,
519
- outlineOffset: '2px',
524
+ outlineOffset: `${offset}px`,
520
525
  ...forcedColorsMediaQuery({
521
526
  outlineColor: 'Highlight',
522
527
  }),
523
528
  };
524
529
  };
525
- const getDisabledBaseStyles = () => {
530
+ const getDisabledBaseStyles = (addForcedColorsDisabledStyles) => {
526
531
  return {
527
532
  opacity: alphaDisabled,
528
533
  ...forcedColorsMediaQuery({
529
534
  opacity: 1,
530
535
  color: 'GrayText',
536
+ ...addForcedColorsDisabledStyles,
531
537
  }),
532
538
  };
533
539
  };
@@ -3766,10 +3772,6 @@ const isDisabledOrLoading = (disabled, loading) => {
3766
3772
  return disabled || loading;
3767
3773
  };
3768
3774
 
3769
- const hasWindow = typeof window !== 'undefined';
3770
-
3771
- const isHighContrastMode = hasWindow && window.matchMedia?.('(forced-colors: active)').matches;
3772
-
3773
3775
  const parseJSON = (prop) => {
3774
3776
  if (typeof prop === 'string') {
3775
3777
  try {
@@ -3857,6 +3859,8 @@ const mergeDeep = (...objects) => {
3857
3859
  }
3858
3860
  })(); // determine it once
3859
3861
 
3862
+ const hasWindow = typeof window !== 'undefined';
3863
+
3860
3864
  const attributeMutationMap = new Map();
3861
3865
  hasWindow &&
3862
3866
  new MutationObserver((mutations) => {
@@ -3903,7 +3907,7 @@ const OPTION_LIST_SAFE_ZONE = 6;
3903
3907
 
3904
3908
  const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
3905
3909
 
3906
- const prefix = `[Porsche Design System v${"4.0.0-beta.1"}]` // this part isn't covered by unit tests
3910
+ const prefix = `[Porsche Design System v${"4.0.0-beta.2"}]` // this part isn't covered by unit tests
3907
3911
  ;
3908
3912
  const consoleError = (...messages) => {
3909
3913
  console.error(prefix, ...messages);
@@ -4033,8 +4037,8 @@ const cssVarPaddingBlock = '--p-accordion-py';
4033
4037
  /**
4034
4038
  * @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
4035
4039
  */
4036
- const icon = getInlineSVGBackgroundImage(`<path d="m12 15.125h-.001l-.005-.006-6.494-5.476.642-.768 5.858 4.94 5.858-4.94.642.769-6.497 5.477z"/>`);
4037
- const backgroundMap = {
4040
+ const iconMarker = getInlineSVGBackgroundImage(`<path d="m12 15.125h-.001l-.005-.006-6.494-5.476.642-.768 5.858 4.94 5.858-4.94.642.769-6.497 5.477z"/>`);
4041
+ const backgroundMap$1 = {
4038
4042
  canvas: colorCanvas,
4039
4043
  surface: colorSurface,
4040
4044
  frosted: colorFrosted,
@@ -4109,7 +4113,7 @@ const getComponentCss$19 = (alignMarker, background, isCompact, isOpen, isSticky
4109
4113
  columnGap: gap,
4110
4114
  alignItems: 'center',
4111
4115
  padding: `var(${cssVarPaddingBlock}, ${background === 'none' ? '0' : paddingBlock}) var(${cssVarPaddingInline$1}, ${background === 'none' ? '0' : paddingInline})`,
4112
- background: backgroundMap[background],
4116
+ background: backgroundMap$1[background],
4113
4117
  ...(background === 'frosted' && frostedGlassStyle),
4114
4118
  borderRadius: `var(${legacyRadiusSmall}, ${radiusXl})`,
4115
4119
  ...forcedColorsMediaQuery({
@@ -4158,7 +4162,7 @@ const getComponentCss$19 = (alignMarker, background, isCompact, isOpen, isSticky
4158
4162
  (background === 'canvas' || background === 'surface') && {
4159
4163
  position: 'sticky',
4160
4164
  top: `var(${cssVarSummaryTop}, var(${cssVarSummaryTopDeprecated}, 0px))`,
4161
- background: `linear-gradient(180deg,${backgroundMap[background]} 0%,${backgroundMap[background]} 90%,transparent 100%)`,
4165
+ background: `linear-gradient(180deg,${backgroundMap$1[background]} 0%,${backgroundMap$1[background]} 90%,transparent 100%)`,
4162
4166
  borderRadius: `var(${legacyRadiusSmall}, ${radiusXl})`,
4163
4167
  }),
4164
4168
  '&:focus-visible::before': getFocusBaseStyles(),
@@ -4177,9 +4181,6 @@ const getComponentCss$19 = (alignMarker, background, isCompact, isOpen, isSticky
4177
4181
  borderRadius: radiusFull,
4178
4182
  background: 'transparent',
4179
4183
  transition: getTransition('background-color'),
4180
- ...forcedColorsMediaQuery({
4181
- backgroundColor: 'LinkText',
4182
- }),
4183
4184
  },
4184
4185
  '&::after': {
4185
4186
  gridArea: `1/${isIconAlignedStart ? '1' : hasSummaryBefore && hasSummaryAfter ? '4' : hasSummaryBefore || hasSummaryAfter ? '3' : '2'}`,
@@ -4188,8 +4189,8 @@ const getComponentCss$19 = (alignMarker, background, isCompact, isOpen, isSticky
4188
4189
  width: '1rem',
4189
4190
  height: '1rem',
4190
4191
  pointerEvents: 'none',
4191
- WebkitMask: `${icon} center/contain no-repeat`, // necessary for Sogou browser support :-)
4192
- mask: `${icon} center/contain no-repeat`,
4192
+ WebkitMask: `${iconMarker} center/contain no-repeat`, // necessary for Sogou browser support :-)
4193
+ mask: `${iconMarker} center/contain no-repeat`,
4193
4194
  background: colorPrimary,
4194
4195
  transform: 'rotate3d(0)',
4195
4196
  transition: getTransition('transform', duration, easing),
@@ -4344,6 +4345,12 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
4344
4345
  })), buildResponsiveStyles(size, (sizeValue) => ({
4345
4346
  fontSize: getFontSizeText(sizeValue),
4346
4347
  }))),
4348
+ ...forcedColorsMediaQuery({
4349
+ color: 'LinkText',
4350
+ '&:is(button)': {
4351
+ color: 'ButtonText',
4352
+ },
4353
+ }),
4347
4354
  '&::before': {
4348
4355
  content: '""',
4349
4356
  position: 'absolute', // mobile Safari -> prevent lagging active state
@@ -4701,7 +4708,11 @@ const getComponentCss$15 = (icon, iconSource, variant, hideLabel, isDisabled, is
4701
4708
  cursor: 'not-allowed',
4702
4709
  }),
4703
4710
  ...(isDisabled && {
4704
- ...getDisabledBaseStyles(),
4711
+ ...getDisabledBaseStyles({
4712
+ '&': {
4713
+ boxShadow: 'inset 0 0 0 2px GrayText !important',
4714
+ },
4715
+ }),
4705
4716
  }),
4706
4717
  },
4707
4718
  ...(isLoading && {
@@ -5498,7 +5509,7 @@ const getFunctionalComponentLabelAfterStyles = () => {
5498
5509
  verticalAlign: 'top',
5499
5510
  '&::slotted(*)': {
5500
5511
  ...addImportantToEachRule({
5501
- marginInlineStart: spacingStaticXs$1,
5512
+ marginInlineStart: spacingStaticXs$2,
5502
5513
  })
5503
5514
  },
5504
5515
  },
@@ -5534,8 +5545,8 @@ const getFunctionalComponentLabelStyles = (isDisabled, isLoading, hideLabel, add
5534
5545
  cursor: 'unset',
5535
5546
  fontSize: typescaleXs,
5536
5547
  color: colorContrastHigh,
5537
- ...buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, { marginTop: `-${spacingStaticXs$1}` })),
5538
- marginTop: `-${spacingStaticXs$1}`,
5548
+ ...buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, { marginTop: `-${spacingStaticXs$2}` })),
5549
+ marginTop: `-${spacingStaticXs$2}`,
5539
5550
  },
5540
5551
  ...additionalDefaultJssStyle,
5541
5552
  },
@@ -7098,9 +7109,7 @@ const getComponentCss$T = (name, source, color, size) => {
7098
7109
  mask: `url("${buildIconUrl(source || name)}") center/contain no-repeat`,
7099
7110
  aspectRatio: '1/1',
7100
7111
  background: 'currentcolor', // necessary for proper color inheritance
7101
- ...forcedColorsMediaQuery({
7102
- background: 'CanvasText',
7103
- }),
7112
+ forcedColorAdjust: 'none',
7104
7113
  ...(isFlippableIcon(name, source) && {
7105
7114
  '&(:dir(rtl))': {
7106
7115
  transform: 'scaleX(-1)',
@@ -7545,6 +7554,10 @@ const anchorJssStyle = {
7545
7554
  inset: 0,
7546
7555
  zIndex: 1, // necessary to be on top of img
7547
7556
  borderRadius: `var(${legacyRadiusLarge}, ${radius4Xl})`,
7557
+ ...forcedColorsMediaQuery({
7558
+ forcedColorAdjust: 'none',
7559
+ boxShadow: 'inset 0 0 0 2px LinkText',
7560
+ }),
7548
7561
  };
7549
7562
  const getMultilineEllipsis = (lineClamp) => {
7550
7563
  return {
@@ -8592,109 +8605,161 @@ const getComponentCss$t = (isDisabled, isLoading, hideLabel, state, isCompact, d
8592
8605
  });
8593
8606
  };
8594
8607
 
8595
- const prevNextWrapperWidth = `calc(${fontLineHeight} + 24px)`;
8596
- const getComponentCss$s = (isNextHidden, isPrevHidden, alignScrollIndicator, hasScrollbar) => {
8597
- const actionPrevNextStyles = {
8598
- position: 'absolute',
8599
- top: 0,
8600
- bottom: 0,
8601
- direction: 'ltr',
8602
- width: prevNextWrapperWidth,
8603
- padding: '4px 0',
8604
- display: 'flex',
8605
- alignItems: alignScrollIndicator === 'center' ? 'center' : 'flex-start',
8608
+ /**
8609
+ * Generates a CSS linear-gradient mask string for smooth edge fading
8610
+ * using smoothstep easing.
8611
+ *
8612
+ * @param fadeEdges - Which edges to fade.
8613
+ * @param edgeLength - Size of the fully transparent area at the edge (px).
8614
+ * @param fadeLength - Size of the transition area (px).
8615
+ * @param steps - Number of gradient stops (more = smoother, 8–12 is plenty).
8616
+ * @returns CSS linear-gradient string.
8617
+ */
8618
+ const getSmoothMask = (fadeEdges, edgeLength = 24, fadeLength = 96, steps = 20) => {
8619
+ if (fadeEdges === 'none') {
8620
+ return 'linear-gradient(black,black)';
8621
+ }
8622
+ const fullLength = edgeLength + fadeLength;
8623
+ const leftStops = [];
8624
+ const rightStops = [];
8625
+ for (let i = 1; i < steps; i++) {
8626
+ const t = i / steps;
8627
+ const alpha = t * t * t * (t * (t * 6 - 15) + 10);
8628
+ leftStops.push(`rgb(0 0 0/${alpha.toFixed(3)}) ${(edgeLength + fadeLength * t).toFixed(0)}px`);
8629
+ rightStops.push(`rgb(0 0 0/${(1 - alpha).toFixed(3)}) calc(100% - ${(fullLength - fadeLength * t).toFixed(0)}px)`);
8630
+ }
8631
+ const left = `transparent 0px,transparent ${edgeLength}px,${leftStops.join(',')},black ${fullLength}px`;
8632
+ const right = `black calc(100% - ${fullLength}px),${rightStops.join(',')},transparent calc(100% - ${edgeLength}px),transparent 100%`;
8633
+ const gradients = {
8634
+ left: `linear-gradient(to right,${left},black 100%)`,
8635
+ right: `linear-gradient(to right,black 0%,${right})`,
8636
+ both: `linear-gradient(to right,${left},${right})`,
8637
+ };
8638
+ return gradients[fadeEdges];
8639
+ };
8640
+
8641
+ /**
8642
+ * @css-variable {"name": "--p-scroller-gap", "description": "Defines the gap between slotted nodes.", "defaultValue": "8px"}
8643
+ */
8644
+ const cssVarGap = '--p-scroller-gap';
8645
+ /**
8646
+ * @css-variable {"name": "--p-scroller-indicator-top", "description": "Defines the distance from the top of the viewport at which the indicator sticks when scrolling down and `sticky` is enabled.", "defaultValue": "0px"}
8647
+ */
8648
+ const cssVarIndicatorTop = '--p-scroller-indicator-top';
8649
+ /**
8650
+ * @css-variable {"name": "--p-scroller-indicator-bottom", "description": "Defines the distance from the bottom of the viewport at which the indicator sticks when scrolling up and `sticky` is enabled.", "defaultValue": "0px"}
8651
+ */
8652
+ const cssVarIndicatorBottom = '--p-scroller-indicator-bottom';
8653
+ const iconPrev = getInlineSVGBackgroundImage(`<path d="m8.875 12v-.001l.006-.005 5.476-6.494.768.642-4.94 5.858 4.939 5.858-.768.642-5.477-6.497z"/>`);
8654
+ const iconNext = getInlineSVGBackgroundImage(`<path d="m15.121 11.997-5.477-6.497-.769.642 4.94 5.858-4.94 5.858.768.642 5.476-6.494.006-.005v-.001z"/>`);
8655
+ const scrollbarWidth = '12px';
8656
+ const safeZone = '4px';
8657
+ const getScrollIndicatorStyles = (direction, isVisible, isSticky, hasScrollbar, isCompact) => {
8658
+ const isPrev = direction === 'prev';
8659
+ const iconMask = `${isPrev ? iconPrev : iconNext} center/contain no-repeat`;
8660
+ return {
8661
+ gridArea: isPrev ? '1/1' : '1/3',
8662
+ zIndex: 1, // ensure that indicators are above the scroll area
8663
+ ...(isSticky && {
8664
+ position: 'sticky',
8665
+ top: `var(${cssVarIndicatorTop},0px)`,
8666
+ bottom: `var(${cssVarIndicatorBottom},0px)`,
8667
+ }),
8668
+ ...(hasScrollbar && {
8669
+ marginTop: `calc(-1 * ${scrollbarWidth})`,
8670
+ }),
8671
+ display: 'grid',
8672
+ alignSelf: 'center',
8673
+ width: '1.5rem',
8674
+ height: '1.5rem',
8675
+ ...(!isCompact && {
8676
+ padding: spacingStaticXs$1,
8677
+ }),
8678
+ cursor: 'pointer',
8679
+ opacity: isVisible ? 1 : 0,
8680
+ visibility: isVisible ? 'inherit' : 'hidden',
8681
+ transform: `translate3d(${isVisible ? '0' : `${isPrev ? `calc(-1 * ${spacingStaticSm$1})` : spacingStaticSm$1}`},0,0)`,
8682
+ transition: `${getTransition('transform')},${getTransition('opacity')},visibility 0s linear ${isVisible ? '0s' : `var(${cssVariableTransitionDuration},${durationSm})`}`,
8683
+ '&:dir(rtl)': {
8684
+ gridArea: isPrev ? '1/3' : '1/1',
8685
+ },
8686
+ ...hoverMediaQuery({
8687
+ '&:hover::after': {
8688
+ // do the transform on the pseudo-element to prevent the click area from moving when hovered
8689
+ transform: `translate3d(${isPrev ? `calc(-1 * ${spacingStaticXs$1})` : spacingStaticXs$1},0,0)`,
8690
+ },
8691
+ }),
8692
+ '&::after': {
8693
+ content: '""',
8694
+ WebkitMask: iconMask, // necessary for Sogou browser support :-)
8695
+ mask: iconMask,
8696
+ background: colorPrimary,
8697
+ transition: getTransition('transform'),
8698
+ },
8606
8699
  };
8700
+ };
8701
+ const getComponentCss$s = (isIndicatorPrevVisible, // can be undefined in ssr context
8702
+ isIndicatorNextVisible, // can be undefined in ssr context
8703
+ isSticky, hasScrollbar, isCompact) => {
8704
+ const fadeEdges = !isIndicatorPrevVisible && !isIndicatorNextVisible
8705
+ ? 'none'
8706
+ : !isIndicatorPrevVisible
8707
+ ? 'right'
8708
+ : !isIndicatorNextVisible
8709
+ ? 'left'
8710
+ : 'both';
8711
+ const mask = `${getSmoothMask(fadeEdges)} 0 0/auto no-repeat${hasScrollbar ? `,linear-gradient(black,black) 0 bottom/auto ${scrollbarWidth} no-repeat` : ''}`;
8607
8712
  return getCss({
8608
8713
  '@global': {
8609
8714
  ':host': {
8610
8715
  display: 'block',
8716
+ borderRadius: `var(${legacyRadiusSmall},${radiusLg})`, // needs to be overwritable by tabs-bar to improve focus appearance
8611
8717
  ...addImportantToEachRule({
8612
- height: 'inherit',
8613
8718
  ...hostHiddenStyles,
8614
8719
  }),
8615
8720
  },
8616
- ...preventFoucOfNestedElementsStyles,
8721
+ slot: {
8722
+ gridArea: '1/2',
8723
+ position: 'relative', // necessary for tabs bar animation
8724
+ display: 'inline-flex',
8725
+ gap: `var(${cssVarGap},${isCompact ? spacingStaticXs$1 : spacingStaticSm$1})`,
8726
+ },
8617
8727
  },
8618
8728
  root: {
8619
- position: 'relative',
8620
8729
  display: 'grid',
8621
- gridTemplateColumns: `${prevNextWrapperWidth} minmax(0, 1fr) ${prevNextWrapperWidth}`,
8622
- margin: '0 -4px',
8623
- height: 'inherit',
8730
+ gridTemplateColumns: `auto minmax(0,1fr) auto`,
8731
+ alignItems: 'center',
8732
+ borderRadius: 'inherit',
8733
+ '&:has(.scroll:focus-visible)': getFocusBaseStyles(), // delegating the focus ensures mask does not cut off the focus ring
8624
8734
  },
8625
- 'scroll-area': {
8626
- gridArea: '1 / 1 / 1 / -1',
8627
- padding: '4px',
8735
+ scroll: {
8736
+ gridArea: '1/1/1/-1',
8737
+ zIndex: 0, // ensure that scroll area is behind the indicators
8738
+ display: 'grid',
8739
+ gridTemplateColumns: `${safeZone} minmax(auto,1fr) ${safeZone}`,
8740
+ margin: `calc(-1 * ${safeZone})`, // compensate padding to ensure that `:host` is aligned with other elements
8741
+ padding: `${safeZone} 0px${hasScrollbar ? ` calc(${safeZone} + ${scrollbarWidth})` : ''}`, // ensure enough space is available for focus ring of slotted elements (horizontal space is given by `.sentinel`)
8742
+ outline: 'none', // focus ring is applied to `.root`, it would be cut off by the mask if applied to `.scroll`
8628
8743
  overflow: 'auto hidden',
8629
- ...((!isPrevHidden || !isNextHidden) && {
8630
- mask: isNextHidden
8631
- ? 'linear-gradient(90deg,#0000 8px,#000 40px) alpha'
8632
- : isPrevHidden
8633
- ? 'linear-gradient(90deg,#000 calc(100% - 40px), #0000 calc(100% - 8px)) alpha'
8634
- : 'linear-gradient(90deg,#0000 8px,#000 40px calc(100% - 40px),#0000 calc(100% - 8px)) alpha',
8744
+ ...(fadeEdges !== 'none' && {
8745
+ WebkitMask: mask, // necessary for Sogou browser support :-)
8746
+ mask,
8635
8747
  }),
8636
- ...(!hasScrollbar && {
8637
- // If scrollbar is disabled - hide scrollbar
8638
- msOverflowStyle: 'none' /* IE and Edge */,
8639
- scrollbarWidth: 'none' /* Firefox */,
8640
- '&::-webkit-scrollbar': {
8641
- display: 'none',
8642
- },
8643
- }),
8644
- },
8645
- // Extra wrapper needed to compensate different offset parent calculation depending on browser.
8646
- // Needed for position of status bar.
8647
- 'scroll-wrapper': {
8648
- position: 'relative',
8649
- display: 'inline-flex',
8650
- minHeight: '28px',
8651
- minWidth: '100%',
8652
- verticalAlign: 'top',
8653
- borderRadius: `var(${legacyRadiusSmall}, ${radiusSm})`,
8654
- '&:focus-visible': getFocusBaseStyles(),
8748
+ scrollbarWidth: hasScrollbar ? 'thin' : 'none',
8655
8749
  },
8656
- trigger: {
8657
- position: 'absolute',
8658
- inset: '0 auto',
8659
- width: '1px',
8750
+ // as soon as `@container scroll-state(scrollable: left)` has better browser support we can get rid of sentinel and IntersectionObserver
8751
+ sentinel: {
8752
+ width: safeZone,
8660
8753
  visibility: 'hidden',
8661
- '&:first-of-type': {
8662
- left: 0,
8663
- },
8664
- '&:last-of-type': {
8665
- right: 0,
8754
+ '&:first-of-type:dir(rtl)': {
8755
+ gridArea: '1/3',
8666
8756
  },
8667
- },
8668
- 'action-prev': {
8669
- ...actionPrevNextStyles,
8670
- left: '-1px', // ensures that the gradient always overlays the content (e.g. when zoomed)
8671
- justifyContent: 'flex-start',
8672
- visibility: isPrevHidden ? 'hidden' : 'inherit',
8673
- '& .action-button': {
8674
- marginLeft: '8px',
8675
- // hide buttons on mobile (actually devices not supporting hover)
8676
- ...hoverMediaQuery({
8677
- visibility: isPrevHidden ? 'hidden' : 'inherit',
8678
- }),
8679
- },
8680
- },
8681
- 'action-next': {
8682
- ...actionPrevNextStyles,
8683
- right: '-1px', // ensures that the gradient always overlays the content (e.g. when zoomed)
8684
- justifyContent: 'flex-end',
8685
- visibility: isNextHidden ? 'hidden' : 'inherit',
8686
- '& .action-button': {
8687
- marginRight: '8px',
8688
- // hide buttons on mobile (actually devices not supporting hover)
8689
- ...hoverMediaQuery({
8690
- visibility: isNextHidden ? 'hidden' : 'inherit',
8691
- }),
8757
+ '&:last-of-type:dir(rtl)': {
8758
+ gridArea: '1/1',
8692
8759
  },
8693
8760
  },
8694
- 'action-button': {
8695
- ...dismissButtonJssStyle,
8696
- ...dropShadowLowStyle,
8697
- },
8761
+ prev: getScrollIndicatorStyles('prev', !!isIndicatorPrevVisible, isSticky, hasScrollbar, isCompact),
8762
+ next: getScrollIndicatorStyles('next', !!isIndicatorNextVisible, isSticky, hasScrollbar, isCompact),
8698
8763
  });
8699
8764
  };
8700
8765
 
@@ -9053,9 +9118,6 @@ const getComponentCss$l = (state, disabled) => {
9053
9118
  fontSize: 'inherit',
9054
9119
  ...hostHiddenStyles,
9055
9120
  ...(isDisabled && getDisabledBaseStyles()),
9056
- '&(:not(:last-of-type))': {
9057
- marginInlineEnd: spacingFluidXSmall,
9058
- },
9059
9121
  }),
9060
9122
  },
9061
9123
  ...preventFoucOfNestedElementsStyles,
@@ -9085,6 +9147,15 @@ const getComponentCss$l = (state, disabled) => {
9085
9147
  },
9086
9148
  })),
9087
9149
  '&:focus-visible': getFocusBaseStyles(),
9150
+ ...forcedColorsMediaQuery({
9151
+ ...(isStateCurrent && {
9152
+ outline: '1px solid CanvasText',
9153
+ }),
9154
+ ...(isDisabled && {
9155
+ color: 'GrayText',
9156
+ borderColor: 'GrayText',
9157
+ }),
9158
+ }),
9088
9159
  },
9089
9160
  },
9090
9161
  icon: {
@@ -9092,9 +9163,15 @@ const getComponentCss$l = (state, disabled) => {
9092
9163
  fontSize: 'inherit', // necessary because of all: unset
9093
9164
  width: fontLineHeight,
9094
9165
  height: fontLineHeight,
9166
+ forcedColorAdjust: 'none',
9095
9167
  ...(isStateCurrentOrUndefined && {
9096
9168
  display: 'grid',
9097
9169
  backgroundImage: `radial-gradient(circle, ${colorPrimary} 60%, transparent 62%)`,
9170
+ ...(isDisabled && {
9171
+ ...forcedColorsMediaQuery({
9172
+ backgroundImage: 'radial-gradient(circle, GrayText 60%, transparent 62%)',
9173
+ }),
9174
+ }),
9098
9175
  '&::before': {
9099
9176
  content: '""',
9100
9177
  ...Array.from(new Array(9)).reduce((result, _, i) => ({
@@ -9116,7 +9193,7 @@ const getComponentCss$k = (size) => {
9116
9193
  return getCss({
9117
9194
  '@global': {
9118
9195
  ':host': {
9119
- display: 'block',
9196
+ display: 'grid',
9120
9197
  ...addImportantToEachRule({
9121
9198
  ...hostHiddenStyles,
9122
9199
  }),
@@ -9124,8 +9201,9 @@ const getComponentCss$k = (size) => {
9124
9201
  ...preventFoucOfNestedElementsStyles,
9125
9202
  },
9126
9203
  scroller: {
9204
+ placeSelf: 'flex-start', // ensures scroller doesn't get stretched in x- or y-axis in case the stepper-horizontal is taller than the scroller (e.g. when placed in flex or grid context)
9127
9205
  ...textSmallStyle,
9128
- ...buildResponsiveStyles(size, (s) => ({ fontSize: fontSizeText[s] })),
9206
+ ...buildResponsiveStyles(size, (s) => ({ fontSize: fontSizeText$1[s] })),
9129
9207
  },
9130
9208
  });
9131
9209
  };
@@ -9267,19 +9345,31 @@ const getComponentCss$i = () => {
9267
9345
  });
9268
9346
  };
9269
9347
 
9348
+ /**
9349
+ * @css-variable {"name": "--p-table-scroll-indicator-top", "description": "Defines the distance from the top of the viewport at which the scroll indicator sticks when scrolling down and `sticky` is enabled.", "defaultValue": "0px"}
9350
+ */
9351
+ const cssVarScrollIndicatorTop = '--p-table-scroll-indicator-top';
9352
+ /**
9353
+ * @css-variable {"name": "--p-table-scroll-indicator-bottom", "description": "Defines the distance from the bottom of the viewport at which the scroll indicator sticks when scrolling up and `sticky` is enabled.", "defaultValue": "0px"}
9354
+ */
9355
+ const cssVarScrollIndicatorBottom = '--p-table-scroll-indicator-bottom';
9270
9356
  const cssVariableTablePadding = '--_a';
9271
9357
  const cssVariableTableHoverColor = '--_b';
9272
9358
  const cssVariableTableBorderColor = '--_c';
9273
9359
  const cssVariableTableBorderWidth = '--_d';
9274
- const getComponentCss$h = (compact, layout) => {
9360
+ const getComponentCss$h = (isCompact, layout) => {
9275
9361
  return getCss({
9276
9362
  '@global': {
9277
9363
  ':host': {
9278
9364
  display: 'block',
9279
9365
  ...addImportantToEachRule({
9366
+ '--p-scroller-indicator-top': `var(${cssVarScrollIndicatorTop},0px)`,
9367
+ '--p-scroller-indicator-bottom': `var(${cssVarScrollIndicatorBottom},0px)`,
9280
9368
  [cssVariableTableHoverColor]: colorFrosted,
9281
9369
  [cssVariableTableBorderColor]: colorContrastLow,
9282
- ...(compact && { [cssVariableTablePadding]: spacingStaticSmall }),
9370
+ ...(isCompact && {
9371
+ [cssVariableTablePadding]: spacingStaticSmall,
9372
+ }),
9283
9373
  ...hostHiddenStyles,
9284
9374
  ...textSmallStyle,
9285
9375
  color: colorPrimary,
@@ -9459,105 +9549,100 @@ const getComponentCss$c = () => {
9459
9549
  });
9460
9550
  };
9461
9551
 
9462
- const scrollerAnimatedCssClass = 'scroller--animated';
9463
- const targetSelectors = ['a', 'button'];
9464
- const transformSelector = (selector) => targetSelectors.map((tag) => selector.replace(/\[role]/g, tag)).join();
9465
- const barJssStyle = {
9466
- position: 'absolute',
9467
- height: '2px',
9468
- left: 0,
9469
- background: colorPrimary,
9470
- ...forcedColorsMediaQuery({
9471
- background: 'ActiveBorder',
9472
- }),
9552
+ const backgroundMap = {
9553
+ canvas: colorCanvas,
9554
+ surface: colorSurface,
9555
+ frosted: colorFrosted,
9556
+ };
9557
+ const fontSizeText = {
9558
+ small: typescaleSm,
9559
+ medium: typescaleMd,
9473
9560
  };
9474
- const getComponentCss$b = (size, weight) => {
9561
+ const getComponentCss$b = (background, size, isCompact) => {
9475
9562
  return getCss({
9476
9563
  '@global': {
9477
9564
  ':host': {
9478
- display: 'block',
9565
+ display: 'grid',
9479
9566
  ...addImportantToEachRule({
9480
- position: 'relative',
9567
+ position: 'relative', // necessary for the bar animation to calculate the tab items position correctly
9481
9568
  ...hostHiddenStyles,
9482
9569
  }),
9483
9570
  },
9484
9571
  ...preventFoucOfNestedElementsStyles,
9485
9572
  ...addImportantToEachRule({
9486
- '::slotted(:is(a,button):focus-visible)': getFocusBaseStyles(),
9487
- // would be nice to use shared selector like '::slotted([role])'
9488
- // but this doesn't work reliably when rendering in browser
9489
- // TODO: might work with ::slotted(:is(a,button)) in the meantime?
9490
- [transformSelector('::slotted([role])')]: {
9491
- all: 'unset',
9492
- display: 'inline-block',
9493
- position: 'relative',
9494
- margin: `0 0 ${spacingStaticXs} 0`,
9495
- verticalAlign: 'top',
9496
- whiteSpace: 'nowrap',
9497
- boxSizing: 'border-box',
9498
- textAlign: 'start',
9499
- color: colorPrimary,
9500
- cursor: 'pointer',
9501
- borderRadius: `var(${legacyRadiusSmall}, ${radiusSm})`,
9502
- zIndex: 0, // needed for ::before pseudo-element to be visible
9573
+ '::slotted': {
9574
+ '&(a),&(button)': {
9575
+ all: 'unset',
9576
+ padding: isCompact ? `2px ${spacingStaticSm$1}` : `12px ${spacingStaticMd}`,
9577
+ whiteSpace: 'nowrap',
9578
+ cursor: 'pointer',
9579
+ borderRadius: `var(${legacyRadiusSmall}, ${radiusFull})`,
9580
+ ...(background === 'none' && {
9581
+ background: colorFrosted,
9582
+ }),
9583
+ font: `${typescaleSm} / ${leadingNormal} ${fontPorscheNext}`,
9584
+ ...buildResponsiveStyles(size, (sizeValue) => ({
9585
+ fontSize: fontSizeText[sizeValue],
9586
+ })),
9587
+ color: colorPrimary,
9588
+ transition: `${getTransition('color', 'moderate')}, ${getTransition('background-color')}`,
9589
+ },
9590
+ '&(a:focus-visible),&(button:focus-visible)': getFocusBaseStyles(),
9503
9591
  ...hoverMediaQuery({
9504
- '&::before': {
9505
- content: '""',
9506
- position: 'absolute',
9507
- inset: '-2px -4px',
9508
- borderRadius: `var(${legacyRadiusSmall}, ${radiusSm})`,
9509
- zIndex: -1, // Stack the pseudo-element behind the button to avoid overlay of frosted-glass effect with label text
9510
- transition: getTransition('background-color'),
9592
+ '&(a:not([aria-current="true"]):hover),&(button:not([aria-selected="true"]):hover)': {
9593
+ background: colorFrostedStrong,
9511
9594
  },
9512
9595
  }),
9513
- },
9514
- ...hoverMediaQuery({
9515
- [transformSelector('::slotted([role]:hover)::before')]: {
9516
- ...frostedGlassStyle,
9517
- background: colorFrosted,
9596
+ '&(a[aria-current="true"]),&(button[aria-selected="true"])': {
9597
+ color: colorCanvas,
9598
+ background: colorPrimary,
9599
+ transition: `${getTransition('color', 'moderate')}, background-color 0s linear ${durationMd}`, // the background shall be changed immediately after the bar transition has finished
9518
9600
  },
9519
- }),
9520
- // basic invisible bar, that will be delayed via transition: visibility
9521
- [transformSelector('::slotted([role])::after')]: {
9522
- content: '""',
9523
- visibility: 'hidden',
9524
- },
9525
- // visible bar for selected tab
9526
- [transformSelector('::slotted([role][aria-selected="true"])::after, ::slotted([role][aria-current="true"])::after')]: {
9527
- ...barJssStyle,
9528
- right: '0px',
9529
- bottom: isHighContrastMode ? '-4px' : '-6px',
9530
- visibility: 'inherit',
9531
- },
9532
- [transformSelector('::slotted([role]:not(:last-child))')]: {
9533
- marginInlineEnd: spacingStaticMedium,
9601
+ ...forcedColorsMediaQuery({
9602
+ '&(a),&(button)': {
9603
+ forcedColorAdjust: 'none',
9604
+ background: 'Canvas',
9605
+ },
9606
+ '&(a)': {
9607
+ color: 'LinkText',
9608
+ boxShadow: 'inset 0 0 0 2px LinkText',
9609
+ },
9610
+ '&(button)': {
9611
+ color: 'ButtonText',
9612
+ boxShadow: 'inset 0 0 0 2px ButtonBorder',
9613
+ },
9614
+ '&(a[aria-current="true"]),&(button[aria-selected="true"])': {
9615
+ transition: 'unset',
9616
+ },
9617
+ }),
9534
9618
  },
9535
9619
  }),
9536
9620
  },
9537
9621
  scroller: {
9538
- ...textSmallStyle,
9539
- fontWeight: getFontWeight(weight),
9540
- ...buildResponsiveStyles(size, (s) => ({ fontSize: fontSizeText[s] })),
9541
- },
9542
- // conditionally applied and removed based on if activeTabIndex exists
9543
- [scrollerAnimatedCssClass]: {
9544
- [`& ${transformSelector('::slotted([role][aria-selected="true"])::after, ::slotted([role][aria-current="true"])::after')}`]: {
9545
- transition: addImportantToRule(`visibility 0s linear var(${cssVariableTransitionDuration}, ${motionDurationModerate})`), // bar appears after transition
9546
- },
9622
+ placeSelf: 'flex-start', // ensures scroller doesn't get stretched in x- or y-axis in case the tabs-bar is taller than the scroller (e.g. when placed in flex or grid context)
9623
+ borderRadius: `var(${legacyRadiusSmall}, ${radiusFull})`,
9624
+ ...(background !== 'none' && {
9625
+ background: backgroundMap[background],
9626
+ padding: spacingStaticXs$1,
9627
+ ...forcedColorsMediaQuery({
9628
+ forcedColorAdjust: 'none',
9629
+ outline: '1px solid CanvasText',
9630
+ }),
9631
+ }),
9632
+ ...(background === 'frosted' && {
9633
+ WebkitBackdropFilter: blurFrosted,
9634
+ backdropFilter: blurFrosted,
9635
+ }),
9547
9636
  },
9548
- // moving bar
9549
9637
  bar: {
9550
- ...barJssStyle,
9551
- width: 0, // actual width and transform is set via inline css
9552
- bottom: isHighContrastMode ? '0' : '-2px',
9553
- visibility: 'inherit',
9554
- transition: `${getTransition('transform', 'moderate')}, ${getTransition('width', 'moderate')}`,
9555
- animation: `$hide 0s var(${cssVariableAnimationDuration},0.5s) forwards`, // auto hide bar after transition, needs to be a little longer in Safari
9556
- },
9557
- '@keyframes hide': {
9558
- to: {
9559
- visibility: 'hidden',
9560
- },
9638
+ position: 'absolute',
9639
+ insetInlineStart: 0, // necessary for the bar animation to calculate the tab items position correctly in rtl mode
9640
+ width: '0px', // ensures element is not visible after `.animate()` has finished
9641
+ height: '100%',
9642
+ zIndex: -1,
9643
+ pointerEvents: 'none',
9644
+ borderRadius: `var(${legacyRadiusSmall}, ${radiusFull})`,
9645
+ background: colorPrimary,
9561
9646
  },
9562
9647
  });
9563
9648
  };
@@ -9590,7 +9675,7 @@ const getComponentCss$9 = () => {
9590
9675
  ...preventFoucOfNestedElementsStyles,
9591
9676
  },
9592
9677
  root: {
9593
- marginBottom: spacingStaticSmall,
9678
+ marginBottom: spacingStaticSm$1,
9594
9679
  },
9595
9680
  });
9596
9681
  };
@@ -9727,6 +9812,7 @@ const getComponentCss$7 = (variant, compact, isFocusable, hasIcon) => {
9727
9812
  outline: '2px solid CanvasText',
9728
9813
  outlineOffset: '-2px',
9729
9814
  backgroundColor: 'Canvas',
9815
+ color: 'CanvasText',
9730
9816
  }),
9731
9817
  },
9732
9818
  '::slotted': addImportantToEachRule({