@atlaskit/editor-toolbar 0.18.7 → 0.18.9
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 +15 -0
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/ui/ColorPalette/utils.js +1 -40
- package/dist/cjs/ui/ResponsiveContainer.compiled.css +6 -0
- package/dist/cjs/ui/ResponsiveContainer.js +2 -2
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/ui/ColorPalette/utils.js +1 -36
- package/dist/es2019/ui/ResponsiveContainer.compiled.css +6 -0
- package/dist/es2019/ui/ResponsiveContainer.js +2 -2
- package/dist/esm/index.js +0 -1
- package/dist/esm/ui/ColorPalette/utils.js +1 -38
- package/dist/esm/ui/ResponsiveContainer.compiled.css +6 -0
- package/dist/esm/ui/ResponsiveContainer.js +2 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/ui/ColorPalette/utils.d.ts +0 -20
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/ColorPalette/utils.d.ts +0 -20
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.18.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5ab68d0750bb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ab68d0750bb2) -
|
|
8
|
+
Fix only style missing in the old responsive container
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.18.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`676d45e408322`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/676d45e408322) -
|
|
16
|
+
[ED-29726] clean up platform_editor_toolbar_aifc_patch_8
|
|
17
|
+
|
|
3
18
|
## 0.18.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -478,12 +478,6 @@ Object.defineProperty(exports, "WorkItemsIcon", {
|
|
|
478
478
|
return _WorkItemsIcon.WorkItemsIcon;
|
|
479
479
|
}
|
|
480
480
|
});
|
|
481
|
-
Object.defineProperty(exports, "getContrastingBackgroundColor", {
|
|
482
|
-
enumerable: true,
|
|
483
|
-
get: function get() {
|
|
484
|
-
return _utils.getContrastingBackgroundColor;
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
481
|
Object.defineProperty(exports, "useToolbarDropdownMenu", {
|
|
488
482
|
enumerable: true,
|
|
489
483
|
get: function get() {
|
|
@@ -572,5 +566,4 @@ var _SyncBlocksIcon = require("./ui/icons/SyncBlocksIcon");
|
|
|
572
566
|
var _WorkItemIcon = require("./ui/icons/WorkItemIcon");
|
|
573
567
|
var _WorkItemsIcon = require("./ui/icons/WorkItemsIcon");
|
|
574
568
|
var _ColorPalette = _interopRequireDefault(require("./ui/ColorPalette"));
|
|
575
|
-
var _utils = require("./ui/ColorPalette/utils");
|
|
576
569
|
var _uiContext = require("./hooks/ui-context");
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.DEFAULT_COLOR_PICKER_COLUMNS = void 0;
|
|
8
7
|
exports.getColorsPerRowFromPalette = getColorsPerRowFromPalette;
|
|
9
|
-
exports.getContrastingBackgroundColor = getContrastingBackgroundColor;
|
|
10
8
|
exports.getSelectedRowAndColumn = getSelectedRowAndColumn;
|
|
11
9
|
exports.getSelectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette;
|
|
12
10
|
exports.getTokenCSSVariableValue = void 0;
|
|
13
|
-
var _chromatism = _interopRequireDefault(require("chromatism"));
|
|
14
11
|
/**
|
|
15
12
|
* Default number of columns in the color picker
|
|
16
13
|
*/
|
|
@@ -94,40 +91,4 @@ var getTokenCSSVariableValue = exports.getTokenCSSVariableValue = function getTo
|
|
|
94
91
|
return value || fallback;
|
|
95
92
|
}
|
|
96
93
|
return '';
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Get the best contrasting background color for a given text color
|
|
101
|
-
* Ensures WCAG AA compliance for accessibility
|
|
102
|
-
*
|
|
103
|
-
* @param textColor - The text color to find a contrasting background for (supports HEX, RGB, RGBA etc.)
|
|
104
|
-
* @param useTokens - Whether to return design tokens instead of raw hex values
|
|
105
|
-
* @returns The best contrasting background color (hex value or design token)
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```typescript
|
|
109
|
-
* // Get contrasting color for white text
|
|
110
|
-
* const bgForWhite = getContrastingBackgroundColor('#FFFFFF', false);
|
|
111
|
-
* // Returns: '#42526E' (dark gray)
|
|
112
|
-
*
|
|
113
|
-
* // Get contrasting color for black text with design tokens
|
|
114
|
-
* const bgForBlack = getContrastingBackgroundColor('#000000', true);
|
|
115
|
-
* // Returns: token('elevation.surface', '#FFFFFF')
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
function getContrastingBackgroundColor(textColor) {
|
|
119
|
-
var candidates = ['#FFFFFF',
|
|
120
|
-
// white - surface
|
|
121
|
-
'#172B4D' // dark blue-gray - text color
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
// Extract actual color value if it's a CSS variable
|
|
125
|
-
var tokenVal = getTokenCSSVariableValue(textColor);
|
|
126
|
-
var colorValue = !!tokenVal ? tokenVal : textColor;
|
|
127
|
-
|
|
128
|
-
// Find the color with the highest contrast ratio
|
|
129
|
-
var bestContrast = candidates.sort(function (a, b) {
|
|
130
|
-
return _chromatism.default.difference(b, colorValue) - _chromatism.default.difference(a, colorValue);
|
|
131
|
-
})[0];
|
|
132
|
-
return bestContrast;
|
|
133
|
-
}
|
|
94
|
+
};
|
|
@@ -43,19 +43,25 @@
|
|
|
43
43
|
@container toolbar-container (max-width: 857px){._syrzglyw .show-above-lg{display:none}._fr6v1ule .show-below-lg{display:block}}
|
|
44
44
|
@container toolbar-container (min-width: 1024px){._1je21ule .show-only-xl{display:block}._87bn1ule._87bn1ule .show-only-xl{display:block}}
|
|
45
45
|
@container toolbar-container (min-width: 210px) and (max-width: 407px){._7qjy1ule._7qjy1ule .show-only-sm{display:block}}
|
|
46
|
+
@container toolbar-container (min-width: 211px) and (max-width: 408px){._77vl1ule._77vl1ule .show-only-sm{display:block}}
|
|
46
47
|
@container toolbar-container (min-width: 280px) and (max-width: 419px){._4cj71ule._4cj71ule .show-only-sm{display:block}}
|
|
47
48
|
@container toolbar-container (min-width: 296px) and (max-width: 431px){._1cg81ule._1cg81ule .show-only-sm{display:block}}
|
|
48
49
|
@container toolbar-container (min-width: 365px) and (max-width: 499px){._1jvu1ule._1jvu1ule .show-only-sm{display:block}}
|
|
50
|
+
@container toolbar-container (min-width: 408px) and (max-width: 575px){._1h871ule._1h871ule .show-only-md{display:block}}
|
|
49
51
|
@container toolbar-container (min-width: 408px) and (max-width: 647px){._cpaf1ule._cpaf1ule .show-only-md{display:block}}
|
|
52
|
+
@container toolbar-container (min-width: 411px) and (max-width: 476px){._tjgx1ule .show-only-sm{display:block}}
|
|
50
53
|
@container toolbar-container (min-width: 420px) and (max-width: 649px){._w81r1ule._w81r1ule .show-only-md{display:block}}
|
|
51
54
|
@container toolbar-container (min-width: 422px) and (max-width: 721px){._1btx1ule .show-only-sm{display:block}}
|
|
52
55
|
@container toolbar-container (min-width: 432px) and (max-width: 661px){._oj3l1ule._oj3l1ule .show-only-md{display:block}}
|
|
56
|
+
@container toolbar-container (min-width: 477px) and (max-width: 768px){._jt9u1ule .show-only-md{display:block}}
|
|
53
57
|
@container toolbar-container (min-width: 500px) and (max-width: 629px){._1vu31ule._1vu31ule .show-only-md{display:block}}
|
|
58
|
+
@container toolbar-container (min-width: 576px) and (max-width: 1024px){._ghxv1ule._ghxv1ule .show-only-lg{display:block}}
|
|
54
59
|
@container toolbar-container (min-width: 630px) and (max-width: 1023px){._1bqk1ule._1bqk1ule .show-only-lg{display:block}}
|
|
55
60
|
@container toolbar-container (min-width: 648px) and (max-width: 1023px){._1oqh1ule._1oqh1ule .show-only-lg{display:block}}
|
|
56
61
|
@container toolbar-container (min-width: 650px) and (max-width: 1023px){._1ym01ule._1ym01ule .show-only-lg{display:block}}
|
|
57
62
|
@container toolbar-container (min-width: 662px) and (max-width: 1023px){._wt211ule._wt211ule .show-only-lg{display:block}}
|
|
58
63
|
@container toolbar-container (min-width: 722px) and (max-width: 857px){._biad1ule .show-only-md{display:block}}
|
|
64
|
+
@container toolbar-container (min-width: 768px) and (max-width: 1024px){._6c751ule .show-only-lg{display:block}}
|
|
59
65
|
@container toolbar-container (min-width: 858px) and (max-width: 1023px){._1ana1ule .show-only-lg{display:block}}
|
|
60
66
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
61
67
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -24,8 +24,8 @@ var styles = {
|
|
|
24
24
|
jiraIssue: "_152xglyw _1cn41ule _4cj71ule _afriglyw _ozjb1ule _w81r1ule _1mckglyw _r2nv1ule _1ym01ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
25
25
|
jsmComment: "_s2iiglyw _o4331ule _1jvu1ule _lankglyw _1xpy1ule _1vu31ule _1b07glyw _1meg1ule _1bqk1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
26
26
|
confluenceComment: "_15nrglyw _cm5a1ule _7qjy1ule _13ioglyw _8urt1ule _cpaf1ule _18zmglyw _1uj01ule _1oqh1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
27
|
-
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
28
|
-
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
27
|
+
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule _1je21ule _tjgx1ule _jt9u1ule _6c751ule",
|
|
28
|
+
responsiveRulesReduced: "_j094glyw _1mc51ule _77vl1ule _gipeglyw _311r1ule _1h871ule _11u4glyw _v1i61ule _ghxv1ule _19x4glyw _qck01ule _87bn1ule",
|
|
29
29
|
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
30
30
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
31
31
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -75,5 +75,4 @@ export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
|
75
75
|
export { WorkItemIcon } from './ui/icons/WorkItemIcon';
|
|
76
76
|
export { WorkItemsIcon } from './ui/icons/WorkItemsIcon';
|
|
77
77
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
78
|
-
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
79
78
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import chromatism from 'chromatism';
|
|
2
1
|
/**
|
|
3
2
|
* Default number of columns in the color picker
|
|
4
3
|
*/
|
|
@@ -81,38 +80,4 @@ export const getTokenCSSVariableValue = variableExpression => {
|
|
|
81
80
|
return value || fallback;
|
|
82
81
|
}
|
|
83
82
|
return '';
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get the best contrasting background color for a given text color
|
|
88
|
-
* Ensures WCAG AA compliance for accessibility
|
|
89
|
-
*
|
|
90
|
-
* @param textColor - The text color to find a contrasting background for (supports HEX, RGB, RGBA etc.)
|
|
91
|
-
* @param useTokens - Whether to return design tokens instead of raw hex values
|
|
92
|
-
* @returns The best contrasting background color (hex value or design token)
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```typescript
|
|
96
|
-
* // Get contrasting color for white text
|
|
97
|
-
* const bgForWhite = getContrastingBackgroundColor('#FFFFFF', false);
|
|
98
|
-
* // Returns: '#42526E' (dark gray)
|
|
99
|
-
*
|
|
100
|
-
* // Get contrasting color for black text with design tokens
|
|
101
|
-
* const bgForBlack = getContrastingBackgroundColor('#000000', true);
|
|
102
|
-
* // Returns: token('elevation.surface', '#FFFFFF')
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
export function getContrastingBackgroundColor(textColor) {
|
|
106
|
-
const candidates = ['#FFFFFF',
|
|
107
|
-
// white - surface
|
|
108
|
-
'#172B4D' // dark blue-gray - text color
|
|
109
|
-
];
|
|
110
|
-
|
|
111
|
-
// Extract actual color value if it's a CSS variable
|
|
112
|
-
const tokenVal = getTokenCSSVariableValue(textColor);
|
|
113
|
-
const colorValue = !!tokenVal ? tokenVal : textColor;
|
|
114
|
-
|
|
115
|
-
// Find the color with the highest contrast ratio
|
|
116
|
-
const bestContrast = candidates.sort((a, b) => chromatism.difference(b, colorValue) - chromatism.difference(a, colorValue))[0];
|
|
117
|
-
return bestContrast;
|
|
118
|
-
}
|
|
83
|
+
};
|
|
@@ -43,19 +43,25 @@
|
|
|
43
43
|
@container toolbar-container (max-width: 857px){._syrzglyw .show-above-lg{display:none}._fr6v1ule .show-below-lg{display:block}}
|
|
44
44
|
@container toolbar-container (min-width: 1024px){._1je21ule .show-only-xl{display:block}._87bn1ule._87bn1ule .show-only-xl{display:block}}
|
|
45
45
|
@container toolbar-container (min-width: 210px) and (max-width: 407px){._7qjy1ule._7qjy1ule .show-only-sm{display:block}}
|
|
46
|
+
@container toolbar-container (min-width: 211px) and (max-width: 408px){._77vl1ule._77vl1ule .show-only-sm{display:block}}
|
|
46
47
|
@container toolbar-container (min-width: 280px) and (max-width: 419px){._4cj71ule._4cj71ule .show-only-sm{display:block}}
|
|
47
48
|
@container toolbar-container (min-width: 296px) and (max-width: 431px){._1cg81ule._1cg81ule .show-only-sm{display:block}}
|
|
48
49
|
@container toolbar-container (min-width: 365px) and (max-width: 499px){._1jvu1ule._1jvu1ule .show-only-sm{display:block}}
|
|
50
|
+
@container toolbar-container (min-width: 408px) and (max-width: 575px){._1h871ule._1h871ule .show-only-md{display:block}}
|
|
49
51
|
@container toolbar-container (min-width: 408px) and (max-width: 647px){._cpaf1ule._cpaf1ule .show-only-md{display:block}}
|
|
52
|
+
@container toolbar-container (min-width: 411px) and (max-width: 476px){._tjgx1ule .show-only-sm{display:block}}
|
|
50
53
|
@container toolbar-container (min-width: 420px) and (max-width: 649px){._w81r1ule._w81r1ule .show-only-md{display:block}}
|
|
51
54
|
@container toolbar-container (min-width: 422px) and (max-width: 721px){._1btx1ule .show-only-sm{display:block}}
|
|
52
55
|
@container toolbar-container (min-width: 432px) and (max-width: 661px){._oj3l1ule._oj3l1ule .show-only-md{display:block}}
|
|
56
|
+
@container toolbar-container (min-width: 477px) and (max-width: 768px){._jt9u1ule .show-only-md{display:block}}
|
|
53
57
|
@container toolbar-container (min-width: 500px) and (max-width: 629px){._1vu31ule._1vu31ule .show-only-md{display:block}}
|
|
58
|
+
@container toolbar-container (min-width: 576px) and (max-width: 1024px){._ghxv1ule._ghxv1ule .show-only-lg{display:block}}
|
|
54
59
|
@container toolbar-container (min-width: 630px) and (max-width: 1023px){._1bqk1ule._1bqk1ule .show-only-lg{display:block}}
|
|
55
60
|
@container toolbar-container (min-width: 648px) and (max-width: 1023px){._1oqh1ule._1oqh1ule .show-only-lg{display:block}}
|
|
56
61
|
@container toolbar-container (min-width: 650px) and (max-width: 1023px){._1ym01ule._1ym01ule .show-only-lg{display:block}}
|
|
57
62
|
@container toolbar-container (min-width: 662px) and (max-width: 1023px){._wt211ule._wt211ule .show-only-lg{display:block}}
|
|
58
63
|
@container toolbar-container (min-width: 722px) and (max-width: 857px){._biad1ule .show-only-md{display:block}}
|
|
64
|
+
@container toolbar-container (min-width: 768px) and (max-width: 1024px){._6c751ule .show-only-lg{display:block}}
|
|
59
65
|
@container toolbar-container (min-width: 858px) and (max-width: 1023px){._1ana1ule .show-only-lg{display:block}}
|
|
60
66
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
61
67
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -17,8 +17,8 @@ const styles = {
|
|
|
17
17
|
jiraIssue: "_152xglyw _1cn41ule _4cj71ule _afriglyw _ozjb1ule _w81r1ule _1mckglyw _r2nv1ule _1ym01ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
18
18
|
jsmComment: "_s2iiglyw _o4331ule _1jvu1ule _lankglyw _1xpy1ule _1vu31ule _1b07glyw _1meg1ule _1bqk1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
19
19
|
confluenceComment: "_15nrglyw _cm5a1ule _7qjy1ule _13ioglyw _8urt1ule _cpaf1ule _18zmglyw _1uj01ule _1oqh1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
20
|
-
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
21
|
-
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
20
|
+
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule _1je21ule _tjgx1ule _jt9u1ule _6c751ule",
|
|
21
|
+
responsiveRulesReduced: "_j094glyw _1mc51ule _77vl1ule _gipeglyw _311r1ule _1h871ule _11u4glyw _v1i61ule _ghxv1ule _19x4glyw _qck01ule _87bn1ule",
|
|
22
22
|
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
23
23
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
24
24
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -75,5 +75,4 @@ export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
|
75
75
|
export { WorkItemIcon } from './ui/icons/WorkItemIcon';
|
|
76
76
|
export { WorkItemsIcon } from './ui/icons/WorkItemsIcon';
|
|
77
77
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
78
|
-
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
79
78
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import chromatism from 'chromatism';
|
|
2
1
|
/**
|
|
3
2
|
* Default number of columns in the color picker
|
|
4
3
|
*/
|
|
@@ -82,40 +81,4 @@ export var getTokenCSSVariableValue = function getTokenCSSVariableValue(variable
|
|
|
82
81
|
return value || fallback;
|
|
83
82
|
}
|
|
84
83
|
return '';
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Get the best contrasting background color for a given text color
|
|
89
|
-
* Ensures WCAG AA compliance for accessibility
|
|
90
|
-
*
|
|
91
|
-
* @param textColor - The text color to find a contrasting background for (supports HEX, RGB, RGBA etc.)
|
|
92
|
-
* @param useTokens - Whether to return design tokens instead of raw hex values
|
|
93
|
-
* @returns The best contrasting background color (hex value or design token)
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```typescript
|
|
97
|
-
* // Get contrasting color for white text
|
|
98
|
-
* const bgForWhite = getContrastingBackgroundColor('#FFFFFF', false);
|
|
99
|
-
* // Returns: '#42526E' (dark gray)
|
|
100
|
-
*
|
|
101
|
-
* // Get contrasting color for black text with design tokens
|
|
102
|
-
* const bgForBlack = getContrastingBackgroundColor('#000000', true);
|
|
103
|
-
* // Returns: token('elevation.surface', '#FFFFFF')
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
export function getContrastingBackgroundColor(textColor) {
|
|
107
|
-
var candidates = ['#FFFFFF',
|
|
108
|
-
// white - surface
|
|
109
|
-
'#172B4D' // dark blue-gray - text color
|
|
110
|
-
];
|
|
111
|
-
|
|
112
|
-
// Extract actual color value if it's a CSS variable
|
|
113
|
-
var tokenVal = getTokenCSSVariableValue(textColor);
|
|
114
|
-
var colorValue = !!tokenVal ? tokenVal : textColor;
|
|
115
|
-
|
|
116
|
-
// Find the color with the highest contrast ratio
|
|
117
|
-
var bestContrast = candidates.sort(function (a, b) {
|
|
118
|
-
return chromatism.difference(b, colorValue) - chromatism.difference(a, colorValue);
|
|
119
|
-
})[0];
|
|
120
|
-
return bestContrast;
|
|
121
|
-
}
|
|
84
|
+
};
|
|
@@ -43,19 +43,25 @@
|
|
|
43
43
|
@container toolbar-container (max-width: 857px){._syrzglyw .show-above-lg{display:none}._fr6v1ule .show-below-lg{display:block}}
|
|
44
44
|
@container toolbar-container (min-width: 1024px){._1je21ule .show-only-xl{display:block}._87bn1ule._87bn1ule .show-only-xl{display:block}}
|
|
45
45
|
@container toolbar-container (min-width: 210px) and (max-width: 407px){._7qjy1ule._7qjy1ule .show-only-sm{display:block}}
|
|
46
|
+
@container toolbar-container (min-width: 211px) and (max-width: 408px){._77vl1ule._77vl1ule .show-only-sm{display:block}}
|
|
46
47
|
@container toolbar-container (min-width: 280px) and (max-width: 419px){._4cj71ule._4cj71ule .show-only-sm{display:block}}
|
|
47
48
|
@container toolbar-container (min-width: 296px) and (max-width: 431px){._1cg81ule._1cg81ule .show-only-sm{display:block}}
|
|
48
49
|
@container toolbar-container (min-width: 365px) and (max-width: 499px){._1jvu1ule._1jvu1ule .show-only-sm{display:block}}
|
|
50
|
+
@container toolbar-container (min-width: 408px) and (max-width: 575px){._1h871ule._1h871ule .show-only-md{display:block}}
|
|
49
51
|
@container toolbar-container (min-width: 408px) and (max-width: 647px){._cpaf1ule._cpaf1ule .show-only-md{display:block}}
|
|
52
|
+
@container toolbar-container (min-width: 411px) and (max-width: 476px){._tjgx1ule .show-only-sm{display:block}}
|
|
50
53
|
@container toolbar-container (min-width: 420px) and (max-width: 649px){._w81r1ule._w81r1ule .show-only-md{display:block}}
|
|
51
54
|
@container toolbar-container (min-width: 422px) and (max-width: 721px){._1btx1ule .show-only-sm{display:block}}
|
|
52
55
|
@container toolbar-container (min-width: 432px) and (max-width: 661px){._oj3l1ule._oj3l1ule .show-only-md{display:block}}
|
|
56
|
+
@container toolbar-container (min-width: 477px) and (max-width: 768px){._jt9u1ule .show-only-md{display:block}}
|
|
53
57
|
@container toolbar-container (min-width: 500px) and (max-width: 629px){._1vu31ule._1vu31ule .show-only-md{display:block}}
|
|
58
|
+
@container toolbar-container (min-width: 576px) and (max-width: 1024px){._ghxv1ule._ghxv1ule .show-only-lg{display:block}}
|
|
54
59
|
@container toolbar-container (min-width: 630px) and (max-width: 1023px){._1bqk1ule._1bqk1ule .show-only-lg{display:block}}
|
|
55
60
|
@container toolbar-container (min-width: 648px) and (max-width: 1023px){._1oqh1ule._1oqh1ule .show-only-lg{display:block}}
|
|
56
61
|
@container toolbar-container (min-width: 650px) and (max-width: 1023px){._1ym01ule._1ym01ule .show-only-lg{display:block}}
|
|
57
62
|
@container toolbar-container (min-width: 662px) and (max-width: 1023px){._wt211ule._wt211ule .show-only-lg{display:block}}
|
|
58
63
|
@container toolbar-container (min-width: 722px) and (max-width: 857px){._biad1ule .show-only-md{display:block}}
|
|
64
|
+
@container toolbar-container (min-width: 768px) and (max-width: 1024px){._6c751ule .show-only-lg{display:block}}
|
|
59
65
|
@container toolbar-container (min-width: 858px) and (max-width: 1023px){._1ana1ule .show-only-lg{display:block}}
|
|
60
66
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
61
67
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -17,8 +17,8 @@ var styles = {
|
|
|
17
17
|
jiraIssue: "_152xglyw _1cn41ule _4cj71ule _afriglyw _ozjb1ule _w81r1ule _1mckglyw _r2nv1ule _1ym01ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
18
18
|
jsmComment: "_s2iiglyw _o4331ule _1jvu1ule _lankglyw _1xpy1ule _1vu31ule _1b07glyw _1meg1ule _1bqk1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
19
19
|
confluenceComment: "_15nrglyw _cm5a1ule _7qjy1ule _13ioglyw _8urt1ule _cpaf1ule _18zmglyw _1uj01ule _1oqh1ule _tzm6glyw _ktne1ule _87bn1ule",
|
|
20
|
-
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
21
|
-
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
20
|
+
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule _1je21ule _tjgx1ule _jt9u1ule _6c751ule",
|
|
21
|
+
responsiveRulesReduced: "_j094glyw _1mc51ule _77vl1ule _gipeglyw _311r1ule _1h871ule _11u4glyw _v1i61ule _ghxv1ule _19x4glyw _qck01ule _87bn1ule",
|
|
22
22
|
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
23
23
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
24
24
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -74,6 +74,5 @@ export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
|
74
74
|
export { WorkItemIcon } from './ui/icons/WorkItemIcon';
|
|
75
75
|
export { WorkItemsIcon } from './ui/icons/WorkItemsIcon';
|
|
76
76
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
77
|
-
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
78
77
|
export type { IconComponent, ToolbarKeyboardNavigationProviderConfig } from './types';
|
|
79
78
|
export { useToolbarUI, ToolbarUIProvider, type ToolbarUIContextType } from './hooks/ui-context';
|
|
@@ -38,23 +38,3 @@ export declare function getSelectedRowAndColumnFromPalette(palette: PaletteColor
|
|
|
38
38
|
* @returns The resolved color value or empty string if not found
|
|
39
39
|
*/
|
|
40
40
|
export declare const getTokenCSSVariableValue: (variableExpression: string) => string;
|
|
41
|
-
/**
|
|
42
|
-
* Get the best contrasting background color for a given text color
|
|
43
|
-
* Ensures WCAG AA compliance for accessibility
|
|
44
|
-
*
|
|
45
|
-
* @param textColor - The text color to find a contrasting background for (supports HEX, RGB, RGBA etc.)
|
|
46
|
-
* @param useTokens - Whether to return design tokens instead of raw hex values
|
|
47
|
-
* @returns The best contrasting background color (hex value or design token)
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* // Get contrasting color for white text
|
|
52
|
-
* const bgForWhite = getContrastingBackgroundColor('#FFFFFF', false);
|
|
53
|
-
* // Returns: '#42526E' (dark gray)
|
|
54
|
-
*
|
|
55
|
-
* // Get contrasting color for black text with design tokens
|
|
56
|
-
* const bgForBlack = getContrastingBackgroundColor('#000000', true);
|
|
57
|
-
* // Returns: token('elevation.surface', '#FFFFFF')
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function getContrastingBackgroundColor(textColor: string): string;
|
|
@@ -74,6 +74,5 @@ export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
|
74
74
|
export { WorkItemIcon } from './ui/icons/WorkItemIcon';
|
|
75
75
|
export { WorkItemsIcon } from './ui/icons/WorkItemsIcon';
|
|
76
76
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
77
|
-
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
78
77
|
export type { IconComponent, ToolbarKeyboardNavigationProviderConfig } from './types';
|
|
79
78
|
export { useToolbarUI, ToolbarUIProvider, type ToolbarUIContextType } from './hooks/ui-context';
|
|
@@ -38,23 +38,3 @@ export declare function getSelectedRowAndColumnFromPalette(palette: PaletteColor
|
|
|
38
38
|
* @returns The resolved color value or empty string if not found
|
|
39
39
|
*/
|
|
40
40
|
export declare const getTokenCSSVariableValue: (variableExpression: string) => string;
|
|
41
|
-
/**
|
|
42
|
-
* Get the best contrasting background color for a given text color
|
|
43
|
-
* Ensures WCAG AA compliance for accessibility
|
|
44
|
-
*
|
|
45
|
-
* @param textColor - The text color to find a contrasting background for (supports HEX, RGB, RGBA etc.)
|
|
46
|
-
* @param useTokens - Whether to return design tokens instead of raw hex values
|
|
47
|
-
* @returns The best contrasting background color (hex value or design token)
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* // Get contrasting color for white text
|
|
52
|
-
* const bgForWhite = getContrastingBackgroundColor('#FFFFFF', false);
|
|
53
|
-
* // Returns: '#42526E' (dark gray)
|
|
54
|
-
*
|
|
55
|
-
* // Get contrasting color for black text with design tokens
|
|
56
|
-
* const bgForBlack = getContrastingBackgroundColor('#000000', true);
|
|
57
|
-
* // Returns: token('elevation.surface', '#FFFFFF')
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function getContrastingBackgroundColor(textColor: string): string;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.18.
|
|
6
|
+
"version": "0.18.9",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"@atlaskit/badge": "^18.3.0",
|
|
25
25
|
"@atlaskit/browser-apis": "^0.0.1",
|
|
26
26
|
"@atlaskit/css": "^0.19.0",
|
|
27
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
28
|
-
"@atlaskit/icon": "^29.
|
|
29
|
-
"@atlaskit/icon-lab": "^5.
|
|
27
|
+
"@atlaskit/dropdown-menu": "^16.4.0",
|
|
28
|
+
"@atlaskit/icon": "^29.4.0",
|
|
29
|
+
"@atlaskit/icon-lab": "^5.14.0",
|
|
30
30
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
31
|
-
"@atlaskit/popup": "^4.
|
|
31
|
+
"@atlaskit/popup": "^4.13.0",
|
|
32
32
|
"@atlaskit/primitives": "^17.0.0",
|
|
33
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
34
|
-
"@atlaskit/tokens": "^9.
|
|
35
|
-
"@atlaskit/tooltip": "^20.
|
|
33
|
+
"@atlaskit/tmp-editor-statsig": "^16.10.0",
|
|
34
|
+
"@atlaskit/tokens": "^9.1.0",
|
|
35
|
+
"@atlaskit/tooltip": "^20.12.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"@compiled/react": "^0.18.6",
|
|
38
38
|
"chromatism": "^2.6.0"
|