@atlaskit/tokens 1.55.0 → 1.56.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 +8 -0
- package/dist/cjs/artifacts/generated-pairs.js +2 -2
- package/dist/cjs/artifacts/palettes-raw/palette-brand-refresh.js +2257 -0
- package/dist/cjs/artifacts/theme-import-map.js +13 -1
- package/dist/cjs/artifacts/themes/atlassian-dark-brand-refresh.js +12 -0
- package/dist/cjs/artifacts/themes/atlassian-light-brand-refresh.js +12 -0
- package/dist/cjs/artifacts/token-default-values.js +2 -1
- package/dist/cjs/artifacts/token-names.js +2 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-brand-refresh.js +8727 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-brand-refresh.js +8689 -0
- package/dist/cjs/get-theme-styles.js +4 -1
- package/dist/cjs/get-token-value.js +8 -2
- package/dist/cjs/get-token.js +8 -2
- package/dist/cjs/set-global-theme.js +1 -1
- package/dist/cjs/theme-config.js +19 -1
- package/dist/cjs/utils/get-theme-preferences.js +2 -2
- package/dist/cjs/utils/theme-loading.js +7 -3
- package/dist/es2019/artifacts/generated-pairs.js +2 -2
- package/dist/es2019/artifacts/palettes-raw/palette-brand-refresh.js +2251 -0
- package/dist/es2019/artifacts/theme-import-map.js +6 -2
- package/dist/es2019/artifacts/themes/atlassian-dark-brand-refresh.js +401 -0
- package/dist/es2019/artifacts/themes/atlassian-light-brand-refresh.js +401 -0
- package/dist/es2019/artifacts/token-default-values.js +2 -1
- package/dist/es2019/artifacts/token-names.js +2 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-brand-refresh.js +8721 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-brand-refresh.js +8683 -0
- package/dist/es2019/get-theme-styles.js +3 -2
- package/dist/es2019/get-token-value.js +8 -2
- package/dist/es2019/get-token.js +8 -2
- package/dist/es2019/set-global-theme.js +2 -2
- package/dist/es2019/theme-config.js +19 -1
- package/dist/es2019/utils/get-theme-preferences.js +3 -3
- package/dist/es2019/utils/theme-loading.js +4 -0
- package/dist/esm/artifacts/generated-pairs.js +2 -2
- package/dist/esm/artifacts/palettes-raw/palette-brand-refresh.js +2251 -0
- package/dist/esm/artifacts/theme-import-map.js +9 -1
- package/dist/esm/artifacts/themes/atlassian-dark-brand-refresh.js +6 -0
- package/dist/esm/artifacts/themes/atlassian-light-brand-refresh.js +6 -0
- package/dist/esm/artifacts/token-default-values.js +2 -1
- package/dist/esm/artifacts/token-names.js +2 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-brand-refresh.js +8721 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-light-brand-refresh.js +8683 -0
- package/dist/esm/get-theme-styles.js +5 -2
- package/dist/esm/get-token-value.js +8 -2
- package/dist/esm/get-token.js +8 -2
- package/dist/esm/set-global-theme.js +2 -2
- package/dist/esm/theme-config.js +19 -1
- package/dist/esm/utils/get-theme-preferences.js +3 -3
- package/dist/esm/utils/theme-loading.js +7 -3
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/palettes-raw/palette-brand-refresh.d.ts +41 -0
- package/dist/types/artifacts/theme-import-map.d.ts +1 -1
- package/dist/types/artifacts/themes/atlassian-dark-brand-refresh.d.ts +7 -0
- package/dist/types/artifacts/themes/atlassian-light-brand-refresh.d.ts +7 -0
- package/dist/types/artifacts/token-default-values.d.ts +2 -1
- package/dist/types/artifacts/token-names.d.ts +3 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark-brand-refresh.d.ts +109 -0
- package/dist/types/artifacts/tokens-raw/atlassian-light-brand-refresh.d.ts +89 -0
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/entry-points/css-type-schema.codegen.d.ts +2 -2
- package/dist/types/theme-config.d.ts +6 -6
- package/dist/types/types.d.ts +22 -1
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/palettes-raw/palette-brand-refresh.d.ts +41 -0
- package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark-brand-refresh.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-light-brand-refresh.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/token-names.d.ts +3 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-brand-refresh.d.ts +109 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-brand-refresh.d.ts +89 -0
- 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/entry-points/css-type-schema.codegen.d.ts +2 -2
- package/dist/types-ts4.5/theme-config.d.ts +8 -4
- package/dist/types-ts4.5/types.d.ts +22 -1
- package/figma/atlassian-dark-brand-refresh.json +3558 -0
- package/figma/atlassian-light-brand-refresh.json +3537 -0
- package/package.json +5 -1
|
@@ -43,11 +43,14 @@ var getThemeStyles = /*#__PURE__*/function () {
|
|
|
43
43
|
themePreferences = _themeConfig.themeIdsWithOverrides;
|
|
44
44
|
|
|
45
45
|
// CLEANUP: Remove
|
|
46
|
-
if (!(0, _platformFeatureFlags.
|
|
46
|
+
if (!(0, _platformFeatureFlags.fg)('platform.design-system-team.increased-contrast-themes')) {
|
|
47
47
|
themePreferences = themePreferences.filter(function (n) {
|
|
48
48
|
return n !== 'light-increased-contrast' && n !== 'dark-increased-contrast';
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
+
themePreferences = themePreferences.filter(function (n) {
|
|
52
|
+
return n !== 'light-brand-refresh' && n !== 'dark-brand-refresh';
|
|
53
|
+
});
|
|
51
54
|
} else {
|
|
52
55
|
themeState = {
|
|
53
56
|
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || _themeConfig.themeStateDefaults['colorMode'],
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
10
11
|
/**
|
|
11
12
|
* Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
|
|
@@ -32,8 +33,13 @@ function getTokenValue(tokenId) {
|
|
|
32
33
|
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
33
34
|
var token = _tokenNames.default[tokenId];
|
|
34
35
|
var tokenValue = fallback;
|
|
35
|
-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'
|
|
36
|
-
|
|
36
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
|
|
37
|
+
if (!token) {
|
|
38
|
+
(0, _warnOnce.default)("Unknown token id at path: ".concat(tokenId, " in @atlaskit/tokens"));
|
|
39
|
+
}
|
|
40
|
+
if (token === '--ds-icon-subtlest' && !(0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
|
|
41
|
+
(0, _warnOnce.default)("Token \"color.icon.subtlest\" is only available when feature flag \"platform-component-visual-refresh\" is on, don't use it if the flag can't be turned on on this page");
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
if (typeof window === 'undefined') {
|
|
39
45
|
return tokenValue;
|
package/dist/cjs/get-token.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
10
11
|
var _constants = require("./constants");
|
|
11
12
|
/**
|
|
@@ -32,8 +33,13 @@ var _constants = require("./constants");
|
|
|
32
33
|
*/
|
|
33
34
|
function token(path, fallback) {
|
|
34
35
|
var token = _tokenNames.default[path];
|
|
35
|
-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'
|
|
36
|
-
|
|
36
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
|
|
37
|
+
if (!token) {
|
|
38
|
+
(0, _warnOnce.default)("Unknown token id at path: ".concat(path, " in @atlaskit/tokens"));
|
|
39
|
+
}
|
|
40
|
+
if (token === '--ds-icon-subtlest' && !(0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
|
|
41
|
+
(0, _warnOnce.default)("Token \"color.icon.subtlest\" is only available when feature flag \"platform-component-visual-refresh\" is on, don't use it if the flag can't be turned on on this page");
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
// if the token is not found - replacing it with variable name without any value, to avoid it being undefined which would result in invalid css
|
|
@@ -80,7 +80,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
80
80
|
themeLoader = _args3.length > 1 ? _args3[1] : undefined;
|
|
81
81
|
// CLEANUP: Remove. This blocks application of increased contrast themes
|
|
82
82
|
// without the feature flag enabled.
|
|
83
|
-
if (!(0, _platformFeatureFlags.
|
|
83
|
+
if (!(0, _platformFeatureFlags.fg)('platform.design-system-team.increased-contrast-themes')) {
|
|
84
84
|
if (light === 'light-increased-contrast') {
|
|
85
85
|
light = 'light';
|
|
86
86
|
}
|
package/dist/cjs/theme-config.js
CHANGED
|
@@ -44,7 +44,7 @@ var themeContrastModes = exports.themeContrastModes = ['more', 'no-preference',
|
|
|
44
44
|
*
|
|
45
45
|
* These ids must be kebab case
|
|
46
46
|
*/
|
|
47
|
-
var themeIds = exports.themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', 'legacy-light', 'legacy-dark', 'spacing', 'shape', 'typography-adg3', 'typography-minor3'];
|
|
47
|
+
var themeIds = exports.themeIds = ['light-increased-contrast', 'light', 'light-future', 'light-brand-refresh', 'dark', 'dark-future', 'dark-increased-contrast', 'dark-brand-refresh', 'legacy-light', 'legacy-dark', 'spacing', 'shape', 'typography-adg3', 'typography-minor3'];
|
|
48
48
|
/**
|
|
49
49
|
* Theme override ids: the equivalent of themeIds for theme overrides.
|
|
50
50
|
* Theme overrides are temporary and there may not be any defined at times.
|
|
@@ -179,6 +179,24 @@ var themeConfig = {
|
|
|
179
179
|
attributes: {
|
|
180
180
|
type: 'typography'
|
|
181
181
|
}
|
|
182
|
+
},
|
|
183
|
+
'atlassian-light-brand-refresh': {
|
|
184
|
+
id: 'light-brand-refresh',
|
|
185
|
+
displayName: 'Light theme (Brand refresh)',
|
|
186
|
+
palette: 'brandRefreshPalette',
|
|
187
|
+
attributes: {
|
|
188
|
+
type: 'color',
|
|
189
|
+
mode: 'light'
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
'atlassian-dark-brand-refresh': {
|
|
193
|
+
id: 'dark-brand-refresh',
|
|
194
|
+
displayName: 'Dark theme (Brand refresh)',
|
|
195
|
+
palette: 'brandRefreshPalette',
|
|
196
|
+
attributes: {
|
|
197
|
+
type: 'color',
|
|
198
|
+
mode: 'dark'
|
|
199
|
+
}
|
|
182
200
|
}
|
|
183
201
|
};
|
|
184
202
|
|
|
@@ -19,7 +19,7 @@ var getThemePreferences = exports.getThemePreferences = function getThemePrefere
|
|
|
19
19
|
var autoColorModeThemes = [light, dark];
|
|
20
20
|
var themePreferences = [];
|
|
21
21
|
if (colorMode === 'auto') {
|
|
22
|
-
if (contrastMode !== 'no-preference' && (0, _platformFeatureFlags.
|
|
22
|
+
if (contrastMode !== 'no-preference' && (0, _platformFeatureFlags.fg)('platform.design-system-team.increased-contrast-themes')) {
|
|
23
23
|
autoColorModeThemes.forEach(function (normalTheme) {
|
|
24
24
|
var increasedContrastTheme = (0, _getIncreasedContrastTheme.default)(normalTheme);
|
|
25
25
|
if (increasedContrastTheme) {
|
|
@@ -30,7 +30,7 @@ var getThemePreferences = exports.getThemePreferences = function getThemePrefere
|
|
|
30
30
|
themePreferences.push.apply(themePreferences, autoColorModeThemes);
|
|
31
31
|
} else {
|
|
32
32
|
themePreferences.push(themeState[colorMode]);
|
|
33
|
-
if (contrastMode !== 'no-preference' && (0, _platformFeatureFlags.
|
|
33
|
+
if (contrastMode !== 'no-preference' && (0, _platformFeatureFlags.fg)('platform.design-system-team.increased-contrast-themes')) {
|
|
34
34
|
var increasedContrastTheme = (0, _getIncreasedContrastTheme.default)(themeState[colorMode]);
|
|
35
35
|
if (increasedContrastTheme) {
|
|
36
36
|
themePreferences.push(increasedContrastTheme);
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.moreContrastMediaQuery = exports.loadThemeCss = exports.loadAndAppendThemeCss = exports.darkModeMediaQuery = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _themeImportMap = _interopRequireDefault(require("../artifacts/theme-import-map"));
|
|
11
12
|
var _constants = require("../constants");
|
|
12
13
|
var loadAndAppendThemeCss = exports.loadAndAppendThemeCss = /*#__PURE__*/function () {
|
|
@@ -51,13 +52,16 @@ var loadThemeCss = exports.loadThemeCss = /*#__PURE__*/function () {
|
|
|
51
52
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
52
53
|
while (1) switch (_context2.prev = _context2.next) {
|
|
53
54
|
case 0:
|
|
54
|
-
|
|
55
|
+
if ((themeId === 'light' || themeId === 'dark') && (0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
|
|
56
|
+
themeId += '-brand-refresh';
|
|
57
|
+
}
|
|
58
|
+
_context2.next = 3;
|
|
55
59
|
return _themeImportMap.default[themeId]();
|
|
56
|
-
case
|
|
60
|
+
case 3:
|
|
57
61
|
_yield$themeImportMap = _context2.sent;
|
|
58
62
|
themeCss = _yield$themeImportMap.default;
|
|
59
63
|
return _context2.abrupt("return", themeCss);
|
|
60
|
-
case
|
|
64
|
+
case 6:
|
|
61
65
|
case "end":
|
|
62
66
|
return _context2.stop();
|
|
63
67
|
}
|