@atlaskit/tokens 10.0.1 → 11.0.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/replacement-mapping.js +6 -2
- package/dist/cjs/artifacts/theme-import-map.js +1 -13
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-future.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-future.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-increased-contrast.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-shape.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-spacing.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography.js +9 -5
- package/dist/cjs/babel-plugin/plugin.js +3 -7
- package/dist/cjs/entry-points/tokens-raw.js +0 -7
- package/dist/cjs/theme-config.js +1 -19
- package/dist/cjs/theme-state-transformer.js +4 -4
- package/dist/es2019/artifacts/replacement-mapping.js +6 -2
- package/dist/es2019/artifacts/theme-import-map.js +1 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-future.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-future.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-increased-contrast.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-shape.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-spacing.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-typography.js +9 -5
- package/dist/es2019/babel-plugin/plugin.js +4 -7
- package/dist/es2019/entry-points/tokens-raw.js +0 -1
- package/dist/es2019/theme-config.js +1 -19
- package/dist/es2019/theme-state-transformer.js +4 -4
- package/dist/esm/artifacts/replacement-mapping.js +6 -2
- package/dist/esm/artifacts/theme-import-map.js +1 -9
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-future.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-light-future.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-light-increased-contrast.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-shape.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-spacing.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-typography.js +9 -5
- package/dist/esm/babel-plugin/plugin.js +3 -7
- package/dist/esm/entry-points/tokens-raw.js +0 -1
- package/dist/esm/theme-config.js +1 -19
- package/dist/esm/theme-state-transformer.js +4 -4
- package/dist/types/artifacts/replacement-mapping.d.ts +1 -1
- package/dist/types/artifacts/theme-import-map.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark-future.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark-increased-contrast.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light-future.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light-increased-contrast.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-shape.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-spacing.d.ts +2 -1
- package/dist/types/artifacts/tokens-raw/atlassian-typography.d.ts +2 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/babel-plugin/plugin.d.ts +1 -1
- package/dist/types/entry-points/tokens-raw.d.ts +0 -1
- package/dist/types/theme-config.d.ts +6 -6
- package/dist/types/theme-state-transformer.d.ts +4 -4
- package/dist/types-ts4.5/artifacts/replacement-mapping.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-future.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-increased-contrast.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-future.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-increased-contrast.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-shape.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-spacing.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography.d.ts +2 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/babel-plugin/plugin.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/tokens-raw.d.ts +0 -1
- package/dist/types-ts4.5/theme-config.d.ts +4 -8
- package/dist/types-ts4.5/theme-state-transformer.d.ts +4 -4
- package/figma/atlassian-typography.json +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/tokens
|
|
2
2
|
|
|
3
|
+
## 11.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`2abd451d54eb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2abd451d54eb2) -
|
|
8
|
+
Removes atlassian-legacy-light/dark color themes from the tokens package. These themes are unused
|
|
9
|
+
and non-functional in terms of color contrast. As a result some primitive components may recieve
|
|
10
|
+
modern fallback color values in some scenarios, however these are inline with the latest token
|
|
11
|
+
themes.
|
|
12
|
+
|
|
13
|
+
## 10.1.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`2fdb6040218a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2fdb6040218a1) -
|
|
18
|
+
Deprecating `font.body.UNSAFE_small` typography token, replace with `font.body.small` token.
|
|
19
|
+
|
|
3
20
|
## 10.0.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -18,9 +18,13 @@ exports.default = void 0;
|
|
|
18
18
|
* These changes will then be picked up by our tooling which will attempt to
|
|
19
19
|
* migrate as many of these renames as possible.
|
|
20
20
|
*
|
|
21
|
-
* @codegen <<SignedSource::
|
|
21
|
+
* @codegen <<SignedSource::400f0ecf8657b2dcb96d24d2f0aed049>>
|
|
22
22
|
* @codegenCommand yarn build tokens
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
var replacementMapper = [
|
|
25
|
+
var replacementMapper = [{
|
|
26
|
+
"path": "font.body.UNSAFE_small",
|
|
27
|
+
"state": "deprecated",
|
|
28
|
+
"replacement": "font.body.small"
|
|
29
|
+
}];
|
|
26
30
|
var _default = exports.default = replacementMapper;
|
|
@@ -15,7 +15,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
15
15
|
* This allows users to compose their themes and only use the tokens that are requested.
|
|
16
16
|
* When a new theme is created, the import should automatically be added to the map
|
|
17
17
|
*
|
|
18
|
-
* @codegen <<SignedSource::
|
|
18
|
+
* @codegen <<SignedSource::c1144182e959da59d17686bccb9fac30>>
|
|
19
19
|
* @codegenCommand yarn build tokens
|
|
20
20
|
*/
|
|
21
21
|
|
|
@@ -56,18 +56,6 @@ var themeImportsMap = {
|
|
|
56
56
|
'./themes/atlassian-dark-increased-contrast'));
|
|
57
57
|
});
|
|
58
58
|
},
|
|
59
|
-
'legacy-light': function legacyLight() {
|
|
60
|
-
return Promise.resolve().then(function () {
|
|
61
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-light" */
|
|
62
|
-
'./themes/atlassian-legacy-light'));
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
'legacy-dark': function legacyDark() {
|
|
66
|
-
return Promise.resolve().then(function () {
|
|
67
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-dark" */
|
|
68
|
-
'./themes/atlassian-legacy-dark'));
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
59
|
'spacing': function spacing() {
|
|
72
60
|
return Promise.resolve().then(function () {
|
|
73
61
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-spacing" */
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::481346579796e53160811ac193f2a30b>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::9cf43027d49c104eeaabe2f135ba8c22>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::59ef4b5bec3f9d0828615e38ebd219c2>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::792226eccdf07de5819440afedceac16>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::8ba837ec9e96316ec5c338789f9aad1e>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::17a73ccf5d3b30eeaee16556ef650833>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::8a1f5d2a98c1bd5c70a4bb2c9b1ccf11>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::a101da74518f6374353a0e1b48115f4f>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::139953049673c5a74ab686e4a2ddaf50>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::cf28017e4c52dc92f3b9d8ffa77c0af4>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::deb6b7be7cc018d4dfc8cb7b1704bde5>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -303,9 +303,11 @@ var tokens = [{
|
|
|
303
303
|
}, {
|
|
304
304
|
"attributes": {
|
|
305
305
|
"group": "typography",
|
|
306
|
-
"state": "
|
|
306
|
+
"state": "deprecated",
|
|
307
307
|
"introduced": "1.14.0",
|
|
308
|
-
"
|
|
308
|
+
"deprecated": "10.1.0",
|
|
309
|
+
"description": "UNSAFE - Do not use. Temporary 12px fontsize token. Will be deprecated and replaced with stable small token",
|
|
310
|
+
"replacement": "font.body.small"
|
|
309
311
|
},
|
|
310
312
|
"value": "normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif",
|
|
311
313
|
"filePath": "schema/themes/atlassian-typography/theme.tsx",
|
|
@@ -313,9 +315,11 @@ var tokens = [{
|
|
|
313
315
|
"original": {
|
|
314
316
|
"attributes": {
|
|
315
317
|
"group": "typography",
|
|
316
|
-
"state": "
|
|
318
|
+
"state": "deprecated",
|
|
317
319
|
"introduced": "1.14.0",
|
|
318
|
-
"
|
|
320
|
+
"deprecated": "10.1.0",
|
|
321
|
+
"description": "UNSAFE - Do not use. Temporary 12px fontsize token. Will be deprecated and replaced with stable small token",
|
|
322
|
+
"replacement": "font.body.small"
|
|
319
323
|
},
|
|
320
324
|
"value": {
|
|
321
325
|
"fontWeight": "FontWeight400",
|
|
@@ -10,7 +10,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var t = _interopRequireWildcard(require("@babel/types"));
|
|
12
12
|
var _tokenNames = _interopRequireDefault(require("../artifacts/token-names"));
|
|
13
|
-
var _atlassianLegacyLight = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-legacy-light"));
|
|
14
13
|
var _atlassianLight = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-light"));
|
|
15
14
|
var _atlassianShape = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-shape"));
|
|
16
15
|
var _atlassianSpacing = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-spacing"));
|
|
@@ -125,7 +124,7 @@ function plugin() {
|
|
|
125
124
|
// if no fallback is set, optionally find one from the default theme
|
|
126
125
|
if (path.node.arguments.length < 2) {
|
|
127
126
|
if (state.opts.shouldUseAutoFallback !== false) {
|
|
128
|
-
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ", ").concat(getDefaultFallback(tokenName
|
|
127
|
+
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ", ").concat(getDefaultFallback(tokenName), ")"));
|
|
129
128
|
} else {
|
|
130
129
|
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ")"));
|
|
131
130
|
}
|
|
@@ -136,7 +135,7 @@ function plugin() {
|
|
|
136
135
|
var forceAutoFallbackExemptions = ['radius'].concat((0, _toConsumableArray2.default)(state.opts.forceAutoFallbackExemptions || []));
|
|
137
136
|
|
|
138
137
|
// Handle fallbacks
|
|
139
|
-
var fallback = state.opts.shouldForceAutoFallback !== false && !isExempted(tokenName, forceAutoFallbackExemptions) ? t.stringLiteral(getDefaultFallback(tokenName
|
|
138
|
+
var fallback = state.opts.shouldForceAutoFallback !== false && !isExempted(tokenName, forceAutoFallbackExemptions) ? t.stringLiteral(getDefaultFallback(tokenName)) : path.node.arguments[1];
|
|
140
139
|
if (t.isStringLiteral(fallback)) {
|
|
141
140
|
// String literals can be concatenated into css variable call
|
|
142
141
|
// Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
|
|
@@ -194,12 +193,10 @@ function plugin() {
|
|
|
194
193
|
};
|
|
195
194
|
}
|
|
196
195
|
var lightValues = getThemeValues(_atlassianLight.default);
|
|
197
|
-
var legacyLightValues = getThemeValues(_atlassianLegacyLight.default);
|
|
198
196
|
var shapeValues = getThemeValues(_atlassianShape.default);
|
|
199
197
|
var spacingValues = getThemeValues(_atlassianSpacing.default);
|
|
200
198
|
var typographyValues = getThemeValues(_atlassianTypography.default);
|
|
201
199
|
function getDefaultFallback(tokenName) {
|
|
202
|
-
var theme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'light';
|
|
203
200
|
if (shapeValues[tokenName]) {
|
|
204
201
|
return shapeValues[tokenName];
|
|
205
202
|
}
|
|
@@ -209,8 +206,7 @@ function getDefaultFallback(tokenName) {
|
|
|
209
206
|
if (typographyValues[tokenName]) {
|
|
210
207
|
return typographyValues[tokenName];
|
|
211
208
|
}
|
|
212
|
-
|
|
213
|
-
return colorValues[tokenName];
|
|
209
|
+
return lightValues[tokenName];
|
|
214
210
|
}
|
|
215
211
|
function getNonAliasedImportName(node) {
|
|
216
212
|
if (t.isIdentifier(node.imported)) {
|
|
@@ -10,12 +10,6 @@ Object.defineProperty(exports, "dark", {
|
|
|
10
10
|
return _atlassianDark.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
Object.defineProperty(exports, "legacyLightTokens", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _atlassianLegacyLight.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
13
|
Object.defineProperty(exports, "light", {
|
|
20
14
|
enumerable: true,
|
|
21
15
|
get: function get() {
|
|
@@ -41,7 +35,6 @@ Object.defineProperty(exports, "typography", {
|
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
37
|
var _atlassianLight = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-light"));
|
|
44
|
-
var _atlassianLegacyLight = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-legacy-light"));
|
|
45
38
|
var _atlassianDark = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-dark"));
|
|
46
39
|
var _atlassianSpacing = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-spacing"));
|
|
47
40
|
var _atlassianTypography = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-typography"));
|
package/dist/cjs/theme-config.js
CHANGED
|
@@ -45,7 +45,7 @@ var themeContrastModes = ['more', 'no-preference', 'auto'];
|
|
|
45
45
|
*
|
|
46
46
|
* These ids must be kebab case
|
|
47
47
|
*/
|
|
48
|
-
var themeIds = exports.themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', '
|
|
48
|
+
var themeIds = exports.themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', 'spacing', 'shape', 'typography'];
|
|
49
49
|
/**
|
|
50
50
|
* Theme override ids: the equivalent of themeIds for theme overrides.
|
|
51
51
|
* Theme overrides are temporary and there may not be any defined at times.
|
|
@@ -131,24 +131,6 @@ var themeConfig = {
|
|
|
131
131
|
extends: 'dark',
|
|
132
132
|
increasesContrastFor: 'dark'
|
|
133
133
|
},
|
|
134
|
-
'atlassian-legacy-light': {
|
|
135
|
-
id: 'legacy-light',
|
|
136
|
-
displayName: 'Light Theme (legacy)',
|
|
137
|
-
palette: 'legacyPalette',
|
|
138
|
-
attributes: {
|
|
139
|
-
type: 'color',
|
|
140
|
-
mode: 'light'
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
'atlassian-legacy-dark': {
|
|
144
|
-
id: 'legacy-dark',
|
|
145
|
-
displayName: 'Dark Theme (legacy)',
|
|
146
|
-
palette: 'legacyPalette',
|
|
147
|
-
attributes: {
|
|
148
|
-
type: 'color',
|
|
149
|
-
mode: 'dark'
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
134
|
'atlassian-spacing': {
|
|
153
135
|
id: 'spacing',
|
|
154
136
|
displayName: 'Atlassian Spacing',
|
|
@@ -31,8 +31,8 @@ var isColorMode = function isColorMode(modeId) {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```
|
|
34
|
-
* themeStringToObject('dark:dark light:
|
|
35
|
-
* // returns { dark: 'dark', light: '
|
|
34
|
+
* themeStringToObject('dark:dark light:light spacing:spacing');
|
|
35
|
+
* // returns { dark: 'dark', light: 'light', spacing: 'spacing' }
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
var themeStringToObject = exports.themeStringToObject = function themeStringToObject(themeState) {
|
|
@@ -69,8 +69,8 @@ var themeStringToObject = exports.themeStringToObject = function themeStringToOb
|
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* ```
|
|
72
|
-
* themeObjectToString({ dark: 'dark', light: '
|
|
73
|
-
* // returns 'dark:dark light:
|
|
72
|
+
* themeObjectToString({ dark: 'dark', light: 'light', spacing: 'spacing' });
|
|
73
|
+
* // returns 'dark:dark light:light spacing:spacing'
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
var themeObjectToString = exports.themeObjectToString = function themeObjectToString(themeState) {
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
* These changes will then be picked up by our tooling which will attempt to
|
|
13
13
|
* migrate as many of these renames as possible.
|
|
14
14
|
*
|
|
15
|
-
* @codegen <<SignedSource::
|
|
15
|
+
* @codegen <<SignedSource::400f0ecf8657b2dcb96d24d2f0aed049>>
|
|
16
16
|
* @codegenCommand yarn build tokens
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
const replacementMapper = [
|
|
19
|
+
const replacementMapper = [{
|
|
20
|
+
"path": "font.body.UNSAFE_small",
|
|
21
|
+
"state": "deprecated",
|
|
22
|
+
"replacement": "font.body.small"
|
|
23
|
+
}];
|
|
20
24
|
export default replacementMapper;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This allows users to compose their themes and only use the tokens that are requested.
|
|
7
7
|
* When a new theme is created, the import should automatically be added to the map
|
|
8
8
|
*
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::c1144182e959da59d17686bccb9fac30>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -23,10 +23,6 @@ const themeImportsMap = {
|
|
|
23
23
|
'./themes/atlassian-dark-future'),
|
|
24
24
|
'dark-increased-contrast': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-dark-increased-contrast" */
|
|
25
25
|
'./themes/atlassian-dark-increased-contrast'),
|
|
26
|
-
'legacy-light': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-light" */
|
|
27
|
-
'./themes/atlassian-legacy-light'),
|
|
28
|
-
'legacy-dark': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-dark" */
|
|
29
|
-
'./themes/atlassian-legacy-dark'),
|
|
30
26
|
'spacing': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-spacing" */
|
|
31
27
|
'./themes/atlassian-spacing'),
|
|
32
28
|
'typography': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-typography" */
|
|
@@ -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::deb6b7be7cc018d4dfc8cb7b1704bde5>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -297,9 +297,11 @@ const tokens = [{
|
|
|
297
297
|
}, {
|
|
298
298
|
"attributes": {
|
|
299
299
|
"group": "typography",
|
|
300
|
-
"state": "
|
|
300
|
+
"state": "deprecated",
|
|
301
301
|
"introduced": "1.14.0",
|
|
302
|
-
"
|
|
302
|
+
"deprecated": "10.1.0",
|
|
303
|
+
"description": "UNSAFE - Do not use. Temporary 12px fontsize token. Will be deprecated and replaced with stable small token",
|
|
304
|
+
"replacement": "font.body.small"
|
|
303
305
|
},
|
|
304
306
|
"value": "normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif",
|
|
305
307
|
"filePath": "schema/themes/atlassian-typography/theme.tsx",
|
|
@@ -307,9 +309,11 @@ const tokens = [{
|
|
|
307
309
|
"original": {
|
|
308
310
|
"attributes": {
|
|
309
311
|
"group": "typography",
|
|
310
|
-
"state": "
|
|
312
|
+
"state": "deprecated",
|
|
311
313
|
"introduced": "1.14.0",
|
|
312
|
-
"
|
|
314
|
+
"deprecated": "10.1.0",
|
|
315
|
+
"description": "UNSAFE - Do not use. Temporary 12px fontsize token. Will be deprecated and replaced with stable small token",
|
|
316
|
+
"replacement": "font.body.small"
|
|
313
317
|
},
|
|
314
318
|
"value": {
|
|
315
319
|
"fontWeight": "FontWeight400",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from '@babel/types';
|
|
2
2
|
import tokenNames from '../artifacts/token-names';
|
|
3
|
-
import legacyLight from '../artifacts/tokens-raw/atlassian-legacy-light';
|
|
4
3
|
import light from '../artifacts/tokens-raw/atlassian-light';
|
|
5
4
|
import shape from '../artifacts/tokens-raw/atlassian-shape';
|
|
6
5
|
import spacing from '../artifacts/tokens-raw/atlassian-spacing';
|
|
@@ -102,7 +101,7 @@ export default function plugin() {
|
|
|
102
101
|
// if no fallback is set, optionally find one from the default theme
|
|
103
102
|
if (path.node.arguments.length < 2) {
|
|
104
103
|
if (state.opts.shouldUseAutoFallback !== false) {
|
|
105
|
-
replacementNode = t.stringLiteral(`var(${cssTokenValue}, ${getDefaultFallback(tokenName
|
|
104
|
+
replacementNode = t.stringLiteral(`var(${cssTokenValue}, ${getDefaultFallback(tokenName)})`);
|
|
106
105
|
} else {
|
|
107
106
|
replacementNode = t.stringLiteral(`var(${cssTokenValue})`);
|
|
108
107
|
}
|
|
@@ -113,7 +112,7 @@ export default function plugin() {
|
|
|
113
112
|
const forceAutoFallbackExemptions = ['radius', ...(state.opts.forceAutoFallbackExemptions || [])];
|
|
114
113
|
|
|
115
114
|
// Handle fallbacks
|
|
116
|
-
const fallback = state.opts.shouldForceAutoFallback !== false && !isExempted(tokenName, forceAutoFallbackExemptions) ? t.stringLiteral(getDefaultFallback(tokenName
|
|
115
|
+
const fallback = state.opts.shouldForceAutoFallback !== false && !isExempted(tokenName, forceAutoFallbackExemptions) ? t.stringLiteral(getDefaultFallback(tokenName)) : path.node.arguments[1];
|
|
117
116
|
if (t.isStringLiteral(fallback)) {
|
|
118
117
|
// String literals can be concatenated into css variable call
|
|
119
118
|
// Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
|
|
@@ -171,11 +170,10 @@ export default function plugin() {
|
|
|
171
170
|
};
|
|
172
171
|
}
|
|
173
172
|
const lightValues = getThemeValues(light);
|
|
174
|
-
const legacyLightValues = getThemeValues(legacyLight);
|
|
175
173
|
const shapeValues = getThemeValues(shape);
|
|
176
174
|
const spacingValues = getThemeValues(spacing);
|
|
177
175
|
const typographyValues = getThemeValues(typography);
|
|
178
|
-
function getDefaultFallback(tokenName
|
|
176
|
+
function getDefaultFallback(tokenName) {
|
|
179
177
|
if (shapeValues[tokenName]) {
|
|
180
178
|
return shapeValues[tokenName];
|
|
181
179
|
}
|
|
@@ -185,8 +183,7 @@ function getDefaultFallback(tokenName, theme = 'light') {
|
|
|
185
183
|
if (typographyValues[tokenName]) {
|
|
186
184
|
return typographyValues[tokenName];
|
|
187
185
|
}
|
|
188
|
-
|
|
189
|
-
return colorValues[tokenName];
|
|
186
|
+
return lightValues[tokenName];
|
|
190
187
|
}
|
|
191
188
|
function getNonAliasedImportName(node) {
|
|
192
189
|
if (t.isIdentifier(node.imported)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as light } from '../artifacts/tokens-raw/atlassian-light';
|
|
2
|
-
export { default as legacyLightTokens } from '../artifacts/tokens-raw/atlassian-legacy-light';
|
|
3
2
|
export { default as dark } from '../artifacts/tokens-raw/atlassian-dark';
|
|
4
3
|
export { default as spacing } from '../artifacts/tokens-raw/atlassian-spacing';
|
|
5
4
|
export { default as typography } from '../artifacts/tokens-raw/atlassian-typography';
|
|
@@ -40,7 +40,7 @@ const themeContrastModes = ['more', 'no-preference', 'auto'];
|
|
|
40
40
|
*
|
|
41
41
|
* These ids must be kebab case
|
|
42
42
|
*/
|
|
43
|
-
export const themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', '
|
|
43
|
+
export const themeIds = ['light-increased-contrast', 'light', 'light-future', 'dark', 'dark-future', 'dark-increased-contrast', 'spacing', 'shape', 'typography'];
|
|
44
44
|
/**
|
|
45
45
|
* Theme override ids: the equivalent of themeIds for theme overrides.
|
|
46
46
|
* Theme overrides are temporary and there may not be any defined at times.
|
|
@@ -126,24 +126,6 @@ const themeConfig = {
|
|
|
126
126
|
extends: 'dark',
|
|
127
127
|
increasesContrastFor: 'dark'
|
|
128
128
|
},
|
|
129
|
-
'atlassian-legacy-light': {
|
|
130
|
-
id: 'legacy-light',
|
|
131
|
-
displayName: 'Light Theme (legacy)',
|
|
132
|
-
palette: 'legacyPalette',
|
|
133
|
-
attributes: {
|
|
134
|
-
type: 'color',
|
|
135
|
-
mode: 'light'
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
'atlassian-legacy-dark': {
|
|
139
|
-
id: 'legacy-dark',
|
|
140
|
-
displayName: 'Dark Theme (legacy)',
|
|
141
|
-
palette: 'legacyPalette',
|
|
142
|
-
attributes: {
|
|
143
|
-
type: 'color',
|
|
144
|
-
mode: 'dark'
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
129
|
'atlassian-spacing': {
|
|
148
130
|
id: 'spacing',
|
|
149
131
|
displayName: 'Atlassian Spacing',
|
|
@@ -18,8 +18,8 @@ const isColorMode = modeId => {
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```
|
|
21
|
-
* themeStringToObject('dark:dark light:
|
|
22
|
-
* // returns { dark: 'dark', light: '
|
|
21
|
+
* themeStringToObject('dark:dark light:light spacing:spacing');
|
|
22
|
+
* // returns { dark: 'dark', light: 'light', spacing: 'spacing' }
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export const themeStringToObject = themeState => {
|
|
@@ -51,8 +51,8 @@ export const themeStringToObject = themeState => {
|
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* ```
|
|
54
|
-
* themeObjectToString({ dark: 'dark', light: '
|
|
55
|
-
* // returns 'dark:dark light:
|
|
54
|
+
* themeObjectToString({ dark: 'dark', light: 'light', spacing: 'spacing' });
|
|
55
|
+
* // returns 'dark:dark light:light spacing:spacing'
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
export const themeObjectToString = themeState => Object.entries(themeState).reduce((themeString, [kind, id]) => {
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
* These changes will then be picked up by our tooling which will attempt to
|
|
13
13
|
* migrate as many of these renames as possible.
|
|
14
14
|
*
|
|
15
|
-
* @codegen <<SignedSource::
|
|
15
|
+
* @codegen <<SignedSource::400f0ecf8657b2dcb96d24d2f0aed049>>
|
|
16
16
|
* @codegenCommand yarn build tokens
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
var replacementMapper = [
|
|
19
|
+
var replacementMapper = [{
|
|
20
|
+
"path": "font.body.UNSAFE_small",
|
|
21
|
+
"state": "deprecated",
|
|
22
|
+
"replacement": "font.body.small"
|
|
23
|
+
}];
|
|
20
24
|
export default replacementMapper;
|