@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
|
@@ -6,6 +6,8 @@ const isDisabledOrLoading = (disabled, loading) => {
|
|
|
6
6
|
|
|
7
7
|
const hasWindow = typeof window !== 'undefined';
|
|
8
8
|
|
|
9
|
+
const isHighContrastMode = hasWindow && window.matchMedia && matchMedia('(forced-colors: active)').matches;
|
|
10
|
+
|
|
9
11
|
const attributeMutationMap = new Map();
|
|
10
12
|
hasWindow &&
|
|
11
13
|
new MutationObserver((mutations) => {
|
|
@@ -41,6 +43,8 @@ const borderRadiusSmall = '4px';
|
|
|
41
43
|
|
|
42
44
|
const borderRadiusMedium = '8px';
|
|
43
45
|
|
|
46
|
+
const borderRadiusLarge = '12px';
|
|
47
|
+
|
|
44
48
|
const borderWidthBase = '2px';
|
|
45
49
|
|
|
46
50
|
const _dropShadowBackgroundColor = 'rgba(0, 0, 0, 0.16)';
|
|
@@ -107,12 +111,6 @@ const fontWeightSemiBold = 600;
|
|
|
107
111
|
|
|
108
112
|
const fontWeightBold = 700;
|
|
109
113
|
|
|
110
|
-
const fontWeight = {
|
|
111
|
-
regular: fontWeightRegular,
|
|
112
|
-
semiBold: fontWeightSemiBold,
|
|
113
|
-
bold: fontWeightBold,
|
|
114
|
-
};
|
|
115
|
-
|
|
116
114
|
const fontStyleNormal = 'normal';
|
|
117
115
|
|
|
118
116
|
const fontVariant = 'normal';
|
|
@@ -520,25 +518,6 @@ var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symb
|
|
|
520
518
|
|
|
521
519
|
var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof$1(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof$1(document)) === 'object' && document.nodeType === 9;
|
|
522
520
|
|
|
523
|
-
var isProduction = process.env.NODE_ENV === 'production';
|
|
524
|
-
function warning(condition, message) {
|
|
525
|
-
if (!isProduction) {
|
|
526
|
-
if (condition) {
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
var text = "Warning: " + message;
|
|
531
|
-
|
|
532
|
-
if (typeof console !== 'undefined') {
|
|
533
|
-
console.warn(text);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
try {
|
|
537
|
-
throw Error(text);
|
|
538
|
-
} catch (x) {}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
521
|
function _typeof(obj) {
|
|
543
522
|
"@babel/helpers - typeof";
|
|
544
523
|
|
|
@@ -645,9 +624,7 @@ function createRule(name, decl, options) {
|
|
|
645
624
|
var rule = jss.plugins.onCreateRule(name, declCopy, options);
|
|
646
625
|
if (rule) return rule; // It is an at-rule and it has no instance.
|
|
647
626
|
|
|
648
|
-
if (name[0] === '@')
|
|
649
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Unknown rule " + name) : void 0;
|
|
650
|
-
}
|
|
627
|
+
if (name[0] === '@') ;
|
|
651
628
|
|
|
652
629
|
return null;
|
|
653
630
|
}
|
|
@@ -848,9 +825,7 @@ function () {
|
|
|
848
825
|
|
|
849
826
|
var sheet = this.options.sheet;
|
|
850
827
|
|
|
851
|
-
if (sheet && sheet.attached)
|
|
852
|
-
process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Rule is not linked. Missing sheet option "link: true".') : void 0;
|
|
853
|
-
}
|
|
828
|
+
if (sheet && sheet.attached) ;
|
|
854
829
|
|
|
855
830
|
return this;
|
|
856
831
|
};
|
|
@@ -1096,7 +1071,6 @@ function () {
|
|
|
1096
1071
|
this.name = nameMatch[1];
|
|
1097
1072
|
} else {
|
|
1098
1073
|
this.name = 'noname';
|
|
1099
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Bad keyframes name " + key) : void 0;
|
|
1100
1074
|
}
|
|
1101
1075
|
|
|
1102
1076
|
this.key = this.type + "-" + this.name;
|
|
@@ -1155,8 +1129,6 @@ var findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {
|
|
|
1155
1129
|
if (name in keyframes) {
|
|
1156
1130
|
return keyframes[name];
|
|
1157
1131
|
}
|
|
1158
|
-
|
|
1159
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Referenced keyframes rule \"" + name + "\" is not defined.") : void 0;
|
|
1160
1132
|
return match;
|
|
1161
1133
|
});
|
|
1162
1134
|
}
|
|
@@ -1981,8 +1953,6 @@ function () {
|
|
|
1981
1953
|
for (var name in plugin) {
|
|
1982
1954
|
if (name in registry) {
|
|
1983
1955
|
registry[name].push(plugin[name]);
|
|
1984
|
-
} else {
|
|
1985
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Unknown hook \"" + name + "\".") : void 0;
|
|
1986
1956
|
}
|
|
1987
1957
|
}
|
|
1988
1958
|
|
|
@@ -2124,8 +2094,6 @@ if (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multip
|
|
|
2124
2094
|
// the module.
|
|
2125
2095
|
|
|
2126
2096
|
var moduleId = globalThis$1[ns]++;
|
|
2127
|
-
|
|
2128
|
-
var maxRules = 1e10;
|
|
2129
2097
|
/**
|
|
2130
2098
|
* Returns a function which generates unique class names based on counters.
|
|
2131
2099
|
* When new generator function is created, rule counter is reseted.
|
|
@@ -2142,10 +2110,6 @@ var createGenerateId = function createGenerateId(options) {
|
|
|
2142
2110
|
var generateId = function generateId(rule, sheet) {
|
|
2143
2111
|
ruleCounter += 1;
|
|
2144
2112
|
|
|
2145
|
-
if (ruleCounter > maxRules) {
|
|
2146
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] You might have a memory leak. Rule counter is at " + ruleCounter + ".") : void 0;
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
2113
|
var jssId = '';
|
|
2150
2114
|
var prefix = '';
|
|
2151
2115
|
|
|
@@ -2241,7 +2205,6 @@ var removeProperty = function removeProperty(cssRule, prop) {
|
|
|
2241
2205
|
cssRule.style.removeProperty(prop);
|
|
2242
2206
|
}
|
|
2243
2207
|
} catch (err) {
|
|
2244
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] DOMException \"" + err.message + "\" was thrown. Tried to remove property \"" + prop + "\".") : void 0;
|
|
2245
2208
|
}
|
|
2246
2209
|
};
|
|
2247
2210
|
/**
|
|
@@ -2355,10 +2318,6 @@ function findPrevNode(options) {
|
|
|
2355
2318
|
node: comment.nextSibling
|
|
2356
2319
|
};
|
|
2357
2320
|
} // If user specifies an insertion point and it can't be found in the document -
|
|
2358
|
-
// bad specificity issues may appear.
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Insertion point \"" + insertionPoint + "\" not found.") : void 0;
|
|
2362
2321
|
}
|
|
2363
2322
|
|
|
2364
2323
|
return false;
|
|
@@ -2381,7 +2340,7 @@ function insertStyle(style, options) {
|
|
|
2381
2340
|
if (insertionPoint && typeof insertionPoint.nodeType === 'number') {
|
|
2382
2341
|
var insertionPointElement = insertionPoint;
|
|
2383
2342
|
var parentNode = insertionPointElement.parentNode;
|
|
2384
|
-
if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);
|
|
2343
|
+
if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);
|
|
2385
2344
|
return;
|
|
2386
2345
|
}
|
|
2387
2346
|
|
|
@@ -2406,7 +2365,6 @@ var _insertRule = function insertRule(container, rule, index) {
|
|
|
2406
2365
|
container.appendRule(rule);
|
|
2407
2366
|
}
|
|
2408
2367
|
} catch (err) {
|
|
2409
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] " + err.message) : void 0;
|
|
2410
2368
|
return false;
|
|
2411
2369
|
}
|
|
2412
2370
|
|
|
@@ -2827,8 +2785,6 @@ function () {
|
|
|
2827
2785
|
entry.refs++;
|
|
2828
2786
|
return entry.sheet;
|
|
2829
2787
|
}
|
|
2830
|
-
|
|
2831
|
-
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
|
|
2832
2788
|
return undefined;
|
|
2833
2789
|
};
|
|
2834
2790
|
|
|
@@ -2840,8 +2796,6 @@ function () {
|
|
|
2840
2796
|
entry.refs--;
|
|
2841
2797
|
if (entry.refs === 0) entry.sheet.detach();
|
|
2842
2798
|
}
|
|
2843
|
-
} else {
|
|
2844
|
-
warning(false, "SheetsManager: can't find sheet to unmanage");
|
|
2845
2799
|
}
|
|
2846
2800
|
};
|
|
2847
2801
|
|
|
@@ -3183,8 +3137,6 @@ function jssNested() {
|
|
|
3183
3137
|
if (rule) {
|
|
3184
3138
|
return rule.selector;
|
|
3185
3139
|
}
|
|
3186
|
-
|
|
3187
|
-
process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Could not find the referenced rule \"" + key + "\" in \"" + (container.options.meta || container.toString()) + "\".") : void 0;
|
|
3188
3140
|
return key;
|
|
3189
3141
|
};
|
|
3190
3142
|
}
|
|
@@ -3779,8 +3731,21 @@ const themes = {
|
|
|
3779
3731
|
'dark': themeDark
|
|
3780
3732
|
};
|
|
3781
3733
|
/* Auto Generated End */
|
|
3734
|
+
const schemeHighContrastMerged = {
|
|
3735
|
+
disabledColor: 'GrayText',
|
|
3736
|
+
focusColor: 'Highlight',
|
|
3737
|
+
};
|
|
3738
|
+
const schemeHighContrast = {
|
|
3739
|
+
canvasColor: 'Canvas',
|
|
3740
|
+
canvasTextColor: 'CanvasText',
|
|
3741
|
+
highlightColor: 'Highlight',
|
|
3742
|
+
linkColor: 'LinkText',
|
|
3743
|
+
};
|
|
3782
3744
|
const getThemedColors = (theme) => {
|
|
3783
|
-
return themes[theme];
|
|
3745
|
+
return isHighContrastMode ? Object.assign(Object.assign({}, themes[theme]), schemeHighContrastMerged) : themes[theme];
|
|
3746
|
+
};
|
|
3747
|
+
const getHighContrastColors = () => {
|
|
3748
|
+
return schemeHighContrast;
|
|
3784
3749
|
};
|
|
3785
3750
|
const getInvertedThemedColors = (theme) => {
|
|
3786
3751
|
return getThemedColors(isThemeDark(theme) ? 'light' : 'dark');
|
|
@@ -3878,6 +3843,13 @@ const hoverMediaQuery = (style) =>
|
|
|
3878
3843
|
({ '@media(hover:hover)': style }) // used for prod build, yarn start and unit tests
|
|
3879
3844
|
; // used for staging build in e2e and vrt tests
|
|
3880
3845
|
|
|
3846
|
+
const getSchemedHighContrastMediaQuery = (light, dark) => {
|
|
3847
|
+
return {
|
|
3848
|
+
'@media (forced-colors: active) and (prefers-color-scheme: light)': light,
|
|
3849
|
+
'@media (forced-colors: active) and (prefers-color-scheme: dark)': dark,
|
|
3850
|
+
};
|
|
3851
|
+
};
|
|
3852
|
+
|
|
3881
3853
|
// NOTE: handpicked selection of plugins from jss-preset-default
|
|
3882
3854
|
const jss = createJss({
|
|
3883
3855
|
plugins: [
|
|
@@ -3955,14 +3927,14 @@ const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
|
3955
3927
|
|
|
3956
3928
|
const getComponentCss$Y = (size, compact, open, theme) => {
|
|
3957
3929
|
const { primaryColor, hoverColor, focusColor, contrastLowColor } = getThemedColors(theme);
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
':host': addImportantToEachRule(Object.assign({ display: 'block' },
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
fontSize:
|
|
3965
|
-
padding: compact ? '4px
|
|
3930
|
+
return getCss({
|
|
3931
|
+
'@global': {
|
|
3932
|
+
':host': addImportantToEachRule(Object.assign(Object.assign({ display: 'block' }, (!compact && {
|
|
3933
|
+
borderBottom: `1px solid ${contrastLowColor}`,
|
|
3934
|
+
})), hostHiddenStyles)),
|
|
3935
|
+
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) => ({
|
|
3936
|
+
fontSize: s === 'medium' ? fontSizeTextMedium : fontSizeTextSmall,
|
|
3937
|
+
padding: `${compact ? '4px' : s === 'medium' ? '20px' : '12px'} 0`,
|
|
3966
3938
|
}))), mergeDeep({
|
|
3967
3939
|
'&::before': Object.assign({ content: '""', position: 'absolute', borderRadius: borderRadiusSmall, left: '-4px', right: '-4px' }, (compact
|
|
3968
3940
|
? {
|
|
@@ -3985,41 +3957,37 @@ const getComponentCss$Y = (size, compact, open, theme) => {
|
|
|
3985
3957
|
}, '&:not(:focus-visible)::before': {
|
|
3986
3958
|
border: 0,
|
|
3987
3959
|
} }),
|
|
3988
|
-
} }, (!compact && {
|
|
3989
|
-
root: {
|
|
3990
|
-
borderBottom: border,
|
|
3991
3960
|
},
|
|
3992
|
-
|
|
3961
|
+
heading: {
|
|
3993
3962
|
margin: 0,
|
|
3994
|
-
padding: 0,
|
|
3995
|
-
},
|
|
3963
|
+
padding: '0 0 2px',
|
|
3964
|
+
},
|
|
3965
|
+
icon: {
|
|
3996
3966
|
width: fontLineHeight,
|
|
3997
3967
|
height: fontLineHeight,
|
|
3998
|
-
transformOrigin: '50% 50%',
|
|
3999
3968
|
transform: open ? 'rotate3d(0)' : 'rotate3d(0,0,1,90deg)',
|
|
4000
3969
|
transition: getTransition('transform'),
|
|
4001
|
-
},
|
|
3970
|
+
},
|
|
3971
|
+
collapsible: Object.assign({ color: primaryColor, overflow: 'hidden' }, (open
|
|
4002
3972
|
? {
|
|
4003
3973
|
height: 'auto',
|
|
4004
3974
|
paddingBottom: compact ? spacingStaticSmall : '24px',
|
|
4005
3975
|
visibility: 'visible',
|
|
4006
|
-
transition: getTransition('height') +
|
|
4007
|
-
animation: `$open ${transitionDuration}
|
|
3976
|
+
transition: getTransition('height') + ',' + getTransition('padding-bottom'),
|
|
3977
|
+
animation: `$open 0s ${transitionDuration} forwards`, // delay overflow change and have `overflow: visible` after transition
|
|
4008
3978
|
}
|
|
4009
3979
|
: {
|
|
4010
3980
|
height: 0,
|
|
4011
3981
|
visibility: 'hidden',
|
|
4012
|
-
transition: getTransition('height') + `,visibility
|
|
4013
|
-
})),
|
|
3982
|
+
transition: getTransition('height') + `,visibility 0s linear ${transitionDuration}`,
|
|
3983
|
+
})),
|
|
4014
3984
|
// TODO: this doesn't get shortened and results in `keyframes-open` for some unknown reason
|
|
4015
3985
|
'@keyframes open': {
|
|
4016
|
-
|
|
4017
|
-
overflow: 'hidden',
|
|
4018
|
-
},
|
|
4019
|
-
'100%': {
|
|
3986
|
+
to: {
|
|
4020
3987
|
overflow: 'visible',
|
|
4021
3988
|
},
|
|
4022
|
-
}
|
|
3989
|
+
},
|
|
3990
|
+
});
|
|
4023
3991
|
};
|
|
4024
3992
|
|
|
4025
3993
|
const TOAST_Z_INDEX = 999999;
|
|
@@ -4210,7 +4178,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4210
4178
|
},
|
|
4211
4179
|
},
|
|
4212
4180
|
})),
|
|
4213
|
-
root: Object.assign(Object.assign({ position: 'relative',
|
|
4181
|
+
root: Object.assign(Object.assign({ position: 'relative', overflow: 'hidden', transform: 'translate3d(0,0,0)', borderRadius: borderRadiusLarge, color: getThemedTypographyColor('dark', 'primary') }, buildResponsiveStyles(aspectRatio, (ratio) => ({
|
|
4214
4182
|
paddingTop: aspectRatioPaddingMap[ratio],
|
|
4215
4183
|
}))), (!isDisabled &&
|
|
4216
4184
|
hoverMediaQuery({
|
|
@@ -4226,7 +4194,7 @@ const getTileBaseStyles = (aspectRatio, isDisabled) => {
|
|
|
4226
4194
|
display: 'flex',
|
|
4227
4195
|
justifyItems: 'start',
|
|
4228
4196
|
gap: spacingStaticMedium,
|
|
4229
|
-
borderRadius:
|
|
4197
|
+
borderRadius: borderRadiusLarge,
|
|
4230
4198
|
'@media (forced-colors: active)': {
|
|
4231
4199
|
background: 'rgba(0,0,0,0.7)',
|
|
4232
4200
|
},
|
|
@@ -4273,6 +4241,7 @@ const { primaryColor: darkThemePrimaryColor$1 } = getThemedColors('dark');
|
|
|
4273
4241
|
const { primaryColor: lightThemePrimaryColor$1 } = getThemedColors('light');
|
|
4274
4242
|
const getVariantColors = (variant, theme) => {
|
|
4275
4243
|
const { primaryColor, contrastHighColor, contrastMediumColor, hoverColor } = getThemedColors(theme);
|
|
4244
|
+
const { canvasColor } = getHighContrastColors();
|
|
4276
4245
|
const colors = {
|
|
4277
4246
|
primary: {
|
|
4278
4247
|
textColor: theme === 'dark' ? lightThemePrimaryColor$1 : darkThemePrimaryColor$1,
|
|
@@ -4285,7 +4254,7 @@ const getVariantColors = (variant, theme) => {
|
|
|
4285
4254
|
textColor: primaryColor,
|
|
4286
4255
|
borderColor: primaryColor,
|
|
4287
4256
|
borderColorHover: contrastMediumColor,
|
|
4288
|
-
backgroundColor: 'transparent',
|
|
4257
|
+
backgroundColor: isHighContrastMode ? canvasColor : 'transparent',
|
|
4289
4258
|
backgroundColorHover: hoverColor,
|
|
4290
4259
|
},
|
|
4291
4260
|
};
|
|
@@ -4309,7 +4278,7 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4309
4278
|
},
|
|
4310
4279
|
})), (!isDisabledOrLoading &&
|
|
4311
4280
|
hoverMediaQuery({
|
|
4312
|
-
'&:hover': Object.assign({ backgroundColor: backgroundColorHover, borderColor: borderColorHover }, (!isPrimary && frostedGlassStyle)),
|
|
4281
|
+
'&:hover': Object.assign({ backgroundColor: backgroundColorHover, borderColor: isHighContrastMode ? focusColor : borderColorHover }, (!isPrimary && frostedGlassStyle)),
|
|
4313
4282
|
}))), label: Object.assign({}, buildResponsiveStyles(hideLabel, (hideLabelValue) => hideLabelValue
|
|
4314
4283
|
? {
|
|
4315
4284
|
width: 0,
|
|
@@ -4330,16 +4299,17 @@ const getLinkButtonStyles = (icon, iconSource, variant, hideLabel, isDisabledOrL
|
|
|
4330
4299
|
|
|
4331
4300
|
const getDisabledColors = (variant, loading, theme) => {
|
|
4332
4301
|
const { contrastMediumColor, contrastHighColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
4302
|
+
const { canvasColor } = getHighContrastColors();
|
|
4333
4303
|
const colors = {
|
|
4334
4304
|
primary: {
|
|
4335
|
-
textColor: contrastHighColor,
|
|
4336
|
-
borderColor: loading ? contrastHighColor : disabledColor,
|
|
4337
|
-
backgroundColor: loading ? contrastHighColor : disabledColor,
|
|
4305
|
+
textColor: isHighContrastMode ? disabledColor : contrastHighColor,
|
|
4306
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? contrastHighColor : disabledColor,
|
|
4307
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? contrastHighColor : disabledColor,
|
|
4338
4308
|
},
|
|
4339
4309
|
secondary: {
|
|
4340
4310
|
textColor: disabledColor,
|
|
4341
|
-
borderColor: loading ? contrastMediumColor : disabledColor,
|
|
4342
|
-
backgroundColor: loading ? hoverColor : 'transparent',
|
|
4311
|
+
borderColor: isHighContrastMode ? disabledColor : loading ? contrastMediumColor : disabledColor,
|
|
4312
|
+
backgroundColor: isHighContrastMode ? canvasColor : loading ? hoverColor : 'transparent',
|
|
4343
4313
|
},
|
|
4344
4314
|
};
|
|
4345
4315
|
return colors[variant === 'tertiary' ? 'secondary' : variant];
|
|
@@ -4385,6 +4355,7 @@ const spacingMap = {
|
|
|
4385
4355
|
};
|
|
4386
4356
|
const getComponentCss$S = (width, hasPagination, alignHeader, theme) => {
|
|
4387
4357
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
4358
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
4388
4359
|
const isHeaderAlignCenter = alignHeader === 'center';
|
|
4389
4360
|
return getCss(Object.assign({ '@global': {
|
|
4390
4361
|
':host': addImportantToEachRule(Object.assign({ display: 'flex', gap: spacingFluidMedium, flexDirection: 'column', boxSizing: 'content-box' }, hostHiddenStyles)),
|
|
@@ -4448,14 +4419,14 @@ const getComponentCss$S = (width, hasPagination, alignHeader, theme) => {
|
|
|
4448
4419
|
}))), { justifyContent: 'center', gap: spacingStaticSmall }),
|
|
4449
4420
|
bullet: {
|
|
4450
4421
|
borderRadius: borderRadiusSmall,
|
|
4451
|
-
background: contrastMediumColor,
|
|
4422
|
+
background: isHighContrastMode ? canvasTextColor : contrastMediumColor,
|
|
4452
4423
|
// set transition to have the same speed as switching slides in splide
|
|
4453
4424
|
transition: `background-color ${carouselTransitionDuration}ms, width ${carouselTransitionDuration}ms`,
|
|
4454
4425
|
width: '8px',
|
|
4455
4426
|
height: '8px',
|
|
4456
4427
|
},
|
|
4457
4428
|
[bulletActiveClass]: {
|
|
4458
|
-
background: primaryColor,
|
|
4429
|
+
background: isHighContrastMode ? canvasTextColor : primaryColor,
|
|
4459
4430
|
width: '20px',
|
|
4460
4431
|
},
|
|
4461
4432
|
})));
|
|
@@ -4483,12 +4454,18 @@ const getFunctionalComponentStateMessageStyles = (theme, state) => {
|
|
|
4483
4454
|
};
|
|
4484
4455
|
};
|
|
4485
4456
|
|
|
4486
|
-
const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, theme) => {
|
|
4457
|
+
const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
4487
4458
|
const { primaryColor, contrastMediumColor, contrastHighColor, disabledColor, focusColor } = getThemedColors(theme);
|
|
4488
4459
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
4489
|
-
const
|
|
4460
|
+
const { canvasTextColor } = getHighContrastColors();
|
|
4461
|
+
const disabledOrLoading = isDisabledOrLoading(isDisabled, isLoading);
|
|
4462
|
+
const uncheckedColor = disabledOrLoading ? disabledColor : formStateColor || contrastMediumColor;
|
|
4490
4463
|
const uncheckedHoverColor = formStateHoverColor || primaryColor;
|
|
4491
|
-
const checkedColor =
|
|
4464
|
+
const checkedColor = isHighContrastMode
|
|
4465
|
+
? canvasTextColor
|
|
4466
|
+
: disabledOrLoading
|
|
4467
|
+
? disabledColor
|
|
4468
|
+
: formStateColor || primaryColor;
|
|
4492
4469
|
const checkedHoverColor = formStateHoverColor || contrastHighColor;
|
|
4493
4470
|
return Object.assign(Object.assign({ '@global': {
|
|
4494
4471
|
':host': addImportantToEachRule(Object.assign(Object.assign({}, hostHiddenStyles), { display: 'block' })),
|
|
@@ -4505,56 +4482,77 @@ const getCheckboxRadioJssStyle = (hideLabel, state, isDisabled, theme) => {
|
|
|
4505
4482
|
WebkitAppearance: 'none',
|
|
4506
4483
|
appearance: 'none',
|
|
4507
4484
|
boxSizing: 'content-box',
|
|
4508
|
-
|
|
4509
|
-
backgroundColor: 'transparent',
|
|
4485
|
+
background: `transparent 0% 0% / ${fontLineHeight}`,
|
|
4510
4486
|
transition: ['border-color', 'background-color'].map(getTransition).join(),
|
|
4511
4487
|
border: `2px solid ${uncheckedColor}`,
|
|
4512
4488
|
outline: 0,
|
|
4513
|
-
cursor:
|
|
4489
|
+
cursor: disabledOrLoading ? 'not-allowed' : 'pointer',
|
|
4514
4490
|
}, '&(input:checked)': {
|
|
4491
|
+
// background-image is merged in later
|
|
4515
4492
|
borderColor: checkedColor,
|
|
4516
4493
|
backgroundColor: checkedColor,
|
|
4517
|
-
} }, (!
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4494
|
+
} }, (!disabledOrLoading && Object.assign(Object.assign({}, (!isHighContrastMode &&
|
|
4495
|
+
hoverMediaQuery({
|
|
4496
|
+
'&(input:hover), .text:hover ~ &(input)': {
|
|
4497
|
+
borderColor: uncheckedHoverColor,
|
|
4498
|
+
},
|
|
4499
|
+
'&(input:checked:hover), .text:hover ~ &(input:checked)': {
|
|
4500
|
+
borderColor: checkedHoverColor,
|
|
4501
|
+
backgroundColor: checkedHoverColor,
|
|
4502
|
+
},
|
|
4503
|
+
}))), (!isDisabled && {
|
|
4504
|
+
'&(input:focus)::before': Object.assign(Object.assign({ content: '""', position: 'absolute' }, getInsetJssStyle(-6)), { border: `${borderWidthBase} solid ${focusColor}` }),
|
|
4505
|
+
'&(input:focus:not(:focus-visible))::before': {
|
|
4526
4506
|
borderColor: 'transparent',
|
|
4527
|
-
}
|
|
4507
|
+
},
|
|
4508
|
+
}))))),
|
|
4528
4509
|
label: {
|
|
4529
4510
|
position: 'relative',
|
|
4530
4511
|
display: 'flex',
|
|
4531
4512
|
alignItems: 'flex-start',
|
|
4532
4513
|
},
|
|
4533
|
-
}, text: Object.assign(Object.assign(Object.assign({ order: 1, cursor:
|
|
4514
|
+
}, 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));
|
|
4534
4515
|
};
|
|
4535
4516
|
|
|
4536
4517
|
const getInlineSVGBackgroundImage = (path) => {
|
|
4537
4518
|
return `url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${path}</svg>')`;
|
|
4538
4519
|
};
|
|
4539
4520
|
|
|
4540
|
-
const getComponentCss$R = (hideLabel, state, isDisabled, theme) => {
|
|
4541
|
-
const
|
|
4542
|
-
const
|
|
4543
|
-
|
|
4544
|
-
'
|
|
4545
|
-
|
|
4521
|
+
const getComponentCss$R = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
4522
|
+
const { canvasColor } = getHighContrastColors();
|
|
4523
|
+
const checkedIconColor = isHighContrastMode
|
|
4524
|
+
? canvasColor
|
|
4525
|
+
: getInvertedThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
4526
|
+
const indeterminateIconColor = isHighContrastMode
|
|
4527
|
+
? canvasColor
|
|
4528
|
+
: getThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
4529
|
+
return getCss(mergeDeep(getCheckboxRadioJssStyle(hideLabel, state, isDisabled, isLoading, theme), Object.assign({ '@global': {
|
|
4530
|
+
'::slotted': addImportantToEachRule(Object.assign(Object.assign(Object.assign({ '&(input)': {
|
|
4546
4531
|
borderRadius: borderRadiusSmall,
|
|
4547
|
-
},
|
|
4532
|
+
} }, (!isLoading && {
|
|
4533
|
+
'&(input:checked)': {
|
|
4548
4534
|
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"/>`),
|
|
4549
|
-
},
|
|
4535
|
+
},
|
|
4536
|
+
})), { '&(input:indeterminate)': {
|
|
4550
4537
|
backgroundImage: getInlineSVGBackgroundImage(`<path fill="${indeterminateIconColor}" d="m20,11v2H4v-2h16Z"/>`),
|
|
4551
|
-
} }, (!isDisabled && {
|
|
4538
|
+
} }), (!isDisabled && {
|
|
4552
4539
|
'&(input:focus)::before': {
|
|
4553
4540
|
borderRadius: borderRadiusMedium,
|
|
4554
4541
|
},
|
|
4555
4542
|
}))),
|
|
4543
|
+
} }, (isLoading && {
|
|
4544
|
+
spinner: {
|
|
4545
|
+
position: 'absolute',
|
|
4546
|
+
top: `calc(${fontLineHeight}/2 + 2px)`,
|
|
4547
|
+
left: `calc(${fontLineHeight}/2 + 2px)`,
|
|
4548
|
+
transform: 'translate(-50%, -50%)',
|
|
4549
|
+
height: fontLineHeight,
|
|
4550
|
+
width: fontLineHeight,
|
|
4551
|
+
fontFamily,
|
|
4552
|
+
fontSize: '1rem',
|
|
4553
|
+
cursor: 'not-allowed',
|
|
4556
4554
|
},
|
|
4557
|
-
}));
|
|
4555
|
+
}))));
|
|
4558
4556
|
};
|
|
4559
4557
|
|
|
4560
4558
|
const widthMap = {
|
|
@@ -4583,19 +4581,33 @@ const getComponentCss$Q = (width) => {
|
|
|
4583
4581
|
});
|
|
4584
4582
|
};
|
|
4585
4583
|
|
|
4584
|
+
const crestSize = {
|
|
4585
|
+
width: 30,
|
|
4586
|
+
height: 40,
|
|
4587
|
+
};
|
|
4588
|
+
|
|
4589
|
+
const { width, height } = crestSize;
|
|
4590
|
+
const getDimensionStyle = {
|
|
4591
|
+
maxWidth: `${width}px`,
|
|
4592
|
+
maxHeight: `${height}px`,
|
|
4593
|
+
width: 'inherit',
|
|
4594
|
+
height: 'inherit',
|
|
4595
|
+
};
|
|
4586
4596
|
const getComponentCss$P = () => {
|
|
4587
4597
|
return getCss({
|
|
4588
4598
|
'@global': {
|
|
4589
|
-
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign({ outline: 0 }, hostHiddenStyles))),
|
|
4590
|
-
a: Object.assign({ display: 'block', textDecoration: 'none' }, focusPseudoJssStyle),
|
|
4599
|
+
':host': Object.assign({ position: 'relative', display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ outline: 0, boxSizing: 'content-box' }, getDimensionStyle), hostHiddenStyles))),
|
|
4600
|
+
a: Object.assign(Object.assign({ display: 'block', textDecoration: 'none' }, getDimensionStyle), focusPseudoJssStyle),
|
|
4591
4601
|
picture: {
|
|
4592
4602
|
display: 'block',
|
|
4593
|
-
width:
|
|
4594
|
-
height:
|
|
4603
|
+
width: `min(${width}px, 100%)`,
|
|
4604
|
+
height: `min(${height}px, 100%)`,
|
|
4595
4605
|
},
|
|
4596
4606
|
img: {
|
|
4597
4607
|
display: 'block',
|
|
4598
|
-
|
|
4608
|
+
maxWidth: '100%',
|
|
4609
|
+
maxHeight: '100%',
|
|
4610
|
+
width: 'auto',
|
|
4599
4611
|
height: 'auto',
|
|
4600
4612
|
},
|
|
4601
4613
|
},
|
|
@@ -4661,7 +4673,7 @@ const getComponentCss$N = (color, orientation, theme) => {
|
|
|
4661
4673
|
return getCss({
|
|
4662
4674
|
'@global': {
|
|
4663
4675
|
':host': Object.assign({ display: 'block' }, addImportantToEachRule(hostHiddenStyles)),
|
|
4664
|
-
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' })),
|
|
4676
|
+
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' })),
|
|
4665
4677
|
},
|
|
4666
4678
|
});
|
|
4667
4679
|
};
|
|
@@ -4912,10 +4924,12 @@ const getComponentCss$E = (color, size, theme) => {
|
|
|
4912
4924
|
const isSizeInherit = size === 'inherit';
|
|
4913
4925
|
const isDark = isThemeDark(theme);
|
|
4914
4926
|
return getCss({
|
|
4915
|
-
'@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 && {
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4927
|
+
'@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 &&
|
|
4928
|
+
getSchemedHighContrastMediaQuery({
|
|
4929
|
+
filter: filter.light[color],
|
|
4930
|
+
}, {
|
|
4931
|
+
filter: filter.dark[color],
|
|
4932
|
+
}))), { WebkitAnimation: `${isDark ? keyFramesDark : keyFramesLight} 1ms` }))), (isSizeInherit
|
|
4919
4933
|
? {
|
|
4920
4934
|
width: size,
|
|
4921
4935
|
height: size,
|
|
@@ -4944,20 +4958,14 @@ const getBackgroundColor = (state, theme) => {
|
|
|
4944
4958
|
return colorMap[state];
|
|
4945
4959
|
};
|
|
4946
4960
|
const getNotificationRootJssStyle = (state, hasAction, hasClose, theme) => {
|
|
4947
|
-
return {
|
|
4948
|
-
display: 'grid',
|
|
4961
|
+
return Object.assign(Object.assign({ display: 'grid',
|
|
4949
4962
|
// 2 columns for content and optional close button
|
|
4950
|
-
gridTemplateColumns: `minmax(auto, 1fr)${hasClose ? ' auto' : ''}`,
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
padding: spacingStaticMedium,
|
|
4954
|
-
background: getBackgroundColor(state, theme),
|
|
4955
|
-
borderRadius: borderRadiusSmall,
|
|
4956
|
-
[mediaQueryMinS$1]: {
|
|
4963
|
+
gridTemplateColumns: `minmax(auto, 1fr)${hasClose ? ' auto' : ''}`, gap: spacingStaticMedium, placeItems: 'start', padding: spacingStaticMedium, background: getBackgroundColor(state, theme), borderRadius: borderRadiusSmall }, (isHighContrastMode && {
|
|
4964
|
+
outline: '1px solid transparent',
|
|
4965
|
+
})), { [mediaQueryMinS$1]: {
|
|
4957
4966
|
// 4 columns are for icon, content, optional action button and optional close button
|
|
4958
4967
|
gridTemplateColumns: `auto minmax(auto, 1fr)${hasAction ? ' auto' : ''}${hasClose ? ' auto' : ''}`,
|
|
4959
|
-
}
|
|
4960
|
-
};
|
|
4968
|
+
} });
|
|
4961
4969
|
};
|
|
4962
4970
|
const getNotificationIconJssStyle = () => ({
|
|
4963
4971
|
[mediaQueryMaxS$1]: {
|
|
@@ -5021,8 +5029,12 @@ const getComponentCss$C = (icon, iconSource, active, stretch, size, hideLabel, a
|
|
|
5021
5029
|
|
|
5022
5030
|
const getComponentCss$B = (icon, iconSource, variant, hideLabel, hasSlottedAnchor, theme) => {
|
|
5023
5031
|
const { focusColor } = getThemedColors(theme);
|
|
5024
|
-
|
|
5025
|
-
|
|
5032
|
+
const { linkColor } = getHighContrastColors();
|
|
5033
|
+
return getCss(mergeDeep(getLinkButtonStyles(icon, iconSource, variant, hideLabel, false, hasSlottedAnchor, theme), Object.assign({}, (hasSlottedAnchor && Object.assign(Object.assign({}, (isHighContrastMode && {
|
|
5034
|
+
root: {
|
|
5035
|
+
borderColor: linkColor,
|
|
5036
|
+
},
|
|
5037
|
+
})), { '@global': addImportantToEachRule({
|
|
5026
5038
|
'::slotted': {
|
|
5027
5039
|
'&(a)': Object.assign(Object.assign({}, getResetInitialStylesForSlottedAnchor), { outline: 0, textDecoration: 'none', font: 'inherit', color: 'inherit' }),
|
|
5028
5040
|
// The clickable area for Safari < ~15 (<= release date: 2021-10-28) is reduced to the slotted anchor itself,
|
|
@@ -5040,8 +5052,7 @@ const getComponentCss$B = (icon, iconSource, variant, hideLabel, hasSlottedAncho
|
|
|
5040
5052
|
border: 0,
|
|
5041
5053
|
},
|
|
5042
5054
|
},
|
|
5043
|
-
})
|
|
5044
|
-
}))));
|
|
5055
|
+
}) })))));
|
|
5045
5056
|
};
|
|
5046
5057
|
|
|
5047
5058
|
const LINK_TILE_MODEL_SIGNATURE_HEADING_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
@@ -5178,7 +5189,7 @@ const getComponentCss$x = (isOpen, isFullscreen, hasDismissButton, hasHeader) =>
|
|
|
5178
5189
|
transition: `opacity ${duration} ${transitionTimingFunction},transform ${duration} ${transitionTimingFunction}`,
|
|
5179
5190
|
padding: hasDismissButton ? `${pxToRemWithUnit(32)} 32px 32px 32px` : '32px',
|
|
5180
5191
|
background: backgroundColor,
|
|
5181
|
-
outline: 0,
|
|
5192
|
+
outline: isHighContrastMode ? '1px solid transparent' : 0,
|
|
5182
5193
|
'&: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))))),
|
|
5183
5194
|
'&:not(:focus-visible)::before': {
|
|
5184
5195
|
border: 0,
|
|
@@ -5200,6 +5211,8 @@ const getComponentCss$x = (isOpen, isFullscreen, hasDismissButton, hasHeader) =>
|
|
|
5200
5211
|
})));
|
|
5201
5212
|
};
|
|
5202
5213
|
|
|
5214
|
+
const modelSignatureHeight = 36;
|
|
5215
|
+
|
|
5203
5216
|
const colorToFilterMap = {
|
|
5204
5217
|
light: {
|
|
5205
5218
|
primary: filterLightPrimary,
|
|
@@ -5219,8 +5232,18 @@ const getComponentCss$w = (size, color, theme) => {
|
|
|
5219
5232
|
const isColorInherit = color === 'inherit';
|
|
5220
5233
|
return getCss({
|
|
5221
5234
|
'@global': {
|
|
5222
|
-
':host': Object.assign({ display: 'block' }, addImportantToEachRule(
|
|
5223
|
-
|
|
5235
|
+
':host': Object.assign({ display: 'inline-block', verticalAlign: 'top' }, addImportantToEachRule(Object.assign(Object.assign({ maxWidth: '100%', maxHeight: '100%' }, (!isSizeInherit && {
|
|
5236
|
+
width: 'inherit',
|
|
5237
|
+
height: 'inherit',
|
|
5238
|
+
// TODO: we need a width map of all signatures to ensure same fluid behavior like implemented fro crest + wordmark
|
|
5239
|
+
maxHeight: `${modelSignatureHeight}px`,
|
|
5240
|
+
})), hostHiddenStyles))),
|
|
5241
|
+
img: Object.assign(Object.assign({ display: 'block', maxWidth: '100%', maxHeight: '100%', pointerEvents: 'none' }, (!isColorInherit && Object.assign({ filter: colorToFilterMap[theme][color] }, (isHighContrastMode &&
|
|
5242
|
+
getSchemedHighContrastMediaQuery({
|
|
5243
|
+
filter: colorToFilterMap.light[color],
|
|
5244
|
+
}, {
|
|
5245
|
+
filter: colorToFilterMap.dark[color],
|
|
5246
|
+
}))))), (isSizeInherit && { height: size })),
|
|
5224
5247
|
},
|
|
5225
5248
|
});
|
|
5226
5249
|
};
|
|
@@ -5280,7 +5303,7 @@ const getComponentCss$v = (maxNumberOfPageLinks, theme) => {
|
|
|
5280
5303
|
};
|
|
5281
5304
|
|
|
5282
5305
|
const { backgroundColor: backgroundColorThemeLight, primaryColor: primaryColorThemeLight } = getThemedColors('light');
|
|
5283
|
-
const
|
|
5306
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5284
5307
|
const directionPositionMap = {
|
|
5285
5308
|
top: {
|
|
5286
5309
|
bottom: '100%',
|
|
@@ -5305,8 +5328,6 @@ const directionPositionMap = {
|
|
|
5305
5328
|
};
|
|
5306
5329
|
const borderWidth = '12px';
|
|
5307
5330
|
const transparentColor = 'transparent';
|
|
5308
|
-
const canvas = 'canvas';
|
|
5309
|
-
const canvasText = 'canvastext';
|
|
5310
5331
|
const join = (...arr) => arr.join(' ');
|
|
5311
5332
|
const directionArrowMap = {
|
|
5312
5333
|
top: {
|
|
@@ -5314,40 +5335,36 @@ const directionArrowMap = {
|
|
|
5314
5335
|
left: '50%',
|
|
5315
5336
|
transform: 'translateX(-50%)',
|
|
5316
5337
|
borderWidth: join(borderWidth, borderWidth, 0),
|
|
5317
|
-
borderColor:
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
},
|
|
5338
|
+
borderColor: isHighContrastMode
|
|
5339
|
+
? join(canvasTextColor, canvasColor, canvasColor)
|
|
5340
|
+
: join(backgroundColorThemeLight, transparentColor, transparentColor),
|
|
5321
5341
|
},
|
|
5322
5342
|
right: {
|
|
5323
5343
|
top: '50%',
|
|
5324
5344
|
right: 0,
|
|
5325
5345
|
transform: 'translateY(-50%)',
|
|
5326
5346
|
borderWidth: join(borderWidth, borderWidth, borderWidth, 0),
|
|
5327
|
-
borderColor:
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
},
|
|
5347
|
+
borderColor: isHighContrastMode
|
|
5348
|
+
? join(canvasColor, canvasTextColor, canvasColor, canvasColor)
|
|
5349
|
+
: join(transparentColor, backgroundColorThemeLight, transparentColor, transparentColor),
|
|
5331
5350
|
},
|
|
5332
5351
|
bottom: {
|
|
5333
5352
|
bottom: 0,
|
|
5334
5353
|
left: '50%',
|
|
5335
5354
|
transform: 'translateX(-50%)',
|
|
5336
5355
|
borderWidth: join(0, borderWidth, borderWidth),
|
|
5337
|
-
borderColor:
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
},
|
|
5356
|
+
borderColor: isHighContrastMode
|
|
5357
|
+
? join(canvasColor, canvasColor, canvasTextColor)
|
|
5358
|
+
: join(transparentColor, transparentColor, backgroundColorThemeLight),
|
|
5341
5359
|
},
|
|
5342
5360
|
left: {
|
|
5343
5361
|
top: '50%',
|
|
5344
5362
|
left: 0,
|
|
5345
5363
|
transform: 'translateY(-50%)',
|
|
5346
5364
|
borderWidth: join(borderWidth, 0, borderWidth, borderWidth),
|
|
5347
|
-
borderColor:
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
},
|
|
5365
|
+
borderColor: isHighContrastMode
|
|
5366
|
+
? join(canvasColor, canvasColor, canvasColor, canvasTextColor)
|
|
5367
|
+
: join(transparentColor, transparentColor, transparentColor, backgroundColorThemeLight),
|
|
5351
5368
|
},
|
|
5352
5369
|
};
|
|
5353
5370
|
const getComponentCss$u = (direction, theme) => {
|
|
@@ -5385,9 +5402,9 @@ const getComponentCss$u = (direction, theme) => {
|
|
|
5385
5402
|
,
|
|
5386
5403
|
'&::before': Object.assign({ content: '""', position: 'absolute', borderStyle: 'solid' }, directionArrowMap[direction]),
|
|
5387
5404
|
},
|
|
5388
|
-
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,
|
|
5389
|
-
|
|
5390
|
-
|
|
5405
|
+
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 && {
|
|
5406
|
+
outline: `1px solid ${canvasTextColor}`,
|
|
5407
|
+
})),
|
|
5391
5408
|
'@keyframes fadeIn': {
|
|
5392
5409
|
from: {
|
|
5393
5410
|
opacity: 0,
|
|
@@ -5400,8 +5417,10 @@ const getComponentCss$u = (direction, theme) => {
|
|
|
5400
5417
|
};
|
|
5401
5418
|
|
|
5402
5419
|
const getComponentCss$t = (hideLabel, state, isDisabled, theme) => {
|
|
5403
|
-
const checkedIconColor =
|
|
5404
|
-
|
|
5420
|
+
const checkedIconColor = isHighContrastMode
|
|
5421
|
+
? getHighContrastColors().canvasColor
|
|
5422
|
+
: getInvertedThemedColors(theme).primaryColor.replace(/#/g, '%23');
|
|
5423
|
+
return getCss(mergeDeep(getCheckboxRadioJssStyle(hideLabel, state, isDisabled, false, theme), {
|
|
5405
5424
|
'@global': {
|
|
5406
5425
|
'::slotted': addImportantToEachRule(Object.assign({ '&(input)': {
|
|
5407
5426
|
borderRadius: '50%',
|
|
@@ -5519,10 +5538,11 @@ const ICON_SIZE = pxToRemWithUnit(24);
|
|
|
5519
5538
|
const ICON_MARGIN = pxToRemWithUnit(4);
|
|
5520
5539
|
const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
5521
5540
|
const { primaryColor, contrastMediumColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
5541
|
+
const { highlightColor } = getHighContrastColors();
|
|
5522
5542
|
return {
|
|
5523
5543
|
buttonColor: isDisabled ? disabledColor : primaryColor,
|
|
5524
5544
|
labelColor: isDisabled ? disabledColor : contrastMediumColor,
|
|
5525
|
-
borderColor: isSelected ? primaryColor : contrastLowColor,
|
|
5545
|
+
borderColor: isSelected ? (isHighContrastMode ? highlightColor : primaryColor) : contrastLowColor,
|
|
5526
5546
|
hoverBorderColor: primaryColor,
|
|
5527
5547
|
};
|
|
5528
5548
|
};
|
|
@@ -5655,6 +5675,7 @@ const getComponentCss$n = (size, theme) => {
|
|
|
5655
5675
|
const strokeDasharray = '57'; // C = 2πR
|
|
5656
5676
|
const animationDuration = 'var(--p-animation-duration, 2s)';
|
|
5657
5677
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
5678
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5658
5679
|
return getCss({
|
|
5659
5680
|
'@global': {
|
|
5660
5681
|
':host': addImportantToEachRule(Object.assign({ display: 'inline-flex', verticalAlign: 'top' }, hostHiddenStyles)),
|
|
@@ -5667,13 +5688,13 @@ const getComponentCss$n = (size, theme) => {
|
|
|
5667
5688
|
},
|
|
5668
5689
|
circle: {
|
|
5669
5690
|
'&:first-child': {
|
|
5670
|
-
stroke: contrastMediumColor,
|
|
5691
|
+
stroke: isHighContrastMode ? canvasTextColor : contrastMediumColor,
|
|
5671
5692
|
animation: `$rotate ${animationDuration} linear infinite`, // needs to rotate to eliminate stutter in safari
|
|
5672
5693
|
},
|
|
5673
5694
|
'&:last-child': {
|
|
5674
5695
|
transformOrigin: '0 0',
|
|
5675
5696
|
animation: `$dash ${animationDuration} ease-in-out infinite`,
|
|
5676
|
-
stroke: primaryColor,
|
|
5697
|
+
stroke: isHighContrastMode ? canvasColor : primaryColor,
|
|
5677
5698
|
strokeDasharray: strokeDasharray
|
|
5678
5699
|
,
|
|
5679
5700
|
strokeLinecap: 'round',
|
|
@@ -5781,17 +5802,28 @@ const getComponentCss$l = (size) => {
|
|
|
5781
5802
|
const getColors$1 = (checked, disabled, loading, theme) => {
|
|
5782
5803
|
const { primaryColor, contrastMediumColor, successColor, successColorDarken, disabledColor } = getThemedColors(theme);
|
|
5783
5804
|
const { backgroundColor: lightThemeBackgroundColor } = getThemedColors('light');
|
|
5784
|
-
const
|
|
5805
|
+
const { canvasColor, canvasTextColor } = getHighContrastColors();
|
|
5806
|
+
const checkedColor = isHighContrastMode ? canvasTextColor : successColor;
|
|
5785
5807
|
const disabledOrLoadingColor = isDisabledOrLoading(disabled, loading) && disabledColor;
|
|
5786
5808
|
return {
|
|
5787
5809
|
buttonBorderColor: disabledOrLoadingColor || (checked ? checkedColor : contrastMediumColor),
|
|
5788
|
-
buttonBorderColorHover: checked ? successColorDarken : primaryColor,
|
|
5810
|
+
buttonBorderColorHover: checked ? (isHighContrastMode ? primaryColor : successColorDarken) : primaryColor,
|
|
5789
5811
|
buttonBackgroundColor: checked ? disabledOrLoadingColor || checkedColor : 'transparent',
|
|
5790
|
-
buttonBackgroundColorHover: checked ? successColorDarken : 'transparent',
|
|
5812
|
+
buttonBackgroundColorHover: checked ? (isHighContrastMode ? checkedColor : successColorDarken) : 'transparent',
|
|
5791
5813
|
toggleBackgroundColor: (loading && 'transparent') ||
|
|
5792
5814
|
(disabled && !checked && disabledColor) ||
|
|
5793
|
-
(checked
|
|
5794
|
-
|
|
5815
|
+
(checked
|
|
5816
|
+
? isHighContrastMode
|
|
5817
|
+
? canvasColor
|
|
5818
|
+
: lightThemeBackgroundColor
|
|
5819
|
+
: isHighContrastMode
|
|
5820
|
+
? canvasTextColor
|
|
5821
|
+
: primaryColor),
|
|
5822
|
+
toggleBackgroundColorHover: checked
|
|
5823
|
+
? lightThemeBackgroundColor
|
|
5824
|
+
: isHighContrastMode
|
|
5825
|
+
? canvasTextColor
|
|
5826
|
+
: primaryColor,
|
|
5795
5827
|
textColor: disabledOrLoadingColor || primaryColor,
|
|
5796
5828
|
};
|
|
5797
5829
|
};
|
|
@@ -5877,11 +5909,12 @@ const getComponentCss$h = (theme) => {
|
|
|
5877
5909
|
return getCss({
|
|
5878
5910
|
'@global': {
|
|
5879
5911
|
':host': addImportantToEachRule(Object.assign(Object.assign(Object.assign({ display: 'block' }, textSmallStyle), { color: primaryColor, textAlign: 'left' }), hostHiddenStyles)),
|
|
5880
|
-
'::slotted(*)': addImportantToEachRule({
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5912
|
+
'::slotted(*)': addImportantToEachRule(Object.assign({ [cssVariableTableHoverColor]: hoverColor, [cssVariableTableBorderColor]: contrastLowColor, [cssVariableTableHeadCellIconFilter]: isThemeDark(theme) ? 'invert(100%)' : 'none' }, (isHighContrastMode &&
|
|
5913
|
+
getSchemedHighContrastMediaQuery({
|
|
5914
|
+
[cssVariableTableHeadCellIconFilter]: 'none',
|
|
5915
|
+
}, {
|
|
5916
|
+
[cssVariableTableHeadCellIconFilter]: 'invert(100%)',
|
|
5917
|
+
})))),
|
|
5885
5918
|
},
|
|
5886
5919
|
caption: {
|
|
5887
5920
|
marginBottom: spacingFluidMedium,
|
|
@@ -5996,10 +6029,10 @@ const getComponentCss$c = (size, weight, theme) => {
|
|
|
5996
6029
|
display: 'block',
|
|
5997
6030
|
position: 'absolute',
|
|
5998
6031
|
width: 0,
|
|
5999
|
-
height: weight === 'semi-bold' ? '2px' : '1.5px',
|
|
6032
|
+
height: isHighContrastMode ? '4px' : weight === 'semi-bold' ? '2px' : '1.5px',
|
|
6000
6033
|
left: 0,
|
|
6001
|
-
bottom: '-4px',
|
|
6002
|
-
background: primaryColor,
|
|
6034
|
+
bottom: isHighContrastMode ? '-1px' : '-4px',
|
|
6035
|
+
background: isHighContrastMode ? getHighContrastColors().canvasTextColor : primaryColor,
|
|
6003
6036
|
'&--enable-transition': {
|
|
6004
6037
|
willChange: 'width',
|
|
6005
6038
|
transition: `transform ${tabsTransitionDuration},width ${tabsTransitionDuration}`,
|
|
@@ -6060,7 +6093,7 @@ const getComponentCss$9 = (color, hasLabel, theme) => {
|
|
|
6060
6093
|
const backgroundColor = getThemedBackgroundColor(color, themedColors);
|
|
6061
6094
|
return getCss(Object.assign(Object.assign({ '@global': {
|
|
6062
6095
|
':host': addImportantToEachRule(Object.assign({ display: 'inline-block', verticalAlign: 'top', outline: 0 }, hostHiddenStyles)),
|
|
6063
|
-
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({
|
|
6096
|
+
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({
|
|
6064
6097
|
'&:hover > .icon': {
|
|
6065
6098
|
backgroundColor: hoverColor,
|
|
6066
6099
|
},
|
|
@@ -6110,7 +6143,9 @@ const getComponentCss$8 = (tagColor, isFocusable, theme) => {
|
|
|
6110
6143
|
return getCss({
|
|
6111
6144
|
'@global': {
|
|
6112
6145
|
':host': Object.assign({ display: 'inline-flex', verticalAlign: 'top' }, addImportantToEachRule(hostHiddenStyles)),
|
|
6113
|
-
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' }, (
|
|
6146
|
+
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 && {
|
|
6147
|
+
outline: '1px solid transparent',
|
|
6148
|
+
})), (isFocusable &&
|
|
6114
6149
|
hoverMediaQuery({
|
|
6115
6150
|
transition: getTransition('background-color'),
|
|
6116
6151
|
'&:hover': {
|
|
@@ -6354,12 +6389,16 @@ const getComponentCss$1 = () => {
|
|
|
6354
6389
|
const getComponentCss = (size, theme) => {
|
|
6355
6390
|
return getCss({
|
|
6356
6391
|
'@global': {
|
|
6357
|
-
':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))),
|
|
6358
|
-
a
|
|
6359
|
-
svg: {
|
|
6392
|
+
':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))),
|
|
6393
|
+
'a, svg': {
|
|
6360
6394
|
display: 'block',
|
|
6395
|
+
maxWidth: '100%',
|
|
6396
|
+
maxHeight: '100%',
|
|
6361
6397
|
height: 'inherit',
|
|
6362
|
-
|
|
6398
|
+
},
|
|
6399
|
+
a: Object.assign({ textDecoration: 'none' }, focusPseudoJssStyle),
|
|
6400
|
+
svg: {
|
|
6401
|
+
fill: isHighContrastMode ? getHighContrastColors().canvasTextColor : getThemedColors(theme).primaryColor,
|
|
6363
6402
|
},
|
|
6364
6403
|
},
|
|
6365
6404
|
});
|