@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
|
@@ -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();
|
|
@@ -5536,8 +5536,12 @@ const getFunctionalComponentStateMessageStyles = (theme, state, additionalDefaul
|
|
|
5536
5536
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5537
5537
|
color: getThemedFormStateColors('dark', state).formStateColor,
|
|
5538
5538
|
}),
|
|
5539
|
-
transition: getTransition('color'),
|
|
5539
|
+
transition: `${getTransition('color')}, ${getTransition('opacity')}`,
|
|
5540
5540
|
...additionalDefaultJssStyle,
|
|
5541
|
+
'&:empty': {
|
|
5542
|
+
opacity: '0',
|
|
5543
|
+
position: 'absolute',
|
|
5544
|
+
},
|
|
5541
5545
|
},
|
|
5542
5546
|
};
|
|
5543
5547
|
};
|
|
@@ -5548,7 +5552,7 @@ const getCheckedSVGBackgroundImage$2 = (fill) => {
|
|
|
5548
5552
|
const getIndeterminateSVGBackgroundImage$1 = (fill) => {
|
|
5549
5553
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5550
5554
|
};
|
|
5551
|
-
const getComponentCss$
|
|
5555
|
+
const getComponentCss$15 = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
5552
5556
|
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5553
5557
|
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5554
5558
|
const indeterminateIconColor = escapeHashCharacter(getThemedColors(theme).primaryColor);
|
|
@@ -5644,14 +5648,113 @@ const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5644
5648
|
});
|
|
5645
5649
|
};
|
|
5646
5650
|
|
|
5651
|
+
const cssVarInternalCheckboxScaling = '--p-internal-checkbox-scaling';
|
|
5652
|
+
const getCheckboxBaseStyles = (theme, isDisabled, isLoading, state, compact) => {
|
|
5653
|
+
const { contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
5654
|
+
const { contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
5655
|
+
const { formStateColor } = getThemedFormStateColors(theme, state);
|
|
5656
|
+
const { formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
5657
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
5658
|
+
// TODO: needs to be extracted into a color function
|
|
5659
|
+
const uncheckedColor = disabledOrLoading ? disabledColor : formStateColor || contrastMediumColor;
|
|
5660
|
+
const uncheckedColorDark = disabledOrLoading ? disabledColorDark : formStateColorDark || contrastMediumColorDark;
|
|
5661
|
+
const background = `transparent 0% 0% / ${fontLineHeight}`;
|
|
5662
|
+
const minimumTouchTargetSize = '24px'; // Minimum touch target size to comply with accessibility guidelines.
|
|
5663
|
+
const scalingVar = `var(${cssVarInternalCheckboxScaling}, ${compact ? 0.6668 : 1})`;
|
|
5664
|
+
// Determines the scaling factor for the checkbox size. In "compact" mode, it uses 0.6668 to achieve a 20px checkbox (compact size).
|
|
5665
|
+
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalCheckboxScaling`.
|
|
5666
|
+
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${scalingVar} * ${fontLineHeight}))`;
|
|
5667
|
+
// Calculates the checkbox size and ensures a minimum size of 12px (0.75 * SCALING_BASE_VALUE).
|
|
5668
|
+
// Scales proportionally with the line height and the scaling factor.
|
|
5669
|
+
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
5670
|
+
const touchTargetSizeDiff = `calc(${minimumTouchTargetSize} - ${dimensionFull})`; // Difference between the minimum touch target size and the checkbox full size.
|
|
5671
|
+
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.
|
|
5672
|
+
return {
|
|
5673
|
+
position: 'relative',
|
|
5674
|
+
'&::before': {
|
|
5675
|
+
// Ensures the touch target is at least 24px, even if the checkbox is smaller than the minimum touch target size.
|
|
5676
|
+
// This pseudo-element expands the clickable area without affecting the visual size of the checkbox itself.
|
|
5677
|
+
content: '""',
|
|
5678
|
+
position: 'absolute',
|
|
5679
|
+
inset,
|
|
5680
|
+
},
|
|
5681
|
+
width: dimension,
|
|
5682
|
+
height: dimension,
|
|
5683
|
+
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5684
|
+
display: 'block',
|
|
5685
|
+
margin: 0,
|
|
5686
|
+
padding: 0,
|
|
5687
|
+
WebkitAppearance: 'none', // iOS safari
|
|
5688
|
+
appearance: 'none',
|
|
5689
|
+
boxSizing: 'content-box',
|
|
5690
|
+
background,
|
|
5691
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5692
|
+
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5693
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5694
|
+
...(disabledOrLoading
|
|
5695
|
+
? {
|
|
5696
|
+
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
5697
|
+
}
|
|
5698
|
+
: {
|
|
5699
|
+
cursor: 'pointer',
|
|
5700
|
+
}),
|
|
5701
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5702
|
+
borderColor: uncheckedColorDark,
|
|
5703
|
+
}),
|
|
5704
|
+
gridArea: '1/1',
|
|
5705
|
+
borderRadius: borderRadiusSmall,
|
|
5706
|
+
...addImportantToEachRule({
|
|
5707
|
+
backgroundSize: 'cover',
|
|
5708
|
+
}),
|
|
5709
|
+
};
|
|
5710
|
+
};
|
|
5711
|
+
|
|
5647
5712
|
const getCheckedSVGBackgroundImage$1 = (fill) => {
|
|
5648
5713
|
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"/>`);
|
|
5649
5714
|
};
|
|
5715
|
+
const getCheckboxCheckedBaseStyles = (theme, isDisabled, isLoading, state) => {
|
|
5716
|
+
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
5717
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
5718
|
+
const { formStateColor } = getThemedFormStateColors(theme, state);
|
|
5719
|
+
const { formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
5720
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
5721
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
5722
|
+
// TODO: needs to be extracted into a color function
|
|
5723
|
+
const checkedColor = isHighContrastMode
|
|
5724
|
+
? canvasTextColor
|
|
5725
|
+
: disabledOrLoading
|
|
5726
|
+
? disabledColor
|
|
5727
|
+
: formStateColor || primaryColor;
|
|
5728
|
+
const checkedColorDark = isHighContrastMode
|
|
5729
|
+
? canvasTextColor
|
|
5730
|
+
: disabledOrLoading
|
|
5731
|
+
? disabledColorDark
|
|
5732
|
+
: formStateColorDark || primaryColorDark;
|
|
5733
|
+
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5734
|
+
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5735
|
+
return {
|
|
5736
|
+
borderColor: checkedColor,
|
|
5737
|
+
backgroundColor: checkedColor,
|
|
5738
|
+
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColor),
|
|
5739
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5740
|
+
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColorDark),
|
|
5741
|
+
borderColor: checkedColorDark,
|
|
5742
|
+
backgroundColor: checkedColorDark,
|
|
5743
|
+
}),
|
|
5744
|
+
// 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.
|
|
5745
|
+
...(isHighContrastMode &&
|
|
5746
|
+
getSchemedHighContrastMediaQuery({
|
|
5747
|
+
backgroundImage: getCheckedSVGBackgroundImage$1('white'),
|
|
5748
|
+
}, {
|
|
5749
|
+
backgroundImage: getCheckedSVGBackgroundImage$1('black'),
|
|
5750
|
+
})),
|
|
5751
|
+
};
|
|
5752
|
+
};
|
|
5753
|
+
|
|
5650
5754
|
const getIndeterminateSVGBackgroundImage = (fill) => {
|
|
5651
5755
|
return getInlineSVGBackgroundImage(`<path fill="${fill}" d="m20,11v2H4v-2h16Z"/>`);
|
|
5652
5756
|
};
|
|
5653
|
-
const
|
|
5654
|
-
const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
|
|
5757
|
+
const getComponentCss$14 = (hideLabel, state, isDisabled, isLoading, compact, theme) => {
|
|
5655
5758
|
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
|
|
5656
5759
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, focusColor: focusColorDark, } = getThemedColors('dark');
|
|
5657
5760
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
@@ -5675,8 +5778,6 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5675
5778
|
: formStateColorDark || primaryColorDark;
|
|
5676
5779
|
const checkedHoverColor = formStateHoverColor || contrastHighColor;
|
|
5677
5780
|
const checkedHoverColorDark = formStateHoverColorDark || contrastHighColorDark;
|
|
5678
|
-
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
5679
|
-
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
5680
5781
|
const indeterminateIconColor = escapeHashCharacter(disabledOrLoading ? disabledColorDark : formStateColor || primaryColor);
|
|
5681
5782
|
const indeterminateIconColorDark = escapeHashCharacter(formStateColorDark || primaryColorDark);
|
|
5682
5783
|
const indeterminateIconHoverColor = escapeHashCharacter(formStateHoverColor || primaryColor);
|
|
@@ -5684,18 +5785,11 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5684
5785
|
const background = `transparent 0% 0% / ${fontLineHeight}`;
|
|
5685
5786
|
const minimumTouchTargetSize = '24px'; // Minimum touch target size to comply with accessibility guidelines.
|
|
5686
5787
|
const scalingVar = `var(${cssVarInternalCheckboxScaling}, ${compact ? 0.6668 : 1})`;
|
|
5687
|
-
// Determines the scaling factor for the checkbox size. In "compact" mode, it uses 0.6668 to achieve a 20px checkbox (compact size).
|
|
5688
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalCheckboxScaling`.
|
|
5689
5788
|
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${scalingVar} * ${fontLineHeight}))`;
|
|
5690
|
-
// Calculates the checkbox size and ensures a minimum size of 12px (0.75 * SCALING_BASE_VALUE).
|
|
5691
|
-
// Scales proportionally with the line height and the scaling factor.
|
|
5692
5789
|
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
5693
5790
|
const touchTargetSizeDiff = `calc(${minimumTouchTargetSize} - ${dimensionFull})`; // Difference between the minimum touch target size and the checkbox full size.
|
|
5694
5791
|
const paddingInlineStart = `calc(${spacingStaticSmall} - (max(0px, ${touchTargetSizeDiff})))`;
|
|
5695
|
-
// Adjusts padding to maintain consistent spacing when the checkbox is smaller than the minimum touch target size.
|
|
5696
|
-
// Uses asymmetric padding instead of `gap` to ensure there is no non-clickable area between the label and the input.
|
|
5697
5792
|
const paddingTop = `calc((${dimensionFull} - ${fontLineHeight}) / 2)`; // Vertically centers the checkbox label relative to the checkbox size.
|
|
5698
|
-
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.
|
|
5699
5793
|
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.
|
|
5700
5794
|
return getCss({
|
|
5701
5795
|
'@global': {
|
|
@@ -5707,44 +5801,7 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5707
5801
|
}),
|
|
5708
5802
|
},
|
|
5709
5803
|
...preventFoucOfNestedElementsStyles,
|
|
5710
|
-
input:
|
|
5711
|
-
position: 'relative',
|
|
5712
|
-
'&::before': {
|
|
5713
|
-
// Ensures the touch target is at least 24px, even if the checkbox is smaller than the minimum touch target size.
|
|
5714
|
-
// This pseudo-element expands the clickable area without affecting the visual size of the checkbox itself.
|
|
5715
|
-
content: '""',
|
|
5716
|
-
position: 'absolute',
|
|
5717
|
-
inset,
|
|
5718
|
-
},
|
|
5719
|
-
width: dimension,
|
|
5720
|
-
height: dimension,
|
|
5721
|
-
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5722
|
-
display: 'block',
|
|
5723
|
-
margin: 0,
|
|
5724
|
-
padding: 0,
|
|
5725
|
-
WebkitAppearance: 'none', // iOS safari
|
|
5726
|
-
appearance: 'none',
|
|
5727
|
-
boxSizing: 'content-box',
|
|
5728
|
-
background,
|
|
5729
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5730
|
-
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5731
|
-
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5732
|
-
...(disabledOrLoading
|
|
5733
|
-
? {
|
|
5734
|
-
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
5735
|
-
}
|
|
5736
|
-
: {
|
|
5737
|
-
cursor: 'pointer',
|
|
5738
|
-
}),
|
|
5739
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5740
|
-
borderColor: uncheckedColorDark,
|
|
5741
|
-
}),
|
|
5742
|
-
gridArea: '1/1',
|
|
5743
|
-
borderRadius: borderRadiusSmall,
|
|
5744
|
-
...addImportantToEachRule({
|
|
5745
|
-
backgroundSize: 'cover',
|
|
5746
|
-
}),
|
|
5747
|
-
},
|
|
5804
|
+
input: getCheckboxBaseStyles(theme, isDisabled, isLoading, state, compact),
|
|
5748
5805
|
...(isLoading
|
|
5749
5806
|
? {
|
|
5750
5807
|
'input:checked': {
|
|
@@ -5758,23 +5815,7 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5758
5815
|
},
|
|
5759
5816
|
}
|
|
5760
5817
|
: {
|
|
5761
|
-
'input:checked':
|
|
5762
|
-
borderColor: checkedColor,
|
|
5763
|
-
backgroundColor: checkedColor,
|
|
5764
|
-
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColor),
|
|
5765
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5766
|
-
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColorDark),
|
|
5767
|
-
borderColor: checkedColorDark,
|
|
5768
|
-
backgroundColor: checkedColorDark,
|
|
5769
|
-
}),
|
|
5770
|
-
// 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.
|
|
5771
|
-
...(isHighContrastMode &&
|
|
5772
|
-
getSchemedHighContrastMediaQuery({
|
|
5773
|
-
backgroundImage: getCheckedSVGBackgroundImage$1('white'),
|
|
5774
|
-
}, {
|
|
5775
|
-
backgroundImage: getCheckedSVGBackgroundImage$1('black'),
|
|
5776
|
-
})),
|
|
5777
|
-
},
|
|
5818
|
+
'input:checked': getCheckboxCheckedBaseStyles(theme, isDisabled, isLoading, state),
|
|
5778
5819
|
'input:indeterminate': {
|
|
5779
5820
|
background, // Safari fix: ensures proper rendering of 'indeterminate' mode with 'checked' state.
|
|
5780
5821
|
borderColor: uncheckedColor, // Safari fix: ensures proper rendering of 'indeterminate' mode with 'checked' state.
|
|
@@ -5859,32 +5900,262 @@ const getComponentCss$13 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5859
5900
|
alignSelf: 'flex-start', // in case label becomes multiline
|
|
5860
5901
|
height,
|
|
5861
5902
|
},
|
|
5862
|
-
...(isLoading && {
|
|
5863
|
-
spinner: {
|
|
5864
|
-
position: 'relative', // ensure correct stacking, can be removed as soon as focus for input is handled with outline
|
|
5865
|
-
gridArea: '1/1',
|
|
5866
|
-
placeSelf: 'center',
|
|
5867
|
-
width: dimension,
|
|
5868
|
-
height: dimension,
|
|
5869
|
-
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5870
|
-
pointerEvents: 'none',
|
|
5871
|
-
},
|
|
5872
|
-
}),
|
|
5903
|
+
...(isLoading && {
|
|
5904
|
+
spinner: {
|
|
5905
|
+
position: 'relative', // ensure correct stacking, can be removed as soon as focus for input is handled with outline
|
|
5906
|
+
gridArea: '1/1',
|
|
5907
|
+
placeSelf: 'center',
|
|
5908
|
+
width: dimension,
|
|
5909
|
+
height: dimension,
|
|
5910
|
+
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
5911
|
+
pointerEvents: 'none',
|
|
5912
|
+
},
|
|
5913
|
+
}),
|
|
5914
|
+
// .label / .required
|
|
5915
|
+
...getFunctionalComponentLabelStyles(isDisabled || isLoading, hideLabel, theme, {
|
|
5916
|
+
gridArea: '1/2',
|
|
5917
|
+
...(isLoading && { pointerEvents: 'none' }), // prevent default htmlFor behavior. TODO: Remove as soon as label component for custom form components exists.
|
|
5918
|
+
}, {
|
|
5919
|
+
paddingTop,
|
|
5920
|
+
paddingInlineStart,
|
|
5921
|
+
}),
|
|
5922
|
+
// .message
|
|
5923
|
+
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
5924
|
+
gridColumn: '1/3',
|
|
5925
|
+
}),
|
|
5926
|
+
// .loading
|
|
5927
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
5928
|
+
});
|
|
5929
|
+
};
|
|
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
|
+
},
|
|
5873
6150
|
// .label / .required
|
|
5874
|
-
...getFunctionalComponentLabelStyles(
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
paddingInlineStart,
|
|
5880
|
-
}),
|
|
6151
|
+
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, !disabled &&
|
|
6152
|
+
!readOnly &&
|
|
6153
|
+
hoverMediaQuery({
|
|
6154
|
+
'&:hover~.wrapper': hoverStyles,
|
|
6155
|
+
})),
|
|
5881
6156
|
// .message
|
|
5882
|
-
...getFunctionalComponentStateMessageStyles(theme, state,
|
|
5883
|
-
|
|
5884
|
-
}),
|
|
5885
|
-
// .loading
|
|
5886
|
-
...getFunctionalComponentLoadingMessageStyles(),
|
|
5887
|
-
});
|
|
6157
|
+
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
6158
|
+
};
|
|
5888
6159
|
};
|
|
5889
6160
|
|
|
5890
6161
|
const widthMap = {
|
|
@@ -5892,7 +6163,7 @@ const widthMap = {
|
|
|
5892
6163
|
basic: gridBasicOffset,
|
|
5893
6164
|
extended: gridExtendedOffset,
|
|
5894
6165
|
};
|
|
5895
|
-
const getComponentCss$
|
|
6166
|
+
const getComponentCss$13 = (width) => {
|
|
5896
6167
|
return getCss({
|
|
5897
6168
|
'@global': {
|
|
5898
6169
|
':host': {
|
|
@@ -5934,7 +6205,7 @@ const getDimensionStyle = {
|
|
|
5934
6205
|
width: 'inherit',
|
|
5935
6206
|
height: 'inherit',
|
|
5936
6207
|
};
|
|
5937
|
-
const getComponentCss$
|
|
6208
|
+
const getComponentCss$12 = () => {
|
|
5938
6209
|
return getCss({
|
|
5939
6210
|
'@global': {
|
|
5940
6211
|
':host': {
|
|
@@ -6033,7 +6304,7 @@ const sizeMap$4 = {
|
|
|
6033
6304
|
medium: fontSizeDisplayMedium,
|
|
6034
6305
|
large: fontSizeDisplayLarge,
|
|
6035
6306
|
};
|
|
6036
|
-
const getComponentCss$
|
|
6307
|
+
const getComponentCss$11 = (size, align, color, ellipsis, theme) => {
|
|
6037
6308
|
return getCss({
|
|
6038
6309
|
'@global': {
|
|
6039
6310
|
':host': {
|
|
@@ -6051,7 +6322,7 @@ const getComponentCss$10 = (size, align, color, ellipsis, theme) => {
|
|
|
6051
6322
|
});
|
|
6052
6323
|
};
|
|
6053
6324
|
|
|
6054
|
-
const getComponentCss
|
|
6325
|
+
const getComponentCss$10 = (color, orientation, theme) => {
|
|
6055
6326
|
const { contrastLowColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
6056
6327
|
const { contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, } = getThemedColors('dark');
|
|
6057
6328
|
const colorMap = {
|
|
@@ -6112,7 +6383,7 @@ const easingOpen = 'in';
|
|
|
6112
6383
|
const dialogDurationClose = 'short';
|
|
6113
6384
|
const backdropDurationClose = 'moderate';
|
|
6114
6385
|
const easingClose = 'out';
|
|
6115
|
-
const getComponentCss
|
|
6386
|
+
const getComponentCss$$ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme) => {
|
|
6116
6387
|
const { primaryColor, backgroundColor, backgroundSurfaceColor, backgroundShadingColor } = getThemedColors(theme);
|
|
6117
6388
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, backgroundShadingColor: backgroundShadingColorDark, } = getThemedColors('dark');
|
|
6118
6389
|
return getCss({
|
|
@@ -6359,7 +6630,7 @@ const getComponentCss$_ = (isOpen, isPrimary, isSecondaryScrollerVisible, theme)
|
|
|
6359
6630
|
});
|
|
6360
6631
|
};
|
|
6361
6632
|
|
|
6362
|
-
const getComponentCss$
|
|
6633
|
+
const getComponentCss$_ = (isPrimary, isSecondary, isCascade) => {
|
|
6363
6634
|
return getCss({
|
|
6364
6635
|
'@global': {
|
|
6365
6636
|
'@keyframes slide-up-mobile': {
|
|
@@ -6590,7 +6861,7 @@ const getComponentCss$Z = (isPrimary, isSecondary, isCascade) => {
|
|
|
6590
6861
|
});
|
|
6591
6862
|
};
|
|
6592
6863
|
|
|
6593
|
-
const getComponentCss$
|
|
6864
|
+
const getComponentCss$Z = (hasSlottedAnchor, isActive) => {
|
|
6594
6865
|
const anchorJssStyle = {
|
|
6595
6866
|
all: 'unset',
|
|
6596
6867
|
padding: `calc(${spacingFluidSmall} + 2px) calc(${spacingFluidSmall} + 4px)`, // aligned with link-pure
|
|
@@ -6642,7 +6913,7 @@ const getComponentCss$Y = (hasSlottedAnchor, isActive) => {
|
|
|
6642
6913
|
});
|
|
6643
6914
|
};
|
|
6644
6915
|
|
|
6645
|
-
const getComponentCss$
|
|
6916
|
+
const getComponentCss$Y = (state, labelSize, hasLabel, theme) => {
|
|
6646
6917
|
return getCss({
|
|
6647
6918
|
'@global': {
|
|
6648
6919
|
':host': {
|
|
@@ -6679,7 +6950,7 @@ const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
|
6679
6950
|
});
|
|
6680
6951
|
};
|
|
6681
6952
|
|
|
6682
|
-
const getComponentCss$
|
|
6953
|
+
const getComponentCss$X = (state, labelSize, hasLabel, theme) => {
|
|
6683
6954
|
return getCss({
|
|
6684
6955
|
'@global': {
|
|
6685
6956
|
':host': {
|
|
@@ -6726,7 +6997,7 @@ const flexItemWidths = {
|
|
|
6726
6997
|
full: 100,
|
|
6727
6998
|
auto: 'auto',
|
|
6728
6999
|
};
|
|
6729
|
-
const getComponentCss$
|
|
7000
|
+
const getComponentCss$W = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
6730
7001
|
return getCss({
|
|
6731
7002
|
'@global': {
|
|
6732
7003
|
':host': addImportantToEachRule({
|
|
@@ -6748,7 +7019,7 @@ const getComponentCss$V = (width, offset, alignSelf, grow, shrink, flex) => {
|
|
|
6748
7019
|
});
|
|
6749
7020
|
};
|
|
6750
7021
|
|
|
6751
|
-
const getComponentCss$
|
|
7022
|
+
const getComponentCss$V = (inline, wrap, direction, justifyContent, alignItems, alignContent) => {
|
|
6752
7023
|
return getCss({
|
|
6753
7024
|
'@global': {
|
|
6754
7025
|
':host': {
|
|
@@ -6938,7 +7209,7 @@ const getDialogStickyAreaJssStyle = (area, theme) => {
|
|
|
6938
7209
|
const cssVariableWidth$2 = '--p-flyout-width';
|
|
6939
7210
|
// TODO: we shouldn't expose --p-flyout-max-width
|
|
6940
7211
|
const cssVariableMaxWidth = '--p-flyout-max-width';
|
|
6941
|
-
const getComponentCss$
|
|
7212
|
+
const getComponentCss$U = (isOpen, position, hasHeader, hasFooter, hasSubFooter, footerBehavior, theme) => {
|
|
6942
7213
|
const isPositionStart = position === 'start' || position === 'left';
|
|
6943
7214
|
const isFooterFixed = footerBehavior === 'fixed';
|
|
6944
7215
|
return getCss({
|
|
@@ -7048,7 +7319,7 @@ const gutter$1 = `calc(${gridGap} / 2)`;
|
|
|
7048
7319
|
const gridItemWidths = [
|
|
7049
7320
|
0, 8.333333, 16.666667, 25, 33.333333, 41.666667, 50, 58.333333, 66.666667, 75, 83.333333, 91.666667, 100,
|
|
7050
7321
|
];
|
|
7051
|
-
const getComponentCss$
|
|
7322
|
+
const getComponentCss$T = (size, offset) => {
|
|
7052
7323
|
return getCss({
|
|
7053
7324
|
'@global': {
|
|
7054
7325
|
':host': addImportantToEachRule({
|
|
@@ -7068,7 +7339,7 @@ const getComponentCss$S = (size, offset) => {
|
|
|
7068
7339
|
};
|
|
7069
7340
|
|
|
7070
7341
|
const gutter = `calc(${gridGap} / -2)`;
|
|
7071
|
-
const getComponentCss$
|
|
7342
|
+
const getComponentCss$S = (direction, wrap) => {
|
|
7072
7343
|
return getCss({
|
|
7073
7344
|
'@global': {
|
|
7074
7345
|
':host': {
|
|
@@ -7094,7 +7365,7 @@ const sizeMap$3 = {
|
|
|
7094
7365
|
'x-large': fontSizeHeadingXLarge,
|
|
7095
7366
|
'xx-large': fontSizeHeadingXXLarge,
|
|
7096
7367
|
};
|
|
7097
|
-
const getComponentCss$
|
|
7368
|
+
const getComponentCss$R = (size, align, color, ellipsis, theme) => {
|
|
7098
7369
|
return getCss({
|
|
7099
7370
|
'@global': {
|
|
7100
7371
|
':host': {
|
|
@@ -7154,7 +7425,7 @@ const getTextSizeJssStyle = (textSize) => {
|
|
|
7154
7425
|
fontSize: textSize === 'inherit' ? textSize : textSizeMap[textSize],
|
|
7155
7426
|
};
|
|
7156
7427
|
};
|
|
7157
|
-
const getComponentCss$
|
|
7428
|
+
const getComponentCss$Q = (variant, align, color, ellipsis, theme) => {
|
|
7158
7429
|
return getCss({
|
|
7159
7430
|
'@global': {
|
|
7160
7431
|
':host': {
|
|
@@ -7265,7 +7536,7 @@ const isFlippableIcon = (name, source) => {
|
|
|
7265
7536
|
name === 'return' ||
|
|
7266
7537
|
name === 'send'));
|
|
7267
7538
|
};
|
|
7268
|
-
const getComponentCss$
|
|
7539
|
+
const getComponentCss$P = (name, source, color, size, theme) => {
|
|
7269
7540
|
const isColorInherit = color === 'inherit';
|
|
7270
7541
|
const isSizeInherit = size === 'inherit';
|
|
7271
7542
|
const isDark = isThemeDark(theme);
|
|
@@ -7384,7 +7655,7 @@ const getHeadingJssStyle = (theme) => ({
|
|
|
7384
7655
|
...headingSmallStyle,
|
|
7385
7656
|
...getTextJssStyle(theme),
|
|
7386
7657
|
});
|
|
7387
|
-
const getComponentCss$
|
|
7658
|
+
const getComponentCss$O = (state, hasAction, hasClose, theme) => {
|
|
7388
7659
|
return getCss({
|
|
7389
7660
|
'@global': {
|
|
7390
7661
|
':host': {
|
|
@@ -7424,235 +7695,51 @@ const getComponentCss$N = (state, hasAction, hasClose, theme) => {
|
|
|
7424
7695
|
});
|
|
7425
7696
|
};
|
|
7426
7697
|
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
? `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)` // we need 10px additionally so input height becomes 54px
|
|
7438
|
-
: 'auto',
|
|
7439
|
-
margin: 0,
|
|
7440
|
-
outline: 0,
|
|
7441
|
-
WebkitAppearance: 'none', // iOS safari
|
|
7442
|
-
appearance: 'none',
|
|
7443
|
-
boxSizing: 'border-box',
|
|
7444
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7445
|
-
borderRadius: borderRadiusSmall,
|
|
7446
|
-
background: 'transparent',
|
|
7447
|
-
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
|
|
7448
|
-
textIndent: 0,
|
|
7449
|
-
color: primaryColor,
|
|
7450
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
7451
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7452
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7453
|
-
color: primaryColorDark,
|
|
7454
|
-
}),
|
|
7455
|
-
...additionalDefaultJssStyle,
|
|
7456
|
-
},
|
|
7457
|
-
'::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, {
|
|
7458
7708
|
textOverflow: 'ellipsis',
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
// with the media query the selector has higher priority and overrides disabled styles
|
|
7463
|
-
[`::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)' : ''}`]: {
|
|
7464
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7465
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7466
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7467
|
-
}),
|
|
7468
|
-
},
|
|
7469
|
-
})),
|
|
7470
|
-
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7471
|
-
[`::slotted(${child}:focus)`]: {
|
|
7472
|
-
borderColor: primaryColor,
|
|
7473
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7474
|
-
borderColor: primaryColorDark,
|
|
7475
|
-
}),
|
|
7476
|
-
},
|
|
7477
|
-
[`::slotted(${child}:disabled)`]: {
|
|
7478
|
-
cursor: 'not-allowed',
|
|
7479
|
-
color: disabledColor,
|
|
7480
|
-
borderColor: disabledColor,
|
|
7481
|
-
WebkitTextFillColor: disabledColor,
|
|
7482
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7483
|
-
color: disabledColorDark,
|
|
7484
|
-
borderColor: disabledColorDark,
|
|
7485
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7486
|
-
}),
|
|
7487
|
-
},
|
|
7488
|
-
...(child !== 'select' && {
|
|
7489
|
-
[`::slotted(${child}[readonly])`]: {
|
|
7490
|
-
borderColor: contrastLowColor,
|
|
7491
|
-
background: contrastLowColor,
|
|
7492
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7493
|
-
borderColor: contrastLowColorDark,
|
|
7494
|
-
background: contrastLowColorDark,
|
|
7495
|
-
}),
|
|
7709
|
+
MozAppearance: 'textfield',
|
|
7710
|
+
'&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
|
|
7711
|
+
WebkitAppearance: 'none',
|
|
7496
7712
|
},
|
|
7497
7713
|
}),
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
const formButtonOrIconPadding = spacingStaticXSmall;
|
|
7504
|
-
// TODO: if we'd use 12px instead, it wouldn't be necessary for textarea to have a custom vertical padding,
|
|
7505
|
-
// unfortunately line-height alignment breaks for a select element for some reasons then
|
|
7506
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7507
|
-
const formElementPaddingVertical = spacingStaticSmall;
|
|
7508
|
-
// TODO: basic form element padding can already be set within style function instead of on component style level
|
|
7509
|
-
const formElementPaddingHorizontal = spacingStaticMedium;
|
|
7510
|
-
const getCalculatedFormElementPaddingHorizontal = (buttonOrIconAmount) => {
|
|
7511
|
-
// when applied, font-family and font-size needs to be set too for correct calculation of ex-unit ($fontLineHeight)
|
|
7512
|
-
return `calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} / 2 + (${fontLineHeight} + ${formButtonOrIconPadding} * 2) * ${buttonOrIconAmount})`;
|
|
7513
|
-
};
|
|
7514
|
-
// TODO: re-use in textarea-wrapper not only in text-field-wrapper
|
|
7515
|
-
const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
7516
|
-
const { disabledColor, contrastMediumColor, contrastHighColor } = getThemedColors(theme);
|
|
7517
|
-
const { disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
7518
|
-
return {
|
|
7519
|
-
pointerEvents: 'none',
|
|
7520
|
-
maxWidth: '100%',
|
|
7521
|
-
boxSizing: 'border-box',
|
|
7522
|
-
whiteSpace: 'nowrap',
|
|
7523
|
-
overflow: 'hidden',
|
|
7524
|
-
textOverflow: 'ellipsis',
|
|
7525
|
-
font: textSmallStyle.font,
|
|
7526
|
-
color: contrastMediumColor,
|
|
7527
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7528
|
-
color: contrastMediumColorDark,
|
|
7529
|
-
}),
|
|
7530
|
-
...(isDisabled && {
|
|
7531
|
-
color: disabledColor,
|
|
7532
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7533
|
-
color: disabledColorDark,
|
|
7534
|
-
}),
|
|
7535
|
-
}),
|
|
7536
|
-
...(isReadonly && {
|
|
7537
|
-
color: contrastHighColor,
|
|
7714
|
+
...(controls && {
|
|
7715
|
+
button: {
|
|
7716
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7717
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7718
|
+
},
|
|
7538
7719
|
}),
|
|
7539
|
-
};
|
|
7720
|
+
});
|
|
7540
7721
|
};
|
|
7541
7722
|
|
|
7542
|
-
|
|
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
|
+
*/
|
|
7543
7730
|
const getComponentCss$M = (disabled, hideLabel, state, toggle, compact, readOnly, theme) => {
|
|
7544
|
-
// Determines the scaling factor for the input-password size. In "compact" mode, it uses 0.5 to achieve a 36px input-password (compact size).
|
|
7545
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalInputPasswordScaling`.
|
|
7546
|
-
const scalingVar = `var(${cssVarInternalInputPasswordScaling}, ${compact ? 0.5 : 1})`;
|
|
7547
|
-
const paddingBlock = `max(2px, ${formElementPaddingVertical} * ${scalingVar})`;
|
|
7548
|
-
const paddingInline = `max(2px, ${formElementPaddingHorizontal} * ${scalingVar})`;
|
|
7549
|
-
// TODO: Ideally, 'compact' should only influence the calculation of scalingVar,
|
|
7550
|
-
// ensuring that the paddingButton calculation solely depends on the scaling factor.
|
|
7551
|
-
const paddingButton = compact ? '0px' : `calc(${formButtonOrIconPadding} * ${scalingVar})`;
|
|
7552
|
-
const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
|
|
7553
|
-
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
7554
|
-
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
7555
|
-
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
7556
|
-
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
7557
|
-
const hoverStyles = {
|
|
7558
|
-
borderColor: formStateHoverColor || primaryColor,
|
|
7559
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7560
|
-
borderColor: formStateHoverColorDark || primaryColorDark,
|
|
7561
|
-
}),
|
|
7562
|
-
};
|
|
7563
7731
|
return getCss({
|
|
7564
|
-
|
|
7565
|
-
'
|
|
7566
|
-
|
|
7567
|
-
...addImportantToEachRule({
|
|
7568
|
-
...colorSchemeStyles,
|
|
7569
|
-
...hostHiddenStyles,
|
|
7570
|
-
}),
|
|
7571
|
-
},
|
|
7572
|
-
...preventFoucOfNestedElementsStyles,
|
|
7573
|
-
input: {
|
|
7574
|
-
all: 'unset',
|
|
7575
|
-
flex: 1,
|
|
7576
|
-
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
|
|
7577
|
-
height,
|
|
7578
|
-
paddingBlock,
|
|
7579
|
-
textIndent: 0,
|
|
7580
|
-
color: primaryColor,
|
|
7581
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7582
|
-
color: primaryColorDark,
|
|
7583
|
-
}),
|
|
7584
|
-
width: '100%',
|
|
7585
|
-
minWidth: '2rem',
|
|
7586
|
-
'&[type="text"]': {
|
|
7587
|
-
textOverflow: 'ellipsis',
|
|
7588
|
-
},
|
|
7589
|
-
},
|
|
7590
|
-
},
|
|
7591
|
-
root: {
|
|
7592
|
-
display: 'grid',
|
|
7593
|
-
gap: spacingStaticXSmall,
|
|
7594
|
-
},
|
|
7595
|
-
wrapper: {
|
|
7596
|
-
border: `${borderWidthBase} solid ${formStateColor || contrastMediumColor}`,
|
|
7597
|
-
borderRadius: borderRadiusSmall,
|
|
7598
|
-
paddingInlineStart: paddingInline,
|
|
7599
|
-
paddingInlineEnd: toggle ? paddingBlock : paddingInline, // TODO resolve inconsistency in Figma
|
|
7600
|
-
display: 'flex',
|
|
7601
|
-
gap: formElementLayeredGap,
|
|
7602
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
7603
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7604
|
-
borderColor: formStateColorDark || contrastMediumColorDark,
|
|
7605
|
-
}),
|
|
7606
|
-
'&:has(input:focus:not([readonly]))': {
|
|
7607
|
-
borderColor: primaryColor,
|
|
7608
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7609
|
-
borderColor: primaryColorDark,
|
|
7610
|
-
}),
|
|
7732
|
+
...getFunctionalComponentInputBaseStyles(disabled, hideLabel, state, compact, readOnly, theme, {
|
|
7733
|
+
'&[type="text"]': {
|
|
7734
|
+
textOverflow: 'ellipsis',
|
|
7611
7735
|
},
|
|
7612
|
-
|
|
7613
|
-
...(!disabled &&
|
|
7614
|
-
!readOnly && {
|
|
7615
|
-
'&:hover:not(:has(.button:hover, input:focus ))': hoverStyles,
|
|
7616
|
-
}),
|
|
7617
|
-
}),
|
|
7618
|
-
...(disabled && {
|
|
7619
|
-
cursor: 'not-allowed',
|
|
7620
|
-
color: disabledColor,
|
|
7621
|
-
borderColor: disabledColor,
|
|
7622
|
-
WebkitTextFillColor: disabledColor,
|
|
7623
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7624
|
-
color: disabledColorDark,
|
|
7625
|
-
borderColor: disabledColorDark,
|
|
7626
|
-
WebkitTextFillColor: disabledColorDark,
|
|
7627
|
-
}),
|
|
7628
|
-
}),
|
|
7629
|
-
...(readOnly && {
|
|
7630
|
-
cursor: 'text',
|
|
7631
|
-
borderColor: contrastLowColor,
|
|
7632
|
-
background: contrastLowColor,
|
|
7633
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7634
|
-
borderColor: contrastLowColorDark,
|
|
7635
|
-
background: contrastLowColorDark,
|
|
7636
|
-
}),
|
|
7637
|
-
}),
|
|
7638
|
-
},
|
|
7736
|
+
}),
|
|
7639
7737
|
...(toggle && {
|
|
7640
7738
|
button: {
|
|
7641
|
-
|
|
7642
|
-
|
|
7739
|
+
padding: `var(${cssVarButtonPurePadding})`,
|
|
7740
|
+
margin: `var(${cssVarButtonPureMargin})`,
|
|
7643
7741
|
},
|
|
7644
7742
|
}),
|
|
7645
|
-
// .label / .required
|
|
7646
|
-
...getFunctionalComponentLabelStyles(disabled, hideLabel, theme, {
|
|
7647
|
-
...hoverMediaQuery({
|
|
7648
|
-
...(!disabled &&
|
|
7649
|
-
!readOnly && {
|
|
7650
|
-
'&:hover~.wrapper': hoverStyles,
|
|
7651
|
-
}),
|
|
7652
|
-
}),
|
|
7653
|
-
}),
|
|
7654
|
-
// .message
|
|
7655
|
-
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7656
7743
|
});
|
|
7657
7744
|
};
|
|
7658
7745
|
|
|
@@ -7692,12 +7779,12 @@ const getComponentCss$K = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
7692
7779
|
label: {
|
|
7693
7780
|
clip: addImportantToRule('unset'), // to overrule breakpoint customizable hide-label style
|
|
7694
7781
|
},
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7782
|
+
...(isPrimary &&
|
|
7783
|
+
!isHighContrastMode && {
|
|
7784
|
+
icon: {
|
|
7698
7785
|
filter: 'invert(1)',
|
|
7699
|
-
}
|
|
7700
|
-
},
|
|
7786
|
+
},
|
|
7787
|
+
}),
|
|
7701
7788
|
}, hasSlottedAnchor && {
|
|
7702
7789
|
...(isHighContrastMode && {
|
|
7703
7790
|
root: {
|
|
@@ -8580,7 +8667,10 @@ optionHeight, theme) => {
|
|
|
8580
8667
|
};
|
|
8581
8668
|
};
|
|
8582
8669
|
|
|
8583
|
-
const getComponentCss$D = (theme) => {
|
|
8670
|
+
const getComponentCss$D = (theme, isDisabled, selected) => {
|
|
8671
|
+
const dimension = `calc(max(${SCALING_BASE_VALUE} * 0.75, ${fontLineHeight}))`;
|
|
8672
|
+
const dimensionFull = `calc(${dimension} + ${borderWidthBase} * 2)`; // Calculates the total size of the checkbox including its borders.
|
|
8673
|
+
const paddingTop = `calc((${dimensionFull} - ${fontLineHeight}) / 2)`; // Vertically centers the checkbox label relative to the checkbox size.
|
|
8584
8674
|
return getCss({
|
|
8585
8675
|
'@global': {
|
|
8586
8676
|
':host': {
|
|
@@ -8590,11 +8680,19 @@ const getComponentCss$D = (theme) => {
|
|
|
8590
8680
|
...hostHiddenStyles,
|
|
8591
8681
|
}),
|
|
8592
8682
|
},
|
|
8593
|
-
|
|
8683
|
+
slot: {
|
|
8684
|
+
display: 'block',
|
|
8685
|
+
paddingTop,
|
|
8686
|
+
},
|
|
8687
|
+
},
|
|
8688
|
+
option: {
|
|
8689
|
+
...getOptionJssStyle('multi-select-option', 1, theme),
|
|
8690
|
+
columnGap: '8px',
|
|
8594
8691
|
},
|
|
8595
|
-
option: getOptionJssStyle('multi-select-option', 1, theme),
|
|
8596
8692
|
checkbox: {
|
|
8597
|
-
|
|
8693
|
+
flexShrink: 0,
|
|
8694
|
+
...getCheckboxBaseStyles(theme, isDisabled),
|
|
8695
|
+
...(selected && getCheckboxCheckedBaseStyles(theme, isDisabled)),
|
|
8598
8696
|
},
|
|
8599
8697
|
});
|
|
8600
8698
|
};
|
|
@@ -11301,38 +11399,43 @@ const getComponentCss = (size, theme) => {
|
|
|
11301
11399
|
});
|
|
11302
11400
|
};
|
|
11303
11401
|
|
|
11304
|
-
exports.
|
|
11305
|
-
exports.
|
|
11306
|
-
exports.
|
|
11307
|
-
exports.
|
|
11308
|
-
exports.
|
|
11309
|
-
exports.
|
|
11310
|
-
exports.
|
|
11311
|
-
exports.
|
|
11312
|
-
exports.
|
|
11313
|
-
exports.
|
|
11314
|
-
exports.
|
|
11315
|
-
exports.
|
|
11316
|
-
exports.
|
|
11317
|
-
exports.
|
|
11318
|
-
exports.
|
|
11319
|
-
exports.
|
|
11320
|
-
exports.
|
|
11321
|
-
exports.
|
|
11322
|
-
exports.
|
|
11323
|
-
exports.
|
|
11324
|
-
exports.
|
|
11325
|
-
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;
|
|
11326
11428
|
exports.getFunctionalComponentLabelStyles = getFunctionalComponentLabelStyles;
|
|
11327
11429
|
exports.getFunctionalComponentLoadingMessageStyles = getFunctionalComponentLoadingMessageStyles;
|
|
11328
11430
|
exports.getFunctionalComponentRequiredStyles = getFunctionalComponentRequiredStyles;
|
|
11329
11431
|
exports.getFunctionalComponentStateMessageStyles = getFunctionalComponentStateMessageStyles;
|
|
11330
|
-
exports.getGridCss = getComponentCss$
|
|
11331
|
-
exports.getGridItemCss = getComponentCss$
|
|
11332
|
-
exports.getHeadingCss = getComponentCss$
|
|
11333
|
-
exports.getHeadlineCss = getComponentCss$
|
|
11334
|
-
exports.getIconCss = getComponentCss$
|
|
11335
|
-
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;
|
|
11336
11439
|
exports.getInputPasswordCss = getComponentCss$M;
|
|
11337
11440
|
exports.getLinkCss = getComponentCss$K;
|
|
11338
11441
|
exports.getLinkPureCss = getComponentCss$L;
|
|
@@ -11350,6 +11453,7 @@ exports.getPaginationCss = getComponentCss$A;
|
|
|
11350
11453
|
exports.getPinCodeCss = getComponentCss$z;
|
|
11351
11454
|
exports.getPopoverCss = getComponentCss$y;
|
|
11352
11455
|
exports.getRadioButtonWrapperCss = getComponentCss$x;
|
|
11456
|
+
exports.getScalingVar = getScalingVar;
|
|
11353
11457
|
exports.getScrollerCss = getComponentCss$w;
|
|
11354
11458
|
exports.getSegmentedControlCss = getComponentCss$u;
|
|
11355
11459
|
exports.getSegmentedControlItemCss = getComponentCss$v;
|