@porsche-design-system/components-react 3.28.0-rc.2 → 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 +34 -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 +5 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +475 -371
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +0 -14
- 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 +12 -6
- 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/lib/dsr-components/state-message.cjs +6 -2
- 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 +442 -344
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -12
- 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 +13 -7
- 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/lib/dsr-components/state-message.mjs +7 -3
- 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/tailwindcss/index.css +409 -0
|
@@ -3932,7 +3932,7 @@ const formatObjectOutput = (value) => {
|
|
|
3932
3932
|
|
|
3933
3933
|
const OPTION_LIST_SAFE_ZONE = 6;
|
|
3934
3934
|
|
|
3935
|
-
const getComponentCss$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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();
|
|
@@ -5534,8 +5534,12 @@ const getFunctionalComponentStateMessageStyles = (theme, state, additionalDefaul
|
|
|
5534
5534
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5535
5535
|
color: getThemedFormStateColors('dark', state).formStateColor,
|
|
5536
5536
|
}),
|
|
5537
|
-
transition: getTransition('color'),
|
|
5537
|
+
transition: `${getTransition('color')}, ${getTransition('opacity')}`,
|
|
5538
5538
|
...additionalDefaultJssStyle,
|
|
5539
|
+
'&:empty': {
|
|
5540
|
+
opacity: '0',
|
|
5541
|
+
position: 'absolute',
|
|
5542
|
+
},
|
|
5539
5543
|
},
|
|
5540
5544
|
};
|
|
5541
5545
|
};
|
|
@@ -5546,7 +5550,7 @@ const getCheckedSVGBackgroundImage$2 = (fill) => {
|
|
|
5546
5550
|
const getIndeterminateSVGBackgroundImage$1 = (fill) => {
|
|
5547
5551
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5548
5552
|
};
|
|
5549
|
-
const getComponentCss$
|
|
5553
|
+
const getComponentCss$15 = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
5550
5554
|
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5551
5555
|
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5552
5556
|
const indeterminateIconColor = escapeHashCharacter(getThemedColors(theme).primaryColor);
|
|
@@ -5642,14 +5646,113 @@ const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5642
5646
|
});
|
|
5643
5647
|
};
|
|
5644
5648
|
|
|
5649
|
+
const cssVarInternalCheckboxScaling = '--p-internal-checkbox-scaling';
|
|
5650
|
+
const getCheckboxBaseStyles = (theme, isDisabled, isLoading, state, compact) => {
|
|
5651
|
+
const { contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
5652
|
+
const { contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
5653
|
+
const { formStateColor } = getThemedFormStateColors(theme, state);
|
|
5654
|
+
const { formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
5655
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
5656
|
+
// TODO: needs to be extracted into a color function
|
|
5657
|
+
const uncheckedColor = disabledOrLoading ? disabledColor : formStateColor || contrastMediumColor;
|
|
5658
|
+
const uncheckedColorDark = disabledOrLoading ? disabledColorDark : formStateColorDark || contrastMediumColorDark;
|
|
5659
|
+
const background = `transparent 0% 0% / ${fontLineHeight}`;
|
|
5660
|
+
const minimumTouchTargetSize = '24px'; // Minimum touch target size to comply with accessibility guidelines.
|
|
5661
|
+
const scalingVar = `var(${cssVarInternalCheckboxScaling}, ${compact ? 0.6668 : 1})`;
|
|
5662
|
+
// Determines the scaling factor for the checkbox size. In "compact" mode, it uses 0.6668 to achieve a 20px checkbox (compact size).
|
|
5663
|
+
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalCheckboxScaling`.
|
|
5664
|
+
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${scalingVar} * ${fontLineHeight}))`;
|
|
5665
|
+
// Calculates the checkbox size and ensures a minimum size of 12px (0.75 * SCALING_BASE_VALUE).
|
|
5666
|
+
// Scales proportionally with the line height and the scaling factor.
|
|
5667
|
+
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
5668
|
+
const touchTargetSizeDiff = `calc(${minimumTouchTargetSize} - ${dimensionFull})`; // Difference between the minimum touch target size and the checkbox full size.
|
|
5669
|
+
const inset = `calc(-${borderWidthBase} - max(0px, ${touchTargetSizeDiff} / 2))`; // Positions the checkbox ::before pseudo-element with a negative offset to align it with the touch target.
|
|
5670
|
+
return {
|
|
5671
|
+
position: 'relative',
|
|
5672
|
+
'&::before': {
|
|
5673
|
+
// Ensures the touch target is at least 24px, even if the checkbox is smaller than the minimum touch target size.
|
|
5674
|
+
// This pseudo-element expands the clickable area without affecting the visual size of the checkbox itself.
|
|
5675
|
+
content: '""',
|
|
5676
|
+
position: 'absolute',
|
|
5677
|
+
inset,
|
|
5678
|
+
},
|
|
5679
|
+
width: dimension,
|
|
5680
|
+
height: dimension,
|
|
5681
|
+
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5682
|
+
display: 'block',
|
|
5683
|
+
margin: 0,
|
|
5684
|
+
padding: 0,
|
|
5685
|
+
WebkitAppearance: 'none', // iOS safari
|
|
5686
|
+
appearance: 'none',
|
|
5687
|
+
boxSizing: 'content-box',
|
|
5688
|
+
background,
|
|
5689
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5690
|
+
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5691
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5692
|
+
...(disabledOrLoading
|
|
5693
|
+
? {
|
|
5694
|
+
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
5695
|
+
}
|
|
5696
|
+
: {
|
|
5697
|
+
cursor: 'pointer',
|
|
5698
|
+
}),
|
|
5699
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5700
|
+
borderColor: uncheckedColorDark,
|
|
5701
|
+
}),
|
|
5702
|
+
gridArea: '1/1',
|
|
5703
|
+
borderRadius: borderRadiusSmall,
|
|
5704
|
+
...addImportantToEachRule({
|
|
5705
|
+
backgroundSize: 'cover',
|
|
5706
|
+
}),
|
|
5707
|
+
};
|
|
5708
|
+
};
|
|
5709
|
+
|
|
5645
5710
|
const getCheckedSVGBackgroundImage$1 = (fill) => {
|
|
5646
5711
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20.22,7.47l-1.47-1.42-9.26,9.02-4.24-4.15-1.47,1.42,5.71,5.6,10.73-10.47Z"/>`);
|
|
5647
5712
|
};
|
|
5713
|
+
const getCheckboxCheckedBaseStyles = (theme, isDisabled, isLoading, state) => {
|
|
5714
|
+
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
5715
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
5716
|
+
const { formStateColor } = getThemedFormStateColors(theme, state);
|
|
5717
|
+
const { formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
5718
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
5719
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
5720
|
+
// TODO: needs to be extracted into a color function
|
|
5721
|
+
const checkedColor = isHighContrastMode
|
|
5722
|
+
? canvasTextColor
|
|
5723
|
+
: disabledOrLoading
|
|
5724
|
+
? disabledColor
|
|
5725
|
+
: formStateColor || primaryColor;
|
|
5726
|
+
const checkedColorDark = isHighContrastMode
|
|
5727
|
+
? canvasTextColor
|
|
5728
|
+
: disabledOrLoading
|
|
5729
|
+
? disabledColorDark
|
|
5730
|
+
: formStateColorDark || primaryColorDark;
|
|
5731
|
+
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5732
|
+
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5733
|
+
return {
|
|
5734
|
+
borderColor: checkedColor,
|
|
5735
|
+
backgroundColor: checkedColor,
|
|
5736
|
+
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColor),
|
|
5737
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5738
|
+
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColorDark),
|
|
5739
|
+
borderColor: checkedColorDark,
|
|
5740
|
+
backgroundColor: checkedColorDark,
|
|
5741
|
+
}),
|
|
5742
|
+
// This is a workaround for Blink based browsers, which do not reflect the high contrast system colors (e.g.: "Canvas" and "CanvasText") when added to background SVG's.
|
|
5743
|
+
...(isHighContrastMode &&
|
|
5744
|
+
getSchemedHighContrastMediaQuery({
|
|
5745
|
+
backgroundImage: getCheckedSVGBackgroundImage$1('white'),
|
|
5746
|
+
}, {
|
|
5747
|
+
backgroundImage: getCheckedSVGBackgroundImage$1('black'),
|
|
5748
|
+
})),
|
|
5749
|
+
};
|
|
5750
|
+
};
|
|
5751
|
+
|
|
5648
5752
|
const getIndeterminateSVGBackgroundImage = (fill) => {
|
|
5649
5753
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5650
5754
|
};
|
|
5651
|
-
const
|
|
5652
|
-
const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
|
|
5755
|
+
const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
|
|
5653
5756
|
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
|
|
5654
5757
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, focusColor: focusColorDark, } = getThemedColors('dark');
|
|
5655
5758
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
@@ -5673,8 +5776,6 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5673
5776
|
: formStateColorDark || primaryColorDark;
|
|
5674
5777
|
const checkedHoverColor = formStateHoverColor || contrastHighColor;
|
|
5675
5778
|
const checkedHoverColorDark = formStateHoverColorDark || contrastHighColorDark;
|
|
5676
|
-
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5677
|
-
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5678
5779
|
const indeterminateIconColor = escapeHashCharacter(disabledOrLoading ? disabledColorDark : formStateColor || primaryColor);
|
|
5679
5780
|
const indeterminateIconColorDark = escapeHashCharacter(formStateColorDark || primaryColorDark);
|
|
5680
5781
|
const indeterminateIconHoverColor = escapeHashCharacter(formStateHoverColor || primaryColor);
|
|
@@ -5682,18 +5783,11 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5682
5783
|
const background = `transparent 0% 0% / ${fontLineHeight}`;
|
|
5683
5784
|
const minimumTouchTargetSize = '24px'; // Minimum touch target size to comply with accessibility guidelines.
|
|
5684
5785
|
const scalingVar = `var(${cssVarInternalCheckboxScaling}, ${compact ? 0.6668 : 1})`;
|
|
5685
|
-
// Determines the scaling factor for the checkbox size. In "compact" mode, it uses 0.6668 to achieve a 20px checkbox (compact size).
|
|
5686
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalCheckboxScaling`.
|
|
5687
5786
|
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${scalingVar} * ${fontLineHeight}))`;
|
|
5688
|
-
// Calculates the checkbox size and ensures a minimum size of 12px (0.75 * SCALING_BASE_VALUE).
|
|
5689
|
-
// Scales proportionally with the line height and the scaling factor.
|
|
5690
5787
|
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
5691
5788
|
const touchTargetSizeDiff = `calc(${minimumTouchTargetSize} - ${dimensionFull})`; // Difference between the minimum touch target size and the checkbox full size.
|
|
5692
5789
|
const paddingInlineStart = `calc(${spacingStaticSmall} - (max(0px, ${touchTargetSizeDiff})))`;
|
|
5693
|
-
// Adjusts padding to maintain consistent spacing when the checkbox is smaller than the minimum touch target size.
|
|
5694
|
-
// Uses asymmetric padding instead of `gap` to ensure there is no non-clickable area between the label and the input.
|
|
5695
5790
|
const paddingTop = `calc((${dimensionFull} - ${fontLineHeight}) / 2)`; // Vertically centers the checkbox label relative to the checkbox size.
|
|
5696
|
-
const inset = `calc(-${borderWidthBase} - max(0px, ${touchTargetSizeDiff} / 2))`; // Positions the checkbox ::before pseudo-element with a negative offset to align it with the touch target.
|
|
5697
5791
|
const height = `calc(max(${fontLineHeight}, ${dimensionFull}))`; // Ensures the wrapper height matches either the font's line height or the full size of the checkbox, whichever is larger.
|
|
5698
5792
|
return getCss({
|
|
5699
5793
|
'@global': {
|
|
@@ -5705,44 +5799,7 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5705
5799
|
}),
|
|
5706
5800
|
},
|
|
5707
5801
|
...preventFoucOfNestedElementsStyles,
|
|
5708
|
-
input:
|
|
5709
|
-
position: 'relative',
|
|
5710
|
-
'&::before': {
|
|
5711
|
-
// Ensures the touch target is at least 24px, even if the checkbox is smaller than the minimum touch target size.
|
|
5712
|
-
// This pseudo-element expands the clickable area without affecting the visual size of the checkbox itself.
|
|
5713
|
-
content: '""',
|
|
5714
|
-
position: 'absolute',
|
|
5715
|
-
inset,
|
|
5716
|
-
},
|
|
5717
|
-
width: dimension,
|
|
5718
|
-
height: dimension,
|
|
5719
|
-
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5720
|
-
display: 'block',
|
|
5721
|
-
margin: 0,
|
|
5722
|
-
padding: 0,
|
|
5723
|
-
WebkitAppearance: 'none', // iOS safari
|
|
5724
|
-
appearance: 'none',
|
|
5725
|
-
boxSizing: 'content-box',
|
|
5726
|
-
background,
|
|
5727
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5728
|
-
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5729
|
-
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5730
|
-
...(disabledOrLoading
|
|
5731
|
-
? {
|
|
5732
|
-
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
5733
|
-
}
|
|
5734
|
-
: {
|
|
5735
|
-
cursor: 'pointer',
|
|
5736
|
-
}),
|
|
5737
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5738
|
-
borderColor: uncheckedColorDark,
|
|
5739
|
-
}),
|
|
5740
|
-
gridArea: '1/1',
|
|
5741
|
-
borderRadius: borderRadiusSmall,
|
|
5742
|
-
...addImportantToEachRule({
|
|
5743
|
-
backgroundSize: 'cover',
|
|
5744
|
-
}),
|
|
5745
|
-
},
|
|
5802
|
+
input: getCheckboxBaseStyles(theme, isDisabled, isLoading, state, compact),
|
|
5746
5803
|
...(isLoading
|
|
5747
5804
|
? {
|
|
5748
5805
|
'input:checked': {
|
|
@@ -5756,23 +5813,7 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5756
5813
|
},
|
|
5757
5814
|
}
|
|
5758
5815
|
: {
|
|
5759
|
-
'input:checked':
|
|
5760
|
-
borderColor: checkedColor,
|
|
5761
|
-
backgroundColor: checkedColor,
|
|
5762
|
-
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColor),
|
|
5763
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5764
|
-
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColorDark),
|
|
5765
|
-
borderColor: checkedColorDark,
|
|
5766
|
-
backgroundColor: checkedColorDark,
|
|
5767
|
-
}),
|
|
5768
|
-
// This is a workaround for Blink based browsers, which do not reflect the high contrast system colors (e.g.: "Canvas" and "CanvasText") when added to background SVG's.
|
|
5769
|
-
...(isHighContrastMode &&
|
|
5770
|
-
getSchemedHighContrastMediaQuery({
|
|
5771
|
-
backgroundImage: getCheckedSVGBackgroundImage$1('white'),
|
|
5772
|
-
}, {
|
|
5773
|
-
backgroundImage: getCheckedSVGBackgroundImage$1('black'),
|
|
5774
|
-
})),
|
|
5775
|
-
},
|
|
5816
|
+
'input:checked': getCheckboxCheckedBaseStyles(theme, isDisabled, isLoading, state),
|
|
5776
5817
|
'input:indeterminate': {
|
|
5777
5818
|
background, // Safari fix: ensures proper rendering of 'indeterminate' mode with 'checked' state.
|
|
5778
5819
|
borderColor: uncheckedColor, // Safari fix: ensures proper rendering of 'indeterminate' mode with 'checked' state.
|
|
@@ -5857,32 +5898,262 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5857
5898
|
alignSelf: 'flex-start', // in case label becomes multiline
|
|
5858
5899
|
height,
|
|
5859
5900
|
},
|
|
5860
|
-
...(isLoading && {
|
|
5861
|
-
spinner: {
|
|
5862
|
-
position: 'relative', // ensure correct stacking, can be removed as soon as focus for input is handled with outline
|
|
5863
|
-
gridArea: '1/1',
|
|
5864
|
-
placeSelf: 'center',
|
|
5865
|
-
width: dimension,
|
|
5866
|
-
height: dimension,
|
|
5867
|
-
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5868
|
-
pointerEvents: 'none',
|
|
5869
|
-
},
|
|
5870
|
-
}),
|
|
5901
|
+
...(isLoading && {
|
|
5902
|
+
spinner: {
|
|
5903
|
+
position: 'relative', // ensure correct stacking, can be removed as soon as focus for input is handled with outline
|
|
5904
|
+
gridArea: '1/1',
|
|
5905
|
+
placeSelf: 'center',
|
|
5906
|
+
width: dimension,
|
|
5907
|
+
height: dimension,
|
|
5908
|
+
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5909
|
+
pointerEvents: 'none',
|
|
5910
|
+
},
|
|
5911
|
+
}),
|
|
5912
|
+
// .label / .required
|
|
5913
|
+
...getFunctionalComponentLabelStyles(isDisabled || isLoading, hideLabel, theme, {
|
|
5914
|
+
gridArea: '1/2',
|
|
5915
|
+
...(isLoading && { pointerEvents: 'none' }), // prevent default htmlFor behavior. TODO: Remove as soon as label component for custom form components exists.
|
|
5916
|
+
}, {
|
|
5917
|
+
paddingTop,
|
|
5918
|
+
paddingInlineStart,
|
|
5919
|
+
}),
|
|
5920
|
+
// .message
|
|
5921
|
+
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
5922
|
+
gridColumn: '1/3',
|
|
5923
|
+
}),
|
|
5924
|
+
// .loading
|
|
5925
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
5926
|
+
});
|
|
5927
|
+
};
|
|
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
|
+
},
|
|
5871
6148
|
// .label / .required
|
|
5872
|
-
...getFunctionalComponentLabelStyles(
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
paddingInlineStart,
|
|
5878
|
-
}),
|
|
6149
|
+
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
|
|
6150
|
+
!readOnly &&
|
|
6151
|
+
hoverMediaQuery({
|
|
6152
|
+
'&:hover~.wrapper': hoverStyles,
|
|
6153
|
+
})),
|
|
5879
6154
|
// .message
|
|
5880
|
-
...getFunctionalComponentStateMessageStyles(theme, state,
|
|
5881
|
-
|
|
5882
|
-
}),
|
|
5883
|
-
// .loading
|
|
5884
|
-
...getFunctionalComponentLoadingMessageStyles(),
|
|
5885
|
-
});
|
|
6155
|
+
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
6156
|
+
};
|
|
5886
6157
|
};
|
|
5887
6158
|
|
|
5888
6159
|
const widthMap = {
|
|
@@ -5890,7 +6161,7 @@ const widthMap = {
|
|
|
5890
6161
|
basic: gridBasicOffset,
|
|
5891
6162
|
extended: gridExtendedOffset,
|
|
5892
6163
|
};
|
|
5893
|
-
const getComponentCss$
|
|
6164
|
+
const getComponentCss$13 = (width) => {
|
|
5894
6165
|
return getCss({
|
|
5895
6166
|
'@global': {
|
|
5896
6167
|
':host': {
|
|
@@ -5932,7 +6203,7 @@ const getDimensionStyle = {
|
|
|
5932
6203
|
width: 'inherit',
|
|
5933
6204
|
height: 'inherit',
|
|
5934
6205
|
};
|
|
5935
|
-
const getComponentCss$
|
|
6206
|
+
const getComponentCss$12 = () => {
|
|
5936
6207
|
return getCss({
|
|
5937
6208
|
'@global': {
|
|
5938
6209
|
':host': {
|
|
@@ -6031,7 +6302,7 @@ const sizeMap$4 = {
|
|
|
6031
6302
|
medium: fontSizeDisplayMedium,
|
|
6032
6303
|
large: fontSizeDisplayLarge,
|
|
6033
6304
|
};
|
|
6034
|
-
const getComponentCss$
|
|
6305
|
+
const getComponentCss$11 = (size, align, color, ellipsis, theme) => {
|
|
6035
6306
|
return getCss({
|
|
6036
6307
|
'@global': {
|
|
6037
6308
|
':host': {
|
|
@@ -6049,7 +6320,7 @@ const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
|
|
|
6049
6320
|
});
|
|
6050
6321
|
};
|
|
6051
6322
|
|
|
6052
|
-
const getComponentCss
|
|
6323
|
+
const getComponentCss$10 = (color, orientation, theme) => {
|
|
6053
6324
|
const { contrastLowColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
6054
6325
|
const { contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, } = getThemedColors('dark');
|
|
6055
6326
|
const colorMap = {
|
|
@@ -6110,7 +6381,7 @@ const easingOpen = 'in';
|
|
|
6110
6381
|
const dialogDurationClose = 'short';
|
|
6111
6382
|
const backdropDurationClose = 'moderate';
|
|
6112
6383
|
const easingClose = 'out';
|
|
6113
|
-
const getComponentCss
|
|
6384
|
+
const getComponentCss$$ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
|
|
6114
6385
|
const { primaryColor, backgroundColor, backgroundSurfaceColor, backgroundShadingColor } = getThemedColors(theme);
|
|
6115
6386
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, backgroundShadingColor: backgroundShadingColorDark, } = getThemedColors('dark');
|
|
6116
6387
|
return getCss({
|
|
@@ -6357,7 +6628,7 @@ const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme)
|
|
|
6357
6628
|
});
|
|
6358
6629
|
};
|
|
6359
6630
|
|
|
6360
|
-
const getComponentCss$
|
|
6631
|
+
const getComponentCss$_ = (isPrimary, isSecondary, isCascade) => {
|
|
6361
6632
|
return getCss({
|
|
6362
6633
|
'@global': {
|
|
6363
6634
|
'@keyframes slide-up-mobile': {
|
|
@@ -6588,7 +6859,7 @@ const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
|
|
|
6588
6859
|
});
|
|
6589
6860
|
};
|
|
6590
6861
|
|
|
6591
|
-
const getComponentCss$
|
|
6862
|
+
const getComponentCss$Z = (hasSlottedAnchor, isActive) => {
|
|
6592
6863
|
const anchorJssStyle = {
|
|
6593
6864
|
all: 'unset',
|
|
6594
6865
|
padding: `calc(${spacingFluidSmall} + 2px) calc(${spacingFluidSmall} + 4px)`, // aligned with link-pure
|
|
@@ -6640,7 +6911,7 @@ const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
|
|
|
6640
6911
|
});
|
|
6641
6912
|
};
|
|
6642
6913
|
|
|
6643
|
-
const getComponentCss$
|
|
6914
|
+
const getComponentCss$Y = (state, labelSize, hasLabel, theme) => {
|
|
6644
6915
|
return getCss({
|
|
6645
6916
|
'@global': {
|
|
6646
6917
|
':host': {
|
|
@@ -6677,7 +6948,7 @@ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
|
6677
6948
|
});
|
|
6678
6949
|
};
|
|
6679
6950
|
|
|
6680
|
-
const getComponentCss$
|
|
6951
|
+
const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
6681
6952
|
return getCss({
|
|
6682
6953
|
'@global': {
|
|
6683
6954
|
':host': {
|
|
@@ -6724,7 +6995,7 @@ const flexItemWidths = {
|
|
|
6724
6995
|
full: 100,
|
|
6725
6996
|
auto: 'auto',
|
|
6726
6997
|
};
|
|
6727
|
-
const getComponentCss$
|
|
6998
|
+
const getComponentCss$W = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
6728
6999
|
return getCss({
|
|
6729
7000
|
'@global': {
|
|
6730
7001
|
':host': addImportantToEachRule({
|
|
@@ -6746,7 +7017,7 @@ const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
|
6746
7017
|
});
|
|
6747
7018
|
};
|
|
6748
7019
|
|
|
6749
|
-
const getComponentCss$
|
|
7020
|
+
const getComponentCss$V = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
|
|
6750
7021
|
return getCss({
|
|
6751
7022
|
'@global': {
|
|
6752
7023
|
':host': {
|
|
@@ -6936,7 +7207,7 @@ const getDialogStickyAreaJssStyle = (area, theme) => {
|
|
|
6936
7207
|
const cssVariableWidth$2 = '--p-flyout-width';
|
|
6937
7208
|
// TODO: we shouldn't expose --p-flyout-max-width
|
|
6938
7209
|
const cssVariableMaxWidth = '--p-flyout-max-width';
|
|
6939
|
-
const getComponentCss$
|
|
7210
|
+
const getComponentCss$U = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
|
|
6940
7211
|
const isPositionStart = position === 'start' || position === 'left';
|
|
6941
7212
|
const isFooterFixed = footerBehavior === 'fixed';
|
|
6942
7213
|
return getCss({
|
|
@@ -7046,7 +7317,7 @@ const gutter$1 = `calc(${gridGap} / 2)`;
|
|
|
7046
7317
|
const gridItemWidths = [
|
|
7047
7318
|
0, 8.333333, 16.666667, 25, 33.333333, 41.666667, 50, 58.333333, 66.666667, 75, 83.333333, 91.666667, 100,
|
|
7048
7319
|
];
|
|
7049
|
-
const getComponentCss$
|
|
7320
|
+
const getComponentCss$T = (size, offset) => {
|
|
7050
7321
|
return getCss({
|
|
7051
7322
|
'@global': {
|
|
7052
7323
|
':host': addImportantToEachRule({
|
|
@@ -7066,7 +7337,7 @@ const getComponentCss$S = (size, offset) => {
|
|
|
7066
7337
|
};
|
|
7067
7338
|
|
|
7068
7339
|
const gutter = `calc(${gridGap} / -2)`;
|
|
7069
|
-
const getComponentCss$
|
|
7340
|
+
const getComponentCss$S = (direction, wrap) => {
|
|
7070
7341
|
return getCss({
|
|
7071
7342
|
'@global': {
|
|
7072
7343
|
':host': {
|
|
@@ -7092,7 +7363,7 @@ const sizeMap$3 = {
|
|
|
7092
7363
|
'x-large': fontSizeHeadingXLarge,
|
|
7093
7364
|
'xx-large': fontSizeHeadingXXLarge,
|
|
7094
7365
|
};
|
|
7095
|
-
const getComponentCss$
|
|
7366
|
+
const getComponentCss$R = (size, align, color, ellipsis, theme) => {
|
|
7096
7367
|
return getCss({
|
|
7097
7368
|
'@global': {
|
|
7098
7369
|
':host': {
|
|
@@ -7152,7 +7423,7 @@ const getTextSizeJssStyle = (textSize) => {
|
|
|
7152
7423
|
fontSize: textSize === 'inherit' ? textSize : textSizeMap[textSize],
|
|
7153
7424
|
};
|
|
7154
7425
|
};
|
|
7155
|
-
const getComponentCss$
|
|
7426
|
+
const getComponentCss$Q = (variant, align, color, ellipsis, theme) => {
|
|
7156
7427
|
return getCss({
|
|
7157
7428
|
'@global': {
|
|
7158
7429
|
':host': {
|
|
@@ -7263,7 +7534,7 @@ const isFlippableIcon = (name, source) => {
|
|
|
7263
7534
|
name === 'return' ||
|
|
7264
7535
|
name === 'send'));
|
|
7265
7536
|
};
|
|
7266
|
-
const getComponentCss$
|
|
7537
|
+
const getComponentCss$P = (name, source, color, size, theme) => {
|
|
7267
7538
|
const isColorInherit = color === 'inherit';
|
|
7268
7539
|
const isSizeInherit = size === 'inherit';
|
|
7269
7540
|
const isDark = isThemeDark(theme);
|
|
@@ -7382,7 +7653,7 @@ const getHeadingJssStyle = (theme) => ({
|
|
|
7382
7653
|
...headingSmallStyle,
|
|
7383
7654
|
...getTextJssStyle(theme),
|
|
7384
7655
|
});
|
|
7385
|
-
const getComponentCss$
|
|
7656
|
+
const getComponentCss$O = (state, hasAction, hasClose, theme) => {
|
|
7386
7657
|
return getCss({
|
|
7387
7658
|
'@global': {
|
|
7388
7659
|
':host': {
|
|
@@ -7422,235 +7693,51 @@ const getComponentCss$N = (state, hasAction, hasClose, theme) => {
|
|
|
7422
7693
|
});
|
|
7423
7694
|
};
|
|
7424
7695
|
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
|
|
7436
|
-
: 'auto',
|
|
7437
|
-
margin: 0,
|
|
7438
|
-
outline: 0,
|
|
7439
|
-
WebkitAppearance: 'none', // iOS safari
|
|
7440
|
-
appearance: 'none',
|
|
7441
|
-
boxSizing: 'border-box',
|
|
7442
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7443
|
-
borderRadius: borderRadiusSmall,
|
|
7444
|
-
background: 'transparent',
|
|
7445
|
-
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
|
|
7446
|
-
textIndent: 0,
|
|
7447
|
-
color: primaryColor,
|
|
7448
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
7449
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7450
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7451
|
-
color: primaryColorDark,
|
|
7452
|
-
}),
|
|
7453
|
-
...additionalDefaultJssStyle,
|
|
7454
|
-
},
|
|
7455
|
-
'::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, {
|
|
7456
7706
|
textOverflow: 'ellipsis',
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
// with the media query the selector has higher priority and overrides disabled styles
|
|
7461
|
-
[`::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)' : ''}`]: {
|
|
7462
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7463
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7464
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7465
|
-
}),
|
|
7466
|
-
},
|
|
7467
|
-
})),
|
|
7468
|
-
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7469
|
-
[`::slotted(${child}:focus)`]: {
|
|
7470
|
-
borderColor: primaryColor,
|
|
7471
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7472
|
-
borderColor: primaryColorDark,
|
|
7473
|
-
}),
|
|
7474
|
-
},
|
|
7475
|
-
[`::slotted(${child}:disabled)`]: {
|
|
7476
|
-
cursor: 'not-allowed',
|
|
7477
|
-
color: disabledColor,
|
|
7478
|
-
borderColor: disabledColor,
|
|
7479
|
-
WebkitTextFillColor: disabledColor,
|
|
7480
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7481
|
-
color: disabledColorDark,
|
|
7482
|
-
borderColor: disabledColorDark,
|
|
7483
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7484
|
-
}),
|
|
7485
|
-
},
|
|
7486
|
-
...(child !== 'select' && {
|
|
7487
|
-
[`::slotted(${child}[readonly])`]: {
|
|
7488
|
-
borderColor: contrastLowColor,
|
|
7489
|
-
background: contrastLowColor,
|
|
7490
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7491
|
-
borderColor: contrastLowColorDark,
|
|
7492
|
-
background: contrastLowColorDark,
|
|
7493
|
-
}),
|
|
7707
|
+
MozAppearance: 'textfield',
|
|
7708
|
+
'&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
|
|
7709
|
+
WebkitAppearance: 'none',
|
|
7494
7710
|
},
|
|
7495
7711
|
}),
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
const formButtonOrIconPadding = spacingStaticXSmall;
|
|
7502
|
-
// TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
|
|
7503
|
-
// unfortunately line-height alignment breaks for a select element for some reasons then
|
|
7504
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7505
|
-
const formElementPaddingVertical = spacingStaticSmall;
|
|
7506
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7507
|
-
const formElementPaddingHorizontal = spacingStaticMedium;
|
|
7508
|
-
const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
|
|
7509
|
-
// when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
|
|
7510
|
-
return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
|
|
7511
|
-
};
|
|
7512
|
-
// TODO: re-use in textarea-wrapper not only in text-field-wrapper
|
|
7513
|
-
const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
7514
|
-
const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
7515
|
-
const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
7516
|
-
return {
|
|
7517
|
-
pointerEvents: 'none',
|
|
7518
|
-
maxWidth: '100%',
|
|
7519
|
-
boxSizing: 'border-box',
|
|
7520
|
-
whiteSpace: 'nowrap',
|
|
7521
|
-
overflow: 'hidden',
|
|
7522
|
-
textOverflow: 'ellipsis',
|
|
7523
|
-
font: textSmallStyle.font,
|
|
7524
|
-
color: contrastMediumColor,
|
|
7525
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7526
|
-
color: contrastMediumColorDark,
|
|
7527
|
-
}),
|
|
7528
|
-
...(isDisabled && {
|
|
7529
|
-
color: disabledColor,
|
|
7530
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7531
|
-
color: disabledColorDark,
|
|
7532
|
-
}),
|
|
7533
|
-
}),
|
|
7534
|
-
...(isReadonly && {
|
|
7535
|
-
color: contrastHighColor,
|
|
7712
|
+
...(controls && {
|
|
7713
|
+
button: {
|
|
7714
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7715
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7716
|
+
},
|
|
7536
7717
|
}),
|
|
7537
|
-
};
|
|
7718
|
+
});
|
|
7538
7719
|
};
|
|
7539
7720
|
|
|
7540
|
-
|
|
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
|
+
*/
|
|
7541
7728
|
const getComponentCss$M = (disabled, hideLabel, state, toggle, compact, readOnly, theme) => {
|
|
7542
|
-
// Determines the scaling factor for the input-password size. In "compact" mode, it uses 0.5 to achieve a 36px input-password (compact size).
|
|
7543
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputPasswordScaling`.
|
|
7544
|
-
const scalingVar = `var(${cssVarInternalInputPasswordScaling}, ${compact ? 0.5 : 1})`;
|
|
7545
|
-
const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
|
|
7546
|
-
const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
|
|
7547
|
-
// TODO: Ideally, 'compact' should only influence the calculation of scalingVar,
|
|
7548
|
-
// ensuring that the paddingButton calculation solely depends on the scaling factor.
|
|
7549
|
-
const paddingButton = compact ? '0px' : `calc(${formButtonOrIconPadding} * ${scalingVar})`;
|
|
7550
|
-
const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
|
|
7551
|
-
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
7552
|
-
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
7553
|
-
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
7554
|
-
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
7555
|
-
const hoverStyles = {
|
|
7556
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7557
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7558
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7559
|
-
}),
|
|
7560
|
-
};
|
|
7561
7729
|
return getCss({
|
|
7562
|
-
|
|
7563
|
-
'
|
|
7564
|
-
|
|
7565
|
-
...addImportantToEachRule({
|
|
7566
|
-
...colorSchemeStyles,
|
|
7567
|
-
...hostHiddenStyles,
|
|
7568
|
-
}),
|
|
7569
|
-
},
|
|
7570
|
-
...preventFoucOfNestedElementsStyles,
|
|
7571
|
-
input: {
|
|
7572
|
-
all: 'unset',
|
|
7573
|
-
flex: 1,
|
|
7574
|
-
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
|
|
7575
|
-
height,
|
|
7576
|
-
paddingBlock,
|
|
7577
|
-
textIndent: 0,
|
|
7578
|
-
color: primaryColor,
|
|
7579
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7580
|
-
color: primaryColorDark,
|
|
7581
|
-
}),
|
|
7582
|
-
width: '100%',
|
|
7583
|
-
minWidth: '2rem',
|
|
7584
|
-
'&[type="text"]': {
|
|
7585
|
-
textOverflow: 'ellipsis',
|
|
7586
|
-
},
|
|
7587
|
-
},
|
|
7588
|
-
},
|
|
7589
|
-
root: {
|
|
7590
|
-
display: 'grid',
|
|
7591
|
-
gap: spacingStaticXSmall,
|
|
7592
|
-
},
|
|
7593
|
-
wrapper: {
|
|
7594
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7595
|
-
borderRadius: borderRadiusSmall,
|
|
7596
|
-
paddingInlineStart: paddingInline,
|
|
7597
|
-
paddingInlineEnd: toggle ? paddingBlock : paddingInline, // TODO resolve inconsistency in Figma
|
|
7598
|
-
display: 'flex',
|
|
7599
|
-
gap: formElementLayeredGap,
|
|
7600
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
7601
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7602
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7603
|
-
}),
|
|
7604
|
-
'&:has(input:focus:not([readonly]))': {
|
|
7605
|
-
borderColor: primaryColor,
|
|
7606
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7607
|
-
borderColor: primaryColorDark,
|
|
7608
|
-
}),
|
|
7730
|
+
...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
|
|
7731
|
+
'&[type="text"]': {
|
|
7732
|
+
textOverflow: 'ellipsis',
|
|
7609
7733
|
},
|
|
7610
|
-
|
|
7611
|
-
...(!disabled &&
|
|
7612
|
-
!readOnly && {
|
|
7613
|
-
'&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
|
|
7614
|
-
}),
|
|
7615
|
-
}),
|
|
7616
|
-
...(disabled && {
|
|
7617
|
-
cursor: 'not-allowed',
|
|
7618
|
-
color: disabledColor,
|
|
7619
|
-
borderColor: disabledColor,
|
|
7620
|
-
WebkitTextFillColor: disabledColor,
|
|
7621
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7622
|
-
color: disabledColorDark,
|
|
7623
|
-
borderColor: disabledColorDark,
|
|
7624
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7625
|
-
}),
|
|
7626
|
-
}),
|
|
7627
|
-
...(readOnly && {
|
|
7628
|
-
cursor: 'text',
|
|
7629
|
-
borderColor: contrastLowColor,
|
|
7630
|
-
background: contrastLowColor,
|
|
7631
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7632
|
-
borderColor: contrastLowColorDark,
|
|
7633
|
-
background: contrastLowColorDark,
|
|
7634
|
-
}),
|
|
7635
|
-
}),
|
|
7636
|
-
},
|
|
7734
|
+
}),
|
|
7637
7735
|
...(toggle && {
|
|
7638
7736
|
button: {
|
|
7639
|
-
|
|
7640
|
-
|
|
7737
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7738
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7641
7739
|
},
|
|
7642
7740
|
}),
|
|
7643
|
-
// .label / .required
|
|
7644
|
-
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, {
|
|
7645
|
-
...hoverMediaQuery({
|
|
7646
|
-
...(!disabled &&
|
|
7647
|
-
!readOnly && {
|
|
7648
|
-
'&:hover~.wrapper': hoverStyles,
|
|
7649
|
-
}),
|
|
7650
|
-
}),
|
|
7651
|
-
}),
|
|
7652
|
-
// .message
|
|
7653
|
-
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7654
7741
|
});
|
|
7655
7742
|
};
|
|
7656
7743
|
|
|
@@ -7690,12 +7777,12 @@ const getComponentCss$K = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
7690
7777
|
label: {
|
|
7691
7778
|
clip: addImportantToRule('unset'), // to overrule breakpoint customizable hide-label style
|
|
7692
7779
|
},
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7780
|
+
...(isPrimary &&
|
|
7781
|
+
!isHighContrastMode && {
|
|
7782
|
+
icon: {
|
|
7696
7783
|
filter: 'invert(1)',
|
|
7697
|
-
}
|
|
7698
|
-
},
|
|
7784
|
+
},
|
|
7785
|
+
}),
|
|
7699
7786
|
}, hasSlottedAnchor && {
|
|
7700
7787
|
...(isHighContrastMode && {
|
|
7701
7788
|
root: {
|
|
@@ -8578,7 +8665,10 @@ optionHeight, theme) => {
|
|
|
8578
8665
|
};
|
|
8579
8666
|
};
|
|
8580
8667
|
|
|
8581
|
-
const getComponentCss$D = (theme) => {
|
|
8668
|
+
const getComponentCss$D = (theme, isDisabled, selected) => {
|
|
8669
|
+
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${fontLineHeight}))`;
|
|
8670
|
+
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
8671
|
+
const paddingTop = `calc((${dimensionFull} - ${fontLineHeight}) / 2)`; // Vertically centers the checkbox label relative to the checkbox size.
|
|
8582
8672
|
return getCss({
|
|
8583
8673
|
'@global': {
|
|
8584
8674
|
':host': {
|
|
@@ -8588,11 +8678,19 @@ const getComponentCss$D = (theme) => {
|
|
|
8588
8678
|
...hostHiddenStyles,
|
|
8589
8679
|
}),
|
|
8590
8680
|
},
|
|
8591
|
-
|
|
8681
|
+
slot: {
|
|
8682
|
+
display: 'block',
|
|
8683
|
+
paddingTop,
|
|
8684
|
+
},
|
|
8685
|
+
},
|
|
8686
|
+
option: {
|
|
8687
|
+
...getOptionJssStyle('multi-select-option', 1, theme),
|
|
8688
|
+
columnGap: '8px',
|
|
8592
8689
|
},
|
|
8593
|
-
option: getOptionJssStyle('multi-select-option', 1, theme),
|
|
8594
8690
|
checkbox: {
|
|
8595
|
-
|
|
8691
|
+
flexShrink: 0,
|
|
8692
|
+
...getCheckboxBaseStyles(theme, isDisabled),
|
|
8693
|
+
...(selected && getCheckboxCheckedBaseStyles(theme, isDisabled)),
|
|
8596
8694
|
},
|
|
8597
8695
|
});
|
|
8598
8696
|
};
|
|
@@ -11299,4 +11397,4 @@ const getComponentCss = (size, theme) => {
|
|
|
11299
11397
|
});
|
|
11300
11398
|
};
|
|
11301
11399
|
|
|
11302
|
-
export { getComponentCss$
|
|
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 };
|