@atlaskit/tokens 0.10.27 → 0.10.29

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 (84) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/css/atlassian-dark.css +298 -2
  3. package/css/atlassian-legacy-dark.css +298 -2
  4. package/css/atlassian-legacy-light.css +298 -2
  5. package/css/atlassian-light.css +298 -2
  6. package/css/atlassian-spacing.css +3 -3
  7. package/dist/cjs/artifacts/palettes-raw/spacing-scale.js +3 -3
  8. package/dist/cjs/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  9. package/dist/cjs/artifacts/tokens-raw/atlassian-spacing.js +26 -50
  10. package/dist/cjs/artifacts/typescript/atlassian-spacing-token-default-values.js +2 -2
  11. package/dist/cjs/constants.js +4 -13
  12. package/dist/cjs/entry-points/spacing-raw.js +15 -0
  13. package/dist/cjs/get-token.js +1 -1
  14. package/dist/cjs/index.js +8 -0
  15. package/dist/cjs/palettes/spacing-scale.js +1 -1
  16. package/dist/cjs/set-global-theme.js +30 -4
  17. package/dist/cjs/theme-change-observer.js +3 -2
  18. package/dist/cjs/theme-config.js +95 -0
  19. package/dist/cjs/tokens/default/spacing/spacing.js +12 -24
  20. package/dist/cjs/version.json +1 -1
  21. package/dist/es2019/artifacts/palettes-raw/spacing-scale.js +3 -3
  22. package/dist/es2019/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  23. package/dist/es2019/artifacts/tokens-raw/atlassian-spacing.js +26 -50
  24. package/dist/es2019/artifacts/typescript/atlassian-spacing-token-default-values.js +2 -2
  25. package/dist/es2019/artifacts/typescript/atlassian-spacing-types-internal.js +0 -6
  26. package/dist/es2019/artifacts/typescript/atlassian-spacing-types.js +0 -6
  27. package/dist/es2019/constants.js +2 -10
  28. package/dist/es2019/entry-points/spacing-raw.js +1 -0
  29. package/dist/es2019/get-token.js +1 -1
  30. package/dist/es2019/index.js +1 -0
  31. package/dist/es2019/palettes/spacing-scale.js +1 -1
  32. package/dist/es2019/set-global-theme.js +25 -5
  33. package/dist/es2019/theme-change-observer.js +5 -3
  34. package/dist/es2019/theme-config.js +87 -0
  35. package/dist/es2019/tokens/default/spacing/spacing.js +12 -24
  36. package/dist/es2019/version.json +1 -1
  37. package/dist/esm/artifacts/palettes-raw/spacing-scale.js +3 -3
  38. package/dist/esm/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  39. package/dist/esm/artifacts/tokens-raw/atlassian-spacing.js +26 -50
  40. package/dist/esm/artifacts/typescript/atlassian-spacing-token-default-values.js +2 -2
  41. package/dist/esm/artifacts/typescript/atlassian-spacing-types-internal.js +0 -6
  42. package/dist/esm/artifacts/typescript/atlassian-spacing-types.js +0 -6
  43. package/dist/esm/constants.js +2 -10
  44. package/dist/esm/entry-points/spacing-raw.js +1 -0
  45. package/dist/esm/get-token.js +1 -1
  46. package/dist/esm/index.js +1 -0
  47. package/dist/esm/palettes/spacing-scale.js +1 -1
  48. package/dist/esm/set-global-theme.js +28 -5
  49. package/dist/esm/theme-change-observer.js +5 -3
  50. package/dist/esm/theme-config.js +87 -0
  51. package/dist/esm/tokens/default/spacing/spacing.js +12 -24
  52. package/dist/esm/version.json +1 -1
  53. package/dist/types/artifacts/palettes-raw/spacing-scale.d.ts +1 -1
  54. package/dist/types/artifacts/rename-mapping/atlassian-spacing.d.ts +1 -1
  55. package/dist/types/artifacts/token-default-values.d.ts +1 -1
  56. package/dist/types/artifacts/tokens-raw/atlassian-spacing.d.ts +26 -3
  57. package/dist/types/artifacts/typescript/atlassian-spacing-token-default-values.d.ts +2 -2
  58. package/dist/types/artifacts/typescript/atlassian-spacing-types-internal.d.ts +2 -2
  59. package/dist/types/artifacts/typescript/atlassian-spacing-types.d.ts +2 -2
  60. package/dist/types/constants.d.ts +1 -8
  61. package/dist/types/entry-points/spacing-raw.d.ts +1 -0
  62. package/dist/types/index.d.ts +2 -1
  63. package/dist/types/set-global-theme.d.ts +2 -2
  64. package/dist/types/theme-change-observer.d.ts +4 -3
  65. package/dist/types/theme-config.d.ts +53 -0
  66. package/dist/types/types.d.ts +0 -3
  67. package/dist/types-ts4.0/artifacts/palettes-raw/spacing-scale.d.ts +1 -1
  68. package/dist/types-ts4.0/artifacts/rename-mapping/atlassian-spacing.d.ts +1 -1
  69. package/dist/types-ts4.0/artifacts/token-default-values.d.ts +1 -1
  70. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-spacing.d.ts +26 -3
  71. package/dist/types-ts4.0/artifacts/typescript/atlassian-spacing-token-default-values.d.ts +2 -2
  72. package/dist/types-ts4.0/artifacts/typescript/atlassian-spacing-types-internal.d.ts +2 -2
  73. package/dist/types-ts4.0/artifacts/typescript/atlassian-spacing-types.d.ts +2 -2
  74. package/dist/types-ts4.0/constants.d.ts +1 -14
  75. package/dist/types-ts4.0/entry-points/spacing-raw.d.ts +1 -0
  76. package/dist/types-ts4.0/index.d.ts +2 -1
  77. package/dist/types-ts4.0/set-global-theme.d.ts +2 -2
  78. package/dist/types-ts4.0/theme-change-observer.d.ts +4 -3
  79. package/dist/types-ts4.0/theme-config.d.ts +53 -0
  80. package/dist/types-ts4.0/types.d.ts +0 -3
  81. package/package.json +3 -1
  82. package/report.api.md +51 -14
  83. package/spacing-raw/package.json +17 -0
  84. package/tmp/api-report-tmp.d.ts +36 -8
@@ -0,0 +1,53 @@
1
+ /**
2
+ * This file contains the source of truth for themes and all associated meta data.
3
+ */
4
+ /**
5
+ * Themes: The internal identifier of a theme.
6
+ * These ids are what the actual theme files/folders are called.
7
+ * style-dictionary will attempt to locate these in the file-system.
8
+ */
9
+ export declare type Themes = 'atlassian-light' | 'atlassian-dark' | 'atlassian-legacy-light' | 'atlassian-legacy-dark' | 'atlassian-spacing';
10
+ export declare type ThemeFileNames = Themes;
11
+ /**
12
+ * Theme kinds: The type of theme.
13
+ * Some themes are entirely focused on Color, whilst others are purely focused on spacing.
14
+ * In the future other types may be introduced such as typography.
15
+ */
16
+ export declare type ThemeKinds = 'color' | 'spacing';
17
+ /**
18
+ * Theme modes: The general purpose of a theme.
19
+ * This attr is used to apply the appropriate system-preference media selector
20
+ * It may also be used as a selector for mode-specific overrides such as light/dark images.
21
+ * The idea is there may exist many color themes, but every theme must either fit into light or dark.
22
+ */
23
+ export declare type ThemeColorModes = 'light' | 'dark';
24
+ /**
25
+ * Theme ids: The value that will mounted to the DOM as a data attr
26
+ * For example: `data-theme="light"
27
+ *
28
+ * These ids must be kebab case
29
+ */
30
+ export declare type ThemeIds = 'light' | 'dark' | 'legacy-light' | 'legacy-dark' | 'spacing';
31
+ /**
32
+ * Palettes: The set of base tokens a given theme may be populated with.
33
+ * For example: legacy light & dark themes use the "legacyPalette" containing colors from our
34
+ * previous color set.
35
+ */
36
+ export declare type Palettes = 'defaultPalette' | 'legacyPalette' | 'spacingScale';
37
+ /**
38
+ * ThemeConfig: the source of truth for all theme meta-data.
39
+ * This object should be used whenever interfacing with themes.
40
+ */
41
+ interface ThemeConfig {
42
+ id: ThemeIds;
43
+ displayName: string;
44
+ palette: Palettes;
45
+ attributes: {
46
+ type: 'color';
47
+ mode: ThemeColorModes;
48
+ } | {
49
+ type: 'spacing';
50
+ };
51
+ }
52
+ declare const themeConfig: Record<Themes, ThemeConfig>;
53
+ export default themeConfig;
@@ -1,5 +1,4 @@
1
1
  import { InternalTokenIds } from './artifacts/types-internal';
2
- import { THEME_NAME_MAP, THEMES } from './constants';
3
2
  export declare type Groups = 'raw' | 'paint' | 'shadow' | 'palette' | 'opacity' | 'spacing' | 'scale';
4
3
  export declare type ActiveTokenState = 'active';
5
4
  export declare type DeprecatedTokenState = 'deprecated';
@@ -10,8 +9,6 @@ export declare type Replacement = InternalTokenIds | InternalTokenIds[];
10
9
  export declare type ExperimentalReplacement = InternalTokenIds | InternalTokenIds[] | string;
11
10
  export declare type PaletteCategory = 'blue' | 'purple' | 'red' | 'magenta' | 'orange' | 'yellow' | 'green' | 'teal' | 'light mode neutral' | 'dark mode neutral';
12
11
  export declare type ValueCategory = 'opacity';
13
- export declare type Themes = typeof THEMES[number];
14
- export declare type ThemesLongName = keyof typeof THEME_NAME_MAP;
15
12
  export interface Token<TValue, Group extends Groups> {
16
13
  value: TValue;
17
14
  attributes: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.27",
3
+ "version": "0.10.29",
4
4
  "author": "Atlassian Pty Ltd",
5
5
  "description": "Design tokens are the single source of truth to name and store design decisions.",
6
6
  "license": "Apache-2.0",
@@ -8,6 +8,7 @@
8
8
  "registry": "https://registry.npmjs.org/"
9
9
  },
10
10
  "atlassian": {
11
+ "disableProductCI": true,
11
12
  "team": "Design System Team",
12
13
  "releaseModel": "continuous",
13
14
  "website": {
@@ -38,6 +39,7 @@
38
39
  "./tokens-raw": "./src/entry-points/tokens-raw.tsx",
39
40
  "./token-ids": "./src/entry-points/token-ids.tsx",
40
41
  "./token-names": "./src/entry-points/token-names.tsx",
42
+ "./spacing-raw": "./src/entry-points/spacing-raw.tsx",
41
43
  "./rename-mapping": "./src/entry-points/rename-mapping.tsx",
42
44
  "./babel-plugin": "./src/entry-points/babel-plugin.tsx",
43
45
  "./css/atlassian-light.css": "./css/atlassian-light.css",
package/report.api.md CHANGED
@@ -332,31 +332,68 @@ type CSSTokenMap_3 = {
332
332
  'spacing.scale.075': 'var(--ds-scale-075)';
333
333
  };
334
334
 
335
+ // @public
336
+ type Palettes = 'defaultPalette' | 'legacyPalette' | 'spacingScale';
337
+
338
+ // @public (undocumented)
339
+ export const setGlobalTheme: (
340
+ themeId: ThemeIds,
341
+ shouldMatchSystem?: boolean,
342
+ ) => void;
343
+
344
+ // @public
345
+ type ThemeColorModes = 'dark' | 'light';
346
+
347
+ // @public
348
+ interface ThemeConfig {
349
+ // (undocumented)
350
+ attributes:
351
+ | {
352
+ type: 'color';
353
+ mode: ThemeColorModes;
354
+ }
355
+ | {
356
+ type: 'spacing';
357
+ };
358
+ // (undocumented)
359
+ displayName: string;
360
+ // (undocumented)
361
+ id: ThemeIds;
362
+ // (undocumented)
363
+ palette: Palettes;
364
+ }
365
+
335
366
  // @public (undocumented)
336
- export const setGlobalTheme: (theme: Themes) => void;
367
+ export const themeConfig: Record<Themes, ThemeConfig>;
368
+
369
+ // @public
370
+ export type ThemeIds =
371
+ | 'dark'
372
+ | 'legacy-dark'
373
+ | 'legacy-light'
374
+ | 'light'
375
+ | 'spacing';
337
376
 
338
377
  // @public
339
378
  export class ThemeMutationObserver {
340
- constructor(callback: (theme: Themes | null) => unknown);
379
+ constructor(callback: (theme: ThemeIds | null) => unknown);
341
380
  // (undocumented)
342
381
  disconnect(): void;
343
382
  // (undocumented)
383
+ mediaObserver: any;
384
+ // (undocumented)
344
385
  observe(): void;
345
386
  // (undocumented)
346
387
  observer: MutationObserver | null;
347
388
  }
348
389
 
349
- // @public (undocumented)
350
- const THEMES: readonly [
351
- 'light',
352
- 'dark',
353
- 'legacy-light',
354
- 'legacy-dark',
355
- 'spacing',
356
- ];
357
-
358
- // @public (undocumented)
359
- export type Themes = typeof THEMES[number];
390
+ // @public
391
+ export type Themes =
392
+ | 'atlassian-dark'
393
+ | 'atlassian-legacy-dark'
394
+ | 'atlassian-legacy-light'
395
+ | 'atlassian-light'
396
+ | 'atlassian-spacing';
360
397
 
361
398
  // @public (undocumented)
362
399
  export function token<T extends keyof Tokens>(
@@ -676,7 +713,7 @@ const tokens: {
676
713
  };
677
714
 
678
715
  // @public
679
- export const useThemeObserver: () => Themes | null;
716
+ export const useThemeObserver: () => ThemeIds | null;
680
717
 
681
718
  // (No @packageDocumentation comment for this package)
682
719
  ```
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/tokens/spacing-raw",
3
+ "main": "../dist/cjs/entry-points/spacing-raw.js",
4
+ "module": "../dist/esm/entry-points/spacing-raw.js",
5
+ "module:es2019": "../dist/es2019/entry-points/spacing-raw.js",
6
+ "sideEffects": [
7
+ "**/*.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/spacing-raw.d.ts",
10
+ "typesVersions": {
11
+ ">=4.0 <4.5": {
12
+ "*": [
13
+ "../dist/types-ts4.0/entry-points/spacing-raw.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -322,25 +322,53 @@ type CSSTokenMap_3 = {
322
322
  'spacing.scale.075': 'var(--ds-scale-075)';
323
323
  };
324
324
 
325
+ // @public
326
+ type Palettes = 'defaultPalette' | 'legacyPalette' | 'spacingScale';
327
+
328
+ // @public (undocumented)
329
+ export const setGlobalTheme: (themeId: ThemeIds, shouldMatchSystem?: boolean) => void;
330
+
331
+ // @public
332
+ type ThemeColorModes = 'dark' | 'light';
333
+
334
+ // @public
335
+ interface ThemeConfig {
336
+ // (undocumented)
337
+ attributes: {
338
+ type: 'color';
339
+ mode: ThemeColorModes;
340
+ } | {
341
+ type: 'spacing';
342
+ };
343
+ // (undocumented)
344
+ displayName: string;
345
+ // (undocumented)
346
+ id: ThemeIds;
347
+ // (undocumented)
348
+ palette: Palettes;
349
+ }
350
+
325
351
  // @public (undocumented)
326
- export const setGlobalTheme: (theme: Themes) => void;
352
+ export const themeConfig: Record<Themes, ThemeConfig>;
353
+
354
+ // @public
355
+ export type ThemeIds = 'dark' | 'legacy-dark' | 'legacy-light' | 'light' | 'spacing';
327
356
 
328
357
  // @public
329
358
  export class ThemeMutationObserver {
330
- constructor(callback: (theme: Themes | null) => unknown);
359
+ constructor(callback: (theme: ThemeIds | null) => unknown);
331
360
  // (undocumented)
332
361
  disconnect(): void;
333
362
  // (undocumented)
363
+ mediaObserver: any;
364
+ // (undocumented)
334
365
  observe(): void;
335
366
  // (undocumented)
336
367
  observer: MutationObserver | null;
337
368
  }
338
369
 
339
- // @public (undocumented)
340
- const THEMES: readonly ["light", "dark", "legacy-light", "legacy-dark", "spacing"];
341
-
342
- // @public (undocumented)
343
- export type Themes = typeof THEMES[number];
370
+ // @public
371
+ export type Themes = 'atlassian-dark' | 'atlassian-legacy-dark' | 'atlassian-legacy-light' | 'atlassian-light' | 'atlassian-spacing';
344
372
 
345
373
  // @public (undocumented)
346
374
  export function token<T extends keyof Tokens>(path: T, fallback?: string): CSSTokenMap[T];
@@ -657,7 +685,7 @@ const tokens: {
657
685
  };
658
686
 
659
687
  // @public
660
- export const useThemeObserver: () => Themes | null;
688
+ export const useThemeObserver: () => ThemeIds | null;
661
689
 
662
690
  // (No @packageDocumentation comment for this package)
663
691