@porsche-design-system/components-react 3.28.0-rc.3 → 3.28.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 (70) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cjs/lib/components/input-number.wrapper.cjs +29 -0
  3. package/cjs/public-api.cjs +2 -0
  4. package/esm/lib/components/index.d.ts +1 -0
  5. package/esm/lib/components/input-number.wrapper.d.ts +184 -0
  6. package/esm/lib/components/input-number.wrapper.mjs +27 -0
  7. package/esm/lib/types.d.ts +12 -2
  8. package/esm/public-api.mjs +1 -0
  9. package/package.json +3 -3
  10. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +324 -268
  11. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +0 -9
  12. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +40 -0
  13. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs +1 -1
  14. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +22 -0
  15. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +42 -0
  16. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +8 -9
  17. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +10 -3
  18. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -3
  19. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +6 -5
  20. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -4
  21. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +2 -0
  22. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +291 -241
  23. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -8
  24. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +38 -0
  25. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.mjs +1 -1
  26. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
  27. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +2 -2
  28. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.mjs +2 -2
  29. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -2
  30. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +2 -2
  31. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -2
  32. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -2
  33. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +2 -2
  34. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -2
  35. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
  36. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.mjs +2 -2
  37. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +2 -2
  38. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/display.mjs +2 -2
  39. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.mjs +2 -2
  40. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +2 -2
  41. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-link.mjs +2 -2
  42. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +2 -2
  43. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.mjs +2 -2
  44. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +2 -2
  45. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.mjs +2 -2
  46. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.mjs +2 -2
  47. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +2 -2
  48. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.mjs +2 -2
  49. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.mjs +2 -2
  50. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/heading.mjs +2 -2
  51. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.mjs +2 -2
  52. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +2 -2
  53. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +2 -2
  54. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +20 -0
  55. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +40 -0
  56. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +8 -9
  57. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +11 -4
  58. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -4
  59. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +6 -5
  60. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -4
  61. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +1 -0
  62. package/ssr/esm/lib/components/index.d.ts +1 -0
  63. package/ssr/esm/lib/components/input-number.wrapper.d.ts +184 -0
  64. package/ssr/esm/lib/dsr-components/input-base.d.ts +31 -0
  65. package/ssr/esm/lib/dsr-components/input-number.d.ts +18 -0
  66. package/ssr/esm/lib/dsr-components/input-password.d.ts +5 -3
  67. package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -1
  68. package/ssr/esm/lib/dsr-components/select.d.ts +0 -1
  69. package/ssr/esm/lib/types.d.ts +12 -2
  70. 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$1d = (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$1c = (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$1b = (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$1a = (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$19 = (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$18 = (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$17 = (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$16 = (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$15 = (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$14 = (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,242 @@ 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, 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
+ ...additionalInputJssStyle,
6099
+ },
6100
+ },
6101
+ root: {
6102
+ display: 'grid',
6103
+ gap: spacingStaticXSmall,
6104
+ },
6105
+ wrapper: {
6106
+ border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
6107
+ borderRadius: borderRadiusSmall,
6108
+ paddingInline,
6109
+ display: 'flex',
6110
+ alignItems: 'center',
6111
+ gap,
6112
+ transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
6113
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6114
+ borderColor: formStateColorDark || contrastMediumColorDark,
6115
+ }),
6116
+ '&:has(input:focus:not([readonly]))': {
6117
+ borderColor: primaryColor,
6118
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6119
+ borderColor: primaryColorDark,
6120
+ }),
6121
+ },
6122
+ ...(!disabled &&
6123
+ !readOnly &&
6124
+ hoverMediaQuery({
6125
+ '&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
6126
+ })),
6127
+ ...(disabled && {
6128
+ cursor: 'not-allowed',
6129
+ color: disabledColor,
6130
+ borderColor: disabledColor,
6131
+ WebkitTextFillColor: disabledColor,
6132
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6133
+ color: disabledColorDark,
6134
+ borderColor: disabledColorDark,
6135
+ WebkitTextFillColor: disabledColorDark,
6136
+ }),
6137
+ }),
6138
+ ...(readOnly && {
6139
+ cursor: 'text',
6140
+ borderColor: contrastLowColor,
6141
+ background: contrastLowColor,
6142
+ ...prefersColorSchemeDarkMediaQuery(theme, {
6143
+ borderColor: contrastLowColorDark,
6144
+ background: contrastLowColorDark,
6145
+ }),
6146
+ }),
6147
+ },
6148
+ // .label / .required
6149
+ ...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
6150
+ !readOnly &&
6151
+ hoverMediaQuery({
6152
+ '&:hover~.wrapper': hoverStyles,
6153
+ })),
6154
+ // .message
6155
+ ...getFunctionalComponentStateMessageStyles(theme, state),
6156
+ };
6157
+ };
6158
+
5929
6159
  const widthMap = {
5930
6160
  narrow: gridNarrowOffset,
5931
6161
  basic: gridBasicOffset,
5932
6162
  extended: gridExtendedOffset,
5933
6163
  };
5934
- const getComponentCss$12 = (width) => {
6164
+ const getComponentCss$13 = (width) => {
5935
6165
  return getCss({
5936
6166
  '@global': {
5937
6167
  ':host': {
@@ -5973,7 +6203,7 @@ const getDimensionStyle = {
5973
6203
  width: 'inherit',
5974
6204
  height: 'inherit',
5975
6205
  };
5976
- const getComponentCss$11 = () => {
6206
+ const getComponentCss$12 = () => {
5977
6207
  return getCss({
5978
6208
  '@global': {
5979
6209
  ':host': {
@@ -6072,7 +6302,7 @@ const sizeMap$4 = {
6072
6302
  medium: fontSizeDisplayMedium,
6073
6303
  large: fontSizeDisplayLarge,
6074
6304
  };
6075
- const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
6305
+ const getComponentCss$11 = (size, align, color, ellipsis, theme) => {
6076
6306
  return getCss({
6077
6307
  '@global': {
6078
6308
  ':host': {
@@ -6090,7 +6320,7 @@ const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
6090
6320
  });
6091
6321
  };
6092
6322
 
6093
- const getComponentCss$$ = (color, orientation, theme) => {
6323
+ const getComponentCss$10 = (color, orientation, theme) => {
6094
6324
  const { contrastLowColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
6095
6325
  const { contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, } = getThemedColors('dark');
6096
6326
  const colorMap = {
@@ -6151,7 +6381,7 @@ const easingOpen = 'in';
6151
6381
  const dialogDurationClose = 'short';
6152
6382
  const backdropDurationClose = 'moderate';
6153
6383
  const easingClose = 'out';
6154
- const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
6384
+ const getComponentCss$$ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
6155
6385
  const { primaryColor, backgroundColor, backgroundSurfaceColor, backgroundShadingColor } = getThemedColors(theme);
6156
6386
  const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, backgroundShadingColor: backgroundShadingColorDark, } = getThemedColors('dark');
6157
6387
  return getCss({
@@ -6398,7 +6628,7 @@ const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme)
6398
6628
  });
6399
6629
  };
6400
6630
 
6401
- const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
6631
+ const getComponentCss$_ = (isPrimary, isSecondary, isCascade) => {
6402
6632
  return getCss({
6403
6633
  '@global': {
6404
6634
  '@keyframes slide-up-mobile': {
@@ -6629,7 +6859,7 @@ const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
6629
6859
  });
6630
6860
  };
6631
6861
 
6632
- const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
6862
+ const getComponentCss$Z = (hasSlottedAnchor, isActive) => {
6633
6863
  const anchorJssStyle = {
6634
6864
  all: 'unset',
6635
6865
  padding: `calc(${spacingFluidSmall} + 2px) calc(${spacingFluidSmall} + 4px)`, // aligned with link-pure
@@ -6681,7 +6911,7 @@ const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
6681
6911
  });
6682
6912
  };
6683
6913
 
6684
- const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
6914
+ const getComponentCss$Y = (state, labelSize, hasLabel, theme) => {
6685
6915
  return getCss({
6686
6916
  '@global': {
6687
6917
  ':host': {
@@ -6718,7 +6948,7 @@ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
6718
6948
  });
6719
6949
  };
6720
6950
 
6721
- const getComponentCss$W = (state, labelSize, hasLabel, theme) => {
6951
+ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
6722
6952
  return getCss({
6723
6953
  '@global': {
6724
6954
  ':host': {
@@ -6765,7 +6995,7 @@ const flexItemWidths = {
6765
6995
  full: 100,
6766
6996
  auto: 'auto',
6767
6997
  };
6768
- const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
6998
+ const getComponentCss$W = (width, offset, alignSelf, grow, shrink, flex) => {
6769
6999
  return getCss({
6770
7000
  '@global': {
6771
7001
  ':host': addImportantToEachRule({
@@ -6787,7 +7017,7 @@ const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
6787
7017
  });
6788
7018
  };
6789
7019
 
6790
- const getComponentCss$U = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
7020
+ const getComponentCss$V = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
6791
7021
  return getCss({
6792
7022
  '@global': {
6793
7023
  ':host': {
@@ -6977,7 +7207,7 @@ const getDialogStickyAreaJssStyle = (area, theme) => {
6977
7207
  const cssVariableWidth$2 = '--p-flyout-width';
6978
7208
  // TODO: we shouldn't expose --p-flyout-max-width
6979
7209
  const cssVariableMaxWidth = '--p-flyout-max-width';
6980
- const getComponentCss$T = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
7210
+ const getComponentCss$U = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
6981
7211
  const isPositionStart = position === 'start' || position === 'left';
6982
7212
  const isFooterFixed = footerBehavior === 'fixed';
6983
7213
  return getCss({
@@ -7087,7 +7317,7 @@ const gutter$1 = `calc(${gridGap} / 2)`;
7087
7317
  const gridItemWidths = [
7088
7318
  0, 8.333333, 16.666667, 25, 33.333333, 41.666667, 50, 58.333333, 66.666667, 75, 83.333333, 91.666667, 100,
7089
7319
  ];
7090
- const getComponentCss$S = (size, offset) => {
7320
+ const getComponentCss$T = (size, offset) => {
7091
7321
  return getCss({
7092
7322
  '@global': {
7093
7323
  ':host': addImportantToEachRule({
@@ -7107,7 +7337,7 @@ const getComponentCss$S = (size, offset) => {
7107
7337
  };
7108
7338
 
7109
7339
  const gutter = `calc(${gridGap} / -2)`;
7110
- const getComponentCss$R = (direction, wrap) => {
7340
+ const getComponentCss$S = (direction, wrap) => {
7111
7341
  return getCss({
7112
7342
  '@global': {
7113
7343
  ':host': {
@@ -7133,7 +7363,7 @@ const sizeMap$3 = {
7133
7363
  'x-large': fontSizeHeadingXLarge,
7134
7364
  'xx-large': fontSizeHeadingXXLarge,
7135
7365
  };
7136
- const getComponentCss$Q = (size, align, color, ellipsis, theme) => {
7366
+ const getComponentCss$R = (size, align, color, ellipsis, theme) => {
7137
7367
  return getCss({
7138
7368
  '@global': {
7139
7369
  ':host': {
@@ -7193,7 +7423,7 @@ const getTextSizeJssStyle = (textSize) => {
7193
7423
  fontSize: textSize === 'inherit' ? textSize : textSizeMap[textSize],
7194
7424
  };
7195
7425
  };
7196
- const getComponentCss$P = (variant, align, color, ellipsis, theme) => {
7426
+ const getComponentCss$Q = (variant, align, color, ellipsis, theme) => {
7197
7427
  return getCss({
7198
7428
  '@global': {
7199
7429
  ':host': {
@@ -7304,7 +7534,7 @@ const isFlippableIcon = (name, source) => {
7304
7534
  name === 'return' ||
7305
7535
  name === 'send'));
7306
7536
  };
7307
- const getComponentCss$O = (name, source, color, size, theme) => {
7537
+ const getComponentCss$P = (name, source, color, size, theme) => {
7308
7538
  const isColorInherit = color === 'inherit';
7309
7539
  const isSizeInherit = size === 'inherit';
7310
7540
  const isDark = isThemeDark(theme);
@@ -7423,7 +7653,7 @@ const getHeadingJssStyle = (theme) => ({
7423
7653
  ...headingSmallStyle,
7424
7654
  ...getTextJssStyle(theme),
7425
7655
  });
7426
- const getComponentCss$N = (state, hasAction, hasClose, theme) => {
7656
+ const getComponentCss$O = (state, hasAction, hasClose, theme) => {
7427
7657
  return getCss({
7428
7658
  '@global': {
7429
7659
  ':host': {
@@ -7463,231 +7693,51 @@ const getComponentCss$N = (state, hasAction, hasClose, theme) => {
7463
7693
  });
7464
7694
  };
7465
7695
 
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"]))': {
7696
+ // CSS Variables defined in base input
7697
+ /**
7698
+ * @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."}
7699
+ */
7700
+ /**
7701
+ * @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."}
7702
+ */
7703
+ const getComponentCss$N = (disabled, hideLabel, state, compact, readOnly, theme, controls) => {
7704
+ return getCss({
7705
+ ...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
7497
7706
  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
- }),
7707
+ MozAppearance: 'textfield',
7708
+ '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
7709
+ WebkitAppearance: 'none',
7535
7710
  },
7536
7711
  }),
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,
7568
- }),
7569
- ...(isDisabled && {
7570
- color: disabledColor,
7571
- ...prefersColorSchemeDarkMediaQuery(theme, {
7572
- color: disabledColorDark,
7573
- }),
7574
- }),
7575
- ...(isReadonly && {
7576
- color: contrastHighColor,
7712
+ ...(controls && {
7713
+ button: {
7714
+ padding: `var(${cssVarButtonPurePadding})`,
7715
+ margin: `var(${cssVarButtonPureMargin})`,
7716
+ },
7577
7717
  }),
7578
- };
7718
+ });
7579
7719
  };
7580
7720
 
7581
- const cssVarInternalInputPasswordScaling = '--p-internal-input-password-scaling';
7721
+ // CSS Variables defined in base input
7722
+ /**
7723
+ * @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."}
7724
+ */
7725
+ /**
7726
+ * @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."}
7727
+ */
7582
7728
  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
- };
7602
7729
  return getCss({
7603
- '@global': {
7604
- ':host': {
7605
- display: 'block',
7606
- ...addImportantToEachRule({
7607
- ...colorSchemeStyles,
7608
- ...hostHiddenStyles,
7609
- }),
7610
- },
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
- },
7628
- },
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
- }),
7730
+ ...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
7731
+ '&[type="text"]': {
7732
+ textOverflow: 'ellipsis',
7650
7733
  },
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 && {
7668
- cursor: 'text',
7669
- borderColor: contrastLowColor,
7670
- background: contrastLowColor,
7671
- ...prefersColorSchemeDarkMediaQuery(theme, {
7672
- borderColor: contrastLowColorDark,
7673
- background: contrastLowColorDark,
7674
- }),
7675
- }),
7676
- },
7734
+ }),
7677
7735
  ...(toggle && {
7678
7736
  button: {
7679
- placeSelf: 'center',
7680
- padding: paddingButton, // TODO resolve inconsistency in Figma
7737
+ padding: `var(${cssVarButtonPurePadding})`,
7738
+ margin: `var(${cssVarButtonPureMargin})`,
7681
7739
  },
7682
7740
  }),
7683
- // .label / .required
7684
- ...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
7685
- !readOnly &&
7686
- hoverMediaQuery({
7687
- '&:hover~.wrapper': hoverStyles,
7688
- })),
7689
- // .message
7690
- ...getFunctionalComponentStateMessageStyles(theme, state),
7691
7741
  });
7692
7742
  };
7693
7743
 
@@ -11347,4 +11397,4 @@ const getComponentCss = (size, theme) => {
11347
11397
  });
11348
11398
  };
11349
11399
 
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 };
11400
+ export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, getComponentCss$1d as getAccordionCss, getComponentCss$1c as getBannerCss, getComponentCss$18 as getButtonCss, getComponentCss$1b as getButtonGroupCss, getComponentCss$1a as getButtonPureCss, getComponentCss$19 as getButtonTileCss, getComponentCss$17 as getCanvasCss, getComponentCss$16 as getCarouselCss, getComponentCss$14 as getCheckboxCss, getComponentCss$15 as getCheckboxWrapperCss, getComponentCss$13 as getContentWrapperCss, getComponentCss$12 as getCrestCss, getComponentCss$11 as getDisplayCss, getComponentCss$10 as getDividerCss, getComponentCss$$ as getDrilldownCss, getComponentCss$_ as getDrilldownItemCss, getComponentCss$Z as getDrilldownLinkCss, getComponentCss$X as getFieldsetCss, getComponentCss$Y as getFieldsetWrapperCss, getComponentCss$V as getFlexCss, getComponentCss$W as getFlexItemCss, getComponentCss$U as getFlyoutCss, getFunctionalComponentInputBaseStyles, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$S as getGridCss, getComponentCss$T as getGridItemCss, getComponentCss$R as getHeadingCss, getComponentCss$Q as getHeadlineCss, getComponentCss$P as getIconCss, getComponentCss$O as getInlineNotificationCss, getComponentCss$N as getInputNumberCss, 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, 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 };