@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.
- package/CHANGELOG.md +14 -0
- package/cjs/lib/components/input-number.wrapper.cjs +29 -0
- package/cjs/public-api.cjs +2 -0
- package/esm/lib/components/index.d.ts +1 -0
- package/esm/lib/components/input-number.wrapper.d.ts +184 -0
- package/esm/lib/components/input-number.wrapper.mjs +27 -0
- package/esm/lib/types.d.ts +12 -2
- package/esm/public-api.mjs +1 -0
- package/package.json +3 -3
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +324 -268
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +0 -9
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +40 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +22 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +42 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +8 -9
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +10 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +6 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +2 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +291 -241
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +38 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/display.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-link.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/heading.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +20 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +40 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +8 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +11 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +6 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +1 -0
- package/ssr/esm/lib/components/index.d.ts +1 -0
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +184 -0
- package/ssr/esm/lib/dsr-components/input-base.d.ts +31 -0
- package/ssr/esm/lib/dsr-components/input-number.d.ts +18 -0
- package/ssr/esm/lib/dsr-components/input-password.d.ts +5 -3
- package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/select.d.ts +0 -1
- package/ssr/esm/lib/types.d.ts +12 -2
- package/{tailwind → tailwindcss}/index.css +194 -133
|
@@ -3934,7 +3934,7 @@ const formatObjectOutput = (value) => {
|
|
|
3934
3934
|
|
|
3935
3935
|
const OPTION_LIST_SAFE_ZONE = 6;
|
|
3936
3936
|
|
|
3937
|
-
const getComponentCss$
|
|
3937
|
+
const getComponentCss$1d = (size, compact, open, theme, sticky) => {
|
|
3938
3938
|
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
3939
3939
|
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
3940
3940
|
const cssVariablePositionStickyTop = '--p-accordion-position-sticky-top';
|
|
@@ -4106,7 +4106,7 @@ const cssVariableTop = '--p-banner-position-top';
|
|
|
4106
4106
|
const cssVariableBottom = '--p-banner-position-bottom';
|
|
4107
4107
|
const cssVariableZIndex = '--p-internal-banner-z-index';
|
|
4108
4108
|
const topBottomFallback = '56px';
|
|
4109
|
-
const getComponentCss$
|
|
4109
|
+
const getComponentCss$1c = (isOpen) => {
|
|
4110
4110
|
return getCss({
|
|
4111
4111
|
'@global': {
|
|
4112
4112
|
':host': {
|
|
@@ -4178,7 +4178,7 @@ const getGroupDirectionJssStyles = (direction) => {
|
|
|
4178
4178
|
return groupDirectionJssStyles[direction];
|
|
4179
4179
|
};
|
|
4180
4180
|
|
|
4181
|
-
const getComponentCss$
|
|
4181
|
+
const getComponentCss$1b = (direction) => {
|
|
4182
4182
|
return getCss({
|
|
4183
4183
|
'@global': {
|
|
4184
4184
|
':host': {
|
|
@@ -4331,7 +4331,7 @@ const getFunctionalComponentLoadingMessageStyles = () => {
|
|
|
4331
4331
|
};
|
|
4332
4332
|
};
|
|
4333
4333
|
|
|
4334
|
-
const getComponentCss$
|
|
4334
|
+
const getComponentCss$1a = (icon, iconSource, active, isLoading, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, underline, theme) => {
|
|
4335
4335
|
const hasIcon = hasVisibleIcon(icon, iconSource);
|
|
4336
4336
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, underline, false, theme), {
|
|
4337
4337
|
root: {
|
|
@@ -4369,7 +4369,7 @@ const getFontWeight = (weight) => {
|
|
|
4369
4369
|
return fontWeightMap[weight];
|
|
4370
4370
|
};
|
|
4371
4371
|
|
|
4372
|
-
const getComponentCss$
|
|
4372
|
+
const getComponentCss$19 = (isDisabledOrLoading, aspectRatio, size, weight, background, align, compact, hasGradient, isDisabled) => {
|
|
4373
4373
|
const isTopAligned = align === 'top';
|
|
4374
4374
|
return getCss({
|
|
4375
4375
|
'@global': {
|
|
@@ -4639,7 +4639,7 @@ const getDisabledColors = (variant, loading, theme) => {
|
|
|
4639
4639
|
};
|
|
4640
4640
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
4641
4641
|
};
|
|
4642
|
-
const getComponentCss$
|
|
4642
|
+
const getComponentCss$18 = (icon, iconSource, variant, hideLabel, disabled, loading, compact, theme) => {
|
|
4643
4643
|
const disabledOrLoading = isDisabledOrLoading(disabled, loading);
|
|
4644
4644
|
const { textColor, borderColor, backgroundColor } = getDisabledColors(variant, loading, theme);
|
|
4645
4645
|
const { textColor: textColorDark, borderColor: borderColorDark, backgroundColor: backgroundColorDark, } = getDisabledColors(variant, loading, 'dark');
|
|
@@ -4715,7 +4715,7 @@ const mediaQueryS$1 = getMediaQueryMin('s');
|
|
|
4715
4715
|
const mediaQueryM = getMediaQueryMin('m');
|
|
4716
4716
|
// others
|
|
4717
4717
|
const spacingBase = gridGap.replace('36px', '24px');
|
|
4718
|
-
const getComponentCss$
|
|
4718
|
+
const getComponentCss$17 = (theme, isSidebarStartOpen, isSidebarEndOpen) => {
|
|
4719
4719
|
const { primaryColor, backgroundColor, backgroundSurfaceColor, contrastLowColor } = getThemedColors(theme);
|
|
4720
4720
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
4721
4721
|
return getCss({
|
|
@@ -5094,7 +5094,7 @@ const getGradient$1 = (theme, gradientColorTheme) => {
|
|
|
5094
5094
|
`rgba(${gradientColor},0.3) 68%,` +
|
|
5095
5095
|
`rgba(${gradientColor},0)`);
|
|
5096
5096
|
};
|
|
5097
|
-
const getComponentCss$
|
|
5097
|
+
const getComponentCss$16 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation, alignControls) => {
|
|
5098
5098
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
5099
5099
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
5100
5100
|
const { canvasTextColor } = getHighContrastColors();
|
|
@@ -5552,7 +5552,7 @@ const getCheckedSVGBackgroundImage$2 = (fill) => {
|
|
|
5552
5552
|
const getIndeterminateSVGBackgroundImage$1 = (fill) => {
|
|
5553
5553
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5554
5554
|
};
|
|
5555
|
-
const getComponentCss$
|
|
5555
|
+
const getComponentCss$15 = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
5556
5556
|
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5557
5557
|
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5558
5558
|
const indeterminateIconColor = escapeHashCharacter(getThemedColors(theme).primaryColor);
|
|
@@ -5754,7 +5754,7 @@ const getCheckboxCheckedBaseStyles = (theme, isDisabled, isLoading, state) => {
|
|
|
5754
5754
|
const getIndeterminateSVGBackgroundImage = (fill) => {
|
|
5755
5755
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5756
5756
|
};
|
|
5757
|
-
const getComponentCss$
|
|
5757
|
+
const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
|
|
5758
5758
|
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
|
|
5759
5759
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, focusColor: focusColorDark, } = getThemedColors('dark');
|
|
5760
5760
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
@@ -5928,12 +5928,242 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5928
5928
|
});
|
|
5929
5929
|
};
|
|
5930
5930
|
|
|
5931
|
+
const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme, additionalDefaultJssStyle) => {
|
|
5932
|
+
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
5933
|
+
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
5934
|
+
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
5935
|
+
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
5936
|
+
return {
|
|
5937
|
+
[`::slotted(${child})`]: {
|
|
5938
|
+
display: 'block',
|
|
5939
|
+
width: '100%',
|
|
5940
|
+
height: child !== 'textarea'
|
|
5941
|
+
? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
|
|
5942
|
+
: 'auto',
|
|
5943
|
+
margin: 0,
|
|
5944
|
+
outline: 0,
|
|
5945
|
+
WebkitAppearance: 'none', // iOS safari
|
|
5946
|
+
appearance: 'none',
|
|
5947
|
+
boxSizing: 'border-box',
|
|
5948
|
+
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
5949
|
+
borderRadius: borderRadiusSmall,
|
|
5950
|
+
background: 'transparent',
|
|
5951
|
+
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
|
|
5952
|
+
textIndent: 0,
|
|
5953
|
+
color: primaryColor,
|
|
5954
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
5955
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5956
|
+
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
5957
|
+
color: primaryColorDark,
|
|
5958
|
+
}),
|
|
5959
|
+
...additionalDefaultJssStyle,
|
|
5960
|
+
},
|
|
5961
|
+
'::slotted(:not(input[type="password"]))': {
|
|
5962
|
+
textOverflow: 'ellipsis',
|
|
5963
|
+
},
|
|
5964
|
+
...(!isLoading &&
|
|
5965
|
+
hoverMediaQuery({
|
|
5966
|
+
// with the media query the selector has higher priority and overrides disabled styles
|
|
5967
|
+
[`::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)' : ''}`]: {
|
|
5968
|
+
borderColor: formStateHoverColor || primaryColor,
|
|
5969
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5970
|
+
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
5971
|
+
}),
|
|
5972
|
+
},
|
|
5973
|
+
})),
|
|
5974
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
5975
|
+
[`::slotted(${child}:focus)`]: {
|
|
5976
|
+
borderColor: primaryColor,
|
|
5977
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5978
|
+
borderColor: primaryColorDark,
|
|
5979
|
+
}),
|
|
5980
|
+
},
|
|
5981
|
+
[`::slotted(${child}:disabled)`]: {
|
|
5982
|
+
cursor: 'not-allowed',
|
|
5983
|
+
color: disabledColor,
|
|
5984
|
+
borderColor: disabledColor,
|
|
5985
|
+
WebkitTextFillColor: disabledColor,
|
|
5986
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5987
|
+
color: disabledColorDark,
|
|
5988
|
+
borderColor: disabledColorDark,
|
|
5989
|
+
WebkitTextFillColor: disabledColorDark,
|
|
5990
|
+
}),
|
|
5991
|
+
},
|
|
5992
|
+
...(child !== 'select' && {
|
|
5993
|
+
[`::slotted(${child}[readonly])`]: {
|
|
5994
|
+
borderColor: contrastLowColor,
|
|
5995
|
+
background: contrastLowColor,
|
|
5996
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5997
|
+
borderColor: contrastLowColorDark,
|
|
5998
|
+
background: contrastLowColorDark,
|
|
5999
|
+
}),
|
|
6000
|
+
},
|
|
6001
|
+
}),
|
|
6002
|
+
};
|
|
6003
|
+
};
|
|
6004
|
+
const formElementLayeredGap = '9px'; // to have same distance vertically and horizontally for e.g. button/icon within form element
|
|
6005
|
+
const formElementLayeredSafeZone = `calc(${formElementLayeredGap} + ${borderWidthBase})`;
|
|
6006
|
+
// TODO: basic button/icon padding can already be set within style function instead of on component style level
|
|
6007
|
+
const formButtonOrIconPadding = spacingStaticXSmall;
|
|
6008
|
+
// TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
|
|
6009
|
+
// unfortunately line-height alignment breaks for a select element for some reasons then
|
|
6010
|
+
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
6011
|
+
const formElementPaddingVertical = spacingStaticSmall;
|
|
6012
|
+
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
6013
|
+
const formElementPaddingHorizontal = spacingStaticMedium;
|
|
6014
|
+
const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
|
|
6015
|
+
// when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
|
|
6016
|
+
return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
|
|
6017
|
+
};
|
|
6018
|
+
// TODO: re-use in textarea-wrapper not only in text-field-wrapper
|
|
6019
|
+
const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
6020
|
+
const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
6021
|
+
const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
6022
|
+
return {
|
|
6023
|
+
pointerEvents: 'none',
|
|
6024
|
+
maxWidth: '100%',
|
|
6025
|
+
boxSizing: 'border-box',
|
|
6026
|
+
whiteSpace: 'nowrap',
|
|
6027
|
+
overflow: 'hidden',
|
|
6028
|
+
textOverflow: 'ellipsis',
|
|
6029
|
+
font: textSmallStyle.font,
|
|
6030
|
+
color: contrastMediumColor,
|
|
6031
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6032
|
+
color: contrastMediumColorDark,
|
|
6033
|
+
}),
|
|
6034
|
+
...(isDisabled && {
|
|
6035
|
+
color: disabledColor,
|
|
6036
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6037
|
+
color: disabledColorDark,
|
|
6038
|
+
}),
|
|
6039
|
+
}),
|
|
6040
|
+
...(isReadonly && {
|
|
6041
|
+
color: contrastHighColor,
|
|
6042
|
+
}),
|
|
6043
|
+
};
|
|
6044
|
+
};
|
|
6045
|
+
|
|
6046
|
+
const cssVarInternalInputBaseScaling = '--p-internal-input-base-scaling';
|
|
6047
|
+
// Determines the scaling factor for the input-number size. In "compact" mode, it uses 0.5 to achieve a 36px input-number (compact size).
|
|
6048
|
+
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputBaseScaling`.
|
|
6049
|
+
const getScalingVar = (compact) => `var(${cssVarInternalInputBaseScaling}, ${compact ? 0.5 : 1})`;
|
|
6050
|
+
/**
|
|
6051
|
+
* @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."}
|
|
6052
|
+
*/
|
|
6053
|
+
const cssVarButtonPurePadding = '--ref-p-input-slotted-padding';
|
|
6054
|
+
/**
|
|
6055
|
+
* @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."}
|
|
6056
|
+
*/
|
|
6057
|
+
const cssVarButtonPureMargin = '--ref-p-input-slotted-margin';
|
|
6058
|
+
const getFunctionalComponentInputBaseStyles = (disabled, hideLabel, state, compact, readOnly, theme, additionalInputJssStyle) => {
|
|
6059
|
+
const scalingVar = getScalingVar(compact);
|
|
6060
|
+
const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
|
|
6061
|
+
const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
|
|
6062
|
+
const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
|
|
6063
|
+
const gap = `max(4px, calc(${spacingStaticMedium} * ${scalingVar}))`;
|
|
6064
|
+
// This will return 0 for <= 0.5, ~4 for 1 and ~8 for 2 scaling...
|
|
6065
|
+
const buttonCompensation = `clamp(0, 6.42 * pow(calc(${scalingVar} - 0.5), 0.6826), 12)`;
|
|
6066
|
+
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
6067
|
+
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
6068
|
+
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
6069
|
+
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
6070
|
+
const hoverStyles = {
|
|
6071
|
+
borderColor: formStateHoverColor || primaryColor,
|
|
6072
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6073
|
+
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
6074
|
+
}),
|
|
6075
|
+
};
|
|
6076
|
+
return {
|
|
6077
|
+
'@global': {
|
|
6078
|
+
':host': {
|
|
6079
|
+
display: 'block',
|
|
6080
|
+
...addImportantToEachRule({
|
|
6081
|
+
...colorSchemeStyles,
|
|
6082
|
+
...hostHiddenStyles,
|
|
6083
|
+
[`${cssVarButtonPurePadding}`]: `calc(1px * ${buttonCompensation})`,
|
|
6084
|
+
[`${cssVarButtonPureMargin}`]: `calc(-1px * ${buttonCompensation})`,
|
|
6085
|
+
}),
|
|
6086
|
+
},
|
|
6087
|
+
...preventFoucOfNestedElementsStyles,
|
|
6088
|
+
input: {
|
|
6089
|
+
all: 'unset',
|
|
6090
|
+
flex: 1,
|
|
6091
|
+
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
|
|
6092
|
+
height,
|
|
6093
|
+
paddingBlock,
|
|
6094
|
+
color: primaryColor,
|
|
6095
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6096
|
+
color: primaryColorDark,
|
|
6097
|
+
}),
|
|
6098
|
+
width: '100%',
|
|
6099
|
+
minWidth: '2rem',
|
|
6100
|
+
...additionalInputJssStyle,
|
|
6101
|
+
},
|
|
6102
|
+
},
|
|
6103
|
+
root: {
|
|
6104
|
+
display: 'grid',
|
|
6105
|
+
gap: spacingStaticXSmall,
|
|
6106
|
+
},
|
|
6107
|
+
wrapper: {
|
|
6108
|
+
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
6109
|
+
borderRadius: borderRadiusSmall,
|
|
6110
|
+
paddingInline,
|
|
6111
|
+
display: 'flex',
|
|
6112
|
+
alignItems: 'center',
|
|
6113
|
+
gap,
|
|
6114
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
6115
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6116
|
+
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
6117
|
+
}),
|
|
6118
|
+
'&:has(input:focus:not([readonly]))': {
|
|
6119
|
+
borderColor: primaryColor,
|
|
6120
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6121
|
+
borderColor: primaryColorDark,
|
|
6122
|
+
}),
|
|
6123
|
+
},
|
|
6124
|
+
...(!disabled &&
|
|
6125
|
+
!readOnly &&
|
|
6126
|
+
hoverMediaQuery({
|
|
6127
|
+
'&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
|
|
6128
|
+
})),
|
|
6129
|
+
...(disabled && {
|
|
6130
|
+
cursor: 'not-allowed',
|
|
6131
|
+
color: disabledColor,
|
|
6132
|
+
borderColor: disabledColor,
|
|
6133
|
+
WebkitTextFillColor: disabledColor,
|
|
6134
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6135
|
+
color: disabledColorDark,
|
|
6136
|
+
borderColor: disabledColorDark,
|
|
6137
|
+
WebkitTextFillColor: disabledColorDark,
|
|
6138
|
+
}),
|
|
6139
|
+
}),
|
|
6140
|
+
...(readOnly && {
|
|
6141
|
+
cursor: 'text',
|
|
6142
|
+
borderColor: contrastLowColor,
|
|
6143
|
+
background: contrastLowColor,
|
|
6144
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6145
|
+
borderColor: contrastLowColorDark,
|
|
6146
|
+
background: contrastLowColorDark,
|
|
6147
|
+
}),
|
|
6148
|
+
}),
|
|
6149
|
+
},
|
|
6150
|
+
// .label / .required
|
|
6151
|
+
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
|
|
6152
|
+
!readOnly &&
|
|
6153
|
+
hoverMediaQuery({
|
|
6154
|
+
'&:hover~.wrapper': hoverStyles,
|
|
6155
|
+
})),
|
|
6156
|
+
// .message
|
|
6157
|
+
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
6158
|
+
};
|
|
6159
|
+
};
|
|
6160
|
+
|
|
5931
6161
|
const widthMap = {
|
|
5932
6162
|
narrow: gridNarrowOffset,
|
|
5933
6163
|
basic: gridBasicOffset,
|
|
5934
6164
|
extended: gridExtendedOffset,
|
|
5935
6165
|
};
|
|
5936
|
-
const getComponentCss$
|
|
6166
|
+
const getComponentCss$13 = (width) => {
|
|
5937
6167
|
return getCss({
|
|
5938
6168
|
'@global': {
|
|
5939
6169
|
':host': {
|
|
@@ -5975,7 +6205,7 @@ const getDimensionStyle = {
|
|
|
5975
6205
|
width: 'inherit',
|
|
5976
6206
|
height: 'inherit',
|
|
5977
6207
|
};
|
|
5978
|
-
const getComponentCss$
|
|
6208
|
+
const getComponentCss$12 = () => {
|
|
5979
6209
|
return getCss({
|
|
5980
6210
|
'@global': {
|
|
5981
6211
|
':host': {
|
|
@@ -6074,7 +6304,7 @@ const sizeMap$4 = {
|
|
|
6074
6304
|
medium: fontSizeDisplayMedium,
|
|
6075
6305
|
large: fontSizeDisplayLarge,
|
|
6076
6306
|
};
|
|
6077
|
-
const getComponentCss$
|
|
6307
|
+
const getComponentCss$11 = (size, align, color, ellipsis, theme) => {
|
|
6078
6308
|
return getCss({
|
|
6079
6309
|
'@global': {
|
|
6080
6310
|
':host': {
|
|
@@ -6092,7 +6322,7 @@ const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
|
|
|
6092
6322
|
});
|
|
6093
6323
|
};
|
|
6094
6324
|
|
|
6095
|
-
const getComponentCss
|
|
6325
|
+
const getComponentCss$10 = (color, orientation, theme) => {
|
|
6096
6326
|
const { contrastLowColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
6097
6327
|
const { contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, } = getThemedColors('dark');
|
|
6098
6328
|
const colorMap = {
|
|
@@ -6153,7 +6383,7 @@ const easingOpen = 'in';
|
|
|
6153
6383
|
const dialogDurationClose = 'short';
|
|
6154
6384
|
const backdropDurationClose = 'moderate';
|
|
6155
6385
|
const easingClose = 'out';
|
|
6156
|
-
const getComponentCss
|
|
6386
|
+
const getComponentCss$$ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
|
|
6157
6387
|
const { primaryColor, backgroundColor, backgroundSurfaceColor, backgroundShadingColor } = getThemedColors(theme);
|
|
6158
6388
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, backgroundShadingColor: backgroundShadingColorDark, } = getThemedColors('dark');
|
|
6159
6389
|
return getCss({
|
|
@@ -6400,7 +6630,7 @@ const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme)
|
|
|
6400
6630
|
});
|
|
6401
6631
|
};
|
|
6402
6632
|
|
|
6403
|
-
const getComponentCss$
|
|
6633
|
+
const getComponentCss$_ = (isPrimary, isSecondary, isCascade) => {
|
|
6404
6634
|
return getCss({
|
|
6405
6635
|
'@global': {
|
|
6406
6636
|
'@keyframes slide-up-mobile': {
|
|
@@ -6631,7 +6861,7 @@ const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
|
|
|
6631
6861
|
});
|
|
6632
6862
|
};
|
|
6633
6863
|
|
|
6634
|
-
const getComponentCss$
|
|
6864
|
+
const getComponentCss$Z = (hasSlottedAnchor, isActive) => {
|
|
6635
6865
|
const anchorJssStyle = {
|
|
6636
6866
|
all: 'unset',
|
|
6637
6867
|
padding: `calc(${spacingFluidSmall} + 2px) calc(${spacingFluidSmall} + 4px)`, // aligned with link-pure
|
|
@@ -6683,7 +6913,7 @@ const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
|
|
|
6683
6913
|
});
|
|
6684
6914
|
};
|
|
6685
6915
|
|
|
6686
|
-
const getComponentCss$
|
|
6916
|
+
const getComponentCss$Y = (state, labelSize, hasLabel, theme) => {
|
|
6687
6917
|
return getCss({
|
|
6688
6918
|
'@global': {
|
|
6689
6919
|
':host': {
|
|
@@ -6720,7 +6950,7 @@ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
|
6720
6950
|
});
|
|
6721
6951
|
};
|
|
6722
6952
|
|
|
6723
|
-
const getComponentCss$
|
|
6953
|
+
const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
6724
6954
|
return getCss({
|
|
6725
6955
|
'@global': {
|
|
6726
6956
|
':host': {
|
|
@@ -6767,7 +6997,7 @@ const flexItemWidths = {
|
|
|
6767
6997
|
full: 100,
|
|
6768
6998
|
auto: 'auto',
|
|
6769
6999
|
};
|
|
6770
|
-
const getComponentCss$
|
|
7000
|
+
const getComponentCss$W = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
6771
7001
|
return getCss({
|
|
6772
7002
|
'@global': {
|
|
6773
7003
|
':host': addImportantToEachRule({
|
|
@@ -6789,7 +7019,7 @@ const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
|
6789
7019
|
});
|
|
6790
7020
|
};
|
|
6791
7021
|
|
|
6792
|
-
const getComponentCss$
|
|
7022
|
+
const getComponentCss$V = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
|
|
6793
7023
|
return getCss({
|
|
6794
7024
|
'@global': {
|
|
6795
7025
|
':host': {
|
|
@@ -6979,7 +7209,7 @@ const getDialogStickyAreaJssStyle = (area, theme) => {
|
|
|
6979
7209
|
const cssVariableWidth$2 = '--p-flyout-width';
|
|
6980
7210
|
// TODO: we shouldn't expose --p-flyout-max-width
|
|
6981
7211
|
const cssVariableMaxWidth = '--p-flyout-max-width';
|
|
6982
|
-
const getComponentCss$
|
|
7212
|
+
const getComponentCss$U = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
|
|
6983
7213
|
const isPositionStart = position === 'start' || position === 'left';
|
|
6984
7214
|
const isFooterFixed = footerBehavior === 'fixed';
|
|
6985
7215
|
return getCss({
|
|
@@ -7089,7 +7319,7 @@ const gutter$1 = `calc(${gridGap} / 2)`;
|
|
|
7089
7319
|
const gridItemWidths = [
|
|
7090
7320
|
0, 8.333333, 16.666667, 25, 33.333333, 41.666667, 50, 58.333333, 66.666667, 75, 83.333333, 91.666667, 100,
|
|
7091
7321
|
];
|
|
7092
|
-
const getComponentCss$
|
|
7322
|
+
const getComponentCss$T = (size, offset) => {
|
|
7093
7323
|
return getCss({
|
|
7094
7324
|
'@global': {
|
|
7095
7325
|
':host': addImportantToEachRule({
|
|
@@ -7109,7 +7339,7 @@ const getComponentCss$S = (size, offset) => {
|
|
|
7109
7339
|
};
|
|
7110
7340
|
|
|
7111
7341
|
const gutter = `calc(${gridGap} / -2)`;
|
|
7112
|
-
const getComponentCss$
|
|
7342
|
+
const getComponentCss$S = (direction, wrap) => {
|
|
7113
7343
|
return getCss({
|
|
7114
7344
|
'@global': {
|
|
7115
7345
|
':host': {
|
|
@@ -7135,7 +7365,7 @@ const sizeMap$3 = {
|
|
|
7135
7365
|
'x-large': fontSizeHeadingXLarge,
|
|
7136
7366
|
'xx-large': fontSizeHeadingXXLarge,
|
|
7137
7367
|
};
|
|
7138
|
-
const getComponentCss$
|
|
7368
|
+
const getComponentCss$R = (size, align, color, ellipsis, theme) => {
|
|
7139
7369
|
return getCss({
|
|
7140
7370
|
'@global': {
|
|
7141
7371
|
':host': {
|
|
@@ -7195,7 +7425,7 @@ const getTextSizeJssStyle = (textSize) => {
|
|
|
7195
7425
|
fontSize: textSize === 'inherit' ? textSize : textSizeMap[textSize],
|
|
7196
7426
|
};
|
|
7197
7427
|
};
|
|
7198
|
-
const getComponentCss$
|
|
7428
|
+
const getComponentCss$Q = (variant, align, color, ellipsis, theme) => {
|
|
7199
7429
|
return getCss({
|
|
7200
7430
|
'@global': {
|
|
7201
7431
|
':host': {
|
|
@@ -7306,7 +7536,7 @@ const isFlippableIcon = (name, source) => {
|
|
|
7306
7536
|
name === 'return' ||
|
|
7307
7537
|
name === 'send'));
|
|
7308
7538
|
};
|
|
7309
|
-
const getComponentCss$
|
|
7539
|
+
const getComponentCss$P = (name, source, color, size, theme) => {
|
|
7310
7540
|
const isColorInherit = color === 'inherit';
|
|
7311
7541
|
const isSizeInherit = size === 'inherit';
|
|
7312
7542
|
const isDark = isThemeDark(theme);
|
|
@@ -7425,7 +7655,7 @@ const getHeadingJssStyle = (theme) => ({
|
|
|
7425
7655
|
...headingSmallStyle,
|
|
7426
7656
|
...getTextJssStyle(theme),
|
|
7427
7657
|
});
|
|
7428
|
-
const getComponentCss$
|
|
7658
|
+
const getComponentCss$O = (state, hasAction, hasClose, theme) => {
|
|
7429
7659
|
return getCss({
|
|
7430
7660
|
'@global': {
|
|
7431
7661
|
':host': {
|
|
@@ -7465,231 +7695,51 @@ const getComponentCss$N = (state, hasAction, hasClose, theme) => {
|
|
|
7465
7695
|
});
|
|
7466
7696
|
};
|
|
7467
7697
|
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
|
|
7479
|
-
: 'auto',
|
|
7480
|
-
margin: 0,
|
|
7481
|
-
outline: 0,
|
|
7482
|
-
WebkitAppearance: 'none', // iOS safari
|
|
7483
|
-
appearance: 'none',
|
|
7484
|
-
boxSizing: 'border-box',
|
|
7485
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7486
|
-
borderRadius: borderRadiusSmall,
|
|
7487
|
-
background: 'transparent',
|
|
7488
|
-
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
|
|
7489
|
-
textIndent: 0,
|
|
7490
|
-
color: primaryColor,
|
|
7491
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
7492
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7493
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7494
|
-
color: primaryColorDark,
|
|
7495
|
-
}),
|
|
7496
|
-
...additionalDefaultJssStyle,
|
|
7497
|
-
},
|
|
7498
|
-
'::slotted(:not(input[type="password"]))': {
|
|
7698
|
+
// CSS Variables defined in base input
|
|
7699
|
+
/**
|
|
7700
|
+
* @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."}
|
|
7701
|
+
*/
|
|
7702
|
+
/**
|
|
7703
|
+
* @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."}
|
|
7704
|
+
*/
|
|
7705
|
+
const getComponentCss$N = (disabled, hideLabel, state, compact, readOnly, theme, controls) => {
|
|
7706
|
+
return getCss({
|
|
7707
|
+
...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
|
|
7499
7708
|
textOverflow: 'ellipsis',
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
// with the media query the selector has higher priority and overrides disabled styles
|
|
7504
|
-
[`::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)' : ''}`]: {
|
|
7505
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7506
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7507
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7508
|
-
}),
|
|
7509
|
-
},
|
|
7510
|
-
})),
|
|
7511
|
-
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7512
|
-
[`::slotted(${child}:focus)`]: {
|
|
7513
|
-
borderColor: primaryColor,
|
|
7514
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7515
|
-
borderColor: primaryColorDark,
|
|
7516
|
-
}),
|
|
7517
|
-
},
|
|
7518
|
-
[`::slotted(${child}:disabled)`]: {
|
|
7519
|
-
cursor: 'not-allowed',
|
|
7520
|
-
color: disabledColor,
|
|
7521
|
-
borderColor: disabledColor,
|
|
7522
|
-
WebkitTextFillColor: disabledColor,
|
|
7523
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7524
|
-
color: disabledColorDark,
|
|
7525
|
-
borderColor: disabledColorDark,
|
|
7526
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7527
|
-
}),
|
|
7528
|
-
},
|
|
7529
|
-
...(child !== 'select' && {
|
|
7530
|
-
[`::slotted(${child}[readonly])`]: {
|
|
7531
|
-
borderColor: contrastLowColor,
|
|
7532
|
-
background: contrastLowColor,
|
|
7533
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7534
|
-
borderColor: contrastLowColorDark,
|
|
7535
|
-
background: contrastLowColorDark,
|
|
7536
|
-
}),
|
|
7709
|
+
MozAppearance: 'textfield',
|
|
7710
|
+
'&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
|
|
7711
|
+
WebkitAppearance: 'none',
|
|
7537
7712
|
},
|
|
7538
7713
|
}),
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
const formButtonOrIconPadding = spacingStaticXSmall;
|
|
7545
|
-
// TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
|
|
7546
|
-
// unfortunately line-height alignment breaks for a select element for some reasons then
|
|
7547
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7548
|
-
const formElementPaddingVertical = spacingStaticSmall;
|
|
7549
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7550
|
-
const formElementPaddingHorizontal = spacingStaticMedium;
|
|
7551
|
-
const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
|
|
7552
|
-
// when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
|
|
7553
|
-
return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
|
|
7554
|
-
};
|
|
7555
|
-
// TODO: re-use in textarea-wrapper not only in text-field-wrapper
|
|
7556
|
-
const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
7557
|
-
const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
7558
|
-
const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
7559
|
-
return {
|
|
7560
|
-
pointerEvents: 'none',
|
|
7561
|
-
maxWidth: '100%',
|
|
7562
|
-
boxSizing: 'border-box',
|
|
7563
|
-
whiteSpace: 'nowrap',
|
|
7564
|
-
overflow: 'hidden',
|
|
7565
|
-
textOverflow: 'ellipsis',
|
|
7566
|
-
font: textSmallStyle.font,
|
|
7567
|
-
color: contrastMediumColor,
|
|
7568
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7569
|
-
color: contrastMediumColorDark,
|
|
7570
|
-
}),
|
|
7571
|
-
...(isDisabled && {
|
|
7572
|
-
color: disabledColor,
|
|
7573
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7574
|
-
color: disabledColorDark,
|
|
7575
|
-
}),
|
|
7576
|
-
}),
|
|
7577
|
-
...(isReadonly && {
|
|
7578
|
-
color: contrastHighColor,
|
|
7714
|
+
...(controls && {
|
|
7715
|
+
button: {
|
|
7716
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7717
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7718
|
+
},
|
|
7579
7719
|
}),
|
|
7580
|
-
};
|
|
7720
|
+
});
|
|
7581
7721
|
};
|
|
7582
7722
|
|
|
7583
|
-
|
|
7723
|
+
// CSS Variables defined in base input
|
|
7724
|
+
/**
|
|
7725
|
+
* @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."}
|
|
7726
|
+
*/
|
|
7727
|
+
/**
|
|
7728
|
+
* @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."}
|
|
7729
|
+
*/
|
|
7584
7730
|
const getComponentCss$M = (disabled, hideLabel, state, toggle, compact, readOnly, theme) => {
|
|
7585
|
-
// Determines the scaling factor for the input-password size. In "compact" mode, it uses 0.5 to achieve a 36px input-password (compact size).
|
|
7586
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputPasswordScaling`.
|
|
7587
|
-
const scalingVar = `var(${cssVarInternalInputPasswordScaling}, ${compact ? 0.5 : 1})`;
|
|
7588
|
-
const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
|
|
7589
|
-
const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
|
|
7590
|
-
// TODO: Ideally, 'compact' should only influence the calculation of scalingVar,
|
|
7591
|
-
// ensuring that the paddingButton calculation solely depends on the scaling factor.
|
|
7592
|
-
const paddingButton = compact ? '0px' : `calc(${formButtonOrIconPadding} * ${scalingVar})`;
|
|
7593
|
-
const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
|
|
7594
|
-
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
7595
|
-
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
7596
|
-
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
7597
|
-
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
7598
|
-
const hoverStyles = {
|
|
7599
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7600
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7601
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7602
|
-
}),
|
|
7603
|
-
};
|
|
7604
7731
|
return getCss({
|
|
7605
|
-
|
|
7606
|
-
'
|
|
7607
|
-
|
|
7608
|
-
...addImportantToEachRule({
|
|
7609
|
-
...colorSchemeStyles,
|
|
7610
|
-
...hostHiddenStyles,
|
|
7611
|
-
}),
|
|
7612
|
-
},
|
|
7613
|
-
...preventFoucOfNestedElementsStyles,
|
|
7614
|
-
input: {
|
|
7615
|
-
all: 'unset',
|
|
7616
|
-
flex: 1,
|
|
7617
|
-
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
|
|
7618
|
-
height,
|
|
7619
|
-
paddingBlock,
|
|
7620
|
-
textIndent: 0,
|
|
7621
|
-
color: primaryColor,
|
|
7622
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7623
|
-
color: primaryColorDark,
|
|
7624
|
-
}),
|
|
7625
|
-
width: '100%',
|
|
7626
|
-
minWidth: '2rem',
|
|
7627
|
-
'&[type="text"]': {
|
|
7628
|
-
textOverflow: 'ellipsis',
|
|
7629
|
-
},
|
|
7630
|
-
},
|
|
7631
|
-
},
|
|
7632
|
-
root: {
|
|
7633
|
-
display: 'grid',
|
|
7634
|
-
gap: spacingStaticXSmall,
|
|
7635
|
-
},
|
|
7636
|
-
wrapper: {
|
|
7637
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7638
|
-
borderRadius: borderRadiusSmall,
|
|
7639
|
-
paddingInlineStart: paddingInline,
|
|
7640
|
-
paddingInlineEnd: toggle ? paddingBlock : paddingInline, // TODO resolve inconsistency in Figma
|
|
7641
|
-
display: 'flex',
|
|
7642
|
-
gap: formElementLayeredGap,
|
|
7643
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
7644
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7645
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7646
|
-
}),
|
|
7647
|
-
'&:has(input:focus:not([readonly]))': {
|
|
7648
|
-
borderColor: primaryColor,
|
|
7649
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7650
|
-
borderColor: primaryColorDark,
|
|
7651
|
-
}),
|
|
7732
|
+
...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
|
|
7733
|
+
'&[type="text"]': {
|
|
7734
|
+
textOverflow: 'ellipsis',
|
|
7652
7735
|
},
|
|
7653
|
-
|
|
7654
|
-
!readOnly &&
|
|
7655
|
-
hoverMediaQuery({
|
|
7656
|
-
'&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
|
|
7657
|
-
})),
|
|
7658
|
-
...(disabled && {
|
|
7659
|
-
cursor: 'not-allowed',
|
|
7660
|
-
color: disabledColor,
|
|
7661
|
-
borderColor: disabledColor,
|
|
7662
|
-
WebkitTextFillColor: disabledColor,
|
|
7663
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7664
|
-
color: disabledColorDark,
|
|
7665
|
-
borderColor: disabledColorDark,
|
|
7666
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7667
|
-
}),
|
|
7668
|
-
}),
|
|
7669
|
-
...(readOnly && {
|
|
7670
|
-
cursor: 'text',
|
|
7671
|
-
borderColor: contrastLowColor,
|
|
7672
|
-
background: contrastLowColor,
|
|
7673
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7674
|
-
borderColor: contrastLowColorDark,
|
|
7675
|
-
background: contrastLowColorDark,
|
|
7676
|
-
}),
|
|
7677
|
-
}),
|
|
7678
|
-
},
|
|
7736
|
+
}),
|
|
7679
7737
|
...(toggle && {
|
|
7680
7738
|
button: {
|
|
7681
|
-
|
|
7682
|
-
|
|
7739
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7740
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7683
7741
|
},
|
|
7684
7742
|
}),
|
|
7685
|
-
// .label / .required
|
|
7686
|
-
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
|
|
7687
|
-
!readOnly &&
|
|
7688
|
-
hoverMediaQuery({
|
|
7689
|
-
'&:hover~.wrapper': hoverStyles,
|
|
7690
|
-
})),
|
|
7691
|
-
// .message
|
|
7692
|
-
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7693
7743
|
});
|
|
7694
7744
|
};
|
|
7695
7745
|
|
|
@@ -11349,38 +11399,43 @@ const getComponentCss = (size, theme) => {
|
|
|
11349
11399
|
});
|
|
11350
11400
|
};
|
|
11351
11401
|
|
|
11352
|
-
exports.
|
|
11353
|
-
exports.
|
|
11354
|
-
exports.
|
|
11355
|
-
exports.
|
|
11356
|
-
exports.
|
|
11357
|
-
exports.
|
|
11358
|
-
exports.
|
|
11359
|
-
exports.
|
|
11360
|
-
exports.
|
|
11361
|
-
exports.
|
|
11362
|
-
exports.
|
|
11363
|
-
exports.
|
|
11364
|
-
exports.
|
|
11365
|
-
exports.
|
|
11366
|
-
exports.
|
|
11367
|
-
exports.
|
|
11368
|
-
exports.
|
|
11369
|
-
exports.
|
|
11370
|
-
exports.
|
|
11371
|
-
exports.
|
|
11372
|
-
exports.
|
|
11373
|
-
exports.
|
|
11402
|
+
exports.cssVarButtonPureMargin = cssVarButtonPureMargin;
|
|
11403
|
+
exports.cssVarButtonPurePadding = cssVarButtonPurePadding;
|
|
11404
|
+
exports.cssVarInternalInputBaseScaling = cssVarInternalInputBaseScaling;
|
|
11405
|
+
exports.getAccordionCss = getComponentCss$1d;
|
|
11406
|
+
exports.getBannerCss = getComponentCss$1c;
|
|
11407
|
+
exports.getButtonCss = getComponentCss$18;
|
|
11408
|
+
exports.getButtonGroupCss = getComponentCss$1b;
|
|
11409
|
+
exports.getButtonPureCss = getComponentCss$1a;
|
|
11410
|
+
exports.getButtonTileCss = getComponentCss$19;
|
|
11411
|
+
exports.getCanvasCss = getComponentCss$17;
|
|
11412
|
+
exports.getCarouselCss = getComponentCss$16;
|
|
11413
|
+
exports.getCheckboxCss = getComponentCss$14;
|
|
11414
|
+
exports.getCheckboxWrapperCss = getComponentCss$15;
|
|
11415
|
+
exports.getContentWrapperCss = getComponentCss$13;
|
|
11416
|
+
exports.getCrestCss = getComponentCss$12;
|
|
11417
|
+
exports.getDisplayCss = getComponentCss$11;
|
|
11418
|
+
exports.getDividerCss = getComponentCss$10;
|
|
11419
|
+
exports.getDrilldownCss = getComponentCss$$;
|
|
11420
|
+
exports.getDrilldownItemCss = getComponentCss$_;
|
|
11421
|
+
exports.getDrilldownLinkCss = getComponentCss$Z;
|
|
11422
|
+
exports.getFieldsetCss = getComponentCss$X;
|
|
11423
|
+
exports.getFieldsetWrapperCss = getComponentCss$Y;
|
|
11424
|
+
exports.getFlexCss = getComponentCss$V;
|
|
11425
|
+
exports.getFlexItemCss = getComponentCss$W;
|
|
11426
|
+
exports.getFlyoutCss = getComponentCss$U;
|
|
11427
|
+
exports.getFunctionalComponentInputBaseStyles = getFunctionalComponentInputBaseStyles;
|
|
11374
11428
|
exports.getFunctionalComponentLabelStyles = getFunctionalComponentLabelStyles;
|
|
11375
11429
|
exports.getFunctionalComponentLoadingMessageStyles = getFunctionalComponentLoadingMessageStyles;
|
|
11376
11430
|
exports.getFunctionalComponentRequiredStyles = getFunctionalComponentRequiredStyles;
|
|
11377
11431
|
exports.getFunctionalComponentStateMessageStyles = getFunctionalComponentStateMessageStyles;
|
|
11378
|
-
exports.getGridCss = getComponentCss$
|
|
11379
|
-
exports.getGridItemCss = getComponentCss$
|
|
11380
|
-
exports.getHeadingCss = getComponentCss$
|
|
11381
|
-
exports.getHeadlineCss = getComponentCss$
|
|
11382
|
-
exports.getIconCss = getComponentCss$
|
|
11383
|
-
exports.getInlineNotificationCss = getComponentCss$
|
|
11432
|
+
exports.getGridCss = getComponentCss$S;
|
|
11433
|
+
exports.getGridItemCss = getComponentCss$T;
|
|
11434
|
+
exports.getHeadingCss = getComponentCss$R;
|
|
11435
|
+
exports.getHeadlineCss = getComponentCss$Q;
|
|
11436
|
+
exports.getIconCss = getComponentCss$P;
|
|
11437
|
+
exports.getInlineNotificationCss = getComponentCss$O;
|
|
11438
|
+
exports.getInputNumberCss = getComponentCss$N;
|
|
11384
11439
|
exports.getInputPasswordCss = getComponentCss$M;
|
|
11385
11440
|
exports.getLinkCss = getComponentCss$K;
|
|
11386
11441
|
exports.getLinkPureCss = getComponentCss$L;
|
|
@@ -11398,6 +11453,7 @@ exports.getPaginationCss = getComponentCss$A;
|
|
|
11398
11453
|
exports.getPinCodeCss = getComponentCss$z;
|
|
11399
11454
|
exports.getPopoverCss = getComponentCss$y;
|
|
11400
11455
|
exports.getRadioButtonWrapperCss = getComponentCss$x;
|
|
11456
|
+
exports.getScalingVar = getScalingVar;
|
|
11401
11457
|
exports.getScrollerCss = getComponentCss$w;
|
|
11402
11458
|
exports.getSegmentedControlCss = getComponentCss$u;
|
|
11403
11459
|
exports.getSegmentedControlItemCss = getComponentCss$v;
|