@atlaskit/tokens 1.54.1 → 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 +17 -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/themes/atlassian-typography-minor3.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-brand-refresh.js +8727 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-brand-refresh.js +8689 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography-adg3.js +9 -17
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography-minor3.js +9 -17
- 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/themes/atlassian-typography-minor3.js +1 -7
- 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/artifacts/tokens-raw/atlassian-typography-adg3.js +9 -17
- package/dist/es2019/artifacts/tokens-raw/atlassian-typography-minor3.js +9 -17
- 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/themes/atlassian-typography-minor3.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-brand-refresh.js +8721 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-light-brand-refresh.js +8683 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-typography-adg3.js +9 -17
- package/dist/esm/artifacts/tokens-raw/atlassian-typography-minor3.js +9 -17
- 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/themes/atlassian-typography-minor3.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-brand-refresh.d.ts +109 -0
- package/dist/types/artifacts/tokens-raw/atlassian-light-brand-refresh.d.ts +89 -0
- package/dist/types/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +1 -40
- package/dist/types/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -40
- 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 +23 -18
- 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/themes/atlassian-typography-minor3.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-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/tokens-raw/atlassian-typography-adg3.d.ts +1 -40
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -40
- 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 +23 -18
- package/figma/atlassian-dark-brand-refresh.json +3558 -0
- package/figma/atlassian-light-brand-refresh.json +3537 -0
- package/package.json +5 -1
|
@@ -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::4e47e59f97f2e7d43911658468035bca>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
const tokens = [{
|
|
@@ -150,8 +150,7 @@ const tokens = [{
|
|
|
150
150
|
"group": "typography",
|
|
151
151
|
"state": "active",
|
|
152
152
|
"introduced": "1.14.0",
|
|
153
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
154
|
-
"responsiveSmallerVariant": "font.heading.xlarge"
|
|
153
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
155
154
|
},
|
|
156
155
|
"value": "normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
157
156
|
"filePath": "schema/themes/atlassian-typography-adg3/theme.tsx",
|
|
@@ -161,8 +160,7 @@ const tokens = [{
|
|
|
161
160
|
"group": "typography",
|
|
162
161
|
"state": "active",
|
|
163
162
|
"introduced": "1.14.0",
|
|
164
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
165
|
-
"responsiveSmallerVariant": "font.heading.xlarge"
|
|
163
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
166
164
|
},
|
|
167
165
|
"value": {
|
|
168
166
|
"fontWeight": "FontWeight500",
|
|
@@ -181,8 +179,7 @@ const tokens = [{
|
|
|
181
179
|
"group": "typography",
|
|
182
180
|
"state": "active",
|
|
183
181
|
"introduced": "1.14.0",
|
|
184
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
185
|
-
"responsiveSmallerVariant": "font.heading.large"
|
|
182
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
186
183
|
},
|
|
187
184
|
"value": "normal 600 29px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
188
185
|
"filePath": "schema/themes/atlassian-typography-adg3/theme.tsx",
|
|
@@ -192,8 +189,7 @@ const tokens = [{
|
|
|
192
189
|
"group": "typography",
|
|
193
190
|
"state": "active",
|
|
194
191
|
"introduced": "1.14.0",
|
|
195
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
196
|
-
"responsiveSmallerVariant": "font.heading.large"
|
|
192
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
197
193
|
},
|
|
198
194
|
"value": {
|
|
199
195
|
"fontWeight": "FontWeight600",
|
|
@@ -212,8 +208,7 @@ const tokens = [{
|
|
|
212
208
|
"group": "typography",
|
|
213
209
|
"state": "active",
|
|
214
210
|
"introduced": "1.14.0",
|
|
215
|
-
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
216
|
-
"responsiveSmallerVariant": "font.heading.medium"
|
|
211
|
+
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
217
212
|
},
|
|
218
213
|
"value": "normal 500 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
219
214
|
"filePath": "schema/themes/atlassian-typography-adg3/theme.tsx",
|
|
@@ -223,8 +218,7 @@ const tokens = [{
|
|
|
223
218
|
"group": "typography",
|
|
224
219
|
"state": "active",
|
|
225
220
|
"introduced": "1.14.0",
|
|
226
|
-
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
227
|
-
"responsiveSmallerVariant": "font.heading.medium"
|
|
221
|
+
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
228
222
|
},
|
|
229
223
|
"value": {
|
|
230
224
|
"fontWeight": "FontWeight500",
|
|
@@ -243,8 +237,7 @@ const tokens = [{
|
|
|
243
237
|
"group": "typography",
|
|
244
238
|
"state": "active",
|
|
245
239
|
"introduced": "1.14.0",
|
|
246
|
-
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
247
|
-
"responsiveSmallerVariant": "font.heading.small"
|
|
240
|
+
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
248
241
|
},
|
|
249
242
|
"value": "normal 500 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
250
243
|
"filePath": "schema/themes/atlassian-typography-adg3/theme.tsx",
|
|
@@ -254,8 +247,7 @@ const tokens = [{
|
|
|
254
247
|
"group": "typography",
|
|
255
248
|
"state": "active",
|
|
256
249
|
"introduced": "1.14.0",
|
|
257
|
-
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
258
|
-
"responsiveSmallerVariant": "font.heading.small"
|
|
250
|
+
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
259
251
|
},
|
|
260
252
|
"value": {
|
|
261
253
|
"fontWeight": "FontWeight500",
|
|
@@ -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::9266e08ae662e609b2e76306cf8df17e>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
const tokens = [{
|
|
@@ -150,8 +150,7 @@ const tokens = [{
|
|
|
150
150
|
"group": "typography",
|
|
151
151
|
"state": "active",
|
|
152
152
|
"introduced": "1.14.0",
|
|
153
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
154
|
-
"responsiveSmallerVariant": "font.heading.xlarge"
|
|
153
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
155
154
|
},
|
|
156
155
|
"value": "normal 700 32px/36px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
157
156
|
"filePath": "schema/themes/atlassian-typography-minor3/theme.tsx",
|
|
@@ -161,8 +160,7 @@ const tokens = [{
|
|
|
161
160
|
"group": "typography",
|
|
162
161
|
"state": "active",
|
|
163
162
|
"introduced": "1.14.0",
|
|
164
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
165
|
-
"responsiveSmallerVariant": "font.heading.xlarge"
|
|
163
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H900 to Heading XXL."
|
|
166
164
|
},
|
|
167
165
|
"value": {
|
|
168
166
|
"fontWeight": "FontWeight700",
|
|
@@ -181,8 +179,7 @@ const tokens = [{
|
|
|
181
179
|
"group": "typography",
|
|
182
180
|
"state": "active",
|
|
183
181
|
"introduced": "1.14.0",
|
|
184
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
185
|
-
"responsiveSmallerVariant": "font.heading.large"
|
|
182
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
186
183
|
},
|
|
187
184
|
"value": "normal 700 28px/32px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
188
185
|
"filePath": "schema/themes/atlassian-typography-minor3/theme.tsx",
|
|
@@ -192,8 +189,7 @@ const tokens = [{
|
|
|
192
189
|
"group": "typography",
|
|
193
190
|
"state": "active",
|
|
194
191
|
"introduced": "1.14.0",
|
|
195
|
-
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
196
|
-
"responsiveSmallerVariant": "font.heading.large"
|
|
192
|
+
"description": "For overlapping brand with product promotions, such as marketplace content. Migrate instances of H800 to Heading XL."
|
|
197
193
|
},
|
|
198
194
|
"value": {
|
|
199
195
|
"fontWeight": "FontWeight700",
|
|
@@ -212,8 +208,7 @@ const tokens = [{
|
|
|
212
208
|
"group": "typography",
|
|
213
209
|
"state": "active",
|
|
214
210
|
"introduced": "1.14.0",
|
|
215
|
-
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
216
|
-
"responsiveSmallerVariant": "font.heading.medium"
|
|
211
|
+
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
217
212
|
},
|
|
218
213
|
"value": "normal 700 24px/28px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
219
214
|
"filePath": "schema/themes/atlassian-typography-minor3/theme.tsx",
|
|
@@ -223,8 +218,7 @@ const tokens = [{
|
|
|
223
218
|
"group": "typography",
|
|
224
219
|
"state": "active",
|
|
225
220
|
"introduced": "1.14.0",
|
|
226
|
-
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
227
|
-
"responsiveSmallerVariant": "font.heading.medium"
|
|
221
|
+
"description": "Product page titles, such as forms. Migrate instances of H700 to Heading L."
|
|
228
222
|
},
|
|
229
223
|
"value": {
|
|
230
224
|
"fontWeight": "FontWeight700",
|
|
@@ -243,8 +237,7 @@ const tokens = [{
|
|
|
243
237
|
"group": "typography",
|
|
244
238
|
"state": "active",
|
|
245
239
|
"introduced": "1.14.0",
|
|
246
|
-
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
247
|
-
"responsiveSmallerVariant": "font.heading.small"
|
|
240
|
+
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
248
241
|
},
|
|
249
242
|
"value": "normal 700 20px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
250
243
|
"filePath": "schema/themes/atlassian-typography-minor3/theme.tsx",
|
|
@@ -254,8 +247,7 @@ const tokens = [{
|
|
|
254
247
|
"group": "typography",
|
|
255
248
|
"state": "active",
|
|
256
249
|
"introduced": "1.14.0",
|
|
257
|
-
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
258
|
-
"responsiveSmallerVariant": "font.heading.small"
|
|
250
|
+
"description": "Headers in large components, such as modal dialogs. Migrate instances of H600 to Heading M."
|
|
259
251
|
},
|
|
260
252
|
"value": {
|
|
261
253
|
"fontWeight": "FontWeight700",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { themeIdsWithOverrides, themeStateDefaults } from './theme-config';
|
|
3
3
|
import { isValidBrandHex } from './utils/color-utils';
|
|
4
4
|
import { getThemeOverridePreferences, getThemePreferences } from './utils/get-theme-preferences';
|
|
@@ -26,9 +26,10 @@ const getThemeStyles = async preferences => {
|
|
|
26
26
|
themePreferences = themeIdsWithOverrides;
|
|
27
27
|
|
|
28
28
|
// CLEANUP: Remove
|
|
29
|
-
if (!
|
|
29
|
+
if (!fg('platform.design-system-team.increased-contrast-themes')) {
|
|
30
30
|
themePreferences = themePreferences.filter(n => n !== 'light-increased-contrast' && n !== 'dark-increased-contrast');
|
|
31
31
|
}
|
|
32
|
+
themePreferences = themePreferences.filter(n => n !== 'light-brand-refresh' && n !== 'dark-brand-refresh');
|
|
32
33
|
} else {
|
|
33
34
|
const themeState = {
|
|
34
35
|
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import tokens from './artifacts/token-names';
|
|
3
4
|
/**
|
|
4
5
|
* Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
|
|
@@ -24,8 +25,13 @@ import tokens from './artifacts/token-names';
|
|
|
24
25
|
function getTokenValue(tokenId, fallback = '') {
|
|
25
26
|
let token = tokens[tokenId];
|
|
26
27
|
let tokenValue = fallback;
|
|
27
|
-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'
|
|
28
|
-
|
|
28
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
|
|
29
|
+
if (!token) {
|
|
30
|
+
warnOnce(`Unknown token id at path: ${tokenId} in @atlaskit/tokens`);
|
|
31
|
+
}
|
|
32
|
+
if (token === '--ds-icon-subtlest' && !fg('platform-component-visual-refresh')) {
|
|
33
|
+
warnOnce(`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`);
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
if (typeof window === 'undefined') {
|
|
31
37
|
return tokenValue;
|
package/dist/es2019/get-token.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import tokens from './artifacts/token-names';
|
|
3
4
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
5
|
/**
|
|
@@ -25,8 +26,13 @@ import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
|
25
26
|
*/
|
|
26
27
|
function token(path, fallback) {
|
|
27
28
|
let token = tokens[path];
|
|
28
|
-
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'
|
|
29
|
-
|
|
29
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
|
|
30
|
+
if (!token) {
|
|
31
|
+
warnOnce(`Unknown token id at path: ${path} in @atlaskit/tokens`);
|
|
32
|
+
}
|
|
33
|
+
if (token === '--ds-icon-subtlest' && !fg('platform-component-visual-refresh')) {
|
|
34
|
+
warnOnce(`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`);
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
// 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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { themeStateDefaults } from './theme-config';
|
|
3
3
|
import { isValidBrandHex } from './utils/color-utils';
|
|
4
4
|
import configurePage from './utils/configure-page';
|
|
@@ -39,7 +39,7 @@ const setGlobalTheme = async ({
|
|
|
39
39
|
} = {}, themeLoader) => {
|
|
40
40
|
// CLEANUP: Remove. This blocks application of increased contrast themes
|
|
41
41
|
// without the feature flag enabled.
|
|
42
|
-
if (!
|
|
42
|
+
if (!fg('platform.design-system-team.increased-contrast-themes')) {
|
|
43
43
|
if (light === 'light-increased-contrast') {
|
|
44
44
|
light = 'light';
|
|
45
45
|
}
|
|
@@ -38,7 +38,7 @@ export const themeContrastModes = ['more', 'no-preference', 'auto'];
|
|
|
38
38
|
*
|
|
39
39
|
* These ids must be kebab case
|
|
40
40
|
*/
|
|
41
|
-
export const themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', 'legacy-light', 'legacy-dark', 'spacing', 'shape', 'typography-adg3', 'typography-minor3'];
|
|
41
|
+
export const 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'];
|
|
42
42
|
/**
|
|
43
43
|
* Theme override ids: the equivalent of themeIds for theme overrides.
|
|
44
44
|
* Theme overrides are temporary and there may not be any defined at times.
|
|
@@ -173,6 +173,24 @@ const themeConfig = {
|
|
|
173
173
|
attributes: {
|
|
174
174
|
type: 'typography'
|
|
175
175
|
}
|
|
176
|
+
},
|
|
177
|
+
'atlassian-light-brand-refresh': {
|
|
178
|
+
id: 'light-brand-refresh',
|
|
179
|
+
displayName: 'Light theme (Brand refresh)',
|
|
180
|
+
palette: 'brandRefreshPalette',
|
|
181
|
+
attributes: {
|
|
182
|
+
type: 'color',
|
|
183
|
+
mode: 'light'
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
'atlassian-dark-brand-refresh': {
|
|
187
|
+
id: 'dark-brand-refresh',
|
|
188
|
+
displayName: 'Dark theme (Brand refresh)',
|
|
189
|
+
palette: 'brandRefreshPalette',
|
|
190
|
+
attributes: {
|
|
191
|
+
type: 'color',
|
|
192
|
+
mode: 'dark'
|
|
193
|
+
}
|
|
176
194
|
}
|
|
177
195
|
};
|
|
178
196
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import getIncreasedContrastTheme from './get-increased-contrast-theme';
|
|
3
3
|
export const getThemePreferences = themeState => {
|
|
4
4
|
const {
|
|
@@ -13,7 +13,7 @@ export const getThemePreferences = themeState => {
|
|
|
13
13
|
const autoColorModeThemes = [light, dark];
|
|
14
14
|
const themePreferences = [];
|
|
15
15
|
if (colorMode === 'auto') {
|
|
16
|
-
if (contrastMode !== 'no-preference' &&
|
|
16
|
+
if (contrastMode !== 'no-preference' && fg('platform.design-system-team.increased-contrast-themes')) {
|
|
17
17
|
autoColorModeThemes.forEach(normalTheme => {
|
|
18
18
|
const increasedContrastTheme = getIncreasedContrastTheme(normalTheme);
|
|
19
19
|
if (increasedContrastTheme) {
|
|
@@ -24,7 +24,7 @@ export const getThemePreferences = themeState => {
|
|
|
24
24
|
themePreferences.push(...autoColorModeThemes);
|
|
25
25
|
} else {
|
|
26
26
|
themePreferences.push(themeState[colorMode]);
|
|
27
|
-
if (contrastMode !== 'no-preference' &&
|
|
27
|
+
if (contrastMode !== 'no-preference' && fg('platform.design-system-team.increased-contrast-themes')) {
|
|
28
28
|
const increasedContrastTheme = getIncreasedContrastTheme(themeState[colorMode]);
|
|
29
29
|
if (increasedContrastTheme) {
|
|
30
30
|
themePreferences.push(increasedContrastTheme);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import themeImportMap from '../artifacts/theme-import-map';
|
|
2
3
|
import { CUSTOM_THEME_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from '../constants';
|
|
3
4
|
export const loadAndAppendThemeCss = async themeId => {
|
|
@@ -17,6 +18,9 @@ export const loadAndAppendThemeCss = async themeId => {
|
|
|
17
18
|
document.head.appendChild(style);
|
|
18
19
|
};
|
|
19
20
|
export const loadThemeCss = async themeId => {
|
|
21
|
+
if ((themeId === 'light' || themeId === 'dark') && fg('platform-component-visual-refresh')) {
|
|
22
|
+
themeId += '-brand-refresh';
|
|
23
|
+
}
|
|
20
24
|
const {
|
|
21
25
|
default: themeCss
|
|
22
26
|
} = await themeImportMap[themeId]();
|