@atlaskit/tokens 1.49.0 → 1.50.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 (125) hide show
  1. package/CHANGELOG.md +1589 -1591
  2. package/README.md +14 -8
  3. package/codemods/css-to-design-tokens/lib/colors.tsx +47 -49
  4. package/codemods/css-to-design-tokens/lib/declaration.tsx +26 -26
  5. package/codemods/css-to-design-tokens/lib/legacy-colors.tsx +326 -326
  6. package/codemods/css-to-design-tokens/lib/meta.tsx +116 -122
  7. package/codemods/css-to-design-tokens/lib/tokens.tsx +28 -35
  8. package/codemods/css-to-design-tokens/lib/value.tsx +70 -72
  9. package/codemods/css-to-design-tokens/transform.tsx +68 -72
  10. package/codemods/hypermod.config.tsx +5 -5
  11. package/codemods/remove-fallbacks-color/transform.tsx +16 -18
  12. package/codemods/theme-to-design-tokens/transform.tsx +505 -588
  13. package/codemods/theme-to-design-tokens/utils/ast-meta.tsx +139 -147
  14. package/codemods/theme-to-design-tokens/utils/ast.tsx +23 -34
  15. package/codemods/theme-to-design-tokens/utils/color.tsx +25 -26
  16. package/codemods/theme-to-design-tokens/utils/css-utils.tsx +27 -30
  17. package/codemods/theme-to-design-tokens/utils/fuzzy-search.tsx +272 -290
  18. package/codemods/theme-to-design-tokens/utils/legacy-colors.tsx +224 -224
  19. package/codemods/theme-to-design-tokens/utils/named-colors.tsx +148 -148
  20. package/codemods/theme-to-design-tokens/utils/string-utils.tsx +10 -16
  21. package/codemods/utils/tokens.tsx +371 -371
  22. package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
  23. package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
  24. package/dist/cjs/artifacts/generated-pairs.js +1 -1
  25. package/dist/cjs/artifacts/palettes-raw/typography-palette.js +45 -30
  26. package/dist/cjs/artifacts/theme-import-map.js +1 -1
  27. package/dist/cjs/artifacts/themes/atlassian-typography-minor3.js +2 -2
  28. package/dist/cjs/artifacts/token-default-values.js +1 -1
  29. package/dist/cjs/artifacts/token-names.js +1 -1
  30. package/dist/cjs/artifacts/tokens-raw/atlassian-typography-adg3.js +20 -20
  31. package/dist/cjs/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -13
  32. package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
  33. package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
  34. package/dist/es2019/artifacts/generated-pairs.js +1 -1
  35. package/dist/es2019/artifacts/palettes-raw/typography-palette.js +45 -30
  36. package/dist/es2019/artifacts/theme-import-map.js +1 -1
  37. package/dist/es2019/artifacts/themes/atlassian-typography-minor3.js +2 -2
  38. package/dist/es2019/artifacts/token-default-values.js +1 -1
  39. package/dist/es2019/artifacts/token-names.js +1 -1
  40. package/dist/es2019/artifacts/tokens-raw/atlassian-typography-adg3.js +20 -20
  41. package/dist/es2019/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -13
  42. package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
  43. package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
  44. package/dist/esm/artifacts/generated-pairs.js +1 -1
  45. package/dist/esm/artifacts/palettes-raw/typography-palette.js +45 -30
  46. package/dist/esm/artifacts/theme-import-map.js +1 -1
  47. package/dist/esm/artifacts/themes/atlassian-typography-minor3.js +2 -2
  48. package/dist/esm/artifacts/token-default-values.js +1 -1
  49. package/dist/esm/artifacts/token-names.js +1 -1
  50. package/dist/esm/artifacts/tokens-raw/atlassian-typography-adg3.js +20 -20
  51. package/dist/esm/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -13
  52. package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +1 -1
  53. package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +1 -1
  54. package/dist/types/artifacts/generated-pairs.d.ts +1 -1
  55. package/dist/types/artifacts/palettes-raw/typography-palette.d.ts +1 -1
  56. package/dist/types/artifacts/theme-import-map.d.ts +2 -2
  57. package/dist/types/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
  58. package/dist/types/artifacts/token-default-values.d.ts +1 -1
  59. package/dist/types/artifacts/token-names.d.ts +1 -1
  60. package/dist/types/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +1 -1
  61. package/dist/types/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
  62. package/dist/types/artifacts/types-internal.d.ts +1 -1
  63. package/dist/types/artifacts/types.d.ts +1 -1
  64. package/dist/types/babel-plugin/plugin.d.ts +1 -1
  65. package/dist/types/custom-theme.d.ts +2 -2
  66. package/dist/types/enable-global-theme.d.ts +2 -2
  67. package/dist/types/entry-points/css-type-schema.codegen.d.ts +1 -1
  68. package/dist/types/entry-points/token-ids.d.ts +1 -1
  69. package/dist/types/get-global-theme.d.ts +1 -1
  70. package/dist/types/get-ssr-auto-script.d.ts +1 -1
  71. package/dist/types/get-theme-html-attrs.d.ts +1 -1
  72. package/dist/types/get-theme-styles.d.ts +1 -1
  73. package/dist/types/get-token.d.ts +1 -1
  74. package/dist/types/index.d.ts +1 -1
  75. package/dist/types/load-custom-theme-styles.d.ts +1 -1
  76. package/dist/types/set-global-theme.d.ts +2 -2
  77. package/dist/types/theme-state-transformer.d.ts +1 -1
  78. package/dist/types/utils/color-detection.d.ts +1 -1
  79. package/dist/types/utils/color-mode-listeners.d.ts +1 -1
  80. package/dist/types/utils/configure-page.d.ts +1 -1
  81. package/dist/types/utils/contrast-mode-listeners.d.ts +1 -1
  82. package/dist/types/utils/custom-theme-loading-utils.d.ts +1 -1
  83. package/dist/types/utils/custom-theme-token-contrast-check.d.ts +1 -1
  84. package/dist/types/utils/generate-custom-color-ramp.d.ts +2 -2
  85. package/dist/types/utils/get-increased-contrast-theme.d.ts +1 -1
  86. package/dist/types/utils/get-theme-preferences.d.ts +1 -1
  87. package/dist/types/utils/theme-loading.d.ts +1 -1
  88. package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +1 -1
  89. package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +1 -1
  90. package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
  91. package/dist/types-ts4.5/artifacts/palettes-raw/typography-palette.d.ts +1 -1
  92. package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +2 -2
  93. package/dist/types-ts4.5/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
  94. package/dist/types-ts4.5/artifacts/token-default-values.d.ts +1 -1
  95. package/dist/types-ts4.5/artifacts/token-names.d.ts +1 -1
  96. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +1 -1
  97. package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
  98. package/dist/types-ts4.5/artifacts/types-internal.d.ts +1 -1
  99. package/dist/types-ts4.5/artifacts/types.d.ts +1 -1
  100. package/dist/types-ts4.5/babel-plugin/plugin.d.ts +1 -1
  101. package/dist/types-ts4.5/custom-theme.d.ts +2 -2
  102. package/dist/types-ts4.5/enable-global-theme.d.ts +2 -2
  103. package/dist/types-ts4.5/entry-points/css-type-schema.codegen.d.ts +1 -1
  104. package/dist/types-ts4.5/entry-points/token-ids.d.ts +1 -1
  105. package/dist/types-ts4.5/get-global-theme.d.ts +1 -1
  106. package/dist/types-ts4.5/get-ssr-auto-script.d.ts +1 -1
  107. package/dist/types-ts4.5/get-theme-html-attrs.d.ts +1 -1
  108. package/dist/types-ts4.5/get-theme-styles.d.ts +1 -1
  109. package/dist/types-ts4.5/get-token.d.ts +1 -1
  110. package/dist/types-ts4.5/index.d.ts +1 -1
  111. package/dist/types-ts4.5/load-custom-theme-styles.d.ts +1 -1
  112. package/dist/types-ts4.5/set-global-theme.d.ts +2 -2
  113. package/dist/types-ts4.5/theme-state-transformer.d.ts +1 -1
  114. package/dist/types-ts4.5/utils/color-detection.d.ts +1 -1
  115. package/dist/types-ts4.5/utils/color-mode-listeners.d.ts +1 -1
  116. package/dist/types-ts4.5/utils/configure-page.d.ts +1 -1
  117. package/dist/types-ts4.5/utils/contrast-mode-listeners.d.ts +1 -1
  118. package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +1 -1
  119. package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +1 -1
  120. package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +2 -2
  121. package/dist/types-ts4.5/utils/get-increased-contrast-theme.d.ts +1 -1
  122. package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +1 -1
  123. package/dist/types-ts4.5/utils/theme-loading.d.ts +1 -1
  124. package/package.json +3 -5
  125. package/report.api.md +2071 -2090
@@ -1,4 +1,4 @@
1
- import { ThemeState } from './theme-config';
1
+ import { type ThemeState } from './theme-config';
2
2
  /**
3
3
  * Server-side rendering utility. Generates the valid HTML attributes for a given theme.
4
4
  * Note: this utility does not handle automatic theme switching.
@@ -1,4 +1,4 @@
1
- import { ThemeIdsWithOverrides, ThemeState } from './theme-config';
1
+ import { type ThemeIdsWithOverrides, type ThemeState } from './theme-config';
2
2
  export interface ThemeStyles {
3
3
  id: ThemeIdsWithOverrides;
4
4
  attrs: Record<string, string>;
@@ -1,4 +1,4 @@
1
- import tokens, { CSSTokenMap } from './artifacts/token-names';
1
+ import tokens, { type CSSTokenMap } from './artifacts/token-names';
2
2
  type Tokens = typeof tokens;
3
3
  /**
4
4
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
@@ -9,7 +9,7 @@ export { default as getSSRAutoScript } from './get-ssr-auto-script';
9
9
  export { default as useThemeObserver } from './use-theme-observer';
10
10
  export { default as ThemeMutationObserver } from './theme-mutation-observer';
11
11
  export { default as getGlobalTheme } from './get-global-theme';
12
- export { themeStringToObject, themeObjectToString, } from './theme-state-transformer';
12
+ export { themeStringToObject, themeObjectToString } from './theme-state-transformer';
13
13
  export type { CSSToken } from './artifacts/token-names';
14
14
  export type { ActiveTokens } from './artifacts/types';
15
15
  export type { ThemeColorModes, Themes, ThemeFileNames, ThemeIds, ThemeOptionsSchema, ThemeState, } from './theme-config';
@@ -1,4 +1,4 @@
1
- import { ThemeState } from './theme-config';
1
+ import { type ThemeState } from './theme-config';
2
2
  /**
3
3
  * Synchronously generates and applies custom theme styles to the page.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { UnbindFn } from 'bind-event-listener';
2
- import { ThemeIdsWithOverrides, ThemeState } from './theme-config';
1
+ import { type UnbindFn } from 'bind-event-listener';
2
+ import { type ThemeIdsWithOverrides, type ThemeState } from './theme-config';
3
3
  /**
4
4
  * Sets the theme globally at runtime. This updates the `data-theme` and `data-color-mode` attributes on your page's <html> tag.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { ThemeState } from './theme-config';
1
+ import { type ThemeState } from './theme-config';
2
2
  /**
3
3
  * Converts a string that is formatted for the `data-theme` HTML attribute
4
4
  * to an object that can be passed to `setGlobalTheme`.
@@ -1,4 +1,4 @@
1
- import { ShadowToken } from '../types';
1
+ import { type ShadowToken } from '../types';
2
2
  export declare const hexToRGBAValues: (hex: string) => {
3
3
  r: number;
4
4
  g: number;
@@ -1,4 +1,4 @@
1
- import { UnbindFn } from 'bind-event-listener';
1
+ import { type UnbindFn } from 'bind-event-listener';
2
2
  declare class ColorModeObserver {
3
3
  unbindThemeChangeListener: UnbindFn | null;
4
4
  getColorMode(): "light" | "dark";
@@ -1,4 +1,4 @@
1
- import { ThemeState } from '../theme-config';
1
+ import { type ThemeState } from '../theme-config';
2
2
  /**
3
3
  * Given ThemeState, sets appropriate html attributes on the documentElement,
4
4
  * adds a listener to keep colorMode updated, and returns a function to unbind.
@@ -1,4 +1,4 @@
1
- import { UnbindFn } from 'bind-event-listener';
1
+ import { type UnbindFn } from 'bind-event-listener';
2
2
  declare class ContrastModeObserver {
3
3
  unbindContrastChangeListener: UnbindFn | null;
4
4
  getContrastMode(): "more" | "no-preference";
@@ -1,5 +1,5 @@
1
1
  import tokens from '../artifacts/token-names';
2
- import { ThemeColorModes, ThemeOptionsSchema } from '../theme-config';
2
+ import { type ThemeColorModes, type ThemeOptionsSchema } from '../theme-config';
3
3
  type Token = keyof typeof tokens;
4
4
  type ThemeAttributeId = 'light' | 'dark';
5
5
  export declare function findMissingCustomStyleElements(UNSAFE_themeOptions: ThemeOptionsSchema, mode: ThemeColorModes): ThemeAttributeId[];
@@ -1,4 +1,4 @@
1
- import tokens from '../artifacts/token-names';
1
+ import type tokens from '../artifacts/token-names';
2
2
  type Token = keyof typeof tokens;
3
3
  interface AdditionalContrastCheck {
4
4
  foreground: Token;
@@ -1,5 +1,5 @@
1
- import tokens from '../artifacts/token-names';
2
- import { CSSColor, ThemeColorModes } from '../theme-config';
1
+ import type tokens from '../artifacts/token-names';
2
+ import { type CSSColor, type ThemeColorModes } from '../theme-config';
3
3
  type Token = keyof typeof tokens;
4
4
  type TokenMap = {
5
5
  [key in Token]?: number | string;
@@ -1,4 +1,4 @@
1
- import { ThemeIds, ThemeOverrideIds } from '../theme-config';
1
+ import { type ThemeIds, type ThemeOverrideIds } from '../theme-config';
2
2
  /**
3
3
  * Finds any matching increased contrast theme available for a selected theme.
4
4
  */
@@ -1,3 +1,3 @@
1
- import { ThemeIdsWithOverrides, ThemeState } from '../theme-config';
1
+ import { type ThemeIdsWithOverrides, type ThemeState } from '../theme-config';
2
2
  export declare const getThemePreferences: (themeState: ThemeState) => ThemeIdsWithOverrides[];
3
3
  export declare const getThemeOverridePreferences: (themeState: ThemeState) => ThemeIdsWithOverrides[];
@@ -1,4 +1,4 @@
1
- import { ThemeIdsWithOverrides } from '../theme-config';
1
+ import { type ThemeIdsWithOverrides } from '../theme-config';
2
2
  export declare const loadAndAppendThemeCss: (themeId: ThemeIdsWithOverrides) => Promise<void>;
3
3
  export declare const loadThemeCss: (themeId: ThemeIdsWithOverrides) => Promise<string>;
4
4
  export declare const darkModeMediaQuery = "(prefers-color-scheme: dark)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.49.0",
3
+ "version": "1.50.0",
4
4
  "description": "Design tokens are the single source of truth to name and store design decisions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,12 +49,11 @@
49
49
  "@af/accessibility-testing": "*",
50
50
  "@af/formatting": "*",
51
51
  "@atlaskit/calendar": "^14.2.0",
52
- "@atlaskit/checkbox": "^13.3.0",
52
+ "@atlaskit/checkbox": "^13.4.0",
53
53
  "@atlaskit/radio": "^6.3.0",
54
54
  "@atlaskit/textfield": "^6.3.0",
55
55
  "@atlaskit/tooltip": "^18.4.0",
56
56
  "@atlaskit/visual-regression": "*",
57
- "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
58
57
  "@atlassian/codegen": "^0.1.0",
59
58
  "@atlassian/feature-flags-test-utils": "*",
60
59
  "@babel/core": "^7.20.0",
@@ -136,6 +135,5 @@
136
135
  "type": "boolean"
137
136
  }
138
137
  },
139
- "homepage": "https://atlassian.design/components/tokens",
140
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
138
+ "homepage": "https://atlassian.design/components/tokens"
141
139
  }