@atlaskit/tokens 1.19.0 → 1.20.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,11 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0a95595cd3e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0a95595cd3e) - Space tokens are now enabled by default whenever `setGlobalTheme` is called.
8
+
3
9
  ## 1.19.0
4
10
 
5
11
  ### Minor Changes
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
9
  var _constants = require("./constants");
11
10
  var _themeConfig = require("./theme-config");
12
11
  var _themeStateTransformer = require("./theme-state-transformer");
@@ -49,20 +48,10 @@ var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
49
48
  dark: dark,
50
49
  light: light,
51
50
  shape: shape,
52
- spacing: spacing,
51
+ // Load spacing by default
52
+ spacing: spacing || 'spacing',
53
53
  typography: typography
54
54
  };
55
-
56
- // Load spacing by default, currently behind a feature flag
57
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.space-and-shape-tokens_q5me6')) {
58
- themePreferences = {
59
- dark: dark,
60
- light: light,
61
- shape: shape,
62
- spacing: 'spacing',
63
- typography: typography
64
- };
65
- }
66
55
  var themeAttribute = (0, _themeStateTransformer.themeObjectToString)(themePreferences);
67
56
  var result = (_result = {}, (0, _defineProperty2.default)(_result, _constants.THEME_DATA_ATTRIBUTE, themeAttribute), (0, _defineProperty2.default)(_result, _constants.COLOR_MODE_ATTRIBUTE, colorMode === 'auto' ? defaultColorMode : colorMode), _result);
68
57
  if (UNSAFE_themeOptions && (0, _colorUtils.isValidBrandHex)(UNSAFE_themeOptions.brandColor)) {
@@ -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.19.0";
11
+ var version = "1.20.0";
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.19.0";
12
+ var version = "1.20.0";
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.
@@ -24,11 +24,9 @@ var getThemePreferences = function getThemePreferences(themeState) {
24
24
  themePreferences.push("".concat(themePreferences.includes('dark') ? 'dark' : 'light', "-new-input-border"));
25
25
  }
26
26
 
27
- // Load shape and spacing by default, currently behind a feature flag
28
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.space-and-shape-tokens_q5me6')) {
29
- if (!themePreferences.includes('spacing')) {
30
- themePreferences.push('spacing');
31
- }
27
+ // Load spacing by default
28
+ if (!themePreferences.includes('spacing')) {
29
+ themePreferences.push('spacing');
32
30
  }
33
31
  return (0, _toConsumableArray2.default)(new Set(themePreferences));
34
32
  };
@@ -1,4 +1,3 @@
1
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
1
  import { COLOR_MODE_ATTRIBUTE, CUSTOM_THEME_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
3
2
  import { themeStateDefaults } from './theme-config';
4
3
  import { themeObjectToString } from './theme-state-transformer';
@@ -33,20 +32,10 @@ const getThemeHtmlAttrs = ({
33
32
  dark,
34
33
  light,
35
34
  shape,
36
- spacing,
35
+ // Load spacing by default
36
+ spacing: spacing || 'spacing',
37
37
  typography
38
38
  };
39
-
40
- // Load spacing by default, currently behind a feature flag
41
- if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
42
- themePreferences = {
43
- dark,
44
- light,
45
- shape,
46
- spacing: 'spacing',
47
- typography
48
- };
49
- }
50
39
  const themeAttribute = themeObjectToString(themePreferences);
51
40
  const result = {
52
41
  [THEME_DATA_ATTRIBUTE]: themeAttribute,
@@ -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.19.0";
4
+ const version = "1.20.0";
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.19.0";
5
+ const version = "1.20.0";
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.
@@ -18,11 +18,9 @@ export const getThemePreferences = themeState => {
18
18
  themePreferences.push(`${themePreferences.includes('dark') ? 'dark' : 'light'}-new-input-border`);
19
19
  }
20
20
 
21
- // Load shape and spacing by default, currently behind a feature flag
22
- if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
23
- if (!themePreferences.includes('spacing')) {
24
- themePreferences.push('spacing');
25
- }
21
+ // Load spacing by default
22
+ if (!themePreferences.includes('spacing')) {
23
+ themePreferences.push('spacing');
26
24
  }
27
25
  return [...new Set(themePreferences)];
28
26
  };
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
2
  import { COLOR_MODE_ATTRIBUTE, CUSTOM_THEME_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
4
3
  import { themeStateDefaults } from './theme-config';
5
4
  import { themeObjectToString } from './theme-state-transformer';
@@ -42,20 +41,10 @@ var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
42
41
  dark: dark,
43
42
  light: light,
44
43
  shape: shape,
45
- spacing: spacing,
44
+ // Load spacing by default
45
+ spacing: spacing || 'spacing',
46
46
  typography: typography
47
47
  };
48
-
49
- // Load spacing by default, currently behind a feature flag
50
- if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
51
- themePreferences = {
52
- dark: dark,
53
- light: light,
54
- shape: shape,
55
- spacing: 'spacing',
56
- typography: typography
57
- };
58
- }
59
48
  var themeAttribute = themeObjectToString(themePreferences);
60
49
  var result = (_result = {}, _defineProperty(_result, THEME_DATA_ATTRIBUTE, themeAttribute), _defineProperty(_result, COLOR_MODE_ATTRIBUTE, colorMode === 'auto' ? defaultColorMode : colorMode), _result);
61
50
  if (UNSAFE_themeOptions && isValidBrandHex(UNSAFE_themeOptions.brandColor)) {
@@ -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.19.0";
4
+ var version = "1.20.0";
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.19.0";
5
+ var version = "1.20.0";
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.
@@ -17,11 +17,9 @@ export var getThemePreferences = function getThemePreferences(themeState) {
17
17
  themePreferences.push("".concat(themePreferences.includes('dark') ? 'dark' : 'light', "-new-input-border"));
18
18
  }
19
19
 
20
- // Load shape and spacing by default, currently behind a feature flag
21
- if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
22
- if (!themePreferences.includes('spacing')) {
23
- themePreferences.push('spacing');
24
- }
20
+ // Load spacing by default
21
+ if (!themePreferences.includes('spacing')) {
22
+ themePreferences.push('spacing');
25
23
  }
26
24
  return _toConsumableArray(new Set(themePreferences));
27
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.19.0",
3
+ "version": "1.20.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/"
@@ -111,9 +111,6 @@
111
111
  "platform-feature-flags": {
112
112
  "platform.design-system-team.border-checkbox_nyoiu": {
113
113
  "type": "boolean"
114
- },
115
- "platform.design-system-team.space-and-shape-tokens_q5me6": {
116
- "type": "boolean"
117
114
  }
118
115
  },
119
116
  "homepage": "https://atlassian.design/components/tokens",