@atlaskit/tokens 1.22.0 → 1.22.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.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7b6548e6ad0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7b6548e6ad0) - Internally moves the logic which applies spacing as a defaulty enabled theme to be more inline with other themes.
8
+
3
9
  ## 1.22.0
4
10
 
5
11
  ### Minor Changes
@@ -44,15 +44,13 @@ var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
44
44
  typography = _ref$typography === void 0 ? _themeConfig.themeStateDefaults['typography'] : _ref$typography,
45
45
  _ref$UNSAFE_themeOpti = _ref.UNSAFE_themeOptions,
46
46
  UNSAFE_themeOptions = _ref$UNSAFE_themeOpti === void 0 ? _themeConfig.themeStateDefaults['UNSAFE_themeOptions'] : _ref$UNSAFE_themeOpti;
47
- var themePreferences = {
47
+ var themeAttribute = (0, _themeStateTransformer.themeObjectToString)({
48
48
  dark: dark,
49
49
  light: light,
50
50
  shape: shape,
51
- // Load spacing by default
52
- spacing: spacing || 'spacing',
51
+ spacing: spacing,
53
52
  typography: typography
54
- };
55
- var themeAttribute = (0, _themeStateTransformer.themeObjectToString)(themePreferences);
53
+ });
56
54
  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);
57
55
  if (UNSAFE_themeOptions && (0, _colorUtils.isValidBrandHex)(UNSAFE_themeOptions.brandColor)) {
58
56
  var optionString = JSON.stringify(UNSAFE_themeOptions);
@@ -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.22.0";
11
+ var version = "1.22.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.22.0";
12
+ var version = "1.22.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.
@@ -183,7 +183,7 @@ var themeStateDefaults = {
183
183
  dark: 'dark',
184
184
  light: 'light',
185
185
  shape: undefined,
186
- spacing: undefined,
186
+ spacing: 'spacing',
187
187
  typography: undefined,
188
188
  UNSAFE_themeOptions: undefined
189
189
  };
@@ -23,11 +23,6 @@ var getThemePreferences = function getThemePreferences(themeState) {
23
23
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.border-checkbox_nyoiu')) {
24
24
  themePreferences.push("".concat(themePreferences.includes('dark') ? 'dark' : 'light', "-new-input-border"));
25
25
  }
26
-
27
- // Load spacing by default
28
- if (!themePreferences.includes('spacing')) {
29
- themePreferences.push('spacing');
30
- }
31
26
  return (0, _toConsumableArray2.default)(new Set(themePreferences));
32
27
  };
33
28
  exports.getThemePreferences = getThemePreferences;
@@ -28,15 +28,13 @@ const getThemeHtmlAttrs = ({
28
28
  typography = themeStateDefaults['typography'],
29
29
  UNSAFE_themeOptions = themeStateDefaults['UNSAFE_themeOptions']
30
30
  } = {}) => {
31
- let themePreferences = {
31
+ const themeAttribute = themeObjectToString({
32
32
  dark,
33
33
  light,
34
34
  shape,
35
- // Load spacing by default
36
- spacing: spacing || 'spacing',
35
+ spacing,
37
36
  typography
38
- };
39
- const themeAttribute = themeObjectToString(themePreferences);
37
+ });
40
38
  const result = {
41
39
  [THEME_DATA_ATTRIBUTE]: themeAttribute,
42
40
  [COLOR_MODE_ATTRIBUTE]: colorMode === 'auto' ? defaultColorMode : colorMode
@@ -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.22.0";
4
+ const version = "1.22.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.22.0";
5
+ const version = "1.22.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.
@@ -174,7 +174,7 @@ export const themeStateDefaults = {
174
174
  dark: 'dark',
175
175
  light: 'light',
176
176
  shape: undefined,
177
- spacing: undefined,
177
+ spacing: 'spacing',
178
178
  typography: undefined,
179
179
  UNSAFE_themeOptions: undefined
180
180
  };
@@ -17,10 +17,5 @@ export const getThemePreferences = themeState => {
17
17
  if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
18
18
  themePreferences.push(`${themePreferences.includes('dark') ? 'dark' : 'light'}-new-input-border`);
19
19
  }
20
-
21
- // Load spacing by default
22
- if (!themePreferences.includes('spacing')) {
23
- themePreferences.push('spacing');
24
- }
25
20
  return [...new Set(themePreferences)];
26
21
  };
@@ -37,15 +37,13 @@ var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
37
37
  typography = _ref$typography === void 0 ? themeStateDefaults['typography'] : _ref$typography,
38
38
  _ref$UNSAFE_themeOpti = _ref.UNSAFE_themeOptions,
39
39
  UNSAFE_themeOptions = _ref$UNSAFE_themeOpti === void 0 ? themeStateDefaults['UNSAFE_themeOptions'] : _ref$UNSAFE_themeOpti;
40
- var themePreferences = {
40
+ var themeAttribute = themeObjectToString({
41
41
  dark: dark,
42
42
  light: light,
43
43
  shape: shape,
44
- // Load spacing by default
45
- spacing: spacing || 'spacing',
44
+ spacing: spacing,
46
45
  typography: typography
47
- };
48
- var themeAttribute = themeObjectToString(themePreferences);
46
+ });
49
47
  var result = (_result = {}, _defineProperty(_result, THEME_DATA_ATTRIBUTE, themeAttribute), _defineProperty(_result, COLOR_MODE_ATTRIBUTE, colorMode === 'auto' ? defaultColorMode : colorMode), _result);
50
48
  if (UNSAFE_themeOptions && isValidBrandHex(UNSAFE_themeOptions.brandColor)) {
51
49
  var optionString = JSON.stringify(UNSAFE_themeOptions);
@@ -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.22.0";
4
+ var version = "1.22.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.22.0";
5
+ var version = "1.22.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.
@@ -174,7 +174,7 @@ export var themeStateDefaults = {
174
174
  dark: 'dark',
175
175
  light: 'light',
176
176
  shape: undefined,
177
- spacing: undefined,
177
+ spacing: 'spacing',
178
178
  typography: undefined,
179
179
  UNSAFE_themeOptions: undefined
180
180
  };
@@ -16,10 +16,5 @@ export var getThemePreferences = function getThemePreferences(themeState) {
16
16
  if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
17
17
  themePreferences.push("".concat(themePreferences.includes('dark') ? 'dark' : 'light', "-new-input-border"));
18
18
  }
19
-
20
- // Load spacing by default
21
- if (!themePreferences.includes('spacing')) {
22
- themePreferences.push('spacing');
23
- }
24
19
  return _toConsumableArray(new Set(themePreferences));
25
20
  };
@@ -93,7 +93,7 @@ export interface ThemeState {
93
93
  dark: Extract<ThemeIds, 'light' | 'dark' | 'legacy-dark' | 'legacy-light'>;
94
94
  colorMode: ThemeColorModes;
95
95
  shape?: Extract<ThemeIds, 'shape'>;
96
- spacing?: Extract<ThemeIds, 'spacing'>;
96
+ spacing: Extract<ThemeIds, 'spacing'>;
97
97
  typography?: Extract<ThemeIds, 'typography' | 'typography-adg3' | 'typography-minor3'>;
98
98
  UNSAFE_themeOptions?: ThemeOptionsSchema;
99
99
  }
@@ -122,7 +122,7 @@ export interface ThemeState {
122
122
  dark: Extract<ThemeIds, 'light' | 'dark' | 'legacy-dark' | 'legacy-light'>;
123
123
  colorMode: ThemeColorModes;
124
124
  shape?: Extract<ThemeIds, 'shape'>;
125
- spacing?: Extract<ThemeIds, 'spacing'>;
125
+ spacing: Extract<ThemeIds, 'spacing'>;
126
126
  typography?: Extract<ThemeIds, 'typography' | 'typography-adg3' | 'typography-minor3'>;
127
127
  UNSAFE_themeOptions?: ThemeOptionsSchema;
128
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.22.0",
3
+ "version": "1.22.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/"
package/report.api.md CHANGED
@@ -1951,7 +1951,7 @@ export interface ThemeState {
1951
1951
  // (undocumented)
1952
1952
  shape?: Extract<ThemeIds, 'shape'>;
1953
1953
  // (undocumented)
1954
- spacing?: Extract<ThemeIds, 'spacing'>;
1954
+ spacing: Extract<ThemeIds, 'spacing'>;
1955
1955
  // (undocumented)
1956
1956
  typography?: Extract<
1957
1957
  ThemeIds,
@@ -946,7 +946,7 @@ export interface ThemeState {
946
946
  // (undocumented)
947
947
  shape?: Extract<ThemeIds, 'shape'>;
948
948
  // (undocumented)
949
- spacing?: Extract<ThemeIds, 'spacing'>;
949
+ spacing: Extract<ThemeIds, 'spacing'>;
950
950
  // (undocumented)
951
951
  typography?: Extract<ThemeIds, 'typography' | 'typography-adg3' | 'typography-minor3'>;
952
952
  // (undocumented)