@atlaskit/tokens 1.11.3 → 1.13.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 (181) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +25 -0
  3. package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +25 -0
  4. package/dist/cjs/artifacts/generated-pairs.js +2 -2
  5. package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
  6. package/dist/cjs/artifacts/themes/atlassian-legacy-dark.js +2 -2
  7. package/dist/cjs/artifacts/themes/atlassian-legacy-light.js +2 -2
  8. package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
  9. package/dist/cjs/artifacts/token-default-values.js +7 -1
  10. package/dist/cjs/artifacts/token-names.js +7 -1
  11. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +137 -5
  12. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
  13. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
  14. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +137 -5
  15. package/dist/cjs/constants.js +3 -1
  16. package/dist/cjs/custom-theme.js +108 -0
  17. package/dist/cjs/get-token-value.js +1 -1
  18. package/dist/cjs/get-token.js +1 -1
  19. package/dist/cjs/set-global-theme.js +156 -59
  20. package/dist/cjs/tokens/atlassian-dark/color/background.js +22 -0
  21. package/dist/cjs/tokens/atlassian-legacy-dark/color/background.js +22 -0
  22. package/dist/cjs/tokens/atlassian-legacy-light/color/background.js +22 -0
  23. package/dist/cjs/tokens/atlassian-light/color/background.js +22 -0
  24. package/dist/cjs/tokens/default/color/background.js +54 -2
  25. package/dist/cjs/utils/color-utils.js +178 -0
  26. package/dist/cjs/utils/custom-theme-loading-utils.js +47 -0
  27. package/dist/cjs/utils/custom-theme-token-contrast-check.js +74 -0
  28. package/dist/cjs/utils/generate-custom-color-ramp.js +222 -0
  29. package/dist/cjs/utils/hash.js +17 -0
  30. package/dist/cjs/utils/hct-color-utils/color-utils.js +310 -0
  31. package/dist/cjs/utils/hct-color-utils/contrast.js +188 -0
  32. package/dist/cjs/utils/hct-color-utils/hct.js +1036 -0
  33. package/dist/cjs/utils/hct-color-utils/index.js +32 -0
  34. package/dist/cjs/utils/hct-color-utils/math-utils.js +159 -0
  35. package/dist/cjs/utils/theme-loading.js +1 -1
  36. package/dist/cjs/utils/theme-state-transformer.js +1 -1
  37. package/dist/cjs/version.json +1 -1
  38. package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
  39. package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
  40. package/dist/es2019/artifacts/generated-pairs.js +2 -2
  41. package/dist/es2019/artifacts/themes/atlassian-dark.js +7 -1
  42. package/dist/es2019/artifacts/themes/atlassian-legacy-dark.js +7 -1
  43. package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +7 -1
  44. package/dist/es2019/artifacts/themes/atlassian-light.js +7 -1
  45. package/dist/es2019/artifacts/token-default-values.js +7 -1
  46. package/dist/es2019/artifacts/token-names.js +7 -1
  47. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +137 -5
  48. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
  49. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
  50. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +137 -5
  51. package/dist/es2019/constants.js +1 -0
  52. package/dist/es2019/custom-theme.js +77 -0
  53. package/dist/es2019/get-token-value.js +1 -1
  54. package/dist/es2019/get-token.js +1 -1
  55. package/dist/es2019/set-global-theme.js +67 -13
  56. package/dist/es2019/tokens/atlassian-dark/color/background.js +22 -0
  57. package/dist/es2019/tokens/atlassian-legacy-dark/color/background.js +22 -0
  58. package/dist/es2019/tokens/atlassian-legacy-light/color/background.js +22 -0
  59. package/dist/es2019/tokens/atlassian-light/color/background.js +22 -0
  60. package/dist/es2019/tokens/default/color/background.js +54 -2
  61. package/dist/es2019/utils/color-utils.js +154 -0
  62. package/dist/es2019/utils/custom-theme-loading-utils.js +31 -0
  63. package/dist/es2019/utils/custom-theme-token-contrast-check.js +68 -0
  64. package/dist/es2019/utils/generate-custom-color-ramp.js +198 -0
  65. package/dist/es2019/utils/hash.js +10 -0
  66. package/dist/es2019/utils/hct-color-utils/color-utils.js +286 -0
  67. package/dist/es2019/utils/hct-color-utils/contrast.js +161 -0
  68. package/dist/es2019/utils/hct-color-utils/hct.js +931 -0
  69. package/dist/es2019/utils/hct-color-utils/index.js +3 -0
  70. package/dist/es2019/utils/hct-color-utils/math-utils.js +145 -0
  71. package/dist/es2019/utils/theme-loading.js +2 -2
  72. package/dist/es2019/utils/theme-state-transformer.js +3 -1
  73. package/dist/es2019/version.json +1 -1
  74. package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
  75. package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
  76. package/dist/esm/artifacts/generated-pairs.js +2 -2
  77. package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
  78. package/dist/esm/artifacts/themes/atlassian-legacy-dark.js +2 -2
  79. package/dist/esm/artifacts/themes/atlassian-legacy-light.js +2 -2
  80. package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
  81. package/dist/esm/artifacts/token-default-values.js +7 -1
  82. package/dist/esm/artifacts/token-names.js +7 -1
  83. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +137 -5
  84. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
  85. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
  86. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +137 -5
  87. package/dist/esm/constants.js +1 -0
  88. package/dist/esm/custom-theme.js +98 -0
  89. package/dist/esm/get-token-value.js +1 -1
  90. package/dist/esm/get-token.js +1 -1
  91. package/dist/esm/set-global-theme.js +149 -60
  92. package/dist/esm/tokens/atlassian-dark/color/background.js +22 -0
  93. package/dist/esm/tokens/atlassian-legacy-dark/color/background.js +22 -0
  94. package/dist/esm/tokens/atlassian-legacy-light/color/background.js +22 -0
  95. package/dist/esm/tokens/atlassian-light/color/background.js +22 -0
  96. package/dist/esm/tokens/default/color/background.js +54 -2
  97. package/dist/esm/utils/color-utils.js +162 -0
  98. package/dist/esm/utils/custom-theme-loading-utils.js +38 -0
  99. package/dist/esm/utils/custom-theme-token-contrast-check.js +65 -0
  100. package/dist/esm/utils/generate-custom-color-ramp.js +211 -0
  101. package/dist/esm/utils/hash.js +10 -0
  102. package/dist/esm/utils/hct-color-utils/color-utils.js +285 -0
  103. package/dist/esm/utils/hct-color-utils/contrast.js +181 -0
  104. package/dist/esm/utils/hct-color-utils/hct.js +1029 -0
  105. package/dist/esm/utils/hct-color-utils/index.js +3 -0
  106. package/dist/esm/utils/hct-color-utils/math-utils.js +145 -0
  107. package/dist/esm/utils/theme-loading.js +2 -2
  108. package/dist/esm/utils/theme-state-transformer.js +1 -1
  109. package/dist/esm/version.json +1 -1
  110. package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
  111. package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
  112. package/dist/types/artifacts/generated-pairs.d.ts +1 -1
  113. package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
  114. package/dist/types/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
  115. package/dist/types/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
  116. package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
  117. package/dist/types/artifacts/token-default-values.d.ts +7 -1
  118. package/dist/types/artifacts/token-names.d.ts +13 -1
  119. package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  120. package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
  121. package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
  122. package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  123. package/dist/types/artifacts/types-internal.d.ts +2 -2
  124. package/dist/types/artifacts/types.d.ts +2 -2
  125. package/dist/types/constants.d.ts +1 -0
  126. package/dist/types/custom-theme.d.ts +30 -0
  127. package/dist/types/index.d.ts +1 -0
  128. package/dist/types/set-global-theme.d.ts +9 -3
  129. package/dist/types/types.d.ts +10 -0
  130. package/dist/types/utils/color-utils.d.ts +10 -0
  131. package/dist/types/utils/custom-theme-loading-utils.d.ts +11 -0
  132. package/dist/types/utils/custom-theme-token-contrast-check.d.ts +20 -0
  133. package/dist/types/utils/generate-custom-color-ramp.d.ts +19 -0
  134. package/dist/types/utils/hash.d.ts +1 -0
  135. package/dist/types/utils/hct-color-utils/color-utils.d.ts +131 -0
  136. package/dist/types/utils/hct-color-utils/contrast.d.ts +78 -0
  137. package/dist/types/utils/hct-color-utils/hct.d.ts +137 -0
  138. package/dist/types/utils/hct-color-utils/index.d.ts +3 -0
  139. package/dist/types/utils/hct-color-utils/math-utils.d.ts +86 -0
  140. package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
  141. package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
  142. package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
  143. package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
  144. package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
  145. package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
  146. package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
  147. package/dist/types-ts4.5/artifacts/token-default-values.d.ts +7 -1
  148. package/dist/types-ts4.5/artifacts/token-names.d.ts +13 -1
  149. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  150. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
  151. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
  152. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  153. package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
  154. package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
  155. package/dist/types-ts4.5/constants.d.ts +1 -0
  156. package/dist/types-ts4.5/custom-theme.d.ts +30 -0
  157. package/dist/types-ts4.5/index.d.ts +1 -0
  158. package/dist/types-ts4.5/set-global-theme.d.ts +9 -3
  159. package/dist/types-ts4.5/types.d.ts +10 -0
  160. package/dist/types-ts4.5/utils/color-utils.d.ts +27 -0
  161. package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +11 -0
  162. package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +20 -0
  163. package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +19 -0
  164. package/dist/types-ts4.5/utils/hash.d.ts +1 -0
  165. package/dist/types-ts4.5/utils/hct-color-utils/color-utils.d.ts +131 -0
  166. package/dist/types-ts4.5/utils/hct-color-utils/contrast.d.ts +78 -0
  167. package/dist/types-ts4.5/utils/hct-color-utils/hct.d.ts +137 -0
  168. package/dist/types-ts4.5/utils/hct-color-utils/index.d.ts +3 -0
  169. package/dist/types-ts4.5/utils/hct-color-utils/math-utils.d.ts +86 -0
  170. package/figma/atlassian-dark.json +56 -2
  171. package/figma/atlassian-legacy-dark.json +56 -2
  172. package/figma/atlassian-legacy-light.json +56 -2
  173. package/figma/atlassian-light.json +56 -2
  174. package/package.json +36 -37
  175. package/report.api.md +48 -1
  176. package/dist/cjs/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -902
  177. package/dist/es2019/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
  178. package/dist/esm/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
  179. package/dist/types/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
  180. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
  181. package/tmp/api-report-tmp.d.ts +0 -1132
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`bc512702bdc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc512702bdc) - Introduces new brand background tokens.
8
+
9
+ - `color.background.brand.subtlest` - Use for the background of elements used to reinforce our brand, but with less emphasis.
10
+ - `color.background.brand.subtlest.hovered` - Hovered state of color.background.brand.subtlest.
11
+ - `color.background.brand.subtlest.pressed` - Pressed state of color.background.brand.subtlest.
12
+
13
+ - `color.background.brand.boldest` - Use for the background of elements used to reinforce our brand, that need to stand out a lot.
14
+ - `color.background.brand.boldest.hovered` - Hovered state of color.background.brand.boldest.
15
+ - `color.background.brand.boldest.pressed` - Pressed state of color.background.brand.boldest.
16
+
17
+ Updates custom color generation system with new brand background tokens.
18
+
19
+ ## 1.12.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [`beba2779d31`](https://bitbucket.org/atlassian/atlassian-frontend/commits/beba2779d31) - Add experimental support for custom theming via the `UNSAFE_themeOptions` field in `themeState`.
24
+
25
+ This option is supported in the following functions:
26
+
27
+ - `setGlobalTheme()`: optionally generates and loads customized themes based on the options provided, and sets the `data-custom-theme` attribute on page's HTML tag.
28
+ - `getThemeStyles()`: returns additional style objects for constructing custom theme `<style>` tags.
29
+ - `getThemeHtmlAttrs()`: now supports the `data-custom-theme` attribute.
30
+
31
+ Custom themes are generated at runtime based on the options provided. The theme generation logic is lazy-loaded only when `UNSAFE_themeOptions` is set.
32
+
3
33
  ## 1.11.3
4
34
 
5
35
  ### Patch Changes
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
+ *
10
+ * Token names mapped to their values, used for contrast checking when generating custom themes
11
+ *
12
+ * @codegen <<SignedSource::2d922d82772ca155fb2fe7b5c63dc69a>>
13
+ * @codegenCommand yarn build tokens
14
+ */
15
+ var tokenValues = {
16
+ 'color.text.brand': '#579DFF',
17
+ 'elevation.surface.overlay': '#282E33',
18
+ 'color.text.selected': '#579DFF',
19
+ 'color.background.selected': '#092957',
20
+ 'color.border.brand': '#579DFF',
21
+ 'color.chart.brand': '#388BFF',
22
+ 'color.text.inverse': '#1D2125'
23
+ };
24
+ var _default = tokenValues;
25
+ exports.default = _default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
+ *
10
+ * Token names mapped to their values, used for contrast checking when generating custom themes
11
+ *
12
+ * @codegen <<SignedSource::068e846d4121ab9afc08e7a1f99dbb5e>>
13
+ * @codegenCommand yarn build tokens
14
+ */
15
+ var tokenValues = {
16
+ 'color.text.brand': '#0C66E4',
17
+ 'elevation.surface.sunken': '#F7F8F9',
18
+ 'color.text.selected': '#0C66E4',
19
+ 'color.background.selected': '#E9F2FF',
20
+ 'color.border.brand': '#0C66E4',
21
+ 'color.chart.brand': '#1D7AFC',
22
+ 'color.text.inverse': '#FFFFFF'
23
+ };
24
+ var _default = tokenValues;
25
+ exports.default = _default;