@atlaskit/tokens 1.0.0 → 1.2.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 (95) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/cjs/artifacts/palettes-raw/shape-palette.js +134 -0
  3. package/dist/cjs/artifacts/palettes-raw/spacing-scale.js +29 -243
  4. package/dist/cjs/artifacts/palettes-raw/typography-palette.js +41 -41
  5. package/dist/cjs/artifacts/replacement-mapping.js +2 -210
  6. package/dist/cjs/artifacts/theme-import-map.js +6 -1
  7. package/dist/cjs/artifacts/themes/atlassian-shape.js +13 -0
  8. package/dist/cjs/artifacts/themes/atlassian-spacing.js +2 -2
  9. package/dist/cjs/artifacts/token-default-values.js +9 -67
  10. package/dist/cjs/artifacts/token-names.js +9 -67
  11. package/dist/cjs/artifacts/tokens-raw/atlassian-shape.js +190 -0
  12. package/dist/cjs/artifacts/tokens-raw/atlassian-spacing.js +1 -1581
  13. package/dist/cjs/entry-points/tokens-raw.js +8 -1
  14. package/dist/cjs/get-token-value.js +1 -1
  15. package/dist/cjs/get-token.js +1 -1
  16. package/dist/cjs/palettes/shape-palette.js +70 -0
  17. package/dist/cjs/palettes/spacing-scale.js +14 -17
  18. package/dist/cjs/palettes/typography-palette.js +20 -20
  19. package/dist/cjs/theme-config.js +9 -1
  20. package/dist/cjs/tokens/atlassian-shape/shape.js +44 -0
  21. package/dist/cjs/tokens/atlassian-spacing/spacing.js +0 -227
  22. package/dist/cjs/tokens/default/shape/shape.js +80 -0
  23. package/dist/cjs/tokens/default/spacing/spacing.js +0 -620
  24. package/dist/cjs/version.json +1 -1
  25. package/dist/es2019/artifacts/palettes-raw/shape-palette.js +127 -0
  26. package/dist/es2019/artifacts/palettes-raw/spacing-scale.js +29 -243
  27. package/dist/es2019/artifacts/palettes-raw/typography-palette.js +41 -41
  28. package/dist/es2019/artifacts/replacement-mapping.js +2 -210
  29. package/dist/es2019/artifacts/theme-import-map.js +4 -2
  30. package/dist/es2019/artifacts/themes/atlassian-shape.js +17 -0
  31. package/dist/es2019/artifacts/themes/atlassian-spacing.js +1 -67
  32. package/dist/es2019/artifacts/token-default-values.js +9 -67
  33. package/dist/es2019/artifacts/token-names.js +9 -67
  34. package/dist/es2019/artifacts/tokens-raw/atlassian-shape.js +183 -0
  35. package/dist/es2019/artifacts/tokens-raw/atlassian-spacing.js +1 -1581
  36. package/dist/es2019/entry-points/tokens-raw.js +2 -1
  37. package/dist/es2019/get-token-value.js +1 -1
  38. package/dist/es2019/get-token.js +1 -1
  39. package/dist/es2019/palettes/shape-palette.js +63 -0
  40. package/dist/es2019/palettes/spacing-scale.js +14 -17
  41. package/dist/es2019/palettes/typography-palette.js +20 -20
  42. package/dist/es2019/theme-config.js +9 -1
  43. package/dist/es2019/tokens/atlassian-shape/shape.js +37 -0
  44. package/dist/es2019/tokens/atlassian-spacing/spacing.js +0 -227
  45. package/dist/es2019/tokens/default/shape/shape.js +73 -0
  46. package/dist/es2019/tokens/default/spacing/spacing.js +0 -620
  47. package/dist/es2019/version.json +1 -1
  48. package/dist/esm/artifacts/palettes-raw/shape-palette.js +127 -0
  49. package/dist/esm/artifacts/palettes-raw/spacing-scale.js +29 -243
  50. package/dist/esm/artifacts/palettes-raw/typography-palette.js +41 -41
  51. package/dist/esm/artifacts/replacement-mapping.js +2 -210
  52. package/dist/esm/artifacts/theme-import-map.js +5 -1
  53. package/dist/esm/artifacts/themes/atlassian-shape.js +6 -0
  54. package/dist/esm/artifacts/themes/atlassian-spacing.js +2 -2
  55. package/dist/esm/artifacts/token-default-values.js +9 -67
  56. package/dist/esm/artifacts/token-names.js +9 -67
  57. package/dist/esm/artifacts/tokens-raw/atlassian-shape.js +183 -0
  58. package/dist/esm/artifacts/tokens-raw/atlassian-spacing.js +1 -1581
  59. package/dist/esm/entry-points/tokens-raw.js +2 -1
  60. package/dist/esm/get-token-value.js +1 -1
  61. package/dist/esm/get-token.js +1 -1
  62. package/dist/esm/palettes/shape-palette.js +63 -0
  63. package/dist/esm/palettes/spacing-scale.js +14 -17
  64. package/dist/esm/palettes/typography-palette.js +20 -20
  65. package/dist/esm/theme-config.js +9 -1
  66. package/dist/esm/tokens/atlassian-shape/shape.js +37 -0
  67. package/dist/esm/tokens/atlassian-spacing/spacing.js +0 -227
  68. package/dist/esm/tokens/default/shape/shape.js +73 -0
  69. package/dist/esm/tokens/default/spacing/spacing.js +0 -620
  70. package/dist/esm/version.json +1 -1
  71. package/dist/types/artifacts/palettes-raw/shape-palette.d.ts +22 -0
  72. package/dist/types/artifacts/palettes-raw/spacing-scale.d.ts +1 -1
  73. package/dist/types/artifacts/palettes-raw/typography-palette.d.ts +1 -1
  74. package/dist/types/artifacts/replacement-mapping.d.ts +1 -1
  75. package/dist/types/artifacts/theme-import-map.d.ts +1 -1
  76. package/dist/types/artifacts/themes/atlassian-shape.d.ts +7 -0
  77. package/dist/types/artifacts/themes/atlassian-spacing.d.ts +2 -2
  78. package/dist/types/artifacts/token-default-values.d.ts +9 -67
  79. package/dist/types/artifacts/token-names.d.ts +17 -133
  80. package/dist/types/artifacts/tokens-raw/atlassian-shape.d.ts +29 -0
  81. package/dist/types/artifacts/tokens-raw/atlassian-spacing.d.ts +1 -89
  82. package/dist/types/artifacts/types-internal.d.ts +2 -2
  83. package/dist/types/artifacts/types.d.ts +2 -2
  84. package/dist/types/entry-points/tokens-raw.d.ts +1 -0
  85. package/dist/types/palettes/shape-palette.d.ts +61 -0
  86. package/dist/types/palettes/spacing-scale.d.ts +14 -14
  87. package/dist/types/theme-config.d.ts +5 -7
  88. package/dist/types/tokens/atlassian-shape/shape.d.ts +7 -0
  89. package/dist/types/tokens/default/shape/shape.d.ts +3 -0
  90. package/dist/types/types.d.ts +29 -116
  91. package/figma/atlassian-shape.json +78 -0
  92. package/figma/atlassian-spacing.json +1 -761
  93. package/package.json +1 -1
  94. package/report.api.md +23 -136
  95. package/tmp/api-report-tmp.d.ts +23 -138
@@ -1,4 +1,5 @@
1
1
  export { default as light } from '../artifacts/tokens-raw/atlassian-light';
2
2
  export { default as dark } from '../artifacts/tokens-raw/atlassian-dark';
3
3
  export { default as spacing } from '../artifacts/tokens-raw/atlassian-spacing';
4
- export { default as typography } from '../artifacts/tokens-raw/atlassian-typography';
4
+ export { default as typography } from '../artifacts/tokens-raw/atlassian-typography';
5
+ export { default as shape } from '../artifacts/tokens-raw/atlassian-shape';
@@ -1,7 +1,7 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  const name = "@atlaskit/tokens";
4
- const version = "1.0.0";
4
+ const version = "1.2.0";
5
5
  /**
6
6
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
7
7
  * resulting CSS Custom Property.
@@ -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 = "1.0.0";
5
+ const version = "1.2.0";
6
6
  /**
7
7
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
8
8
  * This should be used to implement design decisions throughout your application.
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Types are inferred from the base tokens below
3
+ */
4
+
5
+ const baseSizeTokens = {
6
+ Size050: {
7
+ value: '0.0625rem',
8
+ attributes: {
9
+ group: 'shape'
10
+ }
11
+ },
12
+ Size100: {
13
+ value: '0.125rem',
14
+ attributes: {
15
+ group: 'shape'
16
+ }
17
+ }
18
+ };
19
+ const baseRadiusTokens = {
20
+ Radius050: {
21
+ value: '0.125rem',
22
+ attributes: {
23
+ group: 'shape'
24
+ }
25
+ },
26
+ Radius100: {
27
+ value: '0.25rem',
28
+ attributes: {
29
+ group: 'shape'
30
+ }
31
+ },
32
+ Radius200: {
33
+ value: '0.5rem',
34
+ attributes: {
35
+ group: 'shape'
36
+ }
37
+ },
38
+ Radius300: {
39
+ value: '0.75rem',
40
+ attributes: {
41
+ group: 'shape'
42
+ }
43
+ },
44
+ Radius400: {
45
+ value: '1rem',
46
+ attributes: {
47
+ group: 'shape'
48
+ }
49
+ },
50
+ RadiusCircle: {
51
+ value: '50%',
52
+ attributes: {
53
+ group: 'shape'
54
+ }
55
+ }
56
+ };
57
+ const shapePalette = {
58
+ border: {
59
+ radius: baseRadiusTokens,
60
+ width: baseSizeTokens
61
+ }
62
+ };
63
+ export default shapePalette;
@@ -6,94 +6,91 @@ const baseSpacingTokens = {
6
6
  Space0: {
7
7
  value: '0',
8
8
  attributes: {
9
- group: 'scale'
9
+ group: 'spacing'
10
10
  }
11
11
  },
12
12
  Space025: {
13
13
  value: '0.125rem',
14
14
  attributes: {
15
- group: 'scale'
15
+ group: 'spacing'
16
16
  }
17
17
  },
18
18
  Space050: {
19
19
  value: '0.25rem',
20
20
  attributes: {
21
- group: 'scale'
21
+ group: 'spacing'
22
22
  }
23
23
  },
24
24
  Space075: {
25
25
  value: '0.375rem',
26
26
  attributes: {
27
- group: 'scale'
27
+ group: 'spacing'
28
28
  }
29
29
  },
30
30
  Space100: {
31
31
  value: '0.5rem',
32
32
  attributes: {
33
- group: 'scale'
33
+ group: 'spacing'
34
34
  }
35
35
  },
36
36
  Space150: {
37
37
  value: '0.75rem',
38
38
  attributes: {
39
- group: 'scale'
39
+ group: 'spacing'
40
40
  }
41
41
  },
42
42
  Space200: {
43
43
  value: '1rem',
44
44
  attributes: {
45
- group: 'scale'
45
+ group: 'spacing'
46
46
  }
47
47
  },
48
48
  Space250: {
49
49
  value: '1.25rem',
50
50
  attributes: {
51
- group: 'scale'
51
+ group: 'spacing'
52
52
  }
53
53
  },
54
54
  Space300: {
55
55
  value: '1.5rem',
56
56
  attributes: {
57
- group: 'scale'
57
+ group: 'spacing'
58
58
  }
59
59
  },
60
60
  Space400: {
61
61
  value: '2rem',
62
62
  attributes: {
63
- group: 'scale'
63
+ group: 'spacing'
64
64
  }
65
65
  },
66
66
  Space500: {
67
67
  value: '2.5rem',
68
68
  attributes: {
69
- group: 'scale'
69
+ group: 'spacing'
70
70
  }
71
71
  },
72
72
  Space600: {
73
73
  value: '3rem',
74
74
  attributes: {
75
- group: 'scale'
75
+ group: 'spacing'
76
76
  }
77
77
  },
78
78
  Space800: {
79
79
  value: '4rem',
80
80
  attributes: {
81
- group: 'scale'
81
+ group: 'spacing'
82
82
  },
83
83
  pixelValue: '64px'
84
84
  },
85
85
  Space1000: {
86
86
  value: '5rem',
87
87
  attributes: {
88
- group: 'scale'
88
+ group: 'spacing'
89
89
  },
90
90
  pixelValue: '80px'
91
91
  }
92
92
  };
93
93
  const spacingPalette = {
94
- spacing: {
95
- scale: baseSpacingTokens
96
- },
97
94
  space: baseSpacingTokens
98
95
  };
99
96
  export default spacingPalette;
@@ -3,37 +3,37 @@ const lineHeightScale = {
3
3
  LineHeight100: {
4
4
  value: '16px',
5
5
  attributes: {
6
- group: 'scale'
6
+ group: 'typography'
7
7
  }
8
8
  },
9
9
  LineHeight200: {
10
10
  value: '20px',
11
11
  attributes: {
12
- group: 'scale'
12
+ group: 'typography'
13
13
  }
14
14
  },
15
15
  LineHeight300: {
16
16
  value: '24px',
17
17
  attributes: {
18
- group: 'scale'
18
+ group: 'typography'
19
19
  }
20
20
  },
21
21
  LineHeight400: {
22
22
  value: '28px',
23
23
  attributes: {
24
- group: 'scale'
24
+ group: 'typography'
25
25
  }
26
26
  },
27
27
  LineHeight500: {
28
28
  value: '32px',
29
29
  attributes: {
30
- group: 'scale'
30
+ group: 'typography'
31
31
  }
32
32
  },
33
33
  LineHeight600: {
34
34
  value: '40px',
35
35
  attributes: {
36
- group: 'scale'
36
+ group: 'typography'
37
37
  }
38
38
  }
39
39
  }
@@ -43,25 +43,25 @@ const fontWeightScale = {
43
43
  FontWeightRegular: {
44
44
  value: '400',
45
45
  attributes: {
46
- group: 'scale'
46
+ group: 'typography'
47
47
  }
48
48
  },
49
49
  FontWeightMedium: {
50
50
  value: '500',
51
51
  attributes: {
52
- group: 'scale'
52
+ group: 'typography'
53
53
  }
54
54
  },
55
55
  FontWeightSemiBold: {
56
56
  value: '600',
57
57
  attributes: {
58
- group: 'scale'
58
+ group: 'typography'
59
59
  }
60
60
  },
61
61
  FontWeightBold: {
62
62
  value: '700',
63
63
  attributes: {
64
- group: 'scale'
64
+ group: 'typography'
65
65
  }
66
66
  }
67
67
  }
@@ -71,13 +71,13 @@ const fontFamilyPalette = {
71
71
  FontFamilySans: {
72
72
  value: `-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif`,
73
73
  attributes: {
74
- group: 'scale'
74
+ group: 'typography'
75
75
  }
76
76
  },
77
77
  FontFamilyMonospace: {
78
78
  value: `"SFMono-Medium", "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace`,
79
79
  attributes: {
80
- group: 'scale'
80
+ group: 'typography'
81
81
  }
82
82
  }
83
83
  }
@@ -87,49 +87,49 @@ const fontSizeScale = {
87
87
  FontSize050: {
88
88
  value: '11px',
89
89
  attributes: {
90
- group: 'scale'
90
+ group: 'typography'
91
91
  }
92
92
  },
93
93
  FontSize075: {
94
94
  value: '12px',
95
95
  attributes: {
96
- group: 'scale'
96
+ group: 'typography'
97
97
  }
98
98
  },
99
99
  FontSize100: {
100
100
  value: '14px',
101
101
  attributes: {
102
- group: 'scale'
102
+ group: 'typography'
103
103
  }
104
104
  },
105
105
  FontSize200: {
106
106
  value: '16px',
107
107
  attributes: {
108
- group: 'scale'
108
+ group: 'typography'
109
109
  }
110
110
  },
111
111
  FontSize300: {
112
112
  value: '20px',
113
113
  attributes: {
114
- group: 'scale'
114
+ group: 'typography'
115
115
  }
116
116
  },
117
117
  FontSize400: {
118
118
  value: '24px',
119
119
  attributes: {
120
- group: 'scale'
120
+ group: 'typography'
121
121
  }
122
122
  },
123
123
  FontSize500: {
124
124
  value: '29px',
125
125
  attributes: {
126
- group: 'scale'
126
+ group: 'typography'
127
127
  }
128
128
  },
129
129
  FontSize600: {
130
130
  value: '35px',
131
131
  attributes: {
132
- group: 'scale'
132
+ group: 'typography'
133
133
  }
134
134
  }
135
135
  }
@@ -27,7 +27,7 @@ export const themeColorModes = ['light', 'dark', 'auto'];
27
27
  *
28
28
  * These ids must be kebab case
29
29
  */
30
- export const themeIds = ['light', 'dark', 'legacy-light', 'legacy-dark', 'spacing', 'typography'];
30
+ export const themeIds = ['light', 'dark', 'legacy-light', 'legacy-dark', 'spacing', 'typography', 'shape'];
31
31
  const themeConfig = {
32
32
  'atlassian-light': {
33
33
  id: 'light',
@@ -80,6 +80,14 @@ const themeConfig = {
80
80
  attributes: {
81
81
  type: 'typography'
82
82
  }
83
+ },
84
+ 'atlassian-shape': {
85
+ id: 'shape',
86
+ displayName: 'Atlassian Shape',
87
+ palette: 'shapePalette',
88
+ attributes: {
89
+ type: 'shape'
90
+ }
83
91
  }
84
92
  };
85
93
  export default themeConfig;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * This is combined with the attribute schema.
3
+ * @link 'file:../default/shape/shape.tsx'
4
+ */
5
+ const shape = {
6
+ border: {
7
+ width: {
8
+ '050': {
9
+ value: 'Size050'
10
+ },
11
+ '100': {
12
+ value: 'Size100'
13
+ }
14
+ },
15
+ radius: {
16
+ '050': {
17
+ value: 'Radius050'
18
+ },
19
+ '100': {
20
+ value: 'Radius100'
21
+ },
22
+ '200': {
23
+ value: 'Radius200'
24
+ },
25
+ '300': {
26
+ value: 'Radius300'
27
+ },
28
+ '400': {
29
+ value: 'Radius400'
30
+ },
31
+ round: {
32
+ value: 'RadiusCircle'
33
+ }
34
+ }
35
+ }
36
+ };
37
+ export default shape;
@@ -49,233 +49,6 @@ const spacing = {
49
49
  '1000': {
50
50
  value: 'Space1000'
51
51
  }
52
- },
53
- // original namespace under 'spacing' this is the same as above
54
- spacing: {
55
- scale: {
56
- '0': {
57
- value: 'Space0'
58
- },
59
- '025': {
60
- value: 'Space025'
61
- },
62
- '050': {
63
- value: 'Space050'
64
- },
65
- '075': {
66
- value: 'Space075'
67
- },
68
- '100': {
69
- value: 'Space100'
70
- },
71
- '150': {
72
- value: 'Space150'
73
- },
74
- '200': {
75
- value: 'Space200'
76
- },
77
- '250': {
78
- value: 'Space250'
79
- },
80
- '300': {
81
- value: 'Space300'
82
- },
83
- '400': {
84
- value: 'Space400'
85
- },
86
- '500': {
87
- value: 'Space500'
88
- },
89
- '600': {
90
- value: 'Space600'
91
- },
92
- '800': {
93
- value: 'Space800'
94
- },
95
- '1000': {
96
- value: 'Space1000'
97
- }
98
- },
99
- scaleLinear: {
100
- '0': {
101
- value: 'Space0'
102
- },
103
- '100': {
104
- value: 'Space025'
105
- },
106
- '200': {
107
- value: 'Space050'
108
- },
109
- '300': {
110
- value: 'Space075'
111
- },
112
- '400': {
113
- value: 'Space100'
114
- },
115
- '500': {
116
- value: 'Space150'
117
- },
118
- '600': {
119
- value: 'Space200'
120
- },
121
- '700': {
122
- value: 'Space250'
123
- },
124
- '800': {
125
- value: 'Space300'
126
- },
127
- '900': {
128
- value: 'Space400'
129
- },
130
- '1000': {
131
- value: 'Space500'
132
- },
133
- '1100': {
134
- value: 'Space600'
135
- }
136
- },
137
- size: {
138
- none: {
139
- value: 'Space0'
140
- },
141
- xxxxSmall: {
142
- value: 'Space025'
143
- },
144
- xxxSmall: {
145
- value: 'Space050'
146
- },
147
- xxSmall: {
148
- value: 'Space075'
149
- },
150
- xsmall: {
151
- value: 'Space100'
152
- },
153
- small: {
154
- value: 'Space150'
155
- },
156
- medium: {
157
- value: 'Space200'
158
- },
159
- large: {
160
- value: 'Space250'
161
- },
162
- xlarge: {
163
- value: 'Space300'
164
- },
165
- xxlarge: {
166
- value: 'Space400'
167
- },
168
- xxxlarge: {
169
- value: 'Space500'
170
- },
171
- xxxxlarge: {
172
- value: 'Space600'
173
- }
174
- },
175
- ecl: {
176
- element: {
177
- '2': {
178
- value: 'Space025'
179
- },
180
- '4': {
181
- value: 'Space050'
182
- },
183
- '6': {
184
- value: 'Space075'
185
- },
186
- '8': {
187
- value: 'Space100'
188
- }
189
- },
190
- container: {
191
- '12': {
192
- value: 'Space150'
193
- },
194
- '16': {
195
- value: 'Space200'
196
- },
197
- '20': {
198
- value: 'Space250'
199
- },
200
- '24': {
201
- value: 'Space300'
202
- }
203
- },
204
- layout: {
205
- '32': {
206
- value: 'Space400'
207
- },
208
- '40': {
209
- value: 'Space500'
210
- },
211
- '64': {
212
- value: 'Space600'
213
- }
214
- }
215
- },
216
- ccc: {
217
- component: {
218
- '2': {
219
- value: 'Space025'
220
- },
221
- '4': {
222
- value: 'Space050'
223
- },
224
- '6': {
225
- value: 'Space075'
226
- },
227
- '8': {
228
- value: 'Space100'
229
- }
230
- },
231
- content: {
232
- '12': {
233
- value: 'Space150'
234
- },
235
- '16': {
236
- value: 'Space200'
237
- },
238
- '20': {
239
- value: 'Space250'
240
- },
241
- '24': {
242
- value: 'Space300'
243
- }
244
- },
245
- container: {
246
- '32': {
247
- value: 'Space400'
248
- },
249
- '40': {
250
- value: 'Space500'
251
- },
252
- '48': {
253
- value: 'Space600'
254
- }
255
- }
256
- },
257
- gap: {
258
- '100': {
259
- value: 'Space100'
260
- },
261
- '200': {
262
- value: 'Space200'
263
- },
264
- '300': {
265
- value: 'Space300'
266
- }
267
- },
268
- inset: {
269
- '100': {
270
- value: 'Space100'
271
- },
272
- '200': {
273
- value: 'Space200'
274
- },
275
- '300': {
276
- value: 'Space300'
277
- }
278
- }
279
52
  }
280
53
  };
281
54
  export default spacing;