@atlaskit/tokens 0.10.3 → 0.10.4

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,11 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 0.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7b9be57869b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7b9be57869b) - ED-14905 made fallback token name work for production
8
+
3
9
  ## 0.10.3
4
10
 
5
11
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.THEME_DATA_ATTRIBUTE = exports.THEMES = exports.LONG_SHORT_MAPPING = exports.DEFAULT_THEME = exports.CSS_PREFIX = void 0;
6
+ exports.TOKEN_NOT_FOUND_CSS_VAR = exports.THEME_DATA_ATTRIBUTE = exports.THEMES = exports.LONG_SHORT_MAPPING = exports.DEFAULT_THEME = exports.CSS_PREFIX = void 0;
7
7
  var THEMES = ['light', 'dark'];
8
8
  exports.THEMES = THEMES;
9
9
  var THEME_DATA_ATTRIBUTE = 'data-theme';
@@ -17,4 +17,6 @@ var LONG_SHORT_MAPPING = {
17
17
  'atlassian-light': 'light',
18
18
  'atlassian-dark': 'dark'
19
19
  };
20
- exports.LONG_SHORT_MAPPING = LONG_SHORT_MAPPING;
20
+ exports.LONG_SHORT_MAPPING = LONG_SHORT_MAPPING;
21
+ var TOKEN_NOT_FOUND_CSS_VAR = "--".concat(CSS_PREFIX, "-token-not-found");
22
+ exports.TOKEN_NOT_FOUND_CSS_VAR = TOKEN_NOT_FOUND_CSS_VAR;
@@ -11,15 +11,22 @@ var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
11
11
 
12
12
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
13
13
 
14
+ var _constants = require("./constants");
15
+
14
16
  var name = "@atlaskit/tokens";
15
- var version = "0.10.3";
17
+ var version = "0.10.4";
16
18
 
17
19
  function token(path, fallback) {
18
20
  var token = _tokenNames.default[path];
19
21
 
20
22
  if (process.env.NODE_ENV !== 'production' && !token) {
21
- (0, _warnOnce.default)("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
22
23
  token = _tokenNames.default['utility.UNSAFE_util.MISSING_TOKEN'];
24
+ (0, _warnOnce.default)("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
25
+ } // if the token is not found - replacing it with variable name without any value, to avoid it being undefined which would result in invalid css
26
+
27
+
28
+ if (!token) {
29
+ token = _constants.TOKEN_NOT_FOUND_CSS_VAR;
23
30
  }
24
31
 
25
32
  var tokenCall = fallback ? "var(".concat(token, ", ").concat(fallback, ")") : "var(".concat(token, ")");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -6,4 +6,5 @@ export const CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand use
6
6
  export const LONG_SHORT_MAPPING = {
7
7
  'atlassian-light': 'light',
8
8
  'atlassian-dark': 'dark'
9
- };
9
+ };
10
+ export const TOKEN_NOT_FOUND_CSS_VAR = `--${CSS_PREFIX}-token-not-found`;
@@ -1,14 +1,20 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
+ import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
3
4
  const name = "@atlaskit/tokens";
4
- const version = "0.10.3";
5
+ const version = "0.10.4";
5
6
 
6
7
  function token(path, fallback) {
7
8
  let token = tokens[path];
8
9
 
9
10
  if (process.env.NODE_ENV !== 'production' && !token) {
10
- warnOnce(`Unknown token id at path: ${path} for ${name}@${version}`);
11
11
  token = tokens['utility.UNSAFE_util.MISSING_TOKEN'];
12
+ warnOnce(`Unknown token id at path: ${path} for ${name}@${version}`);
13
+ } // if the token is not found - replacing it with variable name without any value, to avoid it being undefined which would result in invalid css
14
+
15
+
16
+ if (!token) {
17
+ token = TOKEN_NOT_FOUND_CSS_VAR;
12
18
  }
13
19
 
14
20
  const tokenCall = fallback ? `var(${token}, ${fallback})` : `var(${token})`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -6,4 +6,5 @@ export var CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used
6
6
  export var LONG_SHORT_MAPPING = {
7
7
  'atlassian-light': 'light',
8
8
  'atlassian-dark': 'dark'
9
- };
9
+ };
10
+ export var TOKEN_NOT_FOUND_CSS_VAR = "--".concat(CSS_PREFIX, "-token-not-found");
@@ -1,14 +1,20 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
+ import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
3
4
  var name = "@atlaskit/tokens";
4
- var version = "0.10.3";
5
+ var version = "0.10.4";
5
6
 
6
7
  function token(path, fallback) {
7
8
  var token = tokens[path];
8
9
 
9
10
  if (process.env.NODE_ENV !== 'production' && !token) {
10
- warnOnce("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
11
11
  token = tokens['utility.UNSAFE_util.MISSING_TOKEN'];
12
+ warnOnce("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
13
+ } // if the token is not found - replacing it with variable name without any value, to avoid it being undefined which would result in invalid css
14
+
15
+
16
+ if (!token) {
17
+ token = TOKEN_NOT_FOUND_CSS_VAR;
12
18
  }
13
19
 
14
20
  var tokenCall = fallback ? "var(".concat(token, ", ").concat(fallback, ")") : "var(".concat(token, ")");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -3,3 +3,4 @@ export declare const THEME_DATA_ATTRIBUTE = "data-theme";
3
3
  export declare const DEFAULT_THEME = "light";
4
4
  export declare const CSS_PREFIX = "ds";
5
5
  export declare const LONG_SHORT_MAPPING: Record<string, typeof THEMES[number]>;
6
+ export declare const TOKEN_NOT_FOUND_CSS_VAR: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
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",
@@ -16,7 +16,7 @@
16
16
  "draft": true
17
17
  }
18
18
  },
19
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
19
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
20
20
  "main": "dist/cjs/index.js",
21
21
  "module": "dist/esm/index.js",
22
22
  "module:es2019": "dist/es2019/index.js",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/button": "^16.3.0",
58
58
  "@atlaskit/code": "^14.3.0",
59
59
  "@atlaskit/docs": "^9.0.10",
60
- "@atlaskit/dropdown-menu": "^11.1.3",
60
+ "@atlaskit/dropdown-menu": "^11.2.0",
61
61
  "@atlaskit/empty-state": "^7.3.9",
62
62
  "@atlaskit/focus-ring": "^1.0.0",
63
63
  "@atlaskit/heading": "^0.1.8",
@@ -66,6 +66,7 @@
66
66
  "@atlaskit/modal-dialog": "^12.2.4",
67
67
  "@atlaskit/section-message": "^6.1.7",
68
68
  "@atlaskit/tabs": "^13.2.4",
69
+ "@atlaskit/tag": "^11.3.1",
69
70
  "@atlaskit/textfield": "^5.1.5",
70
71
  "@atlaskit/theme": "^12.1.2",
71
72
  "@atlaskit/toggle": "^12.4.2",