@atlaskit/tokens 1.3.1 → 1.3.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 +6 -0
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/set-global-theme.js +28 -10
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/set-global-theme.js +16 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/set-global-theme.js +28 -10
- package/dist/esm/version.json +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
9
9
|
var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
10
10
|
var name = "@atlaskit/tokens";
|
|
11
|
-
var version = "1.3.
|
|
11
|
+
var version = "1.3.2";
|
|
12
12
|
/**
|
|
13
13
|
* Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
|
|
14
14
|
* resulting CSS Custom Property.
|
package/dist/cjs/get-token.js
CHANGED
|
@@ -9,7 +9,7 @@ var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
|
|
|
9
9
|
var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
var name = "@atlaskit/tokens";
|
|
12
|
-
var version = "1.3.
|
|
12
|
+
var version = "1.3.2";
|
|
13
13
|
/**
|
|
14
14
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
|
15
15
|
* This should be used to implement design decisions throughout your application.
|
|
@@ -120,15 +120,29 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
120
120
|
};
|
|
121
121
|
}()));
|
|
122
122
|
case 4:
|
|
123
|
-
if (!(
|
|
123
|
+
if (!themePreferences.includes('dark')) {
|
|
124
|
+
_context2.next = 13;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
if (!
|
|
124
128
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
125
|
-
(0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln')
|
|
126
|
-
_context2.next =
|
|
129
|
+
(0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
130
|
+
_context2.next = 10;
|
|
127
131
|
break;
|
|
128
132
|
}
|
|
129
|
-
_context2.next =
|
|
133
|
+
_context2.next = 8;
|
|
130
134
|
return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
|
|
131
|
-
case
|
|
135
|
+
case 8:
|
|
136
|
+
_context2.next = 13;
|
|
137
|
+
break;
|
|
138
|
+
case 10:
|
|
139
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
140
|
+
_context2.next = 13;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
_context2.next = 13;
|
|
144
|
+
return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
|
|
145
|
+
case 13:
|
|
132
146
|
if (colorMode === 'auto' && darkModeMql) {
|
|
133
147
|
colorMode = darkModeMql.matches ? 'dark' : 'light';
|
|
134
148
|
// Add an event listener for changes to the system theme.
|
|
@@ -154,7 +168,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
154
168
|
document.documentElement.setAttribute(key, value);
|
|
155
169
|
});
|
|
156
170
|
return _context2.abrupt("return", unbindThemeChangeListener);
|
|
157
|
-
case
|
|
171
|
+
case 17:
|
|
158
172
|
case "end":
|
|
159
173
|
return _context2.stop();
|
|
160
174
|
}
|
|
@@ -205,10 +219,14 @@ var getThemeStyles = /*#__PURE__*/function () {
|
|
|
205
219
|
spacing: spacing,
|
|
206
220
|
typography: typography
|
|
207
221
|
});
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
if (themePreferences.includes('dark')) {
|
|
223
|
+
if (
|
|
224
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
225
|
+
(0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
226
|
+
themePreferences.push('dark-iteration');
|
|
227
|
+
} else if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
228
|
+
themePreferences.push('dark-iteration');
|
|
229
|
+
}
|
|
212
230
|
}
|
|
213
231
|
_context4.next = 5;
|
|
214
232
|
return Promise.all(themePreferences.map( /*#__PURE__*/function () {
|
package/dist/cjs/version.json
CHANGED
|
@@ -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.3.
|
|
4
|
+
const version = "1.3.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 = "1.3.
|
|
5
|
+
const version = "1.3.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.
|
|
@@ -78,10 +78,14 @@ const setGlobalTheme = async ({
|
|
|
78
78
|
typography
|
|
79
79
|
});
|
|
80
80
|
await Promise.all(themePreferences.map(async themeId => await loadAndAppendThemeCss(themeId)));
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
if (themePreferences.includes('dark')) {
|
|
82
|
+
if (
|
|
83
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
84
|
+
getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
85
|
+
await loadAndAppendThemeCss('dark-iteration');
|
|
86
|
+
} else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
87
|
+
await loadAndAppendThemeCss('dark-iteration');
|
|
88
|
+
}
|
|
85
89
|
}
|
|
86
90
|
if (colorMode === 'auto' && darkModeMql) {
|
|
87
91
|
colorMode = darkModeMql.matches ? 'dark' : 'light';
|
|
@@ -134,10 +138,14 @@ export const getThemeStyles = async ({
|
|
|
134
138
|
spacing,
|
|
135
139
|
typography
|
|
136
140
|
});
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
if (themePreferences.includes('dark')) {
|
|
142
|
+
if (
|
|
143
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
144
|
+
getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
145
|
+
themePreferences.push('dark-iteration');
|
|
146
|
+
} else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
147
|
+
themePreferences.push('dark-iteration');
|
|
148
|
+
}
|
|
141
149
|
}
|
|
142
150
|
const results = await Promise.all(themePreferences.map(async themeId => {
|
|
143
151
|
try {
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
var name = "@atlaskit/tokens";
|
|
4
|
-
var version = "1.3.
|
|
4
|
+
var version = "1.3.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/esm/get-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
4
|
var name = "@atlaskit/tokens";
|
|
5
|
-
var version = "1.3.
|
|
5
|
+
var version = "1.3.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.
|
|
@@ -114,15 +114,29 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
114
114
|
};
|
|
115
115
|
}()));
|
|
116
116
|
case 4:
|
|
117
|
-
if (!(
|
|
117
|
+
if (!themePreferences.includes('dark')) {
|
|
118
|
+
_context2.next = 13;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
if (!
|
|
118
122
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
119
|
-
getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')
|
|
120
|
-
_context2.next =
|
|
123
|
+
getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
124
|
+
_context2.next = 10;
|
|
121
125
|
break;
|
|
122
126
|
}
|
|
123
|
-
_context2.next =
|
|
127
|
+
_context2.next = 8;
|
|
124
128
|
return loadAndAppendThemeCss('dark-iteration');
|
|
125
|
-
case
|
|
129
|
+
case 8:
|
|
130
|
+
_context2.next = 13;
|
|
131
|
+
break;
|
|
132
|
+
case 10:
|
|
133
|
+
if (!getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
134
|
+
_context2.next = 13;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
_context2.next = 13;
|
|
138
|
+
return loadAndAppendThemeCss('dark-iteration');
|
|
139
|
+
case 13:
|
|
126
140
|
if (colorMode === 'auto' && darkModeMql) {
|
|
127
141
|
colorMode = darkModeMql.matches ? 'dark' : 'light';
|
|
128
142
|
// Add an event listener for changes to the system theme.
|
|
@@ -148,7 +162,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
148
162
|
document.documentElement.setAttribute(key, value);
|
|
149
163
|
});
|
|
150
164
|
return _context2.abrupt("return", unbindThemeChangeListener);
|
|
151
|
-
case
|
|
165
|
+
case 17:
|
|
152
166
|
case "end":
|
|
153
167
|
return _context2.stop();
|
|
154
168
|
}
|
|
@@ -199,10 +213,14 @@ export var getThemeStyles = /*#__PURE__*/function () {
|
|
|
199
213
|
spacing: spacing,
|
|
200
214
|
typography: typography
|
|
201
215
|
});
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
216
|
+
if (themePreferences.includes('dark')) {
|
|
217
|
+
if (
|
|
218
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
219
|
+
getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
|
|
220
|
+
themePreferences.push('dark-iteration');
|
|
221
|
+
} else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
|
|
222
|
+
themePreferences.push('dark-iteration');
|
|
223
|
+
}
|
|
206
224
|
}
|
|
207
225
|
_context4.next = 5;
|
|
208
226
|
return Promise.all(themePreferences.map( /*#__PURE__*/function () {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tokens",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"description": "Design tokens are the single source of truth to name and store design decisions.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -135,6 +135,9 @@
|
|
|
135
135
|
"platform-feature-flags": {
|
|
136
136
|
"design-system-team.dark-theme-iteration_dk1ln": {
|
|
137
137
|
"type": "boolean"
|
|
138
|
+
},
|
|
139
|
+
"platform.design-system-team.dark-iteration-confluence_e2t22": {
|
|
140
|
+
"type": "boolean"
|
|
138
141
|
}
|
|
139
142
|
},
|
|
140
143
|
"homepage": "https://atlassian.design/components/tokens",
|