@atlaskit/tokens 1.24.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 +8 -0
- 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-light-saturated-palette-changes.js +13 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-saturated-palette-changes.js +8684 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8646 -0
- 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-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-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/utils/get-theme-preferences.js +27 -4
- 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-light-saturated-palette-changes.js +399 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-saturated-palette-changes.js +8677 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8639 -0
- 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-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-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/utils/get-theme-preferences.js +26 -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-light-saturated-palette-changes.js +6 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-saturated-palette-changes.js +8677 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.js +8639 -0
- 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-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-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/utils/get-theme-preferences.js +24 -2
- 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-light-saturated-palette-changes.d.ts +7 -0
- package/dist/types/artifacts/tokens-raw/atlassian-dark-saturated-palette-changes.d.ts +109 -0
- package/dist/types/artifacts/tokens-raw/atlassian-light-saturated-palette-changes.d.ts +89 -0
- 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 +1 -1
- package/dist/types/utils/get-theme-preferences.d.ts +1 -0
- 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-light-saturated-palette-changes.d.ts +7 -0
- 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-light-saturated-palette-changes.d.ts +89 -0
- 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 +1 -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-light-saturated-palette-changes.json +3519 -0
- package/package.json +4 -1
- package/report.api.md +11 -2
- package/tmp/api-report-tmp.d.ts +6 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { themeIdsWithOverrides, themeStateDefaults } from './theme-config';
|
|
2
2
|
import { isValidBrandHex } from './utils/color-utils';
|
|
3
|
-
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
3
|
+
import { getThemeOverridePreferences, getThemePreferences } from './utils/get-theme-preferences';
|
|
4
4
|
import { loadThemeCss } from './utils/theme-loading';
|
|
5
5
|
/**
|
|
6
6
|
* Takes an object containing theme preferences, and returns an array of objects for use in applying styles to the document head.
|
|
@@ -20,19 +20,22 @@ import { loadThemeCss } from './utils/theme-loading';
|
|
|
20
20
|
*/
|
|
21
21
|
const getThemeStyles = async preferences => {
|
|
22
22
|
let themePreferences;
|
|
23
|
+
let themeOverridePreferences = [];
|
|
23
24
|
if (preferences === 'all') {
|
|
24
25
|
themePreferences = themeIdsWithOverrides;
|
|
25
26
|
} else {
|
|
26
|
-
|
|
27
|
+
const themeState = {
|
|
27
28
|
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
28
29
|
dark: (preferences === null || preferences === void 0 ? void 0 : preferences.dark) || themeStateDefaults['dark'],
|
|
29
30
|
light: (preferences === null || preferences === void 0 ? void 0 : preferences.light) || themeStateDefaults['light'],
|
|
30
31
|
shape: (preferences === null || preferences === void 0 ? void 0 : preferences.shape) || themeStateDefaults['shape'],
|
|
31
32
|
spacing: (preferences === null || preferences === void 0 ? void 0 : preferences.spacing) || themeStateDefaults['spacing'],
|
|
32
33
|
typography: (preferences === null || preferences === void 0 ? void 0 : preferences.typography) || themeStateDefaults['typography']
|
|
33
|
-
}
|
|
34
|
+
};
|
|
35
|
+
themePreferences = getThemePreferences(themeState);
|
|
36
|
+
themeOverridePreferences = getThemeOverridePreferences(themeState);
|
|
34
37
|
}
|
|
35
|
-
const results = await Promise.all([...themePreferences.map(async themeId => {
|
|
38
|
+
const results = await Promise.all([...[...themePreferences, ...themeOverridePreferences].map(async themeId => {
|
|
36
39
|
try {
|
|
37
40
|
const css = await loadThemeCss(themeId);
|
|
38
41
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
const name = "@atlaskit/tokens";
|
|
4
|
-
const version = "1.
|
|
4
|
+
const 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/es2019/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
|
const name = "@atlaskit/tokens";
|
|
5
|
-
const version = "1.
|
|
5
|
+
const 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,312 @@
|
|
|
1
|
+
import defaultPalette from './palette';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Simple object check.
|
|
5
|
+
* @param item
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
export function isObject(item) {
|
|
9
|
+
return item && typeof item === 'object' && !Array.isArray(item);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Deep merge two objects.
|
|
14
|
+
* @param target
|
|
15
|
+
* @param ...sources
|
|
16
|
+
*/
|
|
17
|
+
function mergeDeep(target, ...sources) {
|
|
18
|
+
if (!sources.length) {
|
|
19
|
+
return target;
|
|
20
|
+
}
|
|
21
|
+
const source = sources.shift();
|
|
22
|
+
if (isObject(target) && isObject(source)) {
|
|
23
|
+
for (const key in source) {
|
|
24
|
+
if (isObject(source[key])) {
|
|
25
|
+
if (!target[key]) {
|
|
26
|
+
Object.assign(target, {
|
|
27
|
+
[key]: {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
mergeDeep(target[key], source[key]);
|
|
31
|
+
} else {
|
|
32
|
+
Object.assign(target, {
|
|
33
|
+
[key]: source[key]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return mergeDeep(target, ...sources);
|
|
39
|
+
}
|
|
40
|
+
const palette = mergeDeep(JSON.parse(JSON.stringify(defaultPalette)), {
|
|
41
|
+
color: {
|
|
42
|
+
palette: {
|
|
43
|
+
Blue1000: {
|
|
44
|
+
value: '#1C2B41',
|
|
45
|
+
attributes: {
|
|
46
|
+
group: 'palette',
|
|
47
|
+
category: 'blue'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
Red100: {
|
|
51
|
+
value: '#FFECEB',
|
|
52
|
+
attributes: {
|
|
53
|
+
group: 'palette',
|
|
54
|
+
category: 'red'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
Red200: {
|
|
58
|
+
value: '#FFD5D2',
|
|
59
|
+
attributes: {
|
|
60
|
+
group: 'palette',
|
|
61
|
+
category: 'red'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
Red300: {
|
|
65
|
+
value: '#FD9891',
|
|
66
|
+
attributes: {
|
|
67
|
+
group: 'palette',
|
|
68
|
+
category: 'red'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
Red400: {
|
|
72
|
+
value: '#F87168',
|
|
73
|
+
attributes: {
|
|
74
|
+
group: 'palette',
|
|
75
|
+
category: 'red'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
Red500: {
|
|
79
|
+
value: '#F15B50',
|
|
80
|
+
attributes: {
|
|
81
|
+
group: 'palette',
|
|
82
|
+
category: 'red'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
Red600: {
|
|
86
|
+
value: '#E2483D',
|
|
87
|
+
attributes: {
|
|
88
|
+
group: 'palette',
|
|
89
|
+
category: 'red'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
Red700: {
|
|
93
|
+
value: '#C9372C',
|
|
94
|
+
attributes: {
|
|
95
|
+
group: 'palette',
|
|
96
|
+
category: 'red'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
Red800: {
|
|
100
|
+
value: '#AE2E24',
|
|
101
|
+
attributes: {
|
|
102
|
+
group: 'palette',
|
|
103
|
+
category: 'red'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
Red900: {
|
|
107
|
+
value: '#5D1F1A',
|
|
108
|
+
attributes: {
|
|
109
|
+
group: 'palette',
|
|
110
|
+
category: 'red'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
Red1000: {
|
|
114
|
+
value: '#42221F',
|
|
115
|
+
attributes: {
|
|
116
|
+
group: 'palette',
|
|
117
|
+
category: 'red'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
Yellow1000: {
|
|
121
|
+
value: '#332E1B',
|
|
122
|
+
attributes: {
|
|
123
|
+
group: 'palette',
|
|
124
|
+
category: 'yellow'
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
Green100: {
|
|
128
|
+
value: '#DCFFF1',
|
|
129
|
+
attributes: {
|
|
130
|
+
group: 'palette',
|
|
131
|
+
category: 'green'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
Green1000: {
|
|
135
|
+
value: '#1C3329',
|
|
136
|
+
attributes: {
|
|
137
|
+
group: 'palette',
|
|
138
|
+
category: 'green'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
Purple1000: {
|
|
142
|
+
value: '#2B273F',
|
|
143
|
+
attributes: {
|
|
144
|
+
group: 'palette',
|
|
145
|
+
category: 'purple'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
Teal100: {
|
|
149
|
+
value: '#E7F9FF',
|
|
150
|
+
attributes: {
|
|
151
|
+
group: 'palette',
|
|
152
|
+
category: 'teal'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
Teal200: {
|
|
156
|
+
value: '#C6EDFB',
|
|
157
|
+
attributes: {
|
|
158
|
+
group: 'palette',
|
|
159
|
+
category: 'teal'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
Teal300: {
|
|
163
|
+
value: '#9DD9EE',
|
|
164
|
+
attributes: {
|
|
165
|
+
group: 'palette',
|
|
166
|
+
category: 'teal'
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
Teal400: {
|
|
170
|
+
value: '#6CC3E0',
|
|
171
|
+
attributes: {
|
|
172
|
+
group: 'palette',
|
|
173
|
+
category: 'teal'
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
Teal500: {
|
|
177
|
+
value: '#42B2D7',
|
|
178
|
+
attributes: {
|
|
179
|
+
group: 'palette',
|
|
180
|
+
category: 'teal'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
Teal600: {
|
|
184
|
+
value: '#2898BD',
|
|
185
|
+
attributes: {
|
|
186
|
+
group: 'palette',
|
|
187
|
+
category: 'teal'
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
Teal700: {
|
|
191
|
+
value: '#227D9B',
|
|
192
|
+
attributes: {
|
|
193
|
+
group: 'palette',
|
|
194
|
+
category: 'teal'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
Teal800: {
|
|
198
|
+
value: '#206A83',
|
|
199
|
+
attributes: {
|
|
200
|
+
group: 'palette',
|
|
201
|
+
category: 'teal'
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
Teal900: {
|
|
205
|
+
value: '#164555',
|
|
206
|
+
attributes: {
|
|
207
|
+
group: 'palette',
|
|
208
|
+
category: 'teal'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
Teal1000: {
|
|
212
|
+
value: '#1E3137',
|
|
213
|
+
attributes: {
|
|
214
|
+
group: 'palette',
|
|
215
|
+
category: 'teal'
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
Orange100: {
|
|
219
|
+
value: '#FFF3EB',
|
|
220
|
+
attributes: {
|
|
221
|
+
group: 'palette',
|
|
222
|
+
category: 'orange'
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
Orange200: {
|
|
226
|
+
value: '#FEDEC8',
|
|
227
|
+
attributes: {
|
|
228
|
+
group: 'palette',
|
|
229
|
+
category: 'orange'
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
Orange300: {
|
|
233
|
+
value: '#FEC195',
|
|
234
|
+
attributes: {
|
|
235
|
+
group: 'palette',
|
|
236
|
+
category: 'orange'
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
Orange400: {
|
|
240
|
+
value: '#FEA362',
|
|
241
|
+
attributes: {
|
|
242
|
+
group: 'palette',
|
|
243
|
+
category: 'orange'
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
Orange500: {
|
|
247
|
+
value: '#F38A3F',
|
|
248
|
+
attributes: {
|
|
249
|
+
group: 'palette',
|
|
250
|
+
category: 'orange'
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
Orange600: {
|
|
254
|
+
value: '#E56910',
|
|
255
|
+
attributes: {
|
|
256
|
+
group: 'palette',
|
|
257
|
+
category: 'orange'
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
Orange700: {
|
|
261
|
+
value: '#C25100',
|
|
262
|
+
attributes: {
|
|
263
|
+
group: 'palette',
|
|
264
|
+
category: 'orange'
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
Orange800: {
|
|
268
|
+
value: '#A54800',
|
|
269
|
+
attributes: {
|
|
270
|
+
group: 'palette',
|
|
271
|
+
category: 'orange'
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
Orange900: {
|
|
275
|
+
value: '#702E00',
|
|
276
|
+
attributes: {
|
|
277
|
+
group: 'palette',
|
|
278
|
+
category: 'orange'
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
Orange1000: {
|
|
282
|
+
value: '#38291E',
|
|
283
|
+
attributes: {
|
|
284
|
+
group: 'palette',
|
|
285
|
+
category: 'orange'
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
Magenta1000: {
|
|
289
|
+
value: '#3D2232',
|
|
290
|
+
attributes: {
|
|
291
|
+
group: 'palette',
|
|
292
|
+
category: 'magenta'
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
Lime100: {
|
|
296
|
+
value: '#EFFFD6',
|
|
297
|
+
attributes: {
|
|
298
|
+
group: 'palette',
|
|
299
|
+
category: 'lime'
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
Lime1000: {
|
|
303
|
+
value: '#28311B',
|
|
304
|
+
attributes: {
|
|
305
|
+
group: 'palette',
|
|
306
|
+
category: 'lime'
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
export default palette;
|
|
@@ -2,7 +2,7 @@ import { themeStateDefaults } from './theme-config';
|
|
|
2
2
|
import { isValidBrandHex } from './utils/color-utils';
|
|
3
3
|
import configurePage from './utils/configure-page';
|
|
4
4
|
import { findMissingCustomStyleElements } from './utils/custom-theme-loading-utils';
|
|
5
|
-
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
5
|
+
import { getThemeOverridePreferences, getThemePreferences } from './utils/get-theme-preferences';
|
|
6
6
|
import { loadAndAppendThemeCss } from './utils/theme-loading';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -45,7 +45,7 @@ const setGlobalTheme = async ({
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
// Determine what to load and loading strategy
|
|
48
|
-
|
|
48
|
+
let themePreferences = getThemePreferences(themeState);
|
|
49
49
|
const loadingStrategy = themeLoader ? themeLoader : loadAndAppendThemeCss;
|
|
50
50
|
|
|
51
51
|
// Load standard themes
|
|
@@ -72,6 +72,12 @@ const setGlobalTheme = async ({
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
await Promise.all(loadingTasks);
|
|
75
|
+
|
|
76
|
+
// Load override themes after standard themes
|
|
77
|
+
const themeOverridePreferences = getThemeOverridePreferences(themeState);
|
|
78
|
+
for (const themeId of themeOverridePreferences) {
|
|
79
|
+
await loadingStrategy(themeId);
|
|
80
|
+
}
|
|
75
81
|
const autoUnbind = configurePage(themeState);
|
|
76
82
|
return autoUnbind;
|
|
77
83
|
};
|
|
@@ -39,7 +39,7 @@ export const themeIds = ['light', 'dark', 'legacy-light', 'legacy-dark', 'spacin
|
|
|
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 const themeOverrideIds = ['light-new-input-border', 'dark-new-input-border'];
|
|
42
|
+
export const themeOverrideIds = ['light-new-input-border', 'dark-new-input-border', 'light-saturated-palette-changes', 'dark-saturated-palette-changes'];
|
|
43
43
|
export const themeIdsWithOverrides = [...themeIds, ...themeOverrideIds];
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -140,6 +140,30 @@ const 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,20 @@
|
|
|
1
|
+
const color = {
|
|
2
|
+
color: {
|
|
3
|
+
background: {
|
|
4
|
+
warning: {
|
|
5
|
+
bold: {
|
|
6
|
+
'[default]': {
|
|
7
|
+
value: 'Yellow300'
|
|
8
|
+
},
|
|
9
|
+
hovered: {
|
|
10
|
+
value: 'Yellow400'
|
|
11
|
+
},
|
|
12
|
+
pressed: {
|
|
13
|
+
value: 'Yellow500'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export default color;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const 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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const color = {
|
|
2
|
+
color: {
|
|
3
|
+
background: {
|
|
4
|
+
warning: {
|
|
5
|
+
bold: {
|
|
6
|
+
'[default]': {
|
|
7
|
+
value: 'Yellow300'
|
|
8
|
+
},
|
|
9
|
+
hovered: {
|
|
10
|
+
value: 'Yellow400'
|
|
11
|
+
},
|
|
12
|
+
pressed: {
|
|
13
|
+
value: 'Yellow500'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export default color;
|
|
@@ -9,13 +9,37 @@ export const getThemePreferences = themeState => {
|
|
|
9
9
|
typography
|
|
10
10
|
} = themeState;
|
|
11
11
|
const themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
12
|
+
|
|
13
|
+
// Replace light/dark theme with new palette if feature flag is on
|
|
14
|
+
if (getBooleanFF('platform.design-system-team.saturated-palette-changes_asoro')) {
|
|
15
|
+
// Iterate over themePreferences and swap out light/dark with new palette
|
|
16
|
+
themePreferences.forEach((themeId, index) => {
|
|
17
|
+
if (themeId === 'light') {
|
|
18
|
+
themePreferences[index] = 'light-saturated-palette-changes';
|
|
19
|
+
}
|
|
20
|
+
if (themeId === 'dark') {
|
|
21
|
+
themePreferences[index] = 'dark-saturated-palette-changes';
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
12
25
|
[shape, spacing, typography].forEach(themeId => {
|
|
13
26
|
if (themeId) {
|
|
14
27
|
themePreferences.push(themeId);
|
|
15
28
|
}
|
|
16
29
|
});
|
|
30
|
+
return [...new Set(themePreferences)];
|
|
31
|
+
};
|
|
32
|
+
export const getThemeOverridePreferences = themeState => {
|
|
33
|
+
const {
|
|
34
|
+
colorMode,
|
|
35
|
+
dark,
|
|
36
|
+
light
|
|
37
|
+
} = themeState;
|
|
38
|
+
const themeOverridePreferences = [];
|
|
39
|
+
const themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
17
40
|
if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
|
|
18
|
-
themePreferences.
|
|
41
|
+
themePreferences.includes('light') && themeOverridePreferences.push('light-new-input-border');
|
|
42
|
+
themePreferences.includes('dark') && themeOverridePreferences.push('dark-new-input-border');
|
|
19
43
|
}
|
|
20
|
-
return [...new Set(
|
|
44
|
+
return [...new Set(themeOverridePreferences)];
|
|
21
45
|
};
|