@atlaskit/tokens 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +3 -2
- package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +3 -2
- package/dist/cjs/artifacts/generated-pairs.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
- package/dist/cjs/artifacts/token-default-values.js +7 -1
- package/dist/cjs/artifacts/token-names.js +7 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-light/color/background.js +22 -0
- package/dist/cjs/tokens/default/color/background.js +54 -2
- package/dist/cjs/utils/generate-custom-color-ramp.js +16 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +3 -2
- package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +3 -2
- package/dist/es2019/artifacts/generated-pairs.js +2 -2
- package/dist/es2019/artifacts/themes/atlassian-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-light.js +7 -1
- package/dist/es2019/artifacts/token-default-values.js +7 -1
- package/dist/es2019/artifacts/token-names.js +7 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-light/color/background.js +22 -0
- package/dist/es2019/tokens/default/color/background.js +54 -2
- package/dist/es2019/utils/generate-custom-color-ramp.js +16 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +3 -2
- package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +3 -2
- package/dist/esm/artifacts/generated-pairs.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
- package/dist/esm/artifacts/token-default-values.js +7 -1
- package/dist/esm/artifacts/token-names.js +7 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-light/color/background.js +22 -0
- package/dist/esm/tokens/default/color/background.js +54 -2
- package/dist/esm/utils/generate-custom-color-ramp.js +16 -7
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +2 -1
- package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +2 -1
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types/artifacts/token-default-values.d.ts +7 -1
- package/dist/types/artifacts/token-names.d.ts +13 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/tokens/atlassian-dark/utility/utility.d.ts +1 -1
- package/dist/types/tokens/atlassian-light/utility/utility.d.ts +1 -1
- package/dist/types/tokens/default/utility/utility.d.ts +1 -1
- package/dist/types/types.d.ts +10 -0
- package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +7 -1
- package/dist/types-ts4.5/artifacts/token-names.d.ts +13 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/tokens/atlassian-dark/utility/utility.d.ts +1 -1
- package/dist/types-ts4.5/tokens/atlassian-light/utility/utility.d.ts +1 -1
- package/dist/types-ts4.5/tokens/default/utility/utility.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +10 -0
- package/figma/atlassian-dark.json +56 -2
- package/figma/atlassian-legacy-dark.json +56 -2
- package/figma/atlassian-legacy-light.json +56 -2
- package/figma/atlassian-light.json +56 -2
- package/package.json +2 -2
- package/report.api.md +24 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -902
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/types/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
|
@@ -87,6 +87,17 @@ var color = {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
brand: {
|
|
90
|
+
subtlest: {
|
|
91
|
+
'[default]': {
|
|
92
|
+
value: 'B75'
|
|
93
|
+
},
|
|
94
|
+
hovered: {
|
|
95
|
+
value: 'B50'
|
|
96
|
+
},
|
|
97
|
+
pressed: {
|
|
98
|
+
value: 'B100'
|
|
99
|
+
}
|
|
100
|
+
},
|
|
90
101
|
bold: {
|
|
91
102
|
'[default]': {
|
|
92
103
|
value: 'B400'
|
|
@@ -97,6 +108,17 @@ var color = {
|
|
|
97
108
|
pressed: {
|
|
98
109
|
value: 'B500'
|
|
99
110
|
}
|
|
111
|
+
},
|
|
112
|
+
boldest: {
|
|
113
|
+
'[default]': {
|
|
114
|
+
value: 'B500'
|
|
115
|
+
},
|
|
116
|
+
hovered: {
|
|
117
|
+
value: 'B400'
|
|
118
|
+
},
|
|
119
|
+
pressed: {
|
|
120
|
+
value: 'B500'
|
|
121
|
+
}
|
|
100
122
|
}
|
|
101
123
|
},
|
|
102
124
|
selected: {
|
|
@@ -87,6 +87,17 @@ var color = {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
brand: {
|
|
90
|
+
subtlest: {
|
|
91
|
+
'[default]': {
|
|
92
|
+
value: 'Blue100'
|
|
93
|
+
},
|
|
94
|
+
hovered: {
|
|
95
|
+
value: 'Blue200'
|
|
96
|
+
},
|
|
97
|
+
pressed: {
|
|
98
|
+
value: 'Blue300'
|
|
99
|
+
}
|
|
100
|
+
},
|
|
90
101
|
bold: {
|
|
91
102
|
'[default]': {
|
|
92
103
|
value: 'Blue700'
|
|
@@ -97,6 +108,17 @@ var color = {
|
|
|
97
108
|
pressed: {
|
|
98
109
|
value: 'Blue900'
|
|
99
110
|
}
|
|
111
|
+
},
|
|
112
|
+
boldest: {
|
|
113
|
+
'[default]': {
|
|
114
|
+
value: 'Blue1000'
|
|
115
|
+
},
|
|
116
|
+
hovered: {
|
|
117
|
+
value: 'Blue900'
|
|
118
|
+
},
|
|
119
|
+
pressed: {
|
|
120
|
+
value: 'Blue800'
|
|
121
|
+
}
|
|
100
122
|
}
|
|
101
123
|
},
|
|
102
124
|
selected: {
|
|
@@ -176,6 +176,32 @@ var color = {
|
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
178
|
brand: {
|
|
179
|
+
subtlest: {
|
|
180
|
+
'[default]': {
|
|
181
|
+
attributes: {
|
|
182
|
+
group: 'paint',
|
|
183
|
+
state: 'active',
|
|
184
|
+
introduced: '1.13.0',
|
|
185
|
+
description: 'Use for the background of elements used to reinforce our brand, but with less emphasis.'
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
hovered: {
|
|
189
|
+
attributes: {
|
|
190
|
+
group: 'paint',
|
|
191
|
+
state: 'active',
|
|
192
|
+
introduced: '1.13.0',
|
|
193
|
+
description: 'Hovered state of color.background.brand.subtlest.'
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
pressed: {
|
|
197
|
+
attributes: {
|
|
198
|
+
group: 'paint',
|
|
199
|
+
state: 'active',
|
|
200
|
+
introduced: '1.13.0',
|
|
201
|
+
description: 'Pressed state of color.background.brand.subtlest'
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
179
205
|
bold: {
|
|
180
206
|
'[default]': {
|
|
181
207
|
attributes: {
|
|
@@ -190,7 +216,7 @@ var color = {
|
|
|
190
216
|
group: 'paint',
|
|
191
217
|
state: 'active',
|
|
192
218
|
introduced: '0.6.0',
|
|
193
|
-
description: 'Hovered state of color.background.brand.bold'
|
|
219
|
+
description: 'Hovered state of color.background.brand.bold.'
|
|
194
220
|
}
|
|
195
221
|
},
|
|
196
222
|
pressed: {
|
|
@@ -198,7 +224,33 @@ var color = {
|
|
|
198
224
|
group: 'paint',
|
|
199
225
|
state: 'active',
|
|
200
226
|
introduced: '0.6.0',
|
|
201
|
-
description: 'Pressed state of color.background.brand.bold'
|
|
227
|
+
description: 'Pressed state of color.background.brand.bold.'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
boldest: {
|
|
232
|
+
'[default]': {
|
|
233
|
+
attributes: {
|
|
234
|
+
group: 'paint',
|
|
235
|
+
state: 'active',
|
|
236
|
+
introduced: '1.13.0',
|
|
237
|
+
description: 'Use for the background of elements used to reinforce our brand, that need to stand out a lot.'
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
hovered: {
|
|
241
|
+
attributes: {
|
|
242
|
+
group: 'paint',
|
|
243
|
+
state: 'active',
|
|
244
|
+
introduced: '1.13.0',
|
|
245
|
+
description: 'Hovered state of color.background.brand.boldest.'
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
pressed: {
|
|
249
|
+
attributes: {
|
|
250
|
+
group: 'paint',
|
|
251
|
+
state: 'active',
|
|
252
|
+
introduced: '1.13.0',
|
|
253
|
+
description: 'Pressed state of color.background.brand.boldest.'
|
|
202
254
|
}
|
|
203
255
|
}
|
|
204
256
|
}
|
|
@@ -8,14 +8,14 @@ exports.getClosestColorIndex = exports.generateTokenMapWithContrastCheck = expor
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var
|
|
11
|
+
var _atlassianDarkTokenValueForContrastCheck = _interopRequireDefault(require("../artifacts/atlassian-dark-token-value-for-contrast-check"));
|
|
12
12
|
var _colorUtils = require("./color-utils");
|
|
13
13
|
var _customThemeTokenContrastCheck = require("./custom-theme-token-contrast-check");
|
|
14
14
|
var _hctColorUtils = require("./hct-color-utils");
|
|
15
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
var lowLuminanceContrastRatios = [1.12, 1.33, 2.03, 2.73, 3.33, 4.27, 5.2, 6.62, 12.46,
|
|
18
|
-
var highLuminanceContrastRatios = [1.08, 1.24, 1.55, 1.99, 2.45, 3.34, 4.64, 6.1, 10.19,
|
|
17
|
+
var lowLuminanceContrastRatios = [1.12, 1.33, 2.03, 2.73, 3.33, 4.27, 5.2, 6.62, 12.46, 14.25];
|
|
18
|
+
var highLuminanceContrastRatios = [1.08, 1.24, 1.55, 1.99, 2.45, 3.34, 4.64, 6.1, 10.19, 12.6];
|
|
19
19
|
var getClosestColorIndex = function getClosestColorIndex(themeRamp, brandColor) {
|
|
20
20
|
// Iterate over themeRamp and find whichever color is closest to brandColor
|
|
21
21
|
var closestColorIndex = 0;
|
|
@@ -109,9 +109,15 @@ var generateTokenMap = function generateTokenMap(brandColor, mode, themeRamp) {
|
|
|
109
109
|
customThemeTokenMapLight = {
|
|
110
110
|
'color.text.brand': closestColorIndex,
|
|
111
111
|
'color.icon.brand': closestColorIndex,
|
|
112
|
+
'color.background.brand.subtlest': 0,
|
|
113
|
+
'color.background.brand.subtlest.hovered': 1,
|
|
114
|
+
'color.background.brand.subtlest.pressed': 2,
|
|
112
115
|
'color.background.brand.bold': closestColorIndex,
|
|
113
116
|
'color.background.brand.bold.hovered': brandBoldSelectedHoveredIndex,
|
|
114
117
|
'color.background.brand.bold.pressed': brandBoldSelectedPressedIndex,
|
|
118
|
+
'color.background.brand.boldest': 9,
|
|
119
|
+
'color.background.brand.boldest.hovered': 8,
|
|
120
|
+
'color.background.brand.boldest.pressed': 7,
|
|
115
121
|
'color.border.brand': closestColorIndex,
|
|
116
122
|
'color.text.selected': closestColorIndex,
|
|
117
123
|
'color.icon.selected': closestColorIndex,
|
|
@@ -129,9 +135,15 @@ var generateTokenMap = function generateTokenMap(brandColor, mode, themeRamp) {
|
|
|
129
135
|
};
|
|
130
136
|
} else {
|
|
131
137
|
customThemeTokenMapLight = {
|
|
138
|
+
'color.background.brand.subtlest': 0,
|
|
139
|
+
'color.background.brand.subtlest.hovered': 1,
|
|
140
|
+
'color.background.brand.subtlest.pressed': 2,
|
|
132
141
|
'color.background.brand.bold': 6,
|
|
133
142
|
'color.background.brand.bold.hovered': 7,
|
|
134
143
|
'color.background.brand.bold.pressed': 8,
|
|
144
|
+
'color.background.brand.boldest': 9,
|
|
145
|
+
'color.background.brand.boldest.hovered': 8,
|
|
146
|
+
'color.background.brand.boldest.pressed': 7,
|
|
135
147
|
'color.border.brand': 6,
|
|
136
148
|
'color.background.selected.bold': 6,
|
|
137
149
|
'color.background.selected.bold.hovered': 7,
|
|
@@ -171,10 +183,7 @@ var generateTokenMap = function generateTokenMap(brandColor, mode, themeRamp) {
|
|
|
171
183
|
* in dark mode, shift color.background.brand.bold to the brand color
|
|
172
184
|
*/
|
|
173
185
|
if (inputContrast < 4.5) {
|
|
174
|
-
var
|
|
175
|
-
var inverseTextColor = (_rawTokensDark$find = _atlassianDark.default.find(function (token) {
|
|
176
|
-
return token.cleanName === 'color.text.inverse';
|
|
177
|
-
})) === null || _rawTokensDark$find === void 0 ? void 0 : _rawTokensDark$find.value;
|
|
186
|
+
var inverseTextColor = _atlassianDarkTokenValueForContrastCheck.default['color.text.inverse'];
|
|
178
187
|
if ((0, _colorUtils.getContrastRatio)(inverseTextColor, brandColor) >= 4.5 && closestColorIndex >= 2) {
|
|
179
188
|
customThemeTokenMapDark['color.background.brand.bold'] = closestColorIndex;
|
|
180
189
|
customThemeTokenMapDark['color.background.brand.bold.hovered'] = closestColorIndex - 1;
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Token names mapped to their values, used for contrast checking when generating custom themes
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::2d922d82772ca155fb2fe7b5c63dc69a>>
|
|
7
7
|
* @codegenCommand yarn build tokens
|
|
8
8
|
*/
|
|
9
9
|
const tokenValues = {
|
|
@@ -12,6 +12,7 @@ const tokenValues = {
|
|
|
12
12
|
'color.text.selected': '#579DFF',
|
|
13
13
|
'color.background.selected': '#092957',
|
|
14
14
|
'color.border.brand': '#579DFF',
|
|
15
|
-
'color.chart.brand': '#388BFF'
|
|
15
|
+
'color.chart.brand': '#388BFF',
|
|
16
|
+
'color.text.inverse': '#1D2125'
|
|
16
17
|
};
|
|
17
18
|
export default tokenValues;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Token names mapped to their values, used for contrast checking when generating custom themes
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::068e846d4121ab9afc08e7a1f99dbb5e>>
|
|
7
7
|
* @codegenCommand yarn build tokens
|
|
8
8
|
*/
|
|
9
9
|
const tokenValues = {
|
|
@@ -12,6 +12,7 @@ const tokenValues = {
|
|
|
12
12
|
'color.text.selected': '#0C66E4',
|
|
13
13
|
'color.background.selected': '#E9F2FF',
|
|
14
14
|
'color.border.brand': '#0C66E4',
|
|
15
|
-
'color.chart.brand': '#1D7AFC'
|
|
15
|
+
'color.chart.brand': '#1D7AFC',
|
|
16
|
+
'color.text.inverse': '#FFFFFF'
|
|
16
17
|
};
|
|
17
18
|
export default tokenValues;
|