@porsche-design-system/components-react 4.0.0-beta.0 → 4.0.0-beta.1
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 +158 -1
- package/cjs/lib/components/accordion.wrapper.cjs +3 -3
- package/esm/lib/components/accordion.wrapper.d.ts +29 -13
- package/esm/lib/components/accordion.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +116 -102
- package/package.json +13 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +407 -186
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs +15 -10
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.cjs +2 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +407 -186
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +15 -10
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.mjs +2 -1
- package/ssr/esm/lib/components/accordion.wrapper.d.ts +29 -13
- package/ssr/esm/lib/dsr-components/accordion.d.ts +8 -2
- package/ssr/esm/lib/types.d.ts +116 -102
|
@@ -14,15 +14,15 @@ const borderWidthBase = '2px';
|
|
|
14
14
|
/** @deprecated since v4.0.0, will be removed with next major release. Use 1px instead. */
|
|
15
15
|
const borderWidthThin = '1px';
|
|
16
16
|
|
|
17
|
-
const fontPorscheNext = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
|
|
17
|
+
const fontPorscheNext$1 = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
|
|
18
18
|
|
|
19
19
|
/** @deprecated since v4.0.0, will be removed with next major release. Use fontPorscheNext instead. */
|
|
20
|
-
const fontFamily = fontPorscheNext;
|
|
20
|
+
const fontFamily = fontPorscheNext$1;
|
|
21
21
|
|
|
22
|
-
const leadingNormal = 'calc(6px + 2.125ex)';
|
|
22
|
+
const leadingNormal$1 = 'calc(6px + 2.125ex)';
|
|
23
23
|
|
|
24
24
|
/** @deprecated since v4.0.0, will be removed with next major release. Use leadingNormal instead */
|
|
25
|
-
const fontLineHeight = leadingNormal;
|
|
25
|
+
const fontLineHeight = leadingNormal$1;
|
|
26
26
|
|
|
27
27
|
const fontSizeDisplayLarge = 'clamp(2.28rem, 5.2vw + 1.24rem, 7.48rem)';
|
|
28
28
|
|
|
@@ -35,15 +35,15 @@ const typescaleLg = 'clamp(1.27rem, 0.51vw + 1.16rem, 1.78rem)';
|
|
|
35
35
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleLg instead. */
|
|
36
36
|
const fontSizeHeadingLarge = typescaleLg;
|
|
37
37
|
|
|
38
|
-
const typescaleMd = 'clamp(1.13rem, 0.21vw + 1.08rem, 1.33rem)';
|
|
38
|
+
const typescaleMd$1 = 'clamp(1.13rem, 0.21vw + 1.08rem, 1.33rem)';
|
|
39
39
|
|
|
40
40
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleMd instead. */
|
|
41
|
-
const fontSizeHeadingMedium = typescaleMd;
|
|
41
|
+
const fontSizeHeadingMedium = typescaleMd$1;
|
|
42
42
|
|
|
43
|
-
const typescaleSm = '1rem';
|
|
43
|
+
const typescaleSm$1 = '1rem';
|
|
44
44
|
|
|
45
45
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleSm instead. */
|
|
46
|
-
const fontSizeHeadingSmall = typescaleSm;
|
|
46
|
+
const fontSizeHeadingSmall = typescaleSm$1;
|
|
47
47
|
|
|
48
48
|
const typescaleXl = 'clamp(1.42rem, 0.94vw + 1.23rem, 2.37rem)';
|
|
49
49
|
|
|
@@ -59,10 +59,10 @@ const fontSizeHeadingXXLarge = typescale2Xl;
|
|
|
59
59
|
const fontSizeTextLarge = typescaleLg;
|
|
60
60
|
|
|
61
61
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleMd instead. */
|
|
62
|
-
const fontSizeTextMedium = typescaleMd;
|
|
62
|
+
const fontSizeTextMedium = typescaleMd$1;
|
|
63
63
|
|
|
64
64
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleSm instead. */
|
|
65
|
-
const fontSizeTextSmall = typescaleSm;
|
|
65
|
+
const fontSizeTextSmall = typescaleSm$1;
|
|
66
66
|
|
|
67
67
|
/** @deprecated since v4.0.0, will be removed with next major release. Use typescaleXl instead. */
|
|
68
68
|
const fontSizeTextXLarge = typescaleXl;
|
|
@@ -98,10 +98,10 @@ const fontWeightNormal = 400;
|
|
|
98
98
|
/** @deprecated since v4.0.0, will be removed with next major release. Use fontWeightNormal instead. */
|
|
99
99
|
const fontWeightRegular = fontWeightNormal;
|
|
100
100
|
|
|
101
|
-
const fontWeightSemibold = 600;
|
|
101
|
+
const fontWeightSemibold$1 = 600;
|
|
102
102
|
|
|
103
103
|
/** @deprecated since v4.0.0, will be removed with next major release. Use fontWeightSemibold instead. */
|
|
104
|
-
const fontWeightSemiBold = fontWeightSemibold;
|
|
104
|
+
const fontWeightSemiBold = fontWeightSemibold$1;
|
|
105
105
|
|
|
106
106
|
const fontWeightBold$1 = 700;
|
|
107
107
|
|
|
@@ -388,7 +388,7 @@ const textMediumStyle = {
|
|
|
388
388
|
};
|
|
389
389
|
|
|
390
390
|
const proseTextSmStyle = {
|
|
391
|
-
font: `normal normal ${fontWeightNormal} ${typescaleSm} / ${leadingNormal} ${fontPorscheNext}`,
|
|
391
|
+
font: `normal normal ${fontWeightNormal} ${typescaleSm$1} / ${leadingNormal$1} ${fontPorscheNext$1}`,
|
|
392
392
|
...fontHyphenationStyle,
|
|
393
393
|
};
|
|
394
394
|
|
|
@@ -466,6 +466,20 @@ const colorWarningFrosted = 'var(--p-color-warning-frosted)';
|
|
|
466
466
|
|
|
467
467
|
const colorWarningFrostedSoft = 'var(--p-color-warning-frosted-soft)';
|
|
468
468
|
|
|
469
|
+
const fontPorscheNext = 'var(--p-font-porsche-next)';
|
|
470
|
+
|
|
471
|
+
const leadingNormal = 'var(--p-leading-normal)';
|
|
472
|
+
|
|
473
|
+
const typescaleMd = 'var(--p-typescale-md)';
|
|
474
|
+
|
|
475
|
+
const typescaleSm = 'var(--p-typescale-sm)';
|
|
476
|
+
|
|
477
|
+
const fontWeightSemibold = 'var(--p-font-weight-semibold)';
|
|
478
|
+
|
|
479
|
+
const forcedColorsMediaQuery = (style) => {
|
|
480
|
+
return { '@media (forced-colors: active)': style };
|
|
481
|
+
};
|
|
482
|
+
|
|
469
483
|
const motionDurationMap = {
|
|
470
484
|
short: motionDurationShort,
|
|
471
485
|
moderate: motionDurationModerate,
|
|
@@ -503,11 +517,18 @@ const getFocusBaseStyles = () => {
|
|
|
503
517
|
return {
|
|
504
518
|
outline: `${borderWidthBase} solid ${colorFocus}`,
|
|
505
519
|
outlineOffset: '2px',
|
|
520
|
+
...forcedColorsMediaQuery({
|
|
521
|
+
outlineColor: 'Highlight',
|
|
522
|
+
}),
|
|
506
523
|
};
|
|
507
524
|
};
|
|
508
525
|
const getDisabledBaseStyles = () => {
|
|
509
526
|
return {
|
|
510
527
|
opacity: alphaDisabled,
|
|
528
|
+
...forcedColorsMediaQuery({
|
|
529
|
+
opacity: 1,
|
|
530
|
+
color: 'GrayText',
|
|
531
|
+
}),
|
|
511
532
|
};
|
|
512
533
|
};
|
|
513
534
|
/**
|
|
@@ -3882,7 +3903,7 @@ const OPTION_LIST_SAFE_ZONE = 6;
|
|
|
3882
3903
|
|
|
3883
3904
|
const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
|
|
3884
3905
|
|
|
3885
|
-
const prefix = `[Porsche Design System v${"4.0.0-beta.
|
|
3906
|
+
const prefix = `[Porsche Design System v${"4.0.0-beta.1"}]` // this part isn't covered by unit tests
|
|
3886
3907
|
;
|
|
3887
3908
|
const consoleError = (...messages) => {
|
|
3888
3909
|
console.error(prefix, ...messages);
|
|
@@ -3991,130 +4012,195 @@ const breakpointCustomizableTemplate = `value, ${internalValidateProps
|
|
|
3991
4012
|
.formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {}))
|
|
3992
4013
|
.replace(/"/g, '')}`;
|
|
3993
4014
|
|
|
3994
|
-
const
|
|
3995
|
-
|
|
4015
|
+
const getInlineSVGBackgroundImage = (path) => {
|
|
4016
|
+
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
4017
|
+
};
|
|
4018
|
+
|
|
4019
|
+
/**
|
|
4020
|
+
* @css-variable {"name": "--p-accordion-summary-top", "description": "Controls the sticky top position when `sticky` is enabled.", "defaultValue": "0px"}
|
|
4021
|
+
*/
|
|
4022
|
+
const cssVarSummaryTop = '--p-accordion-summary-top';
|
|
4023
|
+
const cssVarSummaryTopDeprecated = '--p-accordion-position-sticky-top'; // deprecated
|
|
4024
|
+
/**
|
|
4025
|
+
* @css-variable {"name": "--p-accordion-px", "description": "Horizontal padding of the accordion.", "defaultValue": "16px"}
|
|
4026
|
+
*/
|
|
4027
|
+
const cssVarPaddingInline$1 = '--p-accordion-px';
|
|
4028
|
+
/**
|
|
4029
|
+
* @css-variable {"name": "--p-accordion-py", "description": "Vertical padding of the accordion.", "defaultValue": "16px"}
|
|
4030
|
+
*/
|
|
4031
|
+
const cssVarPaddingBlock = '--p-accordion-py';
|
|
3996
4032
|
// CSS Variable defined in fontHyphenationStyle
|
|
3997
4033
|
/**
|
|
3998
4034
|
* @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
|
|
3999
4035
|
*/
|
|
4000
|
-
const
|
|
4036
|
+
const icon = getInlineSVGBackgroundImage(`<path d="m12 15.125h-.001l-.005-.006-6.494-5.476.642-.768 5.858 4.94 5.858-4.94.642.769-6.497 5.477z"/>`);
|
|
4037
|
+
const backgroundMap = {
|
|
4038
|
+
canvas: colorCanvas,
|
|
4039
|
+
surface: colorSurface,
|
|
4040
|
+
frosted: colorFrosted,
|
|
4041
|
+
none: 'transparent',
|
|
4042
|
+
};
|
|
4043
|
+
// as soon as CSS selector `:has-slotted` works cross-browser we can simplify the styles a lot and remove all the complexity regarding the summary-before and summary-after slots
|
|
4044
|
+
const getComponentCss$19 = (alignMarker, background, isCompact, isOpen, isSticky, hasSummaryBefore, hasSummaryAfter, size) => {
|
|
4045
|
+
const duration = isOpen ? 'moderate' : 'short';
|
|
4046
|
+
const easing = isOpen ? 'in' : 'out';
|
|
4047
|
+
const compactFactor = isCompact ? 0.64285714 : 1;
|
|
4048
|
+
const paddingBlock = `calc(28px * (${compactFactor} - 0.64285714) + 6px)`;
|
|
4049
|
+
const paddingInline = `calc(11.2px * (${compactFactor} - 0.64285714) + 12px)`;
|
|
4050
|
+
const gap = `calc(11.2px * (${compactFactor} - 0.64285714) + 4px)`;
|
|
4051
|
+
const marginTop = `calc(28px * (${compactFactor} - 0.64285714) + 6px)`;
|
|
4052
|
+
const isIconAlignedStart = alignMarker === 'start';
|
|
4001
4053
|
return getCss({
|
|
4002
4054
|
'@global': {
|
|
4055
|
+
'@keyframes overflow-hidden': {
|
|
4056
|
+
from: { overflow: 'hidden' },
|
|
4057
|
+
to: { overflow: 'hidden' },
|
|
4058
|
+
},
|
|
4003
4059
|
':host': {
|
|
4004
4060
|
display: 'block',
|
|
4005
4061
|
...addImportantToEachRule({
|
|
4006
|
-
...(compact
|
|
4007
|
-
? { transform: 'translate3d(0,0,0)' } // relevant for custom click-area in compact variant
|
|
4008
|
-
: {
|
|
4009
|
-
borderBottom: `1px solid ${colorContrastLower}`,
|
|
4010
|
-
}),
|
|
4011
|
-
'&(:only-of-type)': { borderBottom: 0 },
|
|
4012
4062
|
...hostHiddenStyles,
|
|
4013
4063
|
}),
|
|
4014
4064
|
},
|
|
4015
|
-
|
|
4016
|
-
|
|
4065
|
+
slot: {
|
|
4066
|
+
'&[name="summary-before"], &[name="summary"], &[name="summary-after"]': {
|
|
4067
|
+
display: 'flex',
|
|
4068
|
+
flexWrap: 'wrap',
|
|
4069
|
+
alignItems: 'center',
|
|
4070
|
+
gap,
|
|
4071
|
+
},
|
|
4072
|
+
'&[name="summary-before"]': {
|
|
4073
|
+
gridArea: `1/${isIconAlignedStart ? '2' : '1'}`,
|
|
4074
|
+
zIndex: 2, // ensures stacking to be above the summary section
|
|
4075
|
+
},
|
|
4076
|
+
'&[name="summary"]': {
|
|
4077
|
+
gridArea: `1/${hasSummaryBefore && isIconAlignedStart ? '3' : hasSummaryBefore || isIconAlignedStart ? '2' : '1'}`,
|
|
4078
|
+
},
|
|
4079
|
+
'&[name="summary-after"]': {
|
|
4080
|
+
gridArea: `1/${hasSummaryBefore && isIconAlignedStart ? '4' : hasSummaryBefore || isIconAlignedStart ? '3' : '2'}`,
|
|
4081
|
+
zIndex: 2, // ensures stacking to be above the summary section
|
|
4082
|
+
},
|
|
4083
|
+
'&:not([name])': {
|
|
4084
|
+
display: 'block',
|
|
4085
|
+
// as soon as all browsers support calc-size(auto) to be transitionable, we can remove the overflow rule and animation
|
|
4086
|
+
overflow: 'hidden',
|
|
4087
|
+
'details[open] &': {
|
|
4088
|
+
overflow: 'visible',
|
|
4089
|
+
// fix potential overflow issues
|
|
4090
|
+
animation: `overflow-hidden var(${cssVariableTransitionDuration},${motionDurationMap[duration]})`,
|
|
4091
|
+
},
|
|
4092
|
+
},
|
|
4093
|
+
},
|
|
4094
|
+
'h1,h2,h3,h4,h5,h6': {
|
|
4017
4095
|
all: 'unset',
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
gap: '24px',
|
|
4024
|
-
cursor: 'pointer',
|
|
4025
|
-
zIndex: 0,
|
|
4026
|
-
color: colorPrimary,
|
|
4027
|
-
...textSmallStyle,
|
|
4028
|
-
fontWeight: fontWeightSemiBold,
|
|
4029
|
-
...buildResponsiveStyles(size, (s) => ({
|
|
4030
|
-
fontSize: s === 'medium' ? fontSizeTextMedium : fontSizeTextSmall,
|
|
4031
|
-
padding: `${compact ? '4px' : s === 'medium' ? '20px' : '15px'} 0`,
|
|
4096
|
+
gridArea: `1/${hasSummaryBefore && isIconAlignedStart ? '3' : hasSummaryBefore || isIconAlignedStart ? '2' : '1'}`,
|
|
4097
|
+
font: 'inherit',
|
|
4098
|
+
fontWeight: fontWeightSemibold,
|
|
4099
|
+
...buildResponsiveStyles(size, (sizeValue) => ({
|
|
4100
|
+
fontSize: sizeValue === 'medium' ? typescaleMd : typescaleSm,
|
|
4032
4101
|
})),
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
'
|
|
4053
|
-
|
|
4102
|
+
},
|
|
4103
|
+
details: {
|
|
4104
|
+
all: 'unset',
|
|
4105
|
+
font: `${typescaleSm} / ${leadingNormal} ${fontPorscheNext}`, // enables font inheritance for slotted content
|
|
4106
|
+
color: colorPrimary, // enables color inheritance for slotted content
|
|
4107
|
+
display: 'grid',
|
|
4108
|
+
gridTemplate: `repeat(2, auto) / ${hasSummaryBefore ? 'auto ' : ''}${isIconAlignedStart ? 'auto minmax(0, 1fr)' : 'minmax(0, 1fr) auto'}${hasSummaryAfter ? ' auto ' : ''}`,
|
|
4109
|
+
columnGap: gap,
|
|
4110
|
+
alignItems: 'center',
|
|
4111
|
+
padding: `var(${cssVarPaddingBlock}, ${background === 'none' ? '0' : paddingBlock}) var(${cssVarPaddingInline$1}, ${background === 'none' ? '0' : paddingInline})`,
|
|
4112
|
+
background: backgroundMap[background],
|
|
4113
|
+
...(background === 'frosted' && frostedGlassStyle),
|
|
4114
|
+
borderRadius: `var(${legacyRadiusSmall}, ${radiusXl})`,
|
|
4115
|
+
...forcedColorsMediaQuery({
|
|
4116
|
+
outline: '1px solid CanvasText',
|
|
4117
|
+
outlineOffset: background === 'none' ? '0' : '-1px',
|
|
4118
|
+
padding: `var(${cssVarPaddingBlock}, ${paddingBlock}) var(${cssVarPaddingInline$1}, ${paddingInline})`,
|
|
4119
|
+
}),
|
|
4120
|
+
'&::details-content': addImportantToEachRule({
|
|
4121
|
+
display: 'contents', // allows <details> to be used as grid layout
|
|
4122
|
+
contentVisibility: 'visible', // we need to overwrite it to support cross-browser animation, we take care of content-visibility on our own to be a11y compliant
|
|
4123
|
+
}),
|
|
4124
|
+
'& > div': {
|
|
4125
|
+
gridArea: '2/1/auto/-1',
|
|
4126
|
+
zIndex: 0, // ensures stacking to be below the summary section
|
|
4127
|
+
display: 'grid',
|
|
4128
|
+
opacity: 0,
|
|
4129
|
+
marginTop: '0px',
|
|
4130
|
+
gridTemplateRows: '0fr',
|
|
4131
|
+
visibility: 'hidden', // since `::details-content` and `allow-discrete` transition doesn't work in Safari we need to take care ourselves for visibility state to be a11y compliant
|
|
4132
|
+
// as soon as all browsers are supporting `allow-discrete` reliable, visibility transition shouldn't be necessary anymore
|
|
4133
|
+
transition: `visibility 0s linear var(${cssVariableTransitionDuration}, ${motionDurationMap[duration]}), ${getTransition('grid-template-rows', duration, easing)}, ${getTransition('margin-top', duration, easing)}, ${getTransition('opacity', duration, easing)}`,
|
|
4134
|
+
},
|
|
4135
|
+
'&[open]': {
|
|
4136
|
+
'& > div': {
|
|
4137
|
+
opacity: 1,
|
|
4138
|
+
marginTop,
|
|
4139
|
+
// as soon as all browsers support calc-size(auto) to be transitionable, we can remove the grid-template-rows rule and animation
|
|
4140
|
+
gridTemplateRows: '1fr',
|
|
4141
|
+
visibility: 'inherit', // since `::details-content` and `allow-discrete` transition doesn't work in Safari we need to take care ourselves for visibility state to be a11y compliant
|
|
4142
|
+
// as soon as all browsers are supporting `allow-discrete` reliable, visibility transition shouldn't be necessary anymore
|
|
4143
|
+
transition: `visibility 0s linear 0s, ${getTransition('grid-template-rows', duration, easing)}, ${getTransition('margin-top', duration, easing)}, ${getTransition('opacity', duration, easing)}`,
|
|
4054
4144
|
},
|
|
4145
|
+
},
|
|
4146
|
+
},
|
|
4147
|
+
summary: {
|
|
4148
|
+
all: 'unset',
|
|
4149
|
+
gridArea: '1/1/auto/-1',
|
|
4150
|
+
zIndex: 1, // ensures stacking to be above the details content
|
|
4151
|
+
display: 'grid',
|
|
4152
|
+
gridTemplateColumns: 'subgrid',
|
|
4153
|
+
alignItems: 'center',
|
|
4154
|
+
cursor: 'pointer',
|
|
4155
|
+
padding: `var(${cssVarPaddingBlock}, ${background === 'none' ? '0' : paddingBlock}) var(${cssVarPaddingInline$1}, ${background === 'none' ? '0' : paddingInline})`,
|
|
4156
|
+
margin: `calc(-1 * var(${cssVarPaddingBlock}, ${background === 'none' ? '0' : paddingBlock})) calc(-1 * var(${cssVarPaddingInline$1}, ${background === 'none' ? '0' : paddingInline}))`,
|
|
4157
|
+
...(isSticky &&
|
|
4158
|
+
(background === 'canvas' || background === 'surface') && {
|
|
4159
|
+
position: 'sticky',
|
|
4160
|
+
top: `var(${cssVarSummaryTop}, var(${cssVarSummaryTopDeprecated}, 0px))`,
|
|
4161
|
+
background: `linear-gradient(180deg,${backgroundMap[background]} 0%,${backgroundMap[background]} 90%,transparent 100%)`,
|
|
4162
|
+
borderRadius: `var(${legacyRadiusSmall}, ${radiusXl})`,
|
|
4163
|
+
}),
|
|
4164
|
+
'&:focus-visible::before': getFocusBaseStyles(),
|
|
4165
|
+
...hoverMediaQuery({
|
|
4055
4166
|
'&:hover::before': {
|
|
4056
|
-
|
|
4057
|
-
background: colorFrostedSoft,
|
|
4167
|
+
background: colorFrosted,
|
|
4058
4168
|
},
|
|
4059
|
-
})),
|
|
4060
|
-
'&:focus-visible::before': getFocusBaseStyles(),
|
|
4061
|
-
},
|
|
4062
|
-
},
|
|
4063
|
-
heading: {
|
|
4064
|
-
margin: 0,
|
|
4065
|
-
...(sticky && {
|
|
4066
|
-
position: 'sticky',
|
|
4067
|
-
top: `var(${cssVariablePositionStickyTop}, ${positionStickyTopFallback})`,
|
|
4068
|
-
zIndex: 1, // to be on top of the collapsible
|
|
4069
|
-
background: colorCanvas,
|
|
4070
|
-
}),
|
|
4071
|
-
},
|
|
4072
|
-
'icon-container': {
|
|
4073
|
-
height: fontLineHeight,
|
|
4074
|
-
width: fontLineHeight,
|
|
4075
|
-
font: `inherit ${fontFamily}`, // needed for correct calculations based on ex-unit
|
|
4076
|
-
display: 'flex',
|
|
4077
|
-
alignItems: 'center',
|
|
4078
|
-
justifyContent: 'center',
|
|
4079
|
-
},
|
|
4080
|
-
icon: {
|
|
4081
|
-
transform: open ? 'rotate3d(0)' : 'rotate3d(0,0,1,90deg)',
|
|
4082
|
-
transition: getTransition('transform'),
|
|
4083
|
-
},
|
|
4084
|
-
collapsible: {
|
|
4085
|
-
color: colorPrimary, // enables color inheritance for slotted content
|
|
4086
|
-
display: 'grid',
|
|
4087
|
-
...(sticky && {
|
|
4088
|
-
position: 'relative',
|
|
4089
|
-
zIndex: 0, // to be below the heading
|
|
4090
|
-
}),
|
|
4091
|
-
...(open
|
|
4092
|
-
? {
|
|
4093
|
-
gridTemplateRows: '1fr',
|
|
4094
|
-
visibility: 'inherit',
|
|
4095
|
-
transition: getTransition('grid-template-rows'),
|
|
4096
|
-
paddingBottom: compact ? spacingStaticSmall : '24px',
|
|
4097
|
-
}
|
|
4098
|
-
: {
|
|
4099
|
-
gridTemplateRows: '0fr',
|
|
4100
|
-
visibility: 'hidden',
|
|
4101
|
-
transition: `${getTransition('grid-template-rows')}, visibility 0s linear var(${cssVariableTransitionDuration}, ${motionDurationShort})`,
|
|
4102
4169
|
}),
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4170
|
+
'&::before': {
|
|
4171
|
+
gridArea: `1/${isIconAlignedStart ? '1' : hasSummaryBefore && hasSummaryAfter ? '4' : hasSummaryBefore || hasSummaryAfter ? '3' : '2'}`,
|
|
4172
|
+
placeSelf: 'center',
|
|
4173
|
+
content: '""',
|
|
4174
|
+
width: '1.5rem',
|
|
4175
|
+
height: '1.5rem',
|
|
4176
|
+
pointerEvents: 'none',
|
|
4177
|
+
borderRadius: radiusFull,
|
|
4178
|
+
background: 'transparent',
|
|
4179
|
+
transition: getTransition('background-color'),
|
|
4180
|
+
...forcedColorsMediaQuery({
|
|
4181
|
+
backgroundColor: 'LinkText',
|
|
4182
|
+
}),
|
|
4183
|
+
},
|
|
4184
|
+
'&::after': {
|
|
4185
|
+
gridArea: `1/${isIconAlignedStart ? '1' : hasSummaryBefore && hasSummaryAfter ? '4' : hasSummaryBefore || hasSummaryAfter ? '3' : '2'}`,
|
|
4186
|
+
placeSelf: 'center',
|
|
4187
|
+
content: '""',
|
|
4188
|
+
width: '1rem',
|
|
4189
|
+
height: '1rem',
|
|
4190
|
+
pointerEvents: 'none',
|
|
4191
|
+
WebkitMask: `${icon} center/contain no-repeat`, // necessary for Sogou browser support :-)
|
|
4192
|
+
mask: `${icon} center/contain no-repeat`,
|
|
4193
|
+
background: colorPrimary,
|
|
4194
|
+
transform: 'rotate3d(0)',
|
|
4195
|
+
transition: getTransition('transform', duration, easing),
|
|
4196
|
+
...forcedColorsMediaQuery({
|
|
4197
|
+
backgroundColor: 'LinkText',
|
|
4198
|
+
}),
|
|
4199
|
+
'details[open] &': {
|
|
4200
|
+
transform: 'rotate3d(0,0,1,180deg)',
|
|
4201
|
+
},
|
|
4202
|
+
},
|
|
4203
|
+
},
|
|
4118
4204
|
},
|
|
4119
4205
|
});
|
|
4120
4206
|
};
|
|
@@ -4266,8 +4352,8 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4266
4352
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4267
4353
|
right: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
4268
4354
|
left: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
4355
|
+
borderRadius: `var(${legacyRadiusSmall}, ${hideLabelValue ? radiusFull : radiusLg})`,
|
|
4269
4356
|
})),
|
|
4270
|
-
borderRadius: `var(${legacyRadiusSmall}, ${radiusLg})`,
|
|
4271
4357
|
transition: getTransition('background-color'),
|
|
4272
4358
|
...(active && {
|
|
4273
4359
|
...frostedGlassStyle,
|
|
@@ -4537,11 +4623,9 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4537
4623
|
verticalAlign: 'top',
|
|
4538
4624
|
...mergeDeep(buildResponsiveStyles(isCompact, (compactValue) => ({
|
|
4539
4625
|
[`${cssVariableInternalScaling}`]: compactValue ? 0.64285714 : 1,
|
|
4540
|
-
|
|
4626
|
+
'--p-internal-border-radius': compactValue ? radiusLg : radiusXl,
|
|
4541
4627
|
})), buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
4542
|
-
|
|
4543
|
-
borderRadius: addImportantToRule(`var(${legacyRadiusSmall}, ${radiusFull})`),
|
|
4544
|
-
}),
|
|
4628
|
+
borderRadius: addImportantToRule(`var(${legacyRadiusSmall}, ${hideLabelValue ? radiusFull : 'var(--p-internal-border-radius)'})`),
|
|
4545
4629
|
}))),
|
|
4546
4630
|
...addImportantToEachRule({
|
|
4547
4631
|
...hostHiddenStyles,
|
|
@@ -4568,6 +4652,16 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4568
4652
|
padding: hideLabelValue ? paddingBlock : `${paddingBlock} ${paddingInline}`,
|
|
4569
4653
|
gap: hideLabelValue ? 0 : gap,
|
|
4570
4654
|
})),
|
|
4655
|
+
...forcedColorsMediaQuery({
|
|
4656
|
+
forcedColorAdjust: 'none',
|
|
4657
|
+
background: 'Canvas',
|
|
4658
|
+
color: 'LinkText',
|
|
4659
|
+
boxShadow: 'inset 0 0 0 2px LinkText',
|
|
4660
|
+
'&:is(button)': {
|
|
4661
|
+
boxShadow: 'inset 0 0 0 2px ButtonBorder',
|
|
4662
|
+
color: 'ButtonText',
|
|
4663
|
+
},
|
|
4664
|
+
}),
|
|
4571
4665
|
...(!hasSlottedAnchor && {
|
|
4572
4666
|
'&:focus-visible': getFocusBaseStyles(),
|
|
4573
4667
|
}),
|
|
@@ -4575,6 +4669,9 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4575
4669
|
hoverMediaQuery({
|
|
4576
4670
|
'&:hover': {
|
|
4577
4671
|
backgroundColor: backgroundColorHover,
|
|
4672
|
+
...forcedColorsMediaQuery({
|
|
4673
|
+
background: 'Canvas',
|
|
4674
|
+
}),
|
|
4578
4675
|
},
|
|
4579
4676
|
})),
|
|
4580
4677
|
},
|
|
@@ -4602,9 +4699,9 @@ const getComponentCss$15 = (icon, iconSource, variant, hideLabel, isDisabled, is
|
|
|
4602
4699
|
root: {
|
|
4603
4700
|
...(disabledOrLoading && {
|
|
4604
4701
|
cursor: 'not-allowed',
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4702
|
+
}),
|
|
4703
|
+
...(isDisabled && {
|
|
4704
|
+
...getDisabledBaseStyles(),
|
|
4608
4705
|
}),
|
|
4609
4706
|
},
|
|
4610
4707
|
...(isLoading && {
|
|
@@ -4616,6 +4713,7 @@ const getComponentCss$15 = (icon, iconSource, variant, hideLabel, isDisabled, is
|
|
|
4616
4713
|
top: '50%',
|
|
4617
4714
|
left: '50%',
|
|
4618
4715
|
transform: 'translate(-50%, -50%)',
|
|
4716
|
+
color: 'inherit',
|
|
4619
4717
|
},
|
|
4620
4718
|
}),
|
|
4621
4719
|
label: {
|
|
@@ -4623,12 +4721,18 @@ const getComponentCss$15 = (icon, iconSource, variant, hideLabel, isDisabled, is
|
|
|
4623
4721
|
...(isLoading && {
|
|
4624
4722
|
opacity: 0, // use opacity for smooth transition between states
|
|
4625
4723
|
}),
|
|
4724
|
+
...(isDisabled && {
|
|
4725
|
+
...getDisabledBaseStyles(),
|
|
4726
|
+
}),
|
|
4626
4727
|
},
|
|
4627
4728
|
icon: {
|
|
4628
4729
|
transition: getTransition('opacity'),
|
|
4629
4730
|
...(isLoading && {
|
|
4630
4731
|
opacity: 0, // use opacity for smooth transition between states
|
|
4631
4732
|
}),
|
|
4733
|
+
...(isDisabled && {
|
|
4734
|
+
...getDisabledBaseStyles(),
|
|
4735
|
+
}),
|
|
4632
4736
|
},
|
|
4633
4737
|
// .loading
|
|
4634
4738
|
...getFunctionalComponentLoadingMessageStyles(),
|
|
@@ -5324,6 +5428,10 @@ const getCheckboxBaseStyles = (isDisabled, isLoading, isCompact, state) => {
|
|
|
5324
5428
|
background: `var(${cssVarCheckboxBackgroundColor},${formStateBackgroundColor})`,
|
|
5325
5429
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5326
5430
|
border: `${checkboxBorderWidth} solid var(${cssVarCheckboxBorderColor},${formStateBorderColor})`,
|
|
5431
|
+
...(disabledOrLoading &&
|
|
5432
|
+
forcedColorsMediaQuery({
|
|
5433
|
+
borderColor: 'GrayText',
|
|
5434
|
+
})),
|
|
5327
5435
|
borderRadius: `var(${legacyRadiusSmall}, ${isCompact ? radiusMd : radiusLg})`,
|
|
5328
5436
|
...(disabledOrLoading && {
|
|
5329
5437
|
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
@@ -5343,10 +5451,6 @@ const getCheckboxBaseStyles = (isDisabled, isLoading, isCompact, state) => {
|
|
|
5343
5451
|
};
|
|
5344
5452
|
};
|
|
5345
5453
|
|
|
5346
|
-
const getInlineSVGBackgroundImage = (path) => {
|
|
5347
|
-
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
5348
|
-
};
|
|
5349
|
-
|
|
5350
5454
|
const checkedIcon$1 = getInlineSVGBackgroundImage(`<path 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"/>`);
|
|
5351
5455
|
const getCheckboxCheckedBaseStyles = (isLoading, state) => {
|
|
5352
5456
|
const { formStateBorderColor } = getThemedFormStateColors(state);
|
|
@@ -5355,6 +5459,7 @@ const getCheckboxCheckedBaseStyles = (isLoading, state) => {
|
|
|
5355
5459
|
}
|
|
5356
5460
|
return {
|
|
5357
5461
|
'&::before': {
|
|
5462
|
+
forcedColorAdjust: 'none',
|
|
5358
5463
|
WebkitMask: `${checkedIcon$1} center/contain no-repeat`, // necessary for Sogou browser support :-)
|
|
5359
5464
|
mask: `${checkedIcon$1} center/contain no-repeat`,
|
|
5360
5465
|
backgroundColor: `var(${cssVarCheckboxIconColor}, ${state === 'none' ? colorPrimary : formStateBorderColor})`,
|
|
@@ -5370,6 +5475,7 @@ const getCheckboxIndeterminateBaseStyles = (isLoading, state) => {
|
|
|
5370
5475
|
}
|
|
5371
5476
|
return {
|
|
5372
5477
|
'&::before': {
|
|
5478
|
+
forcedColorAdjust: 'none',
|
|
5373
5479
|
WebkitMask: `${indeterminateIcon} center/contain no-repeat`,
|
|
5374
5480
|
mask: `${indeterminateIcon} center/contain no-repeat`,
|
|
5375
5481
|
backgroundColor: state === 'none' ? colorPrimary : formStateBorderColor,
|
|
@@ -5385,19 +5491,21 @@ const getFunctionalComponentRequiredStyles = () => {
|
|
|
5385
5491
|
};
|
|
5386
5492
|
};
|
|
5387
5493
|
|
|
5388
|
-
const getFunctionalComponentLabelAfterStyles = (
|
|
5494
|
+
const getFunctionalComponentLabelAfterStyles = () => {
|
|
5389
5495
|
return {
|
|
5390
5496
|
'slot[name="label-after"]': {
|
|
5391
5497
|
display: 'inline-block',
|
|
5392
5498
|
verticalAlign: 'top',
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5499
|
+
'&::slotted(*)': {
|
|
5500
|
+
...addImportantToEachRule({
|
|
5501
|
+
marginInlineStart: spacingStaticXs$1,
|
|
5502
|
+
})
|
|
5503
|
+
},
|
|
5397
5504
|
},
|
|
5398
5505
|
};
|
|
5399
5506
|
};
|
|
5400
|
-
const getFunctionalComponentLabelStyles = (
|
|
5507
|
+
const getFunctionalComponentLabelStyles = (isDisabled, isLoading, hideLabel, additionalDefaultJssStyle, additionalLabelWrapperJssStyle, additionalIsShownJssStyle) => {
|
|
5508
|
+
const isDisabledOrLoading = isDisabled || isLoading;
|
|
5401
5509
|
return {
|
|
5402
5510
|
'label-wrapper': {
|
|
5403
5511
|
...buildResponsiveStyles(hideLabel, (isHidden) => ({
|
|
@@ -5409,10 +5517,13 @@ const getFunctionalComponentLabelStyles = (isDisabledOrLoading, hideLabel, addit
|
|
|
5409
5517
|
label: {
|
|
5410
5518
|
...proseTextSmStyle,
|
|
5411
5519
|
cursor: isDisabledOrLoading ? 'not-allowed' : 'pointer',
|
|
5520
|
+
color: colorPrimary,
|
|
5412
5521
|
...(isDisabledOrLoading && {
|
|
5413
5522
|
pointerEvents: 'none', // prevents label interaction when disabled or loading
|
|
5414
5523
|
}),
|
|
5415
|
-
|
|
5524
|
+
...(isDisabled && {
|
|
5525
|
+
...getDisabledBaseStyles(),
|
|
5526
|
+
}),
|
|
5416
5527
|
transition: getTransition('color'), // for smooth transitions between e.g. disabled state
|
|
5417
5528
|
display: 'inline',
|
|
5418
5529
|
'&:empty': {
|
|
@@ -5472,11 +5583,10 @@ const getComponentCss$12 = (hideLabel, state, isDisabled, isLoading, isCompact)
|
|
|
5472
5583
|
display: 'block',
|
|
5473
5584
|
...addImportantToEachRule({
|
|
5474
5585
|
...hostHiddenStyles,
|
|
5475
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
5476
5586
|
}),
|
|
5477
5587
|
[`${cssVarInternalCheckboxScaling}`]: isCompact ? 0.64285714 : 1,
|
|
5478
5588
|
},
|
|
5479
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
5589
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
5480
5590
|
...preventFoucOfNestedElementsStyles,
|
|
5481
5591
|
input: {
|
|
5482
5592
|
...getCheckboxBaseStyles(isDisabled, isLoading, isCompact, state),
|
|
@@ -5507,6 +5617,7 @@ const getComponentCss$12 = (hideLabel, state, isDisabled, isLoading, isCompact)
|
|
|
5507
5617
|
alignSelf: 'flex-start',
|
|
5508
5618
|
minHeight: fontLineHeight, // necessary for compact mode
|
|
5509
5619
|
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
5620
|
+
...(isDisabled && getDisabledBaseStyles()),
|
|
5510
5621
|
},
|
|
5511
5622
|
...(isLoading && {
|
|
5512
5623
|
spinner: {
|
|
@@ -5520,7 +5631,7 @@ const getComponentCss$12 = (hideLabel, state, isDisabled, isLoading, isCompact)
|
|
|
5520
5631
|
},
|
|
5521
5632
|
}),
|
|
5522
5633
|
// .label / .required
|
|
5523
|
-
...getFunctionalComponentLabelStyles(isDisabled
|
|
5634
|
+
...getFunctionalComponentLabelStyles(isDisabled, isLoading, hideLabel, {
|
|
5524
5635
|
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
5525
5636
|
}, null, {
|
|
5526
5637
|
paddingTop: labelPaddingTop,
|
|
@@ -5542,7 +5653,7 @@ const cssVarButtonPurePadding = '--ref-p-input-slotted-padding';
|
|
|
5542
5653
|
*/
|
|
5543
5654
|
const cssVarButtonPureMargin = '--ref-p-input-slotted-margin';
|
|
5544
5655
|
const cssVarInternalInputBaseScaling = '--p-internal-input-base-scaling';
|
|
5545
|
-
const getFunctionalComponentInputBaseStyles = (isDisabled, isLoading, hideLabel, state, isCompact, readOnly, additionalInputJssStyle) => {
|
|
5656
|
+
const getFunctionalComponentInputBaseStyles = (isDisabled, isLoading, hideLabel, state, isCompact, readOnly, additionalInputJssStyle, additionalHostJssStyle) => {
|
|
5546
5657
|
const wrapperBorderWidth = borderWidthThin;
|
|
5547
5658
|
const wrapperHeight = `calc(var(${cssVarInternalInputBaseScaling}) * 3.5rem)`;
|
|
5548
5659
|
const wrapperPaddingInline = `calc(22.4px * (var(${cssVarInternalInputBaseScaling}) - 0.64285714) + 8px)`;
|
|
@@ -5559,14 +5670,21 @@ const getFunctionalComponentInputBaseStyles = (isDisabled, isLoading, hideLabel,
|
|
|
5559
5670
|
[`${cssVarButtonPurePadding}`]: buttonPadding,
|
|
5560
5671
|
[`${cssVarButtonPureMargin}`]: buttonMargin,
|
|
5561
5672
|
...hostHiddenStyles,
|
|
5562
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
5563
5673
|
}),
|
|
5674
|
+
// Alignment and direction of placeholder is set always to the right in RTL mode, because it is expected to have rtl language as placeholder value
|
|
5675
|
+
'&(:dir(rtl)) input::placeholder': {
|
|
5676
|
+
direction: 'rtl',
|
|
5677
|
+
textAlign: 'end',
|
|
5678
|
+
},
|
|
5679
|
+
...additionalHostJssStyle,
|
|
5564
5680
|
},
|
|
5565
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
5681
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
5566
5682
|
...preventFoucOfNestedElementsStyles,
|
|
5567
5683
|
input: {
|
|
5568
5684
|
all: 'unset',
|
|
5685
|
+
display: 'flex',
|
|
5569
5686
|
flex: 1,
|
|
5687
|
+
alignItems: 'center',
|
|
5570
5688
|
width: 'max(100%, 2ch)', // show at least 2 characters in very narrow containers
|
|
5571
5689
|
height: '100%',
|
|
5572
5690
|
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
|
|
@@ -5596,9 +5714,23 @@ const getFunctionalComponentInputBaseStyles = (isDisabled, isLoading, hideLabel,
|
|
|
5596
5714
|
background: colorFrosted,
|
|
5597
5715
|
color: colorContrastMedium,
|
|
5598
5716
|
}),
|
|
5599
|
-
'&:focus-within': {
|
|
5717
|
+
'&:not(:has(input:disabled)):focus-within': {
|
|
5600
5718
|
borderColor: formStateBorderHoverColor,
|
|
5719
|
+
...forcedColorsMediaQuery({
|
|
5720
|
+
outline: '2px solid Highlight',
|
|
5721
|
+
outlineOffset: '2px',
|
|
5722
|
+
}),
|
|
5601
5723
|
},
|
|
5724
|
+
...(isDisabled && {
|
|
5725
|
+
...mergeDeep({ ...getDisabledBaseStyles() }, {
|
|
5726
|
+
...forcedColorsMediaQuery({
|
|
5727
|
+
borderColor: 'GrayText',
|
|
5728
|
+
}),
|
|
5729
|
+
}),
|
|
5730
|
+
'& > *': {
|
|
5731
|
+
...getDisabledBaseStyles(),
|
|
5732
|
+
},
|
|
5733
|
+
}),
|
|
5602
5734
|
...(!isDisabled &&
|
|
5603
5735
|
!readOnly &&
|
|
5604
5736
|
!isLoading &&
|
|
@@ -5616,7 +5748,7 @@ const getFunctionalComponentInputBaseStyles = (isDisabled, isLoading, hideLabel,
|
|
|
5616
5748
|
},
|
|
5617
5749
|
}),
|
|
5618
5750
|
// .label / .required
|
|
5619
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel),
|
|
5751
|
+
...getFunctionalComponentLabelStyles(isDisabled, isLoading, hideLabel),
|
|
5620
5752
|
// .message
|
|
5621
5753
|
...getFunctionalComponentStateMessageStyles(state),
|
|
5622
5754
|
// .loading
|
|
@@ -5648,6 +5780,7 @@ const getButtonJssStyle = (componentName, isOpen, isDisabled, state, isCompact,
|
|
|
5648
5780
|
font: textSmallStyle.font,
|
|
5649
5781
|
color: `var(${cssVarTextColor}, ${colorPrimary})`,
|
|
5650
5782
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
5783
|
+
...(isDisabled && getDisabledBaseStyles()),
|
|
5651
5784
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
5652
5785
|
...(!isDisabled && {
|
|
5653
5786
|
...hoverMediaQuery({
|
|
@@ -5717,12 +5850,20 @@ const getOptionJssStyle = (componentName, cssVarScalingName) => {
|
|
|
5717
5850
|
transition: `${getTransition('background-color')}, ${getTransition('color')}`,
|
|
5718
5851
|
'&--highlighted': {
|
|
5719
5852
|
background: colorFrosted,
|
|
5853
|
+
...forcedColorsMediaQuery({
|
|
5854
|
+
forcedColorAdjust: 'none',
|
|
5855
|
+
outline: '2px solid Highlight',
|
|
5856
|
+
outlineOffset: '-2px',
|
|
5857
|
+
}),
|
|
5720
5858
|
},
|
|
5721
5859
|
'&--highlighted, &--selected': {
|
|
5722
5860
|
color: colorPrimary,
|
|
5723
5861
|
},
|
|
5724
5862
|
'&--disabled': {
|
|
5725
5863
|
cursor: 'not-allowed',
|
|
5864
|
+
...forcedColorsMediaQuery({
|
|
5865
|
+
color: 'GrayText',
|
|
5866
|
+
}),
|
|
5726
5867
|
},
|
|
5727
5868
|
'&--hidden': {
|
|
5728
5869
|
display: 'none',
|
|
@@ -6836,10 +6977,17 @@ const getComponentCss$V = (isOpen, background, backdrop, position, hasHeader, ha
|
|
|
6836
6977
|
? {
|
|
6837
6978
|
borderStartEndRadius: dialogBorderRadius,
|
|
6838
6979
|
borderEndEndRadius: dialogBorderRadius,
|
|
6980
|
+
...forcedColorsMediaQuery({
|
|
6981
|
+
borderInlineEnd: '2px solid CanvasText',
|
|
6982
|
+
}),
|
|
6839
6983
|
}
|
|
6840
6984
|
: {
|
|
6841
6985
|
borderStartStartRadius: dialogBorderRadius,
|
|
6842
6986
|
borderEndStartRadius: dialogBorderRadius,
|
|
6987
|
+
// TODO: Fix needs to be implemented for Fullscreen (which is not available as prop for Flyout yet)
|
|
6988
|
+
...forcedColorsMediaQuery({
|
|
6989
|
+
borderInlineStart: '2px solid CanvasText',
|
|
6990
|
+
}),
|
|
6843
6991
|
}),
|
|
6844
6992
|
...(isFooterFixed && {
|
|
6845
6993
|
gridTemplateRows: hasHeader ? 'auto 1fr auto' : '1fr',
|
|
@@ -6950,6 +7098,9 @@ const getComponentCss$T = (name, source, color, size) => {
|
|
|
6950
7098
|
mask: `url("${buildIconUrl(source || name)}") center/contain no-repeat`,
|
|
6951
7099
|
aspectRatio: '1/1',
|
|
6952
7100
|
background: 'currentcolor', // necessary for proper color inheritance
|
|
7101
|
+
...forcedColorsMediaQuery({
|
|
7102
|
+
background: 'CanvasText',
|
|
7103
|
+
}),
|
|
6953
7104
|
...(isFlippableIcon(name, source) && {
|
|
6954
7105
|
'&(:dir(rtl))': {
|
|
6955
7106
|
transform: 'scaleX(-1)',
|
|
@@ -6997,6 +7148,10 @@ const getNotificationRootJssStyle = (state, hasAction, hasClose) => {
|
|
|
6997
7148
|
// 4 columns are for icon, content, optional action button and optional close button
|
|
6998
7149
|
gridTemplateColumns: `auto minmax(auto, 1fr)${hasAction ? ' auto' : ''}${hasClose ? ' auto' : ''}`,
|
|
6999
7150
|
},
|
|
7151
|
+
...forcedColorsMediaQuery({
|
|
7152
|
+
outline: '2px solid CanvasText',
|
|
7153
|
+
outlineOffset: '-2px',
|
|
7154
|
+
}),
|
|
7000
7155
|
};
|
|
7001
7156
|
};
|
|
7002
7157
|
const getNotificationIconJssStyle = () => ({
|
|
@@ -7097,7 +7252,15 @@ const getComponentCss$R = (disabled, loading, hideLabel, state, compact, readOnl
|
|
|
7097
7252
|
* @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
|
|
7098
7253
|
*/
|
|
7099
7254
|
const getComponentCss$Q = (disabled, loading, hideLabel, state, compact, readOnly) => {
|
|
7100
|
-
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly
|
|
7255
|
+
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, null,
|
|
7256
|
+
// Overwrites direction to ltr for rtl languages to prevent issues with the email input, e.g. cursor jumping to the
|
|
7257
|
+
// end of the input when typing in the middle of the text. This is necessary because email addresses are assumed
|
|
7258
|
+
// to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
|
|
7259
|
+
{
|
|
7260
|
+
'&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
|
|
7261
|
+
direction: 'ltr',
|
|
7262
|
+
},
|
|
7263
|
+
}));
|
|
7101
7264
|
};
|
|
7102
7265
|
|
|
7103
7266
|
// CSS Variables defined in base input
|
|
@@ -7217,7 +7380,15 @@ const getComponentCss$M = (disabled, loading, hideLabel, state, compact, readOnl
|
|
|
7217
7380
|
* @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
|
|
7218
7381
|
*/
|
|
7219
7382
|
const getComponentCss$L = (disabled, loading, hideLabel, state, compact, readOnly) => {
|
|
7220
|
-
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly
|
|
7383
|
+
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, null,
|
|
7384
|
+
// Overwrites direction to ltr for rtl languages to prevent issues with the tel input, e.g. cursor jumping to the
|
|
7385
|
+
// end of the input when typing in the middle of the text. This is necessary because tel values are assumed
|
|
7386
|
+
// to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
|
|
7387
|
+
{
|
|
7388
|
+
'&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
|
|
7389
|
+
direction: 'ltr',
|
|
7390
|
+
},
|
|
7391
|
+
}));
|
|
7221
7392
|
};
|
|
7222
7393
|
|
|
7223
7394
|
const formElementLayeredGap = '9px'; // to have same distance vertically and horizontally for e.g. button/icon within form element
|
|
@@ -7304,7 +7475,15 @@ const getComponentCss$J = (disabled, loading, hideLabel, state, compact, readOnl
|
|
|
7304
7475
|
* @css-variable {"name": "--p-hyphens", "description": "Sets the CSS `hyphens` property for text elements, controlling whether words can break and hyphenate automatically.", "defaultValue": "auto"}
|
|
7305
7476
|
*/
|
|
7306
7477
|
const getComponentCss$I = (disabled, loading, hideLabel, state, compact, readOnly) => {
|
|
7307
|
-
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly
|
|
7478
|
+
return getCss(getFunctionalComponentInputBaseStyles(disabled, loading, hideLabel, state, compact, readOnly, null,
|
|
7479
|
+
// Overwrites direction to ltr for rtl languages to prevent issues with the url input, e.g. cursor jumping to the
|
|
7480
|
+
// end of the input when typing in the middle of the text. This is necessary because url addresses are assumed
|
|
7481
|
+
// to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
|
|
7482
|
+
{
|
|
7483
|
+
'&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
|
|
7484
|
+
direction: 'ltr',
|
|
7485
|
+
},
|
|
7486
|
+
}));
|
|
7308
7487
|
};
|
|
7309
7488
|
|
|
7310
7489
|
// CSS Variables defined in base input
|
|
@@ -7754,6 +7933,10 @@ const getComponentCss$C = (isOpen, background, backdrop, fullscreen, hasDismissB
|
|
|
7754
7933
|
placeSelf: 'center',
|
|
7755
7934
|
margin: `var(${cssVariableSpacingTop},clamp(16px, 10vh, 192px)) ${gridExtendedOffsetBase} var(${cssVariableSpacingBottom},clamp(16px, 10vh, 192px))`, // horizontal margin is needed to ensure modal is placed on "Porsche Grid" when slotted content is wider than the viewport width
|
|
7756
7935
|
borderRadius: dialogBorderRadius,
|
|
7936
|
+
...forcedColorsMediaQuery({
|
|
7937
|
+
outline: '2px solid CanvasText',
|
|
7938
|
+
outlineOffset: '-2px',
|
|
7939
|
+
}),
|
|
7757
7940
|
}),
|
|
7758
7941
|
},
|
|
7759
7942
|
...(hasDismissButton && {
|
|
@@ -7794,6 +7977,9 @@ const getComponentCss$B = (model, safeZone, size, color) => {
|
|
|
7794
7977
|
mask: `url(${getSvgUrl(model)}) no-repeat left top / contain`,
|
|
7795
7978
|
aspectRatio: `${width} / ${safeZone ? 36 : height}`, // 36px is the max-height for SVG model signature creation
|
|
7796
7979
|
background: 'currentcolor', // necessary for proper color inheritance
|
|
7980
|
+
...forcedColorsMediaQuery({
|
|
7981
|
+
background: 'CanvasText',
|
|
7982
|
+
}),
|
|
7797
7983
|
...hostHiddenStyles,
|
|
7798
7984
|
}),
|
|
7799
7985
|
},
|
|
@@ -7840,7 +8026,9 @@ const getComponentCss$A = (isDisabled, selected) => {
|
|
|
7840
8026
|
},
|
|
7841
8027
|
},
|
|
7842
8028
|
option: getOptionJssStyle('multi-select-option', cssVarInternalMultiSelectOptionScaling),
|
|
7843
|
-
checkbox: mergeDeep(getCheckboxBaseStyles(isDisabled, false, true, 'none'), selected ? getCheckboxCheckedBaseStyles(false, 'none') : {}
|
|
8029
|
+
checkbox: mergeDeep(getCheckboxBaseStyles(isDisabled, false, true, 'none'), selected ? getCheckboxCheckedBaseStyles(false, 'none') : {}, {
|
|
8030
|
+
flexShrink: 0,
|
|
8031
|
+
}),
|
|
7844
8032
|
});
|
|
7845
8033
|
};
|
|
7846
8034
|
|
|
@@ -7854,7 +8042,6 @@ const getComponentCss$z = (isDisabled) => {
|
|
|
7854
8042
|
'@global': {
|
|
7855
8043
|
':host': addImportantToEachRule({
|
|
7856
8044
|
...hostHiddenStyles,
|
|
7857
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
7858
8045
|
}),
|
|
7859
8046
|
'::slotted(*)': {
|
|
7860
8047
|
'--p-internal-select-option-padding-left': paddingSlottedInlineStart,
|
|
@@ -7870,6 +8057,7 @@ const getComponentCss$z = (isDisabled) => {
|
|
|
7870
8057
|
paddingInline,
|
|
7871
8058
|
font: textXSmallStyle.font.replace(' 400 ', ` ${fontWeightSemiBold} `),
|
|
7872
8059
|
color: colorPrimary,
|
|
8060
|
+
...(isDisabled && getDisabledBaseStyles()),
|
|
7873
8061
|
},
|
|
7874
8062
|
},
|
|
7875
8063
|
});
|
|
@@ -7892,10 +8080,9 @@ const getComponentCss$y = (isOpen, isDisabled, hideLabel, state, isCompact) => {
|
|
|
7892
8080
|
[`${cssVarInternalMultiSelectOptionScaling}`]: isCompact ? 0.64285714 : 1,
|
|
7893
8081
|
[`${cssVarInternalOptgroupScaling}`]: isCompact ? 0.64285714 : 1,
|
|
7894
8082
|
...hostHiddenStyles,
|
|
7895
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
7896
8083
|
}),
|
|
7897
8084
|
},
|
|
7898
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8085
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
7899
8086
|
...preventFoucOfNestedElementsStyles,
|
|
7900
8087
|
button: {
|
|
7901
8088
|
...getButtonJssStyle('multi-select', isOpen, isDisabled, state, isCompact, cssVarInternalMultiSelectScaling),
|
|
@@ -7917,7 +8104,7 @@ const getComponentCss$y = (isOpen, isDisabled, hideLabel, state, isCompact) => {
|
|
|
7917
8104
|
// .no-results / .sr-only
|
|
7918
8105
|
...getFunctionalComponentNoResultsOptionStyles('multi-select-option', cssVarInternalMultiSelectScaling),
|
|
7919
8106
|
// .label / .required
|
|
7920
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel),
|
|
8107
|
+
...getFunctionalComponentLabelStyles(isDisabled, false, hideLabel),
|
|
7921
8108
|
// .message
|
|
7922
8109
|
...getFunctionalComponentStateMessageStyles(state),
|
|
7923
8110
|
});
|
|
@@ -8061,10 +8248,9 @@ const getComponentCss$w = (hideLabel, state, isDisabled, isLoading, length, isCo
|
|
|
8061
8248
|
[`${cssVarInternalPinCodeScaling}`]: isCompact ? 0.64285714 : 1,
|
|
8062
8249
|
...addImportantToEachRule({
|
|
8063
8250
|
...hostHiddenStyles,
|
|
8064
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
8065
8251
|
}),
|
|
8066
8252
|
},
|
|
8067
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8253
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
8068
8254
|
...preventFoucOfNestedElementsStyles,
|
|
8069
8255
|
input: {
|
|
8070
8256
|
all: 'unset',
|
|
@@ -8084,7 +8270,7 @@ const getComponentCss$w = (hideLabel, state, isDisabled, isLoading, length, isCo
|
|
|
8084
8270
|
textOverflow: 'ellipsis',
|
|
8085
8271
|
cursor: isDisabled || isLoading ? 'not-allowed' : 'text',
|
|
8086
8272
|
textAlign: 'center',
|
|
8087
|
-
...(isLoading && getDisabledBaseStyles()),
|
|
8273
|
+
...((isDisabled || isLoading) && getDisabledBaseStyles()),
|
|
8088
8274
|
'&:focus-visible': {
|
|
8089
8275
|
borderColor: formStateBorderHoverColor,
|
|
8090
8276
|
},
|
|
@@ -8121,7 +8307,7 @@ const getComponentCss$w = (hideLabel, state, isDisabled, isLoading, length, isCo
|
|
|
8121
8307
|
},
|
|
8122
8308
|
}),
|
|
8123
8309
|
// .label / .required
|
|
8124
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel),
|
|
8310
|
+
...getFunctionalComponentLabelStyles(isDisabled, isLoading, hideLabel),
|
|
8125
8311
|
// .message
|
|
8126
8312
|
...getFunctionalComponentStateMessageStyles(state),
|
|
8127
8313
|
// .loading
|
|
@@ -8203,6 +8389,9 @@ const getComponentCss$v = () => {
|
|
|
8203
8389
|
height: '12px',
|
|
8204
8390
|
clipPath: 'polygon(50% 0, 100% 110%, 0 110%)',
|
|
8205
8391
|
background: colorCanvas,
|
|
8392
|
+
...forcedColorsMediaQuery({
|
|
8393
|
+
background: 'CanvasText',
|
|
8394
|
+
}),
|
|
8206
8395
|
},
|
|
8207
8396
|
content: {
|
|
8208
8397
|
maxWidth: `min(calc(100dvw - ${POPOVER_SAFE_ZONE * 2}px), 48ch)`,
|
|
@@ -8214,6 +8403,10 @@ const getComponentCss$v = () => {
|
|
|
8214
8403
|
...textSmallStyle,
|
|
8215
8404
|
background: colorCanvas,
|
|
8216
8405
|
color: colorPrimary,
|
|
8406
|
+
...forcedColorsMediaQuery({
|
|
8407
|
+
outline: '2px solid CanvasText',
|
|
8408
|
+
outlineOffset: '-2px',
|
|
8409
|
+
}),
|
|
8217
8410
|
},
|
|
8218
8411
|
});
|
|
8219
8412
|
};
|
|
@@ -8239,10 +8432,9 @@ const getComponentCss$u = (disabled, loading, state) => {
|
|
|
8239
8432
|
display: 'block',
|
|
8240
8433
|
...addImportantToEachRule({
|
|
8241
8434
|
...hostHiddenStyles,
|
|
8242
|
-
...(disabledOrLoading && getDisabledBaseStyles()),
|
|
8243
8435
|
}),
|
|
8244
8436
|
},
|
|
8245
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8437
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
8246
8438
|
...preventFoucOfNestedElementsStyles,
|
|
8247
8439
|
input: {
|
|
8248
8440
|
all: 'unset',
|
|
@@ -8258,6 +8450,9 @@ const getComponentCss$u = (disabled, loading, state) => {
|
|
|
8258
8450
|
borderRadius: radiusFull,
|
|
8259
8451
|
...(disabledOrLoading && {
|
|
8260
8452
|
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
8453
|
+
...forcedColorsMediaQuery({
|
|
8454
|
+
borderColor: 'GrayText',
|
|
8455
|
+
}),
|
|
8261
8456
|
}),
|
|
8262
8457
|
'&:focus-visible': getFocusBaseStyles(),
|
|
8263
8458
|
...(!disabledOrLoading &&
|
|
@@ -8272,6 +8467,7 @@ const getComponentCss$u = (disabled, loading, state) => {
|
|
|
8272
8467
|
gridArea: '1/1',
|
|
8273
8468
|
},
|
|
8274
8469
|
'&:checked::before': {
|
|
8470
|
+
forcedColorAdjust: 'none',
|
|
8275
8471
|
WebkitMask: `${checkedIcon} center/contain no-repeat`, // necessary for Sogou browser support :-)
|
|
8276
8472
|
mask: `${checkedIcon} center/contain no-repeat`,
|
|
8277
8473
|
backgroundColor: state === 'none' ? colorPrimary : formStateBorderColor,
|
|
@@ -8297,6 +8493,7 @@ const getComponentCss$u = (disabled, loading, state) => {
|
|
|
8297
8493
|
alignSelf: 'flex-start',
|
|
8298
8494
|
minHeight: fontLineHeight, // necessary for compact mode
|
|
8299
8495
|
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
8496
|
+
...(disabled && getDisabledBaseStyles()),
|
|
8300
8497
|
},
|
|
8301
8498
|
...(loading && {
|
|
8302
8499
|
spinner: {
|
|
@@ -8310,7 +8507,7 @@ const getComponentCss$u = (disabled, loading, state) => {
|
|
|
8310
8507
|
},
|
|
8311
8508
|
}),
|
|
8312
8509
|
// .label / .required
|
|
8313
|
-
...getFunctionalComponentLabelStyles(disabled
|
|
8510
|
+
...getFunctionalComponentLabelStyles(disabled, loading, false, null, {
|
|
8314
8511
|
paddingTop: labelPaddingTop,
|
|
8315
8512
|
paddingInlineStart: labelPaddingInlineStart,
|
|
8316
8513
|
}),
|
|
@@ -8350,7 +8547,7 @@ const getComponentCss$t = (isDisabled, isLoading, hideLabel, state, isCompact, d
|
|
|
8350
8547
|
[`${cssVarInternalRadioGroupScaling}`]: isCompact ? 0.64285714 : 1,
|
|
8351
8548
|
[`${cssVarInternalRadioGroupOptionScaling}`]: isCompact ? 0.64285714 : 1,
|
|
8352
8549
|
},
|
|
8353
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8550
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
8354
8551
|
...(isLoading && {
|
|
8355
8552
|
'::slotted(*:not([slot]))': {
|
|
8356
8553
|
...addImportantToEachRule(getDisabledBaseStyles()),
|
|
@@ -8384,7 +8581,7 @@ const getComponentCss$t = (isDisabled, isLoading, hideLabel, state, isCompact, d
|
|
|
8384
8581
|
},
|
|
8385
8582
|
}),
|
|
8386
8583
|
// .label / .required
|
|
8387
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, {
|
|
8584
|
+
...getFunctionalComponentLabelStyles(isDisabled, isLoading, hideLabel, {
|
|
8388
8585
|
...(isDisabled ? getDisabledBaseStyles() : { cursor: 'inherit' }), // the label is not clickable
|
|
8389
8586
|
}),
|
|
8390
8587
|
// .message
|
|
@@ -8498,11 +8695,6 @@ const getComponentCss$s = (isNextHidden, isPrevHidden, alignScrollIndicator, has
|
|
|
8498
8695
|
...dismissButtonJssStyle,
|
|
8499
8696
|
...dropShadowLowStyle,
|
|
8500
8697
|
},
|
|
8501
|
-
icon: {
|
|
8502
|
-
'&:dir(rtl)': {
|
|
8503
|
-
transform: 'scaleX(-1)',
|
|
8504
|
-
},
|
|
8505
|
-
},
|
|
8506
8698
|
});
|
|
8507
8699
|
};
|
|
8508
8700
|
|
|
@@ -8556,6 +8748,10 @@ const getComponentCss$r = (isCompact, isDisabled, isSelected, state, hasIcon, ha
|
|
|
8556
8748
|
...(isDisabled
|
|
8557
8749
|
? {
|
|
8558
8750
|
cursor: 'not-allowed',
|
|
8751
|
+
...forcedColorsMediaQuery({
|
|
8752
|
+
color: 'GrayText',
|
|
8753
|
+
borderColor: 'GrayText',
|
|
8754
|
+
}),
|
|
8559
8755
|
}
|
|
8560
8756
|
: {
|
|
8561
8757
|
cursor: 'pointer',
|
|
@@ -8575,6 +8771,10 @@ const getComponentCss$r = (isCompact, isDisabled, isSelected, state, hasIcon, ha
|
|
|
8575
8771
|
...textXSmallStyle,
|
|
8576
8772
|
overflowWrap: 'normal',
|
|
8577
8773
|
color: colorContrastMedium,
|
|
8774
|
+
...(isDisabled &&
|
|
8775
|
+
forcedColorsMediaQuery({
|
|
8776
|
+
color: 'GrayText',
|
|
8777
|
+
})),
|
|
8578
8778
|
},
|
|
8579
8779
|
},
|
|
8580
8780
|
...(hasIcon && {
|
|
@@ -8596,12 +8796,8 @@ const getComponentCss$q = (minWidth, maxWidth, columns, disabled, hideLabel, sta
|
|
|
8596
8796
|
...hostHiddenStyles,
|
|
8597
8797
|
}),
|
|
8598
8798
|
},
|
|
8599
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8799
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
8600
8800
|
...preventFoucOfNestedElementsStyles,
|
|
8601
|
-
...getFunctionalComponentLabelAfterStyles(disabled, getDisabledBaseStyles()),
|
|
8602
|
-
...(disabled && {
|
|
8603
|
-
'::slotted(*:not([slot]))': addImportantToEachRule(getDisabledBaseStyles()),
|
|
8604
|
-
}),
|
|
8605
8801
|
'slot:not([name])': {
|
|
8606
8802
|
display: 'grid',
|
|
8607
8803
|
gridAutoRows: '1fr', // for equal height
|
|
@@ -8619,7 +8815,7 @@ const getComponentCss$q = (minWidth, maxWidth, columns, disabled, hideLabel, sta
|
|
|
8619
8815
|
gap: spacingStaticXSmall,
|
|
8620
8816
|
},
|
|
8621
8817
|
// .label / .required
|
|
8622
|
-
...getFunctionalComponentLabelStyles(disabled, hideLabel, {
|
|
8818
|
+
...getFunctionalComponentLabelStyles(disabled, false, hideLabel, {
|
|
8623
8819
|
...(disabled ? getDisabledBaseStyles() : { cursor: 'inherit' }), // the label is not clickable
|
|
8624
8820
|
}),
|
|
8625
8821
|
// .message
|
|
@@ -8674,9 +8870,8 @@ const getComponentCss$o = (isOpen, isDisabled, hideLabel, state, isCompact) => {
|
|
|
8674
8870
|
[`${cssVarInternalOptgroupScaling}`]: isCompact ? 0.64285714 : 1,
|
|
8675
8871
|
...hostHiddenStyles,
|
|
8676
8872
|
}),
|
|
8677
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
8678
8873
|
},
|
|
8679
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
8874
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
8680
8875
|
...preventFoucOfNestedElementsStyles,
|
|
8681
8876
|
button: {
|
|
8682
8877
|
...getButtonJssStyle('select', isOpen, isDisabled, state, isCompact, cssVarInternalSelectScaling),
|
|
@@ -8699,7 +8894,7 @@ const getComponentCss$o = (isOpen, isDisabled, hideLabel, state, isCompact) => {
|
|
|
8699
8894
|
// .no-results / .sr-only
|
|
8700
8895
|
...getFunctionalComponentNoResultsOptionStyles('select-option', cssVarInternalSelectScaling),
|
|
8701
8896
|
// .label / .required
|
|
8702
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel),
|
|
8897
|
+
...getFunctionalComponentLabelStyles(isDisabled, false, hideLabel),
|
|
8703
8898
|
// .message
|
|
8704
8899
|
...getFunctionalComponentStateMessageStyles(state),
|
|
8705
8900
|
});
|
|
@@ -8751,6 +8946,9 @@ const getComponentCss$n = (isOpen, background, hasDismissButton) => {
|
|
|
8751
8946
|
marginBlockStart: spacingFluidLarge, // ensures minimal space at the top to visualize paper sheet like border top radius in case sheet becomes scrollable
|
|
8752
8947
|
borderTopLeftRadius: dialogBorderRadius,
|
|
8753
8948
|
borderTopRightRadius: dialogBorderRadius,
|
|
8949
|
+
...forcedColorsMediaQuery({
|
|
8950
|
+
borderTop: '2px solid CanvasText',
|
|
8951
|
+
}),
|
|
8754
8952
|
},
|
|
8755
8953
|
...(hasDismissButton && {
|
|
8756
8954
|
dismiss: getDialogDismissButtonJssStyle(),
|
|
@@ -8796,6 +8994,7 @@ const getComponentCss$m = (size) => {
|
|
|
8796
8994
|
},
|
|
8797
8995
|
':host': {
|
|
8798
8996
|
display: 'inline-flex',
|
|
8997
|
+
color: colorPrimary,
|
|
8799
8998
|
...addImportantToEachRule({
|
|
8800
8999
|
verticalAlign: 'top',
|
|
8801
9000
|
...hostHiddenStyles,
|
|
@@ -8812,7 +9011,7 @@ const getComponentCss$m = (size) => {
|
|
|
8812
9011
|
},
|
|
8813
9012
|
'&:last-child': {
|
|
8814
9013
|
animation: `$dash ${animationDuration} steps(50) infinite`,
|
|
8815
|
-
stroke:
|
|
9014
|
+
stroke: 'currentcolor', // necessary for proper color inheritance
|
|
8816
9015
|
strokeDasharray: strokeDasharray
|
|
8817
9016
|
,
|
|
8818
9017
|
strokeLinecap: 'round',
|
|
@@ -8947,6 +9146,7 @@ const getColors$1 = (checked, loading) => {
|
|
|
8947
9146
|
*/
|
|
8948
9147
|
const getComponentCss$j = (alignLabel, hideLabel, isStretched, isChecked, isDisabled, isLoading, isCompact) => {
|
|
8949
9148
|
const { buttonBorderColor, buttonBorderColorHover, buttonBackgroundColor, toggleBackgroundColor, textColor } = getColors$1(isChecked, isLoading);
|
|
9149
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
8950
9150
|
const gap = `calc(11.2px * (var(${cssVarInternalSwitchScaling}) - 0.64285714) + 4px)`;
|
|
8951
9151
|
const buttonBorderWidth = borderWidthThin;
|
|
8952
9152
|
const buttonWidth = `calc(var(${cssVarInternalSwitchScaling}) * 3rem)`;
|
|
@@ -8992,9 +9192,13 @@ const getComponentCss$j = (alignLabel, hideLabel, isStretched, isChecked, isDisa
|
|
|
8992
9192
|
border: `${buttonBorderWidth} solid ${buttonBorderColor}`,
|
|
8993
9193
|
borderRadius: radiusFull,
|
|
8994
9194
|
background: buttonBackgroundColor,
|
|
8995
|
-
cursor:
|
|
9195
|
+
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
8996
9196
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
8997
|
-
...(
|
|
9197
|
+
...(disabledOrLoading &&
|
|
9198
|
+
forcedColorsMediaQuery({
|
|
9199
|
+
borderColor: 'GrayText',
|
|
9200
|
+
})),
|
|
9201
|
+
...(!disabledOrLoading &&
|
|
8998
9202
|
hoverMediaQuery({
|
|
8999
9203
|
'&:hover': {
|
|
9000
9204
|
borderColor: buttonBorderColorHover,
|
|
@@ -9013,8 +9217,12 @@ const getComponentCss$j = (alignLabel, hideLabel, isStretched, isChecked, isDisa
|
|
|
9013
9217
|
...textSmallStyle,
|
|
9014
9218
|
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
9015
9219
|
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
9016
|
-
cursor:
|
|
9220
|
+
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
9017
9221
|
color: textColor,
|
|
9222
|
+
...(disabledOrLoading &&
|
|
9223
|
+
forcedColorsMediaQuery({
|
|
9224
|
+
color: 'GrayText',
|
|
9225
|
+
})),
|
|
9018
9226
|
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
9019
9227
|
order: alignLabelValue === 'start' ? -1 : 0,
|
|
9020
9228
|
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
@@ -9023,6 +9231,7 @@ const getComponentCss$j = (alignLabel, hideLabel, isStretched, isChecked, isDisa
|
|
|
9023
9231
|
},
|
|
9024
9232
|
},
|
|
9025
9233
|
toggle: {
|
|
9234
|
+
forcedColorAdjust: 'none',
|
|
9026
9235
|
display: 'flex',
|
|
9027
9236
|
placeItems: 'center',
|
|
9028
9237
|
placeContent: 'center',
|
|
@@ -9258,6 +9467,9 @@ const barJssStyle = {
|
|
|
9258
9467
|
height: '2px',
|
|
9259
9468
|
left: 0,
|
|
9260
9469
|
background: colorPrimary,
|
|
9470
|
+
...forcedColorsMediaQuery({
|
|
9471
|
+
background: 'ActiveBorder',
|
|
9472
|
+
}),
|
|
9261
9473
|
};
|
|
9262
9474
|
const getComponentCss$b = (size, weight) => {
|
|
9263
9475
|
return getCss({
|
|
@@ -9425,6 +9637,10 @@ const getComponentCss$8 = (hasLabel, isCompact) => {
|
|
|
9425
9637
|
backgroundColor: colorFrosted,
|
|
9426
9638
|
},
|
|
9427
9639
|
}),
|
|
9640
|
+
...forcedColorsMediaQuery({
|
|
9641
|
+
outline: '2px solid CanvasText',
|
|
9642
|
+
outlineOffset: '-2px',
|
|
9643
|
+
}),
|
|
9428
9644
|
'&:focus-visible': getFocusBaseStyles(),
|
|
9429
9645
|
},
|
|
9430
9646
|
},
|
|
@@ -9495,7 +9711,7 @@ const getComponentCss$7 = (variant, compact, isFocusable, hasIcon) => {
|
|
|
9495
9711
|
display: 'flex',
|
|
9496
9712
|
gap: '2px',
|
|
9497
9713
|
padding: compact ? '1px 6px' : `${spacingStaticXSmall} 9px`,
|
|
9498
|
-
borderRadius: `var(${legacyRadiusSmall}, ${
|
|
9714
|
+
borderRadius: `var(${legacyRadiusSmall}, calc(${compact ? '1px' : spacingStaticXSmall} + (${fontLineHeight} / 2)))`, // ensures pill shape has a maximum border radius to support multiline.
|
|
9499
9715
|
font: textXSmallStyle.font,
|
|
9500
9716
|
...frostedGlassStyle,
|
|
9501
9717
|
color: textColor,
|
|
@@ -9507,6 +9723,11 @@ const getComponentCss$7 = (variant, compact, isFocusable, hasIcon) => {
|
|
|
9507
9723
|
background: backgroundHoverColor,
|
|
9508
9724
|
},
|
|
9509
9725
|
})),
|
|
9726
|
+
...forcedColorsMediaQuery({
|
|
9727
|
+
outline: '2px solid CanvasText',
|
|
9728
|
+
outlineOffset: '-2px',
|
|
9729
|
+
backgroundColor: 'Canvas',
|
|
9730
|
+
}),
|
|
9510
9731
|
},
|
|
9511
9732
|
'::slotted': addImportantToEachRule({
|
|
9512
9733
|
'&(a),&(button)': {
|
|
@@ -9678,10 +9899,9 @@ const getComponentCss$3 = (isDisabled, isReadonly, hideLabel, state, isCompact,
|
|
|
9678
9899
|
[`${cssVarInternalTextareaScaling}`]: isCompact ? 0.64285714 : 1,
|
|
9679
9900
|
...addImportantToEachRule({
|
|
9680
9901
|
...hostHiddenStyles,
|
|
9681
|
-
...(isDisabled && getDisabledBaseStyles()),
|
|
9682
9902
|
}),
|
|
9683
9903
|
},
|
|
9684
|
-
...getFunctionalComponentLabelAfterStyles(
|
|
9904
|
+
...getFunctionalComponentLabelAfterStyles(),
|
|
9685
9905
|
...preventFoucOfNestedElementsStyles,
|
|
9686
9906
|
textarea: {
|
|
9687
9907
|
all: 'unset',
|
|
@@ -9728,6 +9948,7 @@ const getComponentCss$3 = (isDisabled, isReadonly, hideLabel, state, isCompact,
|
|
|
9728
9948
|
},
|
|
9729
9949
|
wrapper: {
|
|
9730
9950
|
display: 'grid',
|
|
9951
|
+
...(isDisabled && getDisabledBaseStyles()),
|
|
9731
9952
|
},
|
|
9732
9953
|
...(hasCounter && {
|
|
9733
9954
|
counter: {
|
|
@@ -9740,7 +9961,7 @@ const getComponentCss$3 = (isDisabled, isReadonly, hideLabel, state, isCompact,
|
|
|
9740
9961
|
'sr-only': getHiddenTextJssStyle(),
|
|
9741
9962
|
}),
|
|
9742
9963
|
// .label / .required
|
|
9743
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel),
|
|
9964
|
+
...getFunctionalComponentLabelStyles(isDisabled, false, hideLabel),
|
|
9744
9965
|
// .message
|
|
9745
9966
|
...getFunctionalComponentStateMessageStyles(state),
|
|
9746
9967
|
});
|