@atlaskit/tokens 0.7.2 → 0.8.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/css/atlassian-dark.css +3 -0
  3. package/css/atlassian-light.css +3 -0
  4. package/dist/cjs/artifacts/rename-mapping.js +89 -89
  5. package/dist/cjs/artifacts/token-default-values.js +3 -0
  6. package/dist/cjs/artifacts/token-names.js +3 -0
  7. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +267 -178
  8. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +267 -178
  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/skeleton.js +20 -0
  14. package/dist/cjs/tokens/atlassian-dark/elevation/shadow.js +23 -0
  15. package/dist/cjs/tokens/atlassian-light/color/skeleton.js +20 -0
  16. package/dist/cjs/tokens/atlassian-light/elevation/shadow.js +19 -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/tokens/default/elevation/shadow.js +7 -0
  20. package/dist/cjs/version.json +4 -2
  21. package/dist/es2019/artifacts/rename-mapping.js +89 -89
  22. package/dist/es2019/artifacts/token-default-values.js +3 -0
  23. package/dist/es2019/artifacts/token-names.js +3 -0
  24. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +267 -178
  25. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +267 -178
  26. package/dist/es2019/constants.js +8 -0
  27. package/dist/es2019/entry-points/token-ids.js +1 -0
  28. package/dist/es2019/get-token.js +1 -1
  29. package/dist/es2019/token-ids.js +51 -0
  30. package/dist/es2019/tokens/atlassian-dark/color/skeleton.js +13 -0
  31. package/dist/es2019/tokens/atlassian-dark/elevation/shadow.js +23 -0
  32. package/dist/es2019/tokens/atlassian-light/color/skeleton.js +13 -0
  33. package/dist/es2019/tokens/atlassian-light/elevation/shadow.js +19 -0
  34. package/dist/es2019/tokens/default/color/skeleton.js +21 -0
  35. package/dist/es2019/tokens/default/deprecated/deprecated.js +89 -89
  36. package/dist/es2019/tokens/default/elevation/shadow.js +7 -0
  37. package/dist/es2019/version.json +4 -2
  38. package/dist/esm/artifacts/rename-mapping.js +89 -89
  39. package/dist/esm/artifacts/token-default-values.js +3 -0
  40. package/dist/esm/artifacts/token-names.js +3 -0
  41. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +267 -178
  42. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +267 -178
  43. package/dist/esm/constants.js +8 -0
  44. package/dist/esm/entry-points/token-ids.js +1 -0
  45. package/dist/esm/get-token.js +1 -1
  46. package/dist/esm/token-ids.js +58 -0
  47. package/dist/esm/tokens/atlassian-dark/color/skeleton.js +13 -0
  48. package/dist/esm/tokens/atlassian-dark/elevation/shadow.js +23 -0
  49. package/dist/esm/tokens/atlassian-light/color/skeleton.js +13 -0
  50. package/dist/esm/tokens/atlassian-light/elevation/shadow.js +19 -0
  51. package/dist/esm/tokens/default/color/skeleton.js +21 -0
  52. package/dist/esm/tokens/default/deprecated/deprecated.js +89 -89
  53. package/dist/esm/tokens/default/elevation/shadow.js +7 -0
  54. package/dist/esm/version.json +4 -2
  55. package/dist/types/artifacts/token-default-values.d.ts +3 -0
  56. package/dist/types/artifacts/token-names.d.ts +6 -0
  57. package/dist/types/artifacts/types-internal.d.ts +1 -1
  58. package/dist/types/artifacts/types.d.ts +1 -1
  59. package/dist/types/constants.d.ts +4 -0
  60. package/dist/types/entry-points/token-ids.d.ts +1 -0
  61. package/dist/types/token-ids.d.ts +43 -0
  62. package/dist/types/tokens/atlassian-dark/color/skeleton.d.ts +3 -0
  63. package/dist/types/tokens/atlassian-light/color/skeleton.d.ts +3 -0
  64. package/dist/types/tokens/default/color/skeleton.d.ts +3 -0
  65. package/dist/types/tokens/default/utility/utility.d.ts +10 -10
  66. package/dist/types/types.d.ts +9 -0
  67. package/package.json +5 -2
  68. package/token-ids/package.json +7 -0
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LONG_SHORT_MAPPING = exports.DEFAULT_THEME = exports.CSS_PREFIX = exports.ALLOWED_THEMES = void 0;
7
+ var ALLOWED_THEMES = ['light', 'dark'];
8
+ exports.ALLOWED_THEMES = ALLOWED_THEMES;
9
+ var DEFAULT_THEME = 'light';
10
+ exports.DEFAULT_THEME = DEFAULT_THEME;
11
+ var CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used in css/code
12
+
13
+ exports.CSS_PREFIX = CSS_PREFIX;
14
+ var LONG_SHORT_MAPPING = {
15
+ 'atlassian-light': 'light',
16
+ 'atlassian-dark': 'dark'
17
+ };
18
+ exports.LONG_SHORT_MAPPING = LONG_SHORT_MAPPING;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "getCSSCustomProperty", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _tokenIds.getCSSCustomProperty;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "getFullyQualifiedTokenId", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _tokenIds.getFullyQualifiedTokenId;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "getTokenId", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _tokenIds.getTokenId;
22
+ }
23
+ });
24
+
25
+ var _tokenIds = require("../token-ids");
@@ -12,7 +12,7 @@ var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
12
12
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
13
13
 
14
14
  var name = "@atlaskit/tokens";
15
- var version = "0.7.2";
15
+ var version = "0.8.1";
16
16
 
17
17
  function token(path, fallback) {
18
18
  var token = _tokenNames.default[path];
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getTokenId = exports.getFullyQualifiedTokenId = exports.getCSSCustomProperty = void 0;
9
+
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+
12
+ var _constants = require("./constants");
13
+
14
+ /**
15
+ * Transforms a style dictionary token path to a CSS custom property.
16
+ *
17
+ * A css prefix will be prepended and all [default] key words will be omitted
18
+ * from the path
19
+ *
20
+ * @example <caption>Passing a path as an array</caption>
21
+ * // Returns ds-background-bold
22
+ * getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
23
+ *
24
+ * @example <caption>Passing a path as a string</caption>
25
+ * // Returns ds-background-bold
26
+ * getCSSCustomProperty('color.background.bold.[default]')
27
+ */
28
+ var getCSSCustomProperty = function getCSSCustomProperty(path) {
29
+ var normalizedPath = typeof path === 'string' ? path.split('.') : path;
30
+ return "--".concat([_constants.CSS_PREFIX].concat((0, _toConsumableArray2.default)(normalizedPath.slice(1))).filter(function (el) {
31
+ return el !== '[default]';
32
+ }).join('-'));
33
+ };
34
+
35
+ exports.getCSSCustomProperty = getCSSCustomProperty;
36
+
37
+ /**
38
+ * Transforms a style dictionary token path to a shorthand token id
39
+ * These ids will be typically be how tokens are interacted with via typescript and css
40
+ *
41
+ * All [default] key words will be omitted from the path
42
+ *
43
+ * @example <caption>Passing a path as an array</caption>
44
+ * // Returns color.background.bold
45
+ * getTokenId(['color', 'background', 'bold', '[default]'])
46
+ *
47
+ * @example <caption>Passing a path as a string</caption>
48
+ * // Returns color.background.bold
49
+ * getTokenId('color.background.bold.[default]')
50
+ */
51
+ var getTokenId = function getTokenId(path) {
52
+ var normalizedPath = typeof path === 'string' ? path.split('.') : path;
53
+ return normalizedPath.filter(function (el) {
54
+ return el !== '[default]';
55
+ }).join('.');
56
+ };
57
+ /**
58
+ * Transforms a style dictionary token path to a fully qualified token id
59
+ * These Ids are intended to be used internal to this package by style-dictionary
60
+ *
61
+ * [default] key words will NOT be omitted from the path
62
+ *
63
+ * @example <caption>Passing a path as a string</caption>
64
+ * // Returns color.background.bold.[default]
65
+ * getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
66
+ */
67
+
68
+
69
+ exports.getTokenId = getTokenId;
70
+
71
+ var getFullyQualifiedTokenId = function getFullyQualifiedTokenId(path) {
72
+ return path.join('.');
73
+ };
74
+
75
+ exports.getFullyQualifiedTokenId = getFullyQualifiedTokenId;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var color = {
8
+ color: {
9
+ skeleton: {
10
+ '[default]': {
11
+ value: 'DN200A'
12
+ },
13
+ subtle: {
14
+ value: 'DN100A'
15
+ }
16
+ }
17
+ }
18
+ };
19
+ var _default = color;
20
+ exports.default = _default;
@@ -28,6 +28,29 @@ var shadow = {
28
28
  opacity: 0.5
29
29
  }]
30
30
  },
31
+ overflow: {
32
+ value: [{
33
+ radius: 12,
34
+ offset: {
35
+ x: 0,
36
+ y: 0
37
+ },
38
+ // @ts-ignore no current palette colour for this yet
39
+ color: '#030404',
40
+ // This opacity overrides the color alpha.
41
+ opacity: 0.56
42
+ }, {
43
+ radius: 1,
44
+ offset: {
45
+ x: 0,
46
+ y: 0
47
+ },
48
+ // @ts-ignore no current palette colour for this yet
49
+ color: '#030404',
50
+ // This opacity overrides the color alpha.
51
+ opacity: 0.5
52
+ }]
53
+ },
31
54
  overlay: {
32
55
  value: [{
33
56
  radius: 0,
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var color = {
8
+ color: {
9
+ skeleton: {
10
+ '[default]': {
11
+ value: 'N200A'
12
+ },
13
+ subtle: {
14
+ value: 'N100A'
15
+ }
16
+ }
17
+ }
18
+ };
19
+ var _default = color;
20
+ exports.default = _default;
@@ -26,6 +26,25 @@ var shadow = {
26
26
  opacity: 0.31
27
27
  }]
28
28
  },
29
+ overflow: {
30
+ value: [{
31
+ radius: 8,
32
+ offset: {
33
+ x: 0,
34
+ y: 8
35
+ },
36
+ color: 'N1100',
37
+ opacity: 0.08
38
+ }, {
39
+ radius: 1,
40
+ offset: {
41
+ x: 0,
42
+ y: 0
43
+ },
44
+ color: 'N1100',
45
+ opacity: 0.12
46
+ }]
47
+ },
29
48
  overlay: {
30
49
  value: [{
31
50
  radius: 12,
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var color = {
8
+ color: {
9
+ skeleton: {
10
+ '[default]': {
11
+ attributes: {
12
+ group: 'paint',
13
+ state: 'active',
14
+ description: 'Use for skeleton loading states'
15
+ }
16
+ },
17
+ subtle: {
18
+ attributes: {
19
+ group: 'paint',
20
+ state: 'active',
21
+ description: 'Use for the pulse or shimmer effect in skeleton loading states'
22
+ }
23
+ }
24
+ }
25
+ }
26
+ };
27
+ var _default = color;
28
+ exports.default = _default;