@atlaskit/tokens 1.13.0 → 1.13.2
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 +12 -0
- package/dist/cjs/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +3 -3
- package/dist/cjs/custom-theme.js +17 -13
- package/dist/cjs/get-global-theme.js +4 -3
- package/dist/cjs/get-ssr-auto-script.js +21 -0
- package/dist/cjs/get-theme-html-attrs.js +76 -0
- package/dist/cjs/get-theme-styles.js +139 -0
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/index.js +15 -15
- package/dist/cjs/set-global-theme.js +9 -242
- package/dist/cjs/theme-config.js +23 -1
- package/dist/cjs/theme-mutation-observer.js +4 -4
- package/dist/cjs/{utils/theme-state-transformer.js → theme-state-transformer.js} +1 -1
- package/dist/cjs/tokens/atlassian-legacy-light/color/border.js +1 -1
- package/dist/cjs/use-theme-observer.js +7 -6
- package/dist/cjs/utils/get-theme-preferences.js +35 -0
- package/dist/cjs/utils/theme-loading.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +3 -3
- package/dist/es2019/custom-theme.js +10 -10
- package/dist/es2019/get-global-theme.js +4 -3
- package/dist/es2019/get-ssr-auto-script.js +23 -0
- package/dist/es2019/get-theme-html-attrs.js +62 -0
- package/dist/es2019/get-theme-styles.js +72 -0
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/index.js +9 -6
- package/dist/es2019/set-global-theme.js +5 -185
- package/dist/es2019/theme-config.js +21 -0
- package/dist/es2019/theme-mutation-observer.js +2 -2
- package/dist/es2019/{utils/theme-state-transformer.js → theme-state-transformer.js} +1 -1
- package/dist/es2019/tokens/atlassian-legacy-light/color/border.js +1 -1
- package/dist/es2019/use-theme-observer.js +5 -4
- package/dist/es2019/utils/get-theme-preferences.js +28 -0
- package/dist/es2019/utils/theme-loading.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +3 -3
- package/dist/esm/custom-theme.js +15 -11
- package/dist/esm/get-global-theme.js +4 -3
- package/dist/esm/get-ssr-auto-script.js +15 -0
- package/dist/esm/get-theme-html-attrs.js +68 -0
- package/dist/esm/get-theme-styles.js +126 -0
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/index.js +9 -6
- package/dist/esm/set-global-theme.js +6 -233
- package/dist/esm/theme-config.js +21 -0
- package/dist/esm/theme-mutation-observer.js +4 -3
- package/dist/esm/{utils/theme-state-transformer.js → theme-state-transformer.js} +1 -1
- package/dist/esm/tokens/atlassian-legacy-light/color/border.js +1 -1
- package/dist/esm/use-theme-observer.js +5 -4
- package/dist/esm/utils/get-theme-preferences.js +27 -0
- package/dist/esm/utils/theme-loading.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types/custom-theme.d.ts +4 -9
- package/dist/types/get-global-theme.d.ts +2 -1
- package/dist/types/get-ssr-auto-script.d.ts +11 -0
- package/dist/types/get-theme-html-attrs.d.ts +17 -0
- package/dist/types/get-theme-styles.d.ts +24 -0
- package/dist/types/index.d.ts +10 -9
- package/dist/types/set-global-theme.d.ts +1 -58
- package/dist/types/theme-config.d.ts +24 -0
- package/dist/types/theme-mutation-observer.d.ts +1 -1
- package/dist/{types-ts4.5/utils → types}/theme-state-transformer.d.ts +1 -1
- package/dist/types/use-theme-observer.d.ts +2 -1
- package/dist/types/utils/custom-theme-loading-utils.d.ts +2 -3
- package/dist/types/utils/generate-custom-color-ramp.d.ts +1 -2
- package/dist/types/utils/get-theme-preferences.d.ts +2 -0
- package/dist/types/utils/theme-loading.d.ts +1 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types-ts4.5/custom-theme.d.ts +4 -9
- package/dist/types-ts4.5/get-global-theme.d.ts +2 -1
- package/dist/types-ts4.5/get-ssr-auto-script.d.ts +11 -0
- package/dist/types-ts4.5/get-theme-html-attrs.d.ts +17 -0
- package/dist/types-ts4.5/get-theme-styles.d.ts +24 -0
- package/dist/types-ts4.5/index.d.ts +10 -9
- package/dist/types-ts4.5/set-global-theme.d.ts +1 -58
- package/dist/types-ts4.5/theme-config.d.ts +24 -0
- package/dist/types-ts4.5/theme-mutation-observer.d.ts +1 -1
- package/dist/{types/utils → types-ts4.5}/theme-state-transformer.d.ts +1 -1
- package/dist/types-ts4.5/use-theme-observer.d.ts +2 -1
- package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +2 -3
- package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +1 -2
- package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +2 -0
- package/dist/types-ts4.5/utils/theme-loading.d.ts +1 -0
- package/figma/atlassian-legacy-light.json +1 -1
- package/package.json +1 -1
- package/report.api.md +8 -8
- package/tmp/api-report-tmp.d.ts +1158 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { COLOR_MODE_ATTRIBUTE, CUSTOM_THEME_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
|
|
3
|
+
import { themeStateDefaults } from './theme-config';
|
|
4
|
+
import { themeObjectToString } from './theme-state-transformer';
|
|
5
|
+
import { isValidBrandHex } from './utils/color-utils';
|
|
6
|
+
import { hash } from './utils/hash';
|
|
7
|
+
const defaultColorMode = 'light';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Server-side rendering utility. Generates the valid HTML attributes for a given theme.
|
|
11
|
+
* Note: this utility does not handle automatic theme switching.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object<string, string>} themeOptions - Theme options object
|
|
14
|
+
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
15
|
+
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
16
|
+
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
17
|
+
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
18
|
+
* @param {string} themeState.typography The typography theme to be applied.
|
|
19
|
+
* @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} Object of HTML attributes to be applied to the document root
|
|
22
|
+
*/
|
|
23
|
+
const getThemeHtmlAttrs = ({
|
|
24
|
+
colorMode = themeStateDefaults['colorMode'],
|
|
25
|
+
dark = themeStateDefaults['dark'],
|
|
26
|
+
light = themeStateDefaults['light'],
|
|
27
|
+
shape = themeStateDefaults['shape'],
|
|
28
|
+
spacing = themeStateDefaults['spacing'],
|
|
29
|
+
typography = themeStateDefaults['typography'],
|
|
30
|
+
UNSAFE_themeOptions = themeStateDefaults['UNSAFE_themeOptions']
|
|
31
|
+
} = {}) => {
|
|
32
|
+
let themePreferences = {
|
|
33
|
+
dark,
|
|
34
|
+
light,
|
|
35
|
+
shape,
|
|
36
|
+
spacing,
|
|
37
|
+
typography
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Load spacing by default, currently behind a feature flag
|
|
41
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
42
|
+
themePreferences = {
|
|
43
|
+
dark,
|
|
44
|
+
light,
|
|
45
|
+
shape,
|
|
46
|
+
spacing: 'spacing',
|
|
47
|
+
typography
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const themeAttribute = themeObjectToString(themePreferences);
|
|
51
|
+
const result = {
|
|
52
|
+
[THEME_DATA_ATTRIBUTE]: themeAttribute,
|
|
53
|
+
[COLOR_MODE_ATTRIBUTE]: colorMode === 'auto' ? defaultColorMode : colorMode
|
|
54
|
+
};
|
|
55
|
+
if (UNSAFE_themeOptions && isValidBrandHex(UNSAFE_themeOptions.brandColor)) {
|
|
56
|
+
const optionString = JSON.stringify(UNSAFE_themeOptions);
|
|
57
|
+
const uniqueId = hash(optionString);
|
|
58
|
+
result[CUSTOM_THEME_ATTRIBUTE] = uniqueId;
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
export default getThemeHtmlAttrs;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { themeIdsWithOverrides, themeStateDefaults } from './theme-config';
|
|
2
|
+
import { isValidBrandHex } from './utils/color-utils';
|
|
3
|
+
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
4
|
+
import { loadThemeCss } from './utils/theme-loading';
|
|
5
|
+
/**
|
|
6
|
+
* Takes an object containing theme preferences, and returns an array of objects for use in applying styles to the document head.
|
|
7
|
+
* Only supplies the color themes necessary for initial render, based on the current themeState. I.e. if in light mode, dark mode themes are not returned.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object<string, string>} themeState The themes and color mode that should be applied.
|
|
10
|
+
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
11
|
+
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
12
|
+
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
13
|
+
* @param {string} themeState.shape The shape theme to be applied.
|
|
14
|
+
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
15
|
+
* @param {string} themeState.typography The typography theme to be applied.
|
|
16
|
+
* @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
|
|
17
|
+
*
|
|
18
|
+
* @returns A Promise of an object array, containing theme IDs, data-attributes to attach to the theme, and the theme CSS.
|
|
19
|
+
* If an error is encountered while loading themes, the themes array will be empty.
|
|
20
|
+
*/
|
|
21
|
+
const getThemeStyles = async preferences => {
|
|
22
|
+
let themePreferences;
|
|
23
|
+
if (preferences === 'all') {
|
|
24
|
+
themePreferences = themeIdsWithOverrides;
|
|
25
|
+
} else {
|
|
26
|
+
themePreferences = getThemePreferences({
|
|
27
|
+
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
28
|
+
dark: (preferences === null || preferences === void 0 ? void 0 : preferences.dark) || themeStateDefaults['dark'],
|
|
29
|
+
light: (preferences === null || preferences === void 0 ? void 0 : preferences.light) || themeStateDefaults['light'],
|
|
30
|
+
shape: (preferences === null || preferences === void 0 ? void 0 : preferences.shape) || themeStateDefaults['shape'],
|
|
31
|
+
spacing: (preferences === null || preferences === void 0 ? void 0 : preferences.spacing) || themeStateDefaults['spacing'],
|
|
32
|
+
typography: (preferences === null || preferences === void 0 ? void 0 : preferences.typography) || themeStateDefaults['typography']
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const results = await Promise.all([...themePreferences.map(async themeId => {
|
|
36
|
+
try {
|
|
37
|
+
const css = await loadThemeCss(themeId);
|
|
38
|
+
return {
|
|
39
|
+
id: themeId,
|
|
40
|
+
attrs: {
|
|
41
|
+
'data-theme': themeId
|
|
42
|
+
},
|
|
43
|
+
css
|
|
44
|
+
};
|
|
45
|
+
} catch {
|
|
46
|
+
// Return undefined if there's an error loading it, will be filtered out later.
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
// Add custom themes if they're present
|
|
51
|
+
(async () => {
|
|
52
|
+
var _preferences$UNSAFE_t;
|
|
53
|
+
if (preferences !== 'all' && preferences !== null && preferences !== void 0 && preferences.UNSAFE_themeOptions && isValidBrandHex(preferences === null || preferences === void 0 ? void 0 : (_preferences$UNSAFE_t = preferences.UNSAFE_themeOptions) === null || _preferences$UNSAFE_t === void 0 ? void 0 : _preferences$UNSAFE_t.brandColor)) {
|
|
54
|
+
try {
|
|
55
|
+
const {
|
|
56
|
+
getCustomThemeStyles
|
|
57
|
+
} = await import( /* webpackChunkName: "@atlaskit-internal_atlassian-custom-theme" */
|
|
58
|
+
'./custom-theme');
|
|
59
|
+
const customThemeStyles = await getCustomThemeStyles({
|
|
60
|
+
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
61
|
+
UNSAFE_themeOptions: preferences === null || preferences === void 0 ? void 0 : preferences.UNSAFE_themeOptions
|
|
62
|
+
});
|
|
63
|
+
return customThemeStyles;
|
|
64
|
+
} catch {
|
|
65
|
+
// Return undefined if there's an error loading it, will be filtered out later.
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
})()]);
|
|
70
|
+
return results.flat().filter(theme => theme !== undefined);
|
|
71
|
+
};
|
|
72
|
+
export default getThemeStyles;
|
|
@@ -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 = "
|
|
4
|
+
const version = "1.13.2";
|
|
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 = "
|
|
5
|
+
const version = "1.13.2";
|
|
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.
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
export { default as themeConfig } from './theme-config';
|
|
1
2
|
export { default as token } from './get-token';
|
|
2
3
|
export { default as getTokenValue } from './get-token-value';
|
|
3
|
-
export { default as setGlobalTheme
|
|
4
|
-
export { default as
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
4
|
+
export { default as setGlobalTheme } from './set-global-theme';
|
|
5
|
+
export { default as getThemeStyles } from './get-theme-styles';
|
|
6
|
+
export { default as getThemeHtmlAttrs } from './get-theme-html-attrs';
|
|
7
|
+
export { default as getSSRAutoScript } from './get-ssr-auto-script';
|
|
8
|
+
export { default as useThemeObserver } from './use-theme-observer';
|
|
9
|
+
export { default as ThemeMutationObserver } from './theme-mutation-observer';
|
|
10
|
+
export { default as getGlobalTheme } from './get-global-theme';
|
|
11
|
+
export { themeStringToObject, themeObjectToString } from './theme-state-transformer';
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
import { bind } from 'bind-event-listener';
|
|
2
2
|
import noop from '@atlaskit/ds-lib/noop';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { COLOR_MODE_ATTRIBUTE } from './constants';
|
|
4
|
+
import getThemeHtmlAttrs from './get-theme-html-attrs';
|
|
5
|
+
import { themeStateDefaults } from './theme-config';
|
|
6
6
|
import { isValidBrandHex } from './utils/color-utils';
|
|
7
7
|
import { findMissingCustomStyleElements } from './utils/custom-theme-loading-utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { themeObjectToString } from './utils/theme-state-transformer';
|
|
8
|
+
import { getThemePreferences } from './utils/get-theme-preferences';
|
|
9
|
+
import { darkModeMediaQuery, loadAndAppendThemeCss } from './utils/theme-loading';
|
|
11
10
|
|
|
12
11
|
// Represents theme state once mounted to the page (auto is hidden from observers)
|
|
13
12
|
|
|
14
|
-
const defaultColorMode = 'light';
|
|
15
13
|
const isMatchMediaAvailable = typeof window !== 'undefined' && 'matchMedia' in window;
|
|
16
|
-
const darkModeMediaQuery = '(prefers-color-scheme: dark)';
|
|
17
14
|
const darkModeMql = isMatchMediaAvailable && window.matchMedia(darkModeMediaQuery);
|
|
18
15
|
let unbindThemeChangeListener = noop;
|
|
19
|
-
export const themeStateDefaults = {
|
|
20
|
-
colorMode: 'auto',
|
|
21
|
-
dark: 'dark',
|
|
22
|
-
light: 'light',
|
|
23
|
-
shape: undefined,
|
|
24
|
-
spacing: undefined,
|
|
25
|
-
typography: undefined,
|
|
26
|
-
UNSAFE_themeOptions: undefined
|
|
27
|
-
};
|
|
28
16
|
|
|
29
17
|
/**
|
|
30
18
|
* Updates the current theme when the system theme changes. Should be bound
|
|
@@ -35,33 +23,6 @@ const checkNativeListener = function (e) {
|
|
|
35
23
|
const element = document.documentElement;
|
|
36
24
|
element.setAttribute(COLOR_MODE_ATTRIBUTE, e.matches ? 'dark' : 'light');
|
|
37
25
|
};
|
|
38
|
-
const getThemePreferences = themeState => {
|
|
39
|
-
const {
|
|
40
|
-
colorMode,
|
|
41
|
-
dark,
|
|
42
|
-
light,
|
|
43
|
-
shape,
|
|
44
|
-
spacing,
|
|
45
|
-
typography
|
|
46
|
-
} = themeState;
|
|
47
|
-
const themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
48
|
-
[shape, spacing, typography].forEach(themeId => {
|
|
49
|
-
if (themeId) {
|
|
50
|
-
themePreferences.push(themeId);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
|
|
54
|
-
themePreferences.push(`${themePreferences.includes('dark') ? 'dark' : 'light'}-new-input-border`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Load shape and spacing by default, currently behind a feature flag
|
|
58
|
-
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
59
|
-
if (!themePreferences.includes('spacing')) {
|
|
60
|
-
themePreferences.push('spacing');
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return [...new Set(themePreferences)];
|
|
64
|
-
};
|
|
65
26
|
|
|
66
27
|
/**
|
|
67
28
|
* Sets the theme globally at runtime. This updates the `data-theme` and `data-color-mode` attributes on your page's <html> tag.
|
|
@@ -145,145 +106,4 @@ const setGlobalTheme = async ({
|
|
|
145
106
|
});
|
|
146
107
|
return unbindThemeChangeListener;
|
|
147
108
|
};
|
|
148
|
-
/**
|
|
149
|
-
* Takes an object containing theme preferences, and returns an array of objects for use in applying styles to the document head.
|
|
150
|
-
* Only supplies the color themes necessary for initial render, based on the current themeState. I.e. if in light mode, dark mode themes are not returned.
|
|
151
|
-
*
|
|
152
|
-
* @param {Object<string, string>} themeState The themes and color mode that should be applied.
|
|
153
|
-
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
154
|
-
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
155
|
-
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
156
|
-
* @param {string} themeState.shape The shape theme to be applied.
|
|
157
|
-
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
158
|
-
* @param {string} themeState.typography The typography theme to be applied.
|
|
159
|
-
* @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
|
|
160
|
-
*
|
|
161
|
-
* @returns A Promise of an object array, containing theme IDs, data-attributes to attach to the theme, and the theme CSS.
|
|
162
|
-
* If an error is encountered while loading themes, the themes array will be empty.
|
|
163
|
-
*/
|
|
164
|
-
export const getThemeStyles = async preferences => {
|
|
165
|
-
let themePreferences;
|
|
166
|
-
if (preferences === 'all') {
|
|
167
|
-
themePreferences = themeIdsWithOverrides;
|
|
168
|
-
} else {
|
|
169
|
-
themePreferences = getThemePreferences({
|
|
170
|
-
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
171
|
-
dark: (preferences === null || preferences === void 0 ? void 0 : preferences.dark) || themeStateDefaults['dark'],
|
|
172
|
-
light: (preferences === null || preferences === void 0 ? void 0 : preferences.light) || themeStateDefaults['light'],
|
|
173
|
-
shape: (preferences === null || preferences === void 0 ? void 0 : preferences.shape) || themeStateDefaults['shape'],
|
|
174
|
-
spacing: (preferences === null || preferences === void 0 ? void 0 : preferences.spacing) || themeStateDefaults['spacing'],
|
|
175
|
-
typography: (preferences === null || preferences === void 0 ? void 0 : preferences.typography) || themeStateDefaults['typography']
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
const results = await Promise.all([...themePreferences.map(async themeId => {
|
|
179
|
-
try {
|
|
180
|
-
const css = await loadThemeCss(themeId);
|
|
181
|
-
return {
|
|
182
|
-
id: themeId,
|
|
183
|
-
attrs: {
|
|
184
|
-
'data-theme': themeId
|
|
185
|
-
},
|
|
186
|
-
css
|
|
187
|
-
};
|
|
188
|
-
} catch {
|
|
189
|
-
// Return undefined if there's an error loading it, will be filtered out later.
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
}),
|
|
193
|
-
// Add custom themes if they're present
|
|
194
|
-
(async () => {
|
|
195
|
-
var _preferences$UNSAFE_t;
|
|
196
|
-
if (preferences !== 'all' && preferences !== null && preferences !== void 0 && preferences.UNSAFE_themeOptions && isValidBrandHex(preferences === null || preferences === void 0 ? void 0 : (_preferences$UNSAFE_t = preferences.UNSAFE_themeOptions) === null || _preferences$UNSAFE_t === void 0 ? void 0 : _preferences$UNSAFE_t.brandColor)) {
|
|
197
|
-
try {
|
|
198
|
-
const {
|
|
199
|
-
getCustomThemeStyles
|
|
200
|
-
} = await import( /* webpackChunkName: "@atlaskit-internal_atlassian-custom-theme" */
|
|
201
|
-
'./custom-theme');
|
|
202
|
-
const customThemeStyles = await getCustomThemeStyles({
|
|
203
|
-
colorMode: (preferences === null || preferences === void 0 ? void 0 : preferences.colorMode) || themeStateDefaults['colorMode'],
|
|
204
|
-
UNSAFE_themeOptions: preferences === null || preferences === void 0 ? void 0 : preferences.UNSAFE_themeOptions
|
|
205
|
-
});
|
|
206
|
-
return customThemeStyles;
|
|
207
|
-
} catch {
|
|
208
|
-
// Return undefined if there's an error loading it, will be filtered out later.
|
|
209
|
-
return undefined;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
})()]);
|
|
213
|
-
return results.flat().filter(theme => theme !== undefined);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Server-side rendering utility. Generates the valid HTML attributes for a given theme.
|
|
218
|
-
* Note: this utility does not handle automatic theme switching.
|
|
219
|
-
*
|
|
220
|
-
* @param {Object<string, string>} themeOptions - Theme options object
|
|
221
|
-
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
222
|
-
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
223
|
-
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
224
|
-
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
225
|
-
* @param {string} themeState.typography The typography theme to be applied.
|
|
226
|
-
* @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
|
|
227
|
-
*
|
|
228
|
-
* @returns {Object} Object of HTML attributes to be applied to the document root
|
|
229
|
-
*/
|
|
230
|
-
export const getThemeHtmlAttrs = ({
|
|
231
|
-
colorMode = themeStateDefaults['colorMode'],
|
|
232
|
-
dark = themeStateDefaults['dark'],
|
|
233
|
-
light = themeStateDefaults['light'],
|
|
234
|
-
shape = themeStateDefaults['shape'],
|
|
235
|
-
spacing = themeStateDefaults['spacing'],
|
|
236
|
-
typography = themeStateDefaults['typography'],
|
|
237
|
-
UNSAFE_themeOptions = themeStateDefaults['UNSAFE_themeOptions']
|
|
238
|
-
} = {}) => {
|
|
239
|
-
let themePreferences = {
|
|
240
|
-
dark,
|
|
241
|
-
light,
|
|
242
|
-
shape,
|
|
243
|
-
spacing,
|
|
244
|
-
typography
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
// Load spacing by default, currently behind a feature flag
|
|
248
|
-
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
249
|
-
themePreferences = {
|
|
250
|
-
dark,
|
|
251
|
-
light,
|
|
252
|
-
shape,
|
|
253
|
-
spacing: 'spacing',
|
|
254
|
-
typography
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
const themeAttribute = themeObjectToString(themePreferences);
|
|
258
|
-
const result = {
|
|
259
|
-
[THEME_DATA_ATTRIBUTE]: themeAttribute,
|
|
260
|
-
[COLOR_MODE_ATTRIBUTE]: colorMode === 'auto' ? defaultColorMode : colorMode
|
|
261
|
-
};
|
|
262
|
-
if (UNSAFE_themeOptions && isValidBrandHex(UNSAFE_themeOptions.brandColor)) {
|
|
263
|
-
const optionString = JSON.stringify(UNSAFE_themeOptions);
|
|
264
|
-
const uniqueId = hash(optionString);
|
|
265
|
-
result[CUSTOM_THEME_ATTRIBUTE] = uniqueId;
|
|
266
|
-
}
|
|
267
|
-
return result;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Provides a script that, when executed before paint, sets the `data-color-mode` attribute based on the current system theme,
|
|
272
|
-
* to enable SSR support for automatic theme switching, avoid a flash of un-themed content on first paint.
|
|
273
|
-
*
|
|
274
|
-
* @param {string} colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
275
|
-
*
|
|
276
|
-
* @returns {string} A string to be added to the innerHTML of a script tag in the document head
|
|
277
|
-
*/
|
|
278
|
-
export const getSSRAutoScript = colorMode => {
|
|
279
|
-
return colorMode === 'auto' ? `(
|
|
280
|
-
() => {
|
|
281
|
-
try {
|
|
282
|
-
const mql = window.matchMedia('${darkModeMediaQuery}');
|
|
283
|
-
const colorMode = mql.matches ? 'dark' : 'light';
|
|
284
|
-
document.documentElement.setAttribute('${COLOR_MODE_ATTRIBUTE}', colorMode);
|
|
285
|
-
} catch (e) {}
|
|
286
|
-
}
|
|
287
|
-
)()` : undefined;
|
|
288
|
-
};
|
|
289
109
|
export default setGlobalTheme;
|
|
@@ -141,4 +141,25 @@ const themeConfig = {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* ThemeOptionsSchema: additional configuration options used to customize Atlassian's themes
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* ThemeState: the standard representation of an app's current theme and preferences
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* themeStateDefaults: the default values for ThemeState used by theming utilities
|
|
155
|
+
*/
|
|
156
|
+
export const themeStateDefaults = {
|
|
157
|
+
colorMode: 'auto',
|
|
158
|
+
dark: 'dark',
|
|
159
|
+
light: 'light',
|
|
160
|
+
shape: undefined,
|
|
161
|
+
spacing: undefined,
|
|
162
|
+
typography: undefined,
|
|
163
|
+
UNSAFE_themeOptions: undefined
|
|
164
|
+
};
|
|
144
165
|
export default themeConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { COLOR_MODE_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
|
|
3
|
-
import
|
|
3
|
+
import getGlobalTheme from './get-global-theme';
|
|
4
4
|
/**
|
|
5
5
|
* A MutationObserver which watches the `<html>` element for changes to the theme.
|
|
6
6
|
*
|
|
@@ -14,7 +14,7 @@ import { getGlobalTheme } from './get-global-theme';
|
|
|
14
14
|
* observer.observe();
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export class ThemeMutationObserver {
|
|
17
|
+
export default class ThemeMutationObserver {
|
|
18
18
|
constructor(callback) {
|
|
19
19
|
_defineProperty(this, "observer", null);
|
|
20
20
|
_defineProperty(this, "mediaObserver", null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import getGlobalTheme from './get-global-theme';
|
|
3
|
+
import ThemeMutationObserver from './theme-mutation-observer';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A React hook which returns the current themes and color-mode set on `<html>`.
|
|
@@ -15,7 +15,7 @@ import { ThemeMutationObserver } from './theme-mutation-observer';
|
|
|
15
15
|
* }, [theme.colorMode]);
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
const useThemeObserver = () => {
|
|
19
19
|
const [theme, setTheme] = useState(getGlobalTheme());
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
const observer = new ThemeMutationObserver(theme => setTheme(theme));
|
|
@@ -23,4 +23,5 @@ export const useThemeObserver = () => {
|
|
|
23
23
|
return () => observer.disconnect();
|
|
24
24
|
}, []);
|
|
25
25
|
return theme;
|
|
26
|
-
};
|
|
26
|
+
};
|
|
27
|
+
export default useThemeObserver;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
export const getThemePreferences = themeState => {
|
|
3
|
+
const {
|
|
4
|
+
colorMode,
|
|
5
|
+
dark,
|
|
6
|
+
light,
|
|
7
|
+
shape,
|
|
8
|
+
spacing,
|
|
9
|
+
typography
|
|
10
|
+
} = themeState;
|
|
11
|
+
const themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
12
|
+
[shape, spacing, typography].forEach(themeId => {
|
|
13
|
+
if (themeId) {
|
|
14
|
+
themePreferences.push(themeId);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
|
|
18
|
+
themePreferences.push(`${themePreferences.includes('dark') ? 'dark' : 'light'}-new-input-border`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Load shape and spacing by default, currently behind a feature flag
|
|
22
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
23
|
+
if (!themePreferences.includes('spacing')) {
|
|
24
|
+
themePreferences.push('spacing');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return [...new Set(themePreferences)];
|
|
28
|
+
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -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::6c33e244168e3fd752767b58505680ca>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
|
-
export default "\nhtml[data-color-mode=\"light\"][data-theme~=\"light:legacy-light\"],\nhtml[data-color-mode=\"dark\"][data-theme~=\"dark:legacy-light\"] {\n color-scheme: light;\n --ds-text: #172B4D;\n --ds-text-accent-lime: #4C6B1F;\n --ds-text-accent-lime-bolder: #37471F;\n --ds-text-accent-red: #DE350B;\n --ds-text-accent-red-bolder: #BF2600;\n --ds-text-accent-orange: #F18D13;\n --ds-text-accent-orange-bolder: #B65C02;\n --ds-text-accent-yellow: #FF991F;\n --ds-text-accent-yellow-bolder: #FF8B00;\n --ds-text-accent-green: #00875A;\n --ds-text-accent-green-bolder: #006644;\n --ds-text-accent-teal: #00A3BF;\n --ds-text-accent-teal-bolder: #008DA6;\n --ds-text-accent-blue: #0052CC;\n --ds-text-accent-blue-bolder: #0747A6;\n --ds-text-accent-purple: #5243AA;\n --ds-text-accent-purple-bolder: #403294;\n --ds-text-accent-magenta: #E774BB;\n --ds-text-accent-magenta-bolder: #DA62AC;\n --ds-text-accent-gray: #505F79;\n --ds-text-accent-gray-bolder: #172B4D;\n --ds-text-disabled: #A5ADBA;\n --ds-text-inverse: #FFFFFF;\n --ds-text-selected: #0052CC;\n --ds-text-brand: #0065FF;\n --ds-text-danger: #DE350B;\n --ds-text-warning: #974F0C;\n --ds-text-warning-inverse: #172B4D;\n --ds-text-success: #006644;\n --ds-text-discovery: #403294;\n --ds-text-information: #0052CC;\n --ds-text-subtlest: #7A869A;\n --ds-text-subtle: #42526E;\n --ds-link: #0052CC;\n --ds-link-pressed: #0747A6;\n --ds-icon: #505F79;\n --ds-icon-accent-lime: #6A9A23;\n --ds-icon-accent-red: #FF5630;\n --ds-icon-accent-orange: #D94008;\n --ds-icon-accent-yellow: #FFAB00;\n --ds-icon-accent-green: #36B37E;\n --ds-icon-accent-teal: #00B8D9;\n --ds-icon-accent-blue: #0065FF;\n --ds-icon-accent-purple: #6554C0;\n --ds-icon-accent-magenta: #CD519D;\n --ds-icon-accent-gray: #5E6C84;\n --ds-icon-disabled: #8993A4;\n --ds-icon-inverse: #FFFFFF;\n --ds-icon-selected: #0052CC;\n --ds-icon-brand: #0065FF;\n --ds-icon-danger: #DE350B;\n --ds-icon-warning: #FFC400;\n --ds-icon-warning-inverse: #253858;\n --ds-icon-success: #00875A;\n --ds-icon-discovery: #8777D9;\n --ds-icon-information: #0747A6;\n --ds-icon-subtle: #6B778C;\n --ds-border: #091e4221;\n --ds-border-accent-lime: #6A9A23;\n --ds-border-accent-red: #FF5630;\n --ds-border-accent-orange: #D94008;\n --ds-border-accent-yellow: #FFAB00;\n --ds-border-accent-green: #36B37E;\n --ds-border-accent-teal: #00B8D9;\n --ds-border-accent-blue: #0065FF;\n --ds-border-accent-purple: #6554C0;\n --ds-border-accent-magenta: #CD519D;\n --ds-border-accent-gray: #5E6C84;\n --ds-border-disabled: #FAFBFC;\n --ds-border-focused: #4C9AFF;\n --ds-border-input: #FAFBFC;\n --ds-border-inverse: #FFFFFF;\n --ds-border-selected: #0052CC;\n --ds-border-brand: #0052CC;\n --ds-border-danger: #FF5630;\n --ds-border-warning: #FFC400;\n --ds-border-success: #00875A;\n --ds-border-discovery: #998DD9;\n --ds-border-information: #0065FF;\n --ds-border-bold: #344563;\n --ds-background-accent-lime-subtlest: #EEFBDA;\n --ds-background-accent-lime-subtler: #D3F1A7;\n --ds-background-accent-lime-subtle: #94C748;\n --ds-background-accent-lime-bolder: #5B7F24;\n --ds-background-accent-red-subtlest: #FF8F73;\n --ds-background-accent-red-subtler: #FF7452;\n --ds-background-accent-red-subtle: #DE350B;\n --ds-background-accent-red-bolder: #DE350B;\n --ds-background-accent-orange-subtlest: #F18D13;\n --ds-background-accent-orange-subtler: #B65C02;\n --ds-background-accent-orange-subtle: #5F3811;\n --ds-background-accent-orange-bolder: #43290F;\n --ds-background-accent-yellow-subtlest: #FFE380;\n --ds-background-accent-yellow-subtler: #FFC400;\n --ds-background-accent-yellow-subtle: #FF991F;\n --ds-background-accent-yellow-bolder: #FF991F;\n --ds-background-accent-green-subtlest: #79F2C0;\n --ds-background-accent-green-subtler: #57D9A3;\n --ds-background-accent-green-subtle: #00875A;\n --ds-background-accent-green-bolder: #00875A;\n --ds-background-accent-teal-subtlest: #79E2F2;\n --ds-background-accent-teal-subtler: #00C7E6;\n --ds-background-accent-teal-subtle: #00A3BF;\n --ds-background-accent-teal-bolder: #00A3BF;\n --ds-background-accent-blue-subtlest: #4C9AFF;\n --ds-background-accent-blue-subtler: #2684FF;\n --ds-background-accent-blue-subtle: #0052CC;\n --ds-background-accent-blue-bolder: #0052CC;\n --ds-background-accent-purple-subtlest: #998DD9;\n --ds-background-accent-purple-subtler: #8777D9;\n --ds-background-accent-purple-subtle: #5243AA;\n --ds-background-accent-purple-bolder: #5243AA;\n --ds-background-accent-magenta-subtlest: #E774BB;\n --ds-background-accent-magenta-subtler: #E774BB;\n --ds-background-accent-magenta-subtle: #E774BB;\n --ds-background-accent-magenta-bolder: #E774BB;\n --ds-background-accent-gray-subtlest: #6B778C;\n --ds-background-accent-gray-subtler: #5E6C84;\n --ds-background-accent-gray-subtle: #42526E;\n --ds-background-accent-gray-bolder: #505F79;\n --ds-background-disabled: #091e4289;\n --ds-background-input: #FAFBFC;\n --ds-background-input-hovered: #EBECF0;\n --ds-background-input-pressed: #FFFFFF;\n --ds-background-inverse-subtle: #00000029;\n --ds-background-inverse-subtle-hovered: #0000003D;\n --ds-background-inverse-subtle-pressed: #00000052;\n --ds-background-neutral: #DFE1E6;\n --ds-background-neutral-hovered: #091e4214;\n --ds-background-neutral-pressed: #B3D4FF;\n --ds-background-neutral-subtle: transparent;\n --ds-background-neutral-subtle-hovered: #091e4214;\n --ds-background-neutral-subtle-pressed: #B3D4FF;\n --ds-background-neutral-bold: #42526E;\n --ds-background-neutral-bold-hovered: #505F79;\n --ds-background-neutral-bold-pressed: #344563;\n --ds-background-selected: #DEEBFF;\n --ds-background-selected-hovered: #B3D4FF;\n --ds-background-selected-pressed: #4C9AFF;\n --ds-background-selected-bold: #0052CC;\n --ds-background-selected-bold-hovered: #2684FF;\n --ds-background-selected-bold-pressed: #0052CC;\n --ds-background-brand-subtlest: #B3D4FF;\n --ds-background-brand-subtlest-hovered: #DEEBFF;\n --ds-background-brand-subtlest-pressed: #4C9AFF;\n --ds-background-brand-bold: #0052CC;\n --ds-background-brand-bold-hovered: #0065FF;\n --ds-background-brand-bold-pressed: #0747A6;\n --ds-background-brand-boldest: #0747A6;\n --ds-background-brand-boldest-hovered: #0052CC;\n --ds-background-brand-boldest-pressed: #0747A6;\n --ds-background-danger: #FFEBE6;\n --ds-background-danger-hovered: #FFBDAD;\n --ds-background-danger-pressed: #FF8F73;\n --ds-background-danger-bold: #DE350B;\n --ds-background-danger-bold-hovered: #FF5630;\n --ds-background-danger-bold-pressed: #BF2600;\n --ds-background-warning: #FFFAE6;\n --ds-background-warning-hovered: #FFF0B3;\n --ds-background-warning-pressed: #FFE380;\n --ds-background-warning-bold: #FFAB00;\n --ds-background-warning-bold-hovered: #FFC400;\n --ds-background-warning-bold-pressed: #FF991F;\n --ds-background-success: #E3FCEF;\n --ds-background-success-hovered: #ABF5D1;\n --ds-background-success-pressed: #79F2C0;\n --ds-background-success-bold: #00875A;\n --ds-background-success-bold-hovered: #57D9A3;\n --ds-background-success-bold-pressed: #00875A;\n --ds-background-discovery: #EAE6FF;\n --ds-background-discovery-hovered: #C0B6F2;\n --ds-background-discovery-pressed: #998DD9;\n --ds-background-discovery-bold: #5243AA;\n --ds-background-discovery-bold-hovered: #8777D9;\n --ds-background-discovery-bold-pressed: #5243AA;\n --ds-background-information: #DEEBFF;\n --ds-background-information-hovered: #B3D4FF;\n --ds-background-information-pressed: #4C9AFF;\n --ds-background-information-bold: #0052CC;\n --ds-background-information-bold-hovered: #2684FF;\n --ds-background-information-bold-pressed: #0052CC;\n --ds-blanket: #091e4289;\n --ds-blanket-selected: #388BFF14;\n --ds-blanket-danger: #EF5C4814;\n --ds-interaction-hovered: #00000029;\n --ds-interaction-pressed: #00000052;\n --ds-skeleton: #F4F5F7;\n --ds-skeleton-subtle: #091e420a;\n --ds-chart-categorical-1: #00B8D9;\n --ds-chart-categorical-1-hovered: #00A3BF;\n --ds-chart-categorical-2: #5243AA;\n --ds-chart-categorical-2-hovered: #403294;\n --ds-chart-categorical-3: #D94008;\n --ds-chart-categorical-3-hovered: #B65C02;\n --ds-chart-categorical-4: #943D73;\n --ds-chart-categorical-4-hovered: #50253F;\n --ds-chart-categorical-5: #0052CC;\n --ds-chart-categorical-5-hovered: #0747A6;\n --ds-chart-categorical-6: #5243AA;\n --ds-chart-categorical-6-hovered: #403294;\n --ds-chart-categorical-7: #50253F;\n --ds-chart-categorical-7-hovered: #341829;\n --ds-chart-categorical-8: #974F0C;\n --ds-chart-categorical-8-hovered: #5F3811;\n --ds-chart-lime-bold: #6A9A23;\n --ds-chart-lime-bold-hovered: #5B7F24;\n --ds-chart-lime-bolder: #5B7F24;\n --ds-chart-lime-bolder-hovered: #4C6B1F;\n --ds-chart-lime-boldest: #4C6B1F;\n --ds-chart-lime-boldest-hovered: #37471F;\n --ds-chart-neutral: #5E6C84;\n --ds-chart-neutral-hovered: #505F79;\n --ds-chart-red-bold: #FF5630;\n --ds-chart-red-bold-hovered: #DE350B;\n --ds-chart-red-bolder: #DE350B;\n --ds-chart-red-bolder-hovered: #BF2600;\n --ds-chart-red-boldest: #BF2600;\n --ds-chart-red-boldest-hovered: #BF2600;\n --ds-chart-orange-bold: #D97008;\n --ds-chart-orange-bold-hovered: #B65C02;\n --ds-chart-orange-bolder: #B65C02;\n --ds-chart-orange-bolder-hovered: #974F0C;\n --ds-chart-orange-boldest: #974F0C;\n --ds-chart-orange-boldest-hovered: #5F3811;\n --ds-chart-yellow-bold: #FFAB00;\n --ds-chart-yellow-bold-hovered: #FF991F;\n --ds-chart-yellow-bolder: #FF991F;\n --ds-chart-yellow-bolder-hovered: #FF8B00;\n --ds-chart-yellow-boldest: #FF8B00;\n --ds-chart-yellow-boldest-hovered: #FF8B00;\n --ds-chart-green-bold: #36B37E;\n --ds-chart-green-bold-hovered: #00875A;\n --ds-chart-green-bolder: #00875A;\n --ds-chart-green-bolder-hovered: #006644;\n --ds-chart-green-boldest: #006644;\n --ds-chart-green-boldest-hovered: #006644;\n --ds-chart-teal-bold: #00B8D9;\n --ds-chart-teal-bold-hovered: #00A3BF;\n --ds-chart-teal-bolder: #00A3BF;\n --ds-chart-teal-bolder-hovered: #008DA6;\n --ds-chart-teal-boldest: #008DA6;\n --ds-chart-teal-boldest-hovered: #008DA6;\n --ds-chart-blue-bold: #0065FF;\n --ds-chart-blue-bold-hovered: #0052CC;\n --ds-chart-blue-bolder: #0052CC;\n --ds-chart-blue-bolder-hovered: #0747A6;\n --ds-chart-blue-boldest: #0747A6;\n --ds-chart-blue-boldest-hovered: #0747A6;\n --ds-chart-purple-bold: #6554C0;\n --ds-chart-purple-bold-hovered: #5243AA;\n --ds-chart-purple-bolder: #5243AA;\n --ds-chart-purple-bolder-hovered: #403294;\n --ds-chart-purple-boldest: #403294;\n --ds-chart-purple-boldest-hovered: #403294;\n --ds-chart-magenta-bold: #DA62AC;\n --ds-chart-magenta-bold-hovered: #CD519D;\n --ds-chart-magenta-bolder: #CD519D;\n --ds-chart-magenta-bolder-hovered: #AE4787;\n --ds-chart-magenta-boldest: #943D73;\n --ds-chart-magenta-boldest-hovered: #50253F;\n --ds-chart-gray-bold: #5E6C84;\n --ds-chart-gray-bold-hovered: #505F79;\n --ds-chart-gray-bolder: #505F79;\n --ds-chart-gray-bolder-hovered: #42526E;\n --ds-chart-gray-boldest: #42526E;\n --ds-chart-gray-boldest-hovered: #42526E;\n --ds-chart-brand: #0065FF;\n --ds-chart-brand-hovered: #0052CC;\n --ds-chart-danger: #FF5630;\n --ds-chart-danger-hovered: #DE350B;\n --ds-chart-danger-bold: #DE350B;\n --ds-chart-danger-bold-hovered: #BF2600;\n --ds-chart-warning: #FFAB00;\n --ds-chart-warning-hovered: #FF991F;\n --ds-chart-warning-bold: #FF991F;\n --ds-chart-warning-bold-hovered: #FF8B00;\n --ds-chart-success: #36B37E;\n --ds-chart-success-hovered: #00875A;\n --ds-chart-success-bold: #00875A;\n --ds-chart-success-bold-hovered: #006644;\n --ds-chart-discovery: #6554C0;\n --ds-chart-discovery-hovered: #5243AA;\n --ds-chart-discovery-bold: #5243AA;\n --ds-chart-discovery-bold-hovered: #403294;\n --ds-chart-information: #0065FF;\n --ds-chart-information-hovered: #0052CC;\n --ds-chart-information-bold: #0052CC;\n --ds-chart-information-bold-hovered: #0747A6;\n --ds-surface: #FFFFFF;\n --ds-surface-hovered: #FAFBFC;\n --ds-surface-pressed: #F4F5F7;\n --ds-surface-overlay: #FFFFFF;\n --ds-surface-overlay-hovered: #FAFBFC;\n --ds-surface-overlay-pressed: #F4F5F7;\n --ds-surface-raised: #FFFFFF;\n --ds-surface-raised-hovered: #FAFBFC;\n --ds-surface-raised-pressed: #F4F5F7;\n --ds-surface-sunken: #F4F5F7;\n --ds-shadow-overflow: 0px 0px 8px #091e4229, 0px 0px 1px #091e421F;\n --ds-shadow-overflow-perimeter: #091e421f;\n --ds-shadow-overflow-spread: #091e4229;\n --ds-shadow-overlay: 0px 8px 12px #091e4226, 0px 0px 1px #091e424F;\n --ds-shadow-raised: 0px 1px 1px #091e4240, 0px 0px 1px #091e424F;\n --ds-opacity-disabled: 0.4;\n --ds-opacity-loading: 0.2;\n --ds-UNSAFE-transparent: transparent;\n}\n";
|
|
6
|
+
export default "\nhtml[data-color-mode=\"light\"][data-theme~=\"light:legacy-light\"],\nhtml[data-color-mode=\"dark\"][data-theme~=\"dark:legacy-light\"] {\n color-scheme: light;\n --ds-text: #172B4D;\n --ds-text-accent-lime: #4C6B1F;\n --ds-text-accent-lime-bolder: #37471F;\n --ds-text-accent-red: #DE350B;\n --ds-text-accent-red-bolder: #BF2600;\n --ds-text-accent-orange: #F18D13;\n --ds-text-accent-orange-bolder: #B65C02;\n --ds-text-accent-yellow: #FF991F;\n --ds-text-accent-yellow-bolder: #FF8B00;\n --ds-text-accent-green: #00875A;\n --ds-text-accent-green-bolder: #006644;\n --ds-text-accent-teal: #00A3BF;\n --ds-text-accent-teal-bolder: #008DA6;\n --ds-text-accent-blue: #0052CC;\n --ds-text-accent-blue-bolder: #0747A6;\n --ds-text-accent-purple: #5243AA;\n --ds-text-accent-purple-bolder: #403294;\n --ds-text-accent-magenta: #E774BB;\n --ds-text-accent-magenta-bolder: #DA62AC;\n --ds-text-accent-gray: #505F79;\n --ds-text-accent-gray-bolder: #172B4D;\n --ds-text-disabled: #A5ADBA;\n --ds-text-inverse: #FFFFFF;\n --ds-text-selected: #0052CC;\n --ds-text-brand: #0065FF;\n --ds-text-danger: #DE350B;\n --ds-text-warning: #974F0C;\n --ds-text-warning-inverse: #172B4D;\n --ds-text-success: #006644;\n --ds-text-discovery: #403294;\n --ds-text-information: #0052CC;\n --ds-text-subtlest: #7A869A;\n --ds-text-subtle: #42526E;\n --ds-link: #0052CC;\n --ds-link-pressed: #0747A6;\n --ds-icon: #505F79;\n --ds-icon-accent-lime: #6A9A23;\n --ds-icon-accent-red: #FF5630;\n --ds-icon-accent-orange: #D94008;\n --ds-icon-accent-yellow: #FFAB00;\n --ds-icon-accent-green: #36B37E;\n --ds-icon-accent-teal: #00B8D9;\n --ds-icon-accent-blue: #0065FF;\n --ds-icon-accent-purple: #6554C0;\n --ds-icon-accent-magenta: #CD519D;\n --ds-icon-accent-gray: #5E6C84;\n --ds-icon-disabled: #8993A4;\n --ds-icon-inverse: #FFFFFF;\n --ds-icon-selected: #0052CC;\n --ds-icon-brand: #0065FF;\n --ds-icon-danger: #DE350B;\n --ds-icon-warning: #FFC400;\n --ds-icon-warning-inverse: #253858;\n --ds-icon-success: #00875A;\n --ds-icon-discovery: #8777D9;\n --ds-icon-information: #0747A6;\n --ds-icon-subtle: #6B778C;\n --ds-border: #091e4221;\n --ds-border-accent-lime: #6A9A23;\n --ds-border-accent-red: #FF5630;\n --ds-border-accent-orange: #D94008;\n --ds-border-accent-yellow: #FFAB00;\n --ds-border-accent-green: #36B37E;\n --ds-border-accent-teal: #00B8D9;\n --ds-border-accent-blue: #0065FF;\n --ds-border-accent-purple: #6554C0;\n --ds-border-accent-magenta: #CD519D;\n --ds-border-accent-gray: #5E6C84;\n --ds-border-disabled: #FAFBFC;\n --ds-border-focused: #2684FF;\n --ds-border-input: #FAFBFC;\n --ds-border-inverse: #FFFFFF;\n --ds-border-selected: #0052CC;\n --ds-border-brand: #0052CC;\n --ds-border-danger: #FF5630;\n --ds-border-warning: #FFC400;\n --ds-border-success: #00875A;\n --ds-border-discovery: #998DD9;\n --ds-border-information: #0065FF;\n --ds-border-bold: #344563;\n --ds-background-accent-lime-subtlest: #EEFBDA;\n --ds-background-accent-lime-subtler: #D3F1A7;\n --ds-background-accent-lime-subtle: #94C748;\n --ds-background-accent-lime-bolder: #5B7F24;\n --ds-background-accent-red-subtlest: #FF8F73;\n --ds-background-accent-red-subtler: #FF7452;\n --ds-background-accent-red-subtle: #DE350B;\n --ds-background-accent-red-bolder: #DE350B;\n --ds-background-accent-orange-subtlest: #F18D13;\n --ds-background-accent-orange-subtler: #B65C02;\n --ds-background-accent-orange-subtle: #5F3811;\n --ds-background-accent-orange-bolder: #43290F;\n --ds-background-accent-yellow-subtlest: #FFE380;\n --ds-background-accent-yellow-subtler: #FFC400;\n --ds-background-accent-yellow-subtle: #FF991F;\n --ds-background-accent-yellow-bolder: #FF991F;\n --ds-background-accent-green-subtlest: #79F2C0;\n --ds-background-accent-green-subtler: #57D9A3;\n --ds-background-accent-green-subtle: #00875A;\n --ds-background-accent-green-bolder: #00875A;\n --ds-background-accent-teal-subtlest: #79E2F2;\n --ds-background-accent-teal-subtler: #00C7E6;\n --ds-background-accent-teal-subtle: #00A3BF;\n --ds-background-accent-teal-bolder: #00A3BF;\n --ds-background-accent-blue-subtlest: #4C9AFF;\n --ds-background-accent-blue-subtler: #2684FF;\n --ds-background-accent-blue-subtle: #0052CC;\n --ds-background-accent-blue-bolder: #0052CC;\n --ds-background-accent-purple-subtlest: #998DD9;\n --ds-background-accent-purple-subtler: #8777D9;\n --ds-background-accent-purple-subtle: #5243AA;\n --ds-background-accent-purple-bolder: #5243AA;\n --ds-background-accent-magenta-subtlest: #E774BB;\n --ds-background-accent-magenta-subtler: #E774BB;\n --ds-background-accent-magenta-subtle: #E774BB;\n --ds-background-accent-magenta-bolder: #E774BB;\n --ds-background-accent-gray-subtlest: #6B778C;\n --ds-background-accent-gray-subtler: #5E6C84;\n --ds-background-accent-gray-subtle: #42526E;\n --ds-background-accent-gray-bolder: #505F79;\n --ds-background-disabled: #091e4289;\n --ds-background-input: #FAFBFC;\n --ds-background-input-hovered: #EBECF0;\n --ds-background-input-pressed: #FFFFFF;\n --ds-background-inverse-subtle: #00000029;\n --ds-background-inverse-subtle-hovered: #0000003D;\n --ds-background-inverse-subtle-pressed: #00000052;\n --ds-background-neutral: #DFE1E6;\n --ds-background-neutral-hovered: #091e4214;\n --ds-background-neutral-pressed: #B3D4FF;\n --ds-background-neutral-subtle: transparent;\n --ds-background-neutral-subtle-hovered: #091e4214;\n --ds-background-neutral-subtle-pressed: #B3D4FF;\n --ds-background-neutral-bold: #42526E;\n --ds-background-neutral-bold-hovered: #505F79;\n --ds-background-neutral-bold-pressed: #344563;\n --ds-background-selected: #DEEBFF;\n --ds-background-selected-hovered: #B3D4FF;\n --ds-background-selected-pressed: #4C9AFF;\n --ds-background-selected-bold: #0052CC;\n --ds-background-selected-bold-hovered: #2684FF;\n --ds-background-selected-bold-pressed: #0052CC;\n --ds-background-brand-subtlest: #B3D4FF;\n --ds-background-brand-subtlest-hovered: #DEEBFF;\n --ds-background-brand-subtlest-pressed: #4C9AFF;\n --ds-background-brand-bold: #0052CC;\n --ds-background-brand-bold-hovered: #0065FF;\n --ds-background-brand-bold-pressed: #0747A6;\n --ds-background-brand-boldest: #0747A6;\n --ds-background-brand-boldest-hovered: #0052CC;\n --ds-background-brand-boldest-pressed: #0747A6;\n --ds-background-danger: #FFEBE6;\n --ds-background-danger-hovered: #FFBDAD;\n --ds-background-danger-pressed: #FF8F73;\n --ds-background-danger-bold: #DE350B;\n --ds-background-danger-bold-hovered: #FF5630;\n --ds-background-danger-bold-pressed: #BF2600;\n --ds-background-warning: #FFFAE6;\n --ds-background-warning-hovered: #FFF0B3;\n --ds-background-warning-pressed: #FFE380;\n --ds-background-warning-bold: #FFAB00;\n --ds-background-warning-bold-hovered: #FFC400;\n --ds-background-warning-bold-pressed: #FF991F;\n --ds-background-success: #E3FCEF;\n --ds-background-success-hovered: #ABF5D1;\n --ds-background-success-pressed: #79F2C0;\n --ds-background-success-bold: #00875A;\n --ds-background-success-bold-hovered: #57D9A3;\n --ds-background-success-bold-pressed: #00875A;\n --ds-background-discovery: #EAE6FF;\n --ds-background-discovery-hovered: #C0B6F2;\n --ds-background-discovery-pressed: #998DD9;\n --ds-background-discovery-bold: #5243AA;\n --ds-background-discovery-bold-hovered: #8777D9;\n --ds-background-discovery-bold-pressed: #5243AA;\n --ds-background-information: #DEEBFF;\n --ds-background-information-hovered: #B3D4FF;\n --ds-background-information-pressed: #4C9AFF;\n --ds-background-information-bold: #0052CC;\n --ds-background-information-bold-hovered: #2684FF;\n --ds-background-information-bold-pressed: #0052CC;\n --ds-blanket: #091e4289;\n --ds-blanket-selected: #388BFF14;\n --ds-blanket-danger: #EF5C4814;\n --ds-interaction-hovered: #00000029;\n --ds-interaction-pressed: #00000052;\n --ds-skeleton: #F4F5F7;\n --ds-skeleton-subtle: #091e420a;\n --ds-chart-categorical-1: #00B8D9;\n --ds-chart-categorical-1-hovered: #00A3BF;\n --ds-chart-categorical-2: #5243AA;\n --ds-chart-categorical-2-hovered: #403294;\n --ds-chart-categorical-3: #D94008;\n --ds-chart-categorical-3-hovered: #B65C02;\n --ds-chart-categorical-4: #943D73;\n --ds-chart-categorical-4-hovered: #50253F;\n --ds-chart-categorical-5: #0052CC;\n --ds-chart-categorical-5-hovered: #0747A6;\n --ds-chart-categorical-6: #5243AA;\n --ds-chart-categorical-6-hovered: #403294;\n --ds-chart-categorical-7: #50253F;\n --ds-chart-categorical-7-hovered: #341829;\n --ds-chart-categorical-8: #974F0C;\n --ds-chart-categorical-8-hovered: #5F3811;\n --ds-chart-lime-bold: #6A9A23;\n --ds-chart-lime-bold-hovered: #5B7F24;\n --ds-chart-lime-bolder: #5B7F24;\n --ds-chart-lime-bolder-hovered: #4C6B1F;\n --ds-chart-lime-boldest: #4C6B1F;\n --ds-chart-lime-boldest-hovered: #37471F;\n --ds-chart-neutral: #5E6C84;\n --ds-chart-neutral-hovered: #505F79;\n --ds-chart-red-bold: #FF5630;\n --ds-chart-red-bold-hovered: #DE350B;\n --ds-chart-red-bolder: #DE350B;\n --ds-chart-red-bolder-hovered: #BF2600;\n --ds-chart-red-boldest: #BF2600;\n --ds-chart-red-boldest-hovered: #BF2600;\n --ds-chart-orange-bold: #D97008;\n --ds-chart-orange-bold-hovered: #B65C02;\n --ds-chart-orange-bolder: #B65C02;\n --ds-chart-orange-bolder-hovered: #974F0C;\n --ds-chart-orange-boldest: #974F0C;\n --ds-chart-orange-boldest-hovered: #5F3811;\n --ds-chart-yellow-bold: #FFAB00;\n --ds-chart-yellow-bold-hovered: #FF991F;\n --ds-chart-yellow-bolder: #FF991F;\n --ds-chart-yellow-bolder-hovered: #FF8B00;\n --ds-chart-yellow-boldest: #FF8B00;\n --ds-chart-yellow-boldest-hovered: #FF8B00;\n --ds-chart-green-bold: #36B37E;\n --ds-chart-green-bold-hovered: #00875A;\n --ds-chart-green-bolder: #00875A;\n --ds-chart-green-bolder-hovered: #006644;\n --ds-chart-green-boldest: #006644;\n --ds-chart-green-boldest-hovered: #006644;\n --ds-chart-teal-bold: #00B8D9;\n --ds-chart-teal-bold-hovered: #00A3BF;\n --ds-chart-teal-bolder: #00A3BF;\n --ds-chart-teal-bolder-hovered: #008DA6;\n --ds-chart-teal-boldest: #008DA6;\n --ds-chart-teal-boldest-hovered: #008DA6;\n --ds-chart-blue-bold: #0065FF;\n --ds-chart-blue-bold-hovered: #0052CC;\n --ds-chart-blue-bolder: #0052CC;\n --ds-chart-blue-bolder-hovered: #0747A6;\n --ds-chart-blue-boldest: #0747A6;\n --ds-chart-blue-boldest-hovered: #0747A6;\n --ds-chart-purple-bold: #6554C0;\n --ds-chart-purple-bold-hovered: #5243AA;\n --ds-chart-purple-bolder: #5243AA;\n --ds-chart-purple-bolder-hovered: #403294;\n --ds-chart-purple-boldest: #403294;\n --ds-chart-purple-boldest-hovered: #403294;\n --ds-chart-magenta-bold: #DA62AC;\n --ds-chart-magenta-bold-hovered: #CD519D;\n --ds-chart-magenta-bolder: #CD519D;\n --ds-chart-magenta-bolder-hovered: #AE4787;\n --ds-chart-magenta-boldest: #943D73;\n --ds-chart-magenta-boldest-hovered: #50253F;\n --ds-chart-gray-bold: #5E6C84;\n --ds-chart-gray-bold-hovered: #505F79;\n --ds-chart-gray-bolder: #505F79;\n --ds-chart-gray-bolder-hovered: #42526E;\n --ds-chart-gray-boldest: #42526E;\n --ds-chart-gray-boldest-hovered: #42526E;\n --ds-chart-brand: #0065FF;\n --ds-chart-brand-hovered: #0052CC;\n --ds-chart-danger: #FF5630;\n --ds-chart-danger-hovered: #DE350B;\n --ds-chart-danger-bold: #DE350B;\n --ds-chart-danger-bold-hovered: #BF2600;\n --ds-chart-warning: #FFAB00;\n --ds-chart-warning-hovered: #FF991F;\n --ds-chart-warning-bold: #FF991F;\n --ds-chart-warning-bold-hovered: #FF8B00;\n --ds-chart-success: #36B37E;\n --ds-chart-success-hovered: #00875A;\n --ds-chart-success-bold: #00875A;\n --ds-chart-success-bold-hovered: #006644;\n --ds-chart-discovery: #6554C0;\n --ds-chart-discovery-hovered: #5243AA;\n --ds-chart-discovery-bold: #5243AA;\n --ds-chart-discovery-bold-hovered: #403294;\n --ds-chart-information: #0065FF;\n --ds-chart-information-hovered: #0052CC;\n --ds-chart-information-bold: #0052CC;\n --ds-chart-information-bold-hovered: #0747A6;\n --ds-surface: #FFFFFF;\n --ds-surface-hovered: #FAFBFC;\n --ds-surface-pressed: #F4F5F7;\n --ds-surface-overlay: #FFFFFF;\n --ds-surface-overlay-hovered: #FAFBFC;\n --ds-surface-overlay-pressed: #F4F5F7;\n --ds-surface-raised: #FFFFFF;\n --ds-surface-raised-hovered: #FAFBFC;\n --ds-surface-raised-pressed: #F4F5F7;\n --ds-surface-sunken: #F4F5F7;\n --ds-shadow-overflow: 0px 0px 8px #091e4229, 0px 0px 1px #091e421F;\n --ds-shadow-overflow-perimeter: #091e421f;\n --ds-shadow-overflow-spread: #091e4229;\n --ds-shadow-overlay: 0px 8px 12px #091e4226, 0px 0px 1px #091e424F;\n --ds-shadow-raised: 0px 1px 1px #091e4240, 0px 0px 1px #091e424F;\n --ds-opacity-disabled: 0.4;\n --ds-opacity-loading: 0.2;\n --ds-UNSAFE-transparent: transparent;\n}\n";
|
|
@@ -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::309519b3d309ba66f31d019788cc5ef0>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -1528,7 +1528,7 @@ var tokens = [{
|
|
|
1528
1528
|
"introduced": "0.6.0",
|
|
1529
1529
|
"description": "Use for focus rings of elements in a focus state."
|
|
1530
1530
|
},
|
|
1531
|
-
"value": "#
|
|
1531
|
+
"value": "#2684FF",
|
|
1532
1532
|
"filePath": "src/tokens/atlassian-legacy-light/color/border.tsx",
|
|
1533
1533
|
"isSource": true,
|
|
1534
1534
|
"original": {
|
|
@@ -1538,7 +1538,7 @@ var tokens = [{
|
|
|
1538
1538
|
"introduced": "0.6.0",
|
|
1539
1539
|
"description": "Use for focus rings of elements in a focus state."
|
|
1540
1540
|
},
|
|
1541
|
-
"value": "
|
|
1541
|
+
"value": "B200"
|
|
1542
1542
|
},
|
|
1543
1543
|
"name": "color.border.focused",
|
|
1544
1544
|
"path": ["color", "border", "focused"],
|