@atlaskit/tokens 1.39.1 → 1.41.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/artifacts/generated-pairs.js +2 -2
  3. package/dist/cjs/artifacts/theme-import-map.js +3 -15
  4. package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
  5. package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
  6. package/dist/cjs/artifacts/token-default-values.js +2 -2
  7. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +3 -3
  8. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +3 -3
  9. package/dist/cjs/babel-plugin/plugin.js +22 -8
  10. package/dist/cjs/entry-points/tokens-raw.js +7 -0
  11. package/dist/cjs/get-theme-styles.js +2 -2
  12. package/dist/cjs/get-token-value.js +1 -1
  13. package/dist/cjs/get-token.js +1 -1
  14. package/dist/cjs/set-global-theme.js +2 -2
  15. package/dist/cjs/theme-config.js +1 -21
  16. package/dist/cjs/utils/get-theme-preferences.js +0 -11
  17. package/dist/cjs/utils/hash.js +0 -1
  18. package/dist/cjs/utils/hct-color-utils/color-utils.js +2 -2
  19. package/dist/cjs/utils/hct-color-utils/contrast.js +2 -2
  20. package/dist/cjs/utils/hct-color-utils/hct.js +2 -2
  21. package/dist/es2019/artifacts/generated-pairs.js +2 -2
  22. package/dist/es2019/artifacts/theme-import-map.js +1 -5
  23. package/dist/es2019/artifacts/themes/atlassian-dark.js +2 -2
  24. package/dist/es2019/artifacts/themes/atlassian-light.js +2 -2
  25. package/dist/es2019/artifacts/token-default-values.js +2 -2
  26. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +3 -3
  27. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +3 -3
  28. package/dist/es2019/babel-plugin/plugin.js +20 -6
  29. package/dist/es2019/entry-points/tokens-raw.js +1 -0
  30. package/dist/es2019/get-token-value.js +1 -1
  31. package/dist/es2019/get-token.js +1 -1
  32. package/dist/es2019/theme-config.js +1 -21
  33. package/dist/es2019/utils/get-theme-preferences.js +0 -13
  34. package/dist/es2019/utils/hash.js +0 -1
  35. package/dist/esm/artifacts/generated-pairs.js +2 -2
  36. package/dist/esm/artifacts/theme-import-map.js +1 -9
  37. package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
  38. package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
  39. package/dist/esm/artifacts/token-default-values.js +2 -2
  40. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +3 -3
  41. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +3 -3
  42. package/dist/esm/babel-plugin/plugin.js +20 -6
  43. package/dist/esm/entry-points/tokens-raw.js +1 -0
  44. package/dist/esm/get-token-value.js +1 -1
  45. package/dist/esm/get-token.js +1 -1
  46. package/dist/esm/theme-config.js +1 -21
  47. package/dist/esm/utils/get-theme-preferences.js +0 -11
  48. package/dist/esm/utils/hash.js +0 -1
  49. package/dist/types/artifacts/generated-pairs.d.ts +1 -1
  50. package/dist/types/artifacts/theme-import-map.d.ts +1 -1
  51. package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
  52. package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
  53. package/dist/types/artifacts/token-default-values.d.ts +2 -2
  54. package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  55. package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  56. package/dist/types/babel-plugin/plugin.d.ts +2 -2
  57. package/dist/types/entry-points/tokens-raw.d.ts +1 -0
  58. package/dist/types/index.d.ts +1 -1
  59. package/dist/types/theme-config.d.ts +3 -3
  60. package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
  61. package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +1 -1
  62. package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
  63. package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
  64. package/dist/types-ts4.5/artifacts/token-default-values.d.ts +2 -2
  65. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  66. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  67. package/dist/types-ts4.5/babel-plugin/plugin.d.ts +2 -2
  68. package/dist/types-ts4.5/entry-points/tokens-raw.d.ts +1 -0
  69. package/dist/types-ts4.5/index.d.ts +1 -1
  70. package/dist/types-ts4.5/theme-config.d.ts +2 -6
  71. package/figma/atlassian-dark.json +1 -1
  72. package/figma/atlassian-light.json +1 -1
  73. package/package.json +2 -5
  74. package/dist/cjs/artifacts/themes/atlassian-dark-new-input-border.js +0 -12
  75. package/dist/cjs/artifacts/themes/atlassian-light-new-input-border.js +0 -12
  76. package/dist/cjs/artifacts/tokens-raw/atlassian-dark-new-input-border.js +0 -35
  77. package/dist/cjs/artifacts/tokens-raw/atlassian-light-new-input-border.js +0 -35
  78. package/dist/es2019/artifacts/themes/atlassian-dark-new-input-border.js +0 -12
  79. package/dist/es2019/artifacts/themes/atlassian-light-new-input-border.js +0 -12
  80. package/dist/es2019/artifacts/tokens-raw/atlassian-dark-new-input-border.js +0 -29
  81. package/dist/es2019/artifacts/tokens-raw/atlassian-light-new-input-border.js +0 -29
  82. package/dist/esm/artifacts/themes/atlassian-dark-new-input-border.js +0 -6
  83. package/dist/esm/artifacts/themes/atlassian-light-new-input-border.js +0 -6
  84. package/dist/esm/artifacts/tokens-raw/atlassian-dark-new-input-border.js +0 -29
  85. package/dist/esm/artifacts/tokens-raw/atlassian-light-new-input-border.js +0 -29
  86. package/dist/types/artifacts/themes/atlassian-dark-new-input-border.d.ts +0 -7
  87. package/dist/types/artifacts/themes/atlassian-light-new-input-border.d.ts +0 -7
  88. package/dist/types/artifacts/tokens-raw/atlassian-dark-new-input-border.d.ts +0 -29
  89. package/dist/types/artifacts/tokens-raw/atlassian-light-new-input-border.d.ts +0 -29
  90. package/dist/types-ts4.5/artifacts/themes/atlassian-dark-new-input-border.d.ts +0 -7
  91. package/dist/types-ts4.5/artifacts/themes/atlassian-light-new-input-border.d.ts +0 -7
  92. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-new-input-border.d.ts +0 -29
  93. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-new-input-border.d.ts +0 -29
@@ -6,7 +6,7 @@
6
6
  * This allows users to compose their themes and only use the tokens that are requested.
7
7
  * When a new theme is created, the import should automatically be added to the map
8
8
  *
9
- * @codegen <<SignedSource::6c438d052bfcec2f42bfb917a01beef9>>
9
+ * @codegen <<SignedSource::63d467c8d0d48afd8fdc4e213175480c>>
10
10
  * @codegenCommand yarn build tokens
11
11
  */
12
12
 
@@ -33,10 +33,6 @@ const themeImportsMap = {
33
33
  './themes/atlassian-typography-adg3'),
34
34
  'shape': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-shape" */
35
35
  './themes/atlassian-shape'),
36
- 'light-new-input-border': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-light-new-input-border" */
37
- './themes/atlassian-light-new-input-border'),
38
- 'dark-new-input-border': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-dark-new-input-border" */
39
- './themes/atlassian-dark-new-input-border'),
40
36
  'typography-minor3': () => import( /* webpackChunkName: "@atlaskit-internal_atlassian-typography-minor3" */
41
37
  './themes/atlassian-typography-minor3')
42
38
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::dc2c5aac47a1a0e5b07adfca4dfcc7ad>>
3
+ * @codegen <<SignedSource::73c7032ee4ea014038a44d49d438ce85>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  export default `
@@ -78,7 +78,7 @@ html[data-color-mode="dark"][data-theme~="dark:dark"] {
78
78
  --ds-border-accent-gray: #738496;
79
79
  --ds-border-disabled: #A1BDD914;
80
80
  --ds-border-focused: #85B8FF;
81
- --ds-border-input: #A6C5E229;
81
+ --ds-border-input: #738496;
82
82
  --ds-border-inverse: #161A1D;
83
83
  --ds-border-selected: #579DFF;
84
84
  --ds-border-brand: #579DFF;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::70516fae4cc24ba1b8d76c16272420f0>>
3
+ * @codegen <<SignedSource::1dc39a991dc3fbbe997d364bd176d7d5>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  export default `
@@ -78,7 +78,7 @@ html[data-color-mode="dark"][data-theme~="dark:light"] {
78
78
  --ds-border-accent-gray: #758195;
79
79
  --ds-border-disabled: #091E420F;
80
80
  --ds-border-focused: #388BFF;
81
- --ds-border-input: #091E4224;
81
+ --ds-border-input: #8590A2;
82
82
  --ds-border-inverse: #FFFFFF;
83
83
  --ds-border-selected: #0C66E4;
84
84
  --ds-border-brand: #0C66E4;
@@ -7,7 +7,7 @@
7
7
  * Token names mapped to their value in the default Atlassian themes ('light').
8
8
  * These default values are used by the Babel plugin to optionally provide automatic fallbacks.
9
9
  *
10
- * @codegen <<SignedSource::a5ef42a0373166de767df9be7435e58d>>
10
+ * @codegen <<SignedSource::79c7ab52bcfe67ce4b04cd0d15081a1c>>
11
11
  * @codegenCommand yarn build tokens
12
12
  */
13
13
  const defaultTokenValues = {
@@ -82,7 +82,7 @@ const defaultTokenValues = {
82
82
  'color.border.accent.gray': '#758195',
83
83
  'color.border.disabled': '#091E420F',
84
84
  'color.border.focused': '#388BFF',
85
- 'color.border.input': '#091E4224',
85
+ 'color.border.input': '#8590A2',
86
86
  'color.border.inverse': '#FFFFFF',
87
87
  'color.border.selected': '#0C66E4',
88
88
  'color.border.brand': '#0C66E4',
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::17268b2c8921f4f8a7e40e1920d7891a>>
3
+ * @codegen <<SignedSource::adfb0bcfb5ff283cd60f267ea23e788d>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  const tokens = [{
@@ -1572,7 +1572,7 @@ const tokens = [{
1572
1572
  "introduced": "0.6.0",
1573
1573
  "description": "Use for borders of form UI elements, such as text fields, checkboxes, and radio buttons."
1574
1574
  },
1575
- "value": "#A6C5E229",
1575
+ "value": "#738496",
1576
1576
  "filePath": "schema/themes/atlassian-dark/color/border.tsx",
1577
1577
  "isSource": true,
1578
1578
  "original": {
@@ -1582,7 +1582,7 @@ const tokens = [{
1582
1582
  "introduced": "0.6.0",
1583
1583
  "description": "Use for borders of form UI elements, such as text fields, checkboxes, and radio buttons."
1584
1584
  },
1585
- "value": "DarkNeutral300A"
1585
+ "value": "DarkNeutral600"
1586
1586
  },
1587
1587
  "name": "color.border.input",
1588
1588
  "path": ["color", "border", "input"],
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::8002d8a3725e4a69481492649872da52>>
3
+ * @codegen <<SignedSource::3660e560529703d2e2fd6248118f2a84>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  const tokens = [{
@@ -1572,7 +1572,7 @@ const tokens = [{
1572
1572
  "introduced": "0.6.0",
1573
1573
  "description": "Use for borders of form UI elements, such as text fields, checkboxes, and radio buttons."
1574
1574
  },
1575
- "value": "#091E4224",
1575
+ "value": "#8590A2",
1576
1576
  "filePath": "schema/themes/atlassian-light/color/border.tsx",
1577
1577
  "isSource": true,
1578
1578
  "original": {
@@ -1582,7 +1582,7 @@ const tokens = [{
1582
1582
  "introduced": "0.6.0",
1583
1583
  "description": "Use for borders of form UI elements, such as text fields, checkboxes, and radio buttons."
1584
1584
  },
1585
- "value": "Neutral300A"
1585
+ "value": "Neutral500"
1586
1586
  },
1587
1587
  "name": "color.border.input",
1588
1588
  "path": ["color", "border", "input"],
@@ -2,10 +2,12 @@ import * as t from '@babel/types';
2
2
  import tokenNames from '../artifacts/token-names';
3
3
  import legacyLight from '../artifacts/tokens-raw/atlassian-legacy-light';
4
4
  import light from '../artifacts/tokens-raw/atlassian-light';
5
+ import shape from '../artifacts/tokens-raw/atlassian-shape';
6
+ import spacing from '../artifacts/tokens-raw/atlassian-spacing';
7
+ import typography from '../artifacts/tokens-raw/atlassian-typography-adg3';
5
8
  // Convert raw tokens to key-value pairs { token: value }
6
9
  const getThemeValues = theme => {
7
- const tokensToMap = theme === 'light' ? light : legacyLight;
8
- return tokensToMap.reduce((formatted, rawToken) => {
10
+ return theme.reduce((formatted, rawToken) => {
9
11
  let value;
10
12
  if (typeof rawToken.value === 'string') {
11
13
  value = rawToken.value;
@@ -42,8 +44,6 @@ const getThemeValues = theme => {
42
44
  };
43
45
  }, {});
44
46
  };
45
- const lightValues = getThemeValues('light');
46
- const legacyLightValues = getThemeValues('legacy-light');
47
47
  export default function plugin() {
48
48
  return {
49
49
  visitor: {
@@ -145,9 +145,23 @@ export default function plugin() {
145
145
  }
146
146
  };
147
147
  }
148
+ const lightValues = getThemeValues(light);
149
+ const legacyLightValues = getThemeValues(legacyLight);
150
+ const shapeValues = getThemeValues(shape);
151
+ const spacingValues = getThemeValues(spacing);
152
+ const typographyValues = getThemeValues(typography);
148
153
  function getDefaultFallback(tokenName, theme = 'light') {
149
- const tokens = theme === 'legacy-light' ? legacyLightValues : lightValues;
150
- return tokens[tokenName];
154
+ if (shapeValues[tokenName]) {
155
+ return shapeValues[tokenName];
156
+ }
157
+ if (spacingValues[tokenName]) {
158
+ return spacingValues[tokenName];
159
+ }
160
+ if (typographyValues[tokenName]) {
161
+ return typographyValues[tokenName];
162
+ }
163
+ const colorValues = theme === 'legacy-light' ? legacyLightValues : lightValues;
164
+ return colorValues[tokenName];
151
165
  }
152
166
  function getNonAliasedImportName(node) {
153
167
  if (t.isIdentifier(node.imported)) {
@@ -1,4 +1,5 @@
1
1
  export { default as light } from '../artifacts/tokens-raw/atlassian-light';
2
+ export { default as legacyLightTokens } from '../artifacts/tokens-raw/atlassian-legacy-light';
2
3
  export { default as dark } from '../artifacts/tokens-raw/atlassian-dark';
3
4
  export { default as spacing } from '../artifacts/tokens-raw/atlassian-spacing';
4
5
  export { default as typography } from '../artifacts/tokens-raw/atlassian-typography-minor3';
@@ -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.39.1";
4
+ const version = "1.41.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.39.1";
5
+ const version = "1.41.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.
@@ -43,7 +43,7 @@ export const themeIds = ['light-increased-contrast', 'light', 'light-future', 'd
43
43
  * Theme override ids: the equivalent of themeIds for theme overrides.
44
44
  * Theme overrides are temporary and there may not be any defined at times.
45
45
  */
46
- export const themeOverrideIds = ['light-new-input-border', 'dark-new-input-border'];
46
+ export const themeOverrideIds = [];
47
47
  export const themeIdsWithOverrides = [...themeIds, ...themeOverrideIds];
48
48
 
49
49
  /**
@@ -166,26 +166,6 @@ const themeConfig = {
166
166
  type: 'shape'
167
167
  }
168
168
  },
169
- 'atlassian-light-new-input-border': {
170
- id: 'light-new-input-border',
171
- displayName: 'Light Theme New Input Border',
172
- palette: 'defaultPalette',
173
- override: 'light',
174
- attributes: {
175
- type: 'color',
176
- mode: 'light'
177
- }
178
- },
179
- 'atlassian-dark-new-input-border': {
180
- id: 'dark-new-input-border',
181
- displayName: 'Dark Theme New Input Border',
182
- palette: 'defaultPalette',
183
- override: 'dark',
184
- attributes: {
185
- type: 'color',
186
- mode: 'dark'
187
- }
188
- },
189
169
  'atlassian-typography-minor3': {
190
170
  id: 'typography-minor3',
191
171
  displayName: 'Atlassian Typography (Minor Third)',
@@ -39,19 +39,6 @@ export const getThemePreferences = themeState => {
39
39
  return [...new Set(themePreferences)];
40
40
  };
41
41
  export const getThemeOverridePreferences = themeState => {
42
- const {
43
- colorMode
44
- } = themeState;
45
42
  const themeOverridePreferences = [];
46
- if (getBooleanFF('platform.design-system-team.border-checkbox_nyoiu')) {
47
- if (colorMode === 'auto') {
48
- themeOverridePreferences.push('light-new-input-border');
49
- themeOverridePreferences.push('dark-new-input-border');
50
- } else if (colorMode === 'dark') {
51
- themeOverridePreferences.push('dark-new-input-border');
52
- } else {
53
- themeOverridePreferences.push('light-new-input-border');
54
- }
55
- }
56
43
  return [...new Set(themeOverridePreferences)];
57
44
  };
@@ -5,6 +5,5 @@ export const hash = str => {
5
5
  hash = (hash << 5) - hash + char;
6
6
  hash &= hash; // Convert to 32bit integer
7
7
  }
8
-
9
8
  return new Uint32Array([hash])[0].toString(36);
10
9
  };