@atlaskit/tokens 13.0.2 → 13.0.4

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 (263) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/codemods/css-to-design-tokens/lib/meta.tsx +1 -1
  3. package/codemods/css-to-design-tokens/lib/tokens.tsx +1 -1
  4. package/codemods/theme-to-design-tokens/transform.tsx +16 -14
  5. package/codemods/theme-to-design-tokens/utils/ast-meta.tsx +2 -151
  6. package/codemods/theme-to-design-tokens/utils/ast.tsx +3 -35
  7. package/codemods/theme-to-design-tokens/utils/clean-meta.tsx +63 -0
  8. package/codemods/theme-to-design-tokens/utils/color.tsx +3 -11
  9. package/codemods/theme-to-design-tokens/utils/contains-replaceable-css-declarations.tsx +13 -0
  10. package/codemods/theme-to-design-tokens/utils/css-utils.tsx +2 -35
  11. package/codemods/theme-to-design-tokens/utils/find-end-index-of-css-expression.tsx +21 -0
  12. package/codemods/theme-to-design-tokens/utils/find-first-nonspace-index-after.tsx +9 -0
  13. package/codemods/theme-to-design-tokens/utils/get-closest-decendant-of-type.tsx +10 -0
  14. package/codemods/theme-to-design-tokens/utils/get-meta-from-ancestors.tsx +87 -0
  15. package/codemods/theme-to-design-tokens/utils/is-bold-color.tsx +4 -0
  16. package/codemods/theme-to-design-tokens/utils/is-decendant-of-token.tsx +14 -0
  17. package/codemods/theme-to-design-tokens/utils/is-legacy-color.tsx +4 -0
  18. package/codemods/theme-to-design-tokens/utils/is-legacy-named-color.tsx +4 -0
  19. package/codemods/theme-to-design-tokens/utils/is-parent-of-token.tsx +13 -0
  20. package/codemods/theme-to-design-tokens/utils/kebabize.tsx +2 -0
  21. package/codemods/theme-to-design-tokens/utils/legacy-color-meta-map.tsx +88 -0
  22. package/codemods/theme-to-design-tokens/utils/legacy-color-mixins.tsx +26 -0
  23. package/codemods/theme-to-design-tokens/utils/legacy-colors.tsx +2 -115
  24. package/codemods/theme-to-design-tokens/utils/split-at-index.tsx +3 -0
  25. package/codemods/theme-to-design-tokens/utils/string-utils.tsx +3 -16
  26. package/codemods/utils/active-tokens.tsx +284 -0
  27. package/codemods/utils/tokens.tsx +2 -376
  28. package/codemods/utils/unique-words-from-tokens.tsx +91 -0
  29. package/dist/cjs/artifacts/replacement-mapping.js +5 -2
  30. package/dist/cjs/artifacts/tokens-raw/atlassian-motion.js +3 -3
  31. package/dist/cjs/custom-theme.js +10 -60
  32. package/dist/cjs/entry-points/token-metadata.codegen.js +1 -10
  33. package/dist/cjs/get-custom-theme-styles.js +57 -0
  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/get-theme-styles.js +6 -5
  37. package/dist/cjs/load-custom-theme-styles.js +2 -2
  38. package/dist/cjs/set-global-theme.js +4 -3
  39. package/dist/cjs/theme-color-modes.js +13 -0
  40. package/dist/cjs/theme-config.js +19 -16
  41. package/dist/cjs/theme-ids.js +13 -0
  42. package/dist/cjs/theme-state-transformer.js +2 -2
  43. package/dist/cjs/utils/color-detection.js +9 -12
  44. package/dist/cjs/utils/color-utils.js +38 -47
  45. package/dist/cjs/utils/custom-theme-loading-utils.js +7 -11
  46. package/dist/cjs/utils/generate-custom-color-ramp.js +16 -19
  47. package/dist/cjs/utils/get-alpha.js +13 -0
  48. package/dist/cjs/utils/get-closest-color-index.js +20 -0
  49. package/dist/cjs/utils/get-css-custom-property.js +32 -0
  50. package/dist/cjs/utils/get-fully-qualified-token-id.js +19 -0
  51. package/dist/cjs/utils/get-theme-override-preferences.js +12 -0
  52. package/dist/cjs/utils/get-theme-preferences.js +8 -5
  53. package/dist/cjs/utils/get-token-id.js +26 -0
  54. package/dist/cjs/utils/hct-color-utils/argb-from-rgb.js +12 -0
  55. package/dist/cjs/utils/hct-color-utils/clamp-double.js +20 -0
  56. package/dist/cjs/utils/hct-color-utils/clamp-int.js +20 -0
  57. package/dist/cjs/utils/hct-color-utils/color-utils.js +34 -59
  58. package/dist/cjs/utils/hct-color-utils/delinearized.js +27 -0
  59. package/dist/cjs/utils/hct-color-utils/hct.js +19 -95
  60. package/dist/cjs/utils/hct-color-utils/lerp.js +14 -0
  61. package/dist/cjs/utils/hct-color-utils/linearized.js +22 -0
  62. package/dist/cjs/utils/hct-color-utils/math-utils.js +38 -107
  63. package/dist/cjs/utils/hct-color-utils/matrix-multiply.js +15 -0
  64. package/dist/cjs/utils/hct-color-utils/sanitize-degrees-double.js +19 -0
  65. package/dist/cjs/utils/hct-color-utils/signum.js +20 -0
  66. package/dist/cjs/utils/hct-color-utils/viewing-conditions.js +98 -0
  67. package/dist/cjs/utils/hex-to-rgba-values.js +15 -0
  68. package/dist/cjs/utils/hsl-to-rgb.js +18 -0
  69. package/dist/cjs/utils/is-valid-brand-hex.js +9 -0
  70. package/dist/cjs/utils/limit-size-of-custom-style-elements.js +16 -0
  71. package/dist/cjs/utils/load-theme-css.js +32 -0
  72. package/dist/cjs/utils/relative-luminance-w3-c.js +18 -0
  73. package/dist/cjs/utils/rgb-to-hex.js +9 -0
  74. package/dist/cjs/utils/theme-loading.js +10 -25
  75. package/dist/cjs/utils/token-ids.js +21 -62
  76. package/dist/es2019/artifacts/replacement-mapping.js +5 -2
  77. package/dist/es2019/artifacts/tokens-raw/atlassian-motion.js +3 -3
  78. package/dist/es2019/custom-theme.js +4 -66
  79. package/dist/es2019/entry-points/token-metadata.codegen.js +1 -10
  80. package/dist/es2019/get-custom-theme-styles.js +60 -0
  81. package/dist/es2019/get-global-theme.js +1 -1
  82. package/dist/es2019/get-theme-html-attrs.js +1 -1
  83. package/dist/es2019/get-theme-styles.js +4 -3
  84. package/dist/es2019/load-custom-theme-styles.js +1 -1
  85. package/dist/es2019/set-global-theme.js +3 -2
  86. package/dist/es2019/theme-color-modes.js +7 -0
  87. package/dist/es2019/theme-config.js +4 -16
  88. package/dist/es2019/theme-ids.js +7 -0
  89. package/dist/es2019/theme-state-transformer.js +1 -1
  90. package/dist/es2019/utils/color-detection.js +3 -11
  91. package/dist/es2019/utils/color-utils.js +8 -34
  92. package/dist/es2019/utils/custom-theme-loading-utils.js +2 -8
  93. package/dist/es2019/utils/generate-custom-color-ramp.js +7 -15
  94. package/dist/es2019/utils/get-alpha.js +7 -0
  95. package/dist/es2019/utils/get-closest-color-index.js +14 -0
  96. package/dist/es2019/utils/get-css-custom-property.js +23 -0
  97. package/dist/es2019/utils/get-fully-qualified-token-id.js +11 -0
  98. package/dist/es2019/utils/get-theme-override-preferences.js +4 -0
  99. package/dist/es2019/utils/get-theme-preferences.js +1 -4
  100. package/dist/es2019/utils/get-token-id.js +18 -0
  101. package/dist/es2019/utils/hct-color-utils/argb-from-rgb.js +6 -0
  102. package/dist/es2019/utils/hct-color-utils/clamp-double.js +14 -0
  103. package/dist/es2019/utils/hct-color-utils/clamp-int.js +14 -0
  104. package/dist/es2019/utils/hct-color-utils/color-utils.js +7 -45
  105. package/dist/es2019/utils/hct-color-utils/delinearized.js +20 -0
  106. package/dist/es2019/utils/hct-color-utils/hct.js +3 -76
  107. package/dist/es2019/utils/hct-color-utils/lerp.js +8 -0
  108. package/dist/es2019/utils/hct-color-utils/linearized.js +16 -0
  109. package/dist/es2019/utils/hct-color-utils/math-utils.js +6 -105
  110. package/dist/es2019/utils/hct-color-utils/matrix-multiply.js +9 -0
  111. package/dist/es2019/utils/hct-color-utils/sanitize-degrees-double.js +13 -0
  112. package/dist/es2019/utils/hct-color-utils/signum.js +14 -0
  113. package/dist/es2019/utils/hct-color-utils/viewing-conditions.js +78 -0
  114. package/dist/es2019/utils/hex-to-rgba-values.js +9 -0
  115. package/dist/es2019/utils/hsl-to-rgb.js +8 -0
  116. package/dist/es2019/utils/is-valid-brand-hex.js +1 -0
  117. package/dist/es2019/utils/limit-size-of-custom-style-elements.js +8 -0
  118. package/dist/es2019/utils/load-theme-css.js +7 -0
  119. package/dist/es2019/utils/relative-luminance-w3-c.js +12 -0
  120. package/dist/es2019/utils/rgb-to-hex.js +3 -0
  121. package/dist/es2019/utils/theme-loading.js +3 -8
  122. package/dist/es2019/utils/token-ids.js +3 -54
  123. package/dist/esm/artifacts/replacement-mapping.js +5 -2
  124. package/dist/esm/artifacts/tokens-raw/atlassian-motion.js +3 -3
  125. package/dist/esm/custom-theme.js +4 -58
  126. package/dist/esm/entry-points/token-metadata.codegen.js +1 -10
  127. package/dist/esm/get-custom-theme-styles.js +52 -0
  128. package/dist/esm/get-global-theme.js +1 -1
  129. package/dist/esm/get-theme-html-attrs.js +1 -1
  130. package/dist/esm/get-theme-styles.js +4 -3
  131. package/dist/esm/load-custom-theme-styles.js +1 -1
  132. package/dist/esm/set-global-theme.js +3 -2
  133. package/dist/esm/theme-color-modes.js +7 -0
  134. package/dist/esm/theme-config.js +6 -17
  135. package/dist/esm/theme-ids.js +7 -0
  136. package/dist/esm/theme-state-transformer.js +1 -1
  137. package/dist/esm/utils/color-detection.js +3 -11
  138. package/dist/esm/utils/color-utils.js +8 -40
  139. package/dist/esm/utils/custom-theme-loading-utils.js +2 -11
  140. package/dist/esm/utils/generate-custom-color-ramp.js +7 -15
  141. package/dist/esm/utils/get-alpha.js +7 -0
  142. package/dist/esm/utils/get-closest-color-index.js +14 -0
  143. package/dist/esm/utils/get-css-custom-property.js +26 -0
  144. package/dist/esm/utils/get-fully-qualified-token-id.js +13 -0
  145. package/dist/esm/utils/get-theme-override-preferences.js +5 -0
  146. package/dist/esm/utils/get-theme-preferences.js +1 -4
  147. package/dist/esm/utils/get-token-id.js +20 -0
  148. package/dist/esm/utils/hct-color-utils/argb-from-rgb.js +6 -0
  149. package/dist/esm/utils/hct-color-utils/clamp-double.js +14 -0
  150. package/dist/esm/utils/hct-color-utils/clamp-int.js +14 -0
  151. package/dist/esm/utils/hct-color-utils/color-utils.js +7 -45
  152. package/dist/esm/utils/hct-color-utils/delinearized.js +20 -0
  153. package/dist/esm/utils/hct-color-utils/hct.js +5 -87
  154. package/dist/esm/utils/hct-color-utils/lerp.js +8 -0
  155. package/dist/esm/utils/hct-color-utils/linearized.js +16 -0
  156. package/dist/esm/utils/hct-color-utils/math-utils.js +6 -105
  157. package/dist/esm/utils/hct-color-utils/matrix-multiply.js +9 -0
  158. package/dist/esm/utils/hct-color-utils/sanitize-degrees-double.js +13 -0
  159. package/dist/esm/utils/hct-color-utils/signum.js +14 -0
  160. package/dist/esm/utils/hct-color-utils/viewing-conditions.js +89 -0
  161. package/dist/esm/utils/hex-to-rgba-values.js +9 -0
  162. package/dist/esm/utils/hsl-to-rgb.js +12 -0
  163. package/dist/esm/utils/is-valid-brand-hex.js +3 -0
  164. package/dist/esm/utils/limit-size-of-custom-style-elements.js +10 -0
  165. package/dist/esm/utils/load-theme-css.js +25 -0
  166. package/dist/esm/utils/relative-luminance-w3-c.js +12 -0
  167. package/dist/esm/utils/rgb-to-hex.js +3 -0
  168. package/dist/esm/utils/theme-loading.js +3 -24
  169. package/dist/esm/utils/token-ids.js +3 -61
  170. package/dist/types/artifacts/replacement-mapping.d.ts +1 -1
  171. package/dist/types/artifacts/tokens-raw/atlassian-motion.d.ts +1 -1
  172. package/dist/types/artifacts/types-internal.d.ts +2 -2
  173. package/dist/types/artifacts/types.d.ts +2 -2
  174. package/dist/types/custom-theme.d.ts +1 -20
  175. package/dist/types/entry-points/css-type-schema.codegen.d.ts +2 -2
  176. package/dist/types/entry-points/token-metadata.codegen.d.ts +1 -1
  177. package/dist/types/get-custom-theme-styles.d.ts +16 -0
  178. package/dist/types/get-global-theme.d.ts +1 -1
  179. package/dist/types/theme-color-modes.d.ts +7 -0
  180. package/dist/types/theme-config.d.ts +4 -14
  181. package/dist/types/theme-ids.d.ts +7 -0
  182. package/dist/types/theme-state-transformer.d.ts +1 -1
  183. package/dist/types/utils/color-detection.d.ts +1 -6
  184. package/dist/types/utils/color-utils.d.ts +5 -5
  185. package/dist/types/utils/custom-theme-loading-utils.d.ts +1 -2
  186. package/dist/types/utils/generate-custom-color-ramp.d.ts +1 -2
  187. package/dist/types/utils/get-alpha.d.ts +1 -0
  188. package/dist/types/utils/get-closest-color-index.d.ts +2 -0
  189. package/dist/types/utils/get-css-custom-property.d.ts +15 -0
  190. package/dist/types/utils/get-fully-qualified-token-id.d.ts +11 -0
  191. package/dist/types/utils/get-theme-override-preferences.d.ts +2 -0
  192. package/dist/types/utils/get-theme-preferences.d.ts +1 -1
  193. package/dist/types/utils/get-token-id.d.ts +15 -0
  194. package/dist/types/utils/hct-color-utils/argb-from-rgb.d.ts +4 -0
  195. package/dist/types/utils/hct-color-utils/clamp-double.d.ts +7 -0
  196. package/dist/types/utils/hct-color-utils/clamp-int.d.ts +7 -0
  197. package/dist/types/utils/hct-color-utils/color-utils.d.ts +3 -23
  198. package/dist/types/utils/hct-color-utils/delinearized.d.ts +9 -0
  199. package/dist/types/utils/hct-color-utils/hct.d.ts +3 -48
  200. package/dist/types/utils/hct-color-utils/lerp.d.ts +6 -0
  201. package/dist/types/utils/hct-color-utils/linearized.d.ts +9 -0
  202. package/dist/types/utils/hct-color-utils/math-utils.d.ts +6 -60
  203. package/dist/types/utils/hct-color-utils/matrix-multiply.d.ts +4 -0
  204. package/dist/types/utils/hct-color-utils/sanitize-degrees-double.d.ts +7 -0
  205. package/dist/types/utils/hct-color-utils/signum.d.ts +6 -0
  206. package/dist/types/utils/hct-color-utils/viewing-conditions.d.ts +47 -0
  207. package/dist/types/utils/hex-to-rgba-values.d.ts +6 -0
  208. package/dist/types/utils/hsl-to-rgb.d.ts +1 -0
  209. package/dist/types/utils/is-valid-brand-hex.d.ts +1 -0
  210. package/dist/types/utils/limit-size-of-custom-style-elements.d.ts +1 -0
  211. package/dist/types/utils/load-theme-css.d.ts +2 -0
  212. package/dist/types/utils/relative-luminance-w3-c.d.ts +1 -0
  213. package/dist/types/utils/rgb-to-hex.d.ts +1 -0
  214. package/dist/types/utils/theme-loading.d.ts +1 -1
  215. package/dist/types/utils/token-ids.d.ts +3 -41
  216. package/dist/types-ts4.5/artifacts/replacement-mapping.d.ts +1 -1
  217. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-motion.d.ts +1 -1
  218. package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
  219. package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
  220. package/dist/types-ts4.5/custom-theme.d.ts +1 -20
  221. package/dist/types-ts4.5/entry-points/css-type-schema.codegen.d.ts +2 -2
  222. package/dist/types-ts4.5/entry-points/token-metadata.codegen.d.ts +1 -1
  223. package/dist/types-ts4.5/get-custom-theme-styles.d.ts +16 -0
  224. package/dist/types-ts4.5/get-global-theme.d.ts +1 -1
  225. package/dist/types-ts4.5/theme-color-modes.d.ts +11 -0
  226. package/dist/types-ts4.5/theme-config.d.ts +4 -29
  227. package/dist/types-ts4.5/theme-ids.d.ts +18 -0
  228. package/dist/types-ts4.5/theme-state-transformer.d.ts +1 -1
  229. package/dist/types-ts4.5/utils/color-detection.d.ts +1 -6
  230. package/dist/types-ts4.5/utils/color-utils.d.ts +5 -9
  231. package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +1 -2
  232. package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +1 -2
  233. package/dist/types-ts4.5/utils/get-alpha.d.ts +1 -0
  234. package/dist/types-ts4.5/utils/get-closest-color-index.d.ts +2 -0
  235. package/dist/types-ts4.5/utils/get-css-custom-property.d.ts +15 -0
  236. package/dist/types-ts4.5/utils/get-fully-qualified-token-id.d.ts +11 -0
  237. package/dist/types-ts4.5/utils/get-theme-override-preferences.d.ts +2 -0
  238. package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +1 -1
  239. package/dist/types-ts4.5/utils/get-token-id.d.ts +15 -0
  240. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-rgb.d.ts +4 -0
  241. package/dist/types-ts4.5/utils/hct-color-utils/clamp-double.d.ts +7 -0
  242. package/dist/types-ts4.5/utils/hct-color-utils/clamp-int.d.ts +7 -0
  243. package/dist/types-ts4.5/utils/hct-color-utils/color-utils.d.ts +3 -23
  244. package/dist/types-ts4.5/utils/hct-color-utils/delinearized.d.ts +9 -0
  245. package/dist/types-ts4.5/utils/hct-color-utils/hct.d.ts +3 -48
  246. package/dist/types-ts4.5/utils/hct-color-utils/lerp.d.ts +6 -0
  247. package/dist/types-ts4.5/utils/hct-color-utils/linearized.d.ts +9 -0
  248. package/dist/types-ts4.5/utils/hct-color-utils/math-utils.d.ts +6 -60
  249. package/dist/types-ts4.5/utils/hct-color-utils/matrix-multiply.d.ts +4 -0
  250. package/dist/types-ts4.5/utils/hct-color-utils/sanitize-degrees-double.d.ts +7 -0
  251. package/dist/types-ts4.5/utils/hct-color-utils/signum.d.ts +6 -0
  252. package/dist/types-ts4.5/utils/hct-color-utils/viewing-conditions.d.ts +47 -0
  253. package/dist/types-ts4.5/utils/hex-to-rgba-values.d.ts +6 -0
  254. package/dist/types-ts4.5/utils/hsl-to-rgb.d.ts +5 -0
  255. package/dist/types-ts4.5/utils/is-valid-brand-hex.d.ts +1 -0
  256. package/dist/types-ts4.5/utils/limit-size-of-custom-style-elements.d.ts +1 -0
  257. package/dist/types-ts4.5/utils/load-theme-css.d.ts +2 -0
  258. package/dist/types-ts4.5/utils/relative-luminance-w3-c.d.ts +1 -0
  259. package/dist/types-ts4.5/utils/rgb-to-hex.d.ts +1 -0
  260. package/dist/types-ts4.5/utils/theme-loading.d.ts +1 -1
  261. package/dist/types-ts4.5/utils/token-ids.d.ts +3 -41
  262. package/package.json +7 -7
  263. package/offerings.json +0 -44
@@ -1,376 +1,2 @@
1
- export const activeTokens: string[] = [
2
- 'color.text',
3
- 'color.text.accent.lime',
4
- 'color.text.accent.lime.bolder',
5
- 'color.text.accent.red',
6
- 'color.text.accent.red.bolder',
7
- 'color.text.accent.orange',
8
- 'color.text.accent.orange.bolder',
9
- 'color.text.accent.yellow',
10
- 'color.text.accent.yellow.bolder',
11
- 'color.text.accent.green',
12
- 'color.text.accent.green.bolder',
13
- 'color.text.accent.teal',
14
- 'color.text.accent.teal.bolder',
15
- 'color.text.accent.blue',
16
- 'color.text.accent.blue.bolder',
17
- 'color.text.accent.purple',
18
- 'color.text.accent.purple.bolder',
19
- 'color.text.accent.magenta',
20
- 'color.text.accent.magenta.bolder',
21
- 'color.text.accent.gray',
22
- 'color.text.accent.gray.bolder',
23
- 'color.text.disabled',
24
- 'color.text.inverse',
25
- 'color.text.selected',
26
- 'color.text.brand',
27
- 'color.text.danger',
28
- 'color.text.warning',
29
- 'color.text.warning.inverse',
30
- 'color.text.success',
31
- 'color.text.discovery',
32
- 'color.text.information',
33
- 'color.text.subtlest',
34
- 'color.text.subtle',
35
- 'color.link',
36
- 'color.link.pressed',
37
- 'color.link.visited',
38
- 'color.icon',
39
- 'color.icon.accent.lime',
40
- 'color.icon.accent.red',
41
- 'color.icon.accent.orange',
42
- 'color.icon.accent.yellow',
43
- 'color.icon.accent.green',
44
- 'color.icon.accent.teal',
45
- 'color.icon.accent.blue',
46
- 'color.icon.accent.purple',
47
- 'color.icon.accent.magenta',
48
- 'color.icon.accent.gray',
49
- 'color.icon.disabled',
50
- 'color.icon.inverse',
51
- 'color.icon.selected',
52
- 'color.icon.brand',
53
- 'color.icon.danger',
54
- 'color.icon.warning',
55
- 'color.icon.warning.inverse',
56
- 'color.icon.success',
57
- 'color.icon.discovery',
58
- 'color.icon.information',
59
- 'color.icon.subtle',
60
- 'color.border',
61
- 'color.border.accent.lime',
62
- 'color.border.accent.red',
63
- 'color.border.accent.orange',
64
- 'color.border.accent.yellow',
65
- 'color.border.accent.green',
66
- 'color.border.accent.teal',
67
- 'color.border.accent.blue',
68
- 'color.border.accent.purple',
69
- 'color.border.accent.magenta',
70
- 'color.border.accent.gray',
71
- 'color.border.disabled',
72
- 'color.border.focused',
73
- 'color.border.input',
74
- 'color.border.inverse',
75
- 'color.border.selected',
76
- 'color.border.brand',
77
- 'color.border.danger',
78
- 'color.border.warning',
79
- 'color.border.success',
80
- 'color.border.discovery',
81
- 'color.border.information',
82
- 'color.border.bold',
83
- 'color.background.accent.lime.subtlest',
84
- 'color.background.accent.lime.subtlest.hovered',
85
- 'color.background.accent.lime.subtlest.pressed',
86
- 'color.background.accent.lime.subtler',
87
- 'color.background.accent.lime.subtler.hovered',
88
- 'color.background.accent.lime.subtler.pressed',
89
- 'color.background.accent.lime.subtle',
90
- 'color.background.accent.lime.subtle.hovered',
91
- 'color.background.accent.lime.subtle.pressed',
92
- 'color.background.accent.lime.bolder',
93
- 'color.background.accent.lime.bolder.hovered',
94
- 'color.background.accent.lime.bolder.pressed',
95
- 'color.background.accent.red.subtlest',
96
- 'color.background.accent.red.subtlest.hovered',
97
- 'color.background.accent.red.subtlest.pressed',
98
- 'color.background.accent.red.subtler',
99
- 'color.background.accent.red.subtler.hovered',
100
- 'color.background.accent.red.subtler.pressed',
101
- 'color.background.accent.red.subtle',
102
- 'color.background.accent.red.subtle.hovered',
103
- 'color.background.accent.red.subtle.pressed',
104
- 'color.background.accent.red.bolder',
105
- 'color.background.accent.red.bolder.hovered',
106
- 'color.background.accent.red.bolder.pressed',
107
- 'color.background.accent.orange.subtlest',
108
- 'color.background.accent.orange.subtlest.hovered',
109
- 'color.background.accent.orange.subtlest.pressed',
110
- 'color.background.accent.orange.subtler',
111
- 'color.background.accent.orange.subtler.hovered',
112
- 'color.background.accent.orange.subtler.pressed',
113
- 'color.background.accent.orange.subtle',
114
- 'color.background.accent.orange.subtle.hovered',
115
- 'color.background.accent.orange.subtle.pressed',
116
- 'color.background.accent.orange.bolder',
117
- 'color.background.accent.orange.bolder.hovered',
118
- 'color.background.accent.orange.bolder.pressed',
119
- 'color.background.accent.yellow.subtlest',
120
- 'color.background.accent.yellow.subtlest.hovered',
121
- 'color.background.accent.yellow.subtlest.pressed',
122
- 'color.background.accent.yellow.subtler',
123
- 'color.background.accent.yellow.subtler.hovered',
124
- 'color.background.accent.yellow.subtler.pressed',
125
- 'color.background.accent.yellow.subtle',
126
- 'color.background.accent.yellow.subtle.hovered',
127
- 'color.background.accent.yellow.subtle.pressed',
128
- 'color.background.accent.yellow.bolder',
129
- 'color.background.accent.yellow.bolder.hovered',
130
- 'color.background.accent.yellow.bolder.pressed',
131
- 'color.background.accent.green.subtlest',
132
- 'color.background.accent.green.subtlest.hovered',
133
- 'color.background.accent.green.subtlest.pressed',
134
- 'color.background.accent.green.subtler',
135
- 'color.background.accent.green.subtler.hovered',
136
- 'color.background.accent.green.subtler.pressed',
137
- 'color.background.accent.green.subtle',
138
- 'color.background.accent.green.subtle.hovered',
139
- 'color.background.accent.green.subtle.pressed',
140
- 'color.background.accent.green.bolder',
141
- 'color.background.accent.green.bolder.hovered',
142
- 'color.background.accent.green.bolder.pressed',
143
- 'color.background.accent.teal.subtlest',
144
- 'color.background.accent.teal.subtlest.hovered',
145
- 'color.background.accent.teal.subtlest.pressed',
146
- 'color.background.accent.teal.subtler',
147
- 'color.background.accent.teal.subtler.hovered',
148
- 'color.background.accent.teal.subtler.pressed',
149
- 'color.background.accent.teal.subtle',
150
- 'color.background.accent.teal.subtle.hovered',
151
- 'color.background.accent.teal.subtle.pressed',
152
- 'color.background.accent.teal.bolder',
153
- 'color.background.accent.teal.bolder.hovered',
154
- 'color.background.accent.teal.bolder.pressed',
155
- 'color.background.accent.blue.subtlest',
156
- 'color.background.accent.blue.subtlest.hovered',
157
- 'color.background.accent.blue.subtlest.pressed',
158
- 'color.background.accent.blue.subtler',
159
- 'color.background.accent.blue.subtler.hovered',
160
- 'color.background.accent.blue.subtler.pressed',
161
- 'color.background.accent.blue.subtle',
162
- 'color.background.accent.blue.subtle.hovered',
163
- 'color.background.accent.blue.subtle.pressed',
164
- 'color.background.accent.blue.bolder',
165
- 'color.background.accent.blue.bolder.hovered',
166
- 'color.background.accent.blue.bolder.pressed',
167
- 'color.background.accent.purple.subtlest',
168
- 'color.background.accent.purple.subtlest.hovered',
169
- 'color.background.accent.purple.subtlest.pressed',
170
- 'color.background.accent.purple.subtler',
171
- 'color.background.accent.purple.subtler.hovered',
172
- 'color.background.accent.purple.subtler.pressed',
173
- 'color.background.accent.purple.subtle',
174
- 'color.background.accent.purple.subtle.hovered',
175
- 'color.background.accent.purple.subtle.pressed',
176
- 'color.background.accent.purple.bolder',
177
- 'color.background.accent.purple.bolder.hovered',
178
- 'color.background.accent.purple.bolder.pressed',
179
- 'color.background.accent.magenta.subtlest',
180
- 'color.background.accent.magenta.subtlest.hovered',
181
- 'color.background.accent.magenta.subtlest.pressed',
182
- 'color.background.accent.magenta.subtler',
183
- 'color.background.accent.magenta.subtler.hovered',
184
- 'color.background.accent.magenta.subtler.pressed',
185
- 'color.background.accent.magenta.subtle',
186
- 'color.background.accent.magenta.subtle.hovered',
187
- 'color.background.accent.magenta.subtle.pressed',
188
- 'color.background.accent.magenta.bolder',
189
- 'color.background.accent.magenta.bolder.hovered',
190
- 'color.background.accent.magenta.bolder.pressed',
191
- 'color.background.accent.gray.subtlest',
192
- 'color.background.accent.gray.subtlest.hovered',
193
- 'color.background.accent.gray.subtlest.pressed',
194
- 'color.background.accent.gray.subtler',
195
- 'color.background.accent.gray.subtler.hovered',
196
- 'color.background.accent.gray.subtler.pressed',
197
- 'color.background.accent.gray.subtle',
198
- 'color.background.accent.gray.subtle.hovered',
199
- 'color.background.accent.gray.subtle.pressed',
200
- 'color.background.accent.gray.bolder',
201
- 'color.background.accent.gray.bolder.hovered',
202
- 'color.background.accent.gray.bolder.pressed',
203
- 'color.background.disabled',
204
- 'color.background.input',
205
- 'color.background.input.hovered',
206
- 'color.background.input.pressed',
207
- 'color.background.inverse.subtle',
208
- 'color.background.inverse.subtle.hovered',
209
- 'color.background.inverse.subtle.pressed',
210
- 'color.background.neutral',
211
- 'color.background.neutral.hovered',
212
- 'color.background.neutral.pressed',
213
- 'color.background.neutral.subtle',
214
- 'color.background.neutral.subtle.hovered',
215
- 'color.background.neutral.subtle.pressed',
216
- 'color.background.neutral.bold',
217
- 'color.background.neutral.bold.hovered',
218
- 'color.background.neutral.bold.pressed',
219
- 'color.background.selected',
220
- 'color.background.selected.hovered',
221
- 'color.background.selected.pressed',
222
- 'color.background.selected.bold',
223
- 'color.background.selected.bold.hovered',
224
- 'color.background.selected.bold.pressed',
225
- 'color.background.brand.subtlest',
226
- 'color.background.brand.subtlest.hovered',
227
- 'color.background.brand.subtlest.pressed',
228
- 'color.background.brand.bold',
229
- 'color.background.brand.bold.hovered',
230
- 'color.background.brand.bold.pressed',
231
- 'color.background.brand.boldest',
232
- 'color.background.brand.boldest.hovered',
233
- 'color.background.brand.boldest.pressed',
234
- 'color.background.danger',
235
- 'color.background.danger.hovered',
236
- 'color.background.danger.pressed',
237
- 'color.background.danger.bold',
238
- 'color.background.danger.bold.hovered',
239
- 'color.background.danger.bold.pressed',
240
- 'color.background.warning',
241
- 'color.background.warning.hovered',
242
- 'color.background.warning.pressed',
243
- 'color.background.warning.bold',
244
- 'color.background.warning.bold.hovered',
245
- 'color.background.warning.bold.pressed',
246
- 'color.background.success',
247
- 'color.background.success.hovered',
248
- 'color.background.success.pressed',
249
- 'color.background.success.bold',
250
- 'color.background.success.bold.hovered',
251
- 'color.background.success.bold.pressed',
252
- 'color.background.discovery',
253
- 'color.background.discovery.hovered',
254
- 'color.background.discovery.pressed',
255
- 'color.background.discovery.bold',
256
- 'color.background.discovery.bold.hovered',
257
- 'color.background.discovery.bold.pressed',
258
- 'color.background.information',
259
- 'color.background.information.hovered',
260
- 'color.background.information.pressed',
261
- 'color.background.information.bold',
262
- 'color.background.information.bold.hovered',
263
- 'color.background.information.bold.pressed',
264
- 'color.blanket',
265
- 'color.blanket.selected',
266
- 'color.blanket.danger',
267
- 'color.skeleton',
268
- 'color.skeleton.subtle',
269
- 'elevation.surface',
270
- 'elevation.surface.hovered',
271
- 'elevation.surface.pressed',
272
- 'elevation.surface.overlay',
273
- 'elevation.surface.overlay.hovered',
274
- 'elevation.surface.overlay.pressed',
275
- 'elevation.surface.raised',
276
- 'elevation.surface.raised.hovered',
277
- 'elevation.surface.raised.pressed',
278
- 'elevation.surface.sunken',
279
- 'elevation.shadow.overlay',
280
- 'elevation.shadow.raised',
281
- 'opacity.disabled',
282
- 'opacity.loading',
283
- 'utility.elevation.surface.current',
284
- ];
285
-
286
- export const uniqueWordsFromTokens: string[] = [
287
- 'color',
288
- 'text',
289
- 'accent',
290
- 'lime',
291
- 'bolder',
292
- 'red',
293
- 'orange',
294
- 'yellow',
295
- 'green',
296
- 'teal',
297
- 'blue',
298
- 'purple',
299
- 'magenta',
300
- 'gray',
301
- 'disabled',
302
- 'inverse',
303
- 'selected',
304
- 'brand',
305
- 'danger',
306
- 'warning',
307
- 'success',
308
- 'discovery',
309
- 'information',
310
- 'subtlest',
311
- 'subtle',
312
- 'link',
313
- 'pressed',
314
- 'visited',
315
- 'icon',
316
- 'border',
317
- 'focused',
318
- 'input',
319
- 'bold',
320
- 'background',
321
- 'hovered',
322
- 'subtler',
323
- 'neutral',
324
- 'boldest',
325
- 'blanket',
326
- 'interaction',
327
- 'skeleton',
328
- 'chart',
329
- 'categorical',
330
- 'elevation',
331
- 'surface',
332
- 'overlay',
333
- 'raised',
334
- 'sunken',
335
- 'shadow',
336
- 'overflow',
337
- 'perimeter',
338
- 'spread',
339
- 'opacity',
340
- 'loading',
341
- 'utility',
342
- 'transform',
343
- 'uppercase',
344
- 'transparent',
345
- 'current',
346
- 'radius',
347
- 'circle',
348
- 'width',
349
- 'indicator',
350
- 'outline',
351
- 'space',
352
- 'negative',
353
- 'font',
354
- 'heading',
355
- 'xxlarge',
356
- 'xlarge',
357
- 'large',
358
- 'medium',
359
- 'small',
360
- 'xsmall',
361
- 'xxsmall',
362
- 'body',
363
- 'ui',
364
- 'code',
365
- 'letter',
366
- 'spacing',
367
- 'family',
368
- 'monospace',
369
- 'sans',
370
- 'size',
371
- 'weight',
372
- 'regular',
373
- 'semibold',
374
- 'line',
375
- 'height',
376
- ];
1
+ export { activeTokens } from './active-tokens';
2
+ export { uniqueWordsFromTokens } from './unique-words-from-tokens';
@@ -0,0 +1,91 @@
1
+ export const uniqueWordsFromTokens: string[] = [
2
+ 'color',
3
+ 'text',
4
+ 'accent',
5
+ 'lime',
6
+ 'bolder',
7
+ 'red',
8
+ 'orange',
9
+ 'yellow',
10
+ 'green',
11
+ 'teal',
12
+ 'blue',
13
+ 'purple',
14
+ 'magenta',
15
+ 'gray',
16
+ 'disabled',
17
+ 'inverse',
18
+ 'selected',
19
+ 'brand',
20
+ 'danger',
21
+ 'warning',
22
+ 'success',
23
+ 'discovery',
24
+ 'information',
25
+ 'subtlest',
26
+ 'subtle',
27
+ 'link',
28
+ 'pressed',
29
+ 'visited',
30
+ 'icon',
31
+ 'border',
32
+ 'focused',
33
+ 'input',
34
+ 'bold',
35
+ 'background',
36
+ 'hovered',
37
+ 'subtler',
38
+ 'neutral',
39
+ 'boldest',
40
+ 'blanket',
41
+ 'interaction',
42
+ 'skeleton',
43
+ 'chart',
44
+ 'categorical',
45
+ 'elevation',
46
+ 'surface',
47
+ 'overlay',
48
+ 'raised',
49
+ 'sunken',
50
+ 'shadow',
51
+ 'overflow',
52
+ 'perimeter',
53
+ 'spread',
54
+ 'opacity',
55
+ 'loading',
56
+ 'utility',
57
+ 'transform',
58
+ 'uppercase',
59
+ 'transparent',
60
+ 'current',
61
+ 'radius',
62
+ 'circle',
63
+ 'width',
64
+ 'indicator',
65
+ 'outline',
66
+ 'space',
67
+ 'negative',
68
+ 'font',
69
+ 'heading',
70
+ 'xxlarge',
71
+ 'xlarge',
72
+ 'large',
73
+ 'medium',
74
+ 'small',
75
+ 'xsmall',
76
+ 'xxsmall',
77
+ 'body',
78
+ 'ui',
79
+ 'code',
80
+ 'letter',
81
+ 'spacing',
82
+ 'family',
83
+ 'monospace',
84
+ 'sans',
85
+ 'size',
86
+ 'weight',
87
+ 'regular',
88
+ 'semibold',
89
+ 'line',
90
+ 'height',
91
+ ];
@@ -18,9 +18,12 @@ exports.default = void 0;
18
18
  * These changes will then be picked up by our tooling which will attempt to
19
19
  * migrate as many of these renames as possible.
20
20
  *
21
- * @codegen <<SignedSource::c779b40628532228cae2ec34977f1f8e>>
21
+ * @codegen <<SignedSource::047b57f2d22a7675431a9f6acb147bf6>>
22
22
  * @codegenCommand yarn build tokens
23
23
  */
24
24
 
25
- var replacementMapper = [];
25
+ var replacementMapper = [{
26
+ "path": "motion.easing.spring",
27
+ "state": "experimental"
28
+ }];
26
29
  var _default = exports.default = replacementMapper;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  /**
8
8
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
- * @codegen <<SignedSource::f86ddd91a5d48fe256274c50f5d73493>>
9
+ * @codegen <<SignedSource::33ce7f44e704e6b32332ffdfac5776e4>>
10
10
  * @codegenCommand yarn build tokens
11
11
  */
12
12
 
@@ -427,7 +427,7 @@ var tokens = [{
427
427
  }, {
428
428
  "attributes": {
429
429
  "group": "motionEasing",
430
- "state": "active",
430
+ "state": "experimental",
431
431
  "introduced": "11.5.0",
432
432
  "description": "A spring curve that overshoots slightly before settling. Use for playful, tactile feedback on small branded elements such as avatar hover, where the slight overshoot reinforces a sense of life."
433
433
  },
@@ -437,7 +437,7 @@ var tokens = [{
437
437
  "original": {
438
438
  "attributes": {
439
439
  "group": "motionEasing",
440
- "state": "active",
440
+ "state": "experimental",
441
441
  "introduced": "11.5.0",
442
442
  "description": "A spring curve that overshoots slightly before settling. Use for playful, tactile feedback on small branded elements such as avatar hover, where the slight overshoot reinforces a sense of life."
443
443
  },
@@ -4,69 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD = void 0;
7
- exports.getCustomThemeStyles = getCustomThemeStyles;
7
+ Object.defineProperty(exports, "getCustomThemeStyles", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _getCustomThemeStyles.getCustomThemeStyles;
11
+ }
12
+ });
8
13
  exports.loadAndAppendCustomThemeCss = loadAndAppendCustomThemeCss;
9
- var _constants = require("./constants");
10
- var _themeConfig = require("./theme-config");
11
- var _customThemeLoadingUtils = require("./utils/custom-theme-loading-utils");
12
- var _generateCustomColorRamp = require("./utils/generate-custom-color-ramp");
13
- var _hash = require("./utils/hash");
14
+ var _getCustomThemeStyles = require("./get-custom-theme-styles");
15
+ var _limitSizeOfCustomStyleElements = require("./utils/limit-size-of-custom-style-elements");
14
16
  var CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD = exports.CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD = 10;
15
-
16
- /**
17
- *
18
- * @param themeSchema The schema of available themes
19
- * @returns a string with the CSS for the custom theme
20
- */
21
- /**
22
- * Takes a color mode and custom branding options, and returns an array of objects for use in applying custom styles to the document head.
23
- * 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.
24
- *
25
- * @param {Object<string, string>} themeState The themes and color mode that should be applied.
26
- * @param {string} themeState.colorMode Determines which color theme is applied
27
- * @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
28
- *
29
- * @returns An object array, containing theme IDs, data-attributes to attach to the theme, and the theme CSS.
30
- * If an error is encountered while loading themes, the themes array will be empty.
31
- */
32
- function getCustomThemeStyles(themeState) {
33
- var _themeState$UNSAFE_th;
34
- var brandColor = themeState === null || themeState === void 0 || (_themeState$UNSAFE_th = themeState.UNSAFE_themeOptions) === null || _themeState$UNSAFE_th === void 0 ? void 0 : _themeState$UNSAFE_th.brandColor;
35
- var mode = (themeState === null || themeState === void 0 ? void 0 : themeState.colorMode) || _themeConfig.themeStateDefaults['colorMode'];
36
- var optionString = JSON.stringify(themeState === null || themeState === void 0 ? void 0 : themeState.UNSAFE_themeOptions);
37
- var uniqueId = (0, _hash.hash)(optionString);
38
- var themeRamp = (0, _generateCustomColorRamp.generateColors)(brandColor).ramp;
39
-
40
- // outputs object to generate to CSS from
41
- var themes = [];
42
- var tokenMaps = (0, _generateCustomColorRamp.generateTokenMapWithContrastCheck)(brandColor, mode, themeRamp);
43
- if ((mode === 'light' || mode === 'auto') && tokenMaps.light) {
44
- // Light mode theming
45
- themes.push({
46
- id: 'light',
47
- attrs: {
48
- 'data-theme': 'light',
49
- 'data-custom-theme': uniqueId
50
- },
51
- 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}")
52
- });
53
- }
54
- if ((mode === 'dark' || mode === 'auto') && tokenMaps.dark) {
55
- // Dark mode theming
56
- themes.push({
57
- id: 'dark',
58
- attrs: {
59
- 'data-theme': 'dark',
60
- 'data-custom-theme': uniqueId
61
- },
62
- 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}")
63
- });
64
- }
65
- return themes;
66
- }
67
17
  function loadAndAppendCustomThemeCss(themeState) {
68
- var themes = getCustomThemeStyles(themeState);
69
- (0, _customThemeLoadingUtils.limitSizeOfCustomStyleElements)(CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD);
18
+ var themes = (0, _getCustomThemeStyles.getCustomThemeStyles)(themeState);
19
+ (0, _limitSizeOfCustomStyleElements.limitSizeOfCustomStyleElements)(CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD);
70
20
  themes.map(function (theme) {
71
21
  var styleTag = document.createElement('style');
72
22
  document.head.appendChild(styleTag);
@@ -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::84f21045f3136acc13a56a289840c82a>>
12
+ * @codegen <<SignedSource::8a97395137b2eee0fedb0ac95a7a2528>>
13
13
  * @codegenCommand yarn build tokens
14
14
  */
15
15
 
@@ -166,15 +166,6 @@ var tokens = exports.tokens = [{
166
166
  usage: '',
167
167
  cssProperties: []
168
168
  }
169
- }, {
170
- name: 'motion.easing.spring',
171
- path: ['motion', 'easing', 'spring'],
172
- description: 'A spring curve that overshoots slightly before settling. Use for playful, tactile feedback on small branded elements such as avatar hover, where the slight overshoot reinforces a sense of life.',
173
- exampleValue: 'linear(0, 0.021, 0.058, 0.107, 0.164, 0.227, 0.292, 0.359, 0.425, 0.49, 0.552, 0.61, 0.664, 0.714, 0.759, 0.8, 0.837, 0.869, 0.898, 0.922, 0.943, 0.961, 0.976, 0.988, 0.998, 1.006, 1.013, 1.017, 1.02, 1.023, 1.024, 1.024, 1.024, 1.024, 1.023, 1.022, 1.02, 1.019, 1.017, 1.015, 1.014, 1.012, 1.011, 1.009, 1.008, 1.007, 1.006, 1.005, 1.004, 1.003, 1.002, 1.002, 1.001, 1.001, 1.001, 1, 1, 1, 1, 1, 0.999, 0.999, 0.999, 0.999, 1)',
174
- usageGuidelines: {
175
- usage: '',
176
- cssProperties: []
177
- }
178
169
  }, {
179
170
  name: 'motion.flag.enter',
180
171
  path: ['motion', 'flag', 'enter'],
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getCustomThemeStyles = getCustomThemeStyles;
7
+ var _constants = require("./constants");
8
+ var _themeConfig = require("./theme-config");
9
+ var _customThemeLoadingUtils = require("./utils/custom-theme-loading-utils");
10
+ var _generateCustomColorRamp = require("./utils/generate-custom-color-ramp");
11
+ var _hash = require("./utils/hash");
12
+ /**
13
+ * 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
+ * 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.
15
+ *
16
+ * @param {Object<string, string>} themeState The themes and color mode that should be applied.
17
+ * @param {string} themeState.colorMode Determines which color theme is applied
18
+ * @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
19
+ *
20
+ * @returns An object array, containing theme IDs, data-attributes to attach to the theme, and the theme CSS.
21
+ * If an error is encountered while loading themes, the themes array will be empty.
22
+ */
23
+ function getCustomThemeStyles(themeState) {
24
+ var _themeState$UNSAFE_th;
25
+ var brandColor = themeState === null || themeState === void 0 || (_themeState$UNSAFE_th = themeState.UNSAFE_themeOptions) === null || _themeState$UNSAFE_th === void 0 ? void 0 : _themeState$UNSAFE_th.brandColor;
26
+ var mode = (themeState === null || themeState === void 0 ? void 0 : themeState.colorMode) || _themeConfig.themeStateDefaults['colorMode'];
27
+ var optionString = JSON.stringify(themeState === null || themeState === void 0 ? void 0 : themeState.UNSAFE_themeOptions);
28
+ var uniqueId = (0, _hash.hash)(optionString);
29
+ var themeRamp = (0, _generateCustomColorRamp.generateColors)(brandColor).ramp;
30
+
31
+ // outputs object to generate to CSS from
32
+ var themes = [];
33
+ var tokenMaps = (0, _generateCustomColorRamp.generateTokenMapWithContrastCheck)(brandColor, mode, themeRamp);
34
+ if ((mode === 'light' || mode === 'auto') && tokenMaps.light) {
35
+ // Light mode theming
36
+ themes.push({
37
+ id: 'light',
38
+ attrs: {
39
+ 'data-theme': 'light',
40
+ 'data-custom-theme': uniqueId
41
+ },
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
+ });
44
+ }
45
+ if ((mode === 'dark' || mode === 'auto') && tokenMaps.dark) {
46
+ // Dark mode theming
47
+ themes.push({
48
+ id: 'dark',
49
+ attrs: {
50
+ 'data-theme': 'dark',
51
+ 'data-custom-theme': uniqueId
52
+ },
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
+ });
55
+ }
56
+ return themes;
57
+ }