@atlaskit/tokens 13.1.0 → 13.2.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 (349) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/codemods/css-to-design-tokens/lib/colors.tsx +3 -8
  3. package/codemods/css-to-design-tokens/lib/declaration.tsx +3 -13
  4. package/codemods/css-to-design-tokens/lib/extract-between-parentheses.tsx +4 -0
  5. package/codemods/css-to-design-tokens/lib/extract-less-var-name.tsx +3 -0
  6. package/codemods/css-to-design-tokens/lib/get-css-var-meta.tsx +13 -0
  7. package/codemods/css-to-design-tokens/lib/get-named-color-meta.tsx +5 -0
  8. package/codemods/css-to-design-tokens/lib/get-raw-color-meta.tsx +11 -0
  9. package/codemods/css-to-design-tokens/lib/is-css-declaration.tsx +3 -0
  10. package/codemods/css-to-design-tokens/lib/is-known-css-variable.tsx +5 -0
  11. package/codemods/css-to-design-tokens/lib/known-named-colors.tsx +150 -0
  12. package/codemods/css-to-design-tokens/lib/known-raw-colors.tsx +17 -0
  13. package/codemods/css-to-design-tokens/lib/known-variables.tsx +167 -0
  14. package/codemods/css-to-design-tokens/lib/legacy-colors.tsx +3 -336
  15. package/codemods/css-to-design-tokens/lib/meta.tsx +3 -28
  16. package/codemods/css-to-design-tokens/lib/split-css-value.tsx +4 -0
  17. package/codemods/css-to-design-tokens/lib/value.tsx +6 -9
  18. package/codemods/css-to-design-tokens/transform.tsx +3 -1
  19. package/dist/cjs/artifacts/generated-pairs.js +2 -2
  20. package/dist/cjs/artifacts/palettes-raw/palette.js +35 -1
  21. package/dist/cjs/artifacts/themes/atlassian-dark-increased-contrast.js +2 -2
  22. package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
  23. package/dist/cjs/artifacts/themes/atlassian-light-increased-contrast.js +2 -2
  24. package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
  25. package/dist/cjs/artifacts/token-default-values.js +21 -1
  26. package/dist/cjs/artifacts/token-names.js +21 -1
  27. package/dist/cjs/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +471 -31
  28. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +471 -31
  29. package/dist/cjs/artifacts/tokens-raw/atlassian-light-increased-contrast.js +471 -31
  30. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +471 -31
  31. package/dist/cjs/entry-points/theme-state-transformer.js +4 -3
  32. package/dist/cjs/entry-points/token-metadata.codegen.js +196 -16
  33. package/dist/cjs/get-custom-theme-styles.js +7 -6
  34. package/dist/cjs/get-global-theme.js +2 -2
  35. package/dist/cjs/get-theme-html-attrs.js +2 -2
  36. package/dist/cjs/index.js +4 -3
  37. package/dist/cjs/is-color-mode.js +9 -0
  38. package/dist/cjs/is-theme-ids.js +12 -0
  39. package/dist/cjs/is-theme-kind.js +12 -0
  40. package/dist/cjs/theme-config.js +8 -44
  41. package/dist/cjs/theme-object-to-string.js +42 -0
  42. package/dist/cjs/theme-options-schema.js +1 -0
  43. package/dist/cjs/theme-state-defaults.js +39 -0
  44. package/dist/cjs/theme-state.js +5 -0
  45. package/dist/cjs/theme-string-to-object.js +51 -0
  46. package/dist/cjs/utils/additional-contrast-checker.js +43 -0
  47. package/dist/cjs/utils/custom-theme-loading-utils.js +0 -22
  48. package/dist/cjs/utils/custom-theme-token-contrast-check.js +2 -40
  49. package/dist/cjs/utils/delta-e.js +26 -0
  50. package/dist/cjs/utils/generate-colors.js +47 -0
  51. package/dist/cjs/utils/generate-token-map-with-contrast-check.js +32 -0
  52. package/dist/cjs/utils/{generate-custom-color-ramp.js → generate-token-map.js} +6 -75
  53. package/dist/cjs/utils/get-closest-color-index.js +3 -2
  54. package/dist/cjs/utils/get-contrast-ratio.js +22 -0
  55. package/dist/cjs/utils/hct-color-utils/alpha-from-argb.js +12 -0
  56. package/dist/cjs/utils/hct-color-utils/argb-from-linrgb.js +17 -0
  57. package/dist/cjs/utils/hct-color-utils/argb-from-lstar.js +21 -0
  58. package/dist/cjs/utils/hct-color-utils/argb-from-rgba.js +24 -0
  59. package/dist/cjs/utils/hct-color-utils/argb-from-xyz.js +29 -0
  60. package/dist/cjs/utils/hct-color-utils/blue-from-argb.js +12 -0
  61. package/dist/cjs/utils/hct-color-utils/clamp-component.js +15 -0
  62. package/dist/cjs/utils/hct-color-utils/contrast.js +10 -11
  63. package/dist/cjs/utils/hct-color-utils/green-from-argb.js +12 -0
  64. package/dist/cjs/utils/hct-color-utils/hct.js +18 -12
  65. package/dist/cjs/utils/hct-color-utils/index.js +4 -3
  66. package/dist/cjs/utils/hct-color-utils/lab-f.js +15 -0
  67. package/dist/cjs/utils/hct-color-utils/lab-invf.js +16 -0
  68. package/dist/cjs/utils/hct-color-utils/lstar-from-argb.js +34 -0
  69. package/dist/cjs/utils/hct-color-utils/lstar-from-y.js +21 -0
  70. package/dist/cjs/utils/hct-color-utils/red-from-argb.js +12 -0
  71. package/dist/cjs/utils/hct-color-utils/rgba-from-argb.js +28 -0
  72. package/dist/cjs/utils/hct-color-utils/rgba.js +1 -0
  73. package/dist/cjs/utils/hct-color-utils/viewing-conditions.js +5 -4
  74. package/dist/cjs/utils/hct-color-utils/white-point-d65.js +14 -0
  75. package/dist/cjs/utils/hct-color-utils/y-from-lstar.js +21 -0
  76. package/dist/cjs/utils/hex-to-hsl.js +52 -0
  77. package/dist/cjs/utils/hex-to-rgb-a.js +20 -0
  78. package/dist/cjs/utils/hex-to-rgb.js +19 -0
  79. package/dist/cjs/utils/is-valid-hex.js +10 -0
  80. package/dist/cjs/utils/reduce-token-map.js +18 -0
  81. package/dist/cjs/utils/rgb-to-lab.js +24 -0
  82. package/dist/es2019/artifacts/generated-pairs.js +2 -2
  83. package/dist/es2019/artifacts/palettes-raw/palette.js +35 -1
  84. package/dist/es2019/artifacts/themes/atlassian-dark-increased-contrast.js +21 -1
  85. package/dist/es2019/artifacts/themes/atlassian-dark.js +21 -1
  86. package/dist/es2019/artifacts/themes/atlassian-light-increased-contrast.js +21 -1
  87. package/dist/es2019/artifacts/themes/atlassian-light.js +21 -1
  88. package/dist/es2019/artifacts/token-default-values.js +21 -1
  89. package/dist/es2019/artifacts/token-names.js +21 -1
  90. package/dist/es2019/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +471 -31
  91. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +471 -31
  92. package/dist/es2019/artifacts/tokens-raw/atlassian-light-increased-contrast.js +471 -31
  93. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +471 -31
  94. package/dist/es2019/entry-points/theme-state-transformer.js +2 -1
  95. package/dist/es2019/entry-points/token-metadata.codegen.js +196 -16
  96. package/dist/es2019/get-custom-theme-styles.js +3 -2
  97. package/dist/es2019/get-global-theme.js +1 -1
  98. package/dist/es2019/get-theme-html-attrs.js +1 -1
  99. package/dist/es2019/index.js +2 -1
  100. package/dist/es2019/is-color-mode.js +3 -0
  101. package/dist/es2019/is-theme-ids.js +4 -0
  102. package/dist/es2019/is-theme-kind.js +4 -0
  103. package/dist/es2019/theme-config.js +4 -45
  104. package/dist/es2019/theme-object-to-string.js +28 -0
  105. package/dist/es2019/theme-options-schema.js +0 -0
  106. package/dist/es2019/theme-state-defaults.js +34 -0
  107. package/dist/es2019/theme-state.js +1 -0
  108. package/dist/es2019/theme-string-to-object.js +38 -0
  109. package/dist/es2019/utils/additional-contrast-checker.js +39 -0
  110. package/dist/es2019/utils/custom-theme-loading-utils.js +1 -11
  111. package/dist/es2019/utils/custom-theme-token-contrast-check.js +1 -41
  112. package/dist/es2019/utils/delta-e.js +20 -0
  113. package/dist/es2019/utils/generate-colors.js +39 -0
  114. package/dist/es2019/utils/generate-token-map-with-contrast-check.js +21 -0
  115. package/dist/es2019/utils/{generate-custom-color-ramp.js → generate-token-map.js} +3 -63
  116. package/dist/es2019/utils/get-closest-color-index.js +2 -1
  117. package/dist/es2019/utils/get-contrast-ratio.js +16 -0
  118. package/dist/es2019/utils/hct-color-utils/alpha-from-argb.js +6 -0
  119. package/dist/es2019/utils/hct-color-utils/argb-from-linrgb.js +12 -0
  120. package/dist/es2019/utils/hct-color-utils/argb-from-lstar.js +16 -0
  121. package/dist/es2019/utils/hct-color-utils/argb-from-rgba.js +19 -0
  122. package/dist/es2019/utils/hct-color-utils/argb-from-xyz.js +24 -0
  123. package/dist/es2019/utils/hct-color-utils/blue-from-argb.js +6 -0
  124. package/dist/es2019/utils/hct-color-utils/clamp-component.js +9 -0
  125. package/dist/es2019/utils/hct-color-utils/contrast.js +10 -10
  126. package/dist/es2019/utils/hct-color-utils/green-from-argb.js +6 -0
  127. package/dist/es2019/utils/hct-color-utils/hct.js +19 -12
  128. package/dist/es2019/utils/hct-color-utils/index.js +2 -1
  129. package/dist/es2019/utils/hct-color-utils/lab-f.js +9 -0
  130. package/dist/es2019/utils/hct-color-utils/lab-invf.js +10 -0
  131. package/dist/es2019/utils/hct-color-utils/lstar-from-argb.js +28 -0
  132. package/dist/es2019/utils/hct-color-utils/lstar-from-y.js +16 -0
  133. package/dist/es2019/utils/hct-color-utils/red-from-argb.js +6 -0
  134. package/dist/es2019/utils/hct-color-utils/rgba-from-argb.js +22 -0
  135. package/dist/es2019/utils/hct-color-utils/rgba.js +0 -0
  136. package/dist/es2019/utils/hct-color-utils/viewing-conditions.js +4 -3
  137. package/dist/es2019/utils/hct-color-utils/white-point-d65.js +8 -0
  138. package/dist/es2019/utils/hct-color-utils/y-from-lstar.js +16 -0
  139. package/dist/es2019/utils/hex-to-hsl.js +46 -0
  140. package/dist/es2019/utils/hex-to-rgb-a.js +14 -0
  141. package/dist/es2019/utils/hex-to-rgb.js +13 -0
  142. package/dist/es2019/utils/is-valid-hex.js +2 -0
  143. package/dist/es2019/utils/reduce-token-map.js +7 -0
  144. package/dist/es2019/utils/rgb-to-lab.js +18 -0
  145. package/dist/esm/artifacts/generated-pairs.js +2 -2
  146. package/dist/esm/artifacts/palettes-raw/palette.js +35 -1
  147. package/dist/esm/artifacts/themes/atlassian-dark-increased-contrast.js +2 -2
  148. package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
  149. package/dist/esm/artifacts/themes/atlassian-light-increased-contrast.js +2 -2
  150. package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
  151. package/dist/esm/artifacts/token-default-values.js +21 -1
  152. package/dist/esm/artifacts/token-names.js +21 -1
  153. package/dist/esm/artifacts/tokens-raw/atlassian-dark-increased-contrast.js +471 -31
  154. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +471 -31
  155. package/dist/esm/artifacts/tokens-raw/atlassian-light-increased-contrast.js +471 -31
  156. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +471 -31
  157. package/dist/esm/entry-points/theme-state-transformer.js +2 -1
  158. package/dist/esm/entry-points/token-metadata.codegen.js +196 -16
  159. package/dist/esm/get-custom-theme-styles.js +3 -2
  160. package/dist/esm/get-global-theme.js +1 -1
  161. package/dist/esm/get-theme-html-attrs.js +1 -1
  162. package/dist/esm/index.js +2 -1
  163. package/dist/esm/is-color-mode.js +3 -0
  164. package/dist/esm/is-theme-ids.js +6 -0
  165. package/dist/esm/is-theme-kind.js +6 -0
  166. package/dist/esm/theme-config.js +4 -45
  167. package/dist/esm/theme-object-to-string.js +35 -0
  168. package/dist/esm/theme-options-schema.js +0 -0
  169. package/dist/esm/theme-state-defaults.js +34 -0
  170. package/dist/esm/theme-state.js +1 -0
  171. package/dist/esm/theme-string-to-object.js +44 -0
  172. package/dist/esm/utils/additional-contrast-checker.js +36 -0
  173. package/dist/esm/utils/custom-theme-loading-utils.js +1 -15
  174. package/dist/esm/utils/custom-theme-token-contrast-check.js +1 -38
  175. package/dist/esm/utils/delta-e.js +20 -0
  176. package/dist/esm/utils/generate-colors.js +40 -0
  177. package/dist/esm/utils/generate-token-map-with-contrast-check.js +25 -0
  178. package/dist/esm/utils/{generate-custom-color-ramp.js → generate-token-map.js} +3 -67
  179. package/dist/esm/utils/get-closest-color-index.js +2 -1
  180. package/dist/esm/utils/get-contrast-ratio.js +16 -0
  181. package/dist/esm/utils/hct-color-utils/alpha-from-argb.js +6 -0
  182. package/dist/esm/utils/hct-color-utils/argb-from-linrgb.js +12 -0
  183. package/dist/esm/utils/hct-color-utils/argb-from-lstar.js +16 -0
  184. package/dist/esm/utils/hct-color-utils/argb-from-rgba.js +18 -0
  185. package/dist/esm/utils/hct-color-utils/argb-from-xyz.js +24 -0
  186. package/dist/esm/utils/hct-color-utils/blue-from-argb.js +6 -0
  187. package/dist/esm/utils/hct-color-utils/clamp-component.js +9 -0
  188. package/dist/esm/utils/hct-color-utils/contrast.js +10 -10
  189. package/dist/esm/utils/hct-color-utils/green-from-argb.js +6 -0
  190. package/dist/esm/utils/hct-color-utils/hct.js +19 -12
  191. package/dist/esm/utils/hct-color-utils/index.js +2 -1
  192. package/dist/esm/utils/hct-color-utils/lab-f.js +9 -0
  193. package/dist/esm/utils/hct-color-utils/lab-invf.js +10 -0
  194. package/dist/esm/utils/hct-color-utils/lstar-from-argb.js +28 -0
  195. package/dist/esm/utils/hct-color-utils/lstar-from-y.js +16 -0
  196. package/dist/esm/utils/hct-color-utils/red-from-argb.js +6 -0
  197. package/dist/esm/utils/hct-color-utils/rgba-from-argb.js +22 -0
  198. package/dist/esm/utils/hct-color-utils/rgba.js +0 -0
  199. package/dist/esm/utils/hct-color-utils/viewing-conditions.js +5 -4
  200. package/dist/esm/utils/hct-color-utils/white-point-d65.js +8 -0
  201. package/dist/esm/utils/hct-color-utils/y-from-lstar.js +16 -0
  202. package/dist/esm/utils/hex-to-hsl.js +46 -0
  203. package/dist/esm/utils/hex-to-rgb-a.js +14 -0
  204. package/dist/esm/utils/hex-to-rgb.js +13 -0
  205. package/dist/esm/utils/is-valid-hex.js +4 -0
  206. package/dist/esm/utils/reduce-token-map.js +11 -0
  207. package/dist/esm/utils/rgb-to-lab.js +18 -0
  208. package/dist/types/artifacts/generated-pairs.d.ts +1 -1
  209. package/dist/types/artifacts/palettes-raw/palette.d.ts +1 -1
  210. package/dist/types/artifacts/themes/atlassian-dark-increased-contrast.d.ts +2 -2
  211. package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
  212. package/dist/types/artifacts/themes/atlassian-light-increased-contrast.d.ts +2 -2
  213. package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
  214. package/dist/types/artifacts/token-default-values.d.ts +21 -1
  215. package/dist/types/artifacts/token-names.d.ts +41 -1
  216. package/dist/types/artifacts/tokens-raw/atlassian-dark-increased-contrast.d.ts +1 -1
  217. package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  218. package/dist/types/artifacts/tokens-raw/atlassian-light-increased-contrast.d.ts +1 -1
  219. package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  220. package/dist/types/artifacts/types-internal.d.ts +2 -2
  221. package/dist/types/artifacts/types.d.ts +2 -2
  222. package/dist/types/entry-points/css-type-schema.codegen.d.ts +3 -3
  223. package/dist/types/entry-points/theme-state-transformer.d.ts +2 -1
  224. package/dist/types/entry-points/token-metadata.codegen.d.ts +1 -1
  225. package/dist/types/index.d.ts +2 -1
  226. package/dist/types/is-color-mode.d.ts +2 -0
  227. package/dist/types/is-theme-ids.d.ts +2 -0
  228. package/dist/types/is-theme-kind.d.ts +4 -0
  229. package/dist/types/theme-color-modes.d.ts +1 -0
  230. package/dist/types/theme-config.d.ts +8 -40
  231. package/dist/types/theme-ids.d.ts +1 -0
  232. package/dist/types/theme-object-to-string.d.ts +13 -0
  233. package/dist/types/theme-options-schema.d.ts +7 -0
  234. package/dist/types/theme-state-defaults.d.ts +14 -0
  235. package/dist/types/theme-state.d.ts +17 -0
  236. package/dist/types/{theme-state-transformer.d.ts → theme-string-to-object.d.ts} +0 -12
  237. package/dist/types/types.d.ts +75 -15
  238. package/dist/types/utils/additional-contrast-checker.d.ts +9 -0
  239. package/dist/types/utils/custom-theme-loading-utils.d.ts +1 -6
  240. package/dist/types/utils/custom-theme-token-contrast-check.d.ts +0 -9
  241. package/dist/types/utils/delta-e.d.ts +1 -0
  242. package/dist/types/utils/generate-colors.d.ts +5 -0
  243. package/dist/types/utils/{generate-custom-color-ramp.d.ts → generate-token-map-with-contrast-check.d.ts} +1 -6
  244. package/dist/types/utils/generate-token-map.d.ts +9 -0
  245. package/dist/types/utils/get-contrast-ratio.d.ts +1 -0
  246. package/dist/types/utils/hct-color-utils/alpha-from-argb.d.ts +4 -0
  247. package/dist/types/utils/hct-color-utils/argb-from-linrgb.d.ts +4 -0
  248. package/dist/types/utils/hct-color-utils/argb-from-lstar.d.ts +8 -0
  249. package/dist/types/utils/hct-color-utils/argb-from-rgba.d.ts +8 -0
  250. package/dist/types/utils/hct-color-utils/argb-from-xyz.d.ts +4 -0
  251. package/dist/types/utils/hct-color-utils/blue-from-argb.d.ts +4 -0
  252. package/dist/types/utils/hct-color-utils/clamp-component.d.ts +1 -0
  253. package/dist/types/utils/hct-color-utils/green-from-argb.d.ts +4 -0
  254. package/dist/types/utils/hct-color-utils/index.d.ts +2 -1
  255. package/dist/types/utils/hct-color-utils/lab-f.d.ts +1 -0
  256. package/dist/types/utils/hct-color-utils/lab-invf.d.ts +1 -0
  257. package/dist/types/utils/hct-color-utils/lstar-from-argb.d.ts +7 -0
  258. package/dist/types/utils/hct-color-utils/lstar-from-y.d.ts +12 -0
  259. package/dist/types/utils/hct-color-utils/red-from-argb.d.ts +4 -0
  260. package/dist/types/utils/hct-color-utils/rgba-from-argb.d.ts +8 -0
  261. package/dist/types/utils/hct-color-utils/rgba.d.ts +14 -0
  262. package/dist/types/utils/hct-color-utils/white-point-d65.d.ts +6 -0
  263. package/dist/types/utils/hct-color-utils/y-from-lstar.d.ts +12 -0
  264. package/dist/types/utils/hex-to-hsl.d.ts +1 -0
  265. package/dist/types/utils/hex-to-rgb-a.d.ts +1 -0
  266. package/dist/types/utils/hex-to-rgb.d.ts +1 -0
  267. package/dist/types/utils/is-valid-hex.d.ts +1 -0
  268. package/dist/types/utils/reduce-token-map.d.ts +6 -0
  269. package/dist/types/utils/rgb-to-lab.d.ts +1 -0
  270. package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
  271. package/dist/types-ts4.5/artifacts/palettes-raw/palette.d.ts +1 -1
  272. package/dist/types-ts4.5/artifacts/themes/atlassian-dark-increased-contrast.d.ts +2 -2
  273. package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
  274. package/dist/types-ts4.5/artifacts/themes/atlassian-light-increased-contrast.d.ts +2 -2
  275. package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
  276. package/dist/types-ts4.5/artifacts/token-default-values.d.ts +21 -1
  277. package/dist/types-ts4.5/artifacts/token-names.d.ts +41 -1
  278. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-increased-contrast.d.ts +1 -1
  279. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
  280. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-increased-contrast.d.ts +1 -1
  281. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
  282. package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
  283. package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
  284. package/dist/types-ts4.5/entry-points/css-type-schema.codegen.d.ts +3 -3
  285. package/dist/types-ts4.5/entry-points/theme-state-transformer.d.ts +2 -1
  286. package/dist/types-ts4.5/entry-points/token-metadata.codegen.d.ts +1 -1
  287. package/dist/types-ts4.5/index.d.ts +2 -1
  288. package/dist/types-ts4.5/is-color-mode.d.ts +2 -0
  289. package/dist/types-ts4.5/is-theme-ids.d.ts +2 -0
  290. package/dist/types-ts4.5/is-theme-kind.d.ts +11 -0
  291. package/dist/types-ts4.5/theme-color-modes.d.ts +1 -0
  292. package/dist/types-ts4.5/theme-config.d.ts +8 -40
  293. package/dist/types-ts4.5/theme-ids.d.ts +1 -0
  294. package/dist/types-ts4.5/theme-object-to-string.d.ts +13 -0
  295. package/dist/types-ts4.5/theme-options-schema.d.ts +7 -0
  296. package/dist/types-ts4.5/theme-state-defaults.d.ts +14 -0
  297. package/dist/types-ts4.5/theme-state.d.ts +17 -0
  298. package/dist/types-ts4.5/{theme-state-transformer.d.ts → theme-string-to-object.d.ts} +0 -12
  299. package/dist/types-ts4.5/types.d.ts +75 -15
  300. package/dist/types-ts4.5/utils/additional-contrast-checker.d.ts +9 -0
  301. package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +1 -6
  302. package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +0 -9
  303. package/dist/types-ts4.5/utils/delta-e.d.ts +1 -0
  304. package/dist/types-ts4.5/utils/generate-colors.d.ts +5 -0
  305. package/dist/types-ts4.5/utils/{generate-custom-color-ramp.d.ts → generate-token-map-with-contrast-check.d.ts} +1 -8
  306. package/dist/types-ts4.5/utils/generate-token-map.d.ts +11 -0
  307. package/dist/types-ts4.5/utils/get-contrast-ratio.d.ts +1 -0
  308. package/dist/types-ts4.5/utils/hct-color-utils/alpha-from-argb.d.ts +4 -0
  309. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-linrgb.d.ts +4 -0
  310. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-lstar.d.ts +8 -0
  311. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-rgba.d.ts +8 -0
  312. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-xyz.d.ts +4 -0
  313. package/dist/types-ts4.5/utils/hct-color-utils/blue-from-argb.d.ts +4 -0
  314. package/dist/types-ts4.5/utils/hct-color-utils/clamp-component.d.ts +1 -0
  315. package/dist/types-ts4.5/utils/hct-color-utils/green-from-argb.d.ts +4 -0
  316. package/dist/types-ts4.5/utils/hct-color-utils/index.d.ts +2 -1
  317. package/dist/types-ts4.5/utils/hct-color-utils/lab-f.d.ts +1 -0
  318. package/dist/types-ts4.5/utils/hct-color-utils/lab-invf.d.ts +1 -0
  319. package/dist/types-ts4.5/utils/hct-color-utils/lstar-from-argb.d.ts +7 -0
  320. package/dist/types-ts4.5/utils/hct-color-utils/lstar-from-y.d.ts +12 -0
  321. package/dist/types-ts4.5/utils/hct-color-utils/red-from-argb.d.ts +4 -0
  322. package/dist/types-ts4.5/utils/hct-color-utils/rgba-from-argb.d.ts +8 -0
  323. package/dist/types-ts4.5/utils/hct-color-utils/rgba.d.ts +14 -0
  324. package/dist/types-ts4.5/utils/hct-color-utils/white-point-d65.d.ts +6 -0
  325. package/dist/types-ts4.5/utils/hct-color-utils/y-from-lstar.d.ts +12 -0
  326. package/dist/types-ts4.5/utils/hex-to-hsl.d.ts +5 -0
  327. package/dist/types-ts4.5/utils/hex-to-rgb-a.d.ts +6 -0
  328. package/dist/types-ts4.5/utils/hex-to-rgb.d.ts +5 -0
  329. package/dist/types-ts4.5/utils/is-valid-hex.d.ts +1 -0
  330. package/dist/types-ts4.5/utils/reduce-token-map.d.ts +6 -0
  331. package/dist/types-ts4.5/utils/rgb-to-lab.d.ts +5 -0
  332. package/figma/atlassian-dark-increased-contrast.json +180 -0
  333. package/figma/atlassian-dark.json +180 -0
  334. package/figma/atlassian-light-increased-contrast.json +180 -0
  335. package/figma/atlassian-light.json +180 -0
  336. package/package.json +7 -7
  337. package/dist/cjs/theme-state-transformer.js +0 -93
  338. package/dist/cjs/utils/color-utils.js +0 -176
  339. package/dist/cjs/utils/hct-color-utils/color-utils.js +0 -279
  340. package/dist/es2019/theme-state-transformer.js +0 -70
  341. package/dist/es2019/utils/color-utils.js +0 -136
  342. package/dist/es2019/utils/hct-color-utils/color-utils.js +0 -249
  343. package/dist/esm/theme-state-transformer.js +0 -86
  344. package/dist/esm/utils/color-utils.js +0 -138
  345. package/dist/esm/utils/hct-color-utils/color-utils.js +0 -248
  346. package/dist/types/utils/color-utils.d.ts +0 -10
  347. package/dist/types/utils/hct-color-utils/color-utils.d.ts +0 -88
  348. package/dist/types-ts4.5/utils/color-utils.d.ts +0 -23
  349. package/dist/types-ts4.5/utils/hct-color-utils/color-utils.d.ts +0 -88
@@ -9,7 +9,7 @@ exports.tokens = void 0;
9
9
  *
10
10
  * Metadata for generation of `@atlaskit/ads-mcp` and https://atlassian.design/llms-tokens.txt.
11
11
  *
12
- * @codegen <<SignedSource::ecdf4f84ae7b36849943b200af52ee54>>
12
+ * @codegen <<SignedSource::620de1bdd9882e214dcc9ae141009ae7>>
13
13
  * @codegenCommand yarn build tokens
14
14
  */
15
15
 
@@ -1041,94 +1041,184 @@ var tokens = exports.tokens = [{
1041
1041
  }
1042
1042
  }, {
1043
1043
  name: 'color.border.accent.lime',
1044
- path: ['color', 'border', 'accent', 'lime'],
1044
+ path: ['color', 'border', 'accent', 'lime', '[default]'],
1045
1045
  description: 'Use for lime borders on non-bold backgrounds when there is no meaning tied to the color.',
1046
1046
  exampleValue: '#6A9A23',
1047
1047
  usageGuidelines: {
1048
1048
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1049
1049
  cssProperties: ['border-color', 'outline-color']
1050
1050
  }
1051
+ }, {
1052
+ name: 'color.border.accent.lime.subtle',
1053
+ path: ['color', 'border', 'accent', 'lime', 'subtle'],
1054
+ description: 'Use for decorative lime borders that do not need to meet 3:1 contrast requirements.',
1055
+ exampleValue: '#B3DF72',
1056
+ usageGuidelines: {
1057
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1058
+ cssProperties: ['border-color', 'outline-color']
1059
+ }
1051
1060
  }, {
1052
1061
  name: 'color.border.accent.red',
1053
- path: ['color', 'border', 'accent', 'red'],
1062
+ path: ['color', 'border', 'accent', 'red', '[default]'],
1054
1063
  description: 'Use for red borders on non-bold backgrounds when there is no meaning tied to the color.',
1055
1064
  exampleValue: '#E2483D',
1056
1065
  usageGuidelines: {
1057
1066
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1058
1067
  cssProperties: ['border-color', 'outline-color']
1059
1068
  }
1069
+ }, {
1070
+ name: 'color.border.accent.red.subtle',
1071
+ path: ['color', 'border', 'accent', 'red', 'subtle'],
1072
+ description: 'Use for decorative red borders that do not need to meet 3:1 contrast requirements.',
1073
+ exampleValue: '#FD9891',
1074
+ usageGuidelines: {
1075
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1076
+ cssProperties: ['border-color', 'outline-color']
1077
+ }
1060
1078
  }, {
1061
1079
  name: 'color.border.accent.orange',
1062
- path: ['color', 'border', 'accent', 'orange'],
1080
+ path: ['color', 'border', 'accent', 'orange', '[default]'],
1063
1081
  description: 'Use for orange borders on non-bold backgrounds when there is no meaning tied to the color.',
1064
1082
  exampleValue: '#E06C00',
1065
1083
  usageGuidelines: {
1066
1084
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1067
1085
  cssProperties: ['border-color', 'outline-color']
1068
1086
  }
1087
+ }, {
1088
+ name: 'color.border.accent.orange.subtle',
1089
+ path: ['color', 'border', 'accent', 'orange', 'subtle'],
1090
+ description: 'Use for decorative orange borders that do not need to meet 3:1 contrast requirements.',
1091
+ exampleValue: '#FBC828',
1092
+ usageGuidelines: {
1093
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1094
+ cssProperties: ['border-color', 'outline-color']
1095
+ }
1069
1096
  }, {
1070
1097
  name: 'color.border.accent.yellow',
1071
- path: ['color', 'border', 'accent', 'yellow'],
1098
+ path: ['color', 'border', 'accent', 'yellow', '[default]'],
1072
1099
  description: 'Use for yellow borders on non-bold backgrounds when there is no meaning tied to the color.',
1073
1100
  exampleValue: '#B38600',
1074
1101
  usageGuidelines: {
1075
1102
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1076
1103
  cssProperties: ['border-color', 'outline-color']
1077
1104
  }
1105
+ }, {
1106
+ name: 'color.border.accent.yellow.subtle',
1107
+ path: ['color', 'border', 'accent', 'yellow', 'subtle'],
1108
+ description: 'Use for decorative yellow borders that do not need to meet 3:1 contrast requirements.',
1109
+ exampleValue: '#EED12B',
1110
+ usageGuidelines: {
1111
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1112
+ cssProperties: ['border-color', 'outline-color']
1113
+ }
1078
1114
  }, {
1079
1115
  name: 'color.border.accent.green',
1080
- path: ['color', 'border', 'accent', 'green'],
1116
+ path: ['color', 'border', 'accent', 'green', '[default]'],
1081
1117
  description: 'Use for green borders on non-bold backgrounds when there is no meaning tied to the color.',
1082
1118
  exampleValue: '#22A06B',
1083
1119
  usageGuidelines: {
1084
1120
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1085
1121
  cssProperties: ['border-color', 'outline-color']
1086
1122
  }
1123
+ }, {
1124
+ name: 'color.border.accent.green.subtle',
1125
+ path: ['color', 'border', 'accent', 'green', 'subtle'],
1126
+ description: 'Use for decorative green borders that do not need to meet 3:1 contrast requirements.',
1127
+ exampleValue: '#7EE2B8',
1128
+ usageGuidelines: {
1129
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1130
+ cssProperties: ['border-color', 'outline-color']
1131
+ }
1087
1132
  }, {
1088
1133
  name: 'color.border.accent.teal',
1089
- path: ['color', 'border', 'accent', 'teal'],
1134
+ path: ['color', 'border', 'accent', 'teal', '[default]'],
1090
1135
  description: 'Use for teal borders on non-bold backgrounds when there is no meaning tied to the color.',
1091
1136
  exampleValue: '#2898BD',
1092
1137
  usageGuidelines: {
1093
1138
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1094
1139
  cssProperties: ['border-color', 'outline-color']
1095
1140
  }
1141
+ }, {
1142
+ name: 'color.border.accent.teal.subtle',
1143
+ path: ['color', 'border', 'accent', 'teal', 'subtle'],
1144
+ description: 'Use for decorative teal borders that do not need to meet 3:1 contrast requirements.',
1145
+ exampleValue: '#9DD9EE',
1146
+ usageGuidelines: {
1147
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1148
+ cssProperties: ['border-color', 'outline-color']
1149
+ }
1096
1150
  }, {
1097
1151
  name: 'color.border.accent.blue',
1098
- path: ['color', 'border', 'accent', 'blue'],
1152
+ path: ['color', 'border', 'accent', 'blue', '[default]'],
1099
1153
  description: 'Use for blue borders on non-bold backgrounds when there is no meaning tied to the color.',
1100
1154
  exampleValue: '#357DE8',
1101
1155
  usageGuidelines: {
1102
1156
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1103
1157
  cssProperties: ['border-color', 'outline-color']
1104
1158
  }
1159
+ }, {
1160
+ name: 'color.border.accent.blue.subtle',
1161
+ path: ['color', 'border', 'accent', 'blue', 'subtle'],
1162
+ description: 'Use for decorative blue borders that do not need to meet 3:1 contrast requirements.',
1163
+ exampleValue: '#8FB8F6',
1164
+ usageGuidelines: {
1165
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1166
+ cssProperties: ['border-color', 'outline-color']
1167
+ }
1105
1168
  }, {
1106
1169
  name: 'color.border.accent.purple',
1107
- path: ['color', 'border', 'accent', 'purple'],
1170
+ path: ['color', 'border', 'accent', 'purple', '[default]'],
1108
1171
  description: 'Use for purple borders on non-bold backgrounds when there is no meaning tied to the color.',
1109
1172
  exampleValue: '#AF59E1',
1110
1173
  usageGuidelines: {
1111
1174
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1112
1175
  cssProperties: ['border-color', 'outline-color']
1113
1176
  }
1177
+ }, {
1178
+ name: 'color.border.accent.purple.subtle',
1179
+ path: ['color', 'border', 'accent', 'purple', 'subtle'],
1180
+ description: 'Use for decorative purple borders that do not need to meet 3:1 contrast requirements.',
1181
+ exampleValue: '#D8A0F7',
1182
+ usageGuidelines: {
1183
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1184
+ cssProperties: ['border-color', 'outline-color']
1185
+ }
1114
1186
  }, {
1115
1187
  name: 'color.border.accent.magenta',
1116
- path: ['color', 'border', 'accent', 'magenta'],
1188
+ path: ['color', 'border', 'accent', 'magenta', '[default]'],
1117
1189
  description: 'Use for magenta borders on non-bold backgrounds when there is no meaning tied to the color.',
1118
1190
  exampleValue: '#CD519D',
1119
1191
  usageGuidelines: {
1120
1192
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1121
1193
  cssProperties: ['border-color', 'outline-color']
1122
1194
  }
1195
+ }, {
1196
+ name: 'color.border.accent.magenta.subtle',
1197
+ path: ['color', 'border', 'accent', 'magenta', 'subtle'],
1198
+ description: 'Use for decorative magenta borders that do not need to meet 3:1 contrast requirements.',
1199
+ exampleValue: '#F797D2',
1200
+ usageGuidelines: {
1201
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1202
+ cssProperties: ['border-color', 'outline-color']
1203
+ }
1123
1204
  }, {
1124
1205
  name: 'color.border.accent.gray',
1125
- path: ['color', 'border', 'accent', 'gray'],
1206
+ path: ['color', 'border', 'accent', 'gray', '[default]'],
1126
1207
  description: 'Use for borders on non-bold gray accent backgrounds.',
1127
1208
  exampleValue: '#7D818A',
1128
1209
  usageGuidelines: {
1129
1210
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1130
1211
  cssProperties: ['border-color', 'outline-color']
1131
1212
  }
1213
+ }, {
1214
+ name: 'color.border.accent.gray.subtle',
1215
+ path: ['color', 'border', 'accent', 'gray', 'subtle'],
1216
+ description: 'Use for decorative gray borders that do not need to meet 3:1 contrast requirements.',
1217
+ exampleValue: '#DDDEE1',
1218
+ usageGuidelines: {
1219
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1220
+ cssProperties: ['border-color', 'outline-color']
1221
+ }
1132
1222
  }, {
1133
1223
  name: 'color.border.disabled',
1134
1224
  path: ['color', 'border', 'disabled'],
@@ -1185,49 +1275,94 @@ var tokens = exports.tokens = [{
1185
1275
  }
1186
1276
  }, {
1187
1277
  name: 'color.border.danger',
1188
- path: ['color', 'border', 'danger'],
1278
+ path: ['color', 'border', 'danger', '[default]'],
1189
1279
  description: 'Use for borders communicating critical information, such as the borders on invalid text fields.',
1190
1280
  exampleValue: '#E2483D',
1191
1281
  usageGuidelines: {
1192
1282
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1193
1283
  cssProperties: ['border-color', 'outline-color']
1194
1284
  }
1285
+ }, {
1286
+ name: 'color.border.danger.subtle',
1287
+ path: ['color', 'border', 'danger', 'subtle'],
1288
+ description: 'Use for decorative danger borders that do not need to meet 3:1 contrast requirements.',
1289
+ exampleValue: '#FD9891',
1290
+ usageGuidelines: {
1291
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1292
+ cssProperties: ['border-color', 'outline-color']
1293
+ }
1195
1294
  }, {
1196
1295
  name: 'color.border.warning',
1197
- path: ['color', 'border', 'warning'],
1296
+ path: ['color', 'border', 'warning', '[default]'],
1198
1297
  description: 'Use for borders communicating caution.',
1199
1298
  exampleValue: '#E06C00',
1200
1299
  usageGuidelines: {
1201
1300
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1202
1301
  cssProperties: ['border-color', 'outline-color']
1203
1302
  }
1303
+ }, {
1304
+ name: 'color.border.warning.subtle',
1305
+ path: ['color', 'border', 'warning', 'subtle'],
1306
+ description: 'Use for decorative warning borders that do not need to meet 3:1 contrast requirements.',
1307
+ exampleValue: '#FBC828',
1308
+ usageGuidelines: {
1309
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1310
+ cssProperties: ['border-color', 'outline-color']
1311
+ }
1204
1312
  }, {
1205
1313
  name: 'color.border.success',
1206
- path: ['color', 'border', 'success'],
1314
+ path: ['color', 'border', 'success', '[default]'],
1207
1315
  description: 'Use for borders communicating a favorable outcome, such as the borders on validated text fields.',
1208
1316
  exampleValue: '#6A9A23',
1209
1317
  usageGuidelines: {
1210
1318
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1211
1319
  cssProperties: ['border-color', 'outline-color']
1212
1320
  }
1321
+ }, {
1322
+ name: 'color.border.success.subtle',
1323
+ path: ['color', 'border', 'success', 'subtle'],
1324
+ description: 'Use for decorative success borders that do not need to meet 3:1 contrast requirements.',
1325
+ exampleValue: '#B3DF72',
1326
+ usageGuidelines: {
1327
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1328
+ cssProperties: ['border-color', 'outline-color']
1329
+ }
1213
1330
  }, {
1214
1331
  name: 'color.border.discovery',
1215
- path: ['color', 'border', 'discovery'],
1332
+ path: ['color', 'border', 'discovery', '[default]'],
1216
1333
  description: 'Use for borders communicating change or something new, such as the borders in onboarding spotlights.',
1217
1334
  exampleValue: '#AF59E1',
1218
1335
  usageGuidelines: {
1219
1336
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1220
1337
  cssProperties: ['border-color', 'outline-color']
1221
1338
  }
1339
+ }, {
1340
+ name: 'color.border.discovery.subtle',
1341
+ path: ['color', 'border', 'discovery', 'subtle'],
1342
+ description: 'Use for decorative discovery borders that do not need to meet 3:1 contrast requirements.',
1343
+ exampleValue: '#D8A0F7',
1344
+ usageGuidelines: {
1345
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1346
+ cssProperties: ['border-color', 'outline-color']
1347
+ }
1222
1348
  }, {
1223
1349
  name: 'color.border.information',
1224
- path: ['color', 'border', 'information'],
1350
+ path: ['color', 'border', 'information', '[default]'],
1225
1351
  description: 'Use for borders communicating information or something in-progress.',
1226
1352
  exampleValue: '#357DE8',
1227
1353
  usageGuidelines: {
1228
1354
  usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1229
1355
  cssProperties: ['border-color', 'outline-color']
1230
1356
  }
1357
+ }, {
1358
+ name: 'color.border.information.subtle',
1359
+ path: ['color', 'border', 'information', 'subtle'],
1360
+ description: 'Use for decorative information borders that do not need to meet 3:1 contrast requirements.',
1361
+ exampleValue: '#8FB8F6',
1362
+ usageGuidelines: {
1363
+ usage: 'The color for borders or outlines. Use for border and outline colors on components (e.g. color.border, color.border.focused)',
1364
+ cssProperties: ['border-color', 'outline-color']
1365
+ }
1231
1366
  }, {
1232
1367
  name: 'color.border.bold',
1233
1368
  path: ['color', 'border', 'bold'],
@@ -2650,6 +2785,15 @@ var tokens = exports.tokens = [{
2650
2785
  usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2651
2786
  cssProperties: ['background-color']
2652
2787
  }
2788
+ }, {
2789
+ name: 'color.background.danger.subtle',
2790
+ path: ['color', 'background', 'danger', 'subtle', '[default]'],
2791
+ description: 'Background colour for non-interactive elements communicating critical danger information (e.g. semantic badges, status pills, callout chips). Sits between subtler and bold in visual emphasis. Not for interactive surfaces — see color.background.danger.bold or color.background.danger.subtler for interactive states.',
2792
+ exampleValue: '#FD9891',
2793
+ usageGuidelines: {
2794
+ usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2795
+ cssProperties: ['background-color']
2796
+ }
2653
2797
  }, {
2654
2798
  name: 'color.background.danger.bold',
2655
2799
  path: ['color', 'background', 'danger', 'bold', '[default]'],
@@ -2731,6 +2875,15 @@ var tokens = exports.tokens = [{
2731
2875
  usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2732
2876
  cssProperties: ['background-color']
2733
2877
  }
2878
+ }, {
2879
+ name: 'color.background.warning.subtle',
2880
+ path: ['color', 'background', 'warning', 'subtle', '[default]'],
2881
+ description: 'Background colour for non-interactive elements communicating caution (e.g. semantic badges, status pills, callout chips). Sits between subtler and bold in visual emphasis. Not for interactive surfaces — see color.background.warning.bold or color.background.warning.subtler for interactive states.',
2882
+ exampleValue: '#FBD779',
2883
+ usageGuidelines: {
2884
+ usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2885
+ cssProperties: ['background-color']
2886
+ }
2734
2887
  }, {
2735
2888
  name: 'color.background.warning.bold',
2736
2889
  path: ['color', 'background', 'warning', 'bold', '[default]'],
@@ -2812,6 +2965,15 @@ var tokens = exports.tokens = [{
2812
2965
  usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2813
2966
  cssProperties: ['background-color']
2814
2967
  }
2968
+ }, {
2969
+ name: 'color.background.success.subtle',
2970
+ path: ['color', 'background', 'success', 'subtle', '[default]'],
2971
+ description: 'Background colour for non-interactive elements communicating success (e.g. semantic badges, status pills, callout chips). Sits between subtler and bold in visual emphasis. Not for interactive surfaces — see color.background.success.bold or color.background.success.subtler for interactive states.',
2972
+ exampleValue: '#B3DF72',
2973
+ usageGuidelines: {
2974
+ usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2975
+ cssProperties: ['background-color']
2976
+ }
2815
2977
  }, {
2816
2978
  name: 'color.background.success.bold',
2817
2979
  path: ['color', 'background', 'success', 'bold', '[default]'],
@@ -2893,6 +3055,15 @@ var tokens = exports.tokens = [{
2893
3055
  usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2894
3056
  cssProperties: ['background-color']
2895
3057
  }
3058
+ }, {
3059
+ name: 'color.background.discovery.subtle',
3060
+ path: ['color', 'background', 'discovery', 'subtle', '[default]'],
3061
+ description: 'Background colour for non-interactive elements communicating discovery (e.g. semantic badges, status pills, callout chips). Sits between subtler and bold in visual emphasis. Not for interactive surfaces — see color.background.discovery.bold or color.background.discovery.subtler for interactive states.',
3062
+ exampleValue: '#D8A0F7',
3063
+ usageGuidelines: {
3064
+ usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
3065
+ cssProperties: ['background-color']
3066
+ }
2896
3067
  }, {
2897
3068
  name: 'color.background.discovery.bold',
2898
3069
  path: ['color', 'background', 'discovery', 'bold', '[default]'],
@@ -2974,6 +3145,15 @@ var tokens = exports.tokens = [{
2974
3145
  usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
2975
3146
  cssProperties: ['background-color']
2976
3147
  }
3148
+ }, {
3149
+ name: 'color.background.information.subtle',
3150
+ path: ['color', 'background', 'information', 'subtle', '[default]'],
3151
+ description: 'Background colour for non-interactive elements communicating information (e.g. semantic badges, status pills, callout chips). Sits between subtler and bold in visual emphasis. Not for interactive surfaces — see color.background.information.bold or color.background.information.subtler for interactive states.',
3152
+ exampleValue: '#8FB8F6',
3153
+ usageGuidelines: {
3154
+ usage: 'The color for backgrounds. Use for areas behind content (e.g. color.background.neutral, color.background.selected)',
3155
+ cssProperties: ['background-color']
3156
+ }
2977
3157
  }, {
2978
3158
  name: 'color.background.information.bold',
2979
3159
  path: ['color', 'background', 'information', 'bold', '[default]'],
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getCustomThemeStyles = getCustomThemeStyles;
7
7
  var _constants = require("./constants");
8
8
  var _themeConfig = require("./theme-config");
9
- var _customThemeLoadingUtils = require("./utils/custom-theme-loading-utils");
10
- var _generateCustomColorRamp = require("./utils/generate-custom-color-ramp");
9
+ var _generateColors = require("./utils/generate-colors");
10
+ var _generateTokenMapWithContrastCheck = require("./utils/generate-token-map-with-contrast-check");
11
11
  var _hash = require("./utils/hash");
12
+ var _reduceTokenMap = require("./utils/reduce-token-map");
12
13
  /**
13
14
  * Takes a color mode and custom branding options, and returns an array of objects for use in applying custom styles to the document head.
14
15
  * Only supplies the color themes necessary for initial render, based on the current themeState. I.e. if in light mode, dark mode themes are not returned.
@@ -26,11 +27,11 @@ function getCustomThemeStyles(themeState) {
26
27
  var mode = (themeState === null || themeState === void 0 ? void 0 : themeState.colorMode) || _themeConfig.themeStateDefaults['colorMode'];
27
28
  var optionString = JSON.stringify(themeState === null || themeState === void 0 ? void 0 : themeState.UNSAFE_themeOptions);
28
29
  var uniqueId = (0, _hash.hash)(optionString);
29
- var themeRamp = (0, _generateCustomColorRamp.generateColors)(brandColor).ramp;
30
+ var themeRamp = (0, _generateColors.generateColors)(brandColor).ramp;
30
31
 
31
32
  // outputs object to generate to CSS from
32
33
  var themes = [];
33
- var tokenMaps = (0, _generateCustomColorRamp.generateTokenMapWithContrastCheck)(brandColor, mode, themeRamp);
34
+ var tokenMaps = (0, _generateTokenMapWithContrastCheck.generateTokenMapWithContrastCheck)(brandColor, mode, themeRamp);
34
35
  if ((mode === 'light' || mode === 'auto') && tokenMaps.light) {
35
36
  // Light mode theming
36
37
  themes.push({
@@ -39,7 +40,7 @@ function getCustomThemeStyles(themeState) {
39
40
  'data-theme': 'light',
40
41
  'data-custom-theme': uniqueId
41
42
  },
42
- css: "\nhtml[".concat(_constants.CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(_constants.COLOR_MODE_ATTRIBUTE, "=\"light\"][data-theme~=\"light:light\"] {\n /* Branded tokens */\n ").concat((0, _customThemeLoadingUtils.reduceTokenMap)(tokenMaps.light, themeRamp), "\n}")
43
+ css: "\nhtml[".concat(_constants.CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(_constants.COLOR_MODE_ATTRIBUTE, "=\"light\"][data-theme~=\"light:light\"] {\n /* Branded tokens */\n ").concat((0, _reduceTokenMap.reduceTokenMap)(tokenMaps.light, themeRamp), "\n}")
43
44
  });
44
45
  }
45
46
  if ((mode === 'dark' || mode === 'auto') && tokenMaps.dark) {
@@ -50,7 +51,7 @@ function getCustomThemeStyles(themeState) {
50
51
  'data-theme': 'dark',
51
52
  'data-custom-theme': uniqueId
52
53
  },
53
- css: "\nhtml[".concat(_constants.CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(_constants.COLOR_MODE_ATTRIBUTE, "=\"dark\"][data-theme~=\"dark:dark\"] {\n /* Branded tokens */\n ").concat((0, _customThemeLoadingUtils.reduceTokenMap)(tokenMaps.dark, themeRamp), "\n}")
54
+ css: "\nhtml[".concat(_constants.CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(_constants.COLOR_MODE_ATTRIBUTE, "=\"dark\"][data-theme~=\"dark:dark\"] {\n /* Branded tokens */\n ").concat((0, _reduceTokenMap.reduceTokenMap)(tokenMaps.dark, themeRamp), "\n}")
54
55
  });
55
56
  }
56
57
  return themes;
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _constants = require("./constants");
10
10
  var _themeColorModes = require("./theme-color-modes");
11
- var _themeStateTransformer = require("./theme-state-transformer");
11
+ var _themeStringToObject = require("./theme-string-to-object");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var isThemeColorMode = function isThemeColorMode(colorMode) {
@@ -23,7 +23,7 @@ var getGlobalTheme = function getGlobalTheme() {
23
23
  var element = document.documentElement;
24
24
  var colorMode = element.getAttribute(_constants.COLOR_MODE_ATTRIBUTE) || '';
25
25
  var theme = element.getAttribute(_constants.THEME_DATA_ATTRIBUTE) || '';
26
- return _objectSpread(_objectSpread({}, (0, _themeStateTransformer.themeStringToObject)(theme)), isThemeColorMode(colorMode) && {
26
+ return _objectSpread(_objectSpread({}, (0, _themeStringToObject.themeStringToObject)(theme)), isThemeColorMode(colorMode) && {
27
27
  colorMode: colorMode
28
28
  });
29
29
  };
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
10
  var _constants = require("./constants");
11
11
  var _themeConfig = require("./theme-config");
12
- var _themeStateTransformer = require("./theme-state-transformer");
12
+ var _themeObjectToString = require("./theme-object-to-string");
13
13
  var _hash = require("./utils/hash");
14
14
  var _isValidBrandHex = require("./utils/is-valid-brand-hex");
15
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -52,7 +52,7 @@ var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
52
52
  typography = _ref$typography === void 0 ? _themeConfig.themeStateDefaults['typography'] : _ref$typography,
53
53
  _ref$UNSAFE_themeOpti = _ref.UNSAFE_themeOptions,
54
54
  UNSAFE_themeOptions = _ref$UNSAFE_themeOpti === void 0 ? _themeConfig.themeStateDefaults['UNSAFE_themeOptions'] : _ref$UNSAFE_themeOpti;
55
- var themeAttribute = (0, _themeStateTransformer.themeObjectToString)({
55
+ var themeAttribute = (0, _themeObjectToString.themeObjectToString)({
56
56
  dark: dark,
57
57
  light: light,
58
58
  motion: motion,
package/dist/cjs/index.js CHANGED
@@ -91,13 +91,13 @@ Object.defineProperty(exports, "themeImportMap", {
91
91
  Object.defineProperty(exports, "themeObjectToString", {
92
92
  enumerable: true,
93
93
  get: function get() {
94
- return _themeStateTransformer.themeObjectToString;
94
+ return _themeObjectToString.themeObjectToString;
95
95
  }
96
96
  });
97
97
  Object.defineProperty(exports, "themeStringToObject", {
98
98
  enumerable: true,
99
99
  get: function get() {
100
- return _themeStateTransformer.themeStringToObject;
100
+ return _themeStringToObject.themeStringToObject;
101
101
  }
102
102
  });
103
103
  Object.defineProperty(exports, "token", {
@@ -123,6 +123,7 @@ var _getSsrAutoScript = _interopRequireDefault(require("./get-ssr-auto-script"))
123
123
  var _useThemeObserver = _interopRequireDefault(require("./use-theme-observer"));
124
124
  var _themeMutationObserver = _interopRequireDefault(require("./theme-mutation-observer"));
125
125
  var _getGlobalTheme = _interopRequireDefault(require("./get-global-theme"));
126
- var _themeStateTransformer = require("./theme-state-transformer");
126
+ var _themeStringToObject = require("./theme-string-to-object");
127
+ var _themeObjectToString = require("./theme-object-to-string");
127
128
  var _themeImportMap = _interopRequireDefault(require("./artifacts/theme-import-map"));
128
129
  var _constants = require("./constants");
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isColorMode = void 0;
7
+ var isColorMode = exports.isColorMode = function isColorMode(modeId) {
8
+ return ['light', 'dark', 'auto'].includes(modeId);
9
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isThemeIds = void 0;
7
+ var _themeIds = require("./theme-ids");
8
+ var isThemeIds = exports.isThemeIds = function isThemeIds(themeId) {
9
+ return _themeIds.themeIds.find(function (id) {
10
+ return id === themeId;
11
+ }) !== undefined;
12
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isThemeKind = void 0;
7
+ var themeKinds = ['light', 'dark', 'spacing', 'typography', 'shape', 'motion'];
8
+ var isThemeKind = exports.isThemeKind = function isThemeKind(themeKind) {
9
+ return themeKinds.find(function (kind) {
10
+ return kind === themeKind;
11
+ }) !== undefined;
12
+ };
@@ -17,11 +17,17 @@ Object.defineProperty(exports, "themeIds", {
17
17
  return _themeIds.themeIds;
18
18
  }
19
19
  });
20
- exports.themeStateDefaults = exports.themeIdsWithOverrides = void 0;
20
+ exports.themeIdsWithOverrides = void 0;
21
+ Object.defineProperty(exports, "themeStateDefaults", {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _themeStateDefaults.themeStateDefaults;
25
+ }
26
+ });
21
27
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
22
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
28
  var _themeIds = require("./theme-ids");
24
29
  var _themeColorModes = require("./theme-color-modes");
30
+ var _themeStateDefaults = require("./theme-state-defaults");
25
31
  /**
26
32
  * This file contains the source of truth for themes and all associated meta data.
27
33
  */
@@ -168,48 +174,6 @@ var themeConfig = {
168
174
  }
169
175
  };
170
176
 
171
- /**
172
- * ThemeOptionsSchema: additional configuration options used to customize Atlassian's themes
173
- */
174
-
175
- /**
176
- * ThemeState: the standard representation of an app's current theme and preferences
177
- */
178
-
179
- /**
180
- * Can't evaluate typography feature flags at the module level,
181
- * it will always resolve to false when server side rendered or when flags are loaded async.
182
- */
183
-
184
- function getShapeDefault() {
185
- if ((0, _platformFeatureFlags.fg)('platform-dst-shape-theme-default')) {
186
- return 'shape';
187
- }
188
- return undefined;
189
- }
190
- function getMotionDefault() {
191
- if ((0, _platformFeatureFlags.fg)('platform-dst-motion-theme-default')) {
192
- return 'motion';
193
- }
194
- return undefined;
195
- }
196
-
197
- /**
198
- * themeStateDefaults: the default values for ThemeState used by theming utilities
199
- */
200
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
201
- var themeStateDefaults = exports.themeStateDefaults = {
202
- colorMode: 'auto',
203
- contrastMode: 'auto',
204
- dark: 'dark',
205
- light: 'light',
206
- shape: getShapeDefault,
207
- spacing: 'spacing',
208
- typography: 'typography',
209
- motion: getMotionDefault,
210
- UNSAFE_themeOptions: undefined
211
- };
212
-
213
177
  /**
214
178
  * Represents theme state once mounted to the page
215
179
  * (the page doesn't have an "auto" color mode, it's either light or dark)
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.themeObjectToString = void 0;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _isColorMode = require("./is-color-mode");
11
+ var _isThemeIds = require("./is-theme-ids");
12
+ var _isThemeKind = require("./is-theme-kind");
13
+ var customThemeOptions = 'UNSAFE_themeOptions';
14
+
15
+ /**
16
+ * Converts a theme object to a string formatted for the `data-theme` HTML attribute.
17
+ *
18
+ * @param {object} themes The themes that should be applied.
19
+ *
20
+ * @example
21
+ * ```
22
+ * themeObjectToString({ dark: 'dark', light: 'light', spacing: 'spacing' });
23
+ * // returns 'dark:dark light:light spacing:spacing'
24
+ * ```
25
+ */
26
+ var themeObjectToString = exports.themeObjectToString = function themeObjectToString(themeState) {
27
+ return Object.entries(themeState).reduce(function (themeString, _ref) {
28
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
29
+ kind = _ref2[0],
30
+ id = _ref2[1];
31
+ if (
32
+ // colorMode theme state
33
+ kind === 'colorMode' && typeof id === 'string' && (0, _isColorMode.isColorMode)(id) ||
34
+ // custom theme state
35
+ kind === customThemeOptions && (0, _typeof2.default)(id) === 'object' ||
36
+ // other theme states
37
+ (0, _isThemeKind.isThemeKind)(kind) && typeof id === 'string' && (0, _isThemeIds.isThemeIds)(id)) {
38
+ return themeString + "".concat(themeString ? ' ' : '') + "".concat(kind, ":").concat((0, _typeof2.default)(id) === 'object' ? JSON.stringify(id) : id);
39
+ }
40
+ return themeString;
41
+ }, '');
42
+ };
@@ -0,0 +1 @@
1
+ "use strict";