@atlaskit/tokens 1.23.0 → 1.25.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 +14 -0
- package/dist/cjs/artifacts/generated-pairs.js +2 -2
- package/dist/cjs/artifacts/palettes-raw/updated-saturated-palette.js +2258 -0
- package/dist/cjs/artifacts/theme-import-map.js +13 -1
- package/dist/cjs/artifacts/themes/atlassian-dark-saturated-palette-changes.js +13 -0
- 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-saturated-palette-changes.js +13 -0
- package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
- 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-saturated-palette-changes.js +8684 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +23 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +23 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +23 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8646 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +23 -1
- package/dist/cjs/get-theme-styles.js +10 -7
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/palettes/updated-saturated-palette.js +321 -0
- package/dist/cjs/set-global-theme.js +37 -2
- package/dist/cjs/theme-config.js +25 -1
- package/dist/cjs/tokens/atlassian-dark/color/text.js +3 -0
- package/dist/cjs/tokens/atlassian-dark-saturated-palette-changes/color/accent.js +22 -0
- package/dist/cjs/tokens/atlassian-dark-saturated-palette-changes/color/background.js +27 -0
- package/dist/cjs/tokens/atlassian-dark-saturated-palette-changes/color/icon.js +19 -0
- package/dist/cjs/tokens/atlassian-legacy-dark/color/text.js +3 -0
- package/dist/cjs/tokens/atlassian-legacy-light/color/text.js +3 -0
- package/dist/cjs/tokens/atlassian-light/color/text.js +3 -0
- package/dist/cjs/tokens/atlassian-light-saturated-palette-changes/color/accent.js +36 -0
- package/dist/cjs/tokens/atlassian-light-saturated-palette-changes/color/background.js +27 -0
- package/dist/cjs/tokens/atlassian-light-saturated-palette-changes/color/icon.js +17 -0
- package/dist/cjs/tokens/default/color/text.js +8 -0
- package/dist/cjs/utils/get-theme-preferences.js +27 -4
- package/dist/es2019/artifacts/generated-pairs.js +2 -2
- package/dist/es2019/artifacts/palettes-raw/updated-saturated-palette.js +2251 -0
- package/dist/es2019/artifacts/theme-import-map.js +5 -1
- package/dist/es2019/artifacts/themes/atlassian-dark-saturated-palette-changes.js +399 -0
- package/dist/es2019/artifacts/themes/atlassian-dark.js +2 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-dark.js +2 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +2 -1
- package/dist/es2019/artifacts/themes/atlassian-light-saturated-palette-changes.js +399 -0
- package/dist/es2019/artifacts/themes/atlassian-light.js +2 -1
- 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-saturated-palette-changes.js +8677 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +23 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +23 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +23 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8639 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +23 -1
- package/dist/es2019/get-theme-styles.js +7 -4
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/palettes/updated-saturated-palette.js +312 -0
- package/dist/es2019/set-global-theme.js +8 -2
- package/dist/es2019/theme-config.js +25 -1
- package/dist/es2019/tokens/atlassian-dark/color/text.js +3 -0
- package/dist/es2019/tokens/atlassian-dark-saturated-palette-changes/color/accent.js +15 -0
- package/dist/es2019/tokens/atlassian-dark-saturated-palette-changes/color/background.js +20 -0
- package/dist/es2019/tokens/atlassian-dark-saturated-palette-changes/color/icon.js +12 -0
- package/dist/es2019/tokens/atlassian-legacy-dark/color/text.js +3 -0
- package/dist/es2019/tokens/atlassian-legacy-light/color/text.js +3 -0
- package/dist/es2019/tokens/atlassian-light/color/text.js +3 -0
- package/dist/es2019/tokens/atlassian-light-saturated-palette-changes/color/accent.js +29 -0
- package/dist/es2019/tokens/atlassian-light-saturated-palette-changes/color/background.js +20 -0
- package/dist/es2019/tokens/atlassian-light-saturated-palette-changes/color/icon.js +10 -0
- package/dist/es2019/tokens/default/color/text.js +8 -0
- package/dist/es2019/utils/get-theme-preferences.js +26 -2
- package/dist/esm/artifacts/generated-pairs.js +2 -2
- package/dist/esm/artifacts/palettes-raw/updated-saturated-palette.js +2251 -0
- package/dist/esm/artifacts/theme-import-map.js +9 -1
- package/dist/esm/artifacts/themes/atlassian-dark-saturated-palette-changes.js +6 -0
- 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-saturated-palette-changes.js +6 -0
- package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
- 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-saturated-palette-changes.js +8677 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +23 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +23 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +23 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8639 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +23 -1
- package/dist/esm/get-theme-styles.js +11 -8
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/palettes/updated-saturated-palette.js +313 -0
- package/dist/esm/set-global-theme.js +38 -3
- package/dist/esm/theme-config.js +25 -1
- package/dist/esm/tokens/atlassian-dark/color/text.js +3 -0
- package/dist/esm/tokens/atlassian-dark-saturated-palette-changes/color/accent.js +15 -0
- package/dist/esm/tokens/atlassian-dark-saturated-palette-changes/color/background.js +20 -0
- package/dist/esm/tokens/atlassian-dark-saturated-palette-changes/color/icon.js +12 -0
- package/dist/esm/tokens/atlassian-legacy-dark/color/text.js +3 -0
- package/dist/esm/tokens/atlassian-legacy-light/color/text.js +3 -0
- package/dist/esm/tokens/atlassian-light/color/text.js +3 -0
- package/dist/esm/tokens/atlassian-light-saturated-palette-changes/color/accent.js +29 -0
- package/dist/esm/tokens/atlassian-light-saturated-palette-changes/color/background.js +20 -0
- package/dist/esm/tokens/atlassian-light-saturated-palette-changes/color/icon.js +10 -0
- package/dist/esm/tokens/default/color/text.js +8 -0
- package/dist/esm/utils/get-theme-preferences.js +24 -2
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/palettes-raw/updated-saturated-palette.d.ts +41 -0
- package/dist/types/artifacts/theme-import-map.d.ts +1 -1
- package/dist/types/artifacts/themes/atlassian-dark-saturated-palette-changes.d.ts +7 -0
- 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-saturated-palette-changes.d.ts +7 -0
- package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
- 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-saturated-palette-changes.d.ts +109 -0
- 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-saturated-palette-changes.d.ts +89 -0
- 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/palettes/palette.d.ts +1 -1
- package/dist/types/palettes/updated-saturated-palette.d.ts +10 -0
- package/dist/types/theme-config.d.ts +8 -4
- package/dist/types/tokens/atlassian-dark/utility/utility.d.ts +1 -1
- package/dist/types/tokens/atlassian-dark-saturated-palette-changes/color/accent.d.ts +4 -0
- package/dist/types/tokens/atlassian-dark-saturated-palette-changes/color/background.d.ts +4 -0
- package/dist/types/tokens/atlassian-dark-saturated-palette-changes/color/icon.d.ts +4 -0
- package/dist/types/tokens/atlassian-light/utility/utility.d.ts +1 -1
- package/dist/types/tokens/atlassian-light-saturated-palette-changes/color/accent.d.ts +4 -0
- package/dist/types/tokens/atlassian-light-saturated-palette-changes/color/background.d.ts +4 -0
- package/dist/types/tokens/atlassian-light-saturated-palette-changes/color/icon.d.ts +4 -0
- package/dist/types/tokens/atlassian-typography-adg3/theme.d.ts +1 -1
- package/dist/types/tokens/atlassian-typography-minor3/theme.d.ts +1 -1
- package/dist/types/tokens/default/utility/utility.d.ts +1 -1
- package/dist/types/types.d.ts +2 -1
- package/dist/types/utils/get-theme-preferences.d.ts +1 -0
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/palettes-raw/updated-saturated-palette.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-saturated-palette-changes.d.ts +7 -0
- 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-saturated-palette-changes.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
- 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-saturated-palette-changes.d.ts +109 -0
- 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-saturated-palette-changes.d.ts +89 -0
- 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/palettes/palette.d.ts +1 -1
- package/dist/types-ts4.5/palettes/updated-saturated-palette.d.ts +10 -0
- package/dist/types-ts4.5/theme-config.d.ts +12 -4
- package/dist/types-ts4.5/tokens/atlassian-dark/utility/utility.d.ts +1 -1
- package/dist/types-ts4.5/tokens/atlassian-dark-saturated-palette-changes/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-saturated-palette-changes/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-saturated-palette-changes/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/utility/utility.d.ts +1 -1
- package/dist/types-ts4.5/tokens/atlassian-light-saturated-palette-changes/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light-saturated-palette-changes/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light-saturated-palette-changes/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-typography-adg3/theme.d.ts +1 -1
- package/dist/types-ts4.5/tokens/atlassian-typography-minor3/theme.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 +2 -1
- package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +1 -0
- package/figma/atlassian-dark-saturated-palette-changes.json +3540 -0
- package/figma/atlassian-dark.json +9 -0
- package/figma/atlassian-legacy-dark.json +9 -0
- package/figma/atlassian-legacy-light.json +9 -0
- package/figma/atlassian-light-saturated-palette-changes.json +3519 -0
- package/figma/atlassian-light.json +9 -0
- package/package.json +5 -2
- package/report.api.md +15 -2
- package/tmp/api-report-tmp.d.ts +10 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::6009ba9010fc2a039dc1080a936d9f80>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -773,6 +773,28 @@ var tokens = [{
|
|
|
773
773
|
"name": "color.link.pressed",
|
|
774
774
|
"path": ["color", "link", "pressed"],
|
|
775
775
|
"cleanName": "color.link.pressed"
|
|
776
|
+
}, {
|
|
777
|
+
"attributes": {
|
|
778
|
+
"group": "paint",
|
|
779
|
+
"state": "active",
|
|
780
|
+
"introduced": "1.23.0",
|
|
781
|
+
"description": "Use for links in a visited state."
|
|
782
|
+
},
|
|
783
|
+
"value": "#5E4DB2",
|
|
784
|
+
"filePath": "src/tokens/atlassian-light/color/text.tsx",
|
|
785
|
+
"isSource": true,
|
|
786
|
+
"original": {
|
|
787
|
+
"attributes": {
|
|
788
|
+
"group": "paint",
|
|
789
|
+
"state": "active",
|
|
790
|
+
"introduced": "1.23.0",
|
|
791
|
+
"description": "Use for links in a visited state."
|
|
792
|
+
},
|
|
793
|
+
"value": "Purple800"
|
|
794
|
+
},
|
|
795
|
+
"name": "color.link.visited",
|
|
796
|
+
"path": ["color", "link", "visited"],
|
|
797
|
+
"cleanName": "color.link.visited"
|
|
776
798
|
}, {
|
|
777
799
|
"attributes": {
|
|
778
800
|
"group": "paint",
|
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { themeIdsWithOverrides, themeStateDefaults } from './theme-config';
|
|
5
5
|
import { isValidBrandHex } from './utils/color-utils';
|
|
6
|
-
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
6
|
+
import { getThemeOverridePreferences, getThemePreferences } from './utils/get-theme-preferences';
|
|
7
7
|
import { loadThemeCss } from './utils/theme-loading';
|
|
8
8
|
/**
|
|
9
9
|
* Takes an object containing theme preferences, and returns an array of objects for use in applying styles to the document head.
|
|
@@ -23,24 +23,27 @@ import { loadThemeCss } from './utils/theme-loading';
|
|
|
23
23
|
*/
|
|
24
24
|
var getThemeStyles = /*#__PURE__*/function () {
|
|
25
25
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(preferences) {
|
|
26
|
-
var themePreferences, results;
|
|
26
|
+
var themePreferences, themeOverridePreferences, themeState, results;
|
|
27
27
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
28
28
|
while (1) switch (_context3.prev = _context3.next) {
|
|
29
29
|
case 0:
|
|
30
|
+
themeOverridePreferences = [];
|
|
30
31
|
if (preferences === 'all') {
|
|
31
32
|
themePreferences = themeIdsWithOverrides;
|
|
32
33
|
} else {
|
|
33
|
-
|
|
34
|
+
themeState = {
|
|
34
35
|
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
35
36
|
dark: (preferences === null || preferences === void 0 ? void 0 : preferences.dark) || themeStateDefaults['dark'],
|
|
36
37
|
light: (preferences === null || preferences === void 0 ? void 0 : preferences.light) || themeStateDefaults['light'],
|
|
37
38
|
shape: (preferences === null || preferences === void 0 ? void 0 : preferences.shape) || themeStateDefaults['shape'],
|
|
38
39
|
spacing: (preferences === null || preferences === void 0 ? void 0 : preferences.spacing) || themeStateDefaults['spacing'],
|
|
39
40
|
typography: (preferences === null || preferences === void 0 ? void 0 : preferences.typography) || themeStateDefaults['typography']
|
|
40
|
-
}
|
|
41
|
+
};
|
|
42
|
+
themePreferences = getThemePreferences(themeState);
|
|
43
|
+
themeOverridePreferences = getThemeOverridePreferences(themeState);
|
|
41
44
|
}
|
|
42
|
-
_context3.next =
|
|
43
|
-
return Promise.all([].concat(_toConsumableArray(themePreferences.map( /*#__PURE__*/function () {
|
|
45
|
+
_context3.next = 4;
|
|
46
|
+
return Promise.all([].concat(_toConsumableArray([].concat(_toConsumableArray(themePreferences), _toConsumableArray(themeOverridePreferences)).map( /*#__PURE__*/function () {
|
|
44
47
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(themeId) {
|
|
45
48
|
var css;
|
|
46
49
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -108,12 +111,12 @@ var getThemeStyles = /*#__PURE__*/function () {
|
|
|
108
111
|
}
|
|
109
112
|
}, _callee2, null, [[1, 12]]);
|
|
110
113
|
}))()]));
|
|
111
|
-
case
|
|
114
|
+
case 4:
|
|
112
115
|
results = _context3.sent;
|
|
113
116
|
return _context3.abrupt("return", results.flat().filter(function (theme) {
|
|
114
117
|
return theme !== undefined;
|
|
115
118
|
}));
|
|
116
|
-
case
|
|
119
|
+
case 6:
|
|
117
120
|
case "end":
|
|
118
121
|
return _context3.stop();
|
|
119
122
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
var name = "@atlaskit/tokens";
|
|
4
|
-
var version = "1.
|
|
4
|
+
var version = "1.25.0";
|
|
5
5
|
/**
|
|
6
6
|
* Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
|
|
7
7
|
* resulting CSS Custom Property.
|
package/dist/esm/get-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
4
|
var name = "@atlaskit/tokens";
|
|
5
|
-
var version = "1.
|
|
5
|
+
var version = "1.25.0";
|
|
6
6
|
/**
|
|
7
7
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
|
8
8
|
* This should be used to implement design decisions throughout your application.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
|
+
import defaultPalette from './palette';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Simple object check.
|
|
7
|
+
* @param item
|
|
8
|
+
* @returns {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export function isObject(item) {
|
|
11
|
+
return item && _typeof(item) === 'object' && !Array.isArray(item);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Deep merge two objects.
|
|
16
|
+
* @param target
|
|
17
|
+
* @param ...sources
|
|
18
|
+
*/
|
|
19
|
+
function mergeDeep(target) {
|
|
20
|
+
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
21
|
+
sources[_key - 1] = arguments[_key];
|
|
22
|
+
}
|
|
23
|
+
if (!sources.length) {
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
var source = sources.shift();
|
|
27
|
+
if (isObject(target) && isObject(source)) {
|
|
28
|
+
for (var key in source) {
|
|
29
|
+
if (isObject(source[key])) {
|
|
30
|
+
if (!target[key]) {
|
|
31
|
+
Object.assign(target, _defineProperty({}, key, {}));
|
|
32
|
+
}
|
|
33
|
+
mergeDeep(target[key], source[key]);
|
|
34
|
+
} else {
|
|
35
|
+
Object.assign(target, _defineProperty({}, key, source[key]));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return mergeDeep.apply(void 0, [target].concat(sources));
|
|
40
|
+
}
|
|
41
|
+
var palette = mergeDeep(JSON.parse(JSON.stringify(defaultPalette)), {
|
|
42
|
+
color: {
|
|
43
|
+
palette: {
|
|
44
|
+
Blue1000: {
|
|
45
|
+
value: '#1C2B41',
|
|
46
|
+
attributes: {
|
|
47
|
+
group: 'palette',
|
|
48
|
+
category: 'blue'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
Red100: {
|
|
52
|
+
value: '#FFECEB',
|
|
53
|
+
attributes: {
|
|
54
|
+
group: 'palette',
|
|
55
|
+
category: 'red'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
Red200: {
|
|
59
|
+
value: '#FFD5D2',
|
|
60
|
+
attributes: {
|
|
61
|
+
group: 'palette',
|
|
62
|
+
category: 'red'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
Red300: {
|
|
66
|
+
value: '#FD9891',
|
|
67
|
+
attributes: {
|
|
68
|
+
group: 'palette',
|
|
69
|
+
category: 'red'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
Red400: {
|
|
73
|
+
value: '#F87168',
|
|
74
|
+
attributes: {
|
|
75
|
+
group: 'palette',
|
|
76
|
+
category: 'red'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
Red500: {
|
|
80
|
+
value: '#F15B50',
|
|
81
|
+
attributes: {
|
|
82
|
+
group: 'palette',
|
|
83
|
+
category: 'red'
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
Red600: {
|
|
87
|
+
value: '#E2483D',
|
|
88
|
+
attributes: {
|
|
89
|
+
group: 'palette',
|
|
90
|
+
category: 'red'
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
Red700: {
|
|
94
|
+
value: '#C9372C',
|
|
95
|
+
attributes: {
|
|
96
|
+
group: 'palette',
|
|
97
|
+
category: 'red'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
Red800: {
|
|
101
|
+
value: '#AE2E24',
|
|
102
|
+
attributes: {
|
|
103
|
+
group: 'palette',
|
|
104
|
+
category: 'red'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
Red900: {
|
|
108
|
+
value: '#5D1F1A',
|
|
109
|
+
attributes: {
|
|
110
|
+
group: 'palette',
|
|
111
|
+
category: 'red'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
Red1000: {
|
|
115
|
+
value: '#42221F',
|
|
116
|
+
attributes: {
|
|
117
|
+
group: 'palette',
|
|
118
|
+
category: 'red'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
Yellow1000: {
|
|
122
|
+
value: '#332E1B',
|
|
123
|
+
attributes: {
|
|
124
|
+
group: 'palette',
|
|
125
|
+
category: 'yellow'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
Green100: {
|
|
129
|
+
value: '#DCFFF1',
|
|
130
|
+
attributes: {
|
|
131
|
+
group: 'palette',
|
|
132
|
+
category: 'green'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
Green1000: {
|
|
136
|
+
value: '#1C3329',
|
|
137
|
+
attributes: {
|
|
138
|
+
group: 'palette',
|
|
139
|
+
category: 'green'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
Purple1000: {
|
|
143
|
+
value: '#2B273F',
|
|
144
|
+
attributes: {
|
|
145
|
+
group: 'palette',
|
|
146
|
+
category: 'purple'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
Teal100: {
|
|
150
|
+
value: '#E7F9FF',
|
|
151
|
+
attributes: {
|
|
152
|
+
group: 'palette',
|
|
153
|
+
category: 'teal'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
Teal200: {
|
|
157
|
+
value: '#C6EDFB',
|
|
158
|
+
attributes: {
|
|
159
|
+
group: 'palette',
|
|
160
|
+
category: 'teal'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
Teal300: {
|
|
164
|
+
value: '#9DD9EE',
|
|
165
|
+
attributes: {
|
|
166
|
+
group: 'palette',
|
|
167
|
+
category: 'teal'
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
Teal400: {
|
|
171
|
+
value: '#6CC3E0',
|
|
172
|
+
attributes: {
|
|
173
|
+
group: 'palette',
|
|
174
|
+
category: 'teal'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
Teal500: {
|
|
178
|
+
value: '#42B2D7',
|
|
179
|
+
attributes: {
|
|
180
|
+
group: 'palette',
|
|
181
|
+
category: 'teal'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
Teal600: {
|
|
185
|
+
value: '#2898BD',
|
|
186
|
+
attributes: {
|
|
187
|
+
group: 'palette',
|
|
188
|
+
category: 'teal'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
Teal700: {
|
|
192
|
+
value: '#227D9B',
|
|
193
|
+
attributes: {
|
|
194
|
+
group: 'palette',
|
|
195
|
+
category: 'teal'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
Teal800: {
|
|
199
|
+
value: '#206A83',
|
|
200
|
+
attributes: {
|
|
201
|
+
group: 'palette',
|
|
202
|
+
category: 'teal'
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
Teal900: {
|
|
206
|
+
value: '#164555',
|
|
207
|
+
attributes: {
|
|
208
|
+
group: 'palette',
|
|
209
|
+
category: 'teal'
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
Teal1000: {
|
|
213
|
+
value: '#1E3137',
|
|
214
|
+
attributes: {
|
|
215
|
+
group: 'palette',
|
|
216
|
+
category: 'teal'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
Orange100: {
|
|
220
|
+
value: '#FFF3EB',
|
|
221
|
+
attributes: {
|
|
222
|
+
group: 'palette',
|
|
223
|
+
category: 'orange'
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
Orange200: {
|
|
227
|
+
value: '#FEDEC8',
|
|
228
|
+
attributes: {
|
|
229
|
+
group: 'palette',
|
|
230
|
+
category: 'orange'
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
Orange300: {
|
|
234
|
+
value: '#FEC195',
|
|
235
|
+
attributes: {
|
|
236
|
+
group: 'palette',
|
|
237
|
+
category: 'orange'
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
Orange400: {
|
|
241
|
+
value: '#FEA362',
|
|
242
|
+
attributes: {
|
|
243
|
+
group: 'palette',
|
|
244
|
+
category: 'orange'
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
Orange500: {
|
|
248
|
+
value: '#F38A3F',
|
|
249
|
+
attributes: {
|
|
250
|
+
group: 'palette',
|
|
251
|
+
category: 'orange'
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
Orange600: {
|
|
255
|
+
value: '#E56910',
|
|
256
|
+
attributes: {
|
|
257
|
+
group: 'palette',
|
|
258
|
+
category: 'orange'
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
Orange700: {
|
|
262
|
+
value: '#C25100',
|
|
263
|
+
attributes: {
|
|
264
|
+
group: 'palette',
|
|
265
|
+
category: 'orange'
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
Orange800: {
|
|
269
|
+
value: '#A54800',
|
|
270
|
+
attributes: {
|
|
271
|
+
group: 'palette',
|
|
272
|
+
category: 'orange'
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
Orange900: {
|
|
276
|
+
value: '#702E00',
|
|
277
|
+
attributes: {
|
|
278
|
+
group: 'palette',
|
|
279
|
+
category: 'orange'
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
Orange1000: {
|
|
283
|
+
value: '#38291E',
|
|
284
|
+
attributes: {
|
|
285
|
+
group: 'palette',
|
|
286
|
+
category: 'orange'
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
Magenta1000: {
|
|
290
|
+
value: '#3D2232',
|
|
291
|
+
attributes: {
|
|
292
|
+
group: 'palette',
|
|
293
|
+
category: 'magenta'
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
Lime100: {
|
|
297
|
+
value: '#EFFFD6',
|
|
298
|
+
attributes: {
|
|
299
|
+
group: 'palette',
|
|
300
|
+
category: 'lime'
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
Lime1000: {
|
|
304
|
+
value: '#28311B',
|
|
305
|
+
attributes: {
|
|
306
|
+
group: 'palette',
|
|
307
|
+
category: 'lime'
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
export default palette;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
6
|
import { themeStateDefaults } from './theme-config';
|
|
4
7
|
import { isValidBrandHex } from './utils/color-utils';
|
|
5
8
|
import configurePage from './utils/configure-page';
|
|
6
9
|
import { findMissingCustomStyleElements } from './utils/custom-theme-loading-utils';
|
|
7
|
-
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
10
|
+
import { getThemeOverridePreferences, getThemePreferences } from './utils/get-theme-preferences';
|
|
8
11
|
import { loadAndAppendThemeCss } from './utils/theme-loading';
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -51,6 +54,10 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
51
54
|
loadingTasks,
|
|
52
55
|
mode,
|
|
53
56
|
attrOfMissingCustomStyles,
|
|
57
|
+
themeOverridePreferences,
|
|
58
|
+
_iterator,
|
|
59
|
+
_step,
|
|
60
|
+
themeId,
|
|
54
61
|
autoUnbind,
|
|
55
62
|
_args3 = arguments;
|
|
56
63
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -121,13 +128,41 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
121
128
|
_context3.next = 9;
|
|
122
129
|
return Promise.all(loadingTasks);
|
|
123
130
|
case 9:
|
|
131
|
+
// Load override themes after standard themes
|
|
132
|
+
themeOverridePreferences = getThemeOverridePreferences(themeState);
|
|
133
|
+
_iterator = _createForOfIteratorHelper(themeOverridePreferences);
|
|
134
|
+
_context3.prev = 11;
|
|
135
|
+
_iterator.s();
|
|
136
|
+
case 13:
|
|
137
|
+
if ((_step = _iterator.n()).done) {
|
|
138
|
+
_context3.next = 19;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
themeId = _step.value;
|
|
142
|
+
_context3.next = 17;
|
|
143
|
+
return loadingStrategy(themeId);
|
|
144
|
+
case 17:
|
|
145
|
+
_context3.next = 13;
|
|
146
|
+
break;
|
|
147
|
+
case 19:
|
|
148
|
+
_context3.next = 24;
|
|
149
|
+
break;
|
|
150
|
+
case 21:
|
|
151
|
+
_context3.prev = 21;
|
|
152
|
+
_context3.t0 = _context3["catch"](11);
|
|
153
|
+
_iterator.e(_context3.t0);
|
|
154
|
+
case 24:
|
|
155
|
+
_context3.prev = 24;
|
|
156
|
+
_iterator.f();
|
|
157
|
+
return _context3.finish(24);
|
|
158
|
+
case 27:
|
|
124
159
|
autoUnbind = configurePage(themeState);
|
|
125
160
|
return _context3.abrupt("return", autoUnbind);
|
|
126
|
-
case
|
|
161
|
+
case 29:
|
|
127
162
|
case "end":
|
|
128
163
|
return _context3.stop();
|
|
129
164
|
}
|
|
130
|
-
}, _callee3);
|
|
165
|
+
}, _callee3, null, [[11, 21, 24, 27]]);
|
|
131
166
|
}));
|
|
132
167
|
return function setGlobalTheme() {
|
|
133
168
|
return _ref.apply(this, arguments);
|
package/dist/esm/theme-config.js
CHANGED
|
@@ -39,7 +39,7 @@ export var themeIds = ['light', 'dark', 'legacy-light', 'legacy-dark', 'spacing'
|
|
|
39
39
|
* Theme override ids: the equivalent of themeIds for theme overrides.
|
|
40
40
|
* Theme overrides are temporary and there may not be any defined at times.
|
|
41
41
|
*/
|
|
42
|
-
export var themeOverrideIds = ['light-new-input-border', 'dark-new-input-border'];
|
|
42
|
+
export var themeOverrideIds = ['light-new-input-border', 'dark-new-input-border', 'light-saturated-palette-changes', 'dark-saturated-palette-changes'];
|
|
43
43
|
export var themeIdsWithOverrides = [].concat(themeIds, themeOverrideIds);
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -140,6 +140,30 @@ var themeConfig = {
|
|
|
140
140
|
mode: 'dark'
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
+
'atlassian-light-saturated-palette-changes': {
|
|
144
|
+
id: 'light-saturated-palette-changes',
|
|
145
|
+
displayName: 'Light Theme Saturated Palette Change',
|
|
146
|
+
palette: 'updatedSaturatedPalette',
|
|
147
|
+
override: 'light',
|
|
148
|
+
extends: 'light',
|
|
149
|
+
attributes: {
|
|
150
|
+
type: 'color',
|
|
151
|
+
mode: 'light',
|
|
152
|
+
extends: 'light'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
'atlassian-dark-saturated-palette-changes': {
|
|
156
|
+
id: 'dark-saturated-palette-changes',
|
|
157
|
+
displayName: 'Dark Theme Saturated Palette Change',
|
|
158
|
+
palette: 'updatedSaturatedPalette',
|
|
159
|
+
override: 'dark',
|
|
160
|
+
extends: 'dark',
|
|
161
|
+
attributes: {
|
|
162
|
+
type: 'color',
|
|
163
|
+
mode: 'dark',
|
|
164
|
+
extends: 'dark'
|
|
165
|
+
}
|
|
166
|
+
},
|
|
143
167
|
'atlassian-typography': {
|
|
144
168
|
id: 'typography',
|
|
145
169
|
displayName: 'Atlassian Typography (Minor Second)',
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var color = {
|
|
2
|
+
color: {
|
|
3
|
+
icon: {
|
|
4
|
+
accent: {
|
|
5
|
+
red: {
|
|
6
|
+
value: 'Red700'
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
background: {
|
|
11
|
+
accent: {
|
|
12
|
+
yellow: {
|
|
13
|
+
subtle: {
|
|
14
|
+
'[default]': {
|
|
15
|
+
value: 'Yellow300'
|
|
16
|
+
},
|
|
17
|
+
hovered: {
|
|
18
|
+
value: 'Yellow400'
|
|
19
|
+
},
|
|
20
|
+
pressed: {
|
|
21
|
+
value: 'Yellow500'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export default color;
|