@atlaskit/tokens 0.11.1 → 0.11.2

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 (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/css/atlassian-spacing.css +17 -13
  3. package/dist/cjs/artifacts/palettes-raw/spacing-scale.js +249 -1
  4. package/dist/cjs/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  5. package/dist/cjs/artifacts/tokens-raw/atlassian-spacing.js +323 -213
  6. package/dist/cjs/artifacts/typescript/atlassian-spacing-token-default-values.js +17 -13
  7. package/dist/cjs/artifacts/typescript/atlassian-spacing-token-names.js +17 -13
  8. package/dist/cjs/constants.js +1 -1
  9. package/dist/cjs/get-token.js +1 -1
  10. package/dist/cjs/palettes/spacing-scale.js +96 -76
  11. package/dist/cjs/theme-config.js +6 -0
  12. package/dist/cjs/tokens/atlassian-spacing/spacing.js +65 -44
  13. package/dist/cjs/tokens/default/spacing/spacing.js +167 -116
  14. package/dist/cjs/version.json +1 -1
  15. package/dist/es2019/artifacts/palettes-raw/spacing-scale.js +249 -1
  16. package/dist/es2019/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  17. package/dist/es2019/artifacts/tokens-raw/atlassian-spacing.js +323 -213
  18. package/dist/es2019/artifacts/typescript/atlassian-spacing-token-default-values.js +17 -13
  19. package/dist/es2019/artifacts/typescript/atlassian-spacing-token-names.js +17 -13
  20. package/dist/es2019/constants.js +1 -1
  21. package/dist/es2019/get-token.js +1 -1
  22. package/dist/es2019/palettes/spacing-scale.js +95 -76
  23. package/dist/es2019/theme-config.js +6 -0
  24. package/dist/es2019/tokens/atlassian-spacing/spacing.js +64 -44
  25. package/dist/es2019/tokens/default/spacing/spacing.js +166 -116
  26. package/dist/es2019/version.json +1 -1
  27. package/dist/esm/artifacts/palettes-raw/spacing-scale.js +249 -1
  28. package/dist/esm/artifacts/rename-mapping/atlassian-spacing.js +1 -49
  29. package/dist/esm/artifacts/tokens-raw/atlassian-spacing.js +323 -213
  30. package/dist/esm/artifacts/typescript/atlassian-spacing-token-default-values.js +17 -13
  31. package/dist/esm/artifacts/typescript/atlassian-spacing-token-names.js +17 -13
  32. package/dist/esm/constants.js +1 -1
  33. package/dist/esm/get-token.js +1 -1
  34. package/dist/esm/palettes/spacing-scale.js +95 -76
  35. package/dist/esm/theme-config.js +6 -0
  36. package/dist/esm/tokens/atlassian-spacing/spacing.js +64 -44
  37. package/dist/esm/tokens/default/spacing/spacing.js +166 -116
  38. package/dist/esm/version.json +1 -1
  39. package/dist/types/artifacts/palettes-raw/spacing-scale.d.ts +22 -3
  40. package/dist/types/artifacts/rename-mapping/atlassian-spacing.d.ts +1 -1
  41. package/dist/types/artifacts/token-default-values.d.ts +16 -12
  42. package/dist/types/artifacts/token-names.d.ts +16 -12
  43. package/dist/types/artifacts/tokens-raw/atlassian-spacing.d.ts +61 -1
  44. package/dist/types/artifacts/typescript/atlassian-spacing-token-default-values.d.ts +17 -13
  45. package/dist/types/artifacts/typescript/atlassian-spacing-token-names.d.ts +33 -25
  46. package/dist/types/artifacts/typescript/atlassian-spacing-types-internal.d.ts +2 -2
  47. package/dist/types/artifacts/typescript/atlassian-spacing-types.d.ts +2 -2
  48. package/dist/types/palettes/spacing-scale.d.ts +94 -4
  49. package/dist/types/theme-config.d.ts +9 -1
  50. package/dist/types/tokens/atlassian-spacing/spacing.d.ts +8 -2
  51. package/dist/types/tokens/default/spacing/spacing.d.ts +6 -2
  52. package/dist/types/types.d.ts +92 -81
  53. package/package.json +2 -2
  54. package/report.api.md +40 -26
  55. package/tmp/api-report-tmp.d.ts +38 -25
@@ -4,10 +4,24 @@
4
4
  * Token names mapped to their value in the default Atlassian themes ('light').
5
5
  * These default values are used by the Babel plugin to optionally provide automatic fallbacks.
6
6
  *
7
- * @codegen <<SignedSource::6774c0c721b46e66ada20e02efc078c0>>
7
+ * @codegen <<SignedSource::58e461c6792689bbf53af618a63e94d0>>
8
8
  * @codegenCommand yarn build tokens
9
9
  */
10
10
  const defaultTokenValues = {
11
+ 'space.0': '0',
12
+ 'space.100': '0.5rem',
13
+ 'space.150': '0.75rem',
14
+ 'space.200': '1rem',
15
+ 'space.250': '1.25rem',
16
+ 'space.300': '1.5rem',
17
+ 'space.400': '2rem',
18
+ 'space.500': '2.5rem',
19
+ 'space.600': '3rem',
20
+ 'space.800': '4rem',
21
+ 'space.1000': '5rem',
22
+ 'space.025': '0.125rem',
23
+ 'space.050': '0.25rem',
24
+ 'space.075': '0.375rem',
11
25
  'spacing.scale.0': '0',
12
26
  'spacing.scale.100': '0.5rem',
13
27
  'spacing.scale.150': '0.75rem',
@@ -17,6 +31,8 @@ const defaultTokenValues = {
17
31
  'spacing.scale.400': '2rem',
18
32
  'spacing.scale.500': '2.5rem',
19
33
  'spacing.scale.600': '3rem',
34
+ 'spacing.scale.800': '4rem',
35
+ 'spacing.scale.1000': '5rem',
20
36
  'spacing.scale.025': '0.125rem',
21
37
  'spacing.scale.050': '0.25rem',
22
38
  'spacing.scale.075': '0.375rem',
@@ -32,18 +48,6 @@ const defaultTokenValues = {
32
48
  'spacing.scaleLinear.900': '2rem',
33
49
  'spacing.scaleLinear.1000': '2.5rem',
34
50
  'spacing.scaleLinear.1100': '3rem',
35
- 'spacing.pixel.0': '0',
36
- 'spacing.pixel.2': '0.125rem',
37
- 'spacing.pixel.4': '0.25rem',
38
- 'spacing.pixel.6': '0.375rem',
39
- 'spacing.pixel.8': '0.5rem',
40
- 'spacing.pixel.12': '0.75rem',
41
- 'spacing.pixel.16': '1rem',
42
- 'spacing.pixel.20': '1.25rem',
43
- 'spacing.pixel.24': '1.5rem',
44
- 'spacing.pixel.32': '2rem',
45
- 'spacing.pixel.40': '2.5rem',
46
- 'spacing.pixel.48': '3rem',
47
51
  'spacing.size.none': '0',
48
52
  'spacing.size.xxxxSmall': '0.125rem',
49
53
  'spacing.size.xxxSmall': '0.25rem',
@@ -1,9 +1,23 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::1808e289835f4813ce4782e16cce419d>>
3
+ * @codegen <<SignedSource::32eee2b724a024fa87bb7b5638096758>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  const tokens = {
7
+ 'space.0': '--ds-space-0',
8
+ 'space.100': '--ds-space-100',
9
+ 'space.150': '--ds-space-150',
10
+ 'space.200': '--ds-space-200',
11
+ 'space.250': '--ds-space-250',
12
+ 'space.300': '--ds-space-300',
13
+ 'space.400': '--ds-space-400',
14
+ 'space.500': '--ds-space-500',
15
+ 'space.600': '--ds-space-600',
16
+ 'space.800': '--ds-space-800',
17
+ 'space.1000': '--ds-space-1000',
18
+ 'space.025': '--ds-space-025',
19
+ 'space.050': '--ds-space-050',
20
+ 'space.075': '--ds-space-075',
7
21
  'spacing.scale.0': '--ds-scale-0',
8
22
  'spacing.scale.100': '--ds-scale-100',
9
23
  'spacing.scale.150': '--ds-scale-150',
@@ -13,6 +27,8 @@ const tokens = {
13
27
  'spacing.scale.400': '--ds-scale-400',
14
28
  'spacing.scale.500': '--ds-scale-500',
15
29
  'spacing.scale.600': '--ds-scale-600',
30
+ 'spacing.scale.800': '--ds-scale-800',
31
+ 'spacing.scale.1000': '--ds-scale-1000',
16
32
  'spacing.scale.025': '--ds-scale-025',
17
33
  'spacing.scale.050': '--ds-scale-050',
18
34
  'spacing.scale.075': '--ds-scale-075',
@@ -28,18 +44,6 @@ const tokens = {
28
44
  'spacing.scaleLinear.900': '--ds-scaleLinear-900',
29
45
  'spacing.scaleLinear.1000': '--ds-scaleLinear-1000',
30
46
  'spacing.scaleLinear.1100': '--ds-scaleLinear-1100',
31
- 'spacing.pixel.0': '--ds-pixel-0',
32
- 'spacing.pixel.2': '--ds-pixel-2',
33
- 'spacing.pixel.4': '--ds-pixel-4',
34
- 'spacing.pixel.6': '--ds-pixel-6',
35
- 'spacing.pixel.8': '--ds-pixel-8',
36
- 'spacing.pixel.12': '--ds-pixel-12',
37
- 'spacing.pixel.16': '--ds-pixel-16',
38
- 'spacing.pixel.20': '--ds-pixel-20',
39
- 'spacing.pixel.24': '--ds-pixel-24',
40
- 'spacing.pixel.32': '--ds-pixel-32',
41
- 'spacing.pixel.40': '--ds-pixel-40',
42
- 'spacing.pixel.48': '--ds-pixel-48',
43
47
  'spacing.size.none': '--ds-size-none',
44
48
  'spacing.size.xxxxSmall': '--ds-size-xxxxSmall',
45
49
  'spacing.size.xxxSmall': '--ds-size-xxxSmall',
@@ -2,5 +2,5 @@ export const THEME_DATA_ATTRIBUTE = 'data-theme';
2
2
  export const COLOR_MODE_ATTRIBUTE = 'data-color-mode';
3
3
  export const DEFAULT_THEME = 'light';
4
4
  export const CSS_PREFIX = 'ds';
5
- export const CSS_VAR_FULL = ['opacity', 'font'];
5
+ export const CSS_VAR_FULL = ['opacity', 'font', 'space'];
6
6
  export const TOKEN_NOT_FOUND_CSS_VAR = `--${CSS_PREFIX}-token-not-found`;
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
4
4
  const name = "@atlaskit/tokens";
5
- const version = "0.11.1";
5
+ const version = "0.11.2";
6
6
 
7
7
  /**
8
8
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
@@ -1,79 +1,98 @@
1
- const scale = {
2
- spacing: {
3
- scale: {
4
- Space0: {
5
- value: '0',
6
- attributes: {
7
- group: 'scale'
8
- }
9
- },
10
- Space025: {
11
- value: '0.125rem',
12
- attributes: {
13
- group: 'scale'
14
- }
15
- },
16
- Space050: {
17
- value: '0.25rem',
18
- attributes: {
19
- group: 'scale'
20
- }
21
- },
22
- Space075: {
23
- value: '0.375rem',
24
- attributes: {
25
- group: 'scale'
26
- }
27
- },
28
- Space100: {
29
- value: '0.5rem',
30
- attributes: {
31
- group: 'scale'
32
- }
33
- },
34
- Space150: {
35
- value: '0.75rem',
36
- attributes: {
37
- group: 'scale'
38
- }
39
- },
40
- Space200: {
41
- value: '1rem',
42
- attributes: {
43
- group: 'scale'
44
- }
45
- },
46
- Space250: {
47
- value: '1.25rem',
48
- attributes: {
49
- group: 'scale'
50
- }
51
- },
52
- Space300: {
53
- value: '1.5rem',
54
- attributes: {
55
- group: 'scale'
56
- }
57
- },
58
- Space400: {
59
- value: '2rem',
60
- attributes: {
61
- group: 'scale'
62
- }
63
- },
64
- Space500: {
65
- value: '2.5rem',
66
- attributes: {
67
- group: 'scale'
68
- }
69
- },
70
- Space600: {
71
- value: '3rem',
72
- attributes: {
73
- group: 'scale'
74
- }
75
- }
1
+ /**
2
+ * Types are inferred from the base tokens below
3
+ */
4
+ const baseSpacingTokens = {
5
+ Space0: {
6
+ value: '0',
7
+ attributes: {
8
+ group: 'scale'
9
+ }
10
+ },
11
+ Space025: {
12
+ value: '0.125rem',
13
+ attributes: {
14
+ group: 'scale'
15
+ }
16
+ },
17
+ Space050: {
18
+ value: '0.25rem',
19
+ attributes: {
20
+ group: 'scale'
21
+ }
22
+ },
23
+ Space075: {
24
+ value: '0.375rem',
25
+ attributes: {
26
+ group: 'scale'
27
+ }
28
+ },
29
+ Space100: {
30
+ value: '0.5rem',
31
+ attributes: {
32
+ group: 'scale'
33
+ }
34
+ },
35
+ Space150: {
36
+ value: '0.75rem',
37
+ attributes: {
38
+ group: 'scale'
39
+ }
40
+ },
41
+ Space200: {
42
+ value: '1rem',
43
+ attributes: {
44
+ group: 'scale'
76
45
  }
46
+ },
47
+ Space250: {
48
+ value: '1.25rem',
49
+ attributes: {
50
+ group: 'scale'
51
+ }
52
+ },
53
+ Space300: {
54
+ value: '1.5rem',
55
+ attributes: {
56
+ group: 'scale'
57
+ }
58
+ },
59
+ Space400: {
60
+ value: '2rem',
61
+ attributes: {
62
+ group: 'scale'
63
+ }
64
+ },
65
+ Space500: {
66
+ value: '2.5rem',
67
+ attributes: {
68
+ group: 'scale'
69
+ }
70
+ },
71
+ Space600: {
72
+ value: '3rem',
73
+ attributes: {
74
+ group: 'scale'
75
+ }
76
+ },
77
+ Space800: {
78
+ value: '4rem',
79
+ attributes: {
80
+ group: 'scale'
81
+ },
82
+ pixelValue: '64px'
83
+ },
84
+ Space1000: {
85
+ value: '5rem',
86
+ attributes: {
87
+ group: 'scale'
88
+ },
89
+ pixelValue: '80px'
77
90
  }
78
91
  };
79
- export default scale;
92
+ const spacingPalette = {
93
+ spacing: {
94
+ scale: baseSpacingTokens
95
+ },
96
+ space: baseSpacingTokens
97
+ };
98
+ export default spacingPalette;
@@ -28,6 +28,12 @@
28
28
  * These ids must be kebab case
29
29
  */
30
30
 
31
+ /**
32
+ * Theme to use a base. This will create the theme as
33
+ * an extension with all token values marked as optional
34
+ * to allow tokens to be overridden as required.
35
+ */
36
+
31
37
  /**
32
38
  * Palettes: The set of base tokens a given theme may be populated with.
33
39
  * For example: legacy light & dark themes use the "legacyPalette" containing colors from our
@@ -1,4 +1,56 @@
1
+ /**
2
+ * The spacing value schema is specifically designed to dictate the
3
+ * possible values a specific key-token pair will have.
4
+ *
5
+ * This is combined with the attribute schema.
6
+ * @link 'file:../default/spacing/spacing.tsx'
7
+ */
1
8
  const spacing = {
9
+ space: {
10
+ '0': {
11
+ value: 'Space0'
12
+ },
13
+ '025': {
14
+ value: 'Space025'
15
+ },
16
+ '050': {
17
+ value: 'Space050'
18
+ },
19
+ '075': {
20
+ value: 'Space075'
21
+ },
22
+ '100': {
23
+ value: 'Space100'
24
+ },
25
+ '150': {
26
+ value: 'Space150'
27
+ },
28
+ '200': {
29
+ value: 'Space200'
30
+ },
31
+ '250': {
32
+ value: 'Space250'
33
+ },
34
+ '300': {
35
+ value: 'Space300'
36
+ },
37
+ '400': {
38
+ value: 'Space400'
39
+ },
40
+ '500': {
41
+ value: 'Space500'
42
+ },
43
+ '600': {
44
+ value: 'Space600'
45
+ },
46
+ '800': {
47
+ value: 'Space800'
48
+ },
49
+ '1000': {
50
+ value: 'Space1000'
51
+ }
52
+ },
53
+ // original namespace under 'spacing' this is the same as above
2
54
  spacing: {
3
55
  scale: {
4
56
  '0': {
@@ -36,6 +88,12 @@ const spacing = {
36
88
  },
37
89
  '600': {
38
90
  value: 'Space600'
91
+ },
92
+ '800': {
93
+ value: 'Space800'
94
+ },
95
+ '1000': {
96
+ value: 'Space1000'
39
97
  }
40
98
  },
41
99
  scaleLinear: {
@@ -76,44 +134,6 @@ const spacing = {
76
134
  value: 'Space600'
77
135
  }
78
136
  },
79
- pixel: {
80
- '0': {
81
- value: 'Space0'
82
- },
83
- '2': {
84
- value: 'Space025'
85
- },
86
- '4': {
87
- value: 'Space050'
88
- },
89
- '6': {
90
- value: 'Space075'
91
- },
92
- '8': {
93
- value: 'Space100'
94
- },
95
- '12': {
96
- value: 'Space150'
97
- },
98
- '16': {
99
- value: 'Space200'
100
- },
101
- '20': {
102
- value: 'Space250'
103
- },
104
- '24': {
105
- value: 'Space300'
106
- },
107
- '32': {
108
- value: 'Space400'
109
- },
110
- '40': {
111
- value: 'Space500'
112
- },
113
- '48': {
114
- value: 'Space600'
115
- }
116
- },
117
137
  size: {
118
138
  none: {
119
139
  value: 'Space0'
@@ -235,24 +255,24 @@ const spacing = {
235
255
  }
236
256
  },
237
257
  gap: {
238
- 100: {
258
+ '100': {
239
259
  value: 'Space100'
240
260
  },
241
- 200: {
261
+ '200': {
242
262
  value: 'Space200'
243
263
  },
244
- 300: {
264
+ '300': {
245
265
  value: 'Space300'
246
266
  }
247
267
  },
248
268
  inset: {
249
- 100: {
269
+ '100': {
250
270
  value: 'Space100'
251
271
  },
252
- 200: {
272
+ '200': {
253
273
  value: 'Space200'
254
274
  },
255
- 300: {
275
+ '300': {
256
276
  value: 'Space300'
257
277
  }
258
278
  }