@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
|
@@ -3208,29 +3208,6 @@ const dropShadowHighStyle = {
|
|
|
3208
3208
|
boxShadow: `0px 8px 40px ${_dropShadowBackgroundColor}`, // filter: drop-shadow() causes visual glitches in Firefox in combination with frostedGlassStyle
|
|
3209
3209
|
};
|
|
3210
3210
|
|
|
3211
|
-
const themeLightStateFocus = '#1A44EA';
|
|
3212
|
-
|
|
3213
|
-
const getFocusStyle = (opts) => {
|
|
3214
|
-
const { borderRadius = 'small', offset = '2px' } = opts || {};
|
|
3215
|
-
const outlineOffset = offset === 'small' ? '2px' : offset === 'none' ? 0 : offset || '2px';
|
|
3216
|
-
const borderRadiusValue = borderRadius === 'small'
|
|
3217
|
-
? borderRadiusSmall
|
|
3218
|
-
: borderRadius === 'medium'
|
|
3219
|
-
? borderRadiusMedium
|
|
3220
|
-
: borderRadius || borderRadiusSmall;
|
|
3221
|
-
return {
|
|
3222
|
-
borderRadius: borderRadiusValue, // it's visually being reflected on both (when placed here), element and focus outline
|
|
3223
|
-
'&:focus': {
|
|
3224
|
-
outline: `${borderWidthBase} solid ${themeLightStateFocus}`,
|
|
3225
|
-
outlineOffset,
|
|
3226
|
-
},
|
|
3227
|
-
// why? have a look at this article https://www.tpgi.com/focus-visible-and-backwards-compatibility/
|
|
3228
|
-
'&:focus:not(:focus-visible)': {
|
|
3229
|
-
outlineColor: 'transparent',
|
|
3230
|
-
},
|
|
3231
|
-
};
|
|
3232
|
-
};
|
|
3233
|
-
|
|
3234
3211
|
const fontFamily = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
|
|
3235
3212
|
|
|
3236
3213
|
const fontHyphenationStyle = {
|
|
@@ -3825,8 +3802,9 @@ const motionEasingMap = {
|
|
|
3825
3802
|
};
|
|
3826
3803
|
const cssVariableTransitionDuration = '--p-transition-duration';
|
|
3827
3804
|
const cssVariableAnimationDuration = '--p-animation-duration';
|
|
3828
|
-
const getTransition = (cssProperty, duration = 'short', easing = 'base', delay) =>
|
|
3829
|
-
|
|
3805
|
+
const getTransition = (cssProperty, duration = 'short', easing = 'base', delay) => {
|
|
3806
|
+
return `${cssProperty} var(${cssVariableTransitionDuration}, ${motionDurationMap[duration]}) ${motionEasingMap[easing]}${delay ? ` var(${cssVariableTransitionDuration}, ${motionDurationMap[delay]})` : ''}`;
|
|
3807
|
+
};
|
|
3830
3808
|
const addImportantToRule = (value) => `${value} !important`;
|
|
3831
3809
|
const addImportantToEachRule = (input) => {
|
|
3832
3810
|
return Object.entries(input).reduce((result, [key, value]) => value === null
|
|
@@ -3840,13 +3818,25 @@ const addImportantToEachRule = (input) => {
|
|
|
3840
3818
|
const doGetThemedColors = (theme = 'light') => {
|
|
3841
3819
|
return getThemedColors(theme);
|
|
3842
3820
|
};
|
|
3843
|
-
const
|
|
3844
|
-
|
|
3821
|
+
const getFocusJssStyle = (theme, opts) => {
|
|
3822
|
+
const { offset = '2px', slotted = '', pseudo = false } = opts || {};
|
|
3823
|
+
const { focusColor } = getThemedColors(theme);
|
|
3824
|
+
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
3825
|
+
const slottedSelector = slotted && slotted !== true ? slotted : '';
|
|
3845
3826
|
return {
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3827
|
+
[`&${slotted ? '(' : ''}${slottedSelector}::-moz-focus-inner${slotted ? ')' : ''}`]: {
|
|
3828
|
+
border: 0, // reset ua-style (for FF)
|
|
3829
|
+
},
|
|
3830
|
+
[`&${slotted ? '(' : ''}${slottedSelector}:focus${slotted ? ')' : ''}`]: {
|
|
3831
|
+
outline: 0, // reset ua-style (for older browsers)
|
|
3832
|
+
},
|
|
3833
|
+
[`&${slotted ? '(' : ''}${slottedSelector}:focus-visible${slotted ? ')' : ''}${pseudo ? '::before' : ''}`]: {
|
|
3834
|
+
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
3835
|
+
outlineOffset: offset,
|
|
3836
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
3837
|
+
outlineColor: focusColorDark,
|
|
3838
|
+
}),
|
|
3839
|
+
},
|
|
3850
3840
|
};
|
|
3851
3841
|
};
|
|
3852
3842
|
// reset initial styles, e.g. in case link-pure is used with slotted anchor and nested within e.g. an accordion
|
|
@@ -3857,55 +3847,38 @@ const getResetInitialStylesForSlottedAnchor = {
|
|
|
3857
3847
|
borderRadius: 0,
|
|
3858
3848
|
background: 'transparent',
|
|
3859
3849
|
};
|
|
3860
|
-
const focusPseudoJssStyle = {
|
|
3861
|
-
outline: 0,
|
|
3862
|
-
'&::before': {
|
|
3863
|
-
// needs to be defined always to have correct custom click area
|
|
3864
|
-
content: '""',
|
|
3865
|
-
position: 'absolute',
|
|
3866
|
-
...getInsetJssStyle(),
|
|
3867
|
-
},
|
|
3868
|
-
'&:focus::before': {
|
|
3869
|
-
borderRadius: '1px', // TODO: why just 1px border-radius?
|
|
3870
|
-
outline: `${borderWidthBase} solid ${themeLightStateFocus}`,
|
|
3871
|
-
outlineOffset: '2px',
|
|
3872
|
-
},
|
|
3873
|
-
'&:focus:not(:focus-visible)::before': {
|
|
3874
|
-
outline: 0,
|
|
3875
|
-
},
|
|
3876
|
-
};
|
|
3877
3850
|
/**
|
|
3878
3851
|
* 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.
|
|
3879
3852
|
* @param {boolean} isHidden - A boolean value indicating whether the text should be hidden or not. Defaults to true.
|
|
3880
3853
|
* @param {JssStyle} isShownJssStyle - Additional styles applied when isHidden = false
|
|
3881
3854
|
* @returns {JssStyle} - A JSS style object containing styles depending on the value of isHidden and isShownJssStyle.
|
|
3882
3855
|
*/
|
|
3883
|
-
const getHiddenTextJssStyle = (isHidden = true, isShownJssStyle) =>
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3856
|
+
const getHiddenTextJssStyle = (isHidden = true, isShownJssStyle) => {
|
|
3857
|
+
return isHidden
|
|
3858
|
+
? {
|
|
3859
|
+
position: 'absolute',
|
|
3860
|
+
width: '1px',
|
|
3861
|
+
height: '1px',
|
|
3862
|
+
padding: 0,
|
|
3863
|
+
margin: '-1px',
|
|
3864
|
+
overflow: 'hidden',
|
|
3865
|
+
clip: 'rect(0,0,0,0)',
|
|
3866
|
+
whiteSpace: 'nowrap',
|
|
3867
|
+
}
|
|
3868
|
+
: {
|
|
3869
|
+
position: 'static',
|
|
3870
|
+
width: 'auto',
|
|
3871
|
+
height: 'auto',
|
|
3872
|
+
padding: 0,
|
|
3873
|
+
margin: 0,
|
|
3874
|
+
overflow: 'visible',
|
|
3875
|
+
clip: 'auto',
|
|
3876
|
+
whiteSpace: 'normal',
|
|
3877
|
+
...isShownJssStyle,
|
|
3878
|
+
};
|
|
3879
|
+
};
|
|
3880
|
+
// TODO: there should be a shared style util for modal, flyout and flyout-navigation instead of having this code in the
|
|
3881
|
+
// 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.
|
|
3909
3882
|
/**
|
|
3910
3883
|
* Generates JSS styles for a frosted glass background.
|
|
3911
3884
|
* @param {boolean} isVisible - Determines if the frosted glass effect is visible.
|
|
@@ -3917,7 +3890,7 @@ const getBackfaceVisibilityJssStyle = () => ({
|
|
|
3917
3890
|
const getBackdropJssStyle = (isVisible, zIndex, theme, duration = 'long') => {
|
|
3918
3891
|
return {
|
|
3919
3892
|
position: 'fixed',
|
|
3920
|
-
|
|
3893
|
+
inset: 0,
|
|
3921
3894
|
zIndex,
|
|
3922
3895
|
// TODO: background shading is missing in getThemedColors(theme).backgroundShading
|
|
3923
3896
|
background: isThemeDark(theme) ? themeDarkBackgroundShading : themeLightBackgroundShading,
|
|
@@ -4090,8 +4063,8 @@ const formatObjectOutput = (value) => {
|
|
|
4090
4063
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
4091
4064
|
|
|
4092
4065
|
const getComponentCss$13 = (size, compact, open, theme) => {
|
|
4093
|
-
const { primaryColor, hoverColor,
|
|
4094
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark,
|
|
4066
|
+
const { primaryColor, hoverColor, contrastLowColor } = getThemedColors(theme);
|
|
4067
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
4095
4068
|
return getCss({
|
|
4096
4069
|
'@global': {
|
|
4097
4070
|
':host': {
|
|
@@ -4118,7 +4091,6 @@ const getComponentCss$13 = (size, compact, open, theme) => {
|
|
|
4118
4091
|
width: '100%',
|
|
4119
4092
|
textDecoration: 'none',
|
|
4120
4093
|
border: 0,
|
|
4121
|
-
outline: 0,
|
|
4122
4094
|
margin: 0, // Removes default button margin on safari 15
|
|
4123
4095
|
gap: '24px',
|
|
4124
4096
|
background: 'transparent',
|
|
@@ -4163,15 +4135,7 @@ const getComponentCss$13 = (size, compact, open, theme) => {
|
|
|
4163
4135
|
}),
|
|
4164
4136
|
},
|
|
4165
4137
|
})),
|
|
4166
|
-
'
|
|
4167
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4168
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4169
|
-
borderColor: focusColorDark,
|
|
4170
|
-
}),
|
|
4171
|
-
},
|
|
4172
|
-
'&:not(:focus-visible)::before': {
|
|
4173
|
-
border: 0,
|
|
4174
|
-
},
|
|
4138
|
+
...getFocusJssStyle(theme, { pseudo: true, offset: '-2px' }),
|
|
4175
4139
|
},
|
|
4176
4140
|
},
|
|
4177
4141
|
heading: {
|
|
@@ -4330,18 +4294,19 @@ const getFontSizeText = (size) => {
|
|
|
4330
4294
|
return fontSizeTextMap[size];
|
|
4331
4295
|
};
|
|
4332
4296
|
|
|
4297
|
+
// TODO: why not using getHiddenTextJssStyle()?
|
|
4333
4298
|
// 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.
|
|
4334
4299
|
const getVisibilityJssStyle = (hideLabel) => {
|
|
4335
4300
|
return hideLabel
|
|
4336
4301
|
? {
|
|
4337
4302
|
position: 'absolute',
|
|
4338
|
-
|
|
4303
|
+
inset: 0,
|
|
4339
4304
|
whiteSpace: 'nowrap',
|
|
4340
|
-
textIndent: '-999999px',
|
|
4305
|
+
textIndent: '-999999px', // TODO: check if text-indent still works for RTL-mode in this case
|
|
4341
4306
|
}
|
|
4342
4307
|
: {
|
|
4343
4308
|
position: 'relative',
|
|
4344
|
-
|
|
4309
|
+
inset: 'auto',
|
|
4345
4310
|
whiteSpace: 'inherit',
|
|
4346
4311
|
textIndent: 0,
|
|
4347
4312
|
zIndex: 1, // fix Firefox bug on :hover (#2583)
|
|
@@ -4350,8 +4315,8 @@ const getVisibilityJssStyle = (hideLabel) => {
|
|
|
4350
4315
|
const offsetVertical = '-2px';
|
|
4351
4316
|
const offsetHorizontal = '-4px';
|
|
4352
4317
|
const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, hasSlottedAnchor, theme) => {
|
|
4353
|
-
const { primaryColor, disabledColor, hoverColor
|
|
4354
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark,
|
|
4318
|
+
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4319
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
4355
4320
|
const hasIcon = hasVisibleIcon(icon, iconSource);
|
|
4356
4321
|
return {
|
|
4357
4322
|
'@global': {
|
|
@@ -4379,7 +4344,6 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4379
4344
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4380
4345
|
color: isDisabledOrLoading ? disabledColorDark : primaryColorDark,
|
|
4381
4346
|
}),
|
|
4382
|
-
outline: 0,
|
|
4383
4347
|
...textSmallStyle,
|
|
4384
4348
|
...mergeDeep(buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
4385
4349
|
justifyContent: stretchValue ? 'space-between' : 'flex-start',
|
|
@@ -4416,19 +4380,10 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4416
4380
|
}),
|
|
4417
4381
|
},
|
|
4418
4382
|
})),
|
|
4419
|
-
...(!hasSlottedAnchor && {
|
|
4420
|
-
'&:focus::before': {
|
|
4421
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4422
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4423
|
-
borderColor: focusColorDark,
|
|
4424
|
-
}),
|
|
4425
|
-
},
|
|
4426
|
-
'&:not(:focus-visible)::before': {
|
|
4427
|
-
border: 0,
|
|
4428
|
-
},
|
|
4429
|
-
}),
|
|
4383
|
+
...(!hasSlottedAnchor && getFocusJssStyle(theme, { pseudo: true, offset: '-2px' })),
|
|
4430
4384
|
},
|
|
4431
4385
|
label: {
|
|
4386
|
+
transition: getTransition('opacity'),
|
|
4432
4387
|
position: 'relative', // needed for hover state when icon="none" is set
|
|
4433
4388
|
},
|
|
4434
4389
|
...(hasIcon && {
|
|
@@ -4452,6 +4407,12 @@ const getLinkButtonPureStyles = (icon, iconSource, active, isDisabledOrLoading,
|
|
|
4452
4407
|
};
|
|
4453
4408
|
};
|
|
4454
4409
|
|
|
4410
|
+
const getFunctionalComponentLoadingMessageStyles = () => {
|
|
4411
|
+
return {
|
|
4412
|
+
loading: getHiddenTextJssStyle(),
|
|
4413
|
+
};
|
|
4414
|
+
};
|
|
4415
|
+
|
|
4455
4416
|
const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, theme) => {
|
|
4456
4417
|
const hasIcon = hasVisibleIcon(icon, iconSource);
|
|
4457
4418
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, isDisabledOrLoading, stretch, size, hideLabel, alignLabel, false, theme), {
|
|
@@ -4466,7 +4427,7 @@ const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoa
|
|
|
4466
4427
|
...(!hasIcon &&
|
|
4467
4428
|
isLoading && {
|
|
4468
4429
|
label: {
|
|
4469
|
-
|
|
4430
|
+
opacity: 0, // use opacity for smooth transition between states and to keep accessible name available
|
|
4470
4431
|
},
|
|
4471
4432
|
icon: {
|
|
4472
4433
|
position: 'absolute',
|
|
@@ -4476,6 +4437,8 @@ const getComponentCss$10 = (icon, iconSource, active, isLoading, isDisabledOrLoa
|
|
|
4476
4437
|
height: fontLineHeight,
|
|
4477
4438
|
},
|
|
4478
4439
|
}),
|
|
4440
|
+
// .loading
|
|
4441
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
4479
4442
|
}));
|
|
4480
4443
|
};
|
|
4481
4444
|
|
|
@@ -4528,7 +4491,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4528
4491
|
'::slotted': {
|
|
4529
4492
|
'&(picture)': {
|
|
4530
4493
|
position: 'absolute',
|
|
4531
|
-
|
|
4494
|
+
inset: 0,
|
|
4532
4495
|
},
|
|
4533
4496
|
'&(img)': {
|
|
4534
4497
|
height: '100%',
|
|
@@ -4556,8 +4519,8 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4556
4519
|
},
|
|
4557
4520
|
'image-container': {
|
|
4558
4521
|
position: 'absolute',
|
|
4522
|
+
inset: 0,
|
|
4559
4523
|
transition: getTransition('transform', 'moderate'),
|
|
4560
|
-
...getInsetJssStyle(),
|
|
4561
4524
|
},
|
|
4562
4525
|
content: {
|
|
4563
4526
|
position: 'absolute',
|
|
@@ -4584,7 +4547,7 @@ background, align, compact, hasGradient, isDisabled) => {
|
|
|
4584
4547
|
return mergeDeep(getTileBaseStyles(aspectRatio, isDisabled), {
|
|
4585
4548
|
'@global': {
|
|
4586
4549
|
p: {
|
|
4587
|
-
maxWidth:
|
|
4550
|
+
maxWidth: '34.375rem', // in this case rem unit makes sense to scale up available space
|
|
4588
4551
|
margin: 0,
|
|
4589
4552
|
...textLargeStyle,
|
|
4590
4553
|
hyphens: 'inherit',
|
|
@@ -4688,7 +4651,6 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4688
4651
|
minWidth: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4689
4652
|
minHeight: '54px', // ensure space is already reserved until icon component is loaded (ssr)
|
|
4690
4653
|
boxSizing: 'border-box',
|
|
4691
|
-
outline: 0,
|
|
4692
4654
|
textAlign: 'start',
|
|
4693
4655
|
WebkitAppearance: 'none', // iOS safari
|
|
4694
4656
|
appearance: 'none',
|
|
@@ -4704,18 +4666,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4704
4666
|
padding: hideLabelValue ? '13px' : '13px 26px',
|
|
4705
4667
|
gap: hideLabelValue ? 0 : spacingStaticSmall,
|
|
4706
4668
|
})),
|
|
4707
|
-
...(!hasSlottedAnchor &&
|
|
4708
|
-
'&:focus::before': {
|
|
4709
|
-
content: '""',
|
|
4710
|
-
position: 'fixed',
|
|
4711
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
4712
|
-
borderRadius: borderRadiusMedium,
|
|
4713
|
-
...getInsetJssStyle(-6),
|
|
4714
|
-
},
|
|
4715
|
-
'&:not(:focus-visible)::before': {
|
|
4716
|
-
border: 0,
|
|
4717
|
-
},
|
|
4718
|
-
}),
|
|
4669
|
+
...(!hasSlottedAnchor && getFocusJssStyle(theme)),
|
|
4719
4670
|
...(!isDisabledOrLoading &&
|
|
4720
4671
|
hoverMediaQuery({
|
|
4721
4672
|
'&:hover': {
|
|
@@ -4814,6 +4765,8 @@ const getComponentCss$_ = (icon, iconSource, variant, hideLabel, disabled, loadi
|
|
|
4814
4765
|
opacity: 0, // use opacity for smooth transition between states
|
|
4815
4766
|
}),
|
|
4816
4767
|
},
|
|
4768
|
+
// .loading
|
|
4769
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
4817
4770
|
}));
|
|
4818
4771
|
};
|
|
4819
4772
|
|
|
@@ -4841,9 +4794,13 @@ const spacingMap = {
|
|
|
4841
4794
|
basic: gridBasicOffset,
|
|
4842
4795
|
extended: gridExtendedOffset,
|
|
4843
4796
|
};
|
|
4797
|
+
const backfaceVisibilityJssStyle = {
|
|
4798
|
+
backfaceVisibility: 'hidden',
|
|
4799
|
+
WebkitBackfaceVisibility: 'hidden',
|
|
4800
|
+
};
|
|
4844
4801
|
const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme) => {
|
|
4845
|
-
const { primaryColor, contrastMediumColor
|
|
4846
|
-
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark
|
|
4802
|
+
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
4803
|
+
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
4847
4804
|
const { canvasTextColor } = getHighContrastColors();
|
|
4848
4805
|
const isHeaderAlignCenter = alignHeader === 'center';
|
|
4849
4806
|
return getCss({
|
|
@@ -4867,15 +4824,11 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4867
4824
|
},
|
|
4868
4825
|
}),
|
|
4869
4826
|
...addImportantToEachRule({
|
|
4870
|
-
'::slotted
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4876
|
-
outlineColor: focusColorDark,
|
|
4877
|
-
}),
|
|
4878
|
-
outlineOffset: '2px',
|
|
4827
|
+
'::slotted': {
|
|
4828
|
+
'&(*)': {
|
|
4829
|
+
borderRadius: `var(--p-carousel-border-radius, ${borderRadiusLarge})`,
|
|
4830
|
+
},
|
|
4831
|
+
...getFocusJssStyle(theme, { slotted: true }),
|
|
4879
4832
|
},
|
|
4880
4833
|
// TODO: maybe it's better to style with slot[name="heading"] and slot[name="description"] instead, then styles would be part of shadow dom
|
|
4881
4834
|
// h2,::slotted([slot=heading]),p,::slotted([slot=description])
|
|
@@ -4939,7 +4892,7 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4939
4892
|
'skip-link': {
|
|
4940
4893
|
opacity: 0,
|
|
4941
4894
|
pointerEvents: 'none',
|
|
4942
|
-
'&:focus': {
|
|
4895
|
+
'&:focus-visible': {
|
|
4943
4896
|
opacity: 1,
|
|
4944
4897
|
pointerEvents: 'all',
|
|
4945
4898
|
},
|
|
@@ -4970,12 +4923,12 @@ const getComponentCss$Z = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4970
4923
|
},
|
|
4971
4924
|
},
|
|
4972
4925
|
'&__list': {
|
|
4926
|
+
...backfaceVisibilityJssStyle,
|
|
4973
4927
|
display: 'flex',
|
|
4974
|
-
...getBackfaceVisibilityJssStyle(),
|
|
4975
4928
|
},
|
|
4976
4929
|
'&__slide': {
|
|
4930
|
+
...backfaceVisibilityJssStyle,
|
|
4977
4931
|
flexShrink: 0,
|
|
4978
|
-
...getBackfaceVisibilityJssStyle(),
|
|
4979
4932
|
transform: 'translateZ(0)', // fixes mobile safari flickering, https://github.com/nolimits4web/swiper/issues/3527#issuecomment-609088939
|
|
4980
4933
|
},
|
|
4981
4934
|
'&__sr': getHiddenTextJssStyle(), // appears in the DOM when sliding
|
|
@@ -5104,8 +5057,8 @@ const getThemedFormStateColors = (theme, state) => {
|
|
|
5104
5057
|
|
|
5105
5058
|
// TODO: move to form-styles.ts
|
|
5106
5059
|
const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme) => {
|
|
5107
|
-
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor
|
|
5108
|
-
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark,
|
|
5060
|
+
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor } = getThemedColors(theme);
|
|
5061
|
+
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
5109
5062
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
5110
5063
|
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
5111
5064
|
const { canvasTextColor } = getHighContrastColors();
|
|
@@ -5130,7 +5083,6 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5130
5083
|
return {
|
|
5131
5084
|
'::slotted': {
|
|
5132
5085
|
'&(input)': {
|
|
5133
|
-
position: 'relative', // TODO: can be removed as soon as focus style was adjusted
|
|
5134
5086
|
width: fontLineHeight,
|
|
5135
5087
|
height: fontLineHeight,
|
|
5136
5088
|
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct width and height definition based on ex-unit
|
|
@@ -5142,8 +5094,8 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5142
5094
|
boxSizing: 'content-box',
|
|
5143
5095
|
background: `transparent 0% 0% / ${fontLineHeight}`,
|
|
5144
5096
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}`,
|
|
5145
|
-
border:
|
|
5146
|
-
outline: 0,
|
|
5097
|
+
border: `${borderWidthBase} solid ${uncheckedColor}`,
|
|
5098
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style (in case getFocusJssStyle() condition is not matching)
|
|
5147
5099
|
...(disabledOrLoading
|
|
5148
5100
|
? {
|
|
5149
5101
|
pointerEvents: 'none', // to prevent form element becomes clickable/toggleable
|
|
@@ -5185,21 +5137,7 @@ const getSlottedCheckboxRadioButtonStyles = (state, isDisabled, isLoading, theme
|
|
|
5185
5137
|
transition: 'unset', // Fixes chrome bug where transition properties are stuck on hover
|
|
5186
5138
|
}),
|
|
5187
5139
|
})),
|
|
5188
|
-
...(!isDisabled && {
|
|
5189
|
-
// TODO: can be done with getFocusStyle() in the meantime
|
|
5190
|
-
'&(input:focus)::before': {
|
|
5191
|
-
content: '""',
|
|
5192
|
-
position: 'absolute',
|
|
5193
|
-
...getInsetJssStyle(-6),
|
|
5194
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
5195
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5196
|
-
borderColor: focusColorDark,
|
|
5197
|
-
}),
|
|
5198
|
-
},
|
|
5199
|
-
'&(input:focus:not(:focus-visible))::before': {
|
|
5200
|
-
borderColor: 'transparent',
|
|
5201
|
-
},
|
|
5202
|
-
}),
|
|
5140
|
+
...(!isDisabled && getFocusJssStyle(theme, { slotted: 'input' })),
|
|
5203
5141
|
},
|
|
5204
5142
|
};
|
|
5205
5143
|
};
|
|
@@ -5322,11 +5260,6 @@ const getComponentCss$Y = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5322
5260
|
}),
|
|
5323
5261
|
},
|
|
5324
5262
|
}),
|
|
5325
|
-
...(!isDisabled && {
|
|
5326
|
-
'&(input:focus)::before': {
|
|
5327
|
-
borderRadius: borderRadiusMedium,
|
|
5328
|
-
},
|
|
5329
|
-
}),
|
|
5330
5263
|
},
|
|
5331
5264
|
})),
|
|
5332
5265
|
},
|
|
@@ -5367,6 +5300,8 @@ const getComponentCss$Y = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
5367
5300
|
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
5368
5301
|
gridColumn: '1/3',
|
|
5369
5302
|
}),
|
|
5303
|
+
// .loading
|
|
5304
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
5370
5305
|
});
|
|
5371
5306
|
};
|
|
5372
5307
|
|
|
@@ -5425,7 +5360,7 @@ const getComponentCss$W = () => {
|
|
|
5425
5360
|
display: 'inline-block',
|
|
5426
5361
|
verticalAlign: 'top',
|
|
5427
5362
|
...addImportantToEachRule({
|
|
5428
|
-
outline: 0,
|
|
5363
|
+
outline: 0, // TODO: is it still necessary?
|
|
5429
5364
|
boxSizing: 'content-box', // needed for correct height calculation when padding is set on host (e.g. custom click area)
|
|
5430
5365
|
...getDimensionStyle,
|
|
5431
5366
|
...colorSchemeStyles,
|
|
@@ -5436,7 +5371,14 @@ const getComponentCss$W = () => {
|
|
|
5436
5371
|
display: 'block',
|
|
5437
5372
|
textDecoration: 'none',
|
|
5438
5373
|
...getDimensionStyle,
|
|
5439
|
-
|
|
5374
|
+
'&::before': {
|
|
5375
|
+
// needs to be defined always to have correct custom click area
|
|
5376
|
+
content: '""',
|
|
5377
|
+
position: 'absolute',
|
|
5378
|
+
inset: 0,
|
|
5379
|
+
borderRadius: '1px',
|
|
5380
|
+
},
|
|
5381
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
5440
5382
|
},
|
|
5441
5383
|
picture: {
|
|
5442
5384
|
display: 'block',
|
|
@@ -5722,7 +5664,7 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5722
5664
|
},
|
|
5723
5665
|
dialog: {
|
|
5724
5666
|
position: 'fixed',
|
|
5725
|
-
|
|
5667
|
+
inset: 0,
|
|
5726
5668
|
display: 'grid', // ua-style reset
|
|
5727
5669
|
width: 'auto', // ua-style reset and to ensure transition duration works correctly
|
|
5728
5670
|
height: '100vh', // ua-style reset
|
|
@@ -5734,6 +5676,7 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5734
5676
|
visibility: 'inherit', // ua-style reset
|
|
5735
5677
|
background: 'none', // ua-style reset
|
|
5736
5678
|
overflow: 'hidden', // ua-style reset, dialog shall never become scrollable, it's handled by custom scroll areas
|
|
5679
|
+
outline: 0, // ua-style reset
|
|
5737
5680
|
...(isPrimaryScrollerVisible
|
|
5738
5681
|
? {
|
|
5739
5682
|
transform: 'translate3d(0, 0, 0)',
|
|
@@ -5753,9 +5696,6 @@ const getComponentCss$P = (isPrimaryScrollerVisible, isSecondaryScrollerVisible,
|
|
|
5753
5696
|
transform: 'translate3d(100%, 0, 0)', // use correct transitions in rtl mode
|
|
5754
5697
|
}),
|
|
5755
5698
|
},
|
|
5756
|
-
'&:focus-visible': {
|
|
5757
|
-
outline: 'none', // ua-style reset
|
|
5758
|
-
},
|
|
5759
5699
|
'&::backdrop': {
|
|
5760
5700
|
// to improve browser backwards compatibility we visually style the backdrop on the :host,
|
|
5761
5701
|
// although it's not on the #top-layer like it would be for modern browsers supporting ::backdrop
|
|
@@ -5849,8 +5789,8 @@ const getContentJssStyle = () => {
|
|
|
5849
5789
|
const frostedGlassBackgroundColorLight = 'rgba(238, 239, 242, 0.79)';
|
|
5850
5790
|
const frostedGlassBackgroundColorDark = 'rgba(33, 34, 37, 0.79)';
|
|
5851
5791
|
const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
5852
|
-
const { primaryColor, backgroundSurfaceColor,
|
|
5853
|
-
const { primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
5792
|
+
const { primaryColor, backgroundSurfaceColor, hoverColor } = getThemedColors(theme);
|
|
5793
|
+
const { primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
5854
5794
|
const frostedGlassBackgroundColor = isThemeDark(theme)
|
|
5855
5795
|
? frostedGlassBackgroundColorDark
|
|
5856
5796
|
: frostedGlassBackgroundColorLight;
|
|
@@ -5886,56 +5826,49 @@ const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
|
5886
5826
|
'::slotted(:is(h1, h2, h3, h4, h5, h6):not(:first-child))': addImportantToEachRule({
|
|
5887
5827
|
margin: `calc(${spacingFluidMedium} - ${spacingFluidXSmall}) 0 0`, // spacingFluidXSmall to compensate default gap
|
|
5888
5828
|
}),
|
|
5889
|
-
'::slotted
|
|
5890
|
-
|
|
5891
|
-
margin: 0,
|
|
5892
|
-
color: primaryColor,
|
|
5893
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5894
|
-
color: primaryColorDark,
|
|
5895
|
-
}),
|
|
5896
|
-
}),
|
|
5897
|
-
// TODO: how can we easily re-use getHoverStyle() and getFocusStyle() with ::slotted(a) selector?
|
|
5898
|
-
'::slotted(a)': {
|
|
5899
|
-
...addImportantToEachRule({
|
|
5829
|
+
'::slotted': addImportantToEachRule({
|
|
5830
|
+
'&(p)': {
|
|
5900
5831
|
...textSmallStyle,
|
|
5901
|
-
|
|
5902
|
-
display: 'block',
|
|
5903
|
-
textDecoration: 'none',
|
|
5904
|
-
cursor: 'pointer',
|
|
5832
|
+
margin: 0,
|
|
5905
5833
|
color: primaryColor,
|
|
5906
|
-
borderRadius: borderRadiusSmall,
|
|
5907
|
-
marginLeft: `-${spacingStaticXSmall}`,
|
|
5908
|
-
marginRight: `-${spacingStaticXSmall}`,
|
|
5909
|
-
padding: `2px ${spacingStaticXSmall}`,
|
|
5910
|
-
transition: `background var(${cssVariableTransitionDuration}, ${motionDurationShort}) ${motionEasingBase}`,
|
|
5911
5834
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5912
5835
|
color: primaryColorDark,
|
|
5913
5836
|
}),
|
|
5914
|
-
}
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5837
|
+
},
|
|
5838
|
+
'&(a)': {
|
|
5839
|
+
...{
|
|
5840
|
+
...textSmallStyle,
|
|
5841
|
+
alignSelf: 'flex-start',
|
|
5842
|
+
display: 'block',
|
|
5843
|
+
textDecoration: 'none',
|
|
5844
|
+
cursor: 'pointer',
|
|
5845
|
+
color: primaryColor,
|
|
5846
|
+
borderRadius: borderRadiusSmall,
|
|
5847
|
+
marginLeft: `-${spacingStaticXSmall}`,
|
|
5848
|
+
marginRight: `-${spacingStaticXSmall}`,
|
|
5849
|
+
padding: `2px ${spacingStaticXSmall}`,
|
|
5850
|
+
transition: `background var(${cssVariableTransitionDuration}, ${motionDurationShort}) ${motionEasingBase}`,
|
|
5851
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5852
|
+
color: primaryColorDark,
|
|
5853
|
+
}),
|
|
5854
|
+
},
|
|
5855
|
+
},
|
|
5856
|
+
'&(a[aria-current])': {
|
|
5918
5857
|
background: hoverColor,
|
|
5919
5858
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5920
5859
|
background: hoverColorDark,
|
|
5921
5860
|
}),
|
|
5861
|
+
},
|
|
5862
|
+
...hoverMediaQuery({
|
|
5863
|
+
// TODO: how can we easily re-use getHoverStyle() with ::slotted(a) selector?
|
|
5864
|
+
'&(a:hover)': {
|
|
5865
|
+
background: hoverColor,
|
|
5866
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5867
|
+
background: hoverColorDark,
|
|
5868
|
+
}),
|
|
5869
|
+
},
|
|
5922
5870
|
}),
|
|
5923
|
-
|
|
5924
|
-
'::slotted(a[aria-current])': addImportantToEachRule({
|
|
5925
|
-
background: hoverColor,
|
|
5926
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5927
|
-
background: hoverColorDark,
|
|
5928
|
-
}),
|
|
5929
|
-
}),
|
|
5930
|
-
'::slotted(a:focus)': addImportantToEachRule({
|
|
5931
|
-
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
5932
|
-
outlineOffset: '-2px',
|
|
5933
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5934
|
-
outlineColor: focusColorDark,
|
|
5935
|
-
}),
|
|
5936
|
-
}),
|
|
5937
|
-
'::slotted(a:focus:not(:focus-visible))': addImportantToEachRule({
|
|
5938
|
-
outlineColor: 'transparent',
|
|
5871
|
+
...getFocusJssStyle(theme, { slotted: 'a', offset: '-2px' }),
|
|
5939
5872
|
}),
|
|
5940
5873
|
},
|
|
5941
5874
|
button: {
|
|
@@ -5945,7 +5878,7 @@ const getComponentCss$O = (isSecondaryScrollerVisible, theme) => {
|
|
|
5945
5878
|
},
|
|
5946
5879
|
scroller: {
|
|
5947
5880
|
position: 'fixed',
|
|
5948
|
-
|
|
5881
|
+
inset: 0,
|
|
5949
5882
|
// "cssVariableTransitionDuration" ensures closing animation of secondary scroller is given when whole flyout-navigation gets closed
|
|
5950
5883
|
// "cssVariableVisibility" ensures secondary scroller is not tabbable when whole flyout-navigation is closed
|
|
5951
5884
|
...(isSecondaryScrollerVisible
|
|
@@ -6048,7 +5981,6 @@ const getComponentCss$N = (isOpen, position, hasFooter, hasSubFooter, theme) =>
|
|
|
6048
5981
|
'--pds-internal-grid-outer-column': `calc(${spacingFluidLarge} - ${gridGap})`,
|
|
6049
5982
|
'--pds-internal-grid-margin': `calc(${spacingFluidLarge} * -1)`,
|
|
6050
5983
|
justifyContent: isPositionStart ? 'flex-start' : 'flex-end',
|
|
6051
|
-
...getInsetJssStyle(),
|
|
6052
5984
|
...getBackdropJssStyle(isOpen, FLYOUT_Z_INDEX, theme),
|
|
6053
5985
|
...colorSchemeStyles,
|
|
6054
5986
|
...hostHiddenStyles,
|
|
@@ -6520,8 +6452,6 @@ const getComponentCss$H = (state, hasAction, hasClose, theme) => {
|
|
|
6520
6452
|
};
|
|
6521
6453
|
|
|
6522
6454
|
const getComponentCss$G = (icon, iconSource, active, stretch, size, hideLabel, alignLabel, underline, hasSlottedAnchor, theme) => {
|
|
6523
|
-
const { focusColor } = getThemedColors(theme);
|
|
6524
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
6525
6455
|
return getCss(mergeDeep(getLinkButtonPureStyles(icon, iconSource, active, false, stretch, size, hideLabel, alignLabel, hasSlottedAnchor, theme), {
|
|
6526
6456
|
root: {
|
|
6527
6457
|
textDecoration: underline ? 'underline' : 'none',
|
|
@@ -6541,31 +6471,19 @@ const getComponentCss$G = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
6541
6471
|
'&(a)::before': {
|
|
6542
6472
|
content: '""',
|
|
6543
6473
|
position: 'fixed',
|
|
6544
|
-
|
|
6545
|
-
bottom: offsetVertical,
|
|
6474
|
+
insetBlock: offsetVertical,
|
|
6546
6475
|
borderRadius: borderRadiusSmall,
|
|
6547
6476
|
...buildResponsiveStyles(hideLabel, (hideLabelValue) => ({
|
|
6548
|
-
|
|
6549
|
-
left: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6477
|
+
insetInline: hideLabelValue ? offsetVertical : offsetHorizontal,
|
|
6550
6478
|
})),
|
|
6551
6479
|
},
|
|
6552
|
-
|
|
6553
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
6554
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6555
|
-
borderColor: focusColorDark,
|
|
6556
|
-
}),
|
|
6557
|
-
},
|
|
6558
|
-
'&(a:focus:not(:focus-visible))::before': {
|
|
6559
|
-
border: 0,
|
|
6560
|
-
},
|
|
6480
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true, offset: '-2px' }),
|
|
6561
6481
|
},
|
|
6562
6482
|
}),
|
|
6563
6483
|
}));
|
|
6564
6484
|
};
|
|
6565
6485
|
|
|
6566
6486
|
const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
6567
|
-
const { focusColor } = getThemedColors(theme);
|
|
6568
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
6569
6487
|
const { linkColor } = getHighContrastColors();
|
|
6570
6488
|
const isPrimary = variant === 'primary';
|
|
6571
6489
|
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), {
|
|
@@ -6598,22 +6516,10 @@ const getComponentCss$F = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
6598
6516
|
'&(a)::before': {
|
|
6599
6517
|
content: '""',
|
|
6600
6518
|
position: 'fixed',
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
},
|
|
6604
|
-
// TODO: combine link-social-styles with link-button-styles and tabs-bar-styles
|
|
6605
|
-
'&(a::-moz-focus-inner)': {
|
|
6606
|
-
border: 0,
|
|
6607
|
-
},
|
|
6608
|
-
'&(a:focus)::before': {
|
|
6609
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
6610
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6611
|
-
borderColor: focusColorDark,
|
|
6612
|
-
}),
|
|
6613
|
-
},
|
|
6614
|
-
'&(a:focus:not(:focus-visible))::before': {
|
|
6615
|
-
border: 0,
|
|
6519
|
+
inset: '-2px',
|
|
6520
|
+
borderRadius: borderRadiusSmall,
|
|
6616
6521
|
},
|
|
6522
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
6617
6523
|
},
|
|
6618
6524
|
}),
|
|
6619
6525
|
}));
|
|
@@ -6669,7 +6575,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6669
6575
|
'link-overlay': {
|
|
6670
6576
|
// covers entire tile, used for expanded click-area only
|
|
6671
6577
|
position: 'fixed',
|
|
6672
|
-
|
|
6578
|
+
inset: 0,
|
|
6673
6579
|
},
|
|
6674
6580
|
});
|
|
6675
6581
|
};
|
|
@@ -6677,7 +6583,7 @@ const getComponentCss$E = (aspectRatio, weight, direction, hasDescription) => {
|
|
|
6677
6583
|
const slottedAnchorSelector = `a[slot='${anchorSlot}']`;
|
|
6678
6584
|
const anchorJssStyle = {
|
|
6679
6585
|
position: 'absolute',
|
|
6680
|
-
|
|
6586
|
+
inset: 0,
|
|
6681
6587
|
zIndex: 1, // necessary to be on top of img
|
|
6682
6588
|
borderRadius: borderRadiusMedium,
|
|
6683
6589
|
};
|
|
@@ -6690,8 +6596,8 @@ const getMultilineEllipsis = (lineClamp) => {
|
|
|
6690
6596
|
};
|
|
6691
6597
|
};
|
|
6692
6598
|
const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme) => {
|
|
6693
|
-
const { primaryColor, contrastHighColor, backgroundSurfaceColor
|
|
6694
|
-
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
6599
|
+
const { primaryColor, contrastHighColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
6600
|
+
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
6695
6601
|
return getCss({
|
|
6696
6602
|
'@global': {
|
|
6697
6603
|
':host': {
|
|
@@ -6712,17 +6618,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6712
6618
|
...anchorJssStyle,
|
|
6713
6619
|
textIndent: '-999999px', // hide anchor label visually but still usable for a11y (only works in RTL-mode because of `overflow: hidden;` parent)
|
|
6714
6620
|
},
|
|
6715
|
-
|
|
6716
|
-
[`&(${slottedAnchorSelector}:focus)`]: {
|
|
6717
|
-
outline: `${borderWidthBase} solid ${focusColor}`,
|
|
6718
|
-
outlineOffset: '2px',
|
|
6719
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6720
|
-
outlineColor: focusColorDark,
|
|
6721
|
-
}),
|
|
6722
|
-
},
|
|
6723
|
-
[`&(${slottedAnchorSelector}:focus:not(:focus-visible))`]: {
|
|
6724
|
-
outlineColor: 'transparent',
|
|
6725
|
-
},
|
|
6621
|
+
...getFocusJssStyle(theme, { slotted: slottedAnchorSelector }),
|
|
6726
6622
|
}),
|
|
6727
6623
|
[`&([slot="${headerSlot}"])`]: {
|
|
6728
6624
|
display: 'flex',
|
|
@@ -6761,7 +6657,7 @@ const getComponentCss$D = (hasLikeButton, hasSlottedAnchor, aspectRatio, theme)
|
|
|
6761
6657
|
...(!hasSlottedAnchor && {
|
|
6762
6658
|
anchor: {
|
|
6763
6659
|
...anchorJssStyle,
|
|
6764
|
-
...
|
|
6660
|
+
...getFocusJssStyle(theme),
|
|
6765
6661
|
},
|
|
6766
6662
|
}),
|
|
6767
6663
|
header: {
|
|
@@ -6825,7 +6721,7 @@ const getComponentCss$C = (...args) => {
|
|
|
6825
6721
|
'link-overlay': {
|
|
6826
6722
|
// covers entire tile, used for expanded click-area only
|
|
6827
6723
|
position: 'fixed',
|
|
6828
|
-
|
|
6724
|
+
inset: 0,
|
|
6829
6725
|
},
|
|
6830
6726
|
});
|
|
6831
6727
|
};
|
|
@@ -6856,7 +6752,15 @@ const getComponentCss$B = (size) => {
|
|
|
6856
6752
|
a: {
|
|
6857
6753
|
display: 'block',
|
|
6858
6754
|
textDecoration: 'none',
|
|
6859
|
-
|
|
6755
|
+
outline: 0,
|
|
6756
|
+
'&::before': {
|
|
6757
|
+
// needs to be defined always to have correct custom click area
|
|
6758
|
+
content: '""',
|
|
6759
|
+
position: 'absolute',
|
|
6760
|
+
inset: 0,
|
|
6761
|
+
borderRadius: '1px',
|
|
6762
|
+
},
|
|
6763
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
6860
6764
|
},
|
|
6861
6765
|
picture: {
|
|
6862
6766
|
display: 'block',
|
|
@@ -6919,7 +6823,7 @@ const getSlottedJssStyle = (marginValue, hasHeader, hasDismissButton) => {
|
|
|
6919
6823
|
},
|
|
6920
6824
|
...(!hasHeader && {
|
|
6921
6825
|
[`&(.${stretchToFullModalWidthClassName}:first-child)`]: {
|
|
6922
|
-
marginTop: hasDismissButton ?
|
|
6826
|
+
marginTop: hasDismissButton ? `${-marginValue / 16}rem` : marginPx,
|
|
6923
6827
|
},
|
|
6924
6828
|
}),
|
|
6925
6829
|
[`&(.${stretchToFullModalWidthClassName}:last-child)`]: {
|
|
@@ -6965,7 +6869,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6965
6869
|
},
|
|
6966
6870
|
'scroll-container': {
|
|
6967
6871
|
display: 'flex',
|
|
6968
|
-
|
|
6872
|
+
inset: 0, // TODO: is this still needed?
|
|
6969
6873
|
height: '100%',
|
|
6970
6874
|
overflowY: 'inherit',
|
|
6971
6875
|
alignItems: 'center',
|
|
@@ -6979,10 +6883,12 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6979
6883
|
transform: isOpen ? 'translateY(0%)' : 'translateY(25%)',
|
|
6980
6884
|
opacity: isOpen ? 1 : 0,
|
|
6981
6885
|
transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
|
|
6982
|
-
paddingTop: hasDismissButton ?
|
|
6886
|
+
paddingTop: hasDismissButton ? '2rem' : contentPadding, // rem value needed to prevent overlapping of close button and contents in scaling mode
|
|
6983
6887
|
...(!hasFooter && { paddingBottom: contentPadding }),
|
|
6984
6888
|
background: backgroundColor,
|
|
6985
6889
|
outline: isHighContrastMode ? '1px solid transparent' : 0,
|
|
6890
|
+
// TODO: getFocusJssStyle() can't be re-used atm, but as soon as component is refactored to `<dialog />` then no
|
|
6891
|
+
// focus should be necessary at all because focus is auto forwarded to dismiss button.
|
|
6986
6892
|
// ::after to be above sticky footer without z-index games
|
|
6987
6893
|
'&:focus::after': {
|
|
6988
6894
|
content: '""',
|
|
@@ -6992,7 +6898,7 @@ const getComponentCss$A = (isOpen, isFullscreen, hasDismissButton, hasHeader, ha
|
|
|
6992
6898
|
...buildResponsiveStyles(isFullscreen, (fullscreenValue) => ({
|
|
6993
6899
|
borderRadius: fullscreenValue ? 0 : '12px',
|
|
6994
6900
|
borderColor: fullscreenValue ? primaryColor : darkThemePrimaryColor,
|
|
6995
|
-
|
|
6901
|
+
inset: fullscreenValue ? 0 : '-4px',
|
|
6996
6902
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6997
6903
|
borderColor: darkThemePrimaryColor,
|
|
6998
6904
|
}),
|
|
@@ -7260,6 +7166,7 @@ const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme,
|
|
|
7260
7166
|
}),
|
|
7261
7167
|
},
|
|
7262
7168
|
})),
|
|
7169
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7263
7170
|
[`::slotted(${child}:focus)`]: {
|
|
7264
7171
|
borderColor: primaryColor,
|
|
7265
7172
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7438,6 +7345,7 @@ const getInputStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
|
7438
7345
|
},
|
|
7439
7346
|
}),
|
|
7440
7347
|
...(!isDisabled && {
|
|
7348
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
7441
7349
|
'&:focus': {
|
|
7442
7350
|
borderColor: primaryColor,
|
|
7443
7351
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -7525,8 +7433,8 @@ const disabledCursorStyle = {
|
|
|
7525
7433
|
};
|
|
7526
7434
|
const hiddenStyle = { display: 'none' };
|
|
7527
7435
|
const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
7528
|
-
const { primaryColor, disabledColor, hoverColor
|
|
7529
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark,
|
|
7436
|
+
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
7437
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
7530
7438
|
return getCss({
|
|
7531
7439
|
'@global': {
|
|
7532
7440
|
':host': {
|
|
@@ -7604,9 +7512,9 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7604
7512
|
whiteSpace: 'nowrap',
|
|
7605
7513
|
cursor: 'pointer',
|
|
7606
7514
|
color: primaryColor,
|
|
7607
|
-
outline: 0,
|
|
7608
7515
|
borderRadius: borderRadiusSmall,
|
|
7609
7516
|
borderColor: 'transparent', // default value is needed for smooth transition
|
|
7517
|
+
outline: 0, // TODO: only relevant for VRT testing with forced states - prevents :focus style
|
|
7610
7518
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7611
7519
|
color: primaryColorDark,
|
|
7612
7520
|
}),
|
|
@@ -7619,16 +7527,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7619
7527
|
}),
|
|
7620
7528
|
},
|
|
7621
7529
|
}),
|
|
7622
|
-
'&:not(.ellipsis):focus:focus-visible::before': {
|
|
7623
|
-
content: '""',
|
|
7624
|
-
position: 'absolute',
|
|
7625
|
-
...getInsetJssStyle(-4),
|
|
7626
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
7627
|
-
borderRadius: borderRadiusMedium,
|
|
7628
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7629
|
-
borderColor: focusColorDark,
|
|
7630
|
-
}),
|
|
7631
|
-
},
|
|
7632
7530
|
'&[aria-current]': {
|
|
7633
7531
|
...disabledCursorStyle,
|
|
7634
7532
|
color: primaryColor,
|
|
@@ -7637,7 +7535,6 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7637
7535
|
color: primaryColorDark,
|
|
7638
7536
|
borderColor: primaryColorDark,
|
|
7639
7537
|
}),
|
|
7640
|
-
'&:not(.ellipsis):focus::before': getInsetJssStyle(-6), // adjust for missing 2px border
|
|
7641
7538
|
},
|
|
7642
7539
|
'&[aria-disabled]': {
|
|
7643
7540
|
...disabledCursorStyle,
|
|
@@ -7646,6 +7543,8 @@ const getComponentCss$w = (activePage, pageTotal, showLastPage, theme) => {
|
|
|
7646
7543
|
color: disabledColorDark,
|
|
7647
7544
|
}),
|
|
7648
7545
|
},
|
|
7546
|
+
// TODO :not(.ellipsis) is only needed for VRT states tests to work properly
|
|
7547
|
+
'&:not(.ellipsis)': getFocusJssStyle(theme),
|
|
7649
7548
|
},
|
|
7650
7549
|
},
|
|
7651
7550
|
ellipsis: {
|
|
@@ -7745,6 +7644,8 @@ const getComponentCss$v = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
7745
7644
|
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
7746
7645
|
// .message
|
|
7747
7646
|
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
7647
|
+
// .loading
|
|
7648
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
7748
7649
|
});
|
|
7749
7650
|
};
|
|
7750
7651
|
|
|
@@ -7848,8 +7749,8 @@ const getDirectionArrowMap = (theme) => {
|
|
|
7848
7749
|
};
|
|
7849
7750
|
};
|
|
7850
7751
|
const getComponentCss$u = (direction, isNative, theme) => {
|
|
7851
|
-
const { hoverColor,
|
|
7852
|
-
const { hoverColor: hoverColorDark,
|
|
7752
|
+
const { hoverColor, backgroundColor, primaryColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
7753
|
+
const { hoverColor: hoverColorDark, primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
7853
7754
|
const shadowColor = 'rgba(0,0,0,0.3)';
|
|
7854
7755
|
return getCss({
|
|
7855
7756
|
'@global': {
|
|
@@ -7868,18 +7769,17 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7868
7769
|
},
|
|
7869
7770
|
button: {
|
|
7870
7771
|
display: 'block',
|
|
7871
|
-
position: 'relative',
|
|
7872
7772
|
WebkitAppearance: 'none', // iOS safari
|
|
7873
7773
|
appearance: 'none',
|
|
7874
7774
|
background: 'transparent',
|
|
7875
7775
|
border: 0,
|
|
7876
7776
|
padding: 0,
|
|
7877
|
-
outline: 0,
|
|
7878
7777
|
cursor: 'pointer',
|
|
7879
7778
|
...textSmallStyle,
|
|
7880
7779
|
width: fontLineHeight, // width needed to improve ssr support
|
|
7881
7780
|
height: fontLineHeight, // height needed to improve ssr support
|
|
7882
7781
|
borderRadius: '50%',
|
|
7782
|
+
// TODO: we should try to use getHoverStyle()
|
|
7883
7783
|
...hoverMediaQuery({
|
|
7884
7784
|
transition: getTransition('background-color'),
|
|
7885
7785
|
'&:hover': {
|
|
@@ -7890,22 +7790,7 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7890
7790
|
}),
|
|
7891
7791
|
},
|
|
7892
7792
|
}),
|
|
7893
|
-
|
|
7894
|
-
content: '""',
|
|
7895
|
-
position: 'absolute',
|
|
7896
|
-
...getInsetJssStyle(-2),
|
|
7897
|
-
border: `${borderWidthBase} solid transparent`,
|
|
7898
|
-
borderRadius: '50%',
|
|
7899
|
-
},
|
|
7900
|
-
'&:focus::before': {
|
|
7901
|
-
borderColor: focusColor,
|
|
7902
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
7903
|
-
borderColor: focusColorDark,
|
|
7904
|
-
}),
|
|
7905
|
-
},
|
|
7906
|
-
'&:focus:not(:focus-visible)::before': {
|
|
7907
|
-
borderColor: 'transparent',
|
|
7908
|
-
},
|
|
7793
|
+
...getFocusJssStyle(theme, { offset: 0 }),
|
|
7909
7794
|
},
|
|
7910
7795
|
},
|
|
7911
7796
|
label: getHiddenTextJssStyle(),
|
|
@@ -7921,7 +7806,9 @@ const getComponentCss$u = (direction, isNative, theme) => {
|
|
|
7921
7806
|
margin: 0,
|
|
7922
7807
|
padding: 0,
|
|
7923
7808
|
}
|
|
7924
|
-
:
|
|
7809
|
+
: {
|
|
7810
|
+
inset: `${-safeZonePx}px`,
|
|
7811
|
+
}),
|
|
7925
7812
|
position: 'absolute',
|
|
7926
7813
|
zIndex: POPOVER_Z_INDEX,
|
|
7927
7814
|
filter: `drop-shadow(0 0 16px ${shadowColor})`,
|
|
@@ -8007,11 +7894,6 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8007
7894
|
}),
|
|
8008
7895
|
},
|
|
8009
7896
|
}),
|
|
8010
|
-
...(!isDisabled && {
|
|
8011
|
-
'&(input:focus)::before': {
|
|
8012
|
-
borderRadius: '50%',
|
|
8013
|
-
},
|
|
8014
|
-
}),
|
|
8015
7897
|
},
|
|
8016
7898
|
})),
|
|
8017
7899
|
},
|
|
@@ -8052,6 +7934,8 @@ const getComponentCss$t = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
|
8052
7934
|
...getFunctionalComponentStateMessageStyles(theme, state, {
|
|
8053
7935
|
gridColumn: '1/3',
|
|
8054
7936
|
}),
|
|
7937
|
+
// .loading
|
|
7938
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
8055
7939
|
});
|
|
8056
7940
|
};
|
|
8057
7941
|
|
|
@@ -8077,8 +7961,8 @@ const getGradient = (theme, gradientColorTheme) => {
|
|
|
8077
7961
|
};
|
|
8078
7962
|
const prevNextWrapperWidth = `calc(${fontLineHeight} + 24px)`;
|
|
8079
7963
|
const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndicatorPosition, hasScrollbar, theme) => {
|
|
8080
|
-
const { backgroundColor, backgroundSurfaceColor,
|
|
8081
|
-
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark,
|
|
7964
|
+
const { backgroundColor, backgroundSurfaceColor, hoverColor } = getThemedColors(theme);
|
|
7965
|
+
const { backgroundColor: backgroundColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
8082
7966
|
const backgroundColorLight = {
|
|
8083
7967
|
'background-base': backgroundColor,
|
|
8084
7968
|
'background-surface': backgroundSurfaceColor,
|
|
@@ -8171,24 +8055,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8171
8055
|
minHeight: '28px',
|
|
8172
8056
|
minWidth: '100%',
|
|
8173
8057
|
verticalAlign: 'top',
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
content: '""',
|
|
8177
|
-
position: 'absolute',
|
|
8178
|
-
...getInsetJssStyle(-4),
|
|
8179
|
-
border: `${borderWidthBase} solid transparent`,
|
|
8180
|
-
borderRadius: borderRadiusSmall,
|
|
8181
|
-
pointerEvents: 'none', // Needed to enable clicks inside of slot
|
|
8182
|
-
},
|
|
8183
|
-
'&:focus::before': {
|
|
8184
|
-
borderColor: focusColor,
|
|
8185
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8186
|
-
borderColor: focusColorDark,
|
|
8187
|
-
}),
|
|
8188
|
-
},
|
|
8189
|
-
'&:focus:not(:focus-visible)::before': {
|
|
8190
|
-
borderColor: 'transparent',
|
|
8191
|
-
},
|
|
8058
|
+
borderRadius: borderRadiusSmall,
|
|
8059
|
+
...getFocusJssStyle(theme),
|
|
8192
8060
|
},
|
|
8193
8061
|
trigger: {
|
|
8194
8062
|
position: 'absolute',
|
|
@@ -8246,8 +8114,8 @@ const getComponentCss$s = (gradientColor, isNextHidden, isPrevHidden, scrollIndi
|
|
|
8246
8114
|
};
|
|
8247
8115
|
|
|
8248
8116
|
const ITEM_PADDING = '17px';
|
|
8249
|
-
const ICON_SIZE =
|
|
8250
|
-
const ICON_MARGIN =
|
|
8117
|
+
const ICON_SIZE = '1.5rem';
|
|
8118
|
+
const ICON_MARGIN = '.25rem';
|
|
8251
8119
|
const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
8252
8120
|
const { primaryColor, contrastMediumColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
8253
8121
|
const { highlightColor } = getHighContrastColors();
|
|
@@ -8260,8 +8128,6 @@ const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
|
8260
8128
|
};
|
|
8261
8129
|
const getItemPadding = (hasIconAndSlottedContent) => hasIconAndSlottedContent ? `13px ${ITEM_PADDING} 13px 13px` : `13px ${ITEM_PADDING}`;
|
|
8262
8130
|
const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, theme) => {
|
|
8263
|
-
const { focusColor } = getThemedColors(theme);
|
|
8264
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
8265
8131
|
const { buttonColor, labelColor, borderColor, hoverBorderColor } = getColors$2(isDisabled, isSelected, theme);
|
|
8266
8132
|
const { buttonColor: buttonColorDark, labelColor: labelColorDark, borderColor: borderColorDark, hoverBorderColor: hoverBorderColorDark, } = getColors$2(isDisabled, isSelected, 'dark');
|
|
8267
8133
|
return getCss({
|
|
@@ -8283,30 +8149,9 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8283
8149
|
margin: 0, // Removes default button margin on safari 15
|
|
8284
8150
|
border: `${borderWidthBase} solid ${borderColor}`,
|
|
8285
8151
|
borderRadius: borderRadiusSmall,
|
|
8286
|
-
outline: 0,
|
|
8287
8152
|
background: 'transparent',
|
|
8288
8153
|
color: buttonColor,
|
|
8289
8154
|
...textSmallStyle,
|
|
8290
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8291
|
-
borderColor: borderColorDark,
|
|
8292
|
-
color: buttonColorDark,
|
|
8293
|
-
}),
|
|
8294
|
-
'&::before': {
|
|
8295
|
-
content: '""',
|
|
8296
|
-
position: 'absolute',
|
|
8297
|
-
...getInsetJssStyle(-5),
|
|
8298
|
-
border: `${borderWidthBase} solid transparent`,
|
|
8299
|
-
borderRadius: '7px',
|
|
8300
|
-
},
|
|
8301
|
-
'&:focus::before': {
|
|
8302
|
-
borderColor: focusColor,
|
|
8303
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8304
|
-
borderColor: focusColorDark,
|
|
8305
|
-
}),
|
|
8306
|
-
},
|
|
8307
|
-
'&:focus:not(:focus-visible)::before': {
|
|
8308
|
-
borderColor: 'transparent',
|
|
8309
|
-
},
|
|
8310
8155
|
...(isDisabled
|
|
8311
8156
|
? {
|
|
8312
8157
|
cursor: 'not-allowed',
|
|
@@ -8324,6 +8169,11 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
8324
8169
|
},
|
|
8325
8170
|
})),
|
|
8326
8171
|
}),
|
|
8172
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8173
|
+
borderColor: borderColorDark,
|
|
8174
|
+
color: buttonColorDark,
|
|
8175
|
+
}),
|
|
8176
|
+
...getFocusJssStyle(theme),
|
|
8327
8177
|
},
|
|
8328
8178
|
// label
|
|
8329
8179
|
span: {
|
|
@@ -8382,7 +8232,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8382
8232
|
// TODO: extract generic default button/anchor reset style
|
|
8383
8233
|
button: {
|
|
8384
8234
|
position: 'absolute',
|
|
8385
|
-
|
|
8235
|
+
inset: 0,
|
|
8386
8236
|
width: '100%', // fixes Firefox positioning issue
|
|
8387
8237
|
height: '100%', // fixes Firefox positioning issue
|
|
8388
8238
|
margin: 0,
|
|
@@ -8396,6 +8246,7 @@ const getButtonStyles = (direction, isOpen, state, theme) => {
|
|
|
8396
8246
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8397
8247
|
borderColor: isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark,
|
|
8398
8248
|
}),
|
|
8249
|
+
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
8399
8250
|
'&:focus, &:focus ~ ul': {
|
|
8400
8251
|
borderColor: primaryColor,
|
|
8401
8252
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
@@ -8444,7 +8295,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8444
8295
|
input: {
|
|
8445
8296
|
display: 'block',
|
|
8446
8297
|
position: 'absolute',
|
|
8447
|
-
|
|
8298
|
+
inset: borderWidthBase,
|
|
8448
8299
|
width: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8449
8300
|
height: 'calc(100% - 4px)', // fixes Firefox positioning issue, 4px = 2 x borderWidthBase
|
|
8450
8301
|
zIndex: 1,
|
|
@@ -8513,7 +8364,7 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
8513
8364
|
'&+span': {
|
|
8514
8365
|
// for focus outline and clicking arrow since input ends left of the icon
|
|
8515
8366
|
position: 'absolute',
|
|
8516
|
-
|
|
8367
|
+
inset: 0,
|
|
8517
8368
|
transition: getTransition('border-color'),
|
|
8518
8369
|
pointerEvents: 'all',
|
|
8519
8370
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
@@ -8842,8 +8693,8 @@ const getSVGPath = (stepCount, numberedCircleColors, isStateCurrent) => {
|
|
|
8842
8693
|
return svgNumberedCirclePaths[stepCount];
|
|
8843
8694
|
};
|
|
8844
8695
|
const getComponentCss$m = (state, disabled, theme) => {
|
|
8845
|
-
const { primaryColor, hoverColor, disabledColor
|
|
8846
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark,
|
|
8696
|
+
const { primaryColor, hoverColor, disabledColor } = getThemedColors(theme);
|
|
8697
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
8847
8698
|
const isStateCurrent = state === 'current';
|
|
8848
8699
|
const isStateCurrentOrUndefined = !state || isStateCurrent;
|
|
8849
8700
|
const isDisabled = !state || disabled;
|
|
@@ -8885,7 +8736,6 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8885
8736
|
margin: 0, // Removes default button margin on safari 15
|
|
8886
8737
|
background: 0,
|
|
8887
8738
|
border: 0,
|
|
8888
|
-
outline: 0,
|
|
8889
8739
|
...textSmallStyle,
|
|
8890
8740
|
fontSize: 'inherit',
|
|
8891
8741
|
width: 'max-content',
|
|
@@ -8921,19 +8771,7 @@ const getComponentCss$m = (state, disabled, theme) => {
|
|
|
8921
8771
|
width: fontLineHeight,
|
|
8922
8772
|
},
|
|
8923
8773
|
}),
|
|
8924
|
-
'
|
|
8925
|
-
content: '""',
|
|
8926
|
-
position: 'absolute',
|
|
8927
|
-
...getInsetJssStyle(),
|
|
8928
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
8929
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8930
|
-
borderColor: focusColorDark,
|
|
8931
|
-
}),
|
|
8932
|
-
borderRadius: borderRadiusSmall,
|
|
8933
|
-
},
|
|
8934
|
-
'&:focus:not(:focus-visible)::after': {
|
|
8935
|
-
borderColor: 'transparent',
|
|
8936
|
-
},
|
|
8774
|
+
...getFocusJssStyle(theme, { offset: '-2px' }),
|
|
8937
8775
|
},
|
|
8938
8776
|
},
|
|
8939
8777
|
...(!isStateCurrentOrUndefined && {
|
|
@@ -8996,128 +8834,105 @@ const getColors$1 = (checked, disabled, loading, theme) => {
|
|
|
8996
8834
|
const getComponentCss$k = (alignLabel, hideLabel, stretch, checked, disabled, loading, theme) => {
|
|
8997
8835
|
const { buttonBorderColor, buttonBorderColorHover, buttonBackgroundColor, buttonBackgroundColorHover, toggleBackgroundColor, toggleBackgroundColorHover, textColor, } = getColors$1(checked, disabled, loading, theme);
|
|
8998
8836
|
const { buttonBorderColor: buttonBorderColorDark, buttonBorderColorHover: buttonBorderColorHoverDark, buttonBackgroundColor: buttonBackgroundColorDark, buttonBackgroundColorHover: buttonBackgroundColorHoverDark, toggleBackgroundColor: toggleBackgroundColorDark, toggleBackgroundColorHover: toggleBackgroundColorHoverDark, textColor: textColorDark, } = getColors$1(checked, disabled, loading, 'dark');
|
|
8999
|
-
const { focusColor } = getThemedColors(theme);
|
|
9000
|
-
const { focusColor: focusColorDark } = getThemedColors('dark');
|
|
9001
8837
|
return getCss({
|
|
9002
8838
|
'@global': {
|
|
9003
8839
|
':host': {
|
|
9004
8840
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
9005
|
-
display: stretchValue ? '
|
|
8841
|
+
display: stretchValue ? 'flex' : 'inline-flex',
|
|
9006
8842
|
})),
|
|
9007
8843
|
...addImportantToEachRule({
|
|
9008
8844
|
outline: 0, // custom element is able to delegate the focus
|
|
8845
|
+
gap: spacingStaticSmall,
|
|
9009
8846
|
...colorSchemeStyles,
|
|
9010
8847
|
...hostHiddenStyles,
|
|
9011
8848
|
...buildResponsiveStyles(stretch, (stretchValue) => ({
|
|
8849
|
+
justifyContent: stretchValue ? 'space-between' : 'flex-start',
|
|
9012
8850
|
width: stretchValue ? '100%' : 'auto', // prevents adjusting its size when used as flex or grid child
|
|
9013
8851
|
...(!stretchValue && { verticalAlign: 'top' }),
|
|
9014
8852
|
})),
|
|
9015
8853
|
}),
|
|
9016
8854
|
},
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
backgroundColor: buttonBackgroundColorHoverDark,
|
|
9043
|
-
}),
|
|
9044
|
-
'& .toggle': {
|
|
9045
|
-
backgroundColor: toggleBackgroundColorHover,
|
|
8855
|
+
button: {
|
|
8856
|
+
display: 'flex',
|
|
8857
|
+
alignItems: 'center',
|
|
8858
|
+
flexShrink: 0,
|
|
8859
|
+
width: '48px',
|
|
8860
|
+
height: '28px',
|
|
8861
|
+
boxSizing: 'border-box',
|
|
8862
|
+
border: `${borderWidthBase} solid ${buttonBorderColor}`,
|
|
8863
|
+
borderRadius: '14px',
|
|
8864
|
+
backgroundColor: buttonBackgroundColor,
|
|
8865
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8866
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
8867
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8868
|
+
borderColor: buttonBorderColorDark,
|
|
8869
|
+
backgroundColor: buttonBackgroundColorDark,
|
|
8870
|
+
}),
|
|
8871
|
+
margin: 0, // Removes default button margin on safari 15
|
|
8872
|
+
padding: 0,
|
|
8873
|
+
WebkitAppearance: 'none', // iOS safari
|
|
8874
|
+
appearance: 'none',
|
|
8875
|
+
...(!isDisabledOrLoading(disabled, loading) &&
|
|
8876
|
+
hoverMediaQuery({
|
|
8877
|
+
'&:hover': {
|
|
8878
|
+
borderColor: buttonBorderColorHover,
|
|
8879
|
+
backgroundColor: buttonBackgroundColorHover,
|
|
9046
8880
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9047
|
-
|
|
8881
|
+
borderColor: buttonBorderColorHoverDark,
|
|
8882
|
+
backgroundColor: buttonBackgroundColorHoverDark,
|
|
9048
8883
|
}),
|
|
8884
|
+
'& .toggle': {
|
|
8885
|
+
backgroundColor: toggleBackgroundColorHover,
|
|
8886
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8887
|
+
backgroundColor: toggleBackgroundColorHoverDark,
|
|
8888
|
+
}),
|
|
8889
|
+
},
|
|
9049
8890
|
},
|
|
9050
|
-
},
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
8891
|
+
})),
|
|
8892
|
+
...getFocusJssStyle(theme),
|
|
8893
|
+
},
|
|
8894
|
+
label: {
|
|
8895
|
+
...textSmallStyle,
|
|
8896
|
+
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
8897
|
+
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
8898
|
+
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
8899
|
+
color: textColor,
|
|
9057
8900
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9058
|
-
|
|
8901
|
+
color: textColorDark,
|
|
9059
8902
|
}),
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
8903
|
+
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
8904
|
+
// 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
|
|
8905
|
+
order: alignLabelValue === 'left' || alignLabelValue === 'start' ? -1 : 0,
|
|
8906
|
+
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
8907
|
+
paddingTop: '2px', // currently, line-height of textSmall doesn't match height of switch
|
|
8908
|
+
}))),
|
|
9064
8909
|
},
|
|
9065
8910
|
},
|
|
9066
|
-
switch: {
|
|
9067
|
-
position: 'relative',
|
|
9068
|
-
width: '48px',
|
|
9069
|
-
height: '28px',
|
|
9070
|
-
flexShrink: 0,
|
|
9071
|
-
boxSizing: 'border-box',
|
|
9072
|
-
border: `${borderWidthBase} solid ${buttonBorderColor}`,
|
|
9073
|
-
borderRadius: '14px',
|
|
9074
|
-
backgroundColor: buttonBackgroundColor,
|
|
9075
|
-
cursor: isDisabledOrLoading(disabled, loading) ? 'not-allowed' : 'pointer',
|
|
9076
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`,
|
|
9077
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9078
|
-
borderColor: buttonBorderColorDark,
|
|
9079
|
-
backgroundColor: buttonBackgroundColorDark,
|
|
9080
|
-
}),
|
|
9081
|
-
},
|
|
9082
8911
|
toggle: {
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
8912
|
+
display: 'flex',
|
|
8913
|
+
alignItems: 'center',
|
|
8914
|
+
justifyContent: 'center',
|
|
9086
8915
|
width: '20px',
|
|
9087
8916
|
height: '20px',
|
|
9088
|
-
display: 'block',
|
|
9089
8917
|
borderRadius: '50%',
|
|
9090
8918
|
backgroundColor: toggleBackgroundColor,
|
|
8919
|
+
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
8920
|
+
transform: `translate3d(${checked ? '22px' : '2px'}, 0, 0)`,
|
|
8921
|
+
'&:dir(rtl)': {
|
|
8922
|
+
transform: `translate3d(${checked ? '-22px' : '-2px'}, 0, 0)`,
|
|
8923
|
+
},
|
|
9091
8924
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9092
8925
|
backgroundColor: toggleBackgroundColorDark,
|
|
9093
8926
|
}),
|
|
9094
|
-
transform: `translate3d(${checked ? '20px' : '0'}, 0, 0)`,
|
|
9095
|
-
transition: `${getTransition('background-color')}, ${getTransition('transform')}`,
|
|
9096
8927
|
},
|
|
9097
8928
|
...(loading && {
|
|
9098
8929
|
spinner: {
|
|
9099
|
-
position: 'absolute',
|
|
9100
|
-
top: '-4px',
|
|
9101
|
-
left: '-4px',
|
|
9102
8930
|
width: '28px',
|
|
9103
8931
|
height: '28px',
|
|
9104
8932
|
},
|
|
9105
8933
|
}),
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
minWidth: 0, // prevents flex child to overflow max available parent size
|
|
9109
|
-
minHeight: 0, // prevents flex child to overflow max available parent size
|
|
9110
|
-
color: textColor,
|
|
9111
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9112
|
-
color: textColorDark,
|
|
9113
|
-
}),
|
|
9114
|
-
...mergeDeep(buildResponsiveStyles(alignLabel, (alignLabelValue) => ({
|
|
9115
|
-
// 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
|
|
9116
|
-
order: alignLabelValue === 'left' || alignLabelValue === 'start' ? -1 : 0,
|
|
9117
|
-
})), buildResponsiveStyles(hideLabel, (isHidden) => getHiddenTextJssStyle(isHidden, {
|
|
9118
|
-
paddingTop: '2px', // currently, line-height of textSmall doesn't match height of switch
|
|
9119
|
-
}))),
|
|
9120
|
-
},
|
|
8934
|
+
// .loading
|
|
8935
|
+
...getFunctionalComponentLoadingMessageStyles(),
|
|
9121
8936
|
});
|
|
9122
8937
|
};
|
|
9123
8938
|
|
|
@@ -9204,7 +9019,7 @@ const getComponentCss$h = (theme) => {
|
|
|
9204
9019
|
});
|
|
9205
9020
|
};
|
|
9206
9021
|
|
|
9207
|
-
const { hoverColor
|
|
9022
|
+
const { hoverColor } = getThemedColors('light'); // hover color and focus color are the same for light and dark
|
|
9208
9023
|
const buttonBeforeOffsetVertical = '-2px';
|
|
9209
9024
|
const buttonBeforeOffsetHorizontal = '-4px';
|
|
9210
9025
|
const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
@@ -9231,7 +9046,6 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9231
9046
|
padding: 0,
|
|
9232
9047
|
font: 'inherit',
|
|
9233
9048
|
color: 'inherit',
|
|
9234
|
-
outline: 0,
|
|
9235
9049
|
alignItems: 'flex-end',
|
|
9236
9050
|
WebkitAppearance: 'none', // iOS safari
|
|
9237
9051
|
appearance: 'none',
|
|
@@ -9240,19 +9054,17 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9240
9054
|
border: 0,
|
|
9241
9055
|
zIndex: 0,
|
|
9242
9056
|
cursor: 'pointer',
|
|
9057
|
+
// TODO: re-think if ::before is still needed
|
|
9243
9058
|
'&::before': {
|
|
9244
9059
|
content: '""',
|
|
9245
9060
|
position: 'absolute',
|
|
9246
|
-
|
|
9247
|
-
bottom: buttonBeforeOffsetVertical,
|
|
9248
|
-
right: buttonBeforeOffsetHorizontal,
|
|
9249
|
-
left: buttonBeforeOffsetHorizontal,
|
|
9061
|
+
inset: `${buttonBeforeOffsetVertical} ${buttonBeforeOffsetHorizontal}`,
|
|
9250
9062
|
borderRadius: borderRadiusSmall,
|
|
9251
9063
|
zIndex: -1, // needed so that text behind element is selectable and/or visible
|
|
9252
9064
|
transition: getTransition('background-color'),
|
|
9253
9065
|
},
|
|
9254
9066
|
...hoverMediaQuery({
|
|
9255
|
-
'&:hover, &:focus': {
|
|
9067
|
+
'&:hover, &:focus-visible': {
|
|
9256
9068
|
'& .icon': {
|
|
9257
9069
|
opacity: 1,
|
|
9258
9070
|
},
|
|
@@ -9262,12 +9074,8 @@ const getComponentCss$g = (active, direction, hideLabel, multiline) => {
|
|
|
9262
9074
|
backgroundColor: hoverColor,
|
|
9263
9075
|
},
|
|
9264
9076
|
}),
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
},
|
|
9268
|
-
'&:not(:focus-visible)::before': {
|
|
9269
|
-
border: 0,
|
|
9270
|
-
},
|
|
9077
|
+
// TODO: to be future proof, we need to pass theme parameter
|
|
9078
|
+
...getFocusJssStyle('light', { pseudo: true, offset: '-2px' }),
|
|
9271
9079
|
},
|
|
9272
9080
|
}
|
|
9273
9081
|
: hideLabel && {
|
|
@@ -9343,8 +9151,8 @@ const scrollerAnimatedCssClass = 'scroller--animated';
|
|
|
9343
9151
|
const targetSelectors = ['a', 'button'];
|
|
9344
9152
|
const transformSelector = (selector) => targetSelectors.map((tag) => selector.replace(/\[role]/g, tag)).join();
|
|
9345
9153
|
const getComponentCss$c = (size, weight, theme) => {
|
|
9346
|
-
const { primaryColor, hoverColor
|
|
9347
|
-
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark
|
|
9154
|
+
const { primaryColor, hoverColor } = getThemedColors(theme);
|
|
9155
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark } = getThemedColors('dark');
|
|
9348
9156
|
const barJssStyle = {
|
|
9349
9157
|
position: 'absolute',
|
|
9350
9158
|
height: '2px',
|
|
@@ -9371,6 +9179,12 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9371
9179
|
}),
|
|
9372
9180
|
},
|
|
9373
9181
|
...addImportantToEachRule({
|
|
9182
|
+
'::slotted': {
|
|
9183
|
+
// TODO: produces duplicated css code in SSR context, we should try to make use of multiple selector like
|
|
9184
|
+
// `::slotted(:is(a,button))`.
|
|
9185
|
+
...getFocusJssStyle(theme, { slotted: 'a', offset: '1px' }),
|
|
9186
|
+
...getFocusJssStyle(theme, { slotted: 'button', offset: '1px' }),
|
|
9187
|
+
},
|
|
9374
9188
|
// would be nice to use shared selector like '::slotted([role])'
|
|
9375
9189
|
// but this doesn't work reliably when rendering in browser
|
|
9376
9190
|
[transformSelector('::slotted([role])')]: {
|
|
@@ -9379,6 +9193,7 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9379
9193
|
position: 'relative',
|
|
9380
9194
|
margin: '0 0 4px 0',
|
|
9381
9195
|
verticalAlign: 'top',
|
|
9196
|
+
// TODO: can we use `all: 'inherit'` instead?
|
|
9382
9197
|
fontFamily: 'inherit',
|
|
9383
9198
|
fontStyle: 'inherit',
|
|
9384
9199
|
fontVariant: 'inherit',
|
|
@@ -9432,13 +9247,6 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9432
9247
|
bottom: isHighContrastMode ? '-4px' : '-6px',
|
|
9433
9248
|
visibility: 'inherit',
|
|
9434
9249
|
},
|
|
9435
|
-
// TODO: combine link-social-styles with link-button-styles and tabs-bar-styles
|
|
9436
|
-
[transformSelector('::slotted([role]:focus:focus-visible)::before')]: {
|
|
9437
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
9438
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9439
|
-
borderColor: focusColorDark,
|
|
9440
|
-
}),
|
|
9441
|
-
},
|
|
9442
9250
|
[transformSelector('::slotted([role]:not(:last-child))')]: {
|
|
9443
9251
|
marginInlineEnd: spacingStaticMedium,
|
|
9444
9252
|
},
|
|
@@ -9474,30 +9282,20 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
9474
9282
|
};
|
|
9475
9283
|
|
|
9476
9284
|
const getComponentCss$b = (theme) => {
|
|
9477
|
-
const { primaryColor
|
|
9478
|
-
const { primaryColor: primaryColorDark
|
|
9285
|
+
const { primaryColor } = getThemedColors(theme);
|
|
9286
|
+
const { primaryColor: primaryColorDark } = getThemedColors('dark');
|
|
9479
9287
|
return getCss({
|
|
9480
9288
|
'@global': {
|
|
9481
9289
|
':host': {
|
|
9482
9290
|
display: 'block',
|
|
9483
9291
|
...addImportantToEachRule({
|
|
9484
|
-
position: 'relative',
|
|
9485
9292
|
color: primaryColor, // enables color inheritance for e.g. slotted anchor
|
|
9486
|
-
|
|
9293
|
+
borderRadius: '2px',
|
|
9487
9294
|
...hostHiddenStyles,
|
|
9488
9295
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9489
9296
|
color: primaryColorDark,
|
|
9490
9297
|
}),
|
|
9491
|
-
|
|
9492
|
-
content: '""',
|
|
9493
|
-
position: 'absolute',
|
|
9494
|
-
...getInsetJssStyle(-4),
|
|
9495
|
-
border: `${borderWidthBase} solid ${focusColor}`,
|
|
9496
|
-
borderRadius: borderRadiusSmall,
|
|
9497
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9498
|
-
borderColor: focusColorDark,
|
|
9499
|
-
}),
|
|
9500
|
-
},
|
|
9298
|
+
...getFocusJssStyle(theme, { slotted: true }),
|
|
9501
9299
|
}),
|
|
9502
9300
|
},
|
|
9503
9301
|
},
|
|
@@ -9521,20 +9319,6 @@ const getComponentCss$a = () => {
|
|
|
9521
9319
|
});
|
|
9522
9320
|
};
|
|
9523
9321
|
|
|
9524
|
-
const getTagFocusJssStyle = (themedColors) => {
|
|
9525
|
-
return {
|
|
9526
|
-
'&:focus::before': {
|
|
9527
|
-
content: '""',
|
|
9528
|
-
position: 'absolute',
|
|
9529
|
-
...getInsetJssStyle(-4),
|
|
9530
|
-
border: `${borderWidthBase} solid ${themedColors.focusColor}`,
|
|
9531
|
-
borderRadius: borderRadiusMedium,
|
|
9532
|
-
},
|
|
9533
|
-
'&:focus:not(:focus-visible)::before': {
|
|
9534
|
-
borderColor: 'transparent',
|
|
9535
|
-
},
|
|
9536
|
-
};
|
|
9537
|
-
};
|
|
9538
9322
|
const getThemedBackgroundColor = (tagColor, themedColors) => {
|
|
9539
9323
|
const colorMap = {
|
|
9540
9324
|
'background-base': themedColors.backgroundColor,
|
|
@@ -9581,7 +9365,10 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9581
9365
|
color: primaryColor,
|
|
9582
9366
|
textAlign: 'start',
|
|
9583
9367
|
...textSmallStyle,
|
|
9584
|
-
|
|
9368
|
+
...(isHighContrastMode && {
|
|
9369
|
+
// TODO: using border would increase the dimension but using outline interferes with the focus style
|
|
9370
|
+
outline: '1px solid transparent',
|
|
9371
|
+
}),
|
|
9585
9372
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9586
9373
|
background: backgroundColorDark,
|
|
9587
9374
|
color: primaryColorDark,
|
|
@@ -9594,7 +9381,7 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
9594
9381
|
}),
|
|
9595
9382
|
},
|
|
9596
9383
|
}),
|
|
9597
|
-
...
|
|
9384
|
+
...getFocusJssStyle(theme),
|
|
9598
9385
|
},
|
|
9599
9386
|
},
|
|
9600
9387
|
...(hasLabel && {
|
|
@@ -9637,7 +9424,6 @@ const getColors = (themedColors, tagColor, theme) => {
|
|
|
9637
9424
|
const { primaryColor } = tagColor === 'primary' ? getInvertedThemedColors(theme) : themedColors;
|
|
9638
9425
|
return {
|
|
9639
9426
|
primaryColor,
|
|
9640
|
-
focusColor: themedColors.focusColor,
|
|
9641
9427
|
backgroundColor: getThemedBackgroundColor(tagColor, themedColors),
|
|
9642
9428
|
backgroundHoverColor: getThemedBackgroundHoverColor(tagColor, themedColors, theme),
|
|
9643
9429
|
};
|
|
@@ -9700,11 +9486,14 @@ const getComponentCss$8 = (tagColor, isFocusable, theme) => {
|
|
|
9700
9486
|
border: 0,
|
|
9701
9487
|
textAlign: 'start',
|
|
9702
9488
|
},
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9489
|
+
'&(a)::before,&(button)::before': {
|
|
9490
|
+
content: '""',
|
|
9491
|
+
position: 'absolute',
|
|
9492
|
+
inset: 0,
|
|
9493
|
+
borderRadius: '4px',
|
|
9494
|
+
},
|
|
9495
|
+
...getFocusJssStyle(theme, { slotted: 'a', pseudo: true }),
|
|
9496
|
+
...getFocusJssStyle(theme, { slotted: 'button', pseudo: true }),
|
|
9708
9497
|
'&(br)': {
|
|
9709
9498
|
display: 'none',
|
|
9710
9499
|
},
|
|
@@ -10081,7 +9870,14 @@ const getComponentCss = (size, theme) => {
|
|
|
10081
9870
|
},
|
|
10082
9871
|
a: {
|
|
10083
9872
|
textDecoration: 'none',
|
|
10084
|
-
|
|
9873
|
+
'&::before': {
|
|
9874
|
+
// needs to be defined always to have correct custom click area
|
|
9875
|
+
content: '""',
|
|
9876
|
+
position: 'absolute',
|
|
9877
|
+
inset: 0,
|
|
9878
|
+
borderRadius: '1px',
|
|
9879
|
+
},
|
|
9880
|
+
...getFocusJssStyle('light', { pseudo: true }), // TODO: we need to support theme
|
|
10085
9881
|
},
|
|
10086
9882
|
svg: isHighContrastMode
|
|
10087
9883
|
? {
|
|
@@ -10097,4 +9893,4 @@ const getComponentCss = (size, theme) => {
|
|
|
10097
9893
|
});
|
|
10098
9894
|
};
|
|
10099
9895
|
|
|
10100
|
-
export { getComponentCss$13 as getAccordionCss, getComponentCss$12 as getBannerCss, getComponentCss$_ as getButtonCss, getComponentCss$11 as getButtonGroupCss, getComponentCss$10 as getButtonPureCss, getComponentCss$$ as getButtonTileCss, getComponentCss$Z as getCarouselCss, getComponentCss$Y as getCheckboxWrapperCss, getComponentCss$X as getContentWrapperCss, getComponentCss$W as getCrestCss, getComponentCss$V as getDisplayCss, getComponentCss$U as getDividerCss, getComponentCss$S as getFieldsetCss, getComponentCss$T as getFieldsetWrapperCss, getComponentCss$Q as getFlexCss, getComponentCss$R as getFlexItemCss, getComponentCss$N as getFlyoutCss, getComponentCss$P as getFlyoutNavigationCss, getComponentCss$O as getFlyoutNavigationItemCss, getFunctionalComponentLabelStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$L as getGridCss, getComponentCss$M as getGridItemCss, getComponentCss$K as getHeadingCss, getComponentCss$J as getHeadlineCss, getComponentCss$I as getIconCss, getComponentCss$H as getInlineNotificationCss, getComponentCss$F as getLinkCss, getComponentCss$G as getLinkPureCss, getComponentCss$F as getLinkSocialCss, getComponentCss$C as getLinkTileCss, getComponentCss$E as getLinkTileModelSignatureCss, getComponentCss$D as getLinkTileProductCss, getComponentCss$B as getMarqueCss, getComponentCss$A as getModalCss, getComponentCss$z as getModelSignatureCss, getComponentCss$x as getMultiSelectCss, getComponentCss$y as getMultiSelectOptionCss, getComponentCss$w as getPaginationCss, getComponentCss$v as getPinCodeCss, getComponentCss$u as getPopoverCss, getComponentCss$t as getRadioButtonWrapperCss, getComponentCss$s as getScrollerCss, getComponentCss$q as getSegmentedControlCss, getComponentCss$r as getSegmentedControlItemCss, getComponentCss$o as getSelectWrapperCss, getComponentCss$p as getSelectWrapperDropdownCss, getComponentCss$n as getSpinnerCss, getComponentCss$l as getStepperHorizontalCss, getComponentCss$m as getStepperHorizontalItemCss, getComponentCss$k as getSwitchCss, getComponentCss$j as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$h as getTableCss, getComponentCss$g as getTableHeadCellCss, getComponentCss$e as getTableHeadCss, getComponentCss$f as getTableHeadRowCss, getComponentCss$d as getTableRowCss, getComponentCss$c as getTabsBarCss, getComponentCss$a as getTabsCss, getComponentCss$b as getTabsItemCss, getComponentCss$8 as getTagCss, getComponentCss$9 as getTagDismissibleCss, getComponentCss$4 as getTextCss, getComponentCss$7 as getTextFieldWrapperCss, getComponentCss$6 as getTextListCss, getComponentCss$5 as getTextListItemCss, getComponentCss$3 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
|
|
9896
|
+
export { getComponentCss$13 as getAccordionCss, getComponentCss$12 as getBannerCss, getComponentCss$_ as getButtonCss, getComponentCss$11 as getButtonGroupCss, getComponentCss$10 as getButtonPureCss, getComponentCss$$ as getButtonTileCss, getComponentCss$Z as getCarouselCss, getComponentCss$Y as getCheckboxWrapperCss, getComponentCss$X as getContentWrapperCss, getComponentCss$W as getCrestCss, getComponentCss$V as getDisplayCss, getComponentCss$U as getDividerCss, getComponentCss$S as getFieldsetCss, getComponentCss$T as getFieldsetWrapperCss, getComponentCss$Q as getFlexCss, getComponentCss$R as getFlexItemCss, getComponentCss$N as getFlyoutCss, getComponentCss$P as getFlyoutNavigationCss, getComponentCss$O as getFlyoutNavigationItemCss, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$L as getGridCss, getComponentCss$M as getGridItemCss, getComponentCss$K as getHeadingCss, getComponentCss$J as getHeadlineCss, getComponentCss$I as getIconCss, getComponentCss$H as getInlineNotificationCss, getComponentCss$F as getLinkCss, getComponentCss$G as getLinkPureCss, getComponentCss$F as getLinkSocialCss, getComponentCss$C as getLinkTileCss, getComponentCss$E as getLinkTileModelSignatureCss, getComponentCss$D as getLinkTileProductCss, getComponentCss$B as getMarqueCss, getComponentCss$A as getModalCss, getComponentCss$z as getModelSignatureCss, getComponentCss$x as getMultiSelectCss, getComponentCss$y as getMultiSelectOptionCss, getComponentCss$w as getPaginationCss, getComponentCss$v as getPinCodeCss, getComponentCss$u as getPopoverCss, getComponentCss$t as getRadioButtonWrapperCss, getComponentCss$s as getScrollerCss, getComponentCss$q as getSegmentedControlCss, getComponentCss$r as getSegmentedControlItemCss, getComponentCss$o as getSelectWrapperCss, getComponentCss$p as getSelectWrapperDropdownCss, getComponentCss$n as getSpinnerCss, getComponentCss$l as getStepperHorizontalCss, getComponentCss$m as getStepperHorizontalItemCss, getComponentCss$k as getSwitchCss, getComponentCss$j as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$h as getTableCss, getComponentCss$g as getTableHeadCellCss, getComponentCss$e as getTableHeadCss, getComponentCss$f as getTableHeadRowCss, getComponentCss$d as getTableRowCss, getComponentCss$c as getTabsBarCss, getComponentCss$a as getTabsCss, getComponentCss$b as getTabsItemCss, getComponentCss$8 as getTagCss, getComponentCss$9 as getTagDismissibleCss, getComponentCss$4 as getTextCss, getComponentCss$7 as getTextFieldWrapperCss, getComponentCss$6 as getTextListCss, getComponentCss$5 as getTextListItemCss, getComponentCss$3 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
|