@porsche-design-system/components-react 3.11.0 → 3.12.0-rc.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 +27 -0
- package/esm/lib/components/icon.wrapper.d.ts +1 -1
- package/esm/lib/components/inline-notification.wrapper.d.ts +1 -1
- package/esm/lib/components/tag.wrapper.d.ts +1 -1
- package/esm/lib/types.d.ts +3 -0
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +309 -512
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +3 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.cjs +3 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +3 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.cjs +3 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.cjs +11 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +4 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.cjs +3 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +4 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +309 -513
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +3 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +3 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +3 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +3 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.mjs +8 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +4 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +3 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +4 -1
- package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/loading-message.d.ts +8 -0
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/radio-button-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +3 -0
|
@@ -3210,29 +3210,6 @@ const dropShadowHighStyle = {
|
|
|
3210
3210
|
boxShadow: `0px 8px 40px ${_dropShadowBackgroundColor}`, // filter: drop-shadow() causes visual glitches in Firefox in combination with frostedGlassStyle
|
|
3211
3211
|
};
|
|
3212
3212
|
|
|
3213
|
-
const themeLightStateFocus = '#1A44EA';
|
|
3214
|
-
|
|
3215
|
-
const getFocusStyle = (opts) => {
|
|
3216
|
-
const { borderRadius = 'small', offset = '2px' } = opts || {};
|
|
3217
|
-
const outlineOffset = offset === 'small' ? '2px' : offset === 'none' ? 0 : offset || '2px';
|
|
3218
|
-
const borderRadiusValue = borderRadius === 'small'
|
|
3219
|
-
? borderRadiusSmall
|
|
3220
|
-
: borderRadius === 'medium'
|
|
3221
|
-
? borderRadiusMedium
|
|
3222
|
-
: borderRadius || borderRadiusSmall;
|
|
3223
|
-
return {
|
|
3224
|
-
borderRadius: borderRadiusValue, // it's visually being reflected on both (when placed here), element and focus outline
|
|
3225
|
-
'&:focus': {
|
|
3226
|
-
outline: `${borderWidthBase} solid ${themeLightStateFocus}`,
|
|
3227
|
-
outlineOffset,
|
|
3228
|
-
},
|
|
3229
|
-
// why? have a look at this article https://www.tpgi.com/focus-visible-and-backwards-compatibility/
|
|
3230
|
-
'&:focus:not(:focus-visible)': {
|
|
3231
|
-
outlineColor: 'transparent',
|
|
3232
|
-
},
|
|
3233
|
-
};
|
|
3234
|
-
};
|
|
3235
|
-
|
|
3236
3213
|
const fontFamily = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
|
|
3237
3214
|
|
|
3238
3215
|
const fontHyphenationStyle = {
|
|
@@ -3827,8 +3804,9 @@ const motionEasingMap = {
|
|
|
3827
3804
|
};
|
|
3828
3805
|
const cssVariableTransitionDuration = '--p-transition-duration';
|
|
3829
3806
|
const cssVariableAnimationDuration = '--p-animation-duration';
|
|
3830
|
-
const getTransition = (cssProperty, duration = 'short', easing = 'base', delay) =>
|
|
3831
|
-
|
|
3807
|
+
const getTransition = (cssProperty, duration = 'short', easing = 'base', delay) => {
|
|
3808
|
+
return `${cssProperty} var(${cssVariableTransitionDuration}, ${motionDurationMap[duration]}) ${motionEasingMap[easing]}${delay ? ` var(${cssVariableTransitionDuration}, ${motionDurationMap[delay]})` : ''}`;
|
|
3809
|
+
};
|
|
3832
3810
|
const addImportantToRule = (value) => `${value} !important`;
|
|
3833
3811
|
const addImportantToEachRule = (input) => {
|
|
3834
3812
|
return Object.entries(input).reduce((result, [key, value]) => value === null
|
|
@@ -3842,13 +3820,25 @@ const addImportantToEachRule = (input) => {
|
|
|
3842
3820
|
const doGetThemedColors = (theme = 'light') => {
|
|
3843
3821
|
return getThemedColors(theme);
|
|
3844
3822
|
};
|
|
3845
|
-
const
|
|
3846
|
-
|
|
3823
|
+
const getFocusJssStyle = (theme, opts) => {
|
|
3824
|
+
const { offset = '2px', slotted = '', pseudo = false } = opts || {};
|
|
3825
|
+
const { focusColor } = getThemedColors(theme);
|
|
3826
|
+
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
3827
|
+
const slottedSelector = slotted && slotted !== true ? slotted : '';
|
|
3847
3828
|
return {
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3829
|
+
[`&${slotted ? '(' : ''}${slottedSelector}::-moz-focus-inner${slotted ? ')' : ''}`]: {
|
|
3830
|
+
border: 0, // reset ua-style (for FF)
|
|
3831
|
+
},
|
|
3832
|
+
[`&${slotted ? '(' : ''}${slottedSelector}:focus${slotted ? ')' : ''}`]: {
|
|
3833
|
+
outline: 0, // reset ua-style (for older browsers)
|
|
3834
|
+
},
|
|
3835
|
+
[`&${slotted ? '(' : ''}${slottedSelector}:focus-visible${slotted ? ')' : ''}${pseudo ? '::before' : ''}`]: {
|
|
3836
|
+
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
3837
|
+
outlineOffset: offset,
|
|
3838
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
3839
|
+
outlineColor: focusColorDark,
|
|
3840
|
+
}),
|
|
3841
|
+
},
|
|
3852
3842
|
};
|
|
3853
3843
|
};
|
|
3854
3844
|
// reset initial styles, e.g. in case link-pure is used with slotted anchor and nested within e.g. an accordion
|
|
@@ -3859,55 +3849,38 @@ const getResetInitialStylesForSlottedAnchor = {
|
|
|
3859
3849
|
borderRadius: 0,
|
|
3860
3850
|
background: 'transparent',
|
|
3861
3851
|
};
|
|
3862
|
-
const focusPseudoJssStyle = {
|
|
3863
|
-
outline: 0,
|
|
3864
|
-
'&::before': {
|
|
3865
|
-
// needs to be defined always to have correct custom click area
|
|
3866
|
-
content: '""',
|
|
3867
|
-
position: 'absolute',
|
|
3868
|
-
...getInsetJssStyle(),
|
|
3869
|
-
},
|
|
3870
|
-
'&:focus::before': {
|
|
3871
|
-
borderRadius: '1px', // TODO: why just 1px border-radius?
|
|
3872
|
-
outline: `${borderWidthBase} solid ${themeLightStateFocus}`,
|
|
3873
|
-
outlineOffset: '2px',
|
|
3874
|
-
},
|
|
3875
|
-
'&:focus:not(:focus-visible)::before': {
|
|
3876
|
-
outline: 0,
|
|
3877
|
-
},
|
|
3878
|
-
};
|
|
3879
3852
|
/**
|
|
3880
3853
|
* Returns a JSS style object that can be used to visually hide text in the browser, while still allowing it to be accessed by screen readers.
|
|
3881
3854
|
* @param {boolean} isHidden - A boolean value indicating whether the text should be hidden or not. Defaults to true.
|
|
3882
3855
|
* @param {JssStyle} isShownJssStyle - Additional styles applied when isHidden = false
|
|
3883
3856
|
* @returns {JssStyle} - A JSS style object containing styles depending on the value of isHidden and isShownJssStyle.
|
|
3884
3857
|
*/
|
|
3885
|
-
const getHiddenTextJssStyle = (isHidden = true, isShownJssStyle) =>
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3858
|
+
const getHiddenTextJssStyle = (isHidden = true, isShownJssStyle) => {
|
|
3859
|
+
return isHidden
|
|
3860
|
+
? {
|
|
3861
|
+
position: 'absolute',
|
|
3862
|
+
width: '1px',
|
|
3863
|
+
height: '1px',
|
|
3864
|
+
padding: 0,
|
|
3865
|
+
margin: '-1px',
|
|
3866
|
+
overflow: 'hidden',
|
|
3867
|
+
clip: 'rect(0,0,0,0)',
|
|
3868
|
+
whiteSpace: 'nowrap',
|
|
3869
|
+
}
|
|
3870
|
+
: {
|
|
3871
|
+
position: 'static',
|
|
3872
|
+
width: 'auto',
|
|
3873
|
+
height: 'auto',
|
|
3874
|
+
padding: 0,
|
|
3875
|
+
margin: 0,
|
|
3876
|
+
overflow: 'visible',
|
|
3877
|
+
clip: 'auto',
|
|
3878
|
+
whiteSpace: 'normal',
|
|
3879
|
+
...isShownJssStyle,
|
|
3880
|
+
};
|
|
3881
|
+
};
|
|
3882
|
+
// TODO: there should be a shared style util for modal, flyout and flyout-navigation instead of having this code in the
|
|
3883
|
+
// main bundle. Or don't share it at all, in case same transition concept isn't ideal to be shared from an UI point of view.
|
|
3911
3884
|
/**
|
|
3912
3885
|
* Generates JSS styles for a frosted glass background.
|
|
3913
3886
|
* @param {boolean} isVisible - Determines if the frosted glass effect is visible.
|
|
@@ -3919,7 +3892,7 @@ const getBackfaceVisibilityJssStyle = () => ({
|
|
|
3919
3892
|
const getBackdropJssStyle = (isVisible, zIndex, theme, duration = 'long') => {
|
|
3920
3893
|
return {
|
|
3921
3894
|
position: 'fixed',
|
|
3922
|
-
|
|
3895
|
+
inset: 0,
|
|
3923
3896
|
zIndex,
|
|
3924
3897
|
// TODO: background shading is missing in getThemedColors(theme).backgroundShading
|
|
3925
3898
|
background: isThemeDark(theme) ? themeDarkBackgroundShading : themeLightBackgroundShading,
|
|
@@ -4092,8 +4065,8 @@ const formatObjectOutput = (value) => {
|
|
|
4092
4065
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
4093
4066
|
|
|
4094
4067
|
const getComponentCss$13 = (size, compact, open, theme) => {
|
|
4095
|
-
const { primaryColor, hoverColor,
|
|
4096
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark,
|
|
4068
|
+
const { primaryColor, hoverColor, contrastLowColor } = getThemedColors(theme);
|
|
4069
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
4097
4070
|
return getCss({
|
|
4098
4071
|
'@global': {
|
|
4099
4072
|
':host': {
|
|
@@ -4120,7 +4093,6 @@ const getComponentCss$13 = (size, compact, open, theme) => {
|
|
|
4120
4093
|
width: '100%',
|
|
4121
4094
|
textDecoration: 'none',
|
|
4122
4095
|
border: 0,
|
|
4123
|
-
outline: 0,
|
|
4124
4096
|
margin: 0, // Removes default button margin on safari 15
|
|
4125
4097
|
gap: '24px',
|
|
4126
4098
|
background: 'transparent',
|
|
@@ -4165,15 +4137,7 @@ const getComponentCss$13 = (size, compact, open, theme) => {
|
|
|
4165
4137
|
}),
|
|
4166
4138
|
},
|
|
4167
4139
|
})),
|
|
4168
|
-
'
|
|
4169
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4170
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4171
|
-
borderColor: focusColorDark,
|
|
4172
|
-
}),
|
|
4173
|
-
},
|
|
4174
|
-
'&:not(:focus-visible)::before': {
|
|
4175
|
-
border: 0,
|
|
4176
|
-
},
|
|
4140
|
+
...getFocusJssStyle(theme, { pseudo: true, offset: '-2px' }),
|
|
4177
4141
|
},
|
|
4178
4142
|
},
|
|
4179
4143
|
heading: {
|
|
@@ -4332,18 +4296,19 @@ const getFontSizeText = (size) => {
|
|
|
4332
4296
|
return fontSizeTextMap[size];
|
|
4333
4297
|
};
|
|
4334
4298
|
|
|
4299
|
+
// TODO: why not using getHiddenTextJssStyle()?
|
|
4335
4300
|
// Needed for slotted anchor and hidden label, which then enlarges the hidden label to equal host size and indents the text to be visually hidden.
|
|
4336
4301
|
const getVisibilityJssStyle = (hideLabel) => {
|
|
4337
4302
|
return hideLabel
|
|
4338
4303
|
? {
|
|
4339
4304
|
position: 'absolute',
|
|
4340
|
-
|
|
4305
|
+
inset: 0,
|
|
4341
4306
|
whiteSpace: 'nowrap',
|
|
4342
|
-
textIndent: '-999999px',
|
|
4307
|
+
textIndent: '-999999px', // TODO: check if text-indent still works for RTL-mode in this case
|
|
4343
4308
|
}
|
|
4344
4309
|
: {
|
|
4345
4310
|
position: 'relative',
|
|
4346
|
-
|
|
4311
|
+
inset: 'auto',
|
|
4347
4312
|
whiteSpace: 'inherit',
|
|
4348
4313
|
textIndent: 0,
|
|
4349
4314
|
zIndex: 1, // fix Firefox bug on :hover (#2583)
|
|
@@ -4352,8 +4317,8 @@ const getVisibilityJssStyle = (hideLabel) => {
|
|
|
4352
4317
|
const offsetVertical = '-2px';
|
|
4353
4318
|
const offsetHorizontal = '-4px';
|
|
4354
4319
|
const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, hasSlottedAnchor, theme) => {
|
|
4355
|
-
const { primaryColor, disabledColor, hoverColor
|
|
4356
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark,
|
|
4320
|
+
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4321
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
4357
4322
|
const hasIcon = hasVisibleIcon(icon, iconSource);
|
|
4358
4323
|
return {
|
|
4359
4324
|
'@global': {
|
|
@@ -4381,7 +4346,6 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4381
4346
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4382
4347
|
color: isDisabledOrLoading ? disabledColorDark : primaryColorDark,
|
|
4383
4348
|
}),
|
|
4384
|
-
outline: 0,
|
|
4385
4349
|
...textSmallStyle,
|
|
4386
4350
|
...mergeDeep(buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
4387
4351
|
justifyContent: stretchValue ? 'space-between' : 'flex-start',
|
|
@@ -4418,19 +4382,10 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4418
4382
|
}),
|
|
4419
4383
|
},
|
|
4420
4384
|
})),
|
|
4421
|
-
...(!hasSlottedAnchor && {
|
|
4422
|
-
'&:focus::before': {
|
|
4423
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4424
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4425
|
-
borderColor: focusColorDark,
|
|
4426
|
-
}),
|
|
4427
|
-
},
|
|
4428
|
-
'&:not(:focus-visible)::before': {
|
|
4429
|
-
border: 0,
|
|
4430
|
-
},
|
|
4431
|
-
}),
|
|
4385
|
+
...(!hasSlottedAnchor && getFocusJssStyle(theme, { pseudo: true, offset: '-2px' })),
|
|
4432
4386
|
},
|
|
4433
4387
|
label: {
|
|
4388
|
+
transition: getTransition('opacity'),
|
|
4434
4389
|
position: 'relative', // needed for hover state when icon="none" is set
|
|
4435
4390
|
},
|
|
4436
4391
|
...(hasIcon && {
|
|
@@ -4454,6 +4409,12 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4454
4409
|
};
|
|
4455
4410
|
};
|
|
4456
4411
|
|
|
4412
|
+
const getFunctionalComponentLoadingMessageStyles = () => {
|
|
4413
|
+
return {
|
|
4414
|
+
loading: getHiddenTextJssStyle(),
|
|
4415
|
+
};
|
|
4416
|
+
};
|
|
4417
|
+
|
|
4457
4418
|
const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, theme) => {
|
|
4458
4419
|
const hasIcon = hasVisibleIcon(icon, iconSource);
|
|
4459
4420
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, false, theme), {
|
|
@@ -4468,7 +4429,7 @@ const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoa
|
|
|
4468
4429
|
...(!hasIcon &&
|
|
4469
4430
|
isLoading && {
|
|
4470
4431
|
label: {
|
|
4471
|
-
|
|
4432
|
+
opacity: 0, // use opacity for smooth transition between states and to keep accessible name available
|
|
4472
4433
|
},
|
|
4473
4434
|
icon: {
|
|
4474
4435
|
position: 'absolute',
|
|
@@ -4478,6 +4439,8 @@ const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoa
|
|
|
4478
4439
|
height: fontLineHeight,
|
|
4479
4440
|
},
|
|
4480
4441
|
}),
|
|
4442
|
+
// .loading
|
|
4443
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
4481
4444
|
}));
|
|
4482
4445
|
};
|
|
4483
4446
|
|
|
@@ -4530,7 +4493,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4530
4493
|
'::slotted': {
|
|
4531
4494
|
'&(picture)': {
|
|
4532
4495
|
position: 'absolute',
|
|
4533
|
-
|
|
4496
|
+
inset: 0,
|
|
4534
4497
|
},
|
|
4535
4498
|
'&(img)': {
|
|
4536
4499
|
height: '100%',
|
|
@@ -4558,8 +4521,8 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4558
4521
|
},
|
|
4559
4522
|
'image-container': {
|
|
4560
4523
|
position: 'absolute',
|
|
4524
|
+
inset: 0,
|
|
4561
4525
|
transition: getTransition('transform', 'moderate'),
|
|
4562
|
-
...getInsetJssStyle(),
|
|
4563
4526
|
},
|
|
4564
4527
|
content: {
|
|
4565
4528
|
position: 'absolute',
|
|
@@ -4586,7 +4549,7 @@ background, align, compact, hasGradient, isDisabled) => {
|
|
|
4586
4549
|
return mergeDeep(getTileBaseStyles(aspectRatio, isDisabled), {
|
|
4587
4550
|
'@global': {
|
|
4588
4551
|
p: {
|
|
4589
|
-
maxWidth:
|
|
4552
|
+
maxWidth: '34.375rem', // in this case rem unit makes sense to scale up available space
|
|
4590
4553
|
margin: 0,
|
|
4591
4554
|
...textLargeStyle,
|
|
4592
4555
|
hyphens: 'inherit',
|
|
@@ -4690,7 +4653,6 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4690
4653
|
minWidth: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4691
4654
|
minHeight: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4692
4655
|
boxSizing: 'border-box',
|
|
4693
|
-
outline: 0,
|
|
4694
4656
|
textAlign: 'start',
|
|
4695
4657
|
WebkitAppearance: 'none', // iOS safari
|
|
4696
4658
|
appearance: 'none',
|
|
@@ -4706,18 +4668,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4706
4668
|
padding: hideLabelValue ? '13px' : '13px 26px',
|
|
4707
4669
|
gap: hideLabelValue ? 0 : spacingStaticSmall,
|
|
4708
4670
|
})),
|
|
4709
|
-
...(!hasSlottedAnchor &&
|
|
4710
|
-
'&:focus::before': {
|
|
4711
|
-
content: '""',
|
|
4712
|
-
position: 'fixed',
|
|
4713
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4714
|
-
borderRadius: borderRadiusMedium,
|
|
4715
|
-
...getInsetJssStyle(-6),
|
|
4716
|
-
},
|
|
4717
|
-
'&:not(:focus-visible)::before': {
|
|
4718
|
-
border: 0,
|
|
4719
|
-
},
|
|
4720
|
-
}),
|
|
4671
|
+
...(!hasSlottedAnchor && getFocusJssStyle(theme)),
|
|
4721
4672
|
...(!isDisabledOrLoading &&
|
|
4722
4673
|
hoverMediaQuery({
|
|
4723
4674
|
'&:hover': {
|
|
@@ -4816,6 +4767,8 @@ const getComponentCss$_ = (icon, iconSource, variant, hideLabel, disabled, loadi
|
|
|
4816
4767
|
opacity: 0, // use opacity for smooth transition between states
|
|
4817
4768
|
}),
|
|
4818
4769
|
},
|
|
4770
|
+
// .loading
|
|
4771
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
4819
4772
|
}));
|
|
4820
4773
|
};
|
|
4821
4774
|
|
|
@@ -4843,9 +4796,13 @@ const spacingMap = {
|
|
|
4843
4796
|
basic: gridBasicOffset,
|
|
4844
4797
|
extended: gridExtendedOffset,
|
|
4845
4798
|
};
|
|
4799
|
+
const backfaceVisibilityJssStyle = {
|
|
4800
|
+
backfaceVisibility: 'hidden',
|
|
4801
|
+
WebkitBackfaceVisibility: 'hidden',
|
|
4802
|
+
};
|
|
4846
4803
|
const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme) => {
|
|
4847
|
-
const { primaryColor, contrastMediumColor
|
|
4848
|
-
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark
|
|
4804
|
+
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
4805
|
+
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
4849
4806
|
const { canvasTextColor } = getHighContrastColors();
|
|
4850
4807
|
const isHeaderAlignCenter = alignHeader === 'center';
|
|
4851
4808
|
return getCss({
|
|
@@ -4869,15 +4826,11 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4869
4826
|
},
|
|
4870
4827
|
}),
|
|
4871
4828
|
...addImportantToEachRule({
|
|
4872
|
-
'::slotted
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4878
|
-
outlineColor: focusColorDark,
|
|
4879
|
-
}),
|
|
4880
|
-
outlineOffset: '2px',
|
|
4829
|
+
'::slotted': {
|
|
4830
|
+
'&(*)': {
|
|
4831
|
+
borderRadius: `var(--p-carousel-border-radius, ${borderRadiusLarge})`,
|
|
4832
|
+
},
|
|
4833
|
+
...getFocusJssStyle(theme, { slotted: true }),
|
|
4881
4834
|
},
|
|
4882
4835
|
// TODO: maybe it's better to style with slot[name="heading"] and slot[name="description"] instead, then styles would be part of shadow dom
|
|
4883
4836
|
// h2,::slotted([slot=heading]),p,::slotted([slot=description])
|
|
@@ -4941,7 +4894,7 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4941
4894
|
'skip-link': {
|
|
4942
4895
|
opacity: 0,
|
|
4943
4896
|
pointerEvents: 'none',
|
|
4944
|
-
'&:focus': {
|
|
4897
|
+
'&:focus-visible': {
|
|
4945
4898
|
opacity: 1,
|
|
4946
4899
|
pointerEvents: 'all',
|
|
4947
4900
|
},
|
|
@@ -4972,12 +4925,12 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4972
4925
|
},
|
|
4973
4926
|
},
|
|
4974
4927
|
'&__list': {
|
|
4928
|
+
...backfaceVisibilityJssStyle,
|
|
4975
4929
|
display: 'flex',
|
|
4976
|
-
...getBackfaceVisibilityJssStyle(),
|
|
4977
4930
|
},
|
|
4978
4931
|
'&__slide': {
|
|
4932
|
+
...backfaceVisibilityJssStyle,
|
|
4979
4933
|
flexShrink: 0,
|
|
4980
|
-
...getBackfaceVisibilityJssStyle(),
|
|
4981
4934
|
transform: 'translateZ(0)', // fixes mobile safari flickering, https://github.com/nolimits4web/swiper/issues/3527#issuecomment-609088939
|
|
4982
4935
|
},
|
|
4983
4936
|
'&__sr': getHiddenTextJssStyle(), // appears in the DOM when sliding
|
|
@@ -5106,8 +5059,8 @@ const getThemedFormStateColors = (theme, state) => {
|
|
|
5106
5059
|
|
|
5107
5060
|
// TODO: move to form-styles.ts
|
|
5108
5061
|
const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme) => {
|
|
5109
|
-
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor
|
|
5110
|
-
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark,
|
|
5062
|
+
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor } = getThemedColors(theme);
|
|
5063
|
+
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
5111
5064
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
5112
5065
|
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
5113
5066
|
const { canvasTextColor } = getHighContrastColors();
|
|
@@ -5132,7 +5085,6 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5132
5085
|
return {
|
|
5133
5086
|
'::slotted': {
|
|
5134
5087
|
'&(input)': {
|
|
5135
|
-
position: 'relative', // TODO: can be removed as soon as focus style was adjusted
|
|
5136
5088
|
width: fontLineHeight,
|
|
5137
5089
|
height: fontLineHeight,
|
|
5138
5090
|
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
@@ -5144,8 +5096,8 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5144
5096
|
boxSizing: 'content-box',
|
|
5145
5097
|
background: `transparent 0% 0% / ${fontLineHeight}`,
|
|
5146
5098
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5147
|
-
border:
|
|
5148
|
-
outline: 0,
|
|
5099
|
+
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5100
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5149
5101
|
...(disabledOrLoading
|
|
5150
5102
|
? {
|
|
5151
5103
|
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
@@ -5187,21 +5139,7 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5187
5139
|
transition: 'unset', // Fixes chrome bug where transition properties are stuck on hover
|
|
5188
5140
|
}),
|
|
5189
5141
|
})),
|
|
5190
|
-
...(!isDisabled && {
|
|
5191
|
-
// TODO: can be done with getFocusStyle() in the meantime
|
|
5192
|
-
'&(input:focus)::before': {
|
|
5193
|
-
content: '""',
|
|
5194
|
-
position: 'absolute',
|
|
5195
|
-
...getInsetJssStyle(-6),
|
|
5196
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
5197
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5198
|
-
borderColor: focusColorDark,
|
|
5199
|
-
}),
|
|
5200
|
-
},
|
|
5201
|
-
'&(input:focus:not(:focus-visible))::before': {
|
|
5202
|
-
borderColor: 'transparent',
|
|
5203
|
-
},
|
|
5204
|
-
}),
|
|
5142
|
+
...(!isDisabled && getFocusJssStyle(theme, { slotted: 'input' })),
|
|
5205
5143
|
},
|
|
5206
5144
|
};
|
|
5207
5145
|
};
|
|
@@ -5324,11 +5262,6 @@ const getComponentCss$Y = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5324
5262
|
}),
|
|
5325
5263
|
},
|
|
5326
5264
|
}),
|
|
5327
|
-
...(!isDisabled && {
|
|
5328
|
-
'&(input:focus)::before': {
|
|
5329
|
-
borderRadius: borderRadiusMedium,
|
|
5330
|
-
},
|
|
5331
|
-
}),
|
|
5332
5265
|
},
|
|
5333
5266
|
})),
|
|
5334
5267
|
},
|
|
@@ -5369,6 +5302,8 @@ const getComponentCss$Y = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5369
5302
|
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
5370
5303
|
gridColumn: '1/3',
|
|
5371
5304
|
}),
|
|
5305
|
+
// .loading
|
|
5306
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
5372
5307
|
});
|
|
5373
5308
|
};
|
|
5374
5309
|
|
|
@@ -5427,7 +5362,7 @@ const getComponentCss$W = () => {
|
|
|
5427
5362
|
display: 'inline-block',
|
|
5428
5363
|
verticalAlign: 'top',
|
|
5429
5364
|
...addImportantToEachRule({
|
|
5430
|
-
outline: 0,
|
|
5365
|
+
outline: 0, // TODO: is it still necessary?
|
|
5431
5366
|
boxSizing: 'content-box', // needed for correct height calculation when padding is set on host (e.g. custom click area)
|
|
5432
5367
|
...getDimensionStyle,
|
|
5433
5368
|
...colorSchemeStyles,
|
|
@@ -5438,7 +5373,14 @@ const getComponentCss$W = () => {
|
|
|
5438
5373
|
display: 'block',
|
|
5439
5374
|
textDecoration: 'none',
|
|
5440
5375
|
...getDimensionStyle,
|
|
5441
|
-
|
|
5376
|
+
'&::before': {
|
|
5377
|
+
// needs to be defined always to have correct custom click area
|
|
5378
|
+
content: '""',
|
|
5379
|
+
position: 'absolute',
|
|
5380
|
+
inset: 0,
|
|
5381
|
+
borderRadius: '1px',
|
|
5382
|
+
},
|
|
5383
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
5442
5384
|
},
|
|
5443
5385
|
picture: {
|
|
5444
5386
|
display: 'block',
|
|
@@ -5724,7 +5666,7 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5724
5666
|
},
|
|
5725
5667
|
dialog: {
|
|
5726
5668
|
position: 'fixed',
|
|
5727
|
-
|
|
5669
|
+
inset: 0,
|
|
5728
5670
|
display: 'grid', // ua-style reset
|
|
5729
5671
|
width: 'auto', // ua-style reset and to ensure transition duration works correctly
|
|
5730
5672
|
height: '100vh', // ua-style reset
|
|
@@ -5736,6 +5678,7 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5736
5678
|
visibility: 'inherit', // ua-style reset
|
|
5737
5679
|
background: 'none', // ua-style reset
|
|
5738
5680
|
overflow: 'hidden', // ua-style reset, dialog shall never become scrollable, it's handled by custom scroll areas
|
|
5681
|
+
outline: 0, // ua-style reset
|
|
5739
5682
|
...(isPrimaryScrollerVisible
|
|
5740
5683
|
? {
|
|
5741
5684
|
transform: 'translate3d(0, 0, 0)',
|
|
@@ -5755,9 +5698,6 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5755
5698
|
transform: 'translate3d(100%, 0, 0)', // use correct transitions in rtl mode
|
|
5756
5699
|
}),
|
|
5757
5700
|
},
|
|
5758
|
-
'&:focus-visible': {
|
|
5759
|
-
outline: 'none', // ua-style reset
|
|
5760
|
-
},
|
|
5761
5701
|
'&::backdrop': {
|
|
5762
5702
|
// to improve browser backwards compatibility we visually style the backdrop on the :host,
|
|
5763
5703
|
// although it's not on the #top-layer like it would be for modern browsers supporting ::backdrop
|
|
@@ -5851,8 +5791,8 @@ const getContentJssStyle = () => {
|
|
|
5851
5791
|
const frostedGlassBackgroundColorLight = 'rgba(238, 239, 242, 0.79)';
|
|
5852
5792
|
const frostedGlassBackgroundColorDark = 'rgba(33, 34, 37, 0.79)';
|
|
5853
5793
|
const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
5854
|
-
const { primaryColor, backgroundSurfaceColor,
|
|
5855
|
-
const { primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
5794
|
+
const { primaryColor, backgroundSurfaceColor, hoverColor } = getThemedColors(theme);
|
|
5795
|
+
const { primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
5856
5796
|
const frostedGlassBackgroundColor = isThemeDark(theme)
|
|
5857
5797
|
? frostedGlassBackgroundColorDark
|
|
5858
5798
|
: frostedGlassBackgroundColorLight;
|
|
@@ -5888,56 +5828,49 @@ const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
|
5888
5828
|
'::slotted(:is(h1, h2, h3, h4, h5, h6):not(:first-child))': addImportantToEachRule({
|
|
5889
5829
|
margin: `calc(${spacingFluidMedium} - ${spacingFluidXSmall}) 0 0`, // spacingFluidXSmall to compensate default gap
|
|
5890
5830
|
}),
|
|
5891
|
-
'::slotted
|
|
5892
|
-
|
|
5893
|
-
margin: 0,
|
|
5894
|
-
color: primaryColor,
|
|
5895
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5896
|
-
color: primaryColorDark,
|
|
5897
|
-
}),
|
|
5898
|
-
}),
|
|
5899
|
-
// TODO: how can we easily re-use getHoverStyle() and getFocusStyle() with ::slotted(a) selector?
|
|
5900
|
-
'::slotted(a)': {
|
|
5901
|
-
...addImportantToEachRule({
|
|
5831
|
+
'::slotted': addImportantToEachRule({
|
|
5832
|
+
'&(p)': {
|
|
5902
5833
|
...textSmallStyle,
|
|
5903
|
-
|
|
5904
|
-
display: 'block',
|
|
5905
|
-
textDecoration: 'none',
|
|
5906
|
-
cursor: 'pointer',
|
|
5834
|
+
margin: 0,
|
|
5907
5835
|
color: primaryColor,
|
|
5908
|
-
borderRadius: borderRadiusSmall,
|
|
5909
|
-
marginLeft: `-${spacingStaticXSmall}`,
|
|
5910
|
-
marginRight: `-${spacingStaticXSmall}`,
|
|
5911
|
-
padding: `2px ${spacingStaticXSmall}`,
|
|
5912
|
-
transition: `background var(${cssVariableTransitionDuration}, ${motionDurationShort}) ${motionEasingBase}`,
|
|
5913
5836
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5914
5837
|
color: primaryColorDark,
|
|
5915
5838
|
}),
|
|
5916
|
-
}
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5839
|
+
},
|
|
5840
|
+
'&(a)': {
|
|
5841
|
+
...{
|
|
5842
|
+
...textSmallStyle,
|
|
5843
|
+
alignSelf: 'flex-start',
|
|
5844
|
+
display: 'block',
|
|
5845
|
+
textDecoration: 'none',
|
|
5846
|
+
cursor: 'pointer',
|
|
5847
|
+
color: primaryColor,
|
|
5848
|
+
borderRadius: borderRadiusSmall,
|
|
5849
|
+
marginLeft: `-${spacingStaticXSmall}`,
|
|
5850
|
+
marginRight: `-${spacingStaticXSmall}`,
|
|
5851
|
+
padding: `2px ${spacingStaticXSmall}`,
|
|
5852
|
+
transition: `background var(${cssVariableTransitionDuration}, ${motionDurationShort}) ${motionEasingBase}`,
|
|
5853
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5854
|
+
color: primaryColorDark,
|
|
5855
|
+
}),
|
|
5856
|
+
},
|
|
5857
|
+
},
|
|
5858
|
+
'&(a[aria-current])': {
|
|
5920
5859
|
background: hoverColor,
|
|
5921
5860
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5922
5861
|
background: hoverColorDark,
|
|
5923
5862
|
}),
|
|
5863
|
+
},
|
|
5864
|
+
...hoverMediaQuery({
|
|
5865
|
+
// TODO: how can we easily re-use getHoverStyle() with ::slotted(a) selector?
|
|
5866
|
+
'&(a:hover)': {
|
|
5867
|
+
background: hoverColor,
|
|
5868
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5869
|
+
background: hoverColorDark,
|
|
5870
|
+
}),
|
|
5871
|
+
},
|
|
5924
5872
|
}),
|
|
5925
|
-
|
|
5926
|
-
'::slotted(a[aria-current])': addImportantToEachRule({
|
|
5927
|
-
background: hoverColor,
|
|
5928
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5929
|
-
background: hoverColorDark,
|
|
5930
|
-
}),
|
|
5931
|
-
}),
|
|
5932
|
-
'::slotted(a:focus)': addImportantToEachRule({
|
|
5933
|
-
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
5934
|
-
outlineOffset: '-2px',
|
|
5935
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5936
|
-
outlineColor: focusColorDark,
|
|
5937
|
-
}),
|
|
5938
|
-
}),
|
|
5939
|
-
'::slotted(a:focus:not(:focus-visible))': addImportantToEachRule({
|
|
5940
|
-
outlineColor: 'transparent',
|
|
5873
|
+
...getFocusJssStyle(theme, { slotted: 'a', offset: '-2px' }),
|
|
5941
5874
|
}),
|
|
5942
5875
|
},
|
|
5943
5876
|
button: {
|
|
@@ -5947,7 +5880,7 @@ const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
|
5947
5880
|
},
|
|
5948
5881
|
scroller: {
|
|
5949
5882
|
position: 'fixed',
|
|
5950
|
-
|
|
5883
|
+
inset: 0,
|
|
5951
5884
|
// "cssVariableTransitionDuration" ensures closing animation of secondary scroller is given when whole flyout-navigation gets closed
|
|
5952
5885
|
// "cssVariableVisibility" ensures secondary scroller is not tabbable when whole flyout-navigation is closed
|
|
5953
5886
|
...(isSecondaryScrollerVisible
|
|
@@ -6050,7 +5983,6 @@ const getComponentCss$N = (isOpen, position, hasFooter, hasSubFooter, theme) =>
|
|
|
6050
5983
|
'--pds-internal-grid-outer-column': `calc(${spacingFluidLarge} - ${gridGap})`,
|
|
6051
5984
|
'--pds-internal-grid-margin': `calc(${spacingFluidLarge} * -1)`,
|
|
6052
5985
|
justifyContent: isPositionStart ? 'flex-start' : 'flex-end',
|
|
6053
|
-
...getInsetJssStyle(),
|
|
6054
5986
|
...getBackdropJssStyle(isOpen, FLYOUT_Z_INDEX, theme),
|
|
6055
5987
|
...colorSchemeStyles,
|
|
6056
5988
|
...hostHiddenStyles,
|
|
@@ -6522,8 +6454,6 @@ const getComponentCss$H = (state, hasAction, hasClose, theme) => {
|
|
|
6522
6454
|
};
|
|
6523
6455
|
|
|
6524
6456
|
const getComponentCss$G = (icon, iconSource, active, stretch, size, hideLabel, alignLabel, underline, hasSlottedAnchor, theme) => {
|
|
6525
|
-
const { focusColor } = getThemedColors(theme);
|
|
6526
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
6527
6457
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, false, stretch, size, hideLabel, alignLabel, hasSlottedAnchor, theme), {
|
|
6528
6458
|
root: {
|
|
6529
6459
|
textDecoration: underline ? 'underline' : 'none',
|
|
@@ -6543,31 +6473,19 @@ const getComponentCss$G = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
6543
6473
|
'&(a)::before': {
|
|
6544
6474
|
content: '""',
|
|
6545
6475
|
position: 'fixed',
|
|
6546
|
-
|
|
6547
|
-
bottom: offsetVertical,
|
|
6476
|
+
insetBlock: offsetVertical,
|
|
6548
6477
|
borderRadius: borderRadiusSmall,
|
|
6549
6478
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
6550
|
-
|
|
6551
|
-
left: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6479
|
+
insetInline: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6552
6480
|
})),
|
|
6553
6481
|
},
|
|
6554
|
-
|
|
6555
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
6556
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6557
|
-
borderColor: focusColorDark,
|
|
6558
|
-
}),
|
|
6559
|
-
},
|
|
6560
|
-
'&(a:focus:not(:focus-visible))::before': {
|
|
6561
|
-
border: 0,
|
|
6562
|
-
},
|
|
6482
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true, offset: '-2px' }),
|
|
6563
6483
|
},
|
|
6564
6484
|
}),
|
|
6565
6485
|
}));
|
|
6566
6486
|
};
|
|
6567
6487
|
|
|
6568
6488
|
const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
6569
|
-
const { focusColor } = getThemedColors(theme);
|
|
6570
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
6571
6489
|
const { linkColor } = getHighContrastColors();
|
|
6572
6490
|
const isPrimary = variant === 'primary';
|
|
6573
6491
|
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), {
|
|
@@ -6600,22 +6518,10 @@ const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
6600
6518
|
'&(a)::before': {
|
|
6601
6519
|
content: '""',
|
|
6602
6520
|
position: 'fixed',
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
},
|
|
6606
|
-
// TODO: combine link-social-styles with link-button-styles and tabs-bar-styles
|
|
6607
|
-
'&(a::-moz-focus-inner)': {
|
|
6608
|
-
border: 0,
|
|
6609
|
-
},
|
|
6610
|
-
'&(a:focus)::before': {
|
|
6611
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
6612
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6613
|
-
borderColor: focusColorDark,
|
|
6614
|
-
}),
|
|
6615
|
-
},
|
|
6616
|
-
'&(a:focus:not(:focus-visible))::before': {
|
|
6617
|
-
border: 0,
|
|
6521
|
+
inset: '-2px',
|
|
6522
|
+
borderRadius: borderRadiusSmall,
|
|
6618
6523
|
},
|
|
6524
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
6619
6525
|
},
|
|
6620
6526
|
}),
|
|
6621
6527
|
}));
|
|
@@ -6671,7 +6577,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6671
6577
|
'link-overlay': {
|
|
6672
6578
|
// covers entire tile, used for expanded click-area only
|
|
6673
6579
|
position: 'fixed',
|
|
6674
|
-
|
|
6580
|
+
inset: 0,
|
|
6675
6581
|
},
|
|
6676
6582
|
});
|
|
6677
6583
|
};
|
|
@@ -6679,7 +6585,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6679
6585
|
const slottedAnchorSelector = `a[slot='${anchorSlot}']`;
|
|
6680
6586
|
const anchorJssStyle = {
|
|
6681
6587
|
position: 'absolute',
|
|
6682
|
-
|
|
6588
|
+
inset: 0,
|
|
6683
6589
|
zIndex: 1, // necessary to be on top of img
|
|
6684
6590
|
borderRadius: borderRadiusMedium,
|
|
6685
6591
|
};
|
|
@@ -6692,8 +6598,8 @@ const getMultilineEllipsis = (lineClamp) => {
|
|
|
6692
6598
|
};
|
|
6693
6599
|
};
|
|
6694
6600
|
const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme) => {
|
|
6695
|
-
const { primaryColor, contrastHighColor, backgroundSurfaceColor
|
|
6696
|
-
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
6601
|
+
const { primaryColor, contrastHighColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
6602
|
+
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
6697
6603
|
return getCss({
|
|
6698
6604
|
'@global': {
|
|
6699
6605
|
':host': {
|
|
@@ -6714,17 +6620,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6714
6620
|
...anchorJssStyle,
|
|
6715
6621
|
textIndent: '-999999px', // hide anchor label visually but still usable for a11y (only works in RTL-mode because of `overflow: hidden;` parent)
|
|
6716
6622
|
},
|
|
6717
|
-
|
|
6718
|
-
[`&(${slottedAnchorSelector}:focus)`]: {
|
|
6719
|
-
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
6720
|
-
outlineOffset: '2px',
|
|
6721
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6722
|
-
outlineColor: focusColorDark,
|
|
6723
|
-
}),
|
|
6724
|
-
},
|
|
6725
|
-
[`&(${slottedAnchorSelector}:focus:not(:focus-visible))`]: {
|
|
6726
|
-
outlineColor: 'transparent',
|
|
6727
|
-
},
|
|
6623
|
+
...getFocusJssStyle(theme, { slotted: slottedAnchorSelector }),
|
|
6728
6624
|
}),
|
|
6729
6625
|
[`&([slot="${headerSlot}"])`]: {
|
|
6730
6626
|
display: 'flex',
|
|
@@ -6763,7 +6659,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6763
6659
|
...(!hasSlottedAnchor && {
|
|
6764
6660
|
anchor: {
|
|
6765
6661
|
...anchorJssStyle,
|
|
6766
|
-
...
|
|
6662
|
+
...getFocusJssStyle(theme),
|
|
6767
6663
|
},
|
|
6768
6664
|
}),
|
|
6769
6665
|
header: {
|
|
@@ -6827,7 +6723,7 @@ const getComponentCss$C = (...args) => {
|
|
|
6827
6723
|
'link-overlay': {
|
|
6828
6724
|
// covers entire tile, used for expanded click-area only
|
|
6829
6725
|
position: 'fixed',
|
|
6830
|
-
|
|
6726
|
+
inset: 0,
|
|
6831
6727
|
},
|
|
6832
6728
|
});
|
|
6833
6729
|
};
|
|
@@ -6858,7 +6754,15 @@ const getComponentCss$B = (size) => {
|
|
|
6858
6754
|
a: {
|
|
6859
6755
|
display: 'block',
|
|
6860
6756
|
textDecoration: 'none',
|
|
6861
|
-
|
|
6757
|
+
outline: 0,
|
|
6758
|
+
'&::before': {
|
|
6759
|
+
// needs to be defined always to have correct custom click area
|
|
6760
|
+
content: '""',
|
|
6761
|
+
position: 'absolute',
|
|
6762
|
+
inset: 0,
|
|
6763
|
+
borderRadius: '1px',
|
|
6764
|
+
},
|
|
6765
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
6862
6766
|
},
|
|
6863
6767
|
picture: {
|
|
6864
6768
|
display: 'block',
|
|
@@ -6921,7 +6825,7 @@ const getSlottedJssStyle = (marginValue, hasHeader, hasDismissButton) => {
|
|
|
6921
6825
|
},
|
|
6922
6826
|
...(!hasHeader && {
|
|
6923
6827
|
[`&(.${stretchToFullModalWidthClassName}:first-child)`]: {
|
|
6924
|
-
marginTop: hasDismissButton ?
|
|
6828
|
+
marginTop: hasDismissButton ? `${-marginValue / 16}rem` : marginPx,
|
|
6925
6829
|
},
|
|
6926
6830
|
}),
|
|
6927
6831
|
[`&(.${stretchToFullModalWidthClassName}:last-child)`]: {
|
|
@@ -6967,7 +6871,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6967
6871
|
},
|
|
6968
6872
|
'scroll-container': {
|
|
6969
6873
|
display: 'flex',
|
|
6970
|
-
|
|
6874
|
+
inset: 0, // TODO: is this still needed?
|
|
6971
6875
|
height: '100%',
|
|
6972
6876
|
overflowY: 'inherit',
|
|
6973
6877
|
alignItems: 'center',
|
|
@@ -6981,10 +6885,12 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6981
6885
|
transform: isOpen ? 'translateY(0%)' : 'translateY(25%)',
|
|
6982
6886
|
opacity: isOpen ? 1 : 0,
|
|
6983
6887
|
transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
|
|
6984
|
-
paddingTop: hasDismissButton ?
|
|
6888
|
+
paddingTop: hasDismissButton ? '2rem' : contentPadding, // rem value needed to prevent overlapping of close button and contents in scaling mode
|
|
6985
6889
|
...(!hasFooter && { paddingBottom: contentPadding }),
|
|
6986
6890
|
background: backgroundColor,
|
|
6987
6891
|
outline: isHighContrastMode ? '1px solid transparent' : 0,
|
|
6892
|
+
// TODO: getFocusJssStyle() can't be re-used atm, but as soon as component is refactored to `<dialog />` then no
|
|
6893
|
+
// focus should be necessary at all because focus is auto forwarded to dismiss button.
|
|
6988
6894
|
// ::after to be above sticky footer without z-index games
|
|
6989
6895
|
'&:focus::after': {
|
|
6990
6896
|
content: '""',
|
|
@@ -6994,7 +6900,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6994
6900
|
...buildResponsiveStyles(isFullscreen, (fullscreenValue) => ({
|
|
6995
6901
|
borderRadius: fullscreenValue ? 0 : '12px',
|
|
6996
6902
|
borderColor: fullscreenValue ? primaryColor : darkThemePrimaryColor,
|
|
6997
|
-
|
|
6903
|
+
inset: fullscreenValue ? 0 : '-4px',
|
|
6998
6904
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6999
6905
|
borderColor: darkThemePrimaryColor,
|
|
7000
6906
|
}),
|
|
@@ -7262,6 +7168,7 @@ const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme,
|
|
|
7262
7168
|
}),
|
|
7263
7169
|
},
|
|
7264
7170
|
})),
|
|
7171
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7265
7172
|
[`::slotted(${child}:focus)`]: {
|
|
7266
7173
|
borderColor: primaryColor,
|
|
7267
7174
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7440,6 +7347,7 @@ const getInputStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
|
7440
7347
|
},
|
|
7441
7348
|
}),
|
|
7442
7349
|
...(!isDisabled && {
|
|
7350
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7443
7351
|
'&:focus': {
|
|
7444
7352
|
borderColor: primaryColor,
|
|
7445
7353
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7527,8 +7435,8 @@ const disabledCursorStyle = {
|
|
|
7527
7435
|
};
|
|
7528
7436
|
const hiddenStyle = { display: 'none' };
|
|
7529
7437
|
const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
7530
|
-
const { primaryColor, disabledColor, hoverColor
|
|
7531
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark,
|
|
7438
|
+
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
7439
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
7532
7440
|
return getCss({
|
|
7533
7441
|
'@global': {
|
|
7534
7442
|
':host': {
|
|
@@ -7606,9 +7514,9 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7606
7514
|
whiteSpace: 'nowrap',
|
|
7607
7515
|
cursor: 'pointer',
|
|
7608
7516
|
color: primaryColor,
|
|
7609
|
-
outline: 0,
|
|
7610
7517
|
borderRadius: borderRadiusSmall,
|
|
7611
7518
|
borderColor: 'transparent', // default value is needed for smooth transition
|
|
7519
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style
|
|
7612
7520
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7613
7521
|
color: primaryColorDark,
|
|
7614
7522
|
}),
|
|
@@ -7621,16 +7529,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7621
7529
|
}),
|
|
7622
7530
|
},
|
|
7623
7531
|
}),
|
|
7624
|
-
'&:not(.ellipsis):focus:focus-visible::before': {
|
|
7625
|
-
content: '""',
|
|
7626
|
-
position: 'absolute',
|
|
7627
|
-
...getInsetJssStyle(-4),
|
|
7628
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
7629
|
-
borderRadius: borderRadiusMedium,
|
|
7630
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7631
|
-
borderColor: focusColorDark,
|
|
7632
|
-
}),
|
|
7633
|
-
},
|
|
7634
7532
|
'&[aria-current]': {
|
|
7635
7533
|
...disabledCursorStyle,
|
|
7636
7534
|
color: primaryColor,
|
|
@@ -7639,7 +7537,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7639
7537
|
color: primaryColorDark,
|
|
7640
7538
|
borderColor: primaryColorDark,
|
|
7641
7539
|
}),
|
|
7642
|
-
'&:not(.ellipsis):focus::before': getInsetJssStyle(-6), // adjust for missing 2px border
|
|
7643
7540
|
},
|
|
7644
7541
|
'&[aria-disabled]': {
|
|
7645
7542
|
...disabledCursorStyle,
|
|
@@ -7648,6 +7545,8 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7648
7545
|
color: disabledColorDark,
|
|
7649
7546
|
}),
|
|
7650
7547
|
},
|
|
7548
|
+
// TODO :not(.ellipsis) is only needed for VRT states tests to work properly
|
|
7549
|
+
'&:not(.ellipsis)': getFocusJssStyle(theme),
|
|
7651
7550
|
},
|
|
7652
7551
|
},
|
|
7653
7552
|
ellipsis: {
|
|
@@ -7747,6 +7646,8 @@ const getComponentCss$v = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
7747
7646
|
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
7748
7647
|
// .message
|
|
7749
7648
|
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7649
|
+
// .loading
|
|
7650
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
7750
7651
|
});
|
|
7751
7652
|
};
|
|
7752
7653
|
|
|
@@ -7850,8 +7751,8 @@ const getDirectionArrowMap = (theme) => {
|
|
|
7850
7751
|
};
|
|
7851
7752
|
};
|
|
7852
7753
|
const getComponentCss$u = (direction, isNative, theme) => {
|
|
7853
|
-
const { hoverColor,
|
|
7854
|
-
const { hoverColor: hoverColorDark,
|
|
7754
|
+
const { hoverColor, backgroundColor, primaryColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
7755
|
+
const { hoverColor: hoverColorDark, primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
7855
7756
|
const shadowColor = 'rgba(0,0,0,0.3)';
|
|
7856
7757
|
return getCss({
|
|
7857
7758
|
'@global': {
|
|
@@ -7870,18 +7771,17 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7870
7771
|
},
|
|
7871
7772
|
button: {
|
|
7872
7773
|
display: 'block',
|
|
7873
|
-
position: 'relative',
|
|
7874
7774
|
WebkitAppearance: 'none', // iOS safari
|
|
7875
7775
|
appearance: 'none',
|
|
7876
7776
|
background: 'transparent',
|
|
7877
7777
|
border: 0,
|
|
7878
7778
|
padding: 0,
|
|
7879
|
-
outline: 0,
|
|
7880
7779
|
cursor: 'pointer',
|
|
7881
7780
|
...textSmallStyle,
|
|
7882
7781
|
width: fontLineHeight, // width needed to improve ssr support
|
|
7883
7782
|
height: fontLineHeight, // height needed to improve ssr support
|
|
7884
7783
|
borderRadius: '50%',
|
|
7784
|
+
// TODO: we should try to use getHoverStyle()
|
|
7885
7785
|
...hoverMediaQuery({
|
|
7886
7786
|
transition: getTransition('background-color'),
|
|
7887
7787
|
'&:hover': {
|
|
@@ -7892,22 +7792,7 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7892
7792
|
}),
|
|
7893
7793
|
},
|
|
7894
7794
|
}),
|
|
7895
|
-
|
|
7896
|
-
content: '""',
|
|
7897
|
-
position: 'absolute',
|
|
7898
|
-
...getInsetJssStyle(-2),
|
|
7899
|
-
border: `${borderWidthBase} solid transparent`,
|
|
7900
|
-
borderRadius: '50%',
|
|
7901
|
-
},
|
|
7902
|
-
'&:focus::before': {
|
|
7903
|
-
borderColor: focusColor,
|
|
7904
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7905
|
-
borderColor: focusColorDark,
|
|
7906
|
-
}),
|
|
7907
|
-
},
|
|
7908
|
-
'&:focus:not(:focus-visible)::before': {
|
|
7909
|
-
borderColor: 'transparent',
|
|
7910
|
-
},
|
|
7795
|
+
...getFocusJssStyle(theme, { offset: 0 }),
|
|
7911
7796
|
},
|
|
7912
7797
|
},
|
|
7913
7798
|
label: getHiddenTextJssStyle(),
|
|
@@ -7923,7 +7808,9 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7923
7808
|
margin: 0,
|
|
7924
7809
|
padding: 0,
|
|
7925
7810
|
}
|
|
7926
|
-
:
|
|
7811
|
+
: {
|
|
7812
|
+
inset: `${-safeZonePx}px`,
|
|
7813
|
+
}),
|
|
7927
7814
|
position: 'absolute',
|
|
7928
7815
|
zIndex: POPOVER_Z_INDEX,
|
|
7929
7816
|
filter: `drop-shadow(0 0 16px ${shadowColor})`,
|
|
@@ -8009,11 +7896,6 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8009
7896
|
}),
|
|
8010
7897
|
},
|
|
8011
7898
|
}),
|
|
8012
|
-
...(!isDisabled && {
|
|
8013
|
-
'&(input:focus)::before': {
|
|
8014
|
-
borderRadius: '50%',
|
|
8015
|
-
},
|
|
8016
|
-
}),
|
|
8017
7899
|
},
|
|
8018
7900
|
})),
|
|
8019
7901
|
},
|
|
@@ -8054,6 +7936,8 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8054
7936
|
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
8055
7937
|
gridColumn: '1/3',
|
|
8056
7938
|
}),
|
|
7939
|
+
// .loading
|
|
7940
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
8057
7941
|
});
|
|
8058
7942
|
};
|
|
8059
7943
|
|
|
@@ -8079,8 +7963,8 @@ const getGradient = (theme, gradientColorTheme) => {
|
|
|
8079
7963
|
};
|
|
8080
7964
|
const prevNextWrapperWidth = `calc(${fontLineHeight} + 24px)`;
|
|
8081
7965
|
const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndicatorPosition, hasScrollbar, theme) => {
|
|
8082
|
-
const { backgroundColor, backgroundSurfaceColor,
|
|
8083
|
-
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
7966
|
+
const { backgroundColor, backgroundSurfaceColor, hoverColor } = getThemedColors(theme);
|
|
7967
|
+
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
8084
7968
|
const backgroundColorLight = {
|
|
8085
7969
|
'background-base': backgroundColor,
|
|
8086
7970
|
'background-surface': backgroundSurfaceColor,
|
|
@@ -8173,24 +8057,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8173
8057
|
minHeight: '28px',
|
|
8174
8058
|
minWidth: '100%',
|
|
8175
8059
|
verticalAlign: 'top',
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
content: '""',
|
|
8179
|
-
position: 'absolute',
|
|
8180
|
-
...getInsetJssStyle(-4),
|
|
8181
|
-
border: `${borderWidthBase} solid transparent`,
|
|
8182
|
-
borderRadius: borderRadiusSmall,
|
|
8183
|
-
pointerEvents: 'none', // Needed to enable clicks inside of slot
|
|
8184
|
-
},
|
|
8185
|
-
'&:focus::before': {
|
|
8186
|
-
borderColor: focusColor,
|
|
8187
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8188
|
-
borderColor: focusColorDark,
|
|
8189
|
-
}),
|
|
8190
|
-
},
|
|
8191
|
-
'&:focus:not(:focus-visible)::before': {
|
|
8192
|
-
borderColor: 'transparent',
|
|
8193
|
-
},
|
|
8060
|
+
borderRadius: borderRadiusSmall,
|
|
8061
|
+
...getFocusJssStyle(theme),
|
|
8194
8062
|
},
|
|
8195
8063
|
trigger: {
|
|
8196
8064
|
position: 'absolute',
|
|
@@ -8248,8 +8116,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8248
8116
|
};
|
|
8249
8117
|
|
|
8250
8118
|
const ITEM_PADDING = '17px';
|
|
8251
|
-
const ICON_SIZE =
|
|
8252
|
-
const ICON_MARGIN =
|
|
8119
|
+
const ICON_SIZE = '1.5rem';
|
|
8120
|
+
const ICON_MARGIN = '.25rem';
|
|
8253
8121
|
const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
8254
8122
|
const { primaryColor, contrastMediumColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
8255
8123
|
const { highlightColor } = getHighContrastColors();
|
|
@@ -8262,8 +8130,6 @@ const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
|
8262
8130
|
};
|
|
8263
8131
|
const getItemPadding = (hasIconAndSlottedContent) => hasIconAndSlottedContent ? `13px ${ITEM_PADDING} 13px 13px` : `13px ${ITEM_PADDING}`;
|
|
8264
8132
|
const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, theme) => {
|
|
8265
|
-
const { focusColor } = getThemedColors(theme);
|
|
8266
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
8267
8133
|
const { buttonColor, labelColor, borderColor, hoverBorderColor } = getColors$2(isDisabled, isSelected, theme);
|
|
8268
8134
|
const { buttonColor: buttonColorDark, labelColor: labelColorDark, borderColor: borderColorDark, hoverBorderColor: hoverBorderColorDark, } = getColors$2(isDisabled, isSelected, 'dark');
|
|
8269
8135
|
return getCss({
|
|
@@ -8285,30 +8151,9 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8285
8151
|
margin: 0, // Removes default button margin on safari 15
|
|
8286
8152
|
border: `${borderWidthBase} solid ${borderColor}`,
|
|
8287
8153
|
borderRadius: borderRadiusSmall,
|
|
8288
|
-
outline: 0,
|
|
8289
8154
|
background: 'transparent',
|
|
8290
8155
|
color: buttonColor,
|
|
8291
8156
|
...textSmallStyle,
|
|
8292
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8293
|
-
borderColor: borderColorDark,
|
|
8294
|
-
color: buttonColorDark,
|
|
8295
|
-
}),
|
|
8296
|
-
'&::before': {
|
|
8297
|
-
content: '""',
|
|
8298
|
-
position: 'absolute',
|
|
8299
|
-
...getInsetJssStyle(-5),
|
|
8300
|
-
border: `${borderWidthBase} solid transparent`,
|
|
8301
|
-
borderRadius: '7px',
|
|
8302
|
-
},
|
|
8303
|
-
'&:focus::before': {
|
|
8304
|
-
borderColor: focusColor,
|
|
8305
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8306
|
-
borderColor: focusColorDark,
|
|
8307
|
-
}),
|
|
8308
|
-
},
|
|
8309
|
-
'&:focus:not(:focus-visible)::before': {
|
|
8310
|
-
borderColor: 'transparent',
|
|
8311
|
-
},
|
|
8312
8157
|
...(isDisabled
|
|
8313
8158
|
? {
|
|
8314
8159
|
cursor: 'not-allowed',
|
|
@@ -8326,6 +8171,11 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8326
8171
|
},
|
|
8327
8172
|
})),
|
|
8328
8173
|
}),
|
|
8174
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8175
|
+
borderColor: borderColorDark,
|
|
8176
|
+
color: buttonColorDark,
|
|
8177
|
+
}),
|
|
8178
|
+
...getFocusJssStyle(theme),
|
|
8329
8179
|
},
|
|
8330
8180
|
// label
|
|
8331
8181
|
span: {
|
|
@@ -8384,7 +8234,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8384
8234
|
// TODO: extract generic default button/anchor reset style
|
|
8385
8235
|
button: {
|
|
8386
8236
|
position: 'absolute',
|
|
8387
|
-
|
|
8237
|
+
inset: 0,
|
|
8388
8238
|
width: '100%', // fixes Firefox positioning issue
|
|
8389
8239
|
height: '100%', // fixes Firefox positioning issue
|
|
8390
8240
|
margin: 0,
|
|
@@ -8398,6 +8248,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8398
8248
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8399
8249
|
borderColor: isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark,
|
|
8400
8250
|
}),
|
|
8251
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
8401
8252
|
'&:focus, &:focus ~ ul': {
|
|
8402
8253
|
borderColor: primaryColor,
|
|
8403
8254
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -8446,7 +8297,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8446
8297
|
input: {
|
|
8447
8298
|
display: 'block',
|
|
8448
8299
|
position: 'absolute',
|
|
8449
|
-
|
|
8300
|
+
inset: borderWidthBase,
|
|
8450
8301
|
width: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8451
8302
|
height: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8452
8303
|
zIndex: 1,
|
|
@@ -8515,7 +8366,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8515
8366
|
'&+span': {
|
|
8516
8367
|
// for focus outline and clicking arrow since input ends left of the icon
|
|
8517
8368
|
position: 'absolute',
|
|
8518
|
-
|
|
8369
|
+
inset: 0,
|
|
8519
8370
|
transition: getTransition('border-color'),
|
|
8520
8371
|
pointerEvents: 'all',
|
|
8521
8372
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
@@ -8844,8 +8695,8 @@ const getSVGPath = (stepCount, numberedCircleColors, isStateCurrent) => {
|
|
|
8844
8695
|
return svgNumberedCirclePaths[stepCount];
|
|
8845
8696
|
};
|
|
8846
8697
|
const getComponentCss$m = (state, disabled, theme) => {
|
|
8847
|
-
const { primaryColor, hoverColor, disabledColor
|
|
8848
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark,
|
|
8698
|
+
const { primaryColor, hoverColor, disabledColor } = getThemedColors(theme);
|
|
8699
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
8849
8700
|
const isStateCurrent = state === 'current';
|
|
8850
8701
|
const isStateCurrentOrUndefined = !state || isStateCurrent;
|
|
8851
8702
|
const isDisabled = !state || disabled;
|
|
@@ -8887,7 +8738,6 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8887
8738
|
margin: 0, // Removes default button margin on safari 15
|
|
8888
8739
|
background: 0,
|
|
8889
8740
|
border: 0,
|
|
8890
|
-
outline: 0,
|
|
8891
8741
|
...textSmallStyle,
|
|
8892
8742
|
fontSize: 'inherit',
|
|
8893
8743
|
width: 'max-content',
|
|
@@ -8923,19 +8773,7 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8923
8773
|
width: fontLineHeight,
|
|
8924
8774
|
},
|
|
8925
8775
|
}),
|
|
8926
|
-
'
|
|
8927
|
-
content: '""',
|
|
8928
|
-
position: 'absolute',
|
|
8929
|
-
...getInsetJssStyle(),
|
|
8930
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
8931
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8932
|
-
borderColor: focusColorDark,
|
|
8933
|
-
}),
|
|
8934
|
-
borderRadius: borderRadiusSmall,
|
|
8935
|
-
},
|
|
8936
|
-
'&:focus:not(:focus-visible)::after': {
|
|
8937
|
-
borderColor: 'transparent',
|
|
8938
|
-
},
|
|
8776
|
+
...getFocusJssStyle(theme, { offset: '-2px' }),
|
|
8939
8777
|
},
|
|
8940
8778
|
},
|
|
8941
8779
|
...(!isStateCurrentOrUndefined && {
|
|
@@ -8998,128 +8836,105 @@ const getColors$1 = (checked, disabled, loading, theme) => {
|
|
|
8998
8836
|
const getComponentCss$k = (alignLabel, hideLabel, stretch, checked, disabled, loading, theme) => {
|
|
8999
8837
|
const { buttonBorderColor, buttonBorderColorHover, buttonBackgroundColor, buttonBackgroundColorHover, toggleBackgroundColor, toggleBackgroundColorHover, textColor, } = getColors$1(checked, disabled, loading, theme);
|
|
9000
8838
|
const { buttonBorderColor: buttonBorderColorDark, buttonBorderColorHover: buttonBorderColorHoverDark, buttonBackgroundColor: buttonBackgroundColorDark, buttonBackgroundColorHover: buttonBackgroundColorHoverDark, toggleBackgroundColor: toggleBackgroundColorDark, toggleBackgroundColorHover: toggleBackgroundColorHoverDark, textColor: textColorDark, } = getColors$1(checked, disabled, loading, 'dark');
|
|
9001
|
-
const { focusColor } = getThemedColors(theme);
|
|
9002
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
9003
8839
|
return getCss({
|
|
9004
8840
|
'@global': {
|
|
9005
8841
|
':host': {
|
|
9006
8842
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
9007
|
-
display: stretchValue ? '
|
|
8843
|
+
display: stretchValue ? 'flex' : 'inline-flex',
|
|
9008
8844
|
})),
|
|
9009
8845
|
...addImportantToEachRule({
|
|
9010
8846
|
outline: 0, // custom element is able to delegate the focus
|
|
8847
|
+
gap: spacingStaticSmall,
|
|
9011
8848
|
...colorSchemeStyles,
|
|
9012
8849
|
...hostHiddenStyles,
|
|
9013
8850
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
8851
|
+
justifyContent: stretchValue ? 'space-between' : 'flex-start',
|
|
9014
8852
|
width: stretchValue ? '100%' : 'auto', // prevents adjusting its size when used as flex or grid child
|
|
9015
8853
|
...(!stretchValue && { verticalAlign: 'top' }),
|
|
9016
8854
|
})),
|
|
9017
8855
|
}),
|
|
9018
8856
|
},
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
backgroundColor: buttonBackgroundColorHoverDark,
|
|
9045
|
-
}),
|
|
9046
|
-
'& .toggle': {
|
|
9047
|
-
backgroundColor: toggleBackgroundColorHover,
|
|
8857
|
+
button: {
|
|
8858
|
+
display: 'flex',
|
|
8859
|
+
alignItems: 'center',
|
|
8860
|
+
flexShrink: 0,
|
|
8861
|
+
width: '48px',
|
|
8862
|
+
height: '28px',
|
|
8863
|
+
boxSizing: 'border-box',
|
|
8864
|
+
border: `${borderWidthBase} solid ${buttonBorderColor}`,
|
|
8865
|
+
borderRadius: '14px',
|
|
8866
|
+
backgroundColor: buttonBackgroundColor,
|
|
8867
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8868
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
8869
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8870
|
+
borderColor: buttonBorderColorDark,
|
|
8871
|
+
backgroundColor: buttonBackgroundColorDark,
|
|
8872
|
+
}),
|
|
8873
|
+
margin: 0, // Removes default button margin on safari 15
|
|
8874
|
+
padding: 0,
|
|
8875
|
+
WebkitAppearance: 'none', // iOS safari
|
|
8876
|
+
appearance: 'none',
|
|
8877
|
+
...(!isDisabledOrLoading(disabled, loading) &&
|
|
8878
|
+
hoverMediaQuery({
|
|
8879
|
+
'&:hover': {
|
|
8880
|
+
borderColor: buttonBorderColorHover,
|
|
8881
|
+
backgroundColor: buttonBackgroundColorHover,
|
|
9048
8882
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9049
|
-
|
|
8883
|
+
borderColor: buttonBorderColorHoverDark,
|
|
8884
|
+
backgroundColor: buttonBackgroundColorHoverDark,
|
|
9050
8885
|
}),
|
|
8886
|
+
'& .toggle': {
|
|
8887
|
+
backgroundColor: toggleBackgroundColorHover,
|
|
8888
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8889
|
+
backgroundColor: toggleBackgroundColorHoverDark,
|
|
8890
|
+
}),
|
|
8891
|
+
},
|
|
9051
8892
|
},
|
|
9052
|
-
},
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
8893
|
+
})),
|
|
8894
|
+
...getFocusJssStyle(theme),
|
|
8895
|
+
},
|
|
8896
|
+
label: {
|
|
8897
|
+
...textSmallStyle,
|
|
8898
|
+
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
8899
|
+
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
8900
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8901
|
+
color: textColor,
|
|
9059
8902
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9060
|
-
|
|
8903
|
+
color: textColorDark,
|
|
9061
8904
|
}),
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
8905
|
+
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
8906
|
+
// TODO: we should remove 'left' here and map the value in the component class already to 'start' but might be difficult due to breakpoint customizable prop value
|
|
8907
|
+
order: alignLabelValue === 'left' || alignLabelValue === 'start' ? -1 : 0,
|
|
8908
|
+
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
8909
|
+
paddingTop: '2px', // currently, line-height of textSmall doesn't match height of switch
|
|
8910
|
+
}))),
|
|
9066
8911
|
},
|
|
9067
8912
|
},
|
|
9068
|
-
switch: {
|
|
9069
|
-
position: 'relative',
|
|
9070
|
-
width: '48px',
|
|
9071
|
-
height: '28px',
|
|
9072
|
-
flexShrink: 0,
|
|
9073
|
-
boxSizing: 'border-box',
|
|
9074
|
-
border: `${borderWidthBase} solid ${buttonBorderColor}`,
|
|
9075
|
-
borderRadius: '14px',
|
|
9076
|
-
backgroundColor: buttonBackgroundColor,
|
|
9077
|
-
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
9078
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
9079
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9080
|
-
borderColor: buttonBorderColorDark,
|
|
9081
|
-
backgroundColor: buttonBackgroundColorDark,
|
|
9082
|
-
}),
|
|
9083
|
-
},
|
|
9084
8913
|
toggle: {
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
8914
|
+
display: 'flex',
|
|
8915
|
+
alignItems: 'center',
|
|
8916
|
+
justifyContent: 'center',
|
|
9088
8917
|
width: '20px',
|
|
9089
8918
|
height: '20px',
|
|
9090
|
-
display: 'block',
|
|
9091
8919
|
borderRadius: '50%',
|
|
9092
8920
|
backgroundColor: toggleBackgroundColor,
|
|
8921
|
+
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
8922
|
+
transform: `translate3d(${checked ? '22px' : '2px'}, 0, 0)`,
|
|
8923
|
+
'&:dir(rtl)': {
|
|
8924
|
+
transform: `translate3d(${checked ? '-22px' : '-2px'}, 0, 0)`,
|
|
8925
|
+
},
|
|
9093
8926
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9094
8927
|
backgroundColor: toggleBackgroundColorDark,
|
|
9095
8928
|
}),
|
|
9096
|
-
transform: `translate3d(${checked ? '20px' : '0'}, 0, 0)`,
|
|
9097
|
-
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
9098
8929
|
},
|
|
9099
8930
|
...(loading && {
|
|
9100
8931
|
spinner: {
|
|
9101
|
-
position: 'absolute',
|
|
9102
|
-
top: '-4px',
|
|
9103
|
-
left: '-4px',
|
|
9104
8932
|
width: '28px',
|
|
9105
8933
|
height: '28px',
|
|
9106
8934
|
},
|
|
9107
8935
|
}),
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
9111
|
-
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
9112
|
-
color: textColor,
|
|
9113
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9114
|
-
color: textColorDark,
|
|
9115
|
-
}),
|
|
9116
|
-
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
9117
|
-
// TODO: we should remove 'left' here and map the value in the component class already to 'start' but might be difficult due to breakpoint customizable prop value
|
|
9118
|
-
order: alignLabelValue === 'left' || alignLabelValue === 'start' ? -1 : 0,
|
|
9119
|
-
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
9120
|
-
paddingTop: '2px', // currently, line-height of textSmall doesn't match height of switch
|
|
9121
|
-
}))),
|
|
9122
|
-
},
|
|
8936
|
+
// .loading
|
|
8937
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
9123
8938
|
});
|
|
9124
8939
|
};
|
|
9125
8940
|
|
|
@@ -9206,7 +9021,7 @@ const getComponentCss$h = (theme) => {
|
|
|
9206
9021
|
});
|
|
9207
9022
|
};
|
|
9208
9023
|
|
|
9209
|
-
const { hoverColor
|
|
9024
|
+
const { hoverColor } = getThemedColors('light'); // hover color and focus color are the same for light and dark
|
|
9210
9025
|
const buttonBeforeOffsetVertical = '-2px';
|
|
9211
9026
|
const buttonBeforeOffsetHorizontal = '-4px';
|
|
9212
9027
|
const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
@@ -9233,7 +9048,6 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9233
9048
|
padding: 0,
|
|
9234
9049
|
font: 'inherit',
|
|
9235
9050
|
color: 'inherit',
|
|
9236
|
-
outline: 0,
|
|
9237
9051
|
alignItems: 'flex-end',
|
|
9238
9052
|
WebkitAppearance: 'none', // iOS safari
|
|
9239
9053
|
appearance: 'none',
|
|
@@ -9242,19 +9056,17 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9242
9056
|
border: 0,
|
|
9243
9057
|
zIndex: 0,
|
|
9244
9058
|
cursor: 'pointer',
|
|
9059
|
+
// TODO: re-think if ::before is still needed
|
|
9245
9060
|
'&::before': {
|
|
9246
9061
|
content: '""',
|
|
9247
9062
|
position: 'absolute',
|
|
9248
|
-
|
|
9249
|
-
bottom: buttonBeforeOffsetVertical,
|
|
9250
|
-
right: buttonBeforeOffsetHorizontal,
|
|
9251
|
-
left: buttonBeforeOffsetHorizontal,
|
|
9063
|
+
inset: `${buttonBeforeOffsetVertical} ${buttonBeforeOffsetHorizontal}`,
|
|
9252
9064
|
borderRadius: borderRadiusSmall,
|
|
9253
9065
|
zIndex: -1, // needed so that text behind element is selectable and/or visible
|
|
9254
9066
|
transition: getTransition('background-color'),
|
|
9255
9067
|
},
|
|
9256
9068
|
...hoverMediaQuery({
|
|
9257
|
-
'&:hover, &:focus': {
|
|
9069
|
+
'&:hover, &:focus-visible': {
|
|
9258
9070
|
'& .icon': {
|
|
9259
9071
|
opacity: 1,
|
|
9260
9072
|
},
|
|
@@ -9264,12 +9076,8 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9264
9076
|
backgroundColor: hoverColor,
|
|
9265
9077
|
},
|
|
9266
9078
|
}),
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
},
|
|
9270
|
-
'&:not(:focus-visible)::before': {
|
|
9271
|
-
border: 0,
|
|
9272
|
-
},
|
|
9079
|
+
// TODO: to be future proof, we need to pass theme parameter
|
|
9080
|
+
...getFocusJssStyle('light', { pseudo: true, offset: '-2px' }),
|
|
9273
9081
|
},
|
|
9274
9082
|
}
|
|
9275
9083
|
: hideLabel && {
|
|
@@ -9345,8 +9153,8 @@ const scrollerAnimatedCssClass = 'scroller--animated';
|
|
|
9345
9153
|
const targetSelectors = ['a', 'button'];
|
|
9346
9154
|
const transformSelector = (selector) => targetSelectors.map((tag) => selector.replace(/\[role]/g, tag)).join();
|
|
9347
9155
|
const getComponentCss$c = (size, weight, theme) => {
|
|
9348
|
-
const { primaryColor, hoverColor
|
|
9349
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark
|
|
9156
|
+
const { primaryColor, hoverColor } = getThemedColors(theme);
|
|
9157
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark } = getThemedColors('dark');
|
|
9350
9158
|
const barJssStyle = {
|
|
9351
9159
|
position: 'absolute',
|
|
9352
9160
|
height: '2px',
|
|
@@ -9373,6 +9181,12 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9373
9181
|
}),
|
|
9374
9182
|
},
|
|
9375
9183
|
...addImportantToEachRule({
|
|
9184
|
+
'::slotted': {
|
|
9185
|
+
// TODO: produces duplicated css code in SSR context, we should try to make use of multiple selector like
|
|
9186
|
+
// `::slotted(:is(a,button))`.
|
|
9187
|
+
...getFocusJssStyle(theme, { slotted: 'a', offset: '1px' }),
|
|
9188
|
+
...getFocusJssStyle(theme, { slotted: 'button', offset: '1px' }),
|
|
9189
|
+
},
|
|
9376
9190
|
// would be nice to use shared selector like '::slotted([role])'
|
|
9377
9191
|
// but this doesn't work reliably when rendering in browser
|
|
9378
9192
|
[transformSelector('::slotted([role])')]: {
|
|
@@ -9381,6 +9195,7 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9381
9195
|
position: 'relative',
|
|
9382
9196
|
margin: '0 0 4px 0',
|
|
9383
9197
|
verticalAlign: 'top',
|
|
9198
|
+
// TODO: can we use `all: 'inherit'` instead?
|
|
9384
9199
|
fontFamily: 'inherit',
|
|
9385
9200
|
fontStyle: 'inherit',
|
|
9386
9201
|
fontVariant: 'inherit',
|
|
@@ -9434,13 +9249,6 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9434
9249
|
bottom: isHighContrastMode ? '-4px' : '-6px',
|
|
9435
9250
|
visibility: 'inherit',
|
|
9436
9251
|
},
|
|
9437
|
-
// TODO: combine link-social-styles with link-button-styles and tabs-bar-styles
|
|
9438
|
-
[transformSelector('::slotted([role]:focus:focus-visible)::before')]: {
|
|
9439
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
9440
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9441
|
-
borderColor: focusColorDark,
|
|
9442
|
-
}),
|
|
9443
|
-
},
|
|
9444
9252
|
[transformSelector('::slotted([role]:not(:last-child))')]: {
|
|
9445
9253
|
marginInlineEnd: spacingStaticMedium,
|
|
9446
9254
|
},
|
|
@@ -9476,30 +9284,20 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9476
9284
|
};
|
|
9477
9285
|
|
|
9478
9286
|
const getComponentCss$b = (theme) => {
|
|
9479
|
-
const { primaryColor
|
|
9480
|
-
const { primaryColor: primaryColorDark
|
|
9287
|
+
const { primaryColor } = getThemedColors(theme);
|
|
9288
|
+
const { primaryColor: primaryColorDark } = getThemedColors('dark');
|
|
9481
9289
|
return getCss({
|
|
9482
9290
|
'@global': {
|
|
9483
9291
|
':host': {
|
|
9484
9292
|
display: 'block',
|
|
9485
9293
|
...addImportantToEachRule({
|
|
9486
|
-
position: 'relative',
|
|
9487
9294
|
color: primaryColor, // enables color inheritance for e.g. slotted anchor
|
|
9488
|
-
|
|
9295
|
+
borderRadius: '2px',
|
|
9489
9296
|
...hostHiddenStyles,
|
|
9490
9297
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9491
9298
|
color: primaryColorDark,
|
|
9492
9299
|
}),
|
|
9493
|
-
|
|
9494
|
-
content: '""',
|
|
9495
|
-
position: 'absolute',
|
|
9496
|
-
...getInsetJssStyle(-4),
|
|
9497
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
9498
|
-
borderRadius: borderRadiusSmall,
|
|
9499
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9500
|
-
borderColor: focusColorDark,
|
|
9501
|
-
}),
|
|
9502
|
-
},
|
|
9300
|
+
...getFocusJssStyle(theme, { slotted: true }),
|
|
9503
9301
|
}),
|
|
9504
9302
|
},
|
|
9505
9303
|
},
|
|
@@ -9523,20 +9321,6 @@ const getComponentCss$a = () => {
|
|
|
9523
9321
|
});
|
|
9524
9322
|
};
|
|
9525
9323
|
|
|
9526
|
-
const getTagFocusJssStyle = (themedColors) => {
|
|
9527
|
-
return {
|
|
9528
|
-
'&:focus::before': {
|
|
9529
|
-
content: '""',
|
|
9530
|
-
position: 'absolute',
|
|
9531
|
-
...getInsetJssStyle(-4),
|
|
9532
|
-
border: `${borderWidthBase} solid ${themedColors.focusColor}`,
|
|
9533
|
-
borderRadius: borderRadiusMedium,
|
|
9534
|
-
},
|
|
9535
|
-
'&:focus:not(:focus-visible)::before': {
|
|
9536
|
-
borderColor: 'transparent',
|
|
9537
|
-
},
|
|
9538
|
-
};
|
|
9539
|
-
};
|
|
9540
9324
|
const getThemedBackgroundColor = (tagColor, themedColors) => {
|
|
9541
9325
|
const colorMap = {
|
|
9542
9326
|
'background-base': themedColors.backgroundColor,
|
|
@@ -9583,7 +9367,10 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9583
9367
|
color: primaryColor,
|
|
9584
9368
|
textAlign: 'start',
|
|
9585
9369
|
...textSmallStyle,
|
|
9586
|
-
|
|
9370
|
+
...(isHighContrastMode && {
|
|
9371
|
+
// TODO: using border would increase the dimension but using outline interferes with the focus style
|
|
9372
|
+
outline: '1px solid transparent',
|
|
9373
|
+
}),
|
|
9587
9374
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9588
9375
|
background: backgroundColorDark,
|
|
9589
9376
|
color: primaryColorDark,
|
|
@@ -9596,7 +9383,7 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9596
9383
|
}),
|
|
9597
9384
|
},
|
|
9598
9385
|
}),
|
|
9599
|
-
...
|
|
9386
|
+
...getFocusJssStyle(theme),
|
|
9600
9387
|
},
|
|
9601
9388
|
},
|
|
9602
9389
|
...(hasLabel && {
|
|
@@ -9639,7 +9426,6 @@ const getColors = (themedColors, tagColor, theme) => {
|
|
|
9639
9426
|
const { primaryColor } = tagColor === 'primary' ? getInvertedThemedColors(theme) : themedColors;
|
|
9640
9427
|
return {
|
|
9641
9428
|
primaryColor,
|
|
9642
|
-
focusColor: themedColors.focusColor,
|
|
9643
9429
|
backgroundColor: getThemedBackgroundColor(tagColor, themedColors),
|
|
9644
9430
|
backgroundHoverColor: getThemedBackgroundHoverColor(tagColor, themedColors, theme),
|
|
9645
9431
|
};
|
|
@@ -9702,11 +9488,14 @@ const getComponentCss$8 = (tagColor, isFocusable, theme) => {
|
|
|
9702
9488
|
border: 0,
|
|
9703
9489
|
textAlign: 'start',
|
|
9704
9490
|
},
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9491
|
+
'&(a)::before,&(button)::before': {
|
|
9492
|
+
content: '""',
|
|
9493
|
+
position: 'absolute',
|
|
9494
|
+
inset: 0,
|
|
9495
|
+
borderRadius: '4px',
|
|
9496
|
+
},
|
|
9497
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
9498
|
+
...getFocusJssStyle(theme, { slotted: 'button', pseudo: true }),
|
|
9710
9499
|
'&(br)': {
|
|
9711
9500
|
display: 'none',
|
|
9712
9501
|
},
|
|
@@ -10083,7 +9872,14 @@ const getComponentCss = (size, theme) => {
|
|
|
10083
9872
|
},
|
|
10084
9873
|
a: {
|
|
10085
9874
|
textDecoration: 'none',
|
|
10086
|
-
|
|
9875
|
+
'&::before': {
|
|
9876
|
+
// needs to be defined always to have correct custom click area
|
|
9877
|
+
content: '""',
|
|
9878
|
+
position: 'absolute',
|
|
9879
|
+
inset: 0,
|
|
9880
|
+
borderRadius: '1px',
|
|
9881
|
+
},
|
|
9882
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
10087
9883
|
},
|
|
10088
9884
|
svg: isHighContrastMode
|
|
10089
9885
|
? {
|
|
@@ -10119,6 +9915,7 @@ exports.getFlyoutCss = getComponentCss$N;
|
|
|
10119
9915
|
exports.getFlyoutNavigationCss = getComponentCss$P;
|
|
10120
9916
|
exports.getFlyoutNavigationItemCss = getComponentCss$O;
|
|
10121
9917
|
exports.getFunctionalComponentLabelStyles = getFunctionalComponentLabelStyles;
|
|
9918
|
+
exports.getFunctionalComponentLoadingMessageStyles = getFunctionalComponentLoadingMessageStyles;
|
|
10122
9919
|
exports.getFunctionalComponentRequiredStyles = getFunctionalComponentRequiredStyles;
|
|
10123
9920
|
exports.getFunctionalComponentStateMessageStyles = getFunctionalComponentStateMessageStyles;
|
|
10124
9921
|
exports.getGridCss = getComponentCss$L;
|