@porsche-design-system/components-react 3.0.0-alpha.6 → 3.0.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 +56 -23
- package/esm/lib/components/checkbox-wrapper.wrapper.js +3 -3
- package/lib/components/checkbox-wrapper.wrapper.d.ts +8 -0
- package/lib/components/checkbox-wrapper.wrapper.js +3 -3
- package/lib/types.d.ts +11 -2
- package/package.json +2 -2
- package/ssr/components/dist/styles/esm/styles-entry.js +232 -193
- package/ssr/components/dist/utils/esm/utils-entry.js +45 -76
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/checkbox-wrapper.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +1 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +62 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.js +2 -1
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile-model-signature.js +1 -1
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/model-signature.js +1 -1
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.js +232 -193
- package/ssr/esm/components/dist/utils/esm/utils-entry.js +43 -76
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/checkbox-wrapper.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +1 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +62 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.js +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile-model-signature.js +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/model-signature.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +1 -1
- package/ssr/lib/components/checkbox-wrapper.wrapper.d.ts +8 -0
- package/ssr/lib/types.d.ts +11 -2
|
@@ -4,6 +4,8 @@ const isDisabledOrLoading = (disabled, loading) => {
|
|
|
4
4
|
|
|
5
5
|
const hasWindow = typeof window !== 'undefined';
|
|
6
6
|
|
|
7
|
+
const isHighContrastMode = hasWindow && window.matchMedia && matchMedia('(forced-colors: active)').matches;
|
|
8
|
+
|
|
7
9
|
const attributeMutationMap = new Map();
|
|
8
10
|
hasWindow &&
|
|
9
11
|
new MutationObserver((mutations) => {
|
|
@@ -39,6 +41,8 @@ const borderRadiusSmall = '4px';
|
|
|
39
41
|
|
|
40
42
|
const borderRadiusMedium = '8px';
|
|
41
43
|
|
|
44
|
+
const borderRadiusLarge = '12px';
|
|
45
|
+
|
|
42
46
|
const borderWidthBase = '2px';
|
|
43
47
|
|
|
44
48
|
const _dropShadowBackgroundColor = 'rgba(0, 0, 0, 0.16)';
|
|
@@ -105,12 +109,6 @@ const fontWeightSemiBold = 600;
|
|
|
105
109
|
|
|
106
110
|
const fontWeightBold = 700;
|
|
107
111
|
|
|
108
|
-
const fontWeight = {
|
|
109
|
-
regular: fontWeightRegular,
|
|
110
|
-
semiBold: fontWeightSemiBold,
|
|
111
|
-
bold: fontWeightBold,
|
|
112
|
-
};
|
|
113
|
-
|
|
114
112
|
const fontStyleNormal = 'normal';
|
|
115
113
|
|
|
116
114
|
const fontVariant = 'normal';
|
|
@@ -518,25 +516,6 @@ var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symb
|
|
|
518
516
|
|
|
519
517
|
var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof$1(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof$1(document)) === 'object' && document.nodeType === 9;
|
|
520
518
|
|
|
521
|
-
var isProduction = process.env.NODE_ENV === 'production';
|
|
522
|
-
function warning(condition, message) {
|
|
523
|
-
if (!isProduction) {
|
|
524
|
-
if (condition) {
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
var text = "Warning: " + message;
|
|
529
|
-
|
|
530
|
-
if (typeof console !== 'undefined') {
|
|
531
|
-
console.warn(text);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
try {
|
|
535
|
-
throw Error(text);
|
|
536
|
-
} catch (x) {}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
519
|
function _typeof(obj) {
|
|
541
520
|
"@babel/helpers - typeof";
|
|
542
521
|
|
|
@@ -643,9 +622,7 @@ function createRule(name, decl, options) {
|
|
|
643
622
|
var rule = jss.plugins.onCreateRule(name, declCopy, options);
|
|
644
623
|
if (rule) return rule; // It is an at-rule and it has no instance.
|
|
645
624
|
|
|
646
|
-
if (name[0] === '@')
|
|
647
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Unknown rule " + name) : void 0;
|
|
648
|
-
}
|
|
625
|
+
if (name[0] === '@') ;
|
|
649
626
|
|
|
650
627
|
return null;
|
|
651
628
|
}
|
|
@@ -846,9 +823,7 @@ function () {
|
|
|
846
823
|
|
|
847
824
|
var sheet = this.options.sheet;
|
|
848
825
|
|
|
849
|
-
if (sheet && sheet.attached)
|
|
850
|
-
process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Rule is not linked. Missing sheet option "link: true".') : void 0;
|
|
851
|
-
}
|
|
826
|
+
if (sheet && sheet.attached) ;
|
|
852
827
|
|
|
853
828
|
return this;
|
|
854
829
|
};
|
|
@@ -1094,7 +1069,6 @@ function () {
|
|
|
1094
1069
|
this.name = nameMatch[1];
|
|
1095
1070
|
} else {
|
|
1096
1071
|
this.name = 'noname';
|
|
1097
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Bad keyframes name " + key) : void 0;
|
|
1098
1072
|
}
|
|
1099
1073
|
|
|
1100
1074
|
this.key = this.type + "-" + this.name;
|
|
@@ -1153,8 +1127,6 @@ var findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {
|
|
|
1153
1127
|
if (name in keyframes) {
|
|
1154
1128
|
return keyframes[name];
|
|
1155
1129
|
}
|
|
1156
|
-
|
|
1157
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Referenced keyframes rule \"" + name + "\" is not defined.") : void 0;
|
|
1158
1130
|
return match;
|
|
1159
1131
|
});
|
|
1160
1132
|
}
|
|
@@ -1979,8 +1951,6 @@ function () {
|
|
|
1979
1951
|
for (var name in plugin) {
|
|
1980
1952
|
if (name in registry) {
|
|
1981
1953
|
registry[name].push(plugin[name]);
|
|
1982
|
-
} else {
|
|
1983
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Unknown hook \"" + name + "\".") : void 0;
|
|
1984
1954
|
}
|
|
1985
1955
|
}
|
|
1986
1956
|
|
|
@@ -2122,8 +2092,6 @@ if (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multip
|
|
|
2122
2092
|
// the module.
|
|
2123
2093
|
|
|
2124
2094
|
var moduleId = globalThis$1[ns]++;
|
|
2125
|
-
|
|
2126
|
-
var maxRules = 1e10;
|
|
2127
2095
|
/**
|
|
2128
2096
|
* Returns a function which generates unique class names based on counters.
|
|
2129
2097
|
* When new generator function is created, rule counter is reseted.
|
|
@@ -2140,10 +2108,6 @@ var createGenerateId = function createGenerateId(options) {
|
|
|
2140
2108
|
var generateId = function generateId(rule, sheet) {
|
|
2141
2109
|
ruleCounter += 1;
|
|
2142
2110
|
|
|
2143
|
-
if (ruleCounter > maxRules) {
|
|
2144
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] You might have a memory leak. Rule counter is at " + ruleCounter + ".") : void 0;
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
2111
|
var jssId = '';
|
|
2148
2112
|
var prefix = '';
|
|
2149
2113
|
|
|
@@ -2239,7 +2203,6 @@ var removeProperty = function removeProperty(cssRule, prop) {
|
|
|
2239
2203
|
cssRule.style.removeProperty(prop);
|
|
2240
2204
|
}
|
|
2241
2205
|
} catch (err) {
|
|
2242
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] DOMException \"" + err.message + "\" was thrown. Tried to remove property \"" + prop + "\".") : void 0;
|
|
2243
2206
|
}
|
|
2244
2207
|
};
|
|
2245
2208
|
/**
|
|
@@ -2353,10 +2316,6 @@ function findPrevNode(options) {
|
|
|
2353
2316
|
node: comment.nextSibling
|
|
2354
2317
|
};
|
|
2355
2318
|
} // If user specifies an insertion point and it can't be found in the document -
|
|
2356
|
-
// bad specificity issues may appear.
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Insertion point \"" + insertionPoint + "\" not found.") : void 0;
|
|
2360
2319
|
}
|
|
2361
2320
|
|
|
2362
2321
|
return false;
|
|
@@ -2379,7 +2338,7 @@ function insertStyle(style, options) {
|
|
|
2379
2338
|
if (insertionPoint && typeof insertionPoint.nodeType === 'number') {
|
|
2380
2339
|
var insertionPointElement = insertionPoint;
|
|
2381
2340
|
var parentNode = insertionPointElement.parentNode;
|
|
2382
|
-
if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);
|
|
2341
|
+
if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);
|
|
2383
2342
|
return;
|
|
2384
2343
|
}
|
|
2385
2344
|
|
|
@@ -2404,7 +2363,6 @@ var _insertRule = function insertRule(container, rule, index) {
|
|
|
2404
2363
|
container.appendRule(rule);
|
|
2405
2364
|
}
|
|
2406
2365
|
} catch (err) {
|
|
2407
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] " + err.message) : void 0;
|
|
2408
2366
|
return false;
|
|
2409
2367
|
}
|
|
2410
2368
|
|
|
@@ -2825,8 +2783,6 @@ function () {
|
|
|
2825
2783
|
entry.refs++;
|
|
2826
2784
|
return entry.sheet;
|
|
2827
2785
|
}
|
|
2828
|
-
|
|
2829
|
-
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
|
|
2830
2786
|
return undefined;
|
|
2831
2787
|
};
|
|
2832
2788
|
|
|
@@ -2838,8 +2794,6 @@ function () {
|
|
|
2838
2794
|
entry.refs--;
|
|
2839
2795
|
if (entry.refs === 0) entry.sheet.detach();
|
|
2840
2796
|
}
|
|
2841
|
-
} else {
|
|
2842
|
-
warning(false, "SheetsManager: can't find sheet to unmanage");
|
|
2843
2797
|
}
|
|
2844
2798
|
};
|
|
2845
2799
|
|
|
@@ -3181,8 +3135,6 @@ function jssNested() {
|
|
|
3181
3135
|
if (rule) {
|
|
3182
3136
|
return rule.selector;
|
|
3183
3137
|
}
|
|
3184
|
-
|
|
3185
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Could not find the referenced rule \"" + key + "\" in \"" + (container.options.meta || container.toString()) + "\".") : void 0;
|
|
3186
3138
|
return key;
|
|
3187
3139
|
};
|
|
3188
3140
|
}
|
|
@@ -3777,8 +3729,21 @@ const themes = {
|
|
|
3777
3729
|
'dark': themeDark
|
|
3778
3730
|
};
|
|
3779
3731
|
/* Auto Generated End */
|
|
3732
|
+
const schemeHighContrastMerged = {
|
|
3733
|
+
disabledColor: 'GrayText',
|
|
3734
|
+
focusColor: 'Highlight',
|
|
3735
|
+
};
|
|
3736
|
+
const schemeHighContrast = {
|
|
3737
|
+
canvasColor: 'Canvas',
|
|
3738
|
+
canvasTextColor: 'CanvasText',
|
|
3739
|
+
highlightColor: 'Highlight',
|
|
3740
|
+
linkColor: 'LinkText',
|
|
3741
|
+
};
|
|
3780
3742
|
const getThemedColors = (theme) => {
|
|
3781
|
-
return themes[theme];
|
|
3743
|
+
return isHighContrastMode ? Object.assign(Object.assign({}, themes[theme]), schemeHighContrastMerged) : themes[theme];
|
|
3744
|
+
};
|
|
3745
|
+
const getHighContrastColors = () => {
|
|
3746
|
+
return schemeHighContrast;
|
|
3782
3747
|
};
|
|
3783
3748
|
const getInvertedThemedColors = (theme) => {
|
|
3784
3749
|
return getThemedColors(isThemeDark(theme) ? 'light' : 'dark');
|
|
@@ -3876,6 +3841,13 @@ const hoverMediaQuery = (style) =>
|
|
|
3876
3841
|
({ '@media(hover:hover)': style }) // used for prod build, yarn start and unit tests
|
|
3877
3842
|
; // used for staging build in e2e and vrt tests
|
|
3878
3843
|
|
|
3844
|
+
const getSchemedHighContrastMediaQuery = (light, dark) => {
|
|
3845
|
+
return {
|
|
3846
|
+
'@media (forced-colors: active) and (prefers-color-scheme: light)': light,
|
|
3847
|
+
'@media (forced-colors: active) and (prefers-color-scheme: dark)': dark,
|
|
3848
|
+
};
|
|
3849
|
+
};
|
|
3850
|
+
|
|
3879
3851
|
// NOTE: handpicked selection of plugins from jss-preset-default
|
|
3880
3852
|
const jss = createJss({
|
|
3881
3853
|
plugins: [
|
|
@@ -3953,14 +3925,14 @@ const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
|
3953
3925
|
|
|
3954
3926
|
const getComponentCss$Y = (size, compact, open, theme) => {
|
|
3955
3927
|
const { primaryColor, hoverColor, focusColor, contrastLowColor } = getThemedColors(theme);
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
':host': addImportantToEachRule(Object.assign({ display: 'block' },
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
fontSize:
|
|
3963
|
-
padding: compact ? '4px
|
|
3928
|
+
return getCss({
|
|
3929
|
+
'@global': {
|
|
3930
|
+
':host': addImportantToEachRule(Object.assign(Object.assign({ display: 'block' }, (!compact && {
|
|
3931
|
+
borderBottom: `1px solid ${contrastLowColor}`,
|
|
3932
|
+
})), hostHiddenStyles)),
|
|
3933
|
+
button: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ display: 'flex', position: 'relative', justifyContent: 'space-between', width: '100%', textDecoration: 'none', border: 0, outline: 0, gap: '24px', background: 'transparent', cursor: 'pointer', textAlign: 'left', color: primaryColor }, textSmallStyle), { fontWeight: fontWeightSemiBold }), buildResponsiveStyles(size, (s) => ({
|
|
3934
|
+
fontSize: s === 'medium' ? fontSizeTextMedium : fontSizeTextSmall,
|
|
3935
|
+
padding: `${compact ? '4px' : s === 'medium' ? '20px' : '12px'} 0`,
|
|
3964
3936
|
}))), mergeDeep({
|
|
3965
3937
|
'&::before': Object.assign({ content: '""', position: 'absolute', borderRadius: borderRadiusSmall, left: '-4px', right: '-4px' }, (compact
|
|
3966
3938
|
? {
|
|
@@ -3983,41 +3955,37 @@ const getComponentCss$Y = (size, compact, open, theme) => {
|
|
|
3983
3955
|
}, '&:not(:focus-visible)::before': {
|
|
3984
3956
|
border: 0,
|
|
3985
3957
|
} }),
|
|
3986
|
-
} }, (!compact && {
|
|
3987
|
-
root: {
|
|
3988
|
-
borderBottom: border,
|
|
3989
3958
|
},
|
|
3990
|
-
|
|
3959
|
+
heading: {
|
|
3991
3960
|
margin: 0,
|
|
3992
|
-
padding: 0,
|
|
3993
|
-
},
|
|
3961
|
+
padding: '0 0 2px',
|
|
3962
|
+
},
|
|
3963
|
+
icon: {
|
|
3994
3964
|
width: fontLineHeight,
|
|
3995
3965
|
height: fontLineHeight,
|
|
3996
|
-
transformOrigin: '50% 50%',
|
|
3997
3966
|
transform: open ? 'rotate3d(0)' : 'rotate3d(0,0,1,90deg)',
|
|
3998
3967
|
transition: getTransition('transform'),
|
|
3999
|
-
},
|
|
3968
|
+
},
|
|
3969
|
+
collapsible: Object.assign({ color: primaryColor, overflow: 'hidden' }, (open
|
|
4000
3970
|
? {
|
|
4001
3971
|
height: 'auto',
|
|
4002
3972
|
paddingBottom: compact ? spacingStaticSmall : '24px',
|
|
4003
3973
|
visibility: 'visible',
|
|
4004
|
-
transition: getTransition('height') +
|
|
4005
|
-
animation: `$open ${transitionDuration}
|
|
3974
|
+
transition: getTransition('height') + ',' + getTransition('padding-bottom'),
|
|
3975
|
+
animation: `$open 0s ${transitionDuration} forwards`, // delay overflow change and have `overflow: visible` after transition
|
|
4006
3976
|
}
|
|
4007
3977
|
: {
|
|
4008
3978
|
height: 0,
|
|
4009
3979
|
visibility: 'hidden',
|
|
4010
|
-
transition: getTransition('height') + `,visibility
|
|
4011
|
-
})),
|
|
3980
|
+
transition: getTransition('height') + `,visibility 0s linear ${transitionDuration}`,
|
|
3981
|
+
})),
|
|
4012
3982
|
// TODO: this doesn't get shortened and results in `keyframes-open` for some unknown reason
|
|
4013
3983
|
'@keyframes open': {
|
|
4014
|
-
|
|
4015
|
-
overflow: 'hidden',
|
|
4016
|
-
},
|
|
4017
|
-
'100%': {
|
|
3984
|
+
to: {
|
|
4018
3985
|
overflow: 'visible',
|
|
4019
3986
|
},
|
|
4020
|
-
}
|
|
3987
|
+
},
|
|
3988
|
+
});
|
|
4021
3989
|
};
|
|
4022
3990
|
|
|
4023
3991
|
const TOAST_Z_INDEX = 999999;
|
|
@@ -4208,7 +4176,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4208
4176
|
},
|
|
4209
4177
|
},
|
|
4210
4178
|
})),
|
|
4211
|
-
root: Object.assign(Object.assign({ position: 'relative',
|
|
4179
|
+
root: Object.assign(Object.assign({ position: 'relative', overflow: 'hidden', transform: 'translate3d(0,0,0)', borderRadius: borderRadiusLarge, color: getThemedTypographyColor('dark', 'primary') }, buildResponsiveStyles(aspectRatio, (ratio) => ({
|
|
4212
4180
|
paddingTop: aspectRatioPaddingMap[ratio],
|
|
4213
4181
|
}))), (!isDisabled &&
|
|
4214
4182
|
hoverMediaQuery({
|
|
@@ -4224,7 +4192,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4224
4192
|
display: 'flex',
|
|
4225
4193
|
justifyItems: 'start',
|
|
4226
4194
|
gap: spacingStaticMedium,
|
|
4227
|
-
borderRadius:
|
|
4195
|
+
borderRadius: borderRadiusLarge,
|
|
4228
4196
|
'@media (forced-colors: active)': {
|
|
4229
4197
|
background: 'rgba(0,0,0,0.7)',
|
|
4230
4198
|
},
|
|
@@ -4271,6 +4239,7 @@ const { primaryColor: darkThemePrimaryColor$1 } = getThemedColors('dark');
|
|
|
4271
4239
|
const { primaryColor: lightThemePrimaryColor$1 } = getThemedColors('light');
|
|
4272
4240
|
const getVariantColors = (variant, theme) => {
|
|
4273
4241
|
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor } = getThemedColors(theme);
|
|
4242
|
+
const { canvasColor } = getHighContrastColors();
|
|
4274
4243
|
const colors = {
|
|
4275
4244
|
primary: {
|
|
4276
4245
|
textColor: theme === 'dark' ? lightThemePrimaryColor$1 : darkThemePrimaryColor$1,
|
|
@@ -4283,7 +4252,7 @@ const getVariantColors = (variant, theme) => {
|
|
|
4283
4252
|
textColor: primaryColor,
|
|
4284
4253
|
borderColor: primaryColor,
|
|
4285
4254
|
borderColorHover: contrastMediumColor,
|
|
4286
|
-
backgroundColor: 'transparent',
|
|
4255
|
+
backgroundColor: isHighContrastMode ? canvasColor : 'transparent',
|
|
4287
4256
|
backgroundColorHover: hoverColor,
|
|
4288
4257
|
},
|
|
4289
4258
|
};
|
|
@@ -4307,7 +4276,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4307
4276
|
},
|
|
4308
4277
|
})), (!isDisabledOrLoading &&
|
|
4309
4278
|
hoverMediaQuery({
|
|
4310
|
-
'&:hover': Object.assign({ backgroundColor: backgroundColorHover, borderColor: borderColorHover }, (!isPrimary && frostedGlassStyle)),
|
|
4279
|
+
'&:hover': Object.assign({ backgroundColor: backgroundColorHover, borderColor: isHighContrastMode ? focusColor : borderColorHover }, (!isPrimary && frostedGlassStyle)),
|
|
4311
4280
|
}))), label: Object.assign({}, buildResponsiveStyles(hideLabel, (hideLabelValue) => hideLabelValue
|
|
4312
4281
|
? {
|
|
4313
4282
|
width: 0,
|
|
@@ -4328,16 +4297,17 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4328
4297
|
|
|
4329
4298
|
const getDisabledColors = (variant, loading, theme) => {
|
|
4330
4299
|
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4300
|
+
const { canvasColor } = getHighContrastColors();
|
|
4331
4301
|
const colors = {
|
|
4332
4302
|
primary: {
|
|
4333
|
-
textColor: contrastHighColor,
|
|
4334
|
-
borderColor: loading ? contrastHighColor : disabledColor,
|
|
4335
|
-
backgroundColor: loading ? contrastHighColor : disabledColor,
|
|
4303
|
+
textColor: isHighContrastMode ? disabledColor : contrastHighColor,
|
|
4304
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? contrastHighColor : disabledColor,
|
|
4305
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? contrastHighColor : disabledColor,
|
|
4336
4306
|
},
|
|
4337
4307
|
secondary: {
|
|
4338
4308
|
textColor: disabledColor,
|
|
4339
|
-
borderColor: loading ? contrastMediumColor : disabledColor,
|
|
4340
|
-
backgroundColor: loading ? hoverColor : 'transparent',
|
|
4309
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? contrastMediumColor : disabledColor,
|
|
4310
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? hoverColor : 'transparent',
|
|
4341
4311
|
},
|
|
4342
4312
|
};
|
|
4343
4313
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
@@ -4383,6 +4353,7 @@ const spacingMap = {
|
|
|
4383
4353
|
};
|
|
4384
4354
|
const getComponentCss$S = (width, hasPagination, alignHeader, theme) => {
|
|
4385
4355
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
4356
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
4386
4357
|
const isHeaderAlignCenter = alignHeader === 'center';
|
|
4387
4358
|
return getCss(Object.assign({ '@global': {
|
|
4388
4359
|
':host': addImportantToEachRule(Object.assign({ display: 'flex', gap: spacingFluidMedium, flexDirection: 'column', boxSizing: 'content-box' }, hostHiddenStyles)),
|
|
@@ -4446,14 +4417,14 @@ const getComponentCss$S = (width, hasPagination, alignHeader, theme) => {
|
|
|
4446
4417
|
}))), { justifyContent: 'center', gap: spacingStaticSmall }),
|
|
4447
4418
|
bullet: {
|
|
4448
4419
|
borderRadius: borderRadiusSmall,
|
|
4449
|
-
background: contrastMediumColor,
|
|
4420
|
+
background: isHighContrastMode ? canvasTextColor : contrastMediumColor,
|
|
4450
4421
|
// set transition to have the same speed as switching slides in splide
|
|
4451
4422
|
transition: `background-color ${carouselTransitionDuration}ms, width ${carouselTransitionDuration}ms`,
|
|
4452
4423
|
width: '8px',
|
|
4453
4424
|
height: '8px',
|
|
4454
4425
|
},
|
|
4455
4426
|
[bulletActiveClass]: {
|
|
4456
|
-
background: primaryColor,
|
|
4427
|
+
background: isHighContrastMode ? canvasTextColor : primaryColor,
|
|
4457
4428
|
width: '20px',
|
|
4458
4429
|
},
|
|
4459
4430
|
})));
|
|
@@ -4481,12 +4452,18 @@ const getFunctionalComponentStateMessageStyles = (theme, state) => {
|
|
|
4481
4452
|
};
|
|
4482
4453
|
};
|
|
4483
4454
|
|
|
4484
|
-
const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, theme) => {
|
|
4455
|
+
const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
4485
4456
|
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
|
|
4486
4457
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
4487
|
-
const
|
|
4458
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
4459
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
4460
|
+
const uncheckedColor = disabledOrLoading ? disabledColor : formStateColor || contrastMediumColor;
|
|
4488
4461
|
const uncheckedHoverColor = formStateHoverColor || primaryColor;
|
|
4489
|
-
const checkedColor =
|
|
4462
|
+
const checkedColor = isHighContrastMode
|
|
4463
|
+
? canvasTextColor
|
|
4464
|
+
: disabledOrLoading
|
|
4465
|
+
? disabledColor
|
|
4466
|
+
: formStateColor || primaryColor;
|
|
4490
4467
|
const checkedHoverColor = formStateHoverColor || contrastHighColor;
|
|
4491
4468
|
return Object.assign(Object.assign({ '@global': {
|
|
4492
4469
|
':host': addImportantToEachRule(Object.assign(Object.assign({}, hostHiddenStyles), { display: 'block' })),
|
|
@@ -4503,56 +4480,77 @@ const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, theme) => {
|
|
|
4503
4480
|
WebkitAppearance: 'none',
|
|
4504
4481
|
appearance: 'none',
|
|
4505
4482
|
boxSizing: 'content-box',
|
|
4506
|
-
|
|
4507
|
-
backgroundColor: 'transparent',
|
|
4483
|
+
background: `transparent 0% 0% / ${fontLineHeight}`,
|
|
4508
4484
|
transition: ['border-color', 'background-color'].map(getTransition).join(),
|
|
4509
4485
|
border: `2px solid ${uncheckedColor}`,
|
|
4510
4486
|
outline: 0,
|
|
4511
|
-
cursor:
|
|
4487
|
+
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
4512
4488
|
}, '&(input:checked)': {
|
|
4489
|
+
// background-image is merged in later
|
|
4513
4490
|
borderColor: checkedColor,
|
|
4514
4491
|
backgroundColor: checkedColor,
|
|
4515
|
-
} }, (!
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4492
|
+
} }, (!disabledOrLoading && Object.assign(Object.assign({}, (!isHighContrastMode &&
|
|
4493
|
+
hoverMediaQuery({
|
|
4494
|
+
'&(input:hover), .text:hover ~ &(input)': {
|
|
4495
|
+
borderColor: uncheckedHoverColor,
|
|
4496
|
+
},
|
|
4497
|
+
'&(input:checked:hover), .text:hover ~ &(input:checked)': {
|
|
4498
|
+
borderColor: checkedHoverColor,
|
|
4499
|
+
backgroundColor: checkedHoverColor,
|
|
4500
|
+
},
|
|
4501
|
+
}))), (!isDisabled && {
|
|
4502
|
+
'&(input:focus)::before': Object.assign(Object.assign({ content: '""', position: 'absolute' }, getInsetJssStyle(-6)), { border: `${borderWidthBase} solid ${focusColor}` }),
|
|
4503
|
+
'&(input:focus:not(:focus-visible))::before': {
|
|
4524
4504
|
borderColor: 'transparent',
|
|
4525
|
-
}
|
|
4505
|
+
},
|
|
4506
|
+
}))))),
|
|
4526
4507
|
label: {
|
|
4527
4508
|
position: 'relative',
|
|
4528
4509
|
display: 'flex',
|
|
4529
4510
|
alignItems: 'flex-start',
|
|
4530
4511
|
},
|
|
4531
|
-
}, text: Object.assign(Object.assign(Object.assign({ order: 1, cursor:
|
|
4512
|
+
}, text: Object.assign(Object.assign(Object.assign({ order: 1, cursor: disabledOrLoading ? 'default' : 'pointer' }, textSmallStyle), { color: disabledOrLoading ? disabledColor : primaryColor, transition: getTransition('color') }), buildResponsiveStyles(hideLabel, getFormCheckboxRadioHiddenJssStyle)) }, getFunctionalComponentRequiredStyles()), getFunctionalComponentStateMessageStyles(theme, state));
|
|
4532
4513
|
};
|
|
4533
4514
|
|
|
4534
4515
|
const getInlineSVGBackgroundImage = (path) => {
|
|
4535
4516
|
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
4536
4517
|
};
|
|
4537
4518
|
|
|
4538
|
-
const getComponentCss$R = (hideLabel, state, isDisabled, theme) => {
|
|
4539
|
-
const
|
|
4540
|
-
const
|
|
4541
|
-
|
|
4542
|
-
'
|
|
4543
|
-
|
|
4519
|
+
const getComponentCss$R = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
4520
|
+
const { canvasColor } = getHighContrastColors();
|
|
4521
|
+
const checkedIconColor = isHighContrastMode
|
|
4522
|
+
? canvasColor
|
|
4523
|
+
: getInvertedThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
4524
|
+
const indeterminateIconColor = isHighContrastMode
|
|
4525
|
+
? canvasColor
|
|
4526
|
+
: getThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
4527
|
+
return getCss(mergeDeep(getCheckboxRadioJssStyle(hideLabel, state, isDisabled, isLoading, theme), Object.assign({ '@global': {
|
|
4528
|
+
'::slotted': addImportantToEachRule(Object.assign(Object.assign(Object.assign({ '&(input)': {
|
|
4544
4529
|
borderRadius: borderRadiusSmall,
|
|
4545
|
-
},
|
|
4530
|
+
} }, (!isLoading && {
|
|
4531
|
+
'&(input:checked)': {
|
|
4546
4532
|
backgroundImage: getInlineSVGBackgroundImage(`<path fill="${checkedIconColor}" d="m20.22,7.47l-1.47-1.42-9.26,9.02-4.24-4.15-1.47,1.42,5.71,5.6,10.73-10.47Z"/>`),
|
|
4547
|
-
},
|
|
4533
|
+
},
|
|
4534
|
+
})), { '&(input:indeterminate)': {
|
|
4548
4535
|
backgroundImage: getInlineSVGBackgroundImage(`<path fill="${indeterminateIconColor}" d="m20,11v2H4v-2h16Z"/>`),
|
|
4549
|
-
} }, (!isDisabled && {
|
|
4536
|
+
} }), (!isDisabled && {
|
|
4550
4537
|
'&(input:focus)::before': {
|
|
4551
4538
|
borderRadius: borderRadiusMedium,
|
|
4552
4539
|
},
|
|
4553
4540
|
}))),
|
|
4541
|
+
} }, (isLoading && {
|
|
4542
|
+
spinner: {
|
|
4543
|
+
position: 'absolute',
|
|
4544
|
+
top: `calc(${fontLineHeight}/2 + 2px)`,
|
|
4545
|
+
left: `calc(${fontLineHeight}/2 + 2px)`,
|
|
4546
|
+
transform: 'translate(-50%, -50%)',
|
|
4547
|
+
height: fontLineHeight,
|
|
4548
|
+
width: fontLineHeight,
|
|
4549
|
+
fontFamily,
|
|
4550
|
+
fontSize: '1rem',
|
|
4551
|
+
cursor: 'not-allowed',
|
|
4554
4552
|
},
|
|
4555
|
-
}));
|
|
4553
|
+
}))));
|
|
4556
4554
|
};
|
|
4557
4555
|
|
|
4558
4556
|
const widthMap = {
|
|
@@ -4581,19 +4579,33 @@ const getComponentCss$Q = (width) => {
|
|
|
4581
4579
|
});
|
|
4582
4580
|
};
|
|
4583
4581
|
|
|
4582
|
+
const crestSize = {
|
|
4583
|
+
width: 30,
|
|
4584
|
+
height: 40,
|
|
4585
|
+
};
|
|
4586
|
+
|
|
4587
|
+
const { width, height } = crestSize;
|
|
4588
|
+
const getDimensionStyle = {
|
|
4589
|
+
maxWidth: `${width}px`,
|
|
4590
|
+
maxHeight: `${height}px`,
|
|
4591
|
+
width: 'inherit',
|
|
4592
|
+
height: 'inherit',
|
|
4593
|
+
};
|
|
4584
4594
|
const getComponentCss$P = () => {
|
|
4585
4595
|
return getCss({
|
|
4586
4596
|
'@global': {
|
|
4587
|
-
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign({ outline: 0 }, hostHiddenStyles))),
|
|
4588
|
-
a: Object.assign({ display: 'block', textDecoration: 'none' }, focusPseudoJssStyle),
|
|
4597
|
+
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ outline: 0, boxSizing: 'content-box' }, getDimensionStyle), hostHiddenStyles))),
|
|
4598
|
+
a: Object.assign(Object.assign({ display: 'block', textDecoration: 'none' }, getDimensionStyle), focusPseudoJssStyle),
|
|
4589
4599
|
picture: {
|
|
4590
4600
|
display: 'block',
|
|
4591
|
-
width:
|
|
4592
|
-
height:
|
|
4601
|
+
width: `min(${width}px, 100%)`,
|
|
4602
|
+
height: `min(${height}px, 100%)`,
|
|
4593
4603
|
},
|
|
4594
4604
|
img: {
|
|
4595
4605
|
display: 'block',
|
|
4596
|
-
|
|
4606
|
+
maxWidth: '100%',
|
|
4607
|
+
maxHeight: '100%',
|
|
4608
|
+
width: 'auto',
|
|
4597
4609
|
height: 'auto',
|
|
4598
4610
|
},
|
|
4599
4611
|
},
|
|
@@ -4659,7 +4671,7 @@ const getComponentCss$N = (color, orientation, theme) => {
|
|
|
4659
4671
|
return getCss({
|
|
4660
4672
|
'@global': {
|
|
4661
4673
|
':host': Object.assign({ display: 'block' }, addImportantToEachRule(hostHiddenStyles)),
|
|
4662
|
-
hr: Object.assign({ margin: 0, padding: 0, border: 'none', textAlign: 'left', background: colorMap[color] }, buildResponsiveStyles(orientation, (o) => o === 'horizontal' ? { height: '1px', width: '100%' } : { height: '100%', width: '1px' })),
|
|
4674
|
+
hr: Object.assign({ margin: 0, padding: 0, border: 'none', textAlign: 'left', background: isHighContrastMode ? getHighContrastColors().canvasTextColor : colorMap[color] }, buildResponsiveStyles(orientation, (o) => o === 'horizontal' ? { height: '1px', width: '100%' } : { height: '100%', width: '1px' })),
|
|
4663
4675
|
},
|
|
4664
4676
|
});
|
|
4665
4677
|
};
|
|
@@ -4910,10 +4922,12 @@ const getComponentCss$E = (color, size, theme) => {
|
|
|
4910
4922
|
const isSizeInherit = size === 'inherit';
|
|
4911
4923
|
const isDark = isThemeDark(theme);
|
|
4912
4924
|
return getCss({
|
|
4913
|
-
'@global': Object.assign({ ':host': Object.assign({ display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(hostHiddenStyles)), img: Object.assign(Object.assign({ display: 'block', margin: 0, padding: 0 }, (!isColorInherit && {
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4925
|
+
'@global': Object.assign({ ':host': Object.assign({ display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(hostHiddenStyles)), img: Object.assign(Object.assign({ display: 'block', margin: 0, padding: 0 }, (!isColorInherit && Object.assign(Object.assign({ filter: filter[theme][color] }, (isHighContrastMode &&
|
|
4926
|
+
getSchemedHighContrastMediaQuery({
|
|
4927
|
+
filter: filter.light[color],
|
|
4928
|
+
}, {
|
|
4929
|
+
filter: filter.dark[color],
|
|
4930
|
+
}))), { WebkitAnimation: `${isDark ? keyFramesDark : keyFramesLight} 1ms` }))), (isSizeInherit
|
|
4917
4931
|
? {
|
|
4918
4932
|
width: size,
|
|
4919
4933
|
height: size,
|
|
@@ -4942,20 +4956,14 @@ const getBackgroundColor = (state, theme) => {
|
|
|
4942
4956
|
return colorMap[state];
|
|
4943
4957
|
};
|
|
4944
4958
|
const getNotificationRootJssStyle = (state, hasAction, hasClose, theme) => {
|
|
4945
|
-
return {
|
|
4946
|
-
display: 'grid',
|
|
4959
|
+
return Object.assign(Object.assign({ display: 'grid',
|
|
4947
4960
|
// 2 columns for content and optional close button
|
|
4948
|
-
gridTemplateColumns: `minmax(auto, 1fr)${hasClose ? ' auto' : ''}`,
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
padding: spacingStaticMedium,
|
|
4952
|
-
background: getBackgroundColor(state, theme),
|
|
4953
|
-
borderRadius: borderRadiusSmall,
|
|
4954
|
-
[mediaQueryMinS$1]: {
|
|
4961
|
+
gridTemplateColumns: `minmax(auto, 1fr)${hasClose ? ' auto' : ''}`, gap: spacingStaticMedium, placeItems: 'start', padding: spacingStaticMedium, background: getBackgroundColor(state, theme), borderRadius: borderRadiusSmall }, (isHighContrastMode && {
|
|
4962
|
+
outline: '1px solid transparent',
|
|
4963
|
+
})), { [mediaQueryMinS$1]: {
|
|
4955
4964
|
// 4 columns are for icon, content, optional action button and optional close button
|
|
4956
4965
|
gridTemplateColumns: `auto minmax(auto, 1fr)${hasAction ? ' auto' : ''}${hasClose ? ' auto' : ''}`,
|
|
4957
|
-
}
|
|
4958
|
-
};
|
|
4966
|
+
} });
|
|
4959
4967
|
};
|
|
4960
4968
|
const getNotificationIconJssStyle = () => ({
|
|
4961
4969
|
[mediaQueryMaxS$1]: {
|
|
@@ -5019,8 +5027,12 @@ const getComponentCss$C = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
5019
5027
|
|
|
5020
5028
|
const getComponentCss$B = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
5021
5029
|
const { focusColor } = getThemedColors(theme);
|
|
5022
|
-
|
|
5023
|
-
|
|
5030
|
+
const { linkColor } = getHighContrastColors();
|
|
5031
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), Object.assign({}, (hasSlottedAnchor && Object.assign(Object.assign({}, (isHighContrastMode && {
|
|
5032
|
+
root: {
|
|
5033
|
+
borderColor: linkColor,
|
|
5034
|
+
},
|
|
5035
|
+
})), { '@global': addImportantToEachRule({
|
|
5024
5036
|
'::slotted': {
|
|
5025
5037
|
'&(a)': Object.assign(Object.assign({}, getResetInitialStylesForSlottedAnchor), { outline: 0, textDecoration: 'none', font: 'inherit', color: 'inherit' }),
|
|
5026
5038
|
// The clickable area for Safari < ~15 (<= release date: 2021-10-28) is reduced to the slotted anchor itself,
|
|
@@ -5038,8 +5050,7 @@ const getComponentCss$B = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
5038
5050
|
border: 0,
|
|
5039
5051
|
},
|
|
5040
5052
|
},
|
|
5041
|
-
})
|
|
5042
|
-
}))));
|
|
5053
|
+
}) })))));
|
|
5043
5054
|
};
|
|
5044
5055
|
|
|
5045
5056
|
const LINK_TILE_MODEL_SIGNATURE_HEADING_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
@@ -5176,7 +5187,7 @@ const getComponentCss$x = (isOpen, isFullscreen, hasDismissButton, hasHeader) =>
|
|
|
5176
5187
|
transition: `opacity ${duration} ${transitionTimingFunction},transform ${duration} ${transitionTimingFunction}`,
|
|
5177
5188
|
padding: hasDismissButton ? `${pxToRemWithUnit(32)} 32px 32px 32px` : '32px',
|
|
5178
5189
|
background: backgroundColor,
|
|
5179
|
-
outline: 0,
|
|
5190
|
+
outline: isHighContrastMode ? '1px solid transparent' : 0,
|
|
5180
5191
|
'&:focus::before': Object.assign({ content: '""', position: 'fixed', border: `${borderWidthBase} solid`, pointerEvents: 'none' }, buildResponsiveStyles(isFullscreen, (fullscreenValue) => (Object.assign({ borderRadius: fullscreenValue ? 0 : '12px', borderColor: fullscreenValue ? lightThemePrimaryColor : darkThemePrimaryColor }, getInsetJssStyle(fullscreenValue ? 0 : -4))))),
|
|
5181
5192
|
'&:not(:focus-visible)::before': {
|
|
5182
5193
|
border: 0,
|
|
@@ -5198,6 +5209,8 @@ const getComponentCss$x = (isOpen, isFullscreen, hasDismissButton, hasHeader) =>
|
|
|
5198
5209
|
})));
|
|
5199
5210
|
};
|
|
5200
5211
|
|
|
5212
|
+
const modelSignatureHeight = 36;
|
|
5213
|
+
|
|
5201
5214
|
const colorToFilterMap = {
|
|
5202
5215
|
light: {
|
|
5203
5216
|
primary: filterLightPrimary,
|
|
@@ -5217,8 +5230,18 @@ const getComponentCss$w = (size, color, theme) => {
|
|
|
5217
5230
|
const isColorInherit = color === 'inherit';
|
|
5218
5231
|
return getCss({
|
|
5219
5232
|
'@global': {
|
|
5220
|
-
':host': Object.assign({ display: 'block' }, addImportantToEachRule(
|
|
5221
|
-
|
|
5233
|
+
':host': Object.assign({ display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ maxWidth: '100%', maxHeight: '100%' }, (!isSizeInherit && {
|
|
5234
|
+
width: 'inherit',
|
|
5235
|
+
height: 'inherit',
|
|
5236
|
+
// TODO: we need a width map of all signatures to ensure same fluid behavior like implemented fro crest + wordmark
|
|
5237
|
+
maxHeight: `${modelSignatureHeight}px`,
|
|
5238
|
+
})), hostHiddenStyles))),
|
|
5239
|
+
img: Object.assign(Object.assign({ display: 'block', maxWidth: '100%', maxHeight: '100%', pointerEvents: 'none' }, (!isColorInherit && Object.assign({ filter: colorToFilterMap[theme][color] }, (isHighContrastMode &&
|
|
5240
|
+
getSchemedHighContrastMediaQuery({
|
|
5241
|
+
filter: colorToFilterMap.light[color],
|
|
5242
|
+
}, {
|
|
5243
|
+
filter: colorToFilterMap.dark[color],
|
|
5244
|
+
}))))), (isSizeInherit && { height: size })),
|
|
5222
5245
|
},
|
|
5223
5246
|
});
|
|
5224
5247
|
};
|
|
@@ -5278,7 +5301,7 @@ const getComponentCss$v = (maxNumberOfPageLinks, theme) => {
|
|
|
5278
5301
|
};
|
|
5279
5302
|
|
|
5280
5303
|
const { backgroundColor: backgroundColorThemeLight, primaryColor: primaryColorThemeLight } = getThemedColors('light');
|
|
5281
|
-
const
|
|
5304
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5282
5305
|
const directionPositionMap = {
|
|
5283
5306
|
top: {
|
|
5284
5307
|
bottom: '100%',
|
|
@@ -5303,8 +5326,6 @@ const directionPositionMap = {
|
|
|
5303
5326
|
};
|
|
5304
5327
|
const borderWidth = '12px';
|
|
5305
5328
|
const transparentColor = 'transparent';
|
|
5306
|
-
const canvas = 'canvas';
|
|
5307
|
-
const canvasText = 'canvastext';
|
|
5308
5329
|
const join = (...arr) => arr.join(' ');
|
|
5309
5330
|
const directionArrowMap = {
|
|
5310
5331
|
top: {
|
|
@@ -5312,40 +5333,36 @@ const directionArrowMap = {
|
|
|
5312
5333
|
left: '50%',
|
|
5313
5334
|
transform: 'translateX(-50%)',
|
|
5314
5335
|
borderWidth: join(borderWidth, borderWidth, 0),
|
|
5315
|
-
borderColor:
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
},
|
|
5336
|
+
borderColor: isHighContrastMode
|
|
5337
|
+
? join(canvasTextColor, canvasColor, canvasColor)
|
|
5338
|
+
: join(backgroundColorThemeLight, transparentColor, transparentColor),
|
|
5319
5339
|
},
|
|
5320
5340
|
right: {
|
|
5321
5341
|
top: '50%',
|
|
5322
5342
|
right: 0,
|
|
5323
5343
|
transform: 'translateY(-50%)',
|
|
5324
5344
|
borderWidth: join(borderWidth, borderWidth, borderWidth, 0),
|
|
5325
|
-
borderColor:
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
},
|
|
5345
|
+
borderColor: isHighContrastMode
|
|
5346
|
+
? join(canvasColor, canvasTextColor, canvasColor, canvasColor)
|
|
5347
|
+
: join(transparentColor, backgroundColorThemeLight, transparentColor, transparentColor),
|
|
5329
5348
|
},
|
|
5330
5349
|
bottom: {
|
|
5331
5350
|
bottom: 0,
|
|
5332
5351
|
left: '50%',
|
|
5333
5352
|
transform: 'translateX(-50%)',
|
|
5334
5353
|
borderWidth: join(0, borderWidth, borderWidth),
|
|
5335
|
-
borderColor:
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
},
|
|
5354
|
+
borderColor: isHighContrastMode
|
|
5355
|
+
? join(canvasColor, canvasColor, canvasTextColor)
|
|
5356
|
+
: join(transparentColor, transparentColor, backgroundColorThemeLight),
|
|
5339
5357
|
},
|
|
5340
5358
|
left: {
|
|
5341
5359
|
top: '50%',
|
|
5342
5360
|
left: 0,
|
|
5343
5361
|
transform: 'translateY(-50%)',
|
|
5344
5362
|
borderWidth: join(borderWidth, 0, borderWidth, borderWidth),
|
|
5345
|
-
borderColor:
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
},
|
|
5363
|
+
borderColor: isHighContrastMode
|
|
5364
|
+
? join(canvasColor, canvasColor, canvasColor, canvasTextColor)
|
|
5365
|
+
: join(transparentColor, transparentColor, transparentColor, backgroundColorThemeLight),
|
|
5349
5366
|
},
|
|
5350
5367
|
};
|
|
5351
5368
|
const getComponentCss$u = (direction, theme) => {
|
|
@@ -5383,9 +5400,9 @@ const getComponentCss$u = (direction, theme) => {
|
|
|
5383
5400
|
,
|
|
5384
5401
|
'&::before': Object.assign({ content: '""', position: 'absolute', borderStyle: 'solid' }, directionArrowMap[direction]),
|
|
5385
5402
|
},
|
|
5386
|
-
popover: Object.assign(Object.assign(Object.assign({ position: 'absolute', maxWidth: 'min(90vw, 27rem)', width: 'max-content', boxSizing: 'border-box', background: backgroundColorThemeLight, padding: '8px 16px', pointerEvents: 'auto' }, directionPositionMap[direction]), textSmallStyle), { listStyleType: 'none', color: primaryColorThemeLight, whiteSpace: 'inherit', borderRadius: borderRadiusSmall,
|
|
5387
|
-
|
|
5388
|
-
|
|
5403
|
+
popover: Object.assign(Object.assign(Object.assign(Object.assign({ position: 'absolute', maxWidth: 'min(90vw, 27rem)', width: 'max-content', boxSizing: 'border-box', background: backgroundColorThemeLight, padding: '8px 16px', pointerEvents: 'auto' }, directionPositionMap[direction]), textSmallStyle), { listStyleType: 'none', color: primaryColorThemeLight, whiteSpace: 'inherit', borderRadius: borderRadiusSmall }), (isHighContrastMode && {
|
|
5404
|
+
outline: `1px solid ${canvasTextColor}`,
|
|
5405
|
+
})),
|
|
5389
5406
|
'@keyframes fadeIn': {
|
|
5390
5407
|
from: {
|
|
5391
5408
|
opacity: 0,
|
|
@@ -5398,8 +5415,10 @@ const getComponentCss$u = (direction, theme) => {
|
|
|
5398
5415
|
};
|
|
5399
5416
|
|
|
5400
5417
|
const getComponentCss$t = (hideLabel, state, isDisabled, theme) => {
|
|
5401
|
-
const checkedIconColor =
|
|
5402
|
-
|
|
5418
|
+
const checkedIconColor = isHighContrastMode
|
|
5419
|
+
? getHighContrastColors().canvasColor
|
|
5420
|
+
: getInvertedThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
5421
|
+
return getCss(mergeDeep(getCheckboxRadioJssStyle(hideLabel, state, isDisabled, false, theme), {
|
|
5403
5422
|
'@global': {
|
|
5404
5423
|
'::slotted': addImportantToEachRule(Object.assign({ '&(input)': {
|
|
5405
5424
|
borderRadius: '50%',
|
|
@@ -5517,10 +5536,11 @@ const ICON_SIZE = pxToRemWithUnit(24);
|
|
|
5517
5536
|
const ICON_MARGIN = pxToRemWithUnit(4);
|
|
5518
5537
|
const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
5519
5538
|
const { primaryColor, contrastMediumColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
5539
|
+
const { highlightColor } = getHighContrastColors();
|
|
5520
5540
|
return {
|
|
5521
5541
|
buttonColor: isDisabled ? disabledColor : primaryColor,
|
|
5522
5542
|
labelColor: isDisabled ? disabledColor : contrastMediumColor,
|
|
5523
|
-
borderColor: isSelected ? primaryColor : contrastLowColor,
|
|
5543
|
+
borderColor: isSelected ? (isHighContrastMode ? highlightColor : primaryColor) : contrastLowColor,
|
|
5524
5544
|
hoverBorderColor: primaryColor,
|
|
5525
5545
|
};
|
|
5526
5546
|
};
|
|
@@ -5653,6 +5673,7 @@ const getComponentCss$n = (size, theme) => {
|
|
|
5653
5673
|
const strokeDasharray = '57'; // C = 2πR
|
|
5654
5674
|
const animationDuration = 'var(--p-animation-duration, 2s)';
|
|
5655
5675
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
5676
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5656
5677
|
return getCss({
|
|
5657
5678
|
'@global': {
|
|
5658
5679
|
':host': addImportantToEachRule(Object.assign({ display: 'inline-flex', verticalAlign: 'top' }, hostHiddenStyles)),
|
|
@@ -5665,13 +5686,13 @@ const getComponentCss$n = (size, theme) => {
|
|
|
5665
5686
|
},
|
|
5666
5687
|
circle: {
|
|
5667
5688
|
'&:first-child': {
|
|
5668
|
-
stroke: contrastMediumColor,
|
|
5689
|
+
stroke: isHighContrastMode ? canvasTextColor : contrastMediumColor,
|
|
5669
5690
|
animation: `$rotate ${animationDuration} linear infinite`, // needs to rotate to eliminate stutter in safari
|
|
5670
5691
|
},
|
|
5671
5692
|
'&:last-child': {
|
|
5672
5693
|
transformOrigin: '0 0',
|
|
5673
5694
|
animation: `$dash ${animationDuration} ease-in-out infinite`,
|
|
5674
|
-
stroke: primaryColor,
|
|
5695
|
+
stroke: isHighContrastMode ? canvasColor : primaryColor,
|
|
5675
5696
|
strokeDasharray: strokeDasharray
|
|
5676
5697
|
,
|
|
5677
5698
|
strokeLinecap: 'round',
|
|
@@ -5779,17 +5800,28 @@ const getComponentCss$l = (size) => {
|
|
|
5779
5800
|
const getColors$1 = (checked, disabled, loading, theme) => {
|
|
5780
5801
|
const { primaryColor, contrastMediumColor, successColor, successColorDarken, disabledColor } = getThemedColors(theme);
|
|
5781
5802
|
const { backgroundColor: lightThemeBackgroundColor } = getThemedColors('light');
|
|
5782
|
-
const
|
|
5803
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5804
|
+
const checkedColor = isHighContrastMode ? canvasTextColor : successColor;
|
|
5783
5805
|
const disabledOrLoadingColor = isDisabledOrLoading(disabled, loading) && disabledColor;
|
|
5784
5806
|
return {
|
|
5785
5807
|
buttonBorderColor: disabledOrLoadingColor || (checked ? checkedColor : contrastMediumColor),
|
|
5786
|
-
buttonBorderColorHover: checked ? successColorDarken : primaryColor,
|
|
5808
|
+
buttonBorderColorHover: checked ? (isHighContrastMode ? primaryColor : successColorDarken) : primaryColor,
|
|
5787
5809
|
buttonBackgroundColor: checked ? disabledOrLoadingColor || checkedColor : 'transparent',
|
|
5788
|
-
buttonBackgroundColorHover: checked ? successColorDarken : 'transparent',
|
|
5810
|
+
buttonBackgroundColorHover: checked ? (isHighContrastMode ? checkedColor : successColorDarken) : 'transparent',
|
|
5789
5811
|
toggleBackgroundColor: (loading && 'transparent') ||
|
|
5790
5812
|
(disabled && !checked && disabledColor) ||
|
|
5791
|
-
(checked
|
|
5792
|
-
|
|
5813
|
+
(checked
|
|
5814
|
+
? isHighContrastMode
|
|
5815
|
+
? canvasColor
|
|
5816
|
+
: lightThemeBackgroundColor
|
|
5817
|
+
: isHighContrastMode
|
|
5818
|
+
? canvasTextColor
|
|
5819
|
+
: primaryColor),
|
|
5820
|
+
toggleBackgroundColorHover: checked
|
|
5821
|
+
? lightThemeBackgroundColor
|
|
5822
|
+
: isHighContrastMode
|
|
5823
|
+
? canvasTextColor
|
|
5824
|
+
: primaryColor,
|
|
5793
5825
|
textColor: disabledOrLoadingColor || primaryColor,
|
|
5794
5826
|
};
|
|
5795
5827
|
};
|
|
@@ -5875,11 +5907,12 @@ const getComponentCss$h = (theme) => {
|
|
|
5875
5907
|
return getCss({
|
|
5876
5908
|
'@global': {
|
|
5877
5909
|
':host': addImportantToEachRule(Object.assign(Object.assign(Object.assign({ display: 'block' }, textSmallStyle), { color: primaryColor, textAlign: 'left' }), hostHiddenStyles)),
|
|
5878
|
-
'::slotted(*)': addImportantToEachRule({
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5910
|
+
'::slotted(*)': addImportantToEachRule(Object.assign({ [cssVariableTableHoverColor]: hoverColor, [cssVariableTableBorderColor]: contrastLowColor, [cssVariableTableHeadCellIconFilter]: isThemeDark(theme) ? 'invert(100%)' : 'none' }, (isHighContrastMode &&
|
|
5911
|
+
getSchemedHighContrastMediaQuery({
|
|
5912
|
+
[cssVariableTableHeadCellIconFilter]: 'none',
|
|
5913
|
+
}, {
|
|
5914
|
+
[cssVariableTableHeadCellIconFilter]: 'invert(100%)',
|
|
5915
|
+
})))),
|
|
5883
5916
|
},
|
|
5884
5917
|
caption: {
|
|
5885
5918
|
marginBottom: spacingFluidMedium,
|
|
@@ -5994,10 +6027,10 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
5994
6027
|
display: 'block',
|
|
5995
6028
|
position: 'absolute',
|
|
5996
6029
|
width: 0,
|
|
5997
|
-
height: weight === 'semi-bold' ? '2px' : '1.5px',
|
|
6030
|
+
height: isHighContrastMode ? '4px' : weight === 'semi-bold' ? '2px' : '1.5px',
|
|
5998
6031
|
left: 0,
|
|
5999
|
-
bottom: '-4px',
|
|
6000
|
-
background: primaryColor,
|
|
6032
|
+
bottom: isHighContrastMode ? '-1px' : '-4px',
|
|
6033
|
+
background: isHighContrastMode ? getHighContrastColors().canvasTextColor : primaryColor,
|
|
6001
6034
|
'&--enable-transition': {
|
|
6002
6035
|
willChange: 'width',
|
|
6003
6036
|
transition: `transform ${tabsTransitionDuration},width ${tabsTransitionDuration}`,
|
|
@@ -6058,7 +6091,7 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
6058
6091
|
const backgroundColor = getThemedBackgroundColor(color, themedColors);
|
|
6059
6092
|
return getCss(Object.assign(Object.assign({ '@global': {
|
|
6060
6093
|
':host': addImportantToEachRule(Object.assign({ display: 'inline-block', verticalAlign: 'top', outline: 0 }, hostHiddenStyles)),
|
|
6061
|
-
button: Object.assign(Object.assign(Object.assign(Object.assign({ display: 'flex', position: 'relative', alignItems: 'center', gap: '12px', minHeight: '54px', padding: '4px 0 4px 12px', borderRadius: borderRadiusSmall, border: 0, cursor: 'pointer', background: backgroundColor, color: primaryColor, textAlign: 'left' }, textSmallStyle), { outline: 0 }), getTagFocusJssStyle(themedColors)), hoverMediaQuery({
|
|
6094
|
+
button: Object.assign(Object.assign(Object.assign(Object.assign({ display: 'flex', position: 'relative', alignItems: 'center', gap: '12px', minHeight: '54px', padding: '4px 0 4px 12px', borderRadius: borderRadiusSmall, border: 0, cursor: 'pointer', background: backgroundColor, color: primaryColor, textAlign: 'left' }, textSmallStyle), { outline: isHighContrastMode ? '1px solid transparent' : 0 }), getTagFocusJssStyle(themedColors)), hoverMediaQuery({
|
|
6062
6095
|
'&:hover > .icon': {
|
|
6063
6096
|
backgroundColor: hoverColor,
|
|
6064
6097
|
},
|
|
@@ -6108,7 +6141,9 @@ const getComponentCss$8 = (tagColor, isFocusable, theme) => {
|
|
|
6108
6141
|
return getCss({
|
|
6109
6142
|
'@global': {
|
|
6110
6143
|
':host': Object.assign({ display: 'inline-flex', verticalAlign: 'top' }, addImportantToEachRule(hostHiddenStyles)),
|
|
6111
|
-
span: Object.assign({ display: 'flex', gap: '2px', alignItems: 'center', position: 'relative', padding: '4px 9px', borderRadius: borderRadiusSmall, background: backgroundColor, color: primaryColor, font: textXSmallStyle.font, whiteSpace: 'nowrap' }, (
|
|
6144
|
+
span: Object.assign(Object.assign({ display: 'flex', gap: '2px', alignItems: 'center', position: 'relative', padding: '4px 9px', borderRadius: borderRadiusSmall, background: backgroundColor, color: primaryColor, font: textXSmallStyle.font, whiteSpace: 'nowrap' }, (isHighContrastMode && {
|
|
6145
|
+
outline: '1px solid transparent',
|
|
6146
|
+
})), (isFocusable &&
|
|
6112
6147
|
hoverMediaQuery({
|
|
6113
6148
|
transition: getTransition('background-color'),
|
|
6114
6149
|
'&:hover': {
|
|
@@ -6352,12 +6387,16 @@ const getComponentCss$1 = () => {
|
|
|
6352
6387
|
const getComponentCss = (size, theme) => {
|
|
6353
6388
|
return getCss({
|
|
6354
6389
|
'@global': {
|
|
6355
|
-
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ outline: 0, boxSizing: 'content-box' }, (!(size === 'inherit') && { height: 'clamp(0.63rem, 0.42vw + 0.5rem, 1rem)' })), hostHiddenStyles))),
|
|
6356
|
-
a
|
|
6357
|
-
svg: {
|
|
6390
|
+
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ outline: 0, maxWidth: '100%', maxHeight: '100%', boxSizing: 'content-box' }, (!(size === 'inherit') && { height: 'clamp(0.63rem, 0.42vw + 0.5rem, 1rem)' })), hostHiddenStyles))),
|
|
6391
|
+
'a, svg': {
|
|
6358
6392
|
display: 'block',
|
|
6393
|
+
maxWidth: '100%',
|
|
6394
|
+
maxHeight: '100%',
|
|
6359
6395
|
height: 'inherit',
|
|
6360
|
-
|
|
6396
|
+
},
|
|
6397
|
+
a: Object.assign({ textDecoration: 'none' }, focusPseudoJssStyle),
|
|
6398
|
+
svg: {
|
|
6399
|
+
fill: isHighContrastMode ? getHighContrastColors().canvasTextColor : getThemedColors(theme).primaryColor,
|
|
6361
6400
|
},
|
|
6362
6401
|
},
|
|
6363
6402
|
});
|