@atlaskit/tokens 11.2.0 → 11.3.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 11.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6df6d2b1f286b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6df6d2b1f286b) -
8
+ Added motion values to tokens babel plugin
9
+
3
10
  ## 11.2.0
4
11
 
5
12
  ### Minor Changes
@@ -9,6 +9,7 @@ export default async function transformer(file: FileInfo, api: API): Promise<str
9
9
  return file.source;
10
10
  }
11
11
 
12
+ let fileHasChanges = false;
12
13
  source.find(j.CallExpression, { callee: { name: 'token' } }).forEach((path) => {
13
14
  if (
14
15
  path.node.arguments.length > 1 &&
@@ -17,8 +18,9 @@ export default async function transformer(file: FileInfo, api: API): Promise<str
17
18
  ) {
18
19
  // Remove the second argument
19
20
  path.node.arguments.splice(1, 1);
21
+ fileHasChanges = true
20
22
  }
21
23
  });
22
24
 
23
- return source.toSource();
25
+ return fileHasChanges ? source.toSource({ useTabs: true }) : file.source;
24
26
  }
@@ -11,6 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var t = _interopRequireWildcard(require("@babel/types"));
12
12
  var _tokenNames = _interopRequireDefault(require("../artifacts/token-names"));
13
13
  var _atlassianLight = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-light"));
14
+ var _atlassianMotion = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-motion"));
14
15
  var _atlassianShape = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-shape"));
15
16
  var _atlassianSpacing = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-spacing"));
16
17
  var _atlassianTypography = _interopRequireDefault(require("../artifacts/tokens-raw/atlassian-typography"));
@@ -196,6 +197,7 @@ var lightValues = getThemeValues(_atlassianLight.default);
196
197
  var shapeValues = getThemeValues(_atlassianShape.default);
197
198
  var spacingValues = getThemeValues(_atlassianSpacing.default);
198
199
  var typographyValues = getThemeValues(_atlassianTypography.default);
200
+ var motionValues = getThemeValues(_atlassianMotion.default);
199
201
  function getDefaultFallback(tokenName) {
200
202
  if (shapeValues[tokenName]) {
201
203
  return shapeValues[tokenName];
@@ -206,6 +208,9 @@ function getDefaultFallback(tokenName) {
206
208
  if (typographyValues[tokenName]) {
207
209
  return typographyValues[tokenName];
208
210
  }
211
+ if (motionValues[tokenName]) {
212
+ return motionValues[tokenName];
213
+ }
209
214
  return lightValues[tokenName];
210
215
  }
211
216
  function getNonAliasedImportName(node) {
@@ -1,6 +1,7 @@
1
1
  import * as t from '@babel/types';
2
2
  import tokenNames from '../artifacts/token-names';
3
3
  import light from '../artifacts/tokens-raw/atlassian-light';
4
+ import motion from '../artifacts/tokens-raw/atlassian-motion';
4
5
  import shape from '../artifacts/tokens-raw/atlassian-shape';
5
6
  import spacing from '../artifacts/tokens-raw/atlassian-spacing';
6
7
  import typography from '../artifacts/tokens-raw/atlassian-typography';
@@ -173,6 +174,7 @@ const lightValues = getThemeValues(light);
173
174
  const shapeValues = getThemeValues(shape);
174
175
  const spacingValues = getThemeValues(spacing);
175
176
  const typographyValues = getThemeValues(typography);
177
+ const motionValues = getThemeValues(motion);
176
178
  function getDefaultFallback(tokenName) {
177
179
  if (shapeValues[tokenName]) {
178
180
  return shapeValues[tokenName];
@@ -183,6 +185,9 @@ function getDefaultFallback(tokenName) {
183
185
  if (typographyValues[tokenName]) {
184
186
  return typographyValues[tokenName];
185
187
  }
188
+ if (motionValues[tokenName]) {
189
+ return motionValues[tokenName];
190
+ }
186
191
  return lightValues[tokenName];
187
192
  }
188
193
  function getNonAliasedImportName(node) {
@@ -8,6 +8,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
8
8
  import * as t from '@babel/types';
9
9
  import tokenNames from '../artifacts/token-names';
10
10
  import light from '../artifacts/tokens-raw/atlassian-light';
11
+ import motion from '../artifacts/tokens-raw/atlassian-motion';
11
12
  import shape from '../artifacts/tokens-raw/atlassian-shape';
12
13
  import spacing from '../artifacts/tokens-raw/atlassian-spacing';
13
14
  import typography from '../artifacts/tokens-raw/atlassian-typography';
@@ -187,6 +188,7 @@ var lightValues = getThemeValues(light);
187
188
  var shapeValues = getThemeValues(shape);
188
189
  var spacingValues = getThemeValues(spacing);
189
190
  var typographyValues = getThemeValues(typography);
191
+ var motionValues = getThemeValues(motion);
190
192
  function getDefaultFallback(tokenName) {
191
193
  if (shapeValues[tokenName]) {
192
194
  return shapeValues[tokenName];
@@ -197,6 +199,9 @@ function getDefaultFallback(tokenName) {
197
199
  if (typographyValues[tokenName]) {
198
200
  return typographyValues[tokenName];
199
201
  }
202
+ if (motionValues[tokenName]) {
203
+ return motionValues[tokenName];
204
+ }
200
205
  return lightValues[tokenName];
201
206
  }
202
207
  function getNonAliasedImportName(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "Design tokens are the single source of truth to name and store design decisions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,21 +50,21 @@
50
50
  "@atlaskit/code": "^17.4.0",
51
51
  "@atlaskit/css": "^0.19.0",
52
52
  "@atlaskit/docs": "^11.7.0",
53
- "@atlaskit/dropdown-menu": "^16.7.0",
53
+ "@atlaskit/dropdown-menu": "^16.8.0",
54
54
  "@atlaskit/dynamic-table": "^18.3.0",
55
- "@atlaskit/form": "^15.4.0",
55
+ "@atlaskit/form": "^15.5.0",
56
56
  "@atlaskit/grid": "^0.18.0",
57
57
  "@atlaskit/heading": "^5.3.0",
58
- "@atlaskit/icon": "^33.0.0",
58
+ "@atlaskit/icon": "^33.1.0",
59
59
  "@atlaskit/inline-message": "^15.6.0",
60
60
  "@atlaskit/link": "^3.3.0",
61
61
  "@atlaskit/lozenge": "^13.5.0",
62
62
  "@atlaskit/popup": "^4.14.0",
63
- "@atlaskit/primitives": "^18.0.0",
63
+ "@atlaskit/primitives": "^18.1.0",
64
64
  "@atlaskit/radio": "^8.4.0",
65
65
  "@atlaskit/section-message": "^8.12.0",
66
66
  "@atlaskit/select": "^21.8.0",
67
- "@atlaskit/tag": "^14.5.0",
67
+ "@atlaskit/tag": "^14.6.0",
68
68
  "@atlaskit/textarea": "^8.2.0",
69
69
  "@atlaskit/textfield": "^8.2.0",
70
70
  "@atlaskit/theme": "^22.0.0",