@atlaskit/tokens 0.10.19 → 0.10.21

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 (162) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/babel-plugin/package.json +8 -1
  3. package/css/atlassian-dark.css +8 -2
  4. package/css/atlassian-legacy-dark.css +8 -2
  5. package/css/atlassian-legacy-light.css +7 -1
  6. package/css/atlassian-light.css +7 -1
  7. package/dist/cjs/artifacts/rename-mapping.js +4 -4
  8. package/dist/cjs/artifacts/token-default-values.js +7 -1
  9. package/dist/cjs/artifacts/token-names.js +7 -1
  10. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +163 -17
  11. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +163 -17
  12. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +143 -17
  13. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +143 -17
  14. package/dist/cjs/get-token.js +1 -1
  15. package/dist/cjs/tokens/atlassian-dark/elevation/shadow.js +12 -0
  16. package/dist/cjs/tokens/atlassian-dark/elevation/surface.js +27 -3
  17. package/dist/cjs/tokens/atlassian-legacy-dark/elevation/shadow.js +12 -0
  18. package/dist/cjs/tokens/atlassian-legacy-dark/elevation/surface.js +27 -3
  19. package/dist/cjs/tokens/atlassian-legacy-light/elevation/surface.js +27 -3
  20. package/dist/cjs/tokens/atlassian-light/elevation/surface.js +27 -3
  21. package/dist/cjs/tokens/default/deprecated/deprecated.js +3 -3
  22. package/dist/cjs/tokens/default/elevation/surface.js +69 -15
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/es2019/artifacts/rename-mapping.js +4 -4
  25. package/dist/es2019/artifacts/token-default-values.js +7 -1
  26. package/dist/es2019/artifacts/token-names.js +7 -1
  27. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +163 -17
  28. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +163 -17
  29. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +143 -17
  30. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +143 -17
  31. package/dist/es2019/get-token.js +1 -1
  32. package/dist/es2019/tokens/atlassian-dark/elevation/shadow.js +12 -0
  33. package/dist/es2019/tokens/atlassian-dark/elevation/surface.js +27 -3
  34. package/dist/es2019/tokens/atlassian-legacy-dark/elevation/shadow.js +12 -0
  35. package/dist/es2019/tokens/atlassian-legacy-dark/elevation/surface.js +27 -3
  36. package/dist/es2019/tokens/atlassian-legacy-light/elevation/surface.js +27 -3
  37. package/dist/es2019/tokens/atlassian-light/elevation/surface.js +27 -3
  38. package/dist/es2019/tokens/default/deprecated/deprecated.js +3 -3
  39. package/dist/es2019/tokens/default/elevation/surface.js +69 -17
  40. package/dist/es2019/version.json +1 -1
  41. package/dist/esm/artifacts/rename-mapping.js +4 -4
  42. package/dist/esm/artifacts/token-default-values.js +7 -1
  43. package/dist/esm/artifacts/token-names.js +7 -1
  44. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +163 -17
  45. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +163 -17
  46. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +143 -17
  47. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +143 -17
  48. package/dist/esm/get-token.js +1 -1
  49. package/dist/esm/tokens/atlassian-dark/elevation/shadow.js +12 -0
  50. package/dist/esm/tokens/atlassian-dark/elevation/surface.js +27 -3
  51. package/dist/esm/tokens/atlassian-legacy-dark/elevation/shadow.js +12 -0
  52. package/dist/esm/tokens/atlassian-legacy-dark/elevation/surface.js +27 -3
  53. package/dist/esm/tokens/atlassian-legacy-light/elevation/surface.js +27 -3
  54. package/dist/esm/tokens/atlassian-light/elevation/surface.js +27 -3
  55. package/dist/esm/tokens/default/deprecated/deprecated.js +3 -3
  56. package/dist/esm/tokens/default/elevation/surface.js +69 -15
  57. package/dist/esm/version.json +1 -1
  58. package/dist/types/artifacts/rename-mapping.d.ts +1 -1
  59. package/dist/types/artifacts/token-default-values.d.ts +7 -1
  60. package/dist/types/artifacts/token-names.d.ts +13 -1
  61. package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  62. package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
  63. package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
  64. package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  65. package/dist/types/artifacts/types-internal.d.ts +2 -2
  66. package/dist/types/artifacts/types.d.ts +2 -2
  67. package/dist/types/types.d.ts +15 -3
  68. package/dist/types-ts4.0/artifacts/palettes-raw/legacy-palette.d.ts +41 -0
  69. package/dist/types-ts4.0/artifacts/palettes-raw/palette.d.ts +41 -0
  70. package/dist/types-ts4.0/artifacts/rename-mapping.d.ts +26 -0
  71. package/dist/types-ts4.0/artifacts/token-default-values.d.ts +302 -0
  72. package/dist/types-ts4.0/artifacts/token-names.d.ts +593 -0
  73. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-dark.d.ts +222 -0
  74. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +222 -0
  75. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-legacy-light.d.ts +174 -0
  76. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-light.d.ts +174 -0
  77. package/dist/types-ts4.0/artifacts/types-internal.d.ts +6 -0
  78. package/dist/types-ts4.0/artifacts/types.d.ts +6 -0
  79. package/dist/types-ts4.0/babel-plugin/index.d.ts +1 -0
  80. package/dist/types-ts4.0/babel-plugin/plugin.d.ts +14 -0
  81. package/dist/types-ts4.0/constants.d.ts +17 -0
  82. package/dist/types-ts4.0/entry-points/babel-plugin.d.ts +1 -0
  83. package/dist/types-ts4.0/entry-points/palettes-raw.d.ts +1 -0
  84. package/dist/types-ts4.0/entry-points/rename-mapping.d.ts +1 -0
  85. package/dist/types-ts4.0/entry-points/token-ids.d.ts +1 -0
  86. package/dist/types-ts4.0/entry-points/token-names.d.ts +2 -0
  87. package/dist/types-ts4.0/figma/synchronize-figma-tokens.d.ts +24 -0
  88. package/dist/types-ts4.0/figma/types.d.ts +40 -0
  89. package/dist/types-ts4.0/get-token.d.ts +4 -0
  90. package/dist/types-ts4.0/index.d.ts +5 -0
  91. package/dist/types-ts4.0/palettes/legacy-palette.d.ts +10 -0
  92. package/dist/types-ts4.0/palettes/palette.d.ts +5 -0
  93. package/dist/types-ts4.0/set-global-theme.d.ts +3 -0
  94. package/dist/types-ts4.0/theme-change-observer.d.ts +35 -0
  95. package/dist/types-ts4.0/tokens/atlassian-dark/color/accent.d.ts +4 -0
  96. package/dist/types-ts4.0/tokens/atlassian-dark/color/background.d.ts +4 -0
  97. package/dist/types-ts4.0/tokens/atlassian-dark/color/border.d.ts +4 -0
  98. package/dist/types-ts4.0/tokens/atlassian-dark/color/icon.d.ts +4 -0
  99. package/dist/types-ts4.0/tokens/atlassian-dark/color/interaction.d.ts +4 -0
  100. package/dist/types-ts4.0/tokens/atlassian-dark/color/skeleton.d.ts +4 -0
  101. package/dist/types-ts4.0/tokens/atlassian-dark/color/text.d.ts +4 -0
  102. package/dist/types-ts4.0/tokens/atlassian-dark/deprecated/deprecated.d.ts +4 -0
  103. package/dist/types-ts4.0/tokens/atlassian-dark/elevation/shadow.d.ts +4 -0
  104. package/dist/types-ts4.0/tokens/atlassian-dark/elevation/surface.d.ts +4 -0
  105. package/dist/types-ts4.0/tokens/atlassian-dark/opacity/opacity.d.ts +3 -0
  106. package/dist/types-ts4.0/tokens/atlassian-dark/utility/utility.d.ts +5 -0
  107. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/accent.d.ts +4 -0
  108. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/background.d.ts +4 -0
  109. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/border.d.ts +4 -0
  110. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/icon.d.ts +4 -0
  111. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/interaction.d.ts +4 -0
  112. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/skeleton.d.ts +4 -0
  113. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/color/text.d.ts +4 -0
  114. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/deprecated/deprecated.d.ts +4 -0
  115. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/elevation/shadow.d.ts +4 -0
  116. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/elevation/surface.d.ts +4 -0
  117. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/opacity/opacity.d.ts +3 -0
  118. package/dist/types-ts4.0/tokens/atlassian-legacy-dark/utility/utility.d.ts +5 -0
  119. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/accent.d.ts +4 -0
  120. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/background.d.ts +4 -0
  121. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/border.d.ts +4 -0
  122. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/icon.d.ts +4 -0
  123. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/interaction.d.ts +4 -0
  124. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/skeleton.d.ts +4 -0
  125. package/dist/types-ts4.0/tokens/atlassian-legacy-light/color/text.d.ts +4 -0
  126. package/dist/types-ts4.0/tokens/atlassian-legacy-light/deprecated/deprecated.d.ts +4 -0
  127. package/dist/types-ts4.0/tokens/atlassian-legacy-light/elevation/shadow.d.ts +4 -0
  128. package/dist/types-ts4.0/tokens/atlassian-legacy-light/elevation/surface.d.ts +4 -0
  129. package/dist/types-ts4.0/tokens/atlassian-legacy-light/opacity/opacity.d.ts +3 -0
  130. package/dist/types-ts4.0/tokens/atlassian-legacy-light/utility/utility.d.ts +5 -0
  131. package/dist/types-ts4.0/tokens/atlassian-light/color/accent.d.ts +4 -0
  132. package/dist/types-ts4.0/tokens/atlassian-light/color/background.d.ts +4 -0
  133. package/dist/types-ts4.0/tokens/atlassian-light/color/border.d.ts +4 -0
  134. package/dist/types-ts4.0/tokens/atlassian-light/color/icon.d.ts +4 -0
  135. package/dist/types-ts4.0/tokens/atlassian-light/color/interaction.d.ts +4 -0
  136. package/dist/types-ts4.0/tokens/atlassian-light/color/skeleton.d.ts +4 -0
  137. package/dist/types-ts4.0/tokens/atlassian-light/color/text.d.ts +4 -0
  138. package/dist/types-ts4.0/tokens/atlassian-light/deprecated/deprecated.d.ts +4 -0
  139. package/dist/types-ts4.0/tokens/atlassian-light/elevation/shadow.d.ts +4 -0
  140. package/dist/types-ts4.0/tokens/atlassian-light/elevation/surface.d.ts +4 -0
  141. package/dist/types-ts4.0/tokens/atlassian-light/opacity/opacity.d.ts +3 -0
  142. package/dist/types-ts4.0/tokens/atlassian-light/utility/utility.d.ts +5 -0
  143. package/dist/types-ts4.0/tokens/default/color/accent.d.ts +4 -0
  144. package/dist/types-ts4.0/tokens/default/color/background.d.ts +4 -0
  145. package/dist/types-ts4.0/tokens/default/color/border.d.ts +4 -0
  146. package/dist/types-ts4.0/tokens/default/color/icon.d.ts +4 -0
  147. package/dist/types-ts4.0/tokens/default/color/interaction.d.ts +4 -0
  148. package/dist/types-ts4.0/tokens/default/color/skeleton.d.ts +4 -0
  149. package/dist/types-ts4.0/tokens/default/color/text.d.ts +4 -0
  150. package/dist/types-ts4.0/tokens/default/deprecated/deprecated.d.ts +4 -0
  151. package/dist/types-ts4.0/tokens/default/elevation/shadow.d.ts +4 -0
  152. package/dist/types-ts4.0/tokens/default/elevation/surface.d.ts +4 -0
  153. package/dist/types-ts4.0/tokens/default/opacity/opacity.d.ts +3 -0
  154. package/dist/types-ts4.0/tokens/default/utility/utility.d.ts +5 -0
  155. package/dist/types-ts4.0/types.d.ts +656 -0
  156. package/dist/types-ts4.0/utils/color-detection.d.ts +38 -0
  157. package/dist/types-ts4.0/utils/token-ids.d.ts +41 -0
  158. package/package.json +15 -7
  159. package/palettes-raw/package.json +8 -1
  160. package/rename-mapping/package.json +8 -1
  161. package/token-ids/package.json +8 -1
  162. package/token-names/package.json +8 -1
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Transforms a style dictionary token path to a CSS custom property.
3
+ *
4
+ * A css prefix will be prepended and all [default] key words will be omitted
5
+ * from the path
6
+ *
7
+ * @example <caption>Passing a path as an array</caption>
8
+ * // Returns ds-background-bold
9
+ * getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
10
+ *
11
+ * @example <caption>Passing a path as a string</caption>
12
+ * // Returns ds-background-bold
13
+ * getCSSCustomProperty('color.background.bold.[default]')
14
+ */
15
+ export declare const getCSSCustomProperty: (path: string | string[]) => string;
16
+ /**
17
+ * Transforms a style dictionary token path to a shorthand token id
18
+ * These ids will be typically be how tokens are interacted with via typescript and css
19
+ *
20
+ * All [default] key words will be omitted from the path
21
+ *
22
+ * @example <caption>Passing a path as an array</caption>
23
+ * // Returns color.background.bold
24
+ * getTokenId(['color', 'background', 'bold', '[default]'])
25
+ *
26
+ * @example <caption>Passing a path as a string</caption>
27
+ * // Returns color.background.bold
28
+ * getTokenId('color.background.bold.[default]')
29
+ */
30
+ export declare const getTokenId: (path: string | string[]) => string;
31
+ /**
32
+ * Transforms a style dictionary token path to a fully qualified token id
33
+ * These Ids are intended to be used internal to this package by style-dictionary
34
+ *
35
+ * [default] key words will NOT be omitted from the path
36
+ *
37
+ * @example <caption>Passing a path as a string</caption>
38
+ * // Returns color.background.bold.[default]
39
+ * getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
40
+ */
41
+ export declare const getFullyQualifiedTokenId: (path: string[]) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.19",
3
+ "version": "0.10.21",
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",
@@ -21,6 +21,13 @@
21
21
  "module": "dist/esm/index.js",
22
22
  "module:es2019": "dist/es2019/index.js",
23
23
  "types": "dist/types/index.d.ts",
24
+ "typesVersions": {
25
+ ">=4.0 <4.5": {
26
+ "*": [
27
+ "dist/types-ts4.0/*"
28
+ ]
29
+ }
30
+ },
24
31
  "sideEffects": [
25
32
  "**/*.css"
26
33
  ],
@@ -78,11 +85,12 @@
78
85
  "@atlaskit/tooltip": "^17.5.7",
79
86
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
80
87
  "@babel/core": "^7.12.3",
88
+ "@emotion/core": "^10.0.9",
81
89
  "@emotion/react": "^11.7.1",
82
- "@testing-library/dom": "^7.7.3",
83
- "@testing-library/react": "^8.0.1",
84
- "@testing-library/react-hooks": "^1.0.4",
85
- "@testing-library/user-event": "10.4.0",
90
+ "@testing-library/dom": "^8.17.1",
91
+ "@testing-library/react": "^12.1.5",
92
+ "@testing-library/react-hooks": "^8.0.1",
93
+ "@testing-library/user-event": "^14.4.3",
86
94
  "@types/chrome": "^0.0.171",
87
95
  "copy-webpack-plugin": "^6.4.0",
88
96
  "fuse.js": "^6.6.2",
@@ -90,8 +98,8 @@
90
98
  "prettier": "^2.1.1",
91
99
  "react": "^16.8.0",
92
100
  "style-dictionary": "^3.0.0",
93
- "ts-node": "^10.0.0",
94
- "typescript": "4.3.5"
101
+ "ts-node": "^10.9.1",
102
+ "typescript": "4.5.5"
95
103
  },
96
104
  "techstack": {
97
105
  "@atlassian/frontend": {
@@ -6,5 +6,12 @@
6
6
  "sideEffects": [
7
7
  "**/*.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/palettes-raw.d.ts"
9
+ "types": "../dist/types/entry-points/palettes-raw.d.ts",
10
+ "typesVersions": {
11
+ ">=4.0 <4.5": {
12
+ "*": [
13
+ "../dist/types-ts4.0/entry-points/palettes-raw.d.ts"
14
+ ]
15
+ }
16
+ }
10
17
  }
@@ -6,5 +6,12 @@
6
6
  "sideEffects": [
7
7
  "**/*.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/rename-mapping.d.ts"
9
+ "types": "../dist/types/entry-points/rename-mapping.d.ts",
10
+ "typesVersions": {
11
+ ">=4.0 <4.5": {
12
+ "*": [
13
+ "../dist/types-ts4.0/entry-points/rename-mapping.d.ts"
14
+ ]
15
+ }
16
+ }
10
17
  }
@@ -6,5 +6,12 @@
6
6
  "sideEffects": [
7
7
  "**/*.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/token-ids.d.ts"
9
+ "types": "../dist/types/entry-points/token-ids.d.ts",
10
+ "typesVersions": {
11
+ ">=4.0 <4.5": {
12
+ "*": [
13
+ "../dist/types-ts4.0/entry-points/token-ids.d.ts"
14
+ ]
15
+ }
16
+ }
10
17
  }
@@ -6,5 +6,12 @@
6
6
  "sideEffects": [
7
7
  "**/*.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/token-names.d.ts"
9
+ "types": "../dist/types/entry-points/token-names.d.ts",
10
+ "typesVersions": {
11
+ ">=4.0 <4.5": {
12
+ "*": [
13
+ "../dist/types-ts4.0/entry-points/token-names.d.ts"
14
+ ]
15
+ }
16
+ }
10
17
  }