@atlaskit/tokens 1.56.3 → 1.57.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,14 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.57.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#126723](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126723)
8
+ [`b637fc4edb5b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b637fc4edb5b9) -
9
+ [ux] tokens-babel-plugin accepts `shouldForceAutoFallback` which overrides fallback values
10
+ regardless of provided fallback.
11
+
3
12
  ## 1.56.3
4
13
 
5
14
  ### Patch Changes
@@ -106,7 +106,7 @@ function plugin() {
106
106
  }
107
107
 
108
108
  // Handle fallbacks
109
- var fallback = path.node.arguments[1];
109
+ var fallback = state.opts.shouldForceAutoFallback ? t.stringLiteral(getDefaultFallback(tokenName, state.opts.defaultTheme)) : path.node.arguments[1];
110
110
  if (t.isStringLiteral(fallback)) {
111
111
  // String literals can be concatenated into css variable call
112
112
  // Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
@@ -88,7 +88,7 @@ export default function plugin() {
88
88
  }
89
89
 
90
90
  // Handle fallbacks
91
- const fallback = path.node.arguments[1];
91
+ const fallback = state.opts.shouldForceAutoFallback ? t.stringLiteral(getDefaultFallback(tokenName, state.opts.defaultTheme)) : path.node.arguments[1];
92
92
  if (t.isStringLiteral(fallback)) {
93
93
  // String literals can be concatenated into css variable call
94
94
  // Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
@@ -96,7 +96,7 @@ export default function plugin() {
96
96
  }
97
97
 
98
98
  // Handle fallbacks
99
- var fallback = path.node.arguments[1];
99
+ var fallback = state.opts.shouldForceAutoFallback ? t.stringLiteral(getDefaultFallback(tokenName, state.opts.defaultTheme)) : path.node.arguments[1];
100
100
  if (t.isStringLiteral(fallback)) {
101
101
  // String literals can be concatenated into css variable call
102
102
  // Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
@@ -7,6 +7,7 @@ export default function plugin(): {
7
7
  enter(path: NodePath<t.Program>, state: {
8
8
  opts: {
9
9
  shouldUseAutoFallback?: boolean;
10
+ shouldForceAutoFallback?: boolean;
10
11
  defaultTheme?: DefaultColorTheme;
11
12
  };
12
13
  }): void;
@@ -7,6 +7,7 @@ export default function plugin(): {
7
7
  enter(path: NodePath<t.Program>, state: {
8
8
  opts: {
9
9
  shouldUseAutoFallback?: boolean;
10
+ shouldForceAutoFallback?: boolean;
10
11
  defaultTheme?: DefaultColorTheme;
11
12
  };
12
13
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.56.3",
3
+ "version": "1.57.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/"