@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/report.api.md CHANGED
@@ -78,6 +78,12 @@ export type ActiveTokens =
78
78
  | 'color.background.brand.bold'
79
79
  | 'color.background.brand.bold.hovered'
80
80
  | 'color.background.brand.bold.pressed'
81
+ | 'color.background.brand.boldest'
82
+ | 'color.background.brand.boldest.hovered'
83
+ | 'color.background.brand.boldest.pressed'
84
+ | 'color.background.brand.subtlest'
85
+ | 'color.background.brand.subtlest.hovered'
86
+ | 'color.background.brand.subtlest.pressed'
81
87
  | 'color.background.danger'
82
88
  | 'color.background.danger.bold'
83
89
  | 'color.background.danger.bold.hovered'
@@ -535,6 +541,9 @@ const baseSpacingTokens: {
535
541
  };
536
542
  };
537
543
 
544
+ // @public (undocumented)
545
+ type CSSColor = HEX;
546
+
538
547
  // @public (undocumented)
539
548
  export type CSSToken = CSSTokenMap[keyof CSSTokenMap];
540
549
 
@@ -682,9 +691,15 @@ type CSSTokenMap = {
682
691
  'color.background.selected.bold': 'var(--ds-background-selected-bold)';
683
692
  'color.background.selected.bold.hovered': 'var(--ds-background-selected-bold-hovered)';
684
693
  'color.background.selected.bold.pressed': 'var(--ds-background-selected-bold-pressed)';
694
+ 'color.background.brand.subtlest': 'var(--ds-background-brand-subtlest)';
695
+ 'color.background.brand.subtlest.hovered': 'var(--ds-background-brand-subtlest-hovered)';
696
+ 'color.background.brand.subtlest.pressed': 'var(--ds-background-brand-subtlest-pressed)';
685
697
  'color.background.brand.bold': 'var(--ds-background-brand-bold)';
686
698
  'color.background.brand.bold.hovered': 'var(--ds-background-brand-bold-hovered)';
687
699
  'color.background.brand.bold.pressed': 'var(--ds-background-brand-bold-pressed)';
700
+ 'color.background.brand.boldest': 'var(--ds-background-brand-boldest)';
701
+ 'color.background.brand.boldest.hovered': 'var(--ds-background-brand-boldest-hovered)';
702
+ 'color.background.brand.boldest.pressed': 'var(--ds-background-brand-boldest-pressed)';
688
703
  'color.background.danger': 'var(--ds-background-danger)';
689
704
  'color.background.danger.hovered': 'var(--ds-background-danger-hovered)';
690
705
  'color.background.danger.pressed': 'var(--ds-background-danger-pressed)';
@@ -887,6 +902,12 @@ type CSSTokenMap = {
887
902
  'font.lineHeight.600': 'var(--ds-font-lineHeight-600)';
888
903
  };
889
904
 
905
+ // @public (undocumented)
906
+ export interface CustomBrandSchema {
907
+ // (undocumented)
908
+ brandColor: CSSColor;
909
+ }
910
+
890
911
  // @public (undocumented)
891
912
  type DataColorModes = Exclude<ThemeColorModes, 'auto'>;
892
913
 
@@ -960,6 +981,7 @@ export const getThemeHtmlAttrs: ({
960
981
  shape,
961
982
  spacing,
962
983
  typography,
984
+ UNSAFE_themeOptions,
963
985
  }?: Partial<ThemeState>) => Record<string, string>;
964
986
 
965
987
  // @public
@@ -988,6 +1010,9 @@ export type Groups =
988
1010
  | 'spacing'
989
1011
  | 'typography';
990
1012
 
1013
+ // @public (undocumented)
1014
+ type HEX = `#${string}`;
1015
+
991
1016
  // @public
992
1017
  type InternalTokenIds =
993
1018
  | 'border.radius.050'
@@ -1043,6 +1068,12 @@ type InternalTokenIds =
1043
1068
  | 'color.background.brand.bold.[default]'
1044
1069
  | 'color.background.brand.bold.hovered'
1045
1070
  | 'color.background.brand.bold.pressed'
1071
+ | 'color.background.brand.boldest.[default]'
1072
+ | 'color.background.brand.boldest.hovered'
1073
+ | 'color.background.brand.boldest.pressed'
1074
+ | 'color.background.brand.subtlest.[default]'
1075
+ | 'color.background.brand.subtlest.hovered'
1076
+ | 'color.background.brand.subtlest.pressed'
1046
1077
  | 'color.background.danger.[default].[default]'
1047
1078
  | 'color.background.danger.[default].hovered'
1048
1079
  | 'color.background.danger.[default].pressed'
@@ -1357,7 +1388,15 @@ type Replacement = InternalTokenIds | InternalTokenIds[];
1357
1388
 
1358
1389
  // @public
1359
1390
  export const setGlobalTheme: (
1360
- { colorMode, dark, light, shape, spacing, typography }?: Partial<ThemeState>,
1391
+ {
1392
+ colorMode,
1393
+ dark,
1394
+ light,
1395
+ shape,
1396
+ spacing,
1397
+ typography,
1398
+ UNSAFE_themeOptions,
1399
+ }?: Partial<ThemeState>,
1361
1400
  themeLoader?:
1362
1401
  | ((id: ThemeIdsWithOverrides) => Promise<void> | void)
1363
1402
  | undefined,
@@ -1511,6 +1550,8 @@ export interface ThemeState {
1511
1550
  spacing?: Extract<ThemeIds, 'spacing'>;
1512
1551
  // (undocumented)
1513
1552
  typography?: Extract<ThemeIds, 'typography'>;
1553
+ // (undocumented)
1554
+ UNSAFE_themeOptions?: CustomBrandSchema;
1514
1555
  }
1515
1556
 
1516
1557
  // @public
@@ -1692,9 +1733,15 @@ const tokens: {
1692
1733
  readonly 'color.background.selected.bold': '--ds-background-selected-bold';
1693
1734
  readonly 'color.background.selected.bold.hovered': '--ds-background-selected-bold-hovered';
1694
1735
  readonly 'color.background.selected.bold.pressed': '--ds-background-selected-bold-pressed';
1736
+ readonly 'color.background.brand.subtlest': '--ds-background-brand-subtlest';
1737
+ readonly 'color.background.brand.subtlest.hovered': '--ds-background-brand-subtlest-hovered';
1738
+ readonly 'color.background.brand.subtlest.pressed': '--ds-background-brand-subtlest-pressed';
1695
1739
  readonly 'color.background.brand.bold': '--ds-background-brand-bold';
1696
1740
  readonly 'color.background.brand.bold.hovered': '--ds-background-brand-bold-hovered';
1697
1741
  readonly 'color.background.brand.bold.pressed': '--ds-background-brand-bold-pressed';
1742
+ readonly 'color.background.brand.boldest': '--ds-background-brand-boldest';
1743
+ readonly 'color.background.brand.boldest.hovered': '--ds-background-brand-boldest-hovered';
1744
+ readonly 'color.background.brand.boldest.pressed': '--ds-background-brand-boldest-pressed';
1698
1745
  readonly 'color.background.danger': '--ds-background-danger';
1699
1746
  readonly 'color.background.danger.hovered': '--ds-background-danger-hovered';
1700
1747
  readonly 'color.background.danger.pressed': '--ds-background-danger-pressed';