@atlaskit/tokens 0.10.32 → 0.10.34

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 (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/css/atlassian-spacing.css +77 -77
  3. package/dist/cjs/artifacts/palettes-raw/spacing-scale.js +25 -25
  4. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +5 -5
  5. package/dist/cjs/artifacts/tokens-raw/atlassian-spacing.js +77 -77
  6. package/dist/cjs/artifacts/typescript/atlassian-spacing-token-default-values.js +77 -77
  7. package/dist/cjs/get-token.js +23 -2
  8. package/dist/cjs/palettes/spacing-scale.js +12 -12
  9. package/dist/cjs/set-global-theme.js +12 -0
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/artifacts/palettes-raw/spacing-scale.js +25 -25
  12. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +5 -5
  13. package/dist/es2019/artifacts/tokens-raw/atlassian-spacing.js +77 -77
  14. package/dist/es2019/artifacts/typescript/atlassian-spacing-token-default-values.js +77 -77
  15. package/dist/es2019/get-token.js +22 -1
  16. package/dist/es2019/palettes/spacing-scale.js +12 -12
  17. package/dist/es2019/set-global-theme.js +12 -0
  18. package/dist/es2019/version.json +1 -1
  19. package/dist/esm/artifacts/palettes-raw/spacing-scale.js +25 -25
  20. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +5 -5
  21. package/dist/esm/artifacts/tokens-raw/atlassian-spacing.js +77 -77
  22. package/dist/esm/artifacts/typescript/atlassian-spacing-token-default-values.js +77 -77
  23. package/dist/esm/get-token.js +22 -1
  24. package/dist/esm/palettes/spacing-scale.js +12 -12
  25. package/dist/esm/set-global-theme.js +12 -0
  26. package/dist/esm/version.json +1 -1
  27. package/dist/types/artifacts/palettes-raw/spacing-scale.d.ts +1 -1
  28. package/dist/types/artifacts/token-default-values.d.ts +76 -76
  29. package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
  30. package/dist/types/artifacts/tokens-raw/atlassian-spacing.d.ts +1 -1
  31. package/dist/types/artifacts/typescript/atlassian-spacing-token-default-values.d.ts +77 -77
  32. package/dist/types/get-token.d.ts +21 -0
  33. package/dist/types/set-global-theme.d.ts +12 -0
  34. package/dist/types-ts4.0/artifacts/palettes-raw/spacing-scale.d.ts +1 -1
  35. package/dist/types-ts4.0/artifacts/token-default-values.d.ts +76 -76
  36. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
  37. package/dist/types-ts4.0/artifacts/tokens-raw/atlassian-spacing.d.ts +1 -1
  38. package/dist/types-ts4.0/artifacts/typescript/atlassian-spacing-token-default-values.d.ts +77 -77
  39. package/dist/types-ts4.0/get-token.d.ts +21 -0
  40. package/dist/types-ts4.0/set-global-theme.d.ts +12 -0
  41. package/package.json +1 -1
  42. package/report.api.md +2 -2
  43. package/tmp/api-report-tmp.d.ts +2 -2
@@ -4,85 +4,85 @@
4
4
  * Token names mapped to their value in the default Atlassian themes ('light spacing').
5
5
  * These default values are used by the Babel plugin to optionally provide automatic fallbacks.
6
6
  *
7
- * @codegen <<SignedSource::05c2fcc3d0dba0931605dc98f7540009>>
7
+ * @codegen <<SignedSource::070fc18ba91d3a0673dcabb4f936f8d9>>
8
8
  * @codegenCommand yarn build tokens
9
9
  */
10
10
  declare const defaultTokenValues: {
11
- readonly 'spacing.scale.0': "0px";
12
- readonly 'spacing.scale.100': "8px";
13
- readonly 'spacing.scale.150': "12px";
14
- readonly 'spacing.scale.200': "16px";
15
- readonly 'spacing.scale.250': "20px";
16
- readonly 'spacing.scale.300': "24px";
17
- readonly 'spacing.scale.400': "32px";
18
- readonly 'spacing.scale.500': "40px";
19
- readonly 'spacing.scale.600': "48px";
20
- readonly 'spacing.scale.025': "2px";
21
- readonly 'spacing.scale.050': "4px";
22
- readonly 'spacing.scale.075': "6px";
23
- readonly 'spacing.scaleLinear.0': "0px";
24
- readonly 'spacing.scaleLinear.100': "2px";
25
- readonly 'spacing.scaleLinear.200': "4px";
26
- readonly 'spacing.scaleLinear.300': "6px";
27
- readonly 'spacing.scaleLinear.400': "8px";
28
- readonly 'spacing.scaleLinear.500': "12px";
29
- readonly 'spacing.scaleLinear.600': "16px";
30
- readonly 'spacing.scaleLinear.700': "20px";
31
- readonly 'spacing.scaleLinear.800': "24px";
32
- readonly 'spacing.scaleLinear.900': "32px";
33
- readonly 'spacing.scaleLinear.1000': "40px";
34
- readonly 'spacing.scaleLinear.1100': "48px";
35
- readonly 'spacing.pixel.0': "0px";
36
- readonly 'spacing.pixel.2': "2px";
37
- readonly 'spacing.pixel.4': "4px";
38
- readonly 'spacing.pixel.6': "6px";
39
- readonly 'spacing.pixel.8': "8px";
40
- readonly 'spacing.pixel.12': "12px";
41
- readonly 'spacing.pixel.16': "16px";
42
- readonly 'spacing.pixel.20': "20px";
43
- readonly 'spacing.pixel.24': "24px";
44
- readonly 'spacing.pixel.32': "32px";
45
- readonly 'spacing.pixel.40': "40px";
46
- readonly 'spacing.pixel.48': "48px";
47
- readonly 'spacing.size.none': "0px";
48
- readonly 'spacing.size.xxxxSmall': "2px";
49
- readonly 'spacing.size.xxxSmall': "4px";
50
- readonly 'spacing.size.xxSmall': "6px";
51
- readonly 'spacing.size.xsmall': "8px";
52
- readonly 'spacing.size.small': "12px";
53
- readonly 'spacing.size.medium': "16px";
54
- readonly 'spacing.size.large': "20px";
55
- readonly 'spacing.size.xlarge': "24px";
56
- readonly 'spacing.size.xxlarge': "32px";
57
- readonly 'spacing.size.xxxlarge': "40px";
58
- readonly 'spacing.size.xxxxlarge': "48px";
59
- readonly 'spacing.ecl.element.2': "2px";
60
- readonly 'spacing.ecl.element.4': "4px";
61
- readonly 'spacing.ecl.element.6': "6px";
62
- readonly 'spacing.ecl.element.8': "8px";
63
- readonly 'spacing.ecl.container.12': "12px";
64
- readonly 'spacing.ecl.container.16': "16px";
65
- readonly 'spacing.ecl.container.20': "20px";
66
- readonly 'spacing.ecl.container.24': "24px";
67
- readonly 'spacing.ecl.layout.32': "32px";
68
- readonly 'spacing.ecl.layout.40': "40px";
69
- readonly 'spacing.ecl.layout.64': "48px";
70
- readonly 'spacing.ccc.component.2': "2px";
71
- readonly 'spacing.ccc.component.4': "4px";
72
- readonly 'spacing.ccc.component.6': "6px";
73
- readonly 'spacing.ccc.component.8': "8px";
74
- readonly 'spacing.ccc.content.12': "12px";
75
- readonly 'spacing.ccc.content.16': "16px";
76
- readonly 'spacing.ccc.content.20': "20px";
77
- readonly 'spacing.ccc.content.24': "24px";
78
- readonly 'spacing.ccc.container.32': "32px";
79
- readonly 'spacing.ccc.container.40': "40px";
80
- readonly 'spacing.ccc.container.48': "48px";
81
- readonly 'spacing.gap.100': "8px";
82
- readonly 'spacing.gap.200': "16px";
83
- readonly 'spacing.gap.300': "24px";
84
- readonly 'spacing.inset.100': "8px";
85
- readonly 'spacing.inset.200': "16px";
86
- readonly 'spacing.inset.300': "24px";
11
+ readonly 'spacing.scale.0': "0";
12
+ readonly 'spacing.scale.100': "0.5rem";
13
+ readonly 'spacing.scale.150': "0.75rem";
14
+ readonly 'spacing.scale.200': "1rem";
15
+ readonly 'spacing.scale.250': "1.25rem";
16
+ readonly 'spacing.scale.300': "1.5rem";
17
+ readonly 'spacing.scale.400': "2rem";
18
+ readonly 'spacing.scale.500': "2.5rem";
19
+ readonly 'spacing.scale.600': "3rem";
20
+ readonly 'spacing.scale.025': "0.125rem";
21
+ readonly 'spacing.scale.050': "0.25rem";
22
+ readonly 'spacing.scale.075': "0.375rem";
23
+ readonly 'spacing.scaleLinear.0': "0";
24
+ readonly 'spacing.scaleLinear.100': "0.125rem";
25
+ readonly 'spacing.scaleLinear.200': "0.25rem";
26
+ readonly 'spacing.scaleLinear.300': "0.375rem";
27
+ readonly 'spacing.scaleLinear.400': "0.5rem";
28
+ readonly 'spacing.scaleLinear.500': "0.75rem";
29
+ readonly 'spacing.scaleLinear.600': "1rem";
30
+ readonly 'spacing.scaleLinear.700': "1.25rem";
31
+ readonly 'spacing.scaleLinear.800': "1.5rem";
32
+ readonly 'spacing.scaleLinear.900': "2rem";
33
+ readonly 'spacing.scaleLinear.1000': "2.5rem";
34
+ readonly 'spacing.scaleLinear.1100': "3rem";
35
+ readonly 'spacing.pixel.0': "0";
36
+ readonly 'spacing.pixel.2': "0.125rem";
37
+ readonly 'spacing.pixel.4': "0.25rem";
38
+ readonly 'spacing.pixel.6': "0.375rem";
39
+ readonly 'spacing.pixel.8': "0.5rem";
40
+ readonly 'spacing.pixel.12': "0.75rem";
41
+ readonly 'spacing.pixel.16': "1rem";
42
+ readonly 'spacing.pixel.20': "1.25rem";
43
+ readonly 'spacing.pixel.24': "1.5rem";
44
+ readonly 'spacing.pixel.32': "2rem";
45
+ readonly 'spacing.pixel.40': "2.5rem";
46
+ readonly 'spacing.pixel.48': "3rem";
47
+ readonly 'spacing.size.none': "0";
48
+ readonly 'spacing.size.xxxxSmall': "0.125rem";
49
+ readonly 'spacing.size.xxxSmall': "0.25rem";
50
+ readonly 'spacing.size.xxSmall': "0.375rem";
51
+ readonly 'spacing.size.xsmall': "0.5rem";
52
+ readonly 'spacing.size.small': "0.75rem";
53
+ readonly 'spacing.size.medium': "1rem";
54
+ readonly 'spacing.size.large': "1.25rem";
55
+ readonly 'spacing.size.xlarge': "1.5rem";
56
+ readonly 'spacing.size.xxlarge': "2rem";
57
+ readonly 'spacing.size.xxxlarge': "2.5rem";
58
+ readonly 'spacing.size.xxxxlarge': "3rem";
59
+ readonly 'spacing.ecl.element.2': "0.125rem";
60
+ readonly 'spacing.ecl.element.4': "0.25rem";
61
+ readonly 'spacing.ecl.element.6': "0.375rem";
62
+ readonly 'spacing.ecl.element.8': "0.5rem";
63
+ readonly 'spacing.ecl.container.12': "0.75rem";
64
+ readonly 'spacing.ecl.container.16': "1rem";
65
+ readonly 'spacing.ecl.container.20': "1.25rem";
66
+ readonly 'spacing.ecl.container.24': "1.5rem";
67
+ readonly 'spacing.ecl.layout.32': "2rem";
68
+ readonly 'spacing.ecl.layout.40': "2.5rem";
69
+ readonly 'spacing.ecl.layout.64': "3rem";
70
+ readonly 'spacing.ccc.component.2': "0.125rem";
71
+ readonly 'spacing.ccc.component.4': "0.25rem";
72
+ readonly 'spacing.ccc.component.6': "0.375rem";
73
+ readonly 'spacing.ccc.component.8': "0.5rem";
74
+ readonly 'spacing.ccc.content.12': "0.75rem";
75
+ readonly 'spacing.ccc.content.16': "1rem";
76
+ readonly 'spacing.ccc.content.20': "1.25rem";
77
+ readonly 'spacing.ccc.content.24': "1.5rem";
78
+ readonly 'spacing.ccc.container.32': "2rem";
79
+ readonly 'spacing.ccc.container.40': "2.5rem";
80
+ readonly 'spacing.ccc.container.48': "3rem";
81
+ readonly 'spacing.gap.100': "0.5rem";
82
+ readonly 'spacing.gap.200': "1rem";
83
+ readonly 'spacing.gap.300': "1.5rem";
84
+ readonly 'spacing.inset.100': "0.5rem";
85
+ readonly 'spacing.inset.200': "1rem";
86
+ readonly 'spacing.inset.300': "1.5rem";
87
87
  };
88
88
  export default defaultTokenValues;
@@ -1,4 +1,25 @@
1
1
  import tokens, { CSSTokenMap } from './artifacts/token-names';
2
2
  declare type Tokens = typeof tokens;
3
+ /**
4
+ * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
5
+ * This should be used to implement design decisions throughout your application.
6
+ *
7
+ * Note: With `@atlaskit/babel-plugin-tokens`, this function can be pre-compiled and a fallback value automatically inserted.
8
+ *
9
+ * @param {string} path - A dot-separated token name (example: `'color.background.brand'` or `'spacing.scale.100'`).
10
+ * @param {string} [fallback] - The fallback value that should render when token CSS is not present in your app.
11
+ *
12
+ * @example
13
+ * ```
14
+ * <div
15
+ * css={{
16
+ * backgroundColor: token('elevation.surface.raised', N0),
17
+ * boxShadow: token('elevation.shadow.raised', `0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`),
18
+ * padding: token('spacing.scale.100', '8px'),
19
+ * }}
20
+ * />
21
+ * ```
22
+ *
23
+ */
3
24
  declare function token<T extends keyof Tokens>(path: T, fallback?: string): CSSTokenMap[T];
4
25
  export default token;
@@ -1,3 +1,15 @@
1
1
  import { ThemeIds } from './theme-config';
2
+ /**
3
+ * Sets the theme globally at runtime. This updates the `data-theme` and `data-color-scheme` attributes on your page's <html> tag.
4
+ *
5
+ * @param {string} themeId - Which theme should be used by default.
6
+ * @param {string} [shouldMatchSystem=false] - Whether the theme should automatically switch between themes to match the system preference.
7
+ *
8
+ * @example
9
+ * ```
10
+ * // Set light theme as the default theme, but switch to others based on the system color theme.
11
+ * setGlobalTheme('light', true);
12
+ * ```
13
+ */
2
14
  declare const setGlobalTheme: (themeId: ThemeIds, shouldMatchSystem?: boolean) => void;
3
15
  export default setGlobalTheme;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::9ec4d3766ad54f86aa1d9891b0f32317>>
3
+ * @codegen <<SignedSource::e1fc16f85d9f95330fadb08536a38997>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  declare const tokens: {
@@ -1,80 +1,80 @@
1
1
  declare const defaultTokens: {
2
- 'spacing.scale.0': "0px";
3
- 'spacing.scale.100': "8px";
4
- 'spacing.scale.150': "12px";
5
- 'spacing.scale.200': "16px";
6
- 'spacing.scale.250': "20px";
7
- 'spacing.scale.300': "24px";
8
- 'spacing.scale.400': "32px";
9
- 'spacing.scale.500': "40px";
10
- 'spacing.scale.600': "48px";
11
- 'spacing.scale.025': "2px";
12
- 'spacing.scale.050': "4px";
13
- 'spacing.scale.075': "6px";
14
- 'spacing.scaleLinear.0': "0px";
15
- 'spacing.scaleLinear.100': "2px";
16
- 'spacing.scaleLinear.200': "4px";
17
- 'spacing.scaleLinear.300': "6px";
18
- 'spacing.scaleLinear.400': "8px";
19
- 'spacing.scaleLinear.500': "12px";
20
- 'spacing.scaleLinear.600': "16px";
21
- 'spacing.scaleLinear.700': "20px";
22
- 'spacing.scaleLinear.800': "24px";
23
- 'spacing.scaleLinear.900': "32px";
24
- 'spacing.scaleLinear.1000': "40px";
25
- 'spacing.scaleLinear.1100': "48px";
26
- 'spacing.pixel.0': "0px";
27
- 'spacing.pixel.2': "2px";
28
- 'spacing.pixel.4': "4px";
29
- 'spacing.pixel.6': "6px";
30
- 'spacing.pixel.8': "8px";
31
- 'spacing.pixel.12': "12px";
32
- 'spacing.pixel.16': "16px";
33
- 'spacing.pixel.20': "20px";
34
- 'spacing.pixel.24': "24px";
35
- 'spacing.pixel.32': "32px";
36
- 'spacing.pixel.40': "40px";
37
- 'spacing.pixel.48': "48px";
38
- 'spacing.size.none': "0px";
39
- 'spacing.size.xxxxSmall': "2px";
40
- 'spacing.size.xxxSmall': "4px";
41
- 'spacing.size.xxSmall': "6px";
42
- 'spacing.size.xsmall': "8px";
43
- 'spacing.size.small': "12px";
44
- 'spacing.size.medium': "16px";
45
- 'spacing.size.large': "20px";
46
- 'spacing.size.xlarge': "24px";
47
- 'spacing.size.xxlarge': "32px";
48
- 'spacing.size.xxxlarge': "40px";
49
- 'spacing.size.xxxxlarge': "48px";
50
- 'spacing.ecl.element.2': "2px";
51
- 'spacing.ecl.element.4': "4px";
52
- 'spacing.ecl.element.6': "6px";
53
- 'spacing.ecl.element.8': "8px";
54
- 'spacing.ecl.container.12': "12px";
55
- 'spacing.ecl.container.16': "16px";
56
- 'spacing.ecl.container.20': "20px";
57
- 'spacing.ecl.container.24': "24px";
58
- 'spacing.ecl.layout.32': "32px";
59
- 'spacing.ecl.layout.40': "40px";
60
- 'spacing.ecl.layout.64': "48px";
61
- 'spacing.ccc.component.2': "2px";
62
- 'spacing.ccc.component.4': "4px";
63
- 'spacing.ccc.component.6': "6px";
64
- 'spacing.ccc.component.8': "8px";
65
- 'spacing.ccc.content.12': "12px";
66
- 'spacing.ccc.content.16': "16px";
67
- 'spacing.ccc.content.20': "20px";
68
- 'spacing.ccc.content.24': "24px";
69
- 'spacing.ccc.container.32': "32px";
70
- 'spacing.ccc.container.40': "40px";
71
- 'spacing.ccc.container.48': "48px";
72
- 'spacing.gap.100': "8px";
73
- 'spacing.gap.200': "16px";
74
- 'spacing.gap.300': "24px";
75
- 'spacing.inset.100': "8px";
76
- 'spacing.inset.200': "16px";
77
- 'spacing.inset.300': "24px";
2
+ 'spacing.scale.0': "0";
3
+ 'spacing.scale.100': "0.5rem";
4
+ 'spacing.scale.150': "0.75rem";
5
+ 'spacing.scale.200': "1rem";
6
+ 'spacing.scale.250': "1.25rem";
7
+ 'spacing.scale.300': "1.5rem";
8
+ 'spacing.scale.400': "2rem";
9
+ 'spacing.scale.500': "2.5rem";
10
+ 'spacing.scale.600': "3rem";
11
+ 'spacing.scale.025': "0.125rem";
12
+ 'spacing.scale.050': "0.25rem";
13
+ 'spacing.scale.075': "0.375rem";
14
+ 'spacing.scaleLinear.0': "0";
15
+ 'spacing.scaleLinear.100': "0.125rem";
16
+ 'spacing.scaleLinear.200': "0.25rem";
17
+ 'spacing.scaleLinear.300': "0.375rem";
18
+ 'spacing.scaleLinear.400': "0.5rem";
19
+ 'spacing.scaleLinear.500': "0.75rem";
20
+ 'spacing.scaleLinear.600': "1rem";
21
+ 'spacing.scaleLinear.700': "1.25rem";
22
+ 'spacing.scaleLinear.800': "1.5rem";
23
+ 'spacing.scaleLinear.900': "2rem";
24
+ 'spacing.scaleLinear.1000': "2.5rem";
25
+ 'spacing.scaleLinear.1100': "3rem";
26
+ 'spacing.pixel.0': "0";
27
+ 'spacing.pixel.2': "0.125rem";
28
+ 'spacing.pixel.4': "0.25rem";
29
+ 'spacing.pixel.6': "0.375rem";
30
+ 'spacing.pixel.8': "0.5rem";
31
+ 'spacing.pixel.12': "0.75rem";
32
+ 'spacing.pixel.16': "1rem";
33
+ 'spacing.pixel.20': "1.25rem";
34
+ 'spacing.pixel.24': "1.5rem";
35
+ 'spacing.pixel.32': "2rem";
36
+ 'spacing.pixel.40': "2.5rem";
37
+ 'spacing.pixel.48': "3rem";
38
+ 'spacing.size.none': "0";
39
+ 'spacing.size.xxxxSmall': "0.125rem";
40
+ 'spacing.size.xxxSmall': "0.25rem";
41
+ 'spacing.size.xxSmall': "0.375rem";
42
+ 'spacing.size.xsmall': "0.5rem";
43
+ 'spacing.size.small': "0.75rem";
44
+ 'spacing.size.medium': "1rem";
45
+ 'spacing.size.large': "1.25rem";
46
+ 'spacing.size.xlarge': "1.5rem";
47
+ 'spacing.size.xxlarge': "2rem";
48
+ 'spacing.size.xxxlarge': "2.5rem";
49
+ 'spacing.size.xxxxlarge': "3rem";
50
+ 'spacing.ecl.element.2': "0.125rem";
51
+ 'spacing.ecl.element.4': "0.25rem";
52
+ 'spacing.ecl.element.6': "0.375rem";
53
+ 'spacing.ecl.element.8': "0.5rem";
54
+ 'spacing.ecl.container.12': "0.75rem";
55
+ 'spacing.ecl.container.16': "1rem";
56
+ 'spacing.ecl.container.20': "1.25rem";
57
+ 'spacing.ecl.container.24': "1.5rem";
58
+ 'spacing.ecl.layout.32': "2rem";
59
+ 'spacing.ecl.layout.40': "2.5rem";
60
+ 'spacing.ecl.layout.64': "3rem";
61
+ 'spacing.ccc.component.2': "0.125rem";
62
+ 'spacing.ccc.component.4': "0.25rem";
63
+ 'spacing.ccc.component.6': "0.375rem";
64
+ 'spacing.ccc.component.8': "0.5rem";
65
+ 'spacing.ccc.content.12': "0.75rem";
66
+ 'spacing.ccc.content.16': "1rem";
67
+ 'spacing.ccc.content.20': "1.25rem";
68
+ 'spacing.ccc.content.24': "1.5rem";
69
+ 'spacing.ccc.container.32': "2rem";
70
+ 'spacing.ccc.container.40': "2.5rem";
71
+ 'spacing.ccc.container.48': "3rem";
72
+ 'spacing.gap.100': "0.5rem";
73
+ 'spacing.gap.200': "1rem";
74
+ 'spacing.gap.300': "1.5rem";
75
+ 'spacing.inset.100': "0.5rem";
76
+ 'spacing.inset.200': "1rem";
77
+ 'spacing.inset.300': "1.5rem";
78
78
  'color.text.accent.blue': "#0055CC";
79
79
  'color.text.accent.blue.bolder': "#09326C";
80
80
  'color.text.accent.red': "#AE2A19";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::cebe4ed5e9e0dc70bed7437dafe3c98c>>
3
+ * @codegen <<SignedSource::e18ea502db6feafafab91d0838cfa797>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  declare const tokens: ({
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::3c9107056e9324e57c042a3aafb4188c>>
3
+ * @codegen <<SignedSource::9a19af105c0ae551ba258897b3438626>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  declare const tokens: ({
@@ -4,85 +4,85 @@
4
4
  * Token names mapped to their value in the default Atlassian themes ('light spacing').
5
5
  * These default values are used by the Babel plugin to optionally provide automatic fallbacks.
6
6
  *
7
- * @codegen <<SignedSource::05c2fcc3d0dba0931605dc98f7540009>>
7
+ * @codegen <<SignedSource::070fc18ba91d3a0673dcabb4f936f8d9>>
8
8
  * @codegenCommand yarn build tokens
9
9
  */
10
10
  declare const defaultTokenValues: {
11
- readonly 'spacing.scale.0': "0px";
12
- readonly 'spacing.scale.100': "8px";
13
- readonly 'spacing.scale.150': "12px";
14
- readonly 'spacing.scale.200': "16px";
15
- readonly 'spacing.scale.250': "20px";
16
- readonly 'spacing.scale.300': "24px";
17
- readonly 'spacing.scale.400': "32px";
18
- readonly 'spacing.scale.500': "40px";
19
- readonly 'spacing.scale.600': "48px";
20
- readonly 'spacing.scale.025': "2px";
21
- readonly 'spacing.scale.050': "4px";
22
- readonly 'spacing.scale.075': "6px";
23
- readonly 'spacing.scaleLinear.0': "0px";
24
- readonly 'spacing.scaleLinear.100': "2px";
25
- readonly 'spacing.scaleLinear.200': "4px";
26
- readonly 'spacing.scaleLinear.300': "6px";
27
- readonly 'spacing.scaleLinear.400': "8px";
28
- readonly 'spacing.scaleLinear.500': "12px";
29
- readonly 'spacing.scaleLinear.600': "16px";
30
- readonly 'spacing.scaleLinear.700': "20px";
31
- readonly 'spacing.scaleLinear.800': "24px";
32
- readonly 'spacing.scaleLinear.900': "32px";
33
- readonly 'spacing.scaleLinear.1000': "40px";
34
- readonly 'spacing.scaleLinear.1100': "48px";
35
- readonly 'spacing.pixel.0': "0px";
36
- readonly 'spacing.pixel.2': "2px";
37
- readonly 'spacing.pixel.4': "4px";
38
- readonly 'spacing.pixel.6': "6px";
39
- readonly 'spacing.pixel.8': "8px";
40
- readonly 'spacing.pixel.12': "12px";
41
- readonly 'spacing.pixel.16': "16px";
42
- readonly 'spacing.pixel.20': "20px";
43
- readonly 'spacing.pixel.24': "24px";
44
- readonly 'spacing.pixel.32': "32px";
45
- readonly 'spacing.pixel.40': "40px";
46
- readonly 'spacing.pixel.48': "48px";
47
- readonly 'spacing.size.none': "0px";
48
- readonly 'spacing.size.xxxxSmall': "2px";
49
- readonly 'spacing.size.xxxSmall': "4px";
50
- readonly 'spacing.size.xxSmall': "6px";
51
- readonly 'spacing.size.xsmall': "8px";
52
- readonly 'spacing.size.small': "12px";
53
- readonly 'spacing.size.medium': "16px";
54
- readonly 'spacing.size.large': "20px";
55
- readonly 'spacing.size.xlarge': "24px";
56
- readonly 'spacing.size.xxlarge': "32px";
57
- readonly 'spacing.size.xxxlarge': "40px";
58
- readonly 'spacing.size.xxxxlarge': "48px";
59
- readonly 'spacing.ecl.element.2': "2px";
60
- readonly 'spacing.ecl.element.4': "4px";
61
- readonly 'spacing.ecl.element.6': "6px";
62
- readonly 'spacing.ecl.element.8': "8px";
63
- readonly 'spacing.ecl.container.12': "12px";
64
- readonly 'spacing.ecl.container.16': "16px";
65
- readonly 'spacing.ecl.container.20': "20px";
66
- readonly 'spacing.ecl.container.24': "24px";
67
- readonly 'spacing.ecl.layout.32': "32px";
68
- readonly 'spacing.ecl.layout.40': "40px";
69
- readonly 'spacing.ecl.layout.64': "48px";
70
- readonly 'spacing.ccc.component.2': "2px";
71
- readonly 'spacing.ccc.component.4': "4px";
72
- readonly 'spacing.ccc.component.6': "6px";
73
- readonly 'spacing.ccc.component.8': "8px";
74
- readonly 'spacing.ccc.content.12': "12px";
75
- readonly 'spacing.ccc.content.16': "16px";
76
- readonly 'spacing.ccc.content.20': "20px";
77
- readonly 'spacing.ccc.content.24': "24px";
78
- readonly 'spacing.ccc.container.32': "32px";
79
- readonly 'spacing.ccc.container.40': "40px";
80
- readonly 'spacing.ccc.container.48': "48px";
81
- readonly 'spacing.gap.100': "8px";
82
- readonly 'spacing.gap.200': "16px";
83
- readonly 'spacing.gap.300': "24px";
84
- readonly 'spacing.inset.100': "8px";
85
- readonly 'spacing.inset.200': "16px";
86
- readonly 'spacing.inset.300': "24px";
11
+ readonly 'spacing.scale.0': "0";
12
+ readonly 'spacing.scale.100': "0.5rem";
13
+ readonly 'spacing.scale.150': "0.75rem";
14
+ readonly 'spacing.scale.200': "1rem";
15
+ readonly 'spacing.scale.250': "1.25rem";
16
+ readonly 'spacing.scale.300': "1.5rem";
17
+ readonly 'spacing.scale.400': "2rem";
18
+ readonly 'spacing.scale.500': "2.5rem";
19
+ readonly 'spacing.scale.600': "3rem";
20
+ readonly 'spacing.scale.025': "0.125rem";
21
+ readonly 'spacing.scale.050': "0.25rem";
22
+ readonly 'spacing.scale.075': "0.375rem";
23
+ readonly 'spacing.scaleLinear.0': "0";
24
+ readonly 'spacing.scaleLinear.100': "0.125rem";
25
+ readonly 'spacing.scaleLinear.200': "0.25rem";
26
+ readonly 'spacing.scaleLinear.300': "0.375rem";
27
+ readonly 'spacing.scaleLinear.400': "0.5rem";
28
+ readonly 'spacing.scaleLinear.500': "0.75rem";
29
+ readonly 'spacing.scaleLinear.600': "1rem";
30
+ readonly 'spacing.scaleLinear.700': "1.25rem";
31
+ readonly 'spacing.scaleLinear.800': "1.5rem";
32
+ readonly 'spacing.scaleLinear.900': "2rem";
33
+ readonly 'spacing.scaleLinear.1000': "2.5rem";
34
+ readonly 'spacing.scaleLinear.1100': "3rem";
35
+ readonly 'spacing.pixel.0': "0";
36
+ readonly 'spacing.pixel.2': "0.125rem";
37
+ readonly 'spacing.pixel.4': "0.25rem";
38
+ readonly 'spacing.pixel.6': "0.375rem";
39
+ readonly 'spacing.pixel.8': "0.5rem";
40
+ readonly 'spacing.pixel.12': "0.75rem";
41
+ readonly 'spacing.pixel.16': "1rem";
42
+ readonly 'spacing.pixel.20': "1.25rem";
43
+ readonly 'spacing.pixel.24': "1.5rem";
44
+ readonly 'spacing.pixel.32': "2rem";
45
+ readonly 'spacing.pixel.40': "2.5rem";
46
+ readonly 'spacing.pixel.48': "3rem";
47
+ readonly 'spacing.size.none': "0";
48
+ readonly 'spacing.size.xxxxSmall': "0.125rem";
49
+ readonly 'spacing.size.xxxSmall': "0.25rem";
50
+ readonly 'spacing.size.xxSmall': "0.375rem";
51
+ readonly 'spacing.size.xsmall': "0.5rem";
52
+ readonly 'spacing.size.small': "0.75rem";
53
+ readonly 'spacing.size.medium': "1rem";
54
+ readonly 'spacing.size.large': "1.25rem";
55
+ readonly 'spacing.size.xlarge': "1.5rem";
56
+ readonly 'spacing.size.xxlarge': "2rem";
57
+ readonly 'spacing.size.xxxlarge': "2.5rem";
58
+ readonly 'spacing.size.xxxxlarge': "3rem";
59
+ readonly 'spacing.ecl.element.2': "0.125rem";
60
+ readonly 'spacing.ecl.element.4': "0.25rem";
61
+ readonly 'spacing.ecl.element.6': "0.375rem";
62
+ readonly 'spacing.ecl.element.8': "0.5rem";
63
+ readonly 'spacing.ecl.container.12': "0.75rem";
64
+ readonly 'spacing.ecl.container.16': "1rem";
65
+ readonly 'spacing.ecl.container.20': "1.25rem";
66
+ readonly 'spacing.ecl.container.24': "1.5rem";
67
+ readonly 'spacing.ecl.layout.32': "2rem";
68
+ readonly 'spacing.ecl.layout.40': "2.5rem";
69
+ readonly 'spacing.ecl.layout.64': "3rem";
70
+ readonly 'spacing.ccc.component.2': "0.125rem";
71
+ readonly 'spacing.ccc.component.4': "0.25rem";
72
+ readonly 'spacing.ccc.component.6': "0.375rem";
73
+ readonly 'spacing.ccc.component.8': "0.5rem";
74
+ readonly 'spacing.ccc.content.12': "0.75rem";
75
+ readonly 'spacing.ccc.content.16': "1rem";
76
+ readonly 'spacing.ccc.content.20': "1.25rem";
77
+ readonly 'spacing.ccc.content.24': "1.5rem";
78
+ readonly 'spacing.ccc.container.32': "2rem";
79
+ readonly 'spacing.ccc.container.40': "2.5rem";
80
+ readonly 'spacing.ccc.container.48': "3rem";
81
+ readonly 'spacing.gap.100': "0.5rem";
82
+ readonly 'spacing.gap.200': "1rem";
83
+ readonly 'spacing.gap.300': "1.5rem";
84
+ readonly 'spacing.inset.100': "0.5rem";
85
+ readonly 'spacing.inset.200': "1rem";
86
+ readonly 'spacing.inset.300': "1.5rem";
87
87
  };
88
88
  export default defaultTokenValues;
@@ -1,4 +1,25 @@
1
1
  import tokens, { CSSTokenMap } from './artifacts/token-names';
2
2
  declare type Tokens = typeof tokens;
3
+ /**
4
+ * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
5
+ * This should be used to implement design decisions throughout your application.
6
+ *
7
+ * Note: With `@atlaskit/babel-plugin-tokens`, this function can be pre-compiled and a fallback value automatically inserted.
8
+ *
9
+ * @param {string} path - A dot-separated token name (example: `'color.background.brand'` or `'spacing.scale.100'`).
10
+ * @param {string} [fallback] - The fallback value that should render when token CSS is not present in your app.
11
+ *
12
+ * @example
13
+ * ```
14
+ * <div
15
+ * css={{
16
+ * backgroundColor: token('elevation.surface.raised', N0),
17
+ * boxShadow: token('elevation.shadow.raised', `0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`),
18
+ * padding: token('spacing.scale.100', '8px'),
19
+ * }}
20
+ * />
21
+ * ```
22
+ *
23
+ */
3
24
  declare function token<T extends keyof Tokens>(path: T, fallback?: string): CSSTokenMap[T];
4
25
  export default token;
@@ -1,3 +1,15 @@
1
1
  import { ThemeIds } from './theme-config';
2
+ /**
3
+ * Sets the theme globally at runtime. This updates the `data-theme` and `data-color-scheme` attributes on your page's <html> tag.
4
+ *
5
+ * @param {string} themeId - Which theme should be used by default.
6
+ * @param {string} [shouldMatchSystem=false] - Whether the theme should automatically switch between themes to match the system preference.
7
+ *
8
+ * @example
9
+ * ```
10
+ * // Set light theme as the default theme, but switch to others based on the system color theme.
11
+ * setGlobalTheme('light', true);
12
+ * ```
13
+ */
2
14
  declare const setGlobalTheme: (themeId: ThemeIds, shouldMatchSystem?: boolean) => void;
3
15
  export default setGlobalTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.32",
3
+ "version": "0.10.34",
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",