@porsche-design-system/components-react 3.28.0-rc.3 → 3.29.0-rc.0

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 (106) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/lib/components/input-number.wrapper.cjs +29 -0
  3. package/cjs/lib/components/input-password.wrapper.cjs +3 -3
  4. package/cjs/lib/components/input-search.wrapper.cjs +29 -0
  5. package/cjs/lib/components/input-text.wrapper.cjs +29 -0
  6. package/cjs/lib/components/select.wrapper.cjs +3 -3
  7. package/cjs/lib/components/textarea.wrapper.cjs +1 -1
  8. package/cjs/public-api.cjs +6 -0
  9. package/esm/lib/components/index.d.ts +3 -0
  10. package/esm/lib/components/input-number.wrapper.d.ts +192 -0
  11. package/esm/lib/components/input-number.wrapper.mjs +27 -0
  12. package/esm/lib/components/input-password.wrapper.d.ts +10 -2
  13. package/esm/lib/components/input-password.wrapper.mjs +3 -3
  14. package/esm/lib/components/input-search.wrapper.d.ts +176 -0
  15. package/esm/lib/components/input-search.wrapper.mjs +27 -0
  16. package/esm/lib/components/input-text.wrapper.d.ts +192 -0
  17. package/esm/lib/components/input-text.wrapper.mjs +27 -0
  18. package/esm/lib/components/select.wrapper.d.ts +8 -0
  19. package/esm/lib/components/select.wrapper.mjs +3 -3
  20. package/esm/lib/components/textarea.wrapper.d.ts +4 -4
  21. package/esm/lib/components/textarea.wrapper.mjs +1 -1
  22. package/esm/lib/types.d.ts +29 -4
  23. package/esm/public-api.mjs +3 -0
  24. package/package.json +3 -3
  25. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +429 -271
  26. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +4 -24
  27. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +40 -0
  28. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.cjs +4 -4
  29. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-search.wrapper.cjs +40 -0
  30. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.cjs +40 -0
  31. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.cjs +4 -4
  32. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.cjs +1 -1
  33. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs +1 -1
  34. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +26 -0
  35. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +44 -0
  36. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +11 -11
  37. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.cjs +47 -0
  38. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.cjs +43 -0
  39. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +10 -3
  40. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -3
  41. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +6 -5
  42. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +5 -4
  43. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +6 -0
  44. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +393 -243
  45. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +4 -22
  46. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +38 -0
  47. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.mjs +4 -4
  48. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-search.wrapper.mjs +38 -0
  49. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.mjs +38 -0
  50. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.mjs +4 -4
  51. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.mjs +1 -1
  52. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.mjs +1 -1
  53. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
  54. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +2 -2
  55. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.mjs +2 -2
  56. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -2
  57. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +2 -2
  58. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -2
  59. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -2
  60. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +2 -2
  61. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -2
  62. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
  63. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.mjs +2 -2
  64. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +2 -2
  65. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/display.mjs +2 -2
  66. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.mjs +2 -2
  67. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +2 -2
  68. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-link.mjs +2 -2
  69. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +2 -2
  70. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.mjs +2 -2
  71. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +2 -2
  72. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.mjs +2 -2
  73. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.mjs +2 -2
  74. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +2 -2
  75. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.mjs +2 -2
  76. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.mjs +2 -2
  77. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/heading.mjs +2 -2
  78. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.mjs +2 -2
  79. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +2 -2
  80. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +2 -2
  81. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +24 -0
  82. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +42 -0
  83. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +12 -12
  84. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.mjs +45 -0
  85. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.mjs +41 -0
  86. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +11 -4
  87. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -4
  88. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +6 -5
  89. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +6 -5
  90. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +3 -0
  91. package/ssr/esm/lib/components/index.d.ts +3 -0
  92. package/ssr/esm/lib/components/input-number.wrapper.d.ts +192 -0
  93. package/ssr/esm/lib/components/input-password.wrapper.d.ts +10 -2
  94. package/ssr/esm/lib/components/input-search.wrapper.d.ts +176 -0
  95. package/ssr/esm/lib/components/input-text.wrapper.d.ts +192 -0
  96. package/ssr/esm/lib/components/select.wrapper.d.ts +8 -0
  97. package/ssr/esm/lib/components/textarea.wrapper.d.ts +4 -4
  98. package/ssr/esm/lib/dsr-components/input-base.d.ts +33 -0
  99. package/ssr/esm/lib/dsr-components/input-number.d.ts +19 -0
  100. package/ssr/esm/lib/dsr-components/input-password.d.ts +6 -3
  101. package/ssr/esm/lib/dsr-components/input-search.d.ts +20 -0
  102. package/ssr/esm/lib/dsr-components/input-text.d.ts +19 -0
  103. package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -1
  104. package/ssr/esm/lib/dsr-components/select.d.ts +2 -1
  105. package/ssr/esm/lib/types.d.ts +29 -4
  106. package/{tailwind → tailwindcss}/index.css +194 -133
@@ -3932,7 +3932,7 @@ const formatObjectOutput = (value) => {
3932
3932
 
3933
3933
  const OPTION_LIST_SAFE_ZONE = 6;
3934
3934
 
3935
- const getComponentCss$1c = (size, compact, open, theme, sticky) => {
3935
+ const getComponentCss$1f = (size, compact, open, theme, sticky) => {
3936
3936
  const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
3937
3937
  const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
3938
3938
  const cssVariablePositionStickyTop = '--p-accordion-position-sticky-top';
@@ -4104,7 +4104,7 @@ const cssVariableTop = '--p-banner-position-top';
4104
4104
  const cssVariableBottom = '--p-banner-position-bottom';
4105
4105
  const cssVariableZIndex = '--p-internal-banner-z-index';
4106
4106
  const topBottomFallback = '56px';
4107
- const getComponentCss$1b = (isOpen) => {
4107
+ const getComponentCss$1e = (isOpen) => {
4108
4108
  return getCss({
4109
4109
  '@global': {
4110
4110
  ':host': {
@@ -4176,7 +4176,7 @@ const getGroupDirectionJssStyles = (direction) => {
4176
4176
  return groupDirectionJssStyles[direction];
4177
4177
  };
4178
4178
 
4179
- const getComponentCss$1a = (direction) => {
4179
+ const getComponentCss$1d = (direction) => {
4180
4180
  return getCss({
4181
4181
  '@global': {
4182
4182
  ':host': {
@@ -4329,7 +4329,7 @@ const getFunctionalComponentLoadingMessageStyles = () => {
4329
4329
  };
4330
4330
  };
4331
4331
 
4332
- const getComponentCss$19 = (icon, iconSource, active, isLoading, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, underline, theme) => {
4332
+ const getComponentCss$1c = (icon, iconSource, active, isLoading, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, underline, theme) => {
4333
4333
  const hasIcon = hasVisibleIcon(icon, iconSource);
4334
4334
  return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, underline, false, theme), {
4335
4335
  root: {
@@ -4367,7 +4367,7 @@ const getFontWeight = (weight) => {
4367
4367
  return fontWeightMap[weight];
4368
4368
  };
4369
4369
 
4370
- const getComponentCss$18 = (isDisabledOrLoading, aspectRatio, size, weight, background, align, compact, hasGradient, isDisabled) => {
4370
+ const getComponentCss$1b = (isDisabledOrLoading, aspectRatio, size, weight, background, align, compact, hasGradient, isDisabled) => {
4371
4371
  const isTopAligned = align === 'top';
4372
4372
  return getCss({
4373
4373
  '@global': {
@@ -4637,7 +4637,7 @@ const getDisabledColors = (variant, loading, theme) => {
4637
4637
  };
4638
4638
  return colors[variant === 'tertiary' ? 'secondary' : variant];
4639
4639
  };
4640
- const getComponentCss$17 = (icon, iconSource, variant, hideLabel, disabled, loading, compact, theme) => {
4640
+ const getComponentCss$1a = (icon, iconSource, variant, hideLabel, disabled, loading, compact, theme) => {
4641
4641
  const disabledOrLoading = isDisabledOrLoading(disabled, loading);
4642
4642
  const { textColor, borderColor, backgroundColor } = getDisabledColors(variant, loading, theme);
4643
4643
  const { textColor: textColorDark, borderColor: borderColorDark, backgroundColor: backgroundColorDark, } = getDisabledColors(variant, loading, 'dark');
@@ -4713,7 +4713,7 @@ const mediaQueryS$1 = getMediaQueryMin('s');
4713
4713
  const mediaQueryM = getMediaQueryMin('m');
4714
4714
  // others
4715
4715
  const spacingBase = gridGap.replace('36px', '24px');
4716
- const getComponentCss$16 = (theme, isSidebarStartOpen, isSidebarEndOpen) => {
4716
+ const getComponentCss$19 = (theme, isSidebarStartOpen, isSidebarEndOpen) => {
4717
4717
  const { primaryColor, backgroundColor, backgroundSurfaceColor, contrastLowColor } = getThemedColors(theme);
4718
4718
  const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
4719
4719
  return getCss({
@@ -5092,7 +5092,7 @@ const getGradient$1 = (theme, gradientColorTheme) => {
5092
5092
  `rgba(${gradientColor},0.3) 68%,` +
5093
5093
  `rgba(${gradientColor},0)`);
5094
5094
  };
5095
- const getComponentCss$15 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation, alignControls) => {
5095
+ const getComponentCss$18 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation, alignControls) => {
5096
5096
  const { primaryColor, contrastMediumColor } = getThemedColors(theme);
5097
5097
  const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
5098
5098
  const { canvasTextColor } = getHighContrastColors();
@@ -5550,7 +5550,7 @@ const getCheckedSVGBackgroundImage$2 = (fill) => {
5550
5550
  const getIndeterminateSVGBackgroundImage$1 = (fill) => {
5551
5551
  return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
5552
5552
  };
5553
- const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, theme) => {
5553
+ const getComponentCss$17 = (hideLabel, state, isDisabled, isLoading, theme) => {
5554
5554
  const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
5555
5555
  const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
5556
5556
  const indeterminateIconColor = escapeHashCharacter(getThemedColors(theme).primaryColor);
@@ -5752,7 +5752,7 @@ const getCheckboxCheckedBaseStyles = (theme, isDisabled, isLoading, state) => {
5752
5752
  const getIndeterminateSVGBackgroundImage = (fill) => {
5753
5753
  return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
5754
5754
  };
5755
- const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
5755
+ const getComponentCss$16 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
5756
5756
  const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
5757
5757
  const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, focusColor: focusColorDark, } = getThemedColors('dark');
5758
5758
  const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
@@ -5926,12 +5926,257 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
5926
5926
  });
5927
5927
  };
5928
5928
 
5929
+ const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme, additionalDefaultJssStyle) => {
5930
+ const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
5931
+ const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
5932
+ const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
5933
+ const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
5934
+ return {
5935
+ [`::slotted(${child})`]: {
5936
+ display: 'block',
5937
+ width: '100%',
5938
+ height: child !== 'textarea'
5939
+ ? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
5940
+ : 'auto',
5941
+ margin: 0,
5942
+ outline: 0,
5943
+ WebkitAppearance: 'none', // iOS safari
5944
+ appearance: 'none',
5945
+ boxSizing: 'border-box',
5946
+ border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
5947
+ borderRadius: borderRadiusSmall,
5948
+ background: 'transparent',
5949
+ font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is aligned with how Safari visualize date/time input highlighting
5950
+ textIndent: 0,
5951
+ color: primaryColor,
5952
+ transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
5953
+ ...prefersColorSchemeDarkMediaQuery(theme, {
5954
+ borderColor: formStateColorDark || contrastMediumColorDark,
5955
+ color: primaryColorDark,
5956
+ }),
5957
+ ...additionalDefaultJssStyle,
5958
+ },
5959
+ '::slotted(:not(input[type="password"]))': {
5960
+ textOverflow: 'ellipsis',
5961
+ },
5962
+ ...(!isLoading &&
5963
+ hoverMediaQuery({
5964
+ // with the media query the selector has higher priority and overrides disabled styles
5965
+ [`::slotted(${child}:not(:disabled):not(:focus):not([readonly]):hover),label:hover~.wrapper ::slotted(${child}:not(:disabled):not(:focus):not([readonly]))${child === 'select' ? ',label:hover~.wrapper ::part(select-wrapper-dropdown)' : ''}`]: {
5966
+ borderColor: formStateHoverColor || primaryColor,
5967
+ ...prefersColorSchemeDarkMediaQuery(theme, {
5968
+ borderColor: formStateHoverColorDark || primaryColorDark,
5969
+ }),
5970
+ },
5971
+ })),
5972
+ // TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
5973
+ [`::slotted(${child}:focus)`]: {
5974
+ borderColor: primaryColor,
5975
+ ...prefersColorSchemeDarkMediaQuery(theme, {
5976
+ borderColor: primaryColorDark,
5977
+ }),
5978
+ },
5979
+ [`::slotted(${child}:disabled)`]: {
5980
+ cursor: 'not-allowed',
5981
+ color: disabledColor,
5982
+ borderColor: disabledColor,
5983
+ WebkitTextFillColor: disabledColor,
5984
+ ...prefersColorSchemeDarkMediaQuery(theme, {
5985
+ color: disabledColorDark,
5986
+ borderColor: disabledColorDark,
5987
+ WebkitTextFillColor: disabledColorDark,
5988
+ }),
5989
+ },
5990
+ ...(child !== 'select' && {
5991
+ [`::slotted(${child}[readonly])`]: {
5992
+ borderColor: contrastLowColor,
5993
+ background: contrastLowColor,
5994
+ ...prefersColorSchemeDarkMediaQuery(theme, {
5995
+ borderColor: contrastLowColorDark,
5996
+ background: contrastLowColorDark,
5997
+ }),
5998
+ },
5999
+ }),
6000
+ };
6001
+ };
6002
+ const formElementLayeredGap = '9px'; // to have same distance vertically and horizontally for e.g. button/icon within form element
6003
+ const formElementLayeredSafeZone = `calc(${formElementLayeredGap} + ${borderWidthBase})`;
6004
+ // TODO: basic button/icon padding can already be set within style function instead of on component style level
6005
+ const formButtonOrIconPadding = spacingStaticXSmall;
6006
+ // TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
6007
+ // unfortunately line-height alignment breaks for a select element for some reasons then
6008
+ // TODO: basic form element padding can already be set within style function instead of on component style level
6009
+ const formElementPaddingVertical = spacingStaticSmall;
6010
+ // TODO: basic form element padding can already be set within style function instead of on component style level
6011
+ const formElementPaddingHorizontal = spacingStaticMedium;
6012
+ const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
6013
+ // when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
6014
+ return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
6015
+ };
6016
+ // TODO: re-use in textarea-wrapper not only in text-field-wrapper
6017
+ const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
6018
+ const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
6019
+ const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
6020
+ return {
6021
+ pointerEvents: 'none',
6022
+ maxWidth: '100%',
6023
+ boxSizing: 'border-box',
6024
+ whiteSpace: 'nowrap',
6025
+ overflow: 'hidden',
6026
+ textOverflow: 'ellipsis',
6027
+ font: textSmallStyle.font,
6028
+ color: contrastMediumColor,
6029
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6030
+ color: contrastMediumColorDark,
6031
+ }),
6032
+ ...(isDisabled && {
6033
+ color: disabledColor,
6034
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6035
+ color: disabledColorDark,
6036
+ }),
6037
+ }),
6038
+ ...(isReadonly && {
6039
+ color: contrastHighColor,
6040
+ }),
6041
+ };
6042
+ };
6043
+
6044
+ const cssVarInternalInputBaseScaling = '--p-internal-input-base-scaling';
6045
+ // Determines the scaling factor for the input-number size. In "compact" mode, it uses 0.5 to achieve a 36px input-number (compact size).
6046
+ // Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputBaseScaling`.
6047
+ const getScalingVar = (compact) => `var(${cssVarInternalInputBaseScaling}, ${compact ? 0.5 : 1})`;
6048
+ /**
6049
+ * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
6050
+ */
6051
+ const cssVarButtonPurePadding = '--ref-p-input-slotted-padding';
6052
+ /**
6053
+ * @css-variable {"name": "--ref-p-input-slotted-margin", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly."}
6054
+ */
6055
+ const cssVarButtonPureMargin = '--ref-p-input-slotted-margin';
6056
+ const getFunctionalComponentInputBaseStyles = (disabled, loading, hideLabel, state, compact, readOnly, theme, additionalInputJssStyle) => {
6057
+ const scalingVar = getScalingVar(compact);
6058
+ const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
6059
+ const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
6060
+ const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
6061
+ const gap = `max(4px, calc(${spacingStaticMedium} * ${scalingVar}))`;
6062
+ // This will return 0 for <= 0.5, ~4 for 1 and ~8 for 2 scaling...
6063
+ const buttonCompensation = `clamp(0, 6.42 * pow(calc(${scalingVar} - 0.5), 0.6826), 12)`;
6064
+ const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
6065
+ const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
6066
+ const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
6067
+ const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
6068
+ const hoverStyles = {
6069
+ borderColor: formStateHoverColor || primaryColor,
6070
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6071
+ borderColor: formStateHoverColorDark || primaryColorDark,
6072
+ }),
6073
+ };
6074
+ return {
6075
+ '@global': {
6076
+ ':host': {
6077
+ display: 'block',
6078
+ ...addImportantToEachRule({
6079
+ ...colorSchemeStyles,
6080
+ ...hostHiddenStyles,
6081
+ [`${cssVarButtonPurePadding}`]: `calc(1px * ${buttonCompensation})`,
6082
+ [`${cssVarButtonPureMargin}`]: `calc(-1px * ${buttonCompensation})`,
6083
+ }),
6084
+ },
6085
+ ...preventFoucOfNestedElementsStyles,
6086
+ input: {
6087
+ all: 'unset',
6088
+ flex: 1,
6089
+ font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is aligned with how Safari visualize date/time input highlighting
6090
+ height,
6091
+ paddingBlock,
6092
+ color: primaryColor,
6093
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6094
+ color: primaryColorDark,
6095
+ }),
6096
+ width: '100%',
6097
+ minWidth: '2rem',
6098
+ ...(disabled && {
6099
+ color: disabledColor,
6100
+ WebkitTextFillColor: disabledColor,
6101
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6102
+ color: disabledColorDark,
6103
+ WebkitTextFillColor: disabledColorDark,
6104
+ }),
6105
+ }),
6106
+ ...additionalInputJssStyle,
6107
+ },
6108
+ },
6109
+ root: {
6110
+ display: 'grid',
6111
+ gap: spacingStaticXSmall,
6112
+ },
6113
+ wrapper: {
6114
+ border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
6115
+ borderRadius: borderRadiusSmall,
6116
+ paddingInline,
6117
+ display: 'flex',
6118
+ alignItems: 'center',
6119
+ gap,
6120
+ transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
6121
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6122
+ borderColor: formStateColorDark || contrastMediumColorDark,
6123
+ }),
6124
+ ...(!disabled && {
6125
+ '&:has(input:focus)': {
6126
+ borderColor: primaryColor,
6127
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6128
+ borderColor: primaryColorDark,
6129
+ }),
6130
+ },
6131
+ }),
6132
+ ...(!disabled &&
6133
+ !readOnly &&
6134
+ hoverMediaQuery({
6135
+ '&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
6136
+ })),
6137
+ ...(disabled && {
6138
+ cursor: 'not-allowed',
6139
+ borderColor: disabledColor,
6140
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6141
+ borderColor: disabledColorDark,
6142
+ }),
6143
+ }),
6144
+ ...(readOnly && {
6145
+ cursor: 'text',
6146
+ borderColor: contrastLowColor,
6147
+ background: contrastLowColor,
6148
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6149
+ borderColor: contrastLowColorDark,
6150
+ background: contrastLowColorDark,
6151
+ }),
6152
+ }),
6153
+ },
6154
+ ...(loading && {
6155
+ spinner: {
6156
+ font: textSmallStyle.font,
6157
+ width: fontLineHeight,
6158
+ height: fontLineHeight,
6159
+ },
6160
+ }),
6161
+ // .label / .required
6162
+ ...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
6163
+ !readOnly &&
6164
+ hoverMediaQuery({
6165
+ '&:hover~.wrapper': hoverStyles,
6166
+ })),
6167
+ // .message
6168
+ ...getFunctionalComponentStateMessageStyles(theme, state),
6169
+ // .loading
6170
+ ...getFunctionalComponentLoadingMessageStyles(),
6171
+ };
6172
+ };
6173
+
5929
6174
  const widthMap = {
5930
6175
  narrow: gridNarrowOffset,
5931
6176
  basic: gridBasicOffset,
5932
6177
  extended: gridExtendedOffset,
5933
6178
  };
5934
- const getComponentCss$12 = (width) => {
6179
+ const getComponentCss$15 = (width) => {
5935
6180
  return getCss({
5936
6181
  '@global': {
5937
6182
  ':host': {
@@ -5973,7 +6218,7 @@ const getDimensionStyle = {
5973
6218
  width: 'inherit',
5974
6219
  height: 'inherit',
5975
6220
  };
5976
- const getComponentCss$11 = () => {
6221
+ const getComponentCss$14 = () => {
5977
6222
  return getCss({
5978
6223
  '@global': {
5979
6224
  ':host': {
@@ -6072,7 +6317,7 @@ const sizeMap$4 = {
6072
6317
  medium: fontSizeDisplayMedium,
6073
6318
  large: fontSizeDisplayLarge,
6074
6319
  };
6075
- const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
6320
+ const getComponentCss$13 = (size, align, color, ellipsis, theme) => {
6076
6321
  return getCss({
6077
6322
  '@global': {
6078
6323
  ':host': {
@@ -6090,7 +6335,7 @@ const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
6090
6335
  });
6091
6336
  };
6092
6337
 
6093
- const getComponentCss$$ = (color, orientation, theme) => {
6338
+ const getComponentCss$12 = (color, orientation, theme) => {
6094
6339
  const { contrastLowColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
6095
6340
  const { contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, } = getThemedColors('dark');
6096
6341
  const colorMap = {
@@ -6151,7 +6396,7 @@ const easingOpen = 'in';
6151
6396
  const dialogDurationClose = 'short';
6152
6397
  const backdropDurationClose = 'moderate';
6153
6398
  const easingClose = 'out';
6154
- const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
6399
+ const getComponentCss$11 = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
6155
6400
  const { primaryColor, backgroundColor, backgroundSurfaceColor, backgroundShadingColor } = getThemedColors(theme);
6156
6401
  const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, backgroundShadingColor: backgroundShadingColorDark, } = getThemedColors('dark');
6157
6402
  return getCss({
@@ -6398,7 +6643,7 @@ const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme)
6398
6643
  });
6399
6644
  };
6400
6645
 
6401
- const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
6646
+ const getComponentCss$10 = (isPrimary, isSecondary, isCascade) => {
6402
6647
  return getCss({
6403
6648
  '@global': {
6404
6649
  '@keyframes slide-up-mobile': {
@@ -6629,7 +6874,7 @@ const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
6629
6874
  });
6630
6875
  };
6631
6876
 
6632
- const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
6877
+ const getComponentCss$$ = (hasSlottedAnchor, isActive) => {
6633
6878
  const anchorJssStyle = {
6634
6879
  all: 'unset',
6635
6880
  padding: `calc(${spacingFluidSmall} + 2px) calc(${spacingFluidSmall} + 4px)`, // aligned with link-pure
@@ -6681,7 +6926,7 @@ const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
6681
6926
  });
6682
6927
  };
6683
6928
 
6684
- const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
6929
+ const getComponentCss$_ = (state, labelSize, hasLabel, theme) => {
6685
6930
  return getCss({
6686
6931
  '@global': {
6687
6932
  ':host': {
@@ -6718,7 +6963,7 @@ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
6718
6963
  });
6719
6964
  };
6720
6965
 
6721
- const getComponentCss$W = (state, labelSize, hasLabel, theme) => {
6966
+ const getComponentCss$Z = (state, labelSize, hasLabel, theme) => {
6722
6967
  return getCss({
6723
6968
  '@global': {
6724
6969
  ':host': {
@@ -6765,7 +7010,7 @@ const flexItemWidths = {
6765
7010
  full: 100,
6766
7011
  auto: 'auto',
6767
7012
  };
6768
- const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
7013
+ const getComponentCss$Y = (width, offset, alignSelf, grow, shrink, flex) => {
6769
7014
  return getCss({
6770
7015
  '@global': {
6771
7016
  ':host': addImportantToEachRule({
@@ -6787,7 +7032,7 @@ const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
6787
7032
  });
6788
7033
  };
6789
7034
 
6790
- const getComponentCss$U = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
7035
+ const getComponentCss$X = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
6791
7036
  return getCss({
6792
7037
  '@global': {
6793
7038
  ':host': {
@@ -6904,10 +7149,9 @@ const getScrollerJssStyle = (position, theme) => {
6904
7149
  const dialogPaddingBlock = `calc(${spacingFluidSmall} + ${spacingFluidMedium})`;
6905
7150
  const dialogGridJssStyle = {
6906
7151
  display: 'grid',
6907
- gridTemplate: `auto/${spacingFluidSmall} auto ${spacingFluidSmall}`,
7152
+ gridTemplate: `auto/${spacingFluidSmall} minmax(0,1fr) ${spacingFluidSmall}`,
7153
+ gap: `${spacingFluidMedium} calc(${spacingFluidLarge} - ${spacingFluidSmall})`,
6908
7154
  paddingBlock: dialogPaddingBlock,
6909
- rowGap: spacingFluidMedium,
6910
- columnGap: `calc(${spacingFluidLarge} - ${spacingFluidSmall})`,
6911
7155
  alignContent: 'flex-start',
6912
7156
  };
6913
7157
  const getDialogColorJssStyle = (theme) => {
@@ -6975,9 +7219,17 @@ const getDialogStickyAreaJssStyle = (area, theme) => {
6975
7219
  * @css-variable {"name": "--p-flyout-width", "description": "Width of the flyout.", "defaultValue": "auto"}
6976
7220
  */
6977
7221
  const cssVariableWidth$2 = '--p-flyout-width';
7222
+ /**
7223
+ * @css-variable {"name": "--ref-p-flyout-pt", "description": "Exposes the internally used padding-top of the Flyout as read only CSS variable. When slotting e.g. a media container, this variable can be used to stretch the element to the top of the Flyout."}
7224
+ */
7225
+ const cssVarRefPaddingTop = '--ref-p-flyout-pt';
7226
+ /**
7227
+ * @css-variable {"name": "--ref-p-flyout-px", "description": "Exposes the internally used padding-inline of the Flyout as read only CSS variable. When slotting e.g. a media container, this variable can be used to stretch the element to the full horizontal size of the Flyout."}
7228
+ */
7229
+ const cssVarRefPaddingInline = '--ref-p-flyout-px';
6978
7230
  // TODO: we shouldn't expose --p-flyout-max-width
6979
7231
  const cssVariableMaxWidth = '--p-flyout-max-width';
6980
- const getComponentCss$T = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
7232
+ const getComponentCss$W = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
6981
7233
  const isPositionStart = position === 'start' || position === 'left';
6982
7234
  const isFooterFixed = footerBehavior === 'fixed';
6983
7235
  return getCss({
@@ -6988,6 +7240,8 @@ const getComponentCss$T = (isOpen, position, hasHeader, hasFooter, hasSubFooter,
6988
7240
  ...dialogHostJssStyle,
6989
7241
  ...colorSchemeStyles,
6990
7242
  ...hostHiddenStyles,
7243
+ [`${cssVarRefPaddingTop}`]: dialogPaddingBlock,
7244
+ [`${cssVarRefPaddingInline}`]: spacingFluidLarge,
6991
7245
  }),
6992
7246
  },
6993
7247
  ...preventFoucOfNestedElementsStyles,
@@ -7087,7 +7341,7 @@ const gutter$1 = `calc(${gridGap} / 2)`;
7087
7341
  const gridItemWidths = [
7088
7342
  0, 8.333333, 16.666667, 25, 33.333333, 41.666667, 50, 58.333333, 66.666667, 75, 83.333333, 91.666667, 100,
7089
7343
  ];
7090
- const getComponentCss$S = (size, offset) => {
7344
+ const getComponentCss$V = (size, offset) => {
7091
7345
  return getCss({
7092
7346
  '@global': {
7093
7347
  ':host': addImportantToEachRule({
@@ -7107,7 +7361,7 @@ const getComponentCss$S = (size, offset) => {
7107
7361
  };
7108
7362
 
7109
7363
  const gutter = `calc(${gridGap} / -2)`;
7110
- const getComponentCss$R = (direction, wrap) => {
7364
+ const getComponentCss$U = (direction, wrap) => {
7111
7365
  return getCss({
7112
7366
  '@global': {
7113
7367
  ':host': {
@@ -7133,7 +7387,7 @@ const sizeMap$3 = {
7133
7387
  'x-large': fontSizeHeadingXLarge,
7134
7388
  'xx-large': fontSizeHeadingXXLarge,
7135
7389
  };
7136
- const getComponentCss$Q = (size, align, color, ellipsis, theme) => {
7390
+ const getComponentCss$T = (size, align, color, ellipsis, theme) => {
7137
7391
  return getCss({
7138
7392
  '@global': {
7139
7393
  ':host': {
@@ -7193,7 +7447,7 @@ const getTextSizeJssStyle = (textSize) => {
7193
7447
  fontSize: textSize === 'inherit' ? textSize : textSizeMap[textSize],
7194
7448
  };
7195
7449
  };
7196
- const getComponentCss$P = (variant, align, color, ellipsis, theme) => {
7450
+ const getComponentCss$S = (variant, align, color, ellipsis, theme) => {
7197
7451
  return getCss({
7198
7452
  '@global': {
7199
7453
  ':host': {
@@ -7304,7 +7558,7 @@ const isFlippableIcon = (name, source) => {
7304
7558
  name === 'return' ||
7305
7559
  name === 'send'));
7306
7560
  };
7307
- const getComponentCss$O = (name, source, color, size, theme) => {
7561
+ const getComponentCss$R = (name, source, color, size, theme) => {
7308
7562
  const isColorInherit = color === 'inherit';
7309
7563
  const isSizeInherit = size === 'inherit';
7310
7564
  const isDark = isThemeDark(theme);
@@ -7423,7 +7677,7 @@ const getHeadingJssStyle = (theme) => ({
7423
7677
  ...headingSmallStyle,
7424
7678
  ...getTextJssStyle(theme),
7425
7679
  });
7426
- const getComponentCss$N = (state, hasAction, hasClose, theme) => {
7680
+ const getComponentCss$Q = (state, hasAction, hasClose, theme) => {
7427
7681
  return getCss({
7428
7682
  '@global': {
7429
7683
  ':host': {
@@ -7463,231 +7717,101 @@ const getComponentCss$N = (state, hasAction, hasClose, theme) => {
7463
7717
  });
7464
7718
  };
7465
7719
 
7466
- const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme, additionalDefaultJssStyle) => {
7467
- const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
7468
- const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
7469
- const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
7470
- const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
7471
- return {
7472
- [`::slotted(${child})`]: {
7473
- display: 'block',
7474
- width: '100%',
7475
- height: child !== 'textarea'
7476
- ? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
7477
- : 'auto',
7478
- margin: 0,
7479
- outline: 0,
7480
- WebkitAppearance: 'none', // iOS safari
7481
- appearance: 'none',
7482
- boxSizing: 'border-box',
7483
- border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
7484
- borderRadius: borderRadiusSmall,
7485
- background: 'transparent',
7486
- font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is aligned with how Safari visualize date/time input highlighting
7487
- textIndent: 0,
7488
- color: primaryColor,
7489
- transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
7490
- ...prefersColorSchemeDarkMediaQuery(theme, {
7491
- borderColor: formStateColorDark || contrastMediumColorDark,
7492
- color: primaryColorDark,
7493
- }),
7494
- ...additionalDefaultJssStyle,
7495
- },
7496
- '::slotted(:not(input[type="password"]))': {
7720
+ // CSS Variables defined in base input
7721
+ /**
7722
+ * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
7723
+ */
7724
+ /**
7725
+ * @css-variable {"name": "--ref-p-input-slotted-margin", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly."}
7726
+ */
7727
+ const getComponentCss$P = (disabled, loading, hideLabel, state, compact, readOnly, theme, controls) => {
7728
+ return getCss({
7729
+ ...getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, theme, {
7497
7730
  textOverflow: 'ellipsis',
7498
- },
7499
- ...(!isLoading &&
7500
- hoverMediaQuery({
7501
- // with the media query the selector has higher priority and overrides disabled styles
7502
- [`::slotted(${child}:not(:disabled):not(:focus):not([readonly]):hover),label:hover~.wrapper ::slotted(${child}:not(:disabled):not(:focus):not([readonly]))${child === 'select' ? ',label:hover~.wrapper ::part(select-wrapper-dropdown)' : ''}`]: {
7503
- borderColor: formStateHoverColor || primaryColor,
7504
- ...prefersColorSchemeDarkMediaQuery(theme, {
7505
- borderColor: formStateHoverColorDark || primaryColorDark,
7506
- }),
7507
- },
7508
- })),
7509
- // TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
7510
- [`::slotted(${child}:focus)`]: {
7511
- borderColor: primaryColor,
7512
- ...prefersColorSchemeDarkMediaQuery(theme, {
7513
- borderColor: primaryColorDark,
7514
- }),
7515
- },
7516
- [`::slotted(${child}:disabled)`]: {
7517
- cursor: 'not-allowed',
7518
- color: disabledColor,
7519
- borderColor: disabledColor,
7520
- WebkitTextFillColor: disabledColor,
7521
- ...prefersColorSchemeDarkMediaQuery(theme, {
7522
- color: disabledColorDark,
7523
- borderColor: disabledColorDark,
7524
- WebkitTextFillColor: disabledColorDark,
7525
- }),
7526
- },
7527
- ...(child !== 'select' && {
7528
- [`::slotted(${child}[readonly])`]: {
7529
- borderColor: contrastLowColor,
7530
- background: contrastLowColor,
7531
- ...prefersColorSchemeDarkMediaQuery(theme, {
7532
- borderColor: contrastLowColorDark,
7533
- background: contrastLowColorDark,
7534
- }),
7731
+ MozAppearance: 'textfield',
7732
+ '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
7733
+ WebkitAppearance: 'none',
7535
7734
  },
7536
7735
  }),
7537
- };
7538
- };
7539
- const formElementLayeredGap = '9px'; // to have same distance vertically and horizontally for e.g. button/icon within form element
7540
- const formElementLayeredSafeZone = `calc(${formElementLayeredGap} + ${borderWidthBase})`;
7541
- // TODO: basic button/icon padding can already be set within style function instead of on component style level
7542
- const formButtonOrIconPadding = spacingStaticXSmall;
7543
- // TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
7544
- // unfortunately line-height alignment breaks for a select element for some reasons then
7545
- // TODO: basic form element padding can already be set within style function instead of on component style level
7546
- const formElementPaddingVertical = spacingStaticSmall;
7547
- // TODO: basic form element padding can already be set within style function instead of on component style level
7548
- const formElementPaddingHorizontal = spacingStaticMedium;
7549
- const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
7550
- // when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
7551
- return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
7552
- };
7553
- // TODO: re-use in textarea-wrapper not only in text-field-wrapper
7554
- const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
7555
- const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
7556
- const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
7557
- return {
7558
- pointerEvents: 'none',
7559
- maxWidth: '100%',
7560
- boxSizing: 'border-box',
7561
- whiteSpace: 'nowrap',
7562
- overflow: 'hidden',
7563
- textOverflow: 'ellipsis',
7564
- font: textSmallStyle.font,
7565
- color: contrastMediumColor,
7566
- ...prefersColorSchemeDarkMediaQuery(theme, {
7567
- color: contrastMediumColorDark,
7736
+ ...(controls && {
7737
+ button: {
7738
+ padding: `var(${cssVarButtonPurePadding})`,
7739
+ margin: `var(${cssVarButtonPureMargin})`,
7740
+ },
7568
7741
  }),
7569
- ...(isDisabled && {
7570
- color: disabledColor,
7571
- ...prefersColorSchemeDarkMediaQuery(theme, {
7572
- color: disabledColorDark,
7573
- }),
7742
+ });
7743
+ };
7744
+
7745
+ // CSS Variables defined in base input
7746
+ /**
7747
+ * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
7748
+ */
7749
+ /**
7750
+ * @css-variable {"name": "--ref-p-input-slotted-margin", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly."}
7751
+ */
7752
+ const getComponentCss$O = (disabled, loading, hideLabel, state, toggle, compact, readOnly, theme) => {
7753
+ return getCss({
7754
+ ...getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, theme, {
7755
+ '&[type="text"]': {
7756
+ textOverflow: 'ellipsis',
7757
+ },
7574
7758
  }),
7575
- ...(isReadonly && {
7576
- color: contrastHighColor,
7759
+ ...(toggle && {
7760
+ button: {
7761
+ padding: `var(${cssVarButtonPurePadding})`,
7762
+ margin: `var(${cssVarButtonPureMargin})`,
7763
+ },
7577
7764
  }),
7578
- };
7765
+ });
7579
7766
  };
7580
7767
 
7581
- const cssVarInternalInputPasswordScaling = '--p-internal-input-password-scaling';
7582
- const getComponentCss$M = (disabled, hideLabel, state, toggle, compact, readOnly, theme) => {
7583
- // Determines the scaling factor for the input-password size. In "compact" mode, it uses 0.5 to achieve a 36px input-password (compact size).
7584
- // Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputPasswordScaling`.
7585
- const scalingVar = `var(${cssVarInternalInputPasswordScaling}, ${compact ? 0.5 : 1})`;
7586
- const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
7587
- const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
7588
- // TODO: Ideally, 'compact' should only influence the calculation of scalingVar,
7589
- // ensuring that the paddingButton calculation solely depends on the scaling factor.
7590
- const paddingButton = compact ? '0px' : `calc(${formButtonOrIconPadding} * ${scalingVar})`;
7591
- const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
7592
- const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
7593
- const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
7594
- const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
7595
- const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
7596
- const hoverStyles = {
7597
- borderColor: formStateHoverColor || primaryColor,
7598
- ...prefersColorSchemeDarkMediaQuery(theme, {
7599
- borderColor: formStateHoverColorDark || primaryColorDark,
7600
- }),
7601
- };
7768
+ // CSS Variables defined in base input
7769
+ /**
7770
+ * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
7771
+ */
7772
+ /**
7773
+ * @css-variable {"name": "--ref-p-input-slotted-margin", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly."}
7774
+ */
7775
+ const getComponentCss$N = (disabled, loading, hideLabel, state, compact, readOnly, theme, clear) => {
7602
7776
  return getCss({
7603
- '@global': {
7604
- ':host': {
7605
- display: 'block',
7606
- ...addImportantToEachRule({
7607
- ...colorSchemeStyles,
7608
- ...hostHiddenStyles,
7609
- }),
7777
+ ...getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, theme, {
7778
+ textOverflow: 'ellipsis',
7779
+ '&[type="search"]::-webkit-search-cancel-button': {
7780
+ display: 'none',
7610
7781
  },
7611
- ...preventFoucOfNestedElementsStyles,
7612
- input: {
7613
- all: 'unset',
7614
- flex: 1,
7615
- font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is aligned with how Safari visualize date/time input highlighting
7616
- height,
7617
- paddingBlock,
7618
- textIndent: 0,
7619
- color: primaryColor,
7620
- ...prefersColorSchemeDarkMediaQuery(theme, {
7621
- color: primaryColorDark,
7622
- }),
7623
- width: '100%',
7624
- minWidth: '2rem',
7625
- '&[type="text"]': {
7626
- textOverflow: 'ellipsis',
7627
- },
7782
+ }),
7783
+ ...(clear && {
7784
+ button: {
7785
+ padding: `var(${cssVarButtonPurePadding})`,
7786
+ margin: `var(${cssVarButtonPureMargin})`,
7628
7787
  },
7629
- },
7630
- root: {
7631
- display: 'grid',
7632
- gap: spacingStaticXSmall,
7633
- },
7634
- wrapper: {
7635
- border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
7636
- borderRadius: borderRadiusSmall,
7637
- paddingInlineStart: paddingInline,
7638
- paddingInlineEnd: toggle ? paddingBlock : paddingInline, // TODO resolve inconsistency in Figma
7639
- display: 'flex',
7640
- gap: formElementLayeredGap,
7641
- transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
7642
- ...prefersColorSchemeDarkMediaQuery(theme, {
7643
- borderColor: formStateColorDark || contrastMediumColorDark,
7644
- }),
7645
- '&:has(input:focus:not([readonly]))': {
7646
- borderColor: primaryColor,
7647
- ...prefersColorSchemeDarkMediaQuery(theme, {
7648
- borderColor: primaryColorDark,
7649
- }),
7788
+ }),
7789
+ });
7790
+ };
7791
+
7792
+ // CSS Variables defined in base input
7793
+ /**
7794
+ * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
7795
+ */
7796
+ /**
7797
+ * @css-variable {"name": "--ref-p-input-slotted-margin", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly."}
7798
+ */
7799
+ const getComponentCss$M = (disabled, loading, hideLabel, state, compact, readOnly, theme, counter) => {
7800
+ return getCss({
7801
+ ...getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, theme, {
7802
+ textOverflow: 'ellipsis',
7803
+ MozAppearance: 'textfield',
7804
+ '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
7805
+ WebkitAppearance: 'none',
7650
7806
  },
7651
- ...(!disabled &&
7652
- !readOnly &&
7653
- hoverMediaQuery({
7654
- '&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
7655
- })),
7656
- ...(disabled && {
7657
- cursor: 'not-allowed',
7658
- color: disabledColor,
7659
- borderColor: disabledColor,
7660
- WebkitTextFillColor: disabledColor,
7661
- ...prefersColorSchemeDarkMediaQuery(theme, {
7662
- color: disabledColorDark,
7663
- borderColor: disabledColorDark,
7664
- WebkitTextFillColor: disabledColorDark,
7665
- }),
7666
- }),
7667
- ...(readOnly && {
7807
+ }),
7808
+ ...(counter && {
7809
+ counter: {
7810
+ ...getUnitCounterJssStyle(disabled, readOnly, theme),
7668
7811
  cursor: 'text',
7669
- borderColor: contrastLowColor,
7670
- background: contrastLowColor,
7671
- ...prefersColorSchemeDarkMediaQuery(theme, {
7672
- borderColor: contrastLowColorDark,
7673
- background: contrastLowColorDark,
7674
- }),
7675
- }),
7676
- },
7677
- ...(toggle && {
7678
- button: {
7679
- placeSelf: 'center',
7680
- padding: paddingButton, // TODO resolve inconsistency in Figma
7681
7812
  },
7682
7813
  }),
7683
- // .label / .required
7684
- ...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
7685
- !readOnly &&
7686
- hoverMediaQuery({
7687
- '&:hover~.wrapper': hoverStyles,
7688
- })),
7689
- // .message
7690
- ...getFunctionalComponentStateMessageStyles(theme, state),
7814
+ 'sr-only': getHiddenTextJssStyle(),
7691
7815
  });
7692
7816
  };
7693
7817
 
@@ -9751,7 +9875,8 @@ const getComponentCss$r = (theme) => {
9751
9875
  },
9752
9876
  ...addImportantToEachRule({
9753
9877
  ':host': {
9754
- scrollMargin: '6px', // Aligns option when list is scrolled by navigating with keyboard
9878
+ scrollMarginBlockStart: `calc(max(2px, var(${cssVarInternalSelectOptionScaling}, 1) * 6px) + 36px)`, // 36px input height + 6px padding
9879
+ scrollMarginBlockEnd: `max(2px, var(${cssVarInternalSelectOptionScaling}, 1) * 6px)`, // Aligns option when list is scrolled by navigating with keyboard
9755
9880
  ...hostHiddenStyles,
9756
9881
  },
9757
9882
  '::slotted(img)': getButtonImageJssStyle,
@@ -9768,6 +9893,8 @@ const getComponentCss$r = (theme) => {
9768
9893
  const cssVarInternalSelectScaling = '--p-internal-select-scaling';
9769
9894
  const getComponentCss$q = (isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
9770
9895
  const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
9896
+ const { contrastMediumColor: contrastMediumColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark } = getThemedColors('dark');
9897
+ const { contrastMediumColor, backgroundColor, backgroundSurfaceColor } = getThemedColors(theme);
9771
9898
  return getCss({
9772
9899
  '@global': {
9773
9900
  // @keyframes fade-in
@@ -9797,6 +9924,29 @@ const getComponentCss$q = (isOpen, isDisabled, hideLabel, state, compact, theme,
9797
9924
  // min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character plus the ellipsis dots.
9798
9925
  minWidth: `calc(1rem + ${formElementPaddingHorizontal} + ${borderWidthBase} * 2 + ${getCalculatedFormElementPaddingHorizontal(1)})`,
9799
9926
  },
9927
+ filter: {
9928
+ position: 'sticky',
9929
+ top: `calc(max(2px, ${scalingVar} * 6px) * -1)`,
9930
+ padding: `max(2px, ${scalingVar} * 6px)`,
9931
+ margin: `calc(max(2px, ${scalingVar} * 6px) * -1)`,
9932
+ background: isThemeDark(theme) ? backgroundSurfaceColor : backgroundColor,
9933
+ ...prefersColorSchemeDarkMediaQuery(theme, {
9934
+ background: backgroundSurfaceColorDark,
9935
+ }),
9936
+ zIndex: 1,
9937
+ },
9938
+ options: {
9939
+ display: 'flex',
9940
+ flexDirection: 'column',
9941
+ gap: `max(2px, ${scalingVar} * ${spacingStaticSmall})`,
9942
+ },
9943
+ 'no-results': {
9944
+ ...getOptionJssStyle('select-option', scalingVar, theme),
9945
+ color: contrastMediumColor,
9946
+ ...prefersColorSchemeDarkMediaQuery(theme, {
9947
+ color: contrastMediumColorDark,
9948
+ }),
9949
+ },
9800
9950
  icon: getIconJssStyle('select', isOpen),
9801
9951
  'sr-only': getHiddenTextJssStyle(),
9802
9952
  // .label / .required
@@ -11347,4 +11497,4 @@ const getComponentCss = (size, theme) => {
11347
11497
  });
11348
11498
  };
11349
11499
 
11350
- export { getComponentCss$1c as getAccordionCss, getComponentCss$1b as getBannerCss, getComponentCss$17 as getButtonCss, getComponentCss$1a as getButtonGroupCss, getComponentCss$19 as getButtonPureCss, getComponentCss$18 as getButtonTileCss, getComponentCss$16 as getCanvasCss, getComponentCss$15 as getCarouselCss, getComponentCss$13 as getCheckboxCss, getComponentCss$14 as getCheckboxWrapperCss, getComponentCss$12 as getContentWrapperCss, getComponentCss$11 as getCrestCss, getComponentCss$10 as getDisplayCss, getComponentCss$$ as getDividerCss, getComponentCss$_ as getDrilldownCss, getComponentCss$Z as getDrilldownItemCss, getComponentCss$Y as getDrilldownLinkCss, getComponentCss$W as getFieldsetCss, getComponentCss$X as getFieldsetWrapperCss, getComponentCss$U as getFlexCss, getComponentCss$V as getFlexItemCss, getComponentCss$T as getFlyoutCss, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$R as getGridCss, getComponentCss$S as getGridItemCss, getComponentCss$Q as getHeadingCss, getComponentCss$P as getHeadlineCss, getComponentCss$O as getIconCss, getComponentCss$N as getInlineNotificationCss, getComponentCss$M as getInputPasswordCss, getComponentCss$K as getLinkCss, getComponentCss$L as getLinkPureCss, getComponentCss$K as getLinkSocialCss, getComponentCss$H as getLinkTileCss, getComponentCss$J as getLinkTileModelSignatureCss, getComponentCss$I as getLinkTileProductCss, getComponentCss$G as getMarqueCss, getComponentCss$F as getModalCss, getComponentCss$E as getModelSignatureCss, getComponentCss$C as getMultiSelectCss, getComponentCss$D as getMultiSelectOptionCss, getComponentCss$B as getOptgroupCss, getComponentCss$A as getPaginationCss, getComponentCss$z as getPinCodeCss, getComponentCss$y as getPopoverCss, getComponentCss$x as getRadioButtonWrapperCss, getComponentCss$w as getScrollerCss, getComponentCss$u as getSegmentedControlCss, getComponentCss$v as getSegmentedControlItemCss, getComponentCss$q as getSelectCss, getComponentCss$r as getSelectOptionCss, getComponentCss$s as getSelectWrapperCss, getComponentCss$t as getSelectWrapperDropdownCss, getComponentCss$p as getSheetCss, getComponentCss$o as getSpinnerCss, getComponentCss$m as getStepperHorizontalCss, getComponentCss$n as getStepperHorizontalItemCss, getComponentCss$l as getSwitchCss, getComponentCss$k as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$j as getTableCss, getComponentCss$h as getTableHeadCellCss, getComponentCss$f as getTableHeadCss, getComponentCss$g as getTableHeadRowCss, getComponentCss$e as getTableRowCss, getComponentCss$d as getTabsBarCss, getComponentCss$b as getTabsCss, getComponentCss$c as getTabsItemCss, getComponentCss$9 as getTagCss, getComponentCss$a as getTagDismissibleCss, getComponentCss$5 as getTextCss, getComponentCss$8 as getTextFieldWrapperCss, getComponentCss$7 as getTextListCss, getComponentCss$6 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$4 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
11500
+ export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, getComponentCss$1f as getAccordionCss, getComponentCss$1e as getBannerCss, getComponentCss$1a as getButtonCss, getComponentCss$1d as getButtonGroupCss, getComponentCss$1c as getButtonPureCss, getComponentCss$1b as getButtonTileCss, getComponentCss$19 as getCanvasCss, getComponentCss$18 as getCarouselCss, getComponentCss$16 as getCheckboxCss, getComponentCss$17 as getCheckboxWrapperCss, getComponentCss$15 as getContentWrapperCss, getComponentCss$14 as getCrestCss, getComponentCss$13 as getDisplayCss, getComponentCss$12 as getDividerCss, getComponentCss$11 as getDrilldownCss, getComponentCss$10 as getDrilldownItemCss, getComponentCss$$ as getDrilldownLinkCss, getComponentCss$Z as getFieldsetCss, getComponentCss$_ as getFieldsetWrapperCss, getComponentCss$X as getFlexCss, getComponentCss$Y as getFlexItemCss, getComponentCss$W as getFlyoutCss, getFunctionalComponentInputBaseStyles, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$U as getGridCss, getComponentCss$V as getGridItemCss, getComponentCss$T as getHeadingCss, getComponentCss$S as getHeadlineCss, getComponentCss$R as getIconCss, getComponentCss$Q as getInlineNotificationCss, getComponentCss$P as getInputNumberCss, getComponentCss$O as getInputPasswordCss, getComponentCss$N as getInputSearchCss, getComponentCss$M as getInputTextCss, getComponentCss$K as getLinkCss, getComponentCss$L as getLinkPureCss, getComponentCss$K as getLinkSocialCss, getComponentCss$H as getLinkTileCss, getComponentCss$J as getLinkTileModelSignatureCss, getComponentCss$I as getLinkTileProductCss, getComponentCss$G as getMarqueCss, getComponentCss$F as getModalCss, getComponentCss$E as getModelSignatureCss, getComponentCss$C as getMultiSelectCss, getComponentCss$D as getMultiSelectOptionCss, getComponentCss$B as getOptgroupCss, getComponentCss$A as getPaginationCss, getComponentCss$z as getPinCodeCss, getComponentCss$y as getPopoverCss, getComponentCss$x as getRadioButtonWrapperCss, getScalingVar, getComponentCss$w as getScrollerCss, getComponentCss$u as getSegmentedControlCss, getComponentCss$v as getSegmentedControlItemCss, getComponentCss$q as getSelectCss, getComponentCss$r as getSelectOptionCss, getComponentCss$s as getSelectWrapperCss, getComponentCss$t as getSelectWrapperDropdownCss, getComponentCss$p as getSheetCss, getComponentCss$o as getSpinnerCss, getComponentCss$m as getStepperHorizontalCss, getComponentCss$n as getStepperHorizontalItemCss, getComponentCss$l as getSwitchCss, getComponentCss$k as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$j as getTableCss, getComponentCss$h as getTableHeadCellCss, getComponentCss$f as getTableHeadCss, getComponentCss$g as getTableHeadRowCss, getComponentCss$e as getTableRowCss, getComponentCss$d as getTabsBarCss, getComponentCss$b as getTabsCss, getComponentCss$c as getTabsItemCss, getComponentCss$9 as getTagCss, getComponentCss$a as getTagDismissibleCss, getComponentCss$5 as getTextCss, getComponentCss$8 as getTextFieldWrapperCss, getComponentCss$7 as getTextListCss, getComponentCss$6 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$4 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };