@porsche-design-system/components-react 3.11.0 → 3.12.0-rc.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 +34 -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 +313 -515
- 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 +313 -516
- 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
|
};
|
|
@@ -5309,7 +5247,7 @@ const getComponentCss$Y = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5309
5247
|
gridArea: '1/1',
|
|
5310
5248
|
borderRadius: borderRadiusSmall,
|
|
5311
5249
|
},
|
|
5312
|
-
// TODO: is it somehow useful possible to make following styles configurable by
|
|
5250
|
+
// TODO: is it somehow useful possible to make following styles configurable by parameter?
|
|
5313
5251
|
...(!isLoading && {
|
|
5314
5252
|
'&(input:checked)': {
|
|
5315
5253
|
backgroundImage: getCheckedSVGBackgroundImage$1(checkedIconColor),
|
|
@@ -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,
|
|
@@ -6387,6 +6319,7 @@ const getComponentCss$I = (name, source, color, size, theme) => {
|
|
|
6387
6319
|
const isColorInherit = color === 'inherit';
|
|
6388
6320
|
const isSizeInherit = size === 'inherit';
|
|
6389
6321
|
const isDark = isThemeDark(theme);
|
|
6322
|
+
const animationName = `${isDark ? keyFramesDark : keyFramesLight}-${color}`;
|
|
6390
6323
|
return getCss({
|
|
6391
6324
|
'@global': {
|
|
6392
6325
|
':host': {
|
|
@@ -6413,7 +6346,7 @@ const getComponentCss$I = (name, source, color, size, theme) => {
|
|
|
6413
6346
|
}, {
|
|
6414
6347
|
filter: filterMap.dark[color],
|
|
6415
6348
|
})),
|
|
6416
|
-
WebkitAnimation: `${
|
|
6349
|
+
WebkitAnimation: `${animationName} 1ms`, // needed to enforce repaint in Safari if theme is switched programmatically
|
|
6417
6350
|
}),
|
|
6418
6351
|
...(isSizeInherit
|
|
6419
6352
|
? {
|
|
@@ -6432,7 +6365,7 @@ const getComponentCss$I = (name, source, color, size, theme) => {
|
|
|
6432
6365
|
}),
|
|
6433
6366
|
},
|
|
6434
6367
|
...(!isColorInherit && {
|
|
6435
|
-
[`@keyframes ${
|
|
6368
|
+
[`@keyframes ${animationName}`]: forceRerenderAnimationStyle,
|
|
6436
6369
|
}),
|
|
6437
6370
|
},
|
|
6438
6371
|
});
|
|
@@ -6522,8 +6455,6 @@ const getComponentCss$H = (state, hasAction, hasClose, theme) => {
|
|
|
6522
6455
|
};
|
|
6523
6456
|
|
|
6524
6457
|
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
6458
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, false, stretch, size, hideLabel, alignLabel, hasSlottedAnchor, theme), {
|
|
6528
6459
|
root: {
|
|
6529
6460
|
textDecoration: underline ? 'underline' : 'none',
|
|
@@ -6543,31 +6474,19 @@ const getComponentCss$G = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
6543
6474
|
'&(a)::before': {
|
|
6544
6475
|
content: '""',
|
|
6545
6476
|
position: 'fixed',
|
|
6546
|
-
|
|
6547
|
-
bottom: offsetVertical,
|
|
6477
|
+
insetBlock: offsetVertical,
|
|
6548
6478
|
borderRadius: borderRadiusSmall,
|
|
6549
6479
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
6550
|
-
|
|
6551
|
-
left: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6480
|
+
insetInline: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6552
6481
|
})),
|
|
6553
6482
|
},
|
|
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
|
-
},
|
|
6483
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true, offset: '-2px' }),
|
|
6563
6484
|
},
|
|
6564
6485
|
}),
|
|
6565
6486
|
}));
|
|
6566
6487
|
};
|
|
6567
6488
|
|
|
6568
6489
|
const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
6569
|
-
const { focusColor } = getThemedColors(theme);
|
|
6570
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
6571
6490
|
const { linkColor } = getHighContrastColors();
|
|
6572
6491
|
const isPrimary = variant === 'primary';
|
|
6573
6492
|
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), {
|
|
@@ -6600,22 +6519,10 @@ const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
6600
6519
|
'&(a)::before': {
|
|
6601
6520
|
content: '""',
|
|
6602
6521
|
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,
|
|
6522
|
+
inset: '-2px',
|
|
6523
|
+
borderRadius: borderRadiusSmall,
|
|
6618
6524
|
},
|
|
6525
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
6619
6526
|
},
|
|
6620
6527
|
}),
|
|
6621
6528
|
}));
|
|
@@ -6671,7 +6578,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6671
6578
|
'link-overlay': {
|
|
6672
6579
|
// covers entire tile, used for expanded click-area only
|
|
6673
6580
|
position: 'fixed',
|
|
6674
|
-
|
|
6581
|
+
inset: 0,
|
|
6675
6582
|
},
|
|
6676
6583
|
});
|
|
6677
6584
|
};
|
|
@@ -6679,7 +6586,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6679
6586
|
const slottedAnchorSelector = `a[slot='${anchorSlot}']`;
|
|
6680
6587
|
const anchorJssStyle = {
|
|
6681
6588
|
position: 'absolute',
|
|
6682
|
-
|
|
6589
|
+
inset: 0,
|
|
6683
6590
|
zIndex: 1, // necessary to be on top of img
|
|
6684
6591
|
borderRadius: borderRadiusMedium,
|
|
6685
6592
|
};
|
|
@@ -6692,8 +6599,8 @@ const getMultilineEllipsis = (lineClamp) => {
|
|
|
6692
6599
|
};
|
|
6693
6600
|
};
|
|
6694
6601
|
const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme) => {
|
|
6695
|
-
const { primaryColor, contrastHighColor, backgroundSurfaceColor
|
|
6696
|
-
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
6602
|
+
const { primaryColor, contrastHighColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
6603
|
+
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
6697
6604
|
return getCss({
|
|
6698
6605
|
'@global': {
|
|
6699
6606
|
':host': {
|
|
@@ -6714,17 +6621,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6714
6621
|
...anchorJssStyle,
|
|
6715
6622
|
textIndent: '-999999px', // hide anchor label visually but still usable for a11y (only works in RTL-mode because of `overflow: hidden;` parent)
|
|
6716
6623
|
},
|
|
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
|
-
},
|
|
6624
|
+
...getFocusJssStyle(theme, { slotted: slottedAnchorSelector }),
|
|
6728
6625
|
}),
|
|
6729
6626
|
[`&([slot="${headerSlot}"])`]: {
|
|
6730
6627
|
display: 'flex',
|
|
@@ -6763,7 +6660,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6763
6660
|
...(!hasSlottedAnchor && {
|
|
6764
6661
|
anchor: {
|
|
6765
6662
|
...anchorJssStyle,
|
|
6766
|
-
...
|
|
6663
|
+
...getFocusJssStyle(theme),
|
|
6767
6664
|
},
|
|
6768
6665
|
}),
|
|
6769
6666
|
header: {
|
|
@@ -6827,7 +6724,7 @@ const getComponentCss$C = (...args) => {
|
|
|
6827
6724
|
'link-overlay': {
|
|
6828
6725
|
// covers entire tile, used for expanded click-area only
|
|
6829
6726
|
position: 'fixed',
|
|
6830
|
-
|
|
6727
|
+
inset: 0,
|
|
6831
6728
|
},
|
|
6832
6729
|
});
|
|
6833
6730
|
};
|
|
@@ -6858,7 +6755,15 @@ const getComponentCss$B = (size) => {
|
|
|
6858
6755
|
a: {
|
|
6859
6756
|
display: 'block',
|
|
6860
6757
|
textDecoration: 'none',
|
|
6861
|
-
|
|
6758
|
+
outline: 0,
|
|
6759
|
+
'&::before': {
|
|
6760
|
+
// needs to be defined always to have correct custom click area
|
|
6761
|
+
content: '""',
|
|
6762
|
+
position: 'absolute',
|
|
6763
|
+
inset: 0,
|
|
6764
|
+
borderRadius: '1px',
|
|
6765
|
+
},
|
|
6766
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
6862
6767
|
},
|
|
6863
6768
|
picture: {
|
|
6864
6769
|
display: 'block',
|
|
@@ -6921,7 +6826,7 @@ const getSlottedJssStyle = (marginValue, hasHeader, hasDismissButton) => {
|
|
|
6921
6826
|
},
|
|
6922
6827
|
...(!hasHeader && {
|
|
6923
6828
|
[`&(.${stretchToFullModalWidthClassName}:first-child)`]: {
|
|
6924
|
-
marginTop: hasDismissButton ?
|
|
6829
|
+
marginTop: hasDismissButton ? `${-marginValue / 16}rem` : marginPx,
|
|
6925
6830
|
},
|
|
6926
6831
|
}),
|
|
6927
6832
|
[`&(.${stretchToFullModalWidthClassName}:last-child)`]: {
|
|
@@ -6967,7 +6872,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6967
6872
|
},
|
|
6968
6873
|
'scroll-container': {
|
|
6969
6874
|
display: 'flex',
|
|
6970
|
-
|
|
6875
|
+
inset: 0, // TODO: is this still needed?
|
|
6971
6876
|
height: '100%',
|
|
6972
6877
|
overflowY: 'inherit',
|
|
6973
6878
|
alignItems: 'center',
|
|
@@ -6981,10 +6886,12 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6981
6886
|
transform: isOpen ? 'translateY(0%)' : 'translateY(25%)',
|
|
6982
6887
|
opacity: isOpen ? 1 : 0,
|
|
6983
6888
|
transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
|
|
6984
|
-
paddingTop: hasDismissButton ?
|
|
6889
|
+
paddingTop: hasDismissButton ? '2rem' : contentPadding, // rem value needed to prevent overlapping of close button and contents in scaling mode
|
|
6985
6890
|
...(!hasFooter && { paddingBottom: contentPadding }),
|
|
6986
6891
|
background: backgroundColor,
|
|
6987
6892
|
outline: isHighContrastMode ? '1px solid transparent' : 0,
|
|
6893
|
+
// TODO: getFocusJssStyle() can't be re-used atm, but as soon as component is refactored to `<dialog />` then no
|
|
6894
|
+
// focus should be necessary at all because focus is auto forwarded to dismiss button.
|
|
6988
6895
|
// ::after to be above sticky footer without z-index games
|
|
6989
6896
|
'&:focus::after': {
|
|
6990
6897
|
content: '""',
|
|
@@ -6994,7 +6901,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6994
6901
|
...buildResponsiveStyles(isFullscreen, (fullscreenValue) => ({
|
|
6995
6902
|
borderRadius: fullscreenValue ? 0 : '12px',
|
|
6996
6903
|
borderColor: fullscreenValue ? primaryColor : darkThemePrimaryColor,
|
|
6997
|
-
|
|
6904
|
+
inset: fullscreenValue ? 0 : '-4px',
|
|
6998
6905
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6999
6906
|
borderColor: darkThemePrimaryColor,
|
|
7000
6907
|
}),
|
|
@@ -7262,6 +7169,7 @@ const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme,
|
|
|
7262
7169
|
}),
|
|
7263
7170
|
},
|
|
7264
7171
|
})),
|
|
7172
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7265
7173
|
[`::slotted(${child}:focus)`]: {
|
|
7266
7174
|
borderColor: primaryColor,
|
|
7267
7175
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7440,6 +7348,7 @@ const getInputStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
|
7440
7348
|
},
|
|
7441
7349
|
}),
|
|
7442
7350
|
...(!isDisabled && {
|
|
7351
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7443
7352
|
'&:focus': {
|
|
7444
7353
|
borderColor: primaryColor,
|
|
7445
7354
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7527,8 +7436,8 @@ const disabledCursorStyle = {
|
|
|
7527
7436
|
};
|
|
7528
7437
|
const hiddenStyle = { display: 'none' };
|
|
7529
7438
|
const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
7530
|
-
const { primaryColor, disabledColor, hoverColor
|
|
7531
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark,
|
|
7439
|
+
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
7440
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
7532
7441
|
return getCss({
|
|
7533
7442
|
'@global': {
|
|
7534
7443
|
':host': {
|
|
@@ -7606,9 +7515,9 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7606
7515
|
whiteSpace: 'nowrap',
|
|
7607
7516
|
cursor: 'pointer',
|
|
7608
7517
|
color: primaryColor,
|
|
7609
|
-
outline: 0,
|
|
7610
7518
|
borderRadius: borderRadiusSmall,
|
|
7611
7519
|
borderColor: 'transparent', // default value is needed for smooth transition
|
|
7520
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style
|
|
7612
7521
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7613
7522
|
color: primaryColorDark,
|
|
7614
7523
|
}),
|
|
@@ -7621,16 +7530,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7621
7530
|
}),
|
|
7622
7531
|
},
|
|
7623
7532
|
}),
|
|
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
7533
|
'&[aria-current]': {
|
|
7635
7534
|
...disabledCursorStyle,
|
|
7636
7535
|
color: primaryColor,
|
|
@@ -7639,7 +7538,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7639
7538
|
color: primaryColorDark,
|
|
7640
7539
|
borderColor: primaryColorDark,
|
|
7641
7540
|
}),
|
|
7642
|
-
'&:not(.ellipsis):focus::before': getInsetJssStyle(-6), // adjust for missing 2px border
|
|
7643
7541
|
},
|
|
7644
7542
|
'&[aria-disabled]': {
|
|
7645
7543
|
...disabledCursorStyle,
|
|
@@ -7648,6 +7546,8 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7648
7546
|
color: disabledColorDark,
|
|
7649
7547
|
}),
|
|
7650
7548
|
},
|
|
7549
|
+
// TODO :not(.ellipsis) is only needed for VRT states tests to work properly
|
|
7550
|
+
'&:not(.ellipsis)': getFocusJssStyle(theme),
|
|
7651
7551
|
},
|
|
7652
7552
|
},
|
|
7653
7553
|
ellipsis: {
|
|
@@ -7747,6 +7647,8 @@ const getComponentCss$v = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
7747
7647
|
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
7748
7648
|
// .message
|
|
7749
7649
|
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7650
|
+
// .loading
|
|
7651
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
7750
7652
|
});
|
|
7751
7653
|
};
|
|
7752
7654
|
|
|
@@ -7850,8 +7752,8 @@ const getDirectionArrowMap = (theme) => {
|
|
|
7850
7752
|
};
|
|
7851
7753
|
};
|
|
7852
7754
|
const getComponentCss$u = (direction, isNative, theme) => {
|
|
7853
|
-
const { hoverColor,
|
|
7854
|
-
const { hoverColor: hoverColorDark,
|
|
7755
|
+
const { hoverColor, backgroundColor, primaryColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
7756
|
+
const { hoverColor: hoverColorDark, primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
7855
7757
|
const shadowColor = 'rgba(0,0,0,0.3)';
|
|
7856
7758
|
return getCss({
|
|
7857
7759
|
'@global': {
|
|
@@ -7870,18 +7772,17 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7870
7772
|
},
|
|
7871
7773
|
button: {
|
|
7872
7774
|
display: 'block',
|
|
7873
|
-
position: 'relative',
|
|
7874
7775
|
WebkitAppearance: 'none', // iOS safari
|
|
7875
7776
|
appearance: 'none',
|
|
7876
7777
|
background: 'transparent',
|
|
7877
7778
|
border: 0,
|
|
7878
7779
|
padding: 0,
|
|
7879
|
-
outline: 0,
|
|
7880
7780
|
cursor: 'pointer',
|
|
7881
7781
|
...textSmallStyle,
|
|
7882
7782
|
width: fontLineHeight, // width needed to improve ssr support
|
|
7883
7783
|
height: fontLineHeight, // height needed to improve ssr support
|
|
7884
7784
|
borderRadius: '50%',
|
|
7785
|
+
// TODO: we should try to use getHoverStyle()
|
|
7885
7786
|
...hoverMediaQuery({
|
|
7886
7787
|
transition: getTransition('background-color'),
|
|
7887
7788
|
'&:hover': {
|
|
@@ -7892,22 +7793,7 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7892
7793
|
}),
|
|
7893
7794
|
},
|
|
7894
7795
|
}),
|
|
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
|
-
},
|
|
7796
|
+
...getFocusJssStyle(theme, { offset: 0 }),
|
|
7911
7797
|
},
|
|
7912
7798
|
},
|
|
7913
7799
|
label: getHiddenTextJssStyle(),
|
|
@@ -7923,7 +7809,9 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7923
7809
|
margin: 0,
|
|
7924
7810
|
padding: 0,
|
|
7925
7811
|
}
|
|
7926
|
-
:
|
|
7812
|
+
: {
|
|
7813
|
+
inset: `${-safeZonePx}px`,
|
|
7814
|
+
}),
|
|
7927
7815
|
position: 'absolute',
|
|
7928
7816
|
zIndex: POPOVER_Z_INDEX,
|
|
7929
7817
|
filter: `drop-shadow(0 0 16px ${shadowColor})`,
|
|
@@ -8009,11 +7897,6 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8009
7897
|
}),
|
|
8010
7898
|
},
|
|
8011
7899
|
}),
|
|
8012
|
-
...(!isDisabled && {
|
|
8013
|
-
'&(input:focus)::before': {
|
|
8014
|
-
borderRadius: '50%',
|
|
8015
|
-
},
|
|
8016
|
-
}),
|
|
8017
7900
|
},
|
|
8018
7901
|
})),
|
|
8019
7902
|
},
|
|
@@ -8054,6 +7937,8 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8054
7937
|
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
8055
7938
|
gridColumn: '1/3',
|
|
8056
7939
|
}),
|
|
7940
|
+
// .loading
|
|
7941
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
8057
7942
|
});
|
|
8058
7943
|
};
|
|
8059
7944
|
|
|
@@ -8079,8 +7964,8 @@ const getGradient = (theme, gradientColorTheme) => {
|
|
|
8079
7964
|
};
|
|
8080
7965
|
const prevNextWrapperWidth = `calc(${fontLineHeight} + 24px)`;
|
|
8081
7966
|
const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndicatorPosition, hasScrollbar, theme) => {
|
|
8082
|
-
const { backgroundColor, backgroundSurfaceColor,
|
|
8083
|
-
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
7967
|
+
const { backgroundColor, backgroundSurfaceColor, hoverColor } = getThemedColors(theme);
|
|
7968
|
+
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
8084
7969
|
const backgroundColorLight = {
|
|
8085
7970
|
'background-base': backgroundColor,
|
|
8086
7971
|
'background-surface': backgroundSurfaceColor,
|
|
@@ -8173,24 +8058,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8173
8058
|
minHeight: '28px',
|
|
8174
8059
|
minWidth: '100%',
|
|
8175
8060
|
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
|
-
},
|
|
8061
|
+
borderRadius: borderRadiusSmall,
|
|
8062
|
+
...getFocusJssStyle(theme),
|
|
8194
8063
|
},
|
|
8195
8064
|
trigger: {
|
|
8196
8065
|
position: 'absolute',
|
|
@@ -8248,8 +8117,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8248
8117
|
};
|
|
8249
8118
|
|
|
8250
8119
|
const ITEM_PADDING = '17px';
|
|
8251
|
-
const ICON_SIZE =
|
|
8252
|
-
const ICON_MARGIN =
|
|
8120
|
+
const ICON_SIZE = '1.5rem';
|
|
8121
|
+
const ICON_MARGIN = '.25rem';
|
|
8253
8122
|
const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
8254
8123
|
const { primaryColor, contrastMediumColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
8255
8124
|
const { highlightColor } = getHighContrastColors();
|
|
@@ -8262,8 +8131,6 @@ const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
|
8262
8131
|
};
|
|
8263
8132
|
const getItemPadding = (hasIconAndSlottedContent) => hasIconAndSlottedContent ? `13px ${ITEM_PADDING} 13px 13px` : `13px ${ITEM_PADDING}`;
|
|
8264
8133
|
const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, theme) => {
|
|
8265
|
-
const { focusColor } = getThemedColors(theme);
|
|
8266
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
8267
8134
|
const { buttonColor, labelColor, borderColor, hoverBorderColor } = getColors$2(isDisabled, isSelected, theme);
|
|
8268
8135
|
const { buttonColor: buttonColorDark, labelColor: labelColorDark, borderColor: borderColorDark, hoverBorderColor: hoverBorderColorDark, } = getColors$2(isDisabled, isSelected, 'dark');
|
|
8269
8136
|
return getCss({
|
|
@@ -8285,30 +8152,9 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8285
8152
|
margin: 0, // Removes default button margin on safari 15
|
|
8286
8153
|
border: `${borderWidthBase} solid ${borderColor}`,
|
|
8287
8154
|
borderRadius: borderRadiusSmall,
|
|
8288
|
-
outline: 0,
|
|
8289
8155
|
background: 'transparent',
|
|
8290
8156
|
color: buttonColor,
|
|
8291
8157
|
...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
8158
|
...(isDisabled
|
|
8313
8159
|
? {
|
|
8314
8160
|
cursor: 'not-allowed',
|
|
@@ -8326,6 +8172,11 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8326
8172
|
},
|
|
8327
8173
|
})),
|
|
8328
8174
|
}),
|
|
8175
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8176
|
+
borderColor: borderColorDark,
|
|
8177
|
+
color: buttonColorDark,
|
|
8178
|
+
}),
|
|
8179
|
+
...getFocusJssStyle(theme),
|
|
8329
8180
|
},
|
|
8330
8181
|
// label
|
|
8331
8182
|
span: {
|
|
@@ -8384,7 +8235,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8384
8235
|
// TODO: extract generic default button/anchor reset style
|
|
8385
8236
|
button: {
|
|
8386
8237
|
position: 'absolute',
|
|
8387
|
-
|
|
8238
|
+
inset: 0,
|
|
8388
8239
|
width: '100%', // fixes Firefox positioning issue
|
|
8389
8240
|
height: '100%', // fixes Firefox positioning issue
|
|
8390
8241
|
margin: 0,
|
|
@@ -8398,6 +8249,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8398
8249
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8399
8250
|
borderColor: isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark,
|
|
8400
8251
|
}),
|
|
8252
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
8401
8253
|
'&:focus, &:focus ~ ul': {
|
|
8402
8254
|
borderColor: primaryColor,
|
|
8403
8255
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -8446,7 +8298,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8446
8298
|
input: {
|
|
8447
8299
|
display: 'block',
|
|
8448
8300
|
position: 'absolute',
|
|
8449
|
-
|
|
8301
|
+
inset: borderWidthBase,
|
|
8450
8302
|
width: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8451
8303
|
height: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8452
8304
|
zIndex: 1,
|
|
@@ -8515,7 +8367,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8515
8367
|
'&+span': {
|
|
8516
8368
|
// for focus outline and clicking arrow since input ends left of the icon
|
|
8517
8369
|
position: 'absolute',
|
|
8518
|
-
|
|
8370
|
+
inset: 0,
|
|
8519
8371
|
transition: getTransition('border-color'),
|
|
8520
8372
|
pointerEvents: 'all',
|
|
8521
8373
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
@@ -8844,8 +8696,8 @@ const getSVGPath = (stepCount, numberedCircleColors, isStateCurrent) => {
|
|
|
8844
8696
|
return svgNumberedCirclePaths[stepCount];
|
|
8845
8697
|
};
|
|
8846
8698
|
const getComponentCss$m = (state, disabled, theme) => {
|
|
8847
|
-
const { primaryColor, hoverColor, disabledColor
|
|
8848
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark,
|
|
8699
|
+
const { primaryColor, hoverColor, disabledColor } = getThemedColors(theme);
|
|
8700
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
8849
8701
|
const isStateCurrent = state === 'current';
|
|
8850
8702
|
const isStateCurrentOrUndefined = !state || isStateCurrent;
|
|
8851
8703
|
const isDisabled = !state || disabled;
|
|
@@ -8887,7 +8739,6 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8887
8739
|
margin: 0, // Removes default button margin on safari 15
|
|
8888
8740
|
background: 0,
|
|
8889
8741
|
border: 0,
|
|
8890
|
-
outline: 0,
|
|
8891
8742
|
...textSmallStyle,
|
|
8892
8743
|
fontSize: 'inherit',
|
|
8893
8744
|
width: 'max-content',
|
|
@@ -8923,19 +8774,7 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8923
8774
|
width: fontLineHeight,
|
|
8924
8775
|
},
|
|
8925
8776
|
}),
|
|
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
|
-
},
|
|
8777
|
+
...getFocusJssStyle(theme, { offset: '-2px' }),
|
|
8939
8778
|
},
|
|
8940
8779
|
},
|
|
8941
8780
|
...(!isStateCurrentOrUndefined && {
|
|
@@ -8998,128 +8837,105 @@ const getColors$1 = (checked, disabled, loading, theme) => {
|
|
|
8998
8837
|
const getComponentCss$k = (alignLabel, hideLabel, stretch, checked, disabled, loading, theme) => {
|
|
8999
8838
|
const { buttonBorderColor, buttonBorderColorHover, buttonBackgroundColor, buttonBackgroundColorHover, toggleBackgroundColor, toggleBackgroundColorHover, textColor, } = getColors$1(checked, disabled, loading, theme);
|
|
9000
8839
|
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
8840
|
return getCss({
|
|
9004
8841
|
'@global': {
|
|
9005
8842
|
':host': {
|
|
9006
8843
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
9007
|
-
display: stretchValue ? '
|
|
8844
|
+
display: stretchValue ? 'flex' : 'inline-flex',
|
|
9008
8845
|
})),
|
|
9009
8846
|
...addImportantToEachRule({
|
|
9010
8847
|
outline: 0, // custom element is able to delegate the focus
|
|
8848
|
+
gap: spacingStaticSmall,
|
|
9011
8849
|
...colorSchemeStyles,
|
|
9012
8850
|
...hostHiddenStyles,
|
|
9013
8851
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
8852
|
+
justifyContent: stretchValue ? 'space-between' : 'flex-start',
|
|
9014
8853
|
width: stretchValue ? '100%' : 'auto', // prevents adjusting its size when used as flex or grid child
|
|
9015
8854
|
...(!stretchValue && { verticalAlign: 'top' }),
|
|
9016
8855
|
})),
|
|
9017
8856
|
}),
|
|
9018
8857
|
},
|
|
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,
|
|
8858
|
+
button: {
|
|
8859
|
+
display: 'flex',
|
|
8860
|
+
alignItems: 'center',
|
|
8861
|
+
flexShrink: 0,
|
|
8862
|
+
width: '48px',
|
|
8863
|
+
height: '28px',
|
|
8864
|
+
boxSizing: 'border-box',
|
|
8865
|
+
border: `${borderWidthBase} solid ${buttonBorderColor}`,
|
|
8866
|
+
borderRadius: '14px',
|
|
8867
|
+
backgroundColor: buttonBackgroundColor,
|
|
8868
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8869
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
8870
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8871
|
+
borderColor: buttonBorderColorDark,
|
|
8872
|
+
backgroundColor: buttonBackgroundColorDark,
|
|
8873
|
+
}),
|
|
8874
|
+
margin: 0, // Removes default button margin on safari 15
|
|
8875
|
+
padding: 0,
|
|
8876
|
+
WebkitAppearance: 'none', // iOS safari
|
|
8877
|
+
appearance: 'none',
|
|
8878
|
+
...(!isDisabledOrLoading(disabled, loading) &&
|
|
8879
|
+
hoverMediaQuery({
|
|
8880
|
+
'&:hover': {
|
|
8881
|
+
borderColor: buttonBorderColorHover,
|
|
8882
|
+
backgroundColor: buttonBackgroundColorHover,
|
|
9048
8883
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9049
|
-
|
|
8884
|
+
borderColor: buttonBorderColorHoverDark,
|
|
8885
|
+
backgroundColor: buttonBackgroundColorHoverDark,
|
|
9050
8886
|
}),
|
|
8887
|
+
'& .toggle': {
|
|
8888
|
+
backgroundColor: toggleBackgroundColorHover,
|
|
8889
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8890
|
+
backgroundColor: toggleBackgroundColorHoverDark,
|
|
8891
|
+
}),
|
|
8892
|
+
},
|
|
9051
8893
|
},
|
|
9052
|
-
},
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
8894
|
+
})),
|
|
8895
|
+
...getFocusJssStyle(theme),
|
|
8896
|
+
},
|
|
8897
|
+
label: {
|
|
8898
|
+
...textSmallStyle,
|
|
8899
|
+
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
8900
|
+
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
8901
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8902
|
+
color: textColor,
|
|
9059
8903
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9060
|
-
|
|
8904
|
+
color: textColorDark,
|
|
9061
8905
|
}),
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
8906
|
+
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
8907
|
+
// 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
|
|
8908
|
+
order: alignLabelValue === 'left' || alignLabelValue === 'start' ? -1 : 0,
|
|
8909
|
+
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
8910
|
+
paddingTop: '2px', // currently, line-height of textSmall doesn't match height of switch
|
|
8911
|
+
}))),
|
|
9066
8912
|
},
|
|
9067
8913
|
},
|
|
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
8914
|
toggle: {
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
8915
|
+
display: 'flex',
|
|
8916
|
+
alignItems: 'center',
|
|
8917
|
+
justifyContent: 'center',
|
|
9088
8918
|
width: '20px',
|
|
9089
8919
|
height: '20px',
|
|
9090
|
-
display: 'block',
|
|
9091
8920
|
borderRadius: '50%',
|
|
9092
8921
|
backgroundColor: toggleBackgroundColor,
|
|
8922
|
+
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
8923
|
+
transform: `translate3d(${checked ? '22px' : '2px'}, 0, 0)`,
|
|
8924
|
+
'&:dir(rtl)': {
|
|
8925
|
+
transform: `translate3d(${checked ? '-22px' : '-2px'}, 0, 0)`,
|
|
8926
|
+
},
|
|
9093
8927
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9094
8928
|
backgroundColor: toggleBackgroundColorDark,
|
|
9095
8929
|
}),
|
|
9096
|
-
transform: `translate3d(${checked ? '20px' : '0'}, 0, 0)`,
|
|
9097
|
-
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
9098
8930
|
},
|
|
9099
8931
|
...(loading && {
|
|
9100
8932
|
spinner: {
|
|
9101
|
-
position: 'absolute',
|
|
9102
|
-
top: '-4px',
|
|
9103
|
-
left: '-4px',
|
|
9104
8933
|
width: '28px',
|
|
9105
8934
|
height: '28px',
|
|
9106
8935
|
},
|
|
9107
8936
|
}),
|
|
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
|
-
},
|
|
8937
|
+
// .loading
|
|
8938
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
9123
8939
|
});
|
|
9124
8940
|
};
|
|
9125
8941
|
|
|
@@ -9206,7 +9022,7 @@ const getComponentCss$h = (theme) => {
|
|
|
9206
9022
|
});
|
|
9207
9023
|
};
|
|
9208
9024
|
|
|
9209
|
-
const { hoverColor
|
|
9025
|
+
const { hoverColor } = getThemedColors('light'); // hover color and focus color are the same for light and dark
|
|
9210
9026
|
const buttonBeforeOffsetVertical = '-2px';
|
|
9211
9027
|
const buttonBeforeOffsetHorizontal = '-4px';
|
|
9212
9028
|
const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
@@ -9233,7 +9049,6 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9233
9049
|
padding: 0,
|
|
9234
9050
|
font: 'inherit',
|
|
9235
9051
|
color: 'inherit',
|
|
9236
|
-
outline: 0,
|
|
9237
9052
|
alignItems: 'flex-end',
|
|
9238
9053
|
WebkitAppearance: 'none', // iOS safari
|
|
9239
9054
|
appearance: 'none',
|
|
@@ -9242,19 +9057,17 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9242
9057
|
border: 0,
|
|
9243
9058
|
zIndex: 0,
|
|
9244
9059
|
cursor: 'pointer',
|
|
9060
|
+
// TODO: re-think if ::before is still needed
|
|
9245
9061
|
'&::before': {
|
|
9246
9062
|
content: '""',
|
|
9247
9063
|
position: 'absolute',
|
|
9248
|
-
|
|
9249
|
-
bottom: buttonBeforeOffsetVertical,
|
|
9250
|
-
right: buttonBeforeOffsetHorizontal,
|
|
9251
|
-
left: buttonBeforeOffsetHorizontal,
|
|
9064
|
+
inset: `${buttonBeforeOffsetVertical} ${buttonBeforeOffsetHorizontal}`,
|
|
9252
9065
|
borderRadius: borderRadiusSmall,
|
|
9253
9066
|
zIndex: -1, // needed so that text behind element is selectable and/or visible
|
|
9254
9067
|
transition: getTransition('background-color'),
|
|
9255
9068
|
},
|
|
9256
9069
|
...hoverMediaQuery({
|
|
9257
|
-
'&:hover, &:focus': {
|
|
9070
|
+
'&:hover, &:focus-visible': {
|
|
9258
9071
|
'& .icon': {
|
|
9259
9072
|
opacity: 1,
|
|
9260
9073
|
},
|
|
@@ -9264,12 +9077,8 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9264
9077
|
backgroundColor: hoverColor,
|
|
9265
9078
|
},
|
|
9266
9079
|
}),
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
},
|
|
9270
|
-
'&:not(:focus-visible)::before': {
|
|
9271
|
-
border: 0,
|
|
9272
|
-
},
|
|
9080
|
+
// TODO: to be future proof, we need to pass theme parameter
|
|
9081
|
+
...getFocusJssStyle('light', { pseudo: true, offset: '-2px' }),
|
|
9273
9082
|
},
|
|
9274
9083
|
}
|
|
9275
9084
|
: hideLabel && {
|
|
@@ -9345,8 +9154,8 @@ const scrollerAnimatedCssClass = 'scroller--animated';
|
|
|
9345
9154
|
const targetSelectors = ['a', 'button'];
|
|
9346
9155
|
const transformSelector = (selector) => targetSelectors.map((tag) => selector.replace(/\[role]/g, tag)).join();
|
|
9347
9156
|
const getComponentCss$c = (size, weight, theme) => {
|
|
9348
|
-
const { primaryColor, hoverColor
|
|
9349
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark
|
|
9157
|
+
const { primaryColor, hoverColor } = getThemedColors(theme);
|
|
9158
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark } = getThemedColors('dark');
|
|
9350
9159
|
const barJssStyle = {
|
|
9351
9160
|
position: 'absolute',
|
|
9352
9161
|
height: '2px',
|
|
@@ -9373,6 +9182,12 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9373
9182
|
}),
|
|
9374
9183
|
},
|
|
9375
9184
|
...addImportantToEachRule({
|
|
9185
|
+
'::slotted': {
|
|
9186
|
+
// TODO: produces duplicated css code in SSR context, we should try to make use of multiple selector like
|
|
9187
|
+
// `::slotted(:is(a,button))`.
|
|
9188
|
+
...getFocusJssStyle(theme, { slotted: 'a', offset: '1px' }),
|
|
9189
|
+
...getFocusJssStyle(theme, { slotted: 'button', offset: '1px' }),
|
|
9190
|
+
},
|
|
9376
9191
|
// would be nice to use shared selector like '::slotted([role])'
|
|
9377
9192
|
// but this doesn't work reliably when rendering in browser
|
|
9378
9193
|
[transformSelector('::slotted([role])')]: {
|
|
@@ -9381,6 +9196,7 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9381
9196
|
position: 'relative',
|
|
9382
9197
|
margin: '0 0 4px 0',
|
|
9383
9198
|
verticalAlign: 'top',
|
|
9199
|
+
// TODO: can we use `all: 'inherit'` instead?
|
|
9384
9200
|
fontFamily: 'inherit',
|
|
9385
9201
|
fontStyle: 'inherit',
|
|
9386
9202
|
fontVariant: 'inherit',
|
|
@@ -9434,13 +9250,6 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9434
9250
|
bottom: isHighContrastMode ? '-4px' : '-6px',
|
|
9435
9251
|
visibility: 'inherit',
|
|
9436
9252
|
},
|
|
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
9253
|
[transformSelector('::slotted([role]:not(:last-child))')]: {
|
|
9445
9254
|
marginInlineEnd: spacingStaticMedium,
|
|
9446
9255
|
},
|
|
@@ -9476,30 +9285,20 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9476
9285
|
};
|
|
9477
9286
|
|
|
9478
9287
|
const getComponentCss$b = (theme) => {
|
|
9479
|
-
const { primaryColor
|
|
9480
|
-
const { primaryColor: primaryColorDark
|
|
9288
|
+
const { primaryColor } = getThemedColors(theme);
|
|
9289
|
+
const { primaryColor: primaryColorDark } = getThemedColors('dark');
|
|
9481
9290
|
return getCss({
|
|
9482
9291
|
'@global': {
|
|
9483
9292
|
':host': {
|
|
9484
9293
|
display: 'block',
|
|
9485
9294
|
...addImportantToEachRule({
|
|
9486
|
-
position: 'relative',
|
|
9487
9295
|
color: primaryColor, // enables color inheritance for e.g. slotted anchor
|
|
9488
|
-
|
|
9296
|
+
borderRadius: '2px',
|
|
9489
9297
|
...hostHiddenStyles,
|
|
9490
9298
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9491
9299
|
color: primaryColorDark,
|
|
9492
9300
|
}),
|
|
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
|
-
},
|
|
9301
|
+
...getFocusJssStyle(theme, { slotted: true }),
|
|
9503
9302
|
}),
|
|
9504
9303
|
},
|
|
9505
9304
|
},
|
|
@@ -9523,20 +9322,6 @@ const getComponentCss$a = () => {
|
|
|
9523
9322
|
});
|
|
9524
9323
|
};
|
|
9525
9324
|
|
|
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
9325
|
const getThemedBackgroundColor = (tagColor, themedColors) => {
|
|
9541
9326
|
const colorMap = {
|
|
9542
9327
|
'background-base': themedColors.backgroundColor,
|
|
@@ -9583,7 +9368,10 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9583
9368
|
color: primaryColor,
|
|
9584
9369
|
textAlign: 'start',
|
|
9585
9370
|
...textSmallStyle,
|
|
9586
|
-
|
|
9371
|
+
...(isHighContrastMode && {
|
|
9372
|
+
// TODO: using border would increase the dimension but using outline interferes with the focus style
|
|
9373
|
+
outline: '1px solid transparent',
|
|
9374
|
+
}),
|
|
9587
9375
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9588
9376
|
background: backgroundColorDark,
|
|
9589
9377
|
color: primaryColorDark,
|
|
@@ -9596,7 +9384,7 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9596
9384
|
}),
|
|
9597
9385
|
},
|
|
9598
9386
|
}),
|
|
9599
|
-
...
|
|
9387
|
+
...getFocusJssStyle(theme),
|
|
9600
9388
|
},
|
|
9601
9389
|
},
|
|
9602
9390
|
...(hasLabel && {
|
|
@@ -9639,7 +9427,6 @@ const getColors = (themedColors, tagColor, theme) => {
|
|
|
9639
9427
|
const { primaryColor } = tagColor === 'primary' ? getInvertedThemedColors(theme) : themedColors;
|
|
9640
9428
|
return {
|
|
9641
9429
|
primaryColor,
|
|
9642
|
-
focusColor: themedColors.focusColor,
|
|
9643
9430
|
backgroundColor: getThemedBackgroundColor(tagColor, themedColors),
|
|
9644
9431
|
backgroundHoverColor: getThemedBackgroundHoverColor(tagColor, themedColors, theme),
|
|
9645
9432
|
};
|
|
@@ -9702,11 +9489,14 @@ const getComponentCss$8 = (tagColor, isFocusable, theme) => {
|
|
|
9702
9489
|
border: 0,
|
|
9703
9490
|
textAlign: 'start',
|
|
9704
9491
|
},
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9492
|
+
'&(a)::before,&(button)::before': {
|
|
9493
|
+
content: '""',
|
|
9494
|
+
position: 'absolute',
|
|
9495
|
+
inset: 0,
|
|
9496
|
+
borderRadius: '4px',
|
|
9497
|
+
},
|
|
9498
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
9499
|
+
...getFocusJssStyle(theme, { slotted: 'button', pseudo: true }),
|
|
9710
9500
|
'&(br)': {
|
|
9711
9501
|
display: 'none',
|
|
9712
9502
|
},
|
|
@@ -10083,7 +9873,14 @@ const getComponentCss = (size, theme) => {
|
|
|
10083
9873
|
},
|
|
10084
9874
|
a: {
|
|
10085
9875
|
textDecoration: 'none',
|
|
10086
|
-
|
|
9876
|
+
'&::before': {
|
|
9877
|
+
// needs to be defined always to have correct custom click area
|
|
9878
|
+
content: '""',
|
|
9879
|
+
position: 'absolute',
|
|
9880
|
+
inset: 0,
|
|
9881
|
+
borderRadius: '1px',
|
|
9882
|
+
},
|
|
9883
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
10087
9884
|
},
|
|
10088
9885
|
svg: isHighContrastMode
|
|
10089
9886
|
? {
|
|
@@ -10119,6 +9916,7 @@ exports.getFlyoutCss = getComponentCss$N;
|
|
|
10119
9916
|
exports.getFlyoutNavigationCss = getComponentCss$P;
|
|
10120
9917
|
exports.getFlyoutNavigationItemCss = getComponentCss$O;
|
|
10121
9918
|
exports.getFunctionalComponentLabelStyles = getFunctionalComponentLabelStyles;
|
|
9919
|
+
exports.getFunctionalComponentLoadingMessageStyles = getFunctionalComponentLoadingMessageStyles;
|
|
10122
9920
|
exports.getFunctionalComponentRequiredStyles = getFunctionalComponentRequiredStyles;
|
|
10123
9921
|
exports.getFunctionalComponentStateMessageStyles = getFunctionalComponentStateMessageStyles;
|
|
10124
9922
|
exports.getGridCss = getComponentCss$L;
|