@atlaskit/tokens 13.4.0 → 15.0.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 (219) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/artifacts/theme-import-map/package.json +1 -8
  3. package/artifacts/types/package.json +1 -8
  4. package/babel-plugin/package.json +1 -8
  5. package/constants/package.json +1 -8
  6. package/css-type-schema/package.json +1 -8
  7. package/custom-themes/package.json +1 -8
  8. package/dist/cjs/theme-state-defaults.js +1 -4
  9. package/dist/es2019/theme-state-defaults.js +1 -4
  10. package/dist/esm/theme-state-defaults.js +1 -4
  11. package/enable-global-theme/package.json +1 -8
  12. package/get-global-theme/package.json +1 -8
  13. package/get-ssr-auto-script/package.json +1 -8
  14. package/get-theme-html-attrs/package.json +1 -8
  15. package/get-theme-styles/package.json +1 -8
  16. package/get-token/package.json +1 -8
  17. package/get-token-value/package.json +1 -8
  18. package/package.json +29 -40
  19. package/palettes-raw/package.json +1 -8
  20. package/rename-mapping/package.json +1 -8
  21. package/set-global-theme/package.json +1 -8
  22. package/theme-config/package.json +1 -8
  23. package/theme-mutation-observer/package.json +1 -8
  24. package/theme-state-transformer/package.json +1 -8
  25. package/token-default-values/package.json +1 -8
  26. package/token-ids/package.json +1 -8
  27. package/token-metadata/package.json +1 -8
  28. package/token-names/package.json +1 -8
  29. package/token-order/package.json +1 -8
  30. package/tokens-raw/package.json +1 -8
  31. package/types/package.json +1 -8
  32. package/use-theme-observer/package.json +1 -8
  33. package/dist/cjs/artifacts/themes/atlassian-shape-rounder.js +0 -12
  34. package/dist/cjs/artifacts/themes/atlassian-shape-roundest.js +0 -12
  35. package/dist/es2019/artifacts/themes/atlassian-shape-rounder.js +0 -19
  36. package/dist/es2019/artifacts/themes/atlassian-shape-roundest.js +0 -19
  37. package/dist/esm/artifacts/themes/atlassian-shape-rounder.js +0 -6
  38. package/dist/esm/artifacts/themes/atlassian-shape-roundest.js +0 -6
  39. package/dist/types/artifacts/themes/atlassian-shape-rounder.d.ts +0 -7
  40. package/dist/types/artifacts/themes/atlassian-shape-roundest.d.ts +0 -7
  41. package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +0 -18
  42. package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +0 -18
  43. package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +0 -16
  44. package/dist/types-ts4.5/artifacts/palettes-raw/legacy-palette.d.ts +0 -25
  45. package/dist/types-ts4.5/artifacts/palettes-raw/motion-palette.d.ts +0 -24
  46. package/dist/types-ts4.5/artifacts/palettes-raw/palette-brand-refresh.d.ts +0 -25
  47. package/dist/types-ts4.5/artifacts/palettes-raw/palette.d.ts +0 -25
  48. package/dist/types-ts4.5/artifacts/palettes-raw/shape-palette.d.ts +0 -24
  49. package/dist/types-ts4.5/artifacts/palettes-raw/spacing-scale.d.ts +0 -24
  50. package/dist/types-ts4.5/artifacts/palettes-raw/typography-palette.d.ts +0 -24
  51. package/dist/types-ts4.5/artifacts/replacement-mapping.d.ts +0 -26
  52. package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +0 -16
  53. package/dist/types-ts4.5/artifacts/themes/atlassian-dark-future.d.ts +0 -7
  54. package/dist/types-ts4.5/artifacts/themes/atlassian-dark-increased-contrast.d.ts +0 -7
  55. package/dist/types-ts4.5/artifacts/themes/atlassian-dark-new-input-border.d.ts +0 -7
  56. package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +0 -7
  57. package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +0 -7
  58. package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +0 -7
  59. package/dist/types-ts4.5/artifacts/themes/atlassian-light-future.d.ts +0 -7
  60. package/dist/types-ts4.5/artifacts/themes/atlassian-light-increased-contrast.d.ts +0 -7
  61. package/dist/types-ts4.5/artifacts/themes/atlassian-light-new-input-border.d.ts +0 -7
  62. package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +0 -7
  63. package/dist/types-ts4.5/artifacts/themes/atlassian-motion.d.ts +0 -7
  64. package/dist/types-ts4.5/artifacts/themes/atlassian-shape-rounder.d.ts +0 -7
  65. package/dist/types-ts4.5/artifacts/themes/atlassian-shape-roundest.d.ts +0 -7
  66. package/dist/types-ts4.5/artifacts/themes/atlassian-shape.d.ts +0 -7
  67. package/dist/types-ts4.5/artifacts/themes/atlassian-spacing.d.ts +0 -7
  68. package/dist/types-ts4.5/artifacts/themes/atlassian-typography.d.ts +0 -7
  69. package/dist/types-ts4.5/artifacts/token-default-values.d.ts +0 -566
  70. package/dist/types-ts4.5/artifacts/token-names.d.ts +0 -1113
  71. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-brand-refresh.d.ts +0 -50
  72. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-future.d.ts +0 -31
  73. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-increased-contrast.d.ts +0 -51
  74. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +0 -51
  75. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +0 -51
  76. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +0 -51
  77. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-brand-refresh.d.ts +0 -50
  78. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-future.d.ts +0 -31
  79. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-increased-contrast.d.ts +0 -51
  80. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +0 -51
  81. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-motion.d.ts +0 -43
  82. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-shape.d.ts +0 -31
  83. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-spacing.d.ts +0 -31
  84. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography.d.ts +0 -38
  85. package/dist/types-ts4.5/artifacts/types-internal.d.ts +0 -6
  86. package/dist/types-ts4.5/artifacts/types.d.ts +0 -6
  87. package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-token-names.d.ts +0 -784
  88. package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-types-internal.d.ts +0 -6
  89. package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-types.d.ts +0 -6
  90. package/dist/types-ts4.5/artifacts/typescript/atlassian-light-token-names.d.ts +0 -784
  91. package/dist/types-ts4.5/artifacts/typescript/atlassian-light-types-internal.d.ts +0 -6
  92. package/dist/types-ts4.5/artifacts/typescript/atlassian-light-types.d.ts +0 -6
  93. package/dist/types-ts4.5/babel-plugin/index.d.ts +0 -1
  94. package/dist/types-ts4.5/babel-plugin/plugin.d.ts +0 -29
  95. package/dist/types-ts4.5/constants.d.ts +0 -9
  96. package/dist/types-ts4.5/custom-theme.d.ts +0 -6
  97. package/dist/types-ts4.5/enable-global-theme.d.ts +0 -26
  98. package/dist/types-ts4.5/entry-points/artifacts-theme-import-map.d.ts +0 -1
  99. package/dist/types-ts4.5/entry-points/artifacts-types.d.ts +0 -1
  100. package/dist/types-ts4.5/entry-points/babel-plugin.d.ts +0 -1
  101. package/dist/types-ts4.5/entry-points/constants.d.ts +0 -1
  102. package/dist/types-ts4.5/entry-points/css-type-schema.codegen.d.ts +0 -165
  103. package/dist/types-ts4.5/entry-points/custom-themes.d.ts +0 -1
  104. package/dist/types-ts4.5/entry-points/enable-global-theme.d.ts +0 -1
  105. package/dist/types-ts4.5/entry-points/get-global-theme.d.ts +0 -1
  106. package/dist/types-ts4.5/entry-points/get-ssr-auto-script.d.ts +0 -1
  107. package/dist/types-ts4.5/entry-points/get-theme-html-attrs.d.ts +0 -1
  108. package/dist/types-ts4.5/entry-points/get-theme-styles.d.ts +0 -1
  109. package/dist/types-ts4.5/entry-points/get-token-value.d.ts +0 -1
  110. package/dist/types-ts4.5/entry-points/get-token.d.ts +0 -1
  111. package/dist/types-ts4.5/entry-points/palettes-raw.d.ts +0 -2
  112. package/dist/types-ts4.5/entry-points/rename-mapping.d.ts +0 -1
  113. package/dist/types-ts4.5/entry-points/set-global-theme.d.ts +0 -1
  114. package/dist/types-ts4.5/entry-points/theme-config.d.ts +0 -2
  115. package/dist/types-ts4.5/entry-points/theme-mutation-observer.d.ts +0 -1
  116. package/dist/types-ts4.5/entry-points/theme-state-transformer.d.ts +0 -2
  117. package/dist/types-ts4.5/entry-points/token-default-values.d.ts +0 -1
  118. package/dist/types-ts4.5/entry-points/token-ids.d.ts +0 -1
  119. package/dist/types-ts4.5/entry-points/token-metadata.codegen.d.ts +0 -19
  120. package/dist/types-ts4.5/entry-points/token-names.d.ts +0 -2
  121. package/dist/types-ts4.5/entry-points/token-order.d.ts +0 -1
  122. package/dist/types-ts4.5/entry-points/tokens-raw.d.ts +0 -6
  123. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  124. package/dist/types-ts4.5/entry-points/use-theme-observer.d.ts +0 -1
  125. package/dist/types-ts4.5/get-custom-theme-styles.d.ts +0 -16
  126. package/dist/types-ts4.5/get-global-theme.d.ts +0 -3
  127. package/dist/types-ts4.5/get-ssr-auto-script.d.ts +0 -11
  128. package/dist/types-ts4.5/get-theme-html-attrs.d.ts +0 -18
  129. package/dist/types-ts4.5/get-theme-styles.d.ts +0 -25
  130. package/dist/types-ts4.5/get-token-value.d.ts +0 -25
  131. package/dist/types-ts4.5/get-token.d.ts +0 -26
  132. package/dist/types-ts4.5/index.d.ts +0 -19
  133. package/dist/types-ts4.5/is-color-mode.d.ts +0 -2
  134. package/dist/types-ts4.5/is-theme-ids.d.ts +0 -2
  135. package/dist/types-ts4.5/is-theme-kind.d.ts +0 -11
  136. package/dist/types-ts4.5/load-custom-theme-styles.d.ts +0 -17
  137. package/dist/types-ts4.5/set-global-theme.d.ts +0 -26
  138. package/dist/types-ts4.5/theme-color-modes.d.ts +0 -12
  139. package/dist/types-ts4.5/theme-config.d.ts +0 -121
  140. package/dist/types-ts4.5/theme-ids.d.ts +0 -19
  141. package/dist/types-ts4.5/theme-mutation-observer.d.ts +0 -25
  142. package/dist/types-ts4.5/theme-object-to-string.d.ts +0 -13
  143. package/dist/types-ts4.5/theme-options-schema.d.ts +0 -7
  144. package/dist/types-ts4.5/theme-state-defaults.d.ts +0 -14
  145. package/dist/types-ts4.5/theme-state.d.ts +0 -17
  146. package/dist/types-ts4.5/theme-string-to-object.d.ts +0 -14
  147. package/dist/types-ts4.5/types.d.ts +0 -1356
  148. package/dist/types-ts4.5/use-theme-observer.d.ts +0 -16
  149. package/dist/types-ts4.5/utils/additional-contrast-checker.d.ts +0 -9
  150. package/dist/types-ts4.5/utils/color-detection.d.ts +0 -8
  151. package/dist/types-ts4.5/utils/color-mode-listeners.d.ts +0 -13
  152. package/dist/types-ts4.5/utils/configure-page.d.ts +0 -6
  153. package/dist/types-ts4.5/utils/contrast-mode-listeners.d.ts +0 -13
  154. package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +0 -4
  155. package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +0 -11
  156. package/dist/types-ts4.5/utils/delta-e.d.ts +0 -1
  157. package/dist/types-ts4.5/utils/generate-colors.d.ts +0 -5
  158. package/dist/types-ts4.5/utils/generate-token-map-with-contrast-check.d.ts +0 -11
  159. package/dist/types-ts4.5/utils/generate-token-map.d.ts +0 -11
  160. package/dist/types-ts4.5/utils/get-alpha.d.ts +0 -1
  161. package/dist/types-ts4.5/utils/get-closest-color-index.d.ts +0 -2
  162. package/dist/types-ts4.5/utils/get-contrast-ratio.d.ts +0 -1
  163. package/dist/types-ts4.5/utils/get-css-custom-property.d.ts +0 -15
  164. package/dist/types-ts4.5/utils/get-fully-qualified-token-id.d.ts +0 -11
  165. package/dist/types-ts4.5/utils/get-increased-contrast-theme.d.ts +0 -5
  166. package/dist/types-ts4.5/utils/get-theme-override-preferences.d.ts +0 -2
  167. package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +0 -3
  168. package/dist/types-ts4.5/utils/get-token-id.d.ts +0 -15
  169. package/dist/types-ts4.5/utils/hash.d.ts +0 -1
  170. package/dist/types-ts4.5/utils/hct-color-utils/alpha-from-argb.d.ts +0 -4
  171. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-linrgb.d.ts +0 -4
  172. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-lstar.d.ts +0 -8
  173. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-rgb.d.ts +0 -4
  174. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-rgba.d.ts +0 -8
  175. package/dist/types-ts4.5/utils/hct-color-utils/argb-from-xyz.d.ts +0 -4
  176. package/dist/types-ts4.5/utils/hct-color-utils/blue-from-argb.d.ts +0 -4
  177. package/dist/types-ts4.5/utils/hct-color-utils/clamp-component.d.ts +0 -1
  178. package/dist/types-ts4.5/utils/hct-color-utils/clamp-double.d.ts +0 -7
  179. package/dist/types-ts4.5/utils/hct-color-utils/clamp-int.d.ts +0 -7
  180. package/dist/types-ts4.5/utils/hct-color-utils/contrast.d.ts +0 -78
  181. package/dist/types-ts4.5/utils/hct-color-utils/delinearized.d.ts +0 -9
  182. package/dist/types-ts4.5/utils/hct-color-utils/green-from-argb.d.ts +0 -4
  183. package/dist/types-ts4.5/utils/hct-color-utils/hct.d.ts +0 -92
  184. package/dist/types-ts4.5/utils/hct-color-utils/index.d.ts +0 -4
  185. package/dist/types-ts4.5/utils/hct-color-utils/lab-f.d.ts +0 -1
  186. package/dist/types-ts4.5/utils/hct-color-utils/lab-invf.d.ts +0 -1
  187. package/dist/types-ts4.5/utils/hct-color-utils/lerp.d.ts +0 -6
  188. package/dist/types-ts4.5/utils/hct-color-utils/linearized.d.ts +0 -9
  189. package/dist/types-ts4.5/utils/hct-color-utils/lstar-from-argb.d.ts +0 -7
  190. package/dist/types-ts4.5/utils/hct-color-utils/lstar-from-y.d.ts +0 -12
  191. package/dist/types-ts4.5/utils/hct-color-utils/math-utils.d.ts +0 -6
  192. package/dist/types-ts4.5/utils/hct-color-utils/matrix-multiply.d.ts +0 -4
  193. package/dist/types-ts4.5/utils/hct-color-utils/red-from-argb.d.ts +0 -4
  194. package/dist/types-ts4.5/utils/hct-color-utils/rgba-from-argb.d.ts +0 -8
  195. package/dist/types-ts4.5/utils/hct-color-utils/rgba.d.ts +0 -14
  196. package/dist/types-ts4.5/utils/hct-color-utils/sanitize-degrees-double.d.ts +0 -7
  197. package/dist/types-ts4.5/utils/hct-color-utils/signum.d.ts +0 -6
  198. package/dist/types-ts4.5/utils/hct-color-utils/viewing-conditions.d.ts +0 -47
  199. package/dist/types-ts4.5/utils/hct-color-utils/white-point-d65.d.ts +0 -6
  200. package/dist/types-ts4.5/utils/hct-color-utils/y-from-lstar.d.ts +0 -12
  201. package/dist/types-ts4.5/utils/hex-to-hsl.d.ts +0 -5
  202. package/dist/types-ts4.5/utils/hex-to-rgb-a.d.ts +0 -6
  203. package/dist/types-ts4.5/utils/hex-to-rgb.d.ts +0 -5
  204. package/dist/types-ts4.5/utils/hex-to-rgba-values.d.ts +0 -6
  205. package/dist/types-ts4.5/utils/hsl-to-rgb.d.ts +0 -5
  206. package/dist/types-ts4.5/utils/is-valid-brand-hex.d.ts +0 -1
  207. package/dist/types-ts4.5/utils/is-valid-hex.d.ts +0 -1
  208. package/dist/types-ts4.5/utils/limit-size-of-custom-style-elements.d.ts +0 -1
  209. package/dist/types-ts4.5/utils/load-theme-css.d.ts +0 -2
  210. package/dist/types-ts4.5/utils/reduce-token-map.d.ts +0 -6
  211. package/dist/types-ts4.5/utils/relative-luminance-w3-c.d.ts +0 -1
  212. package/dist/types-ts4.5/utils/rgb-to-hex.d.ts +0 -1
  213. package/dist/types-ts4.5/utils/rgb-to-lab.d.ts +0 -5
  214. package/dist/types-ts4.5/utils/theme-loading.d.ts +0 -5
  215. package/dist/types-ts4.5/utils/token-ids.d.ts +0 -3
  216. package/dist/types-ts4.5/utils/token-order.d.ts +0 -7
  217. package/dist/types-ts4.5/utils/token-usage-guidelines.d.ts +0 -8
  218. package/figma/atlassian-shape-rounder.json +0 -123
  219. package/figma/atlassian-shape-roundest.json +0 -123
@@ -1,19 +0,0 @@
1
- export { default as themeConfig } from './theme-config';
2
- export { default as token } from './get-token';
3
- export { default as getTokenValue } from './get-token-value';
4
- export { default as setGlobalTheme } from './set-global-theme';
5
- export { default as enableGlobalTheme } from './enable-global-theme';
6
- export { default as getThemeStyles } from './get-theme-styles';
7
- export { default as getThemeHtmlAttrs } from './get-theme-html-attrs';
8
- export { default as getSSRAutoScript } from './get-ssr-auto-script';
9
- export { default as useThemeObserver } from './use-theme-observer';
10
- export { default as ThemeMutationObserver } from './theme-mutation-observer';
11
- export { default as getGlobalTheme } from './get-global-theme';
12
- export { themeStringToObject } from './theme-string-to-object';
13
- export { themeObjectToString } from './theme-object-to-string';
14
- export { default as themeImportMap } from './artifacts/theme-import-map';
15
- export type { CSSToken } from './artifacts/token-names';
16
- export type { ActiveTokens } from './artifacts/types';
17
- export type { ThemeColorModes, ThemeContrastModes, Themes, ThemeFileNames, ThemeIds, ThemeOptionsSchema, ThemeState, ActiveThemeState, } from './theme-config';
18
- export type { FontFamilyToken, FontWeightToken, Groups, OpacityToken, PaintToken, RawToken, ShadowToken, SpacingToken, ShapeToken, TypographyToken, MotionToken, } from './types';
19
- export { COLOR_MODE_ATTRIBUTE, CURRENT_SURFACE_CSS_VAR, SUBTREE_THEME_ATTRIBUTE, THEME_DATA_ATTRIBUTE, } from './constants';
@@ -1,2 +0,0 @@
1
- import type { ThemeColorModes } from './theme-color-modes';
2
- export declare const isColorMode: (modeId: string) => modeId is ThemeColorModes;
@@ -1,2 +0,0 @@
1
- import type { ThemeIds } from './theme-config';
2
- export declare const isThemeIds: (themeId: string) => themeId is ThemeIds;
@@ -1,11 +0,0 @@
1
- declare const themeKinds: readonly [
2
- "light",
3
- "dark",
4
- "spacing",
5
- "typography",
6
- "shape",
7
- "motion"
8
- ];
9
- type ThemeKind = (typeof themeKinds)[number];
10
- export declare const isThemeKind: (themeKind: string) => themeKind is ThemeKind;
11
- export {};
@@ -1,17 +0,0 @@
1
- import { type ThemeState } from './theme-config';
2
- /**
3
- * Synchronously generates and applies custom theme styles to the page.
4
- *
5
- * @param {Object<string, string>} themeState The themes and color mode that should be applied.
6
- * @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
7
- *
8
- * @example
9
- * ```
10
- * UNSAFE_loadCustomThemeStyles({
11
- * colorMode: 'auto',
12
- * UNSAFE_themeOptions: { brandColor: '#FF0000' }
13
- * });
14
- * ```
15
- */
16
- declare const UNSAFE_loadCustomThemeStyles: ({ colorMode, UNSAFE_themeOptions, }?: Partial<ThemeState>) => void;
17
- export default UNSAFE_loadCustomThemeStyles;
@@ -1,26 +0,0 @@
1
- import { type UnbindFn } from 'bind-event-listener';
2
- import { type ThemeIdsWithOverrides, type ThemeState } from './theme-config';
3
- /**
4
- * Sets the theme globally at runtime. This updates the `data-theme` and `data-color-mode` attributes on your page's <html> tag.
5
- *
6
- * @param {Object<string, string>} themeState The themes and color mode that should be applied.
7
- * @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
8
- * @param {string} themeState.contrastMode The contrast mode theme to be applied. If set to `auto`, the theme applied will be determined by the OS setting.set to `auto`, the theme applied will be determined by the OS setting.
9
- * @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
10
- * @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
11
- * @param {string} themeState.motion The motion theme to be applied.
12
- * @param {string} themeState.shape The shape theme to be applied.
13
- * @param {string} themeState.spacing The spacing theme to be applied.
14
- * @param {string} themeState.typography The typography theme to be applied.
15
- * @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
16
- * @param {function} themeLoader Callback function used to override the default theme loading functionality.
17
- *
18
- * @returns A Promise of an unbind function, that can be used to stop listening for changes to system theme.
19
- *
20
- * @example
21
- * ```
22
- * setGlobalTheme({colorMode: 'auto', light: 'light', dark: 'dark', spacing: 'spacing'});
23
- * ```
24
- */
25
- declare const setGlobalTheme: (nextThemeState?: Partial<ThemeState> | ((themeState: ThemeState) => ThemeState), themeLoader?: (id: ThemeIdsWithOverrides) => void | Promise<void>) => Promise<UnbindFn>;
26
- export default setGlobalTheme;
@@ -1,12 +0,0 @@
1
- /**
2
- * Theme modes: The general purpose of a theme.
3
- * This attr is used to apply the appropriate system-preference option
4
- * It may also be used as a selector for mode-specific overrides such as light/dark images.
5
- * The idea is there may exist many color themes, but every theme must either fit into light or dark.
6
- */
7
- export declare const themeColorModes: readonly [
8
- "light",
9
- "dark",
10
- "auto"
11
- ];
12
- export type ThemeColorModes = (typeof themeColorModes)[number];
@@ -1,121 +0,0 @@
1
- /**
2
- * This file contains the source of truth for themes and all associated meta data.
3
- */
4
- import type { ThemeColorModes } from './theme-color-modes';
5
- import { type ThemeIds } from './theme-ids';
6
- import type { ThemeState } from './theme-state';
7
- /**
8
- * Themes: The internal identifier of a theme.
9
- * These ids are what the actual theme files/folders are called.
10
- * style-dictionary will attempt to locate these in the file-system.
11
- */
12
- export type Themes = 'atlassian-light' | 'atlassian-light-future' | 'atlassian-light-increased-contrast' | 'atlassian-dark' | 'atlassian-dark-future' | 'atlassian-dark-increased-contrast' | 'atlassian-shape' | 'atlassian-spacing' | 'atlassian-typography' | 'atlassian-motion';
13
- export type ThemeFileNames = Themes;
14
- /**
15
- * ThemeOverrides: The internal identifier of a theme override. Which are themes that contain
16
- * a subset of tokens intended to override an existing theme. These ids are what the actual
17
- * theme files/folders are called. style-dictionary will attempt to locate these in the file-system.
18
- * Theme overrides are temporary and there may not be any defined at times.
19
- */
20
- export type ThemeOverrides = Themes;
21
- /**
22
- * Theme kinds: The type of theme.
23
- * Some themes are entirely focused on Color, whilst others are purely focused on spacing.
24
- * In the future other types may be introduced such as typography.
25
- */
26
- type ThemeKinds = 'color' | 'spacing' | 'typography' | 'shape' | 'motion';
27
- export type DataColorModes = Exclude<ThemeColorModes, 'auto'>;
28
- /**
29
- * Contrast preferences: The system contrast preference
30
- */
31
- declare const themeContrastModes: readonly [
32
- "more",
33
- "no-preference",
34
- "auto"
35
- ];
36
- export type ThemeContrastModes = (typeof themeContrastModes)[number];
37
- export type DataContrastModes = 'more' | 'no-preference' | 'auto';
38
- /**
39
- * Theme override ids: the equivalent of themeIds for theme overrides.
40
- * Theme overrides are temporary and there may not be any defined at times.
41
- */
42
- declare const themeOverrideIds: readonly [
43
- ];
44
- export type ThemeOverrideIds = (typeof themeOverrideIds)[number];
45
- export declare const themeIdsWithOverrides: readonly [
46
- 'light-increased-contrast',
47
- 'light',
48
- 'light-future',
49
- 'dark',
50
- 'dark-future',
51
- 'dark-increased-contrast',
52
- 'spacing',
53
- 'shape',
54
- 'typography',
55
- 'motion'
56
- ];
57
- export type ThemeIdsWithOverrides = (typeof themeIdsWithOverrides)[number];
58
- /**
59
- * Theme to use a base. This will create the theme as
60
- * an extension with all token values marked as optional
61
- * to allow tokens to be overridden as required.
62
- */
63
- type ExtensionThemeId = ThemeIds;
64
- /**
65
- * Palettes: The set of base tokens a given theme may be populated with.
66
- * For example: legacy light & dark themes use the "legacyPalette" containing colors from our
67
- * previous color set.
68
- */
69
- export type Palettes = 'defaultPalette' | 'spacingScale' | 'shapePalette' | 'typographyPalette' | 'motionPalette';
70
- /**
71
- * ThemeConfig: the source of truth for all theme meta-data.
72
- * This object should be used whenever interfacing with themes.
73
- */
74
- interface ThemeConfig {
75
- id: ThemeIds | ThemeOverrideIds;
76
- displayName: string;
77
- palette: Palettes;
78
- attributes: ({
79
- type: 'color';
80
- mode: DataColorModes;
81
- } | {
82
- type: Extract<ThemeKinds, 'spacing' | 'typography' | 'shape' | 'motion'>;
83
- }) & {
84
- /**
85
- * @deprecated Use top-level `extends` property instead
86
- */
87
- extends?: ExtensionThemeId;
88
- };
89
- /**
90
- * Theme to use a base. This will create the theme as
91
- * an extension with all token values marked as optional
92
- * to allow tokens to be overridden as required.
93
- */
94
- extends?: ThemeIds;
95
- /**
96
- * Theme to override. This will cause the theme to only
97
- * output css variables which can be imported to temporarily
98
- * override existing themes for testing purposes.
99
- */
100
- override?: ThemeIds;
101
- /**
102
- * Use when the theme provides an increased contrast
103
- * version of another theme. This will cause the theme to be loaded
104
- * under the media query `@media (prefers-contrast: more)`.
105
- */
106
- increasesContrastFor?: ThemeIds;
107
- }
108
- declare const themeConfig: Record<Themes | ThemeOverrides, ThemeConfig>;
109
- /**
110
- * Represents theme state once mounted to the page
111
- * (the page doesn't have an "auto" color mode, it's either light or dark)
112
- */
113
- export interface ActiveThemeState extends ThemeState {
114
- colorMode: DataColorModes;
115
- }
116
- export default themeConfig;
117
- export { themeColorModes, type ThemeColorModes } from './theme-color-modes';
118
- export { themeIds, type ThemeIds } from './theme-ids';
119
- export { themeStateDefaults } from './theme-state-defaults';
120
- export { type ThemeOptionsSchema, type CSSColor } from './theme-options-schema';
121
- export { type ThemeState } from './theme-state';
@@ -1,19 +0,0 @@
1
- export type ThemeIds = (typeof themeIds)[number];
2
- /**
3
- * Theme ids: The value that will be mounted to the DOM as a data attr
4
- * For example: `data-theme="light:light dark:dark spacing:spacing"
5
- *
6
- * These ids must be kebab case
7
- */
8
- export declare const themeIds: readonly [
9
- "light-increased-contrast",
10
- "light",
11
- "light-future",
12
- "dark",
13
- "dark-future",
14
- "dark-increased-contrast",
15
- "spacing",
16
- "shape",
17
- "typography",
18
- "motion"
19
- ];
@@ -1,25 +0,0 @@
1
- import { type ActiveThemeState } from './theme-config';
2
- type ThemeCallback = (theme: Partial<ActiveThemeState>) => unknown;
3
- /**
4
- * A MutationObserver which watches the `<html>` element for changes to the theme.
5
- *
6
- * In React, use the {@link useThemeObserver `useThemeObserver`} hook instead.
7
- *
8
- * @param {function} callback - A callback function which fires when the theme changes.
9
- *
10
- * @example
11
- * ```
12
- * const observer = new ThemeMutationObserver((theme) => {});
13
- * observer.observe();
14
- * ```
15
- */
16
- export default class ThemeMutationObserver {
17
- legacyObserver: MutationObserver | null;
18
- static observer: MutationObserver | null;
19
- static callbacks: Set<ThemeCallback>;
20
- callback: ThemeCallback;
21
- constructor(callback: ThemeCallback);
22
- observe(): void;
23
- disconnect(): void;
24
- }
25
- export {};
@@ -1,13 +0,0 @@
1
- import type { ThemeState } from './theme-state';
2
- /**
3
- * Converts a theme object to a string formatted for the `data-theme` HTML attribute.
4
- *
5
- * @param {object} themes The themes that should be applied.
6
- *
7
- * @example
8
- * ```
9
- * themeObjectToString({ dark: 'dark', light: 'light', spacing: 'spacing' });
10
- * // returns 'dark:dark light:light spacing:spacing'
11
- * ```
12
- */
13
- export declare const themeObjectToString: (themeState: Partial<ThemeState>) => string;
@@ -1,7 +0,0 @@
1
- export type CSSColor = `#${string}`;
2
- /**
3
- * ThemeOptionsSchema: additional configuration options used to customize Atlassian's themes
4
- */
5
- export interface ThemeOptionsSchema {
6
- brandColor: CSSColor;
7
- }
@@ -1,14 +0,0 @@
1
- import type { ThemeState } from './theme-state';
2
- /**
3
- * Can't evaluate typography feature flags at the module level,
4
- * it will always resolve to false when server side rendered or when flags are loaded async.
5
- */
6
- interface ThemeStateDefaults extends Omit<ThemeState, 'shape' | 'motion'> {
7
- shape: () => ThemeState['shape'];
8
- motion: () => ThemeState['motion'];
9
- }
10
- /**
11
- * themeStateDefaults: the default values for ThemeState used by theming utilities
12
- */
13
- export declare const themeStateDefaults: ThemeStateDefaults;
14
- export {};
@@ -1,17 +0,0 @@
1
- import type { ThemeColorModes } from './theme-color-modes';
2
- import type { ThemeContrastModes, ThemeOptionsSchema } from './theme-config';
3
- import type { ThemeIds } from './theme-ids';
4
- /**
5
- * ThemeState: the standard representation of an app's current theme and preferences
6
- */
7
- export interface ThemeState {
8
- light: Extract<ThemeIds, 'light' | 'light-future' | 'dark' | 'dark-future' | 'light-increased-contrast' | 'dark-increased-contrast'>;
9
- dark: Extract<ThemeIds, 'light' | 'light-future' | 'dark' | 'dark-future' | 'light-increased-contrast' | 'dark-increased-contrast'>;
10
- colorMode: ThemeColorModes;
11
- contrastMode: ThemeContrastModes;
12
- shape?: Extract<ThemeIds, 'shape'>;
13
- spacing: Extract<ThemeIds, 'spacing'>;
14
- typography: Extract<ThemeIds, 'typography'>;
15
- motion?: Extract<ThemeIds, 'motion'>;
16
- UNSAFE_themeOptions?: ThemeOptionsSchema;
17
- }
@@ -1,14 +0,0 @@
1
- import type { ThemeState } from './theme-config';
2
- /**
3
- * Converts a string that is formatted for the `data-theme` HTML attribute
4
- * to an object that can be passed to `setGlobalTheme`.
5
- *
6
- * @param {string} themes The themes that should be applied.
7
- *
8
- * @example
9
- * ```
10
- * themeStringToObject('dark:dark light:light spacing:spacing');
11
- * // returns { dark: 'dark', light: 'light', spacing: 'spacing' }
12
- * ```
13
- */
14
- export declare const themeStringToObject: (themeState: string) => Partial<ThemeState>;