@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,87 @@
1
+ /**
2
+ * This file contains the source of truth for themes and all associated meta data.
3
+ */
4
+
5
+ /**
6
+ * Themes: The internal identifier of a theme.
7
+ * These ids are what the actual theme files/folders are called.
8
+ * style-dictionary will attempt to locate these in the file-system.
9
+ */
10
+
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
+
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
+
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
+
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
+
37
+ /**
38
+ * ThemeConfig: the source of truth for all theme meta-data.
39
+ * This object should be used whenever interfacing with themes.
40
+ */
41
+ const themeConfig = {
42
+ 'atlassian-light': {
43
+ id: 'light',
44
+ displayName: 'Light Theme',
45
+ palette: 'defaultPalette',
46
+ attributes: {
47
+ type: 'color',
48
+ mode: 'light'
49
+ }
50
+ },
51
+ 'atlassian-dark': {
52
+ id: 'dark',
53
+ displayName: 'Dark Theme',
54
+ palette: 'defaultPalette',
55
+ attributes: {
56
+ type: 'color',
57
+ mode: 'dark'
58
+ }
59
+ },
60
+ 'atlassian-legacy-light': {
61
+ id: 'legacy-light',
62
+ displayName: 'Light Theme (legacy)',
63
+ palette: 'legacyPalette',
64
+ attributes: {
65
+ type: 'color',
66
+ mode: 'light'
67
+ }
68
+ },
69
+ 'atlassian-legacy-dark': {
70
+ id: 'legacy-dark',
71
+ displayName: 'Dark Theme (legacy)',
72
+ palette: 'legacyPalette',
73
+ attributes: {
74
+ type: 'color',
75
+ mode: 'dark'
76
+ }
77
+ },
78
+ 'atlassian-spacing': {
79
+ id: 'spacing',
80
+ displayName: 'Atlassian Spacing',
81
+ palette: 'spacingScale',
82
+ attributes: {
83
+ type: 'spacing'
84
+ }
85
+ }
86
+ };
87
+ export default themeConfig;
@@ -15,8 +15,7 @@ const spacing = {
15
15
  '0': {
16
16
  attributes: {
17
17
  group: 'spacing',
18
- state: 'experimental',
19
- replacement: '0',
18
+ state: 'active',
20
19
  introduced: '0.10.16',
21
20
  description: 'Equates to `0`. Can be used for resetting default spacing styles.'
22
21
  }
@@ -24,8 +23,7 @@ const spacing = {
24
23
  '025': {
25
24
  attributes: {
26
25
  group: 'spacing',
27
- state: 'experimental',
28
- replacement: '2px',
26
+ state: 'active',
29
27
  introduced: '0.10.16',
30
28
  description: 'Use for spacing in compact scenarios. The smallest value in our scale.'
31
29
  }
@@ -33,8 +31,7 @@ const spacing = {
33
31
  '050': {
34
32
  attributes: {
35
33
  group: 'spacing',
36
- state: 'experimental',
37
- replacement: '4px',
34
+ state: 'active',
38
35
  introduced: '0.10.16',
39
36
  description: 'Helpful guidance goes here'
40
37
  }
@@ -42,8 +39,7 @@ const spacing = {
42
39
  '075': {
43
40
  attributes: {
44
41
  group: 'spacing',
45
- state: 'experimental',
46
- replacement: '6px',
42
+ state: 'active',
47
43
  introduced: '0.10.16',
48
44
  description: 'Helpful guidance goes here'
49
45
  }
@@ -51,8 +47,7 @@ const spacing = {
51
47
  '100': {
52
48
  attributes: {
53
49
  group: 'spacing',
54
- state: 'experimental',
55
- replacement: '8px',
50
+ state: 'active',
56
51
  introduced: '0.10.16',
57
52
  description: 'Helpful guidance goes here'
58
53
  }
@@ -60,8 +55,7 @@ const spacing = {
60
55
  '150': {
61
56
  attributes: {
62
57
  group: 'spacing',
63
- state: 'experimental',
64
- replacement: '12px',
58
+ state: 'active',
65
59
  introduced: '0.10.16',
66
60
  description: 'Helpful guidance goes here'
67
61
  }
@@ -69,8 +63,7 @@ const spacing = {
69
63
  '200': {
70
64
  attributes: {
71
65
  group: 'spacing',
72
- state: 'experimental',
73
- replacement: '16px',
66
+ state: 'active',
74
67
  introduced: '0.10.16',
75
68
  description: 'Helpful guidance goes here'
76
69
  }
@@ -78,8 +71,7 @@ const spacing = {
78
71
  '250': {
79
72
  attributes: {
80
73
  group: 'spacing',
81
- state: 'experimental',
82
- replacement: '20px',
74
+ state: 'active',
83
75
  introduced: '0.10.16',
84
76
  description: 'Helpful guidance goes here'
85
77
  }
@@ -87,8 +79,7 @@ const spacing = {
87
79
  '300': {
88
80
  attributes: {
89
81
  group: 'spacing',
90
- state: 'experimental',
91
- replacement: '24px',
82
+ state: 'active',
92
83
  introduced: '0.10.16',
93
84
  description: 'Helpful guidance goes here'
94
85
  }
@@ -96,8 +87,7 @@ const spacing = {
96
87
  '400': {
97
88
  attributes: {
98
89
  group: 'spacing',
99
- state: 'experimental',
100
- replacement: '32px',
90
+ state: 'active',
101
91
  introduced: '0.10.16',
102
92
  description: 'Helpful guidance goes here'
103
93
  }
@@ -105,8 +95,7 @@ const spacing = {
105
95
  '500': {
106
96
  attributes: {
107
97
  group: 'spacing',
108
- state: 'experimental',
109
- replacement: '40px',
98
+ state: 'active',
110
99
  introduced: '0.10.16',
111
100
  description: 'Helpful guidance goes here'
112
101
  }
@@ -114,8 +103,7 @@ const spacing = {
114
103
  '600': {
115
104
  attributes: {
116
105
  group: 'spacing',
117
- state: 'experimental',
118
- replacement: '48px',
106
+ state: 'active',
119
107
  introduced: '0.10.16',
120
108
  description: 'Helpful guidance goes here'
121
109
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.27",
3
+ "version": "0.10.29",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::08ae35ae5d6bfe790b538db89c5876de>>
3
+ * @codegen <<SignedSource::9ec4d3766ad54f86aa1d9891b0f32317>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
7
- "value": "0",
7
+ "value": "0px",
8
8
  "attributes": {
9
9
  "group": "scale"
10
10
  },
11
11
  "filePath": "src/palettes/spacing-scale.tsx",
12
12
  "isSource": true,
13
13
  "original": {
14
- "value": "0",
14
+ "value": "0px",
15
15
  "attributes": {
16
16
  "group": "scale"
17
17
  }
@@ -12,60 +12,12 @@
12
12
  * These changes will then be picked up by our tooling which will attempt to
13
13
  * migrate as many of these renames as possible.
14
14
  *
15
- * @codegen <<SignedSource::96a569b32686a2088f106c2ec4cd75d3>>
15
+ * @codegen <<SignedSource::a90d6d19262ac37cb4095da71ba3035c>>
16
16
  * @codegenCommand yarn build tokens
17
17
  */
18
18
  var renameMapper = [{
19
19
  "path": "spacing.container.gutter",
20
20
  "state": "experimental",
21
21
  "replacement": "8px"
22
- }, {
23
- "path": "spacing.scale.0",
24
- "state": "experimental",
25
- "replacement": "0"
26
- }, {
27
- "path": "spacing.scale.100",
28
- "state": "experimental",
29
- "replacement": "8px"
30
- }, {
31
- "path": "spacing.scale.150",
32
- "state": "experimental",
33
- "replacement": "12px"
34
- }, {
35
- "path": "spacing.scale.200",
36
- "state": "experimental",
37
- "replacement": "16px"
38
- }, {
39
- "path": "spacing.scale.250",
40
- "state": "experimental",
41
- "replacement": "20px"
42
- }, {
43
- "path": "spacing.scale.300",
44
- "state": "experimental",
45
- "replacement": "24px"
46
- }, {
47
- "path": "spacing.scale.400",
48
- "state": "experimental",
49
- "replacement": "32px"
50
- }, {
51
- "path": "spacing.scale.500",
52
- "state": "experimental",
53
- "replacement": "40px"
54
- }, {
55
- "path": "spacing.scale.600",
56
- "state": "experimental",
57
- "replacement": "48px"
58
- }, {
59
- "path": "spacing.scale.025",
60
- "state": "experimental",
61
- "replacement": "2px"
62
- }, {
63
- "path": "spacing.scale.050",
64
- "state": "experimental",
65
- "replacement": "4px"
66
- }, {
67
- "path": "spacing.scale.075",
68
- "state": "experimental",
69
- "replacement": "6px"
70
22
  }];
71
23
  export default renameMapper;
@@ -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::fd4d0992b574a7a22bc1b95ebcdaafc8>>
3
+ * @codegen <<SignedSource::e19d1d58b2463145dd0eae095e3d0b36>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
@@ -29,19 +29,17 @@ var tokens = [{
29
29
  }, {
30
30
  "attributes": {
31
31
  "group": "spacing",
32
- "state": "experimental",
33
- "replacement": "0",
32
+ "state": "active",
34
33
  "introduced": "0.10.16",
35
34
  "description": "Equates to `0`. Can be used for resetting default spacing styles."
36
35
  },
37
- "value": "0",
36
+ "value": "0px",
38
37
  "filePath": "src/tokens/atlassian-spacing/spacing.tsx",
39
38
  "isSource": true,
40
39
  "original": {
41
40
  "attributes": {
42
41
  "group": "spacing",
43
- "state": "experimental",
44
- "replacement": "0",
42
+ "state": "active",
45
43
  "introduced": "0.10.16",
46
44
  "description": "Equates to `0`. Can be used for resetting default spacing styles."
47
45
  },
@@ -52,8 +50,7 @@ var tokens = [{
52
50
  }, {
53
51
  "attributes": {
54
52
  "group": "spacing",
55
- "state": "experimental",
56
- "replacement": "8px",
53
+ "state": "active",
57
54
  "introduced": "0.10.16",
58
55
  "description": "Helpful guidance goes here"
59
56
  },
@@ -63,8 +60,7 @@ var tokens = [{
63
60
  "original": {
64
61
  "attributes": {
65
62
  "group": "spacing",
66
- "state": "experimental",
67
- "replacement": "8px",
63
+ "state": "active",
68
64
  "introduced": "0.10.16",
69
65
  "description": "Helpful guidance goes here"
70
66
  },
@@ -75,8 +71,7 @@ var tokens = [{
75
71
  }, {
76
72
  "attributes": {
77
73
  "group": "spacing",
78
- "state": "experimental",
79
- "replacement": "12px",
74
+ "state": "active",
80
75
  "introduced": "0.10.16",
81
76
  "description": "Helpful guidance goes here"
82
77
  },
@@ -86,8 +81,7 @@ var tokens = [{
86
81
  "original": {
87
82
  "attributes": {
88
83
  "group": "spacing",
89
- "state": "experimental",
90
- "replacement": "12px",
84
+ "state": "active",
91
85
  "introduced": "0.10.16",
92
86
  "description": "Helpful guidance goes here"
93
87
  },
@@ -98,8 +92,7 @@ var tokens = [{
98
92
  }, {
99
93
  "attributes": {
100
94
  "group": "spacing",
101
- "state": "experimental",
102
- "replacement": "16px",
95
+ "state": "active",
103
96
  "introduced": "0.10.16",
104
97
  "description": "Helpful guidance goes here"
105
98
  },
@@ -109,8 +102,7 @@ var tokens = [{
109
102
  "original": {
110
103
  "attributes": {
111
104
  "group": "spacing",
112
- "state": "experimental",
113
- "replacement": "16px",
105
+ "state": "active",
114
106
  "introduced": "0.10.16",
115
107
  "description": "Helpful guidance goes here"
116
108
  },
@@ -121,8 +113,7 @@ var tokens = [{
121
113
  }, {
122
114
  "attributes": {
123
115
  "group": "spacing",
124
- "state": "experimental",
125
- "replacement": "20px",
116
+ "state": "active",
126
117
  "introduced": "0.10.16",
127
118
  "description": "Helpful guidance goes here"
128
119
  },
@@ -132,8 +123,7 @@ var tokens = [{
132
123
  "original": {
133
124
  "attributes": {
134
125
  "group": "spacing",
135
- "state": "experimental",
136
- "replacement": "20px",
126
+ "state": "active",
137
127
  "introduced": "0.10.16",
138
128
  "description": "Helpful guidance goes here"
139
129
  },
@@ -144,8 +134,7 @@ var tokens = [{
144
134
  }, {
145
135
  "attributes": {
146
136
  "group": "spacing",
147
- "state": "experimental",
148
- "replacement": "24px",
137
+ "state": "active",
149
138
  "introduced": "0.10.16",
150
139
  "description": "Helpful guidance goes here"
151
140
  },
@@ -155,8 +144,7 @@ var tokens = [{
155
144
  "original": {
156
145
  "attributes": {
157
146
  "group": "spacing",
158
- "state": "experimental",
159
- "replacement": "24px",
147
+ "state": "active",
160
148
  "introduced": "0.10.16",
161
149
  "description": "Helpful guidance goes here"
162
150
  },
@@ -167,8 +155,7 @@ var tokens = [{
167
155
  }, {
168
156
  "attributes": {
169
157
  "group": "spacing",
170
- "state": "experimental",
171
- "replacement": "32px",
158
+ "state": "active",
172
159
  "introduced": "0.10.16",
173
160
  "description": "Helpful guidance goes here"
174
161
  },
@@ -178,8 +165,7 @@ var tokens = [{
178
165
  "original": {
179
166
  "attributes": {
180
167
  "group": "spacing",
181
- "state": "experimental",
182
- "replacement": "32px",
168
+ "state": "active",
183
169
  "introduced": "0.10.16",
184
170
  "description": "Helpful guidance goes here"
185
171
  },
@@ -190,8 +176,7 @@ var tokens = [{
190
176
  }, {
191
177
  "attributes": {
192
178
  "group": "spacing",
193
- "state": "experimental",
194
- "replacement": "40px",
179
+ "state": "active",
195
180
  "introduced": "0.10.16",
196
181
  "description": "Helpful guidance goes here"
197
182
  },
@@ -201,8 +186,7 @@ var tokens = [{
201
186
  "original": {
202
187
  "attributes": {
203
188
  "group": "spacing",
204
- "state": "experimental",
205
- "replacement": "40px",
189
+ "state": "active",
206
190
  "introduced": "0.10.16",
207
191
  "description": "Helpful guidance goes here"
208
192
  },
@@ -213,8 +197,7 @@ var tokens = [{
213
197
  }, {
214
198
  "attributes": {
215
199
  "group": "spacing",
216
- "state": "experimental",
217
- "replacement": "48px",
200
+ "state": "active",
218
201
  "introduced": "0.10.16",
219
202
  "description": "Helpful guidance goes here"
220
203
  },
@@ -224,8 +207,7 @@ var tokens = [{
224
207
  "original": {
225
208
  "attributes": {
226
209
  "group": "spacing",
227
- "state": "experimental",
228
- "replacement": "48px",
210
+ "state": "active",
229
211
  "introduced": "0.10.16",
230
212
  "description": "Helpful guidance goes here"
231
213
  },
@@ -236,8 +218,7 @@ var tokens = [{
236
218
  }, {
237
219
  "attributes": {
238
220
  "group": "spacing",
239
- "state": "experimental",
240
- "replacement": "2px",
221
+ "state": "active",
241
222
  "introduced": "0.10.16",
242
223
  "description": "Use for spacing in compact scenarios. The smallest value in our scale."
243
224
  },
@@ -247,8 +228,7 @@ var tokens = [{
247
228
  "original": {
248
229
  "attributes": {
249
230
  "group": "spacing",
250
- "state": "experimental",
251
- "replacement": "2px",
231
+ "state": "active",
252
232
  "introduced": "0.10.16",
253
233
  "description": "Use for spacing in compact scenarios. The smallest value in our scale."
254
234
  },
@@ -259,8 +239,7 @@ var tokens = [{
259
239
  }, {
260
240
  "attributes": {
261
241
  "group": "spacing",
262
- "state": "experimental",
263
- "replacement": "4px",
242
+ "state": "active",
264
243
  "introduced": "0.10.16",
265
244
  "description": "Helpful guidance goes here"
266
245
  },
@@ -270,8 +249,7 @@ var tokens = [{
270
249
  "original": {
271
250
  "attributes": {
272
251
  "group": "spacing",
273
- "state": "experimental",
274
- "replacement": "4px",
252
+ "state": "active",
275
253
  "introduced": "0.10.16",
276
254
  "description": "Helpful guidance goes here"
277
255
  },
@@ -282,8 +260,7 @@ var tokens = [{
282
260
  }, {
283
261
  "attributes": {
284
262
  "group": "spacing",
285
- "state": "experimental",
286
- "replacement": "6px",
263
+ "state": "active",
287
264
  "introduced": "0.10.16",
288
265
  "description": "Helpful guidance goes here"
289
266
  },
@@ -293,8 +270,7 @@ var tokens = [{
293
270
  "original": {
294
271
  "attributes": {
295
272
  "group": "spacing",
296
- "state": "experimental",
297
- "replacement": "6px",
273
+ "state": "active",
298
274
  "introduced": "0.10.16",
299
275
  "description": "Helpful guidance goes here"
300
276
  },
@@ -4,12 +4,12 @@
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::c5f4991ca82e83d24ff38509c8df5121>>
7
+ * @codegen <<SignedSource::e575bc332dcc60d3fe9e378605bc9100>>
8
8
  * @codegenCommand yarn build tokens
9
9
  */
10
10
  var defaultTokenValues = {
11
11
  'spacing.container.gutter': '8px',
12
- 'spacing.scale.0': '0',
12
+ 'spacing.scale.0': '0px',
13
13
  'spacing.scale.100': '8px',
14
14
  'spacing.scale.150': '12px',
15
15
  'spacing.scale.200': '16px',
@@ -1,7 +1 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::09e6dd0e22e09011160890dfb93241da>>
4
- * @codegenCommand yarn build tokens
5
- */
6
- // No active tokens in this theme
7
1
  export {};
@@ -1,7 +1 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::09e6dd0e22e09011160890dfb93241da>>
4
- * @codegenCommand yarn build tokens
5
- */
6
- // No active tokens in this theme
7
1
  export {};
@@ -1,14 +1,6 @@
1
- export var THEMES = ['light', 'dark', 'legacy-light', 'legacy-dark', 'spacing'];
2
1
  export var THEME_DATA_ATTRIBUTE = 'data-theme';
2
+ export var COLOR_MODE_ATTRIBUTE = 'data-color-mode';
3
3
  export var DEFAULT_THEME = 'light spacing';
4
4
  export var CSS_PREFIX = 'ds';
5
- export var CSS_VAR_FULL = ['opacity']; // Maps the longer theme name to a shorthand used in css/code
6
-
7
- export var THEME_NAME_MAP = {
8
- 'atlassian-light': 'light',
9
- 'atlassian-dark': 'dark',
10
- 'atlassian-legacy-light': 'legacy-light',
11
- 'atlassian-legacy-dark': 'legacy-dark',
12
- 'atlassian-spacing': 'spacing'
13
- };
5
+ export var CSS_VAR_FULL = ['opacity'];
14
6
  export var TOKEN_NOT_FOUND_CSS_VAR = "--".concat(CSS_PREFIX, "-token-not-found");
@@ -0,0 +1 @@
1
+ export { default } from '../artifacts/tokens-raw/atlassian-spacing';
@@ -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
  var name = "@atlaskit/tokens";
5
- var version = "0.10.27";
5
+ var version = "0.10.29";
6
6
 
7
7
  function token(path, fallback) {
8
8
  var token = tokens[path];
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as token } from './get-token';
2
2
  export { default as setGlobalTheme } from './set-global-theme';
3
+ export { default as themeConfig } from './theme-config';
3
4
  export { useThemeObserver, ThemeMutationObserver } from './theme-change-observer';
@@ -2,7 +2,7 @@ var scale = {
2
2
  spacing: {
3
3
  scale: {
4
4
  Space0: {
5
- value: '0',
5
+ value: '0px',
6
6
  attributes: {
7
7
  group: 'scale'
8
8
  }
@@ -1,14 +1,37 @@
1
- import { THEMES } from './constants';
1
+ import { COLOR_MODE_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
2
+ import themeConfig from './theme-config';
3
+
4
+ var setGlobalTheme = function setGlobalTheme(themeId) {
5
+ var shouldMatchSystem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6
+ var theme = Object.values(themeConfig).find(function (_ref) {
7
+ var id = _ref.id;
8
+ return id === themeId;
9
+ });
2
10
 
3
- var setGlobalTheme = function setGlobalTheme(theme) {
4
11
  if (process.env.NODE_ENV !== 'production') {
5
- if (!THEMES.includes(theme)) {
6
- throw new Error("setGlobalTheme only accepts themes: ".concat(THEMES.join(', ')));
12
+ if (!theme) {
13
+ var themeIds = Object.values(themeConfig).map(function (_ref2) {
14
+ var id = _ref2.id;
15
+ return id;
16
+ });
17
+ throw new Error("setGlobalTheme only accepts themes: ".concat(themeIds.join(', ')));
7
18
  }
8
19
  }
9
20
 
21
+ if (!theme) {
22
+ return;
23
+ }
24
+
10
25
  var element = document.documentElement;
11
- element.setAttribute('data-theme', theme);
26
+ element.setAttribute(THEME_DATA_ATTRIBUTE, theme.id);
27
+
28
+ if (theme.attributes.type === 'color') {
29
+ element.setAttribute(COLOR_MODE_ATTRIBUTE, theme.attributes.mode);
30
+ }
31
+
32
+ if (shouldMatchSystem) {
33
+ element.setAttribute(COLOR_MODE_ATTRIBUTE, 'auto');
34
+ }
12
35
  };
13
36
 
14
37
  export default setGlobalTheme;