@atlaskit/tokens 1.2.19 → 1.3.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,21 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e55ef3fcfac`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e55ef3fcfac) - Fixes an issue where the dark theme tweaks (currently behind a feature flag) were not being displayed in some cases due to a race condition.
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 1.2.19
4
20
 
5
21
  ### Patch 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.2.19";
11
+ var version = "1.3.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.2.19";
12
+ var version = "1.3.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.
@@ -52,11 +52,6 @@ var getThemePreferences = function getThemePreferences(themeState) {
52
52
  themePreferences.push(themeId);
53
53
  }
54
54
  });
55
- if (
56
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
57
- (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
58
- themePreferences.push('dark-iteration');
59
- }
60
55
  return (0, _toConsumableArray2.default)(new Set(themePreferences));
61
56
  };
62
57
 
@@ -125,6 +120,15 @@ var setGlobalTheme = /*#__PURE__*/function () {
125
120
  };
126
121
  }()));
127
122
  case 4:
123
+ if (!(
124
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
125
+ (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark'))) {
126
+ _context2.next = 7;
127
+ break;
128
+ }
129
+ _context2.next = 7;
130
+ return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
131
+ case 7:
128
132
  if (colorMode === 'auto' && darkModeMql) {
129
133
  colorMode = darkModeMql.matches ? 'dark' : 'light';
130
134
  // Add an event listener for changes to the system theme.
@@ -150,7 +154,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
150
154
  document.documentElement.setAttribute(key, value);
151
155
  });
152
156
  return _context2.abrupt("return", unbindThemeChangeListener);
153
- case 8:
157
+ case 11:
154
158
  case "end":
155
159
  return _context2.stop();
156
160
  }
@@ -201,7 +205,12 @@ var getThemeStyles = /*#__PURE__*/function () {
201
205
  spacing: spacing,
202
206
  typography: typography
203
207
  });
204
- _context4.next = 4;
208
+ if (
209
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
210
+ (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
211
+ themePreferences.push('dark-iteration');
212
+ }
213
+ _context4.next = 5;
205
214
  return Promise.all(themePreferences.map( /*#__PURE__*/function () {
206
215
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(themeId) {
207
216
  var css;
@@ -234,12 +243,12 @@ var getThemeStyles = /*#__PURE__*/function () {
234
243
  return _ref8.apply(this, arguments);
235
244
  };
236
245
  }()));
237
- case 4:
246
+ case 5:
238
247
  results = _context4.sent;
239
248
  return _context4.abrupt("return", results.filter(function (theme) {
240
249
  return theme !== undefined;
241
250
  }));
242
- case 6:
251
+ case 7:
243
252
  case "end":
244
253
  return _context4.stop();
245
254
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.2.19",
3
+ "version": "1.3.1",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -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.2.19";
4
+ const version = "1.3.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.2.19";
5
+ const version = "1.3.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.
@@ -43,11 +43,6 @@ const getThemePreferences = themeState => {
43
43
  themePreferences.push(themeId);
44
44
  }
45
45
  });
46
- if (
47
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
48
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
49
- themePreferences.push('dark-iteration');
50
- }
51
46
  return [...new Set(themePreferences)];
52
47
  };
53
48
 
@@ -83,6 +78,11 @@ const setGlobalTheme = async ({
83
78
  typography
84
79
  });
85
80
  await Promise.all(themePreferences.map(async themeId => await loadAndAppendThemeCss(themeId)));
81
+ if (
82
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
83
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
84
+ await loadAndAppendThemeCss('dark-iteration');
85
+ }
86
86
  if (colorMode === 'auto' && darkModeMql) {
87
87
  colorMode = darkModeMql.matches ? 'dark' : 'light';
88
88
  // Add an event listener for changes to the system theme.
@@ -134,6 +134,11 @@ export const getThemeStyles = async ({
134
134
  spacing,
135
135
  typography
136
136
  });
137
+ if (
138
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
139
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
140
+ themePreferences.push('dark-iteration');
141
+ }
137
142
  const results = await Promise.all(themePreferences.map(async themeId => {
138
143
  try {
139
144
  const css = await loadThemeCss(themeId);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.2.19",
3
+ "version": "1.3.1",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -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.2.19";
4
+ var version = "1.3.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.2.19";
5
+ var version = "1.3.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.
@@ -46,11 +46,6 @@ var getThemePreferences = function getThemePreferences(themeState) {
46
46
  themePreferences.push(themeId);
47
47
  }
48
48
  });
49
- if (
50
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
51
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
52
- themePreferences.push('dark-iteration');
53
- }
54
49
  return _toConsumableArray(new Set(themePreferences));
55
50
  };
56
51
 
@@ -119,6 +114,15 @@ var setGlobalTheme = /*#__PURE__*/function () {
119
114
  };
120
115
  }()));
121
116
  case 4:
117
+ if (!(
118
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
119
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark'))) {
120
+ _context2.next = 7;
121
+ break;
122
+ }
123
+ _context2.next = 7;
124
+ return loadAndAppendThemeCss('dark-iteration');
125
+ case 7:
122
126
  if (colorMode === 'auto' && darkModeMql) {
123
127
  colorMode = darkModeMql.matches ? 'dark' : 'light';
124
128
  // Add an event listener for changes to the system theme.
@@ -144,7 +148,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
144
148
  document.documentElement.setAttribute(key, value);
145
149
  });
146
150
  return _context2.abrupt("return", unbindThemeChangeListener);
147
- case 8:
151
+ case 11:
148
152
  case "end":
149
153
  return _context2.stop();
150
154
  }
@@ -195,7 +199,12 @@ export var getThemeStyles = /*#__PURE__*/function () {
195
199
  spacing: spacing,
196
200
  typography: typography
197
201
  });
198
- _context4.next = 4;
202
+ if (
203
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
204
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
205
+ themePreferences.push('dark-iteration');
206
+ }
207
+ _context4.next = 5;
199
208
  return Promise.all(themePreferences.map( /*#__PURE__*/function () {
200
209
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(themeId) {
201
210
  var css;
@@ -228,12 +237,12 @@ export var getThemeStyles = /*#__PURE__*/function () {
228
237
  return _ref8.apply(this, arguments);
229
238
  };
230
239
  }()));
231
- case 4:
240
+ case 5:
232
241
  results = _context4.sent;
233
242
  return _context4.abrupt("return", results.filter(function (theme) {
234
243
  return theme !== undefined;
235
244
  }));
236
- case 6:
245
+ case 7:
237
246
  case "end":
238
247
  return _context4.stop();
239
248
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.2.19",
3
+ "version": "1.3.1",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -22,7 +22,7 @@ export declare type ThemeKinds = 'color' | 'spacing' | 'typography' | 'shape';
22
22
  * The idea is there may exist many color themes, but every theme must either fit into light or dark.
23
23
  */
24
24
  export declare const themeColorModes: readonly ["light", "dark", "auto"];
25
- export declare type ThemeColorModes = typeof themeColorModes[number];
25
+ export declare type ThemeColorModes = (typeof themeColorModes)[number];
26
26
  export declare type DataColorModes = Exclude<ThemeColorModes, 'auto'>;
27
27
  /**
28
28
  * Theme ids: The value that will be mounted to the DOM as a data attr
@@ -31,7 +31,7 @@ export declare type DataColorModes = Exclude<ThemeColorModes, 'auto'>;
31
31
  * These ids must be kebab case
32
32
  */
33
33
  export declare const themeIds: readonly ["light", "dark", "legacy-light", "legacy-dark", "spacing", "typography", "shape"];
34
- export declare type ThemeIds = typeof themeIds[number];
34
+ export declare type ThemeIds = (typeof themeIds)[number];
35
35
  export declare type ThemeOverrideIds = 'dark-iteration';
36
36
  /**
37
37
  * Theme to use a base. This will create the theme as
@@ -1,3 +1,3 @@
1
- import { ThemeIds } from '../theme-config';
2
- export declare const loadAndAppendThemeCss: (themeId: ThemeIds) => Promise<void>;
3
- export declare const loadThemeCss: (themeId: ThemeIds) => Promise<string>;
1
+ import { ThemeIds, ThemeOverrideIds } from '../theme-config';
2
+ export declare const loadAndAppendThemeCss: (themeId: ThemeIds | ThemeOverrideIds) => Promise<void>;
3
+ export declare const loadThemeCss: (themeId: ThemeIds | ThemeOverrideIds) => Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.2.19",
3
+ "version": "1.3.1",
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",
@@ -52,8 +52,8 @@
52
52
  "codegen-tokens": "ts-node --project $(npx repo-root)/tsconfig.node.json ./scripts/style-dictionary/build"
53
53
  },
54
54
  "dependencies": {
55
- "@atlaskit/ds-lib": "^2.1.0",
56
- "@atlaskit/platform-feature-flags": "^0.1.0",
55
+ "@atlaskit/ds-lib": "^2.2.0",
56
+ "@atlaskit/platform-feature-flags": "^0.2.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@babel/traverse": "^7.20.0",
59
59
  "@babel/types": "^7.20.0",
@@ -64,35 +64,35 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@af/accessibility-testing": "*",
67
- "@atlaskit/avatar": "^21.2.0",
68
- "@atlaskit/badge": "^15.0.11",
69
- "@atlaskit/button": "^16.6.0",
70
- "@atlaskit/checkbox": "^12.4.0",
71
- "@atlaskit/code": "^14.5.0",
72
- "@atlaskit/docs": "^9.0.10",
73
- "@atlaskit/dropdown-menu": "^11.7.0",
74
- "@atlaskit/ds-explorations": "^2.0.0",
75
- "@atlaskit/dynamic-table": "^14.8.0",
76
- "@atlaskit/empty-state": "^7.4.0",
77
- "@atlaskit/focus-ring": "^1.2.0",
78
- "@atlaskit/grid": "^0.8.7",
79
- "@atlaskit/heading": "^1.2.0",
80
- "@atlaskit/icon": "^21.11.0",
81
- "@atlaskit/lozenge": "^11.3.0",
82
- "@atlaskit/modal-dialog": "^12.4.0",
83
- "@atlaskit/primitives": "^0.8.0",
84
- "@atlaskit/section-message": "^6.3.0",
85
- "@atlaskit/select": "^16.1.0",
86
- "@atlaskit/tabs": "^13.3.0",
87
- "@atlaskit/tag": "^11.4.0",
88
- "@atlaskit/textarea": "^4.5.6",
89
- "@atlaskit/textfield": "^5.3.0",
90
- "@atlaskit/theme": "^12.4.0",
91
- "@atlaskit/toggle": "^12.5.0",
92
- "@atlaskit/tooltip": "^17.7.0",
67
+ "@atlaskit/avatar": "^21.3.0",
68
+ "@atlaskit/badge": "^15.1.0",
69
+ "@atlaskit/button": "^16.7.0",
70
+ "@atlaskit/checkbox": "^12.5.0",
71
+ "@atlaskit/code": "^14.6.0",
72
+ "@atlaskit/docs": "^9.1.0",
73
+ "@atlaskit/dropdown-menu": "^11.8.0",
74
+ "@atlaskit/ds-explorations": "^2.1.0",
75
+ "@atlaskit/dynamic-table": "^14.9.0",
76
+ "@atlaskit/empty-state": "^7.5.0",
77
+ "@atlaskit/focus-ring": "^1.3.0",
78
+ "@atlaskit/grid": "^0.9.0",
79
+ "@atlaskit/heading": "^1.3.0",
80
+ "@atlaskit/icon": "^21.12.0",
81
+ "@atlaskit/lozenge": "^11.4.0",
82
+ "@atlaskit/modal-dialog": "^12.5.0",
83
+ "@atlaskit/primitives": "^0.9.0",
84
+ "@atlaskit/section-message": "^6.4.0",
85
+ "@atlaskit/select": "^16.2.0",
86
+ "@atlaskit/tabs": "^13.4.0",
87
+ "@atlaskit/tag": "^11.5.0",
88
+ "@atlaskit/textarea": "^4.6.0",
89
+ "@atlaskit/textfield": "^5.4.0",
90
+ "@atlaskit/theme": "^12.5.0",
91
+ "@atlaskit/toggle": "^12.6.0",
92
+ "@atlaskit/tooltip": "^17.8.0",
93
93
  "@atlaskit/visual-regression": "*",
94
94
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
95
- "@atlassian/codegen": "^0.0.1",
95
+ "@atlassian/codegen": "^0.1.0",
96
96
  "@atlassian/feature-flags-test-utils": "*",
97
97
  "@babel/core": "^7.20.0",
98
98
  "@emotion/core": "^10.0.9",
@@ -109,7 +109,7 @@
109
109
  "echarts-for-react": "^3.0.2",
110
110
  "fuse.js": "^6.6.2",
111
111
  "lodash": "^4.17.21",
112
- "prettier": "^2.7.0",
112
+ "prettier": "^2.8.0",
113
113
  "react": "^16.8.0",
114
114
  "react-use-clipboard": "^1.0.0",
115
115
  "recharts": "^1.8.5",
package/report.api.md CHANGED
@@ -1255,7 +1255,7 @@ type SpacingPaletteToken = keyof typeof baseSpacingTokens;
1255
1255
  export type SpacingToken = DesignToken<SpacingPaletteToken, 'spacing'>;
1256
1256
 
1257
1257
  // @public (undocumented)
1258
- export type ThemeColorModes = typeof themeColorModes[number];
1258
+ export type ThemeColorModes = (typeof themeColorModes)[number];
1259
1259
 
1260
1260
  // @public
1261
1261
  const themeColorModes: readonly ['light', 'dark', 'auto'];
@@ -1286,7 +1286,7 @@ interface ThemeConfig {
1286
1286
  export const themeConfig: Record<Themes, ThemeConfig>;
1287
1287
 
1288
1288
  // @public (undocumented)
1289
- export type ThemeIds = typeof themeIds[number];
1289
+ export type ThemeIds = (typeof themeIds)[number];
1290
1290
 
1291
1291
  // @public
1292
1292
  const themeIds: readonly [
@@ -556,7 +556,7 @@ type SpacingPaletteToken = keyof typeof baseSpacingTokens;
556
556
  export type SpacingToken = DesignToken<SpacingPaletteToken, 'spacing'>;
557
557
 
558
558
  // @public (undocumented)
559
- export type ThemeColorModes = typeof themeColorModes[number];
559
+ export type ThemeColorModes = (typeof themeColorModes)[number];
560
560
 
561
561
  // @public
562
562
  const themeColorModes: readonly ["light", "dark", "auto"];
@@ -584,7 +584,7 @@ interface ThemeConfig {
584
584
  export const themeConfig: Record<Themes, ThemeConfig>;
585
585
 
586
586
  // @public (undocumented)
587
- export type ThemeIds = typeof themeIds[number];
587
+ export type ThemeIds = (typeof themeIds)[number];
588
588
 
589
589
  // @public
590
590
  const themeIds: readonly ["light", "dark", "legacy-light", "legacy-dark", "spacing", "typography", "shape"];