@atlaskit/tokens 0.7.3 → 0.8.2

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 (65) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/css/atlassian-dark.css +5 -3
  3. package/css/atlassian-light.css +5 -3
  4. package/dist/cjs/artifacts/rename-mapping.js +89 -89
  5. package/dist/cjs/artifacts/token-default-values.js +5 -3
  6. package/dist/cjs/artifacts/token-names.js +2 -0
  7. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +222 -184
  8. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +222 -184
  9. package/dist/cjs/constants.js +18 -0
  10. package/dist/cjs/entry-points/token-ids.js +25 -0
  11. package/dist/cjs/get-token.js +1 -1
  12. package/dist/cjs/token-ids.js +75 -0
  13. package/dist/cjs/tokens/atlassian-dark/color/background.js +3 -3
  14. package/dist/cjs/tokens/atlassian-dark/color/skeleton.js +20 -0
  15. package/dist/cjs/tokens/atlassian-light/color/background.js +3 -3
  16. package/dist/cjs/tokens/atlassian-light/color/skeleton.js +20 -0
  17. package/dist/cjs/tokens/default/color/skeleton.js +28 -0
  18. package/dist/cjs/tokens/default/deprecated/deprecated.js +89 -89
  19. package/dist/cjs/version.json +4 -2
  20. package/dist/es2019/artifacts/rename-mapping.js +89 -89
  21. package/dist/es2019/artifacts/token-default-values.js +5 -3
  22. package/dist/es2019/artifacts/token-names.js +2 -0
  23. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +222 -184
  24. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +222 -184
  25. package/dist/es2019/constants.js +8 -0
  26. package/dist/es2019/entry-points/token-ids.js +1 -0
  27. package/dist/es2019/get-token.js +1 -1
  28. package/dist/es2019/token-ids.js +51 -0
  29. package/dist/es2019/tokens/atlassian-dark/color/background.js +3 -3
  30. package/dist/es2019/tokens/atlassian-dark/color/skeleton.js +13 -0
  31. package/dist/es2019/tokens/atlassian-light/color/background.js +3 -3
  32. package/dist/es2019/tokens/atlassian-light/color/skeleton.js +13 -0
  33. package/dist/es2019/tokens/default/color/skeleton.js +21 -0
  34. package/dist/es2019/tokens/default/deprecated/deprecated.js +89 -89
  35. package/dist/es2019/version.json +4 -2
  36. package/dist/esm/artifacts/rename-mapping.js +89 -89
  37. package/dist/esm/artifacts/token-default-values.js +5 -3
  38. package/dist/esm/artifacts/token-names.js +2 -0
  39. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +222 -184
  40. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +222 -184
  41. package/dist/esm/constants.js +8 -0
  42. package/dist/esm/entry-points/token-ids.js +1 -0
  43. package/dist/esm/get-token.js +1 -1
  44. package/dist/esm/token-ids.js +58 -0
  45. package/dist/esm/tokens/atlassian-dark/color/background.js +3 -3
  46. package/dist/esm/tokens/atlassian-dark/color/skeleton.js +13 -0
  47. package/dist/esm/tokens/atlassian-light/color/background.js +3 -3
  48. package/dist/esm/tokens/atlassian-light/color/skeleton.js +13 -0
  49. package/dist/esm/tokens/default/color/skeleton.js +21 -0
  50. package/dist/esm/tokens/default/deprecated/deprecated.js +89 -89
  51. package/dist/esm/version.json +4 -2
  52. package/dist/types/artifacts/token-default-values.d.ts +5 -3
  53. package/dist/types/artifacts/token-names.d.ts +4 -0
  54. package/dist/types/artifacts/types-internal.d.ts +1 -1
  55. package/dist/types/artifacts/types.d.ts +1 -1
  56. package/dist/types/constants.d.ts +4 -0
  57. package/dist/types/entry-points/token-ids.d.ts +1 -0
  58. package/dist/types/token-ids.d.ts +43 -0
  59. package/dist/types/tokens/atlassian-dark/color/skeleton.d.ts +3 -0
  60. package/dist/types/tokens/atlassian-light/color/skeleton.d.ts +3 -0
  61. package/dist/types/tokens/default/color/skeleton.d.ts +3 -0
  62. package/dist/types/tokens/default/utility/utility.d.ts +10 -10
  63. package/dist/types/types.d.ts +8 -0
  64. package/package.json +5 -2
  65. package/token-ids/package.json +7 -0
@@ -0,0 +1,8 @@
1
+ export var ALLOWED_THEMES = ['light', 'dark'];
2
+ export var DEFAULT_THEME = 'light';
3
+ export var CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used in css/code
4
+
5
+ export var LONG_SHORT_MAPPING = {
6
+ 'atlassian-light': 'light',
7
+ 'atlassian-dark': 'dark'
8
+ };
@@ -0,0 +1 @@
1
+ export { getCSSCustomProperty, getTokenId, getFullyQualifiedTokenId } from '../token-ids';
@@ -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 = "0.7.3";
4
+ var version = "0.8.2";
5
5
 
6
6
  function token(path, fallback) {
7
7
  var token = tokens[path];
@@ -0,0 +1,58 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import { CSS_PREFIX } from './constants';
3
+ /**
4
+ * Transforms a style dictionary token path to a CSS custom property.
5
+ *
6
+ * A css prefix will be prepended and all [default] key words will be omitted
7
+ * from the path
8
+ *
9
+ * @example <caption>Passing a path as an array</caption>
10
+ * // Returns ds-background-bold
11
+ * getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
12
+ *
13
+ * @example <caption>Passing a path as a string</caption>
14
+ * // Returns ds-background-bold
15
+ * getCSSCustomProperty('color.background.bold.[default]')
16
+ */
17
+
18
+ export var getCSSCustomProperty = function getCSSCustomProperty(path) {
19
+ var normalizedPath = typeof path === 'string' ? path.split('.') : path;
20
+ return "--".concat([CSS_PREFIX].concat(_toConsumableArray(normalizedPath.slice(1))).filter(function (el) {
21
+ return el !== '[default]';
22
+ }).join('-'));
23
+ };
24
+
25
+ /**
26
+ * Transforms a style dictionary token path to a shorthand token id
27
+ * These ids will be typically be how tokens are interacted with via typescript and css
28
+ *
29
+ * All [default] key words will be omitted from the path
30
+ *
31
+ * @example <caption>Passing a path as an array</caption>
32
+ * // Returns color.background.bold
33
+ * getTokenId(['color', 'background', 'bold', '[default]'])
34
+ *
35
+ * @example <caption>Passing a path as a string</caption>
36
+ * // Returns color.background.bold
37
+ * getTokenId('color.background.bold.[default]')
38
+ */
39
+ export var getTokenId = function getTokenId(path) {
40
+ var normalizedPath = typeof path === 'string' ? path.split('.') : path;
41
+ return normalizedPath.filter(function (el) {
42
+ return el !== '[default]';
43
+ }).join('.');
44
+ };
45
+ /**
46
+ * Transforms a style dictionary token path to a fully qualified token id
47
+ * These Ids are intended to be used internal to this package by style-dictionary
48
+ *
49
+ * [default] key words will NOT be omitted from the path
50
+ *
51
+ * @example <caption>Passing a path as a string</caption>
52
+ * // Returns color.background.bold.[default]
53
+ * getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
54
+ */
55
+
56
+ export var getFullyQualifiedTokenId = function getFullyQualifiedTokenId(path) {
57
+ return path.join('.');
58
+ };
@@ -23,13 +23,13 @@ var color = {
23
23
  },
24
24
  input: {
25
25
  '[default]': {
26
- value: 'DN100A'
26
+ value: 'DN100'
27
27
  },
28
28
  hovered: {
29
- value: 'DN0'
29
+ value: 'DN200'
30
30
  },
31
31
  pressed: {
32
- value: 'DN200A'
32
+ value: 'DN100'
33
33
  }
34
34
  },
35
35
  neutral: {
@@ -0,0 +1,13 @@
1
+ var color = {
2
+ color: {
3
+ skeleton: {
4
+ '[default]': {
5
+ value: 'DN200A'
6
+ },
7
+ subtle: {
8
+ value: 'DN100A'
9
+ }
10
+ }
11
+ }
12
+ };
13
+ export default color;
@@ -23,13 +23,13 @@ var color = {
23
23
  },
24
24
  input: {
25
25
  '[default]': {
26
- value: 'N100A'
26
+ value: 'N0'
27
27
  },
28
28
  hovered: {
29
- value: 'N0'
29
+ value: 'N100'
30
30
  },
31
31
  pressed: {
32
- value: 'N200A'
32
+ value: 'N0'
33
33
  }
34
34
  },
35
35
  neutral: {
@@ -0,0 +1,13 @@
1
+ var color = {
2
+ color: {
3
+ skeleton: {
4
+ '[default]': {
5
+ value: 'N200A'
6
+ },
7
+ subtle: {
8
+ value: 'N100A'
9
+ }
10
+ }
11
+ }
12
+ };
13
+ export default color;
@@ -0,0 +1,21 @@
1
+ var color = {
2
+ color: {
3
+ skeleton: {
4
+ '[default]': {
5
+ attributes: {
6
+ group: 'paint',
7
+ state: 'active',
8
+ description: 'Use for skeleton loading states'
9
+ }
10
+ },
11
+ subtle: {
12
+ attributes: {
13
+ group: 'paint',
14
+ state: 'active',
15
+ description: 'Use for the pulse or shimmer effect in skeleton loading states'
16
+ }
17
+ }
18
+ }
19
+ }
20
+ };
21
+ export default color;