@atlaskit/tokens 1.43.0 → 1.43.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,11 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.43.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#91883](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91883) [`90edf674186c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/90edf674186c) - Gracefully handles falsy values passed in as theme properties.
8
+
3
9
  ## 1.43.0
4
10
 
5
11
  ### Minor Changes
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
9
9
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
10
10
  var name = "@atlaskit/tokens";
11
- var version = "1.43.0";
11
+ var version = "1.43.1";
12
12
  /**
13
13
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
14
14
  * resulting CSS Custom Property.
@@ -9,7 +9,7 @@ var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
9
9
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
10
10
  var _constants = require("./constants");
11
11
  var name = "@atlaskit/tokens";
12
- var version = "1.43.0";
12
+ var version = "1.43.1";
13
13
  /**
14
14
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
15
15
  * This should be used to implement design decisions throughout your application.
@@ -21,15 +21,21 @@ var loadAndAppendThemeCss = exports.loadAndAppendThemeCss = /*#__PURE__*/functio
21
21
  }
22
22
  return _context.abrupt("return");
23
23
  case 2:
24
- _context.next = 4;
25
- return loadThemeCss(themeId);
24
+ if (themeId) {
25
+ _context.next = 4;
26
+ break;
27
+ }
28
+ return _context.abrupt("return");
26
29
  case 4:
30
+ _context.next = 6;
31
+ return loadThemeCss(themeId);
32
+ case 6:
27
33
  themeCss = _context.sent;
28
34
  style = document.createElement('style');
29
35
  style.textContent = themeCss;
30
36
  style.dataset.theme = themeId;
31
37
  document.head.appendChild(style);
32
- case 9:
38
+ case 11:
33
39
  case "end":
34
40
  return _context.stop();
35
41
  }
@@ -1,7 +1,7 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  const name = "@atlaskit/tokens";
4
- const version = "1.43.0";
4
+ const version = "1.43.1";
5
5
  /**
6
6
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
7
7
  * resulting CSS Custom Property.
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
4
4
  const name = "@atlaskit/tokens";
5
- const version = "1.43.0";
5
+ const version = "1.43.1";
6
6
  /**
7
7
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
8
8
  * This should be used to implement design decisions throughout your application.
@@ -4,6 +4,12 @@ export const loadAndAppendThemeCss = async themeId => {
4
4
  if (document.head.querySelector(`style[${THEME_DATA_ATTRIBUTE}="${themeId}"]:not([${CUSTOM_THEME_ATTRIBUTE}])`)) {
5
5
  return;
6
6
  }
7
+
8
+ // Gracefully handles falsy values like `null` and `undefined` when maker ignore TS
9
+ // to avoid loading default themes.
10
+ if (!themeId) {
11
+ return;
12
+ }
7
13
  const themeCss = await loadThemeCss(themeId);
8
14
  const style = document.createElement('style');
9
15
  style.textContent = themeCss;
@@ -1,7 +1,7 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  var name = "@atlaskit/tokens";
4
- var version = "1.43.0";
4
+ var version = "1.43.1";
5
5
  /**
6
6
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
7
7
  * resulting CSS Custom Property.
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
4
4
  var name = "@atlaskit/tokens";
5
- var version = "1.43.0";
5
+ var version = "1.43.1";
6
6
  /**
7
7
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
8
8
  * This should be used to implement design decisions throughout your application.
@@ -14,15 +14,21 @@ export var loadAndAppendThemeCss = /*#__PURE__*/function () {
14
14
  }
15
15
  return _context.abrupt("return");
16
16
  case 2:
17
- _context.next = 4;
18
- return loadThemeCss(themeId);
17
+ if (themeId) {
18
+ _context.next = 4;
19
+ break;
20
+ }
21
+ return _context.abrupt("return");
19
22
  case 4:
23
+ _context.next = 6;
24
+ return loadThemeCss(themeId);
25
+ case 6:
20
26
  themeCss = _context.sent;
21
27
  style = document.createElement('style');
22
28
  style.textContent = themeCss;
23
29
  style.dataset.theme = themeId;
24
30
  document.head.appendChild(style);
25
- case 9:
31
+ case 11:
26
32
  case "end":
27
33
  return _context.stop();
28
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.43.0",
3
+ "version": "1.43.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/"
@@ -33,7 +33,7 @@
33
33
  "codegen-tokens": "ts-node --project $(npx repo-root)/tsconfig.node.json ./scripts/style-dictionary/build && cd $(npx repo-root)/packages/design-system/primitives && yarn codegen-styles && cd $(npx repo-root)/packages/design-system/ds-explorations && yarn codegen-styles && cd $(npx repo-root)/packages/design-system/heading && yarn codegen"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/ds-lib": "^2.2.0",
36
+ "@atlaskit/ds-lib": "^2.3.0",
37
37
  "@atlaskit/platform-feature-flags": "^0.2.0",
38
38
  "@babel/runtime": "^7.0.0",
39
39
  "@babel/traverse": "^7.23.2",
@@ -45,6 +45,9 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@af/accessibility-testing": "*",
48
+ "@atlaskit/checkbox": "*",
49
+ "@atlaskit/radio": "*",
50
+ "@atlaskit/tooltip": "*",
48
51
  "@atlaskit/visual-regression": "*",
49
52
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
50
53
  "@atlassian/codegen": "^0.1.0",