@atlaskit/tokens 11.3.0 → 11.3.1

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.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9f858e9b1f9e8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9f858e9b1f9e8) -
8
+ Fixed default fallback resolution for motion design tokens
9
+
3
10
  ## 11.3.0
4
11
 
5
12
  ### Minor Changes
@@ -18,7 +18,7 @@ export default async function transformer(file: FileInfo, api: API): Promise<str
18
18
  ) {
19
19
  // Remove the second argument
20
20
  path.node.arguments.splice(1, 1);
21
- fileHasChanges = true
21
+ fileHasChanges = true;
22
22
  }
23
23
  });
24
24
 
@@ -73,6 +73,18 @@ var getThemeValues = function getThemeValues(theme) {
73
73
  }
74
74
  return prev + value;
75
75
  }, '');
76
+ } else if (Object(rawToken.value).hasOwnProperty('keyframes') || Object(rawToken.value).hasOwnProperty('properties')) {
77
+ // Handle motion tokens which have object values like { duration, curve, keyframes, etc. }
78
+ // Convert to a JSON string representation for fallback value
79
+ var motionToken = rawToken.value;
80
+ if (motionToken.keyframes) {
81
+ value = motionToken.keyframes.map(function (keyframe) {
82
+ return "".concat(motionToken.duration, "ms ").concat(motionToken.curve, " ").concat(keyframe).concat(motionToken.delay ? " ".concat(motionToken.delay, "ms") : '');
83
+ }).join(', ');
84
+ } else {
85
+ var _motionToken$properti;
86
+ value = "".concat((_motionToken$properti = motionToken.properties) === null || _motionToken$properti === void 0 ? void 0 : _motionToken$properti.join(' '), " ").concat(motionToken.duration, "ms ").concat(motionToken.curve).concat(motionToken.delay ? " ".concat(motionToken.delay, "ms") : '');
87
+ }
76
88
  } else {
77
89
  // ignore when value is `fontweight` etc. - this is apparently not handled here.
78
90
  return formatted;
@@ -47,6 +47,16 @@ const getThemeValues = theme => {
47
47
  }
48
48
  return prev + value;
49
49
  }, '');
50
+ } else if (Object(rawToken.value).hasOwnProperty('keyframes') || Object(rawToken.value).hasOwnProperty('properties')) {
51
+ // Handle motion tokens which have object values like { duration, curve, keyframes, etc. }
52
+ // Convert to a JSON string representation for fallback value
53
+ const motionToken = rawToken.value;
54
+ if (motionToken.keyframes) {
55
+ value = motionToken.keyframes.map(keyframe => `${motionToken.duration}ms ${motionToken.curve} ${keyframe}${motionToken.delay ? ` ${motionToken.delay}ms` : ''}`).join(', ');
56
+ } else {
57
+ var _motionToken$properti;
58
+ value = `${(_motionToken$properti = motionToken.properties) === null || _motionToken$properti === void 0 ? void 0 : _motionToken$properti.join(' ')} ${motionToken.duration}ms ${motionToken.curve}${motionToken.delay ? ` ${motionToken.delay}ms` : ''}`;
59
+ }
50
60
  } else {
51
61
  // ignore when value is `fontweight` etc. - this is apparently not handled here.
52
62
  return formatted;
@@ -64,6 +64,18 @@ var getThemeValues = function getThemeValues(theme) {
64
64
  }
65
65
  return prev + value;
66
66
  }, '');
67
+ } else if (Object(rawToken.value).hasOwnProperty('keyframes') || Object(rawToken.value).hasOwnProperty('properties')) {
68
+ // Handle motion tokens which have object values like { duration, curve, keyframes, etc. }
69
+ // Convert to a JSON string representation for fallback value
70
+ var motionToken = rawToken.value;
71
+ if (motionToken.keyframes) {
72
+ value = motionToken.keyframes.map(function (keyframe) {
73
+ return "".concat(motionToken.duration, "ms ").concat(motionToken.curve, " ").concat(keyframe).concat(motionToken.delay ? " ".concat(motionToken.delay, "ms") : '');
74
+ }).join(', ');
75
+ } else {
76
+ var _motionToken$properti;
77
+ value = "".concat((_motionToken$properti = motionToken.properties) === null || _motionToken$properti === void 0 ? void 0 : _motionToken$properti.join(' '), " ").concat(motionToken.duration, "ms ").concat(motionToken.curve).concat(motionToken.delay ? " ".concat(motionToken.delay, "ms") : '');
78
+ }
67
79
  } else {
68
80
  // ignore when value is `fontweight` etc. - this is apparently not handled here.
69
81
  return formatted;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "11.3.0",
3
+ "version": "11.3.1",
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/"