@carbon/themes 10.31.0 → 10.33.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.
package/src/g80.js ADDED
@@ -0,0 +1,315 @@
1
+ /**
2
+ * Copyright IBM Corp. 2018, 2018
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { adjustLightness } from './tools';
8
+
9
+ import {
10
+ // Blue
11
+ blue30,
12
+ blue40,
13
+ blue50,
14
+ blue60,
15
+ blue70,
16
+ blue80,
17
+
18
+ // Gray
19
+ gray10,
20
+ gray30,
21
+ gray40,
22
+ gray50,
23
+ gray60,
24
+ gray70,
25
+ gray80,
26
+ gray100,
27
+
28
+ // Support
29
+ green40,
30
+ green50,
31
+ yellow30,
32
+ red30,
33
+ red40,
34
+ red60,
35
+ red80,
36
+ purple40,
37
+
38
+ // Constants
39
+ white,
40
+
41
+ // Tools
42
+ rgba,
43
+ } from '@carbon/colors';
44
+
45
+ // New color tokens
46
+ // TO-DO: remove fallback color when v11 is released and assign carbon colors to new tokens
47
+ export const background = gray80;
48
+ export const layer = gray70;
49
+ export const layerAccent = gray60;
50
+ export const field = gray70;
51
+ export const backgroundInverse = gray10;
52
+ export const backgroundBrand = blue60;
53
+ export const interactive = blue40;
54
+
55
+ export const borderSubtle = gray60;
56
+ export const borderStrong = gray40;
57
+ export const borderInverse = gray10;
58
+ export const borderInteractive = blue50;
59
+
60
+ export const textPrimary = gray10;
61
+ export const textSecondary = gray30;
62
+ export const textPlaceholder = gray60;
63
+ export const textHelper = gray40;
64
+ export const textError = red30;
65
+ export const textOnColor = white;
66
+ export const textInverse = gray100;
67
+
68
+ export const linkPrimary = blue40;
69
+ export const linkSecondary = blue30;
70
+ export const linkVisited = purple40;
71
+ export const linkInverse = blue60;
72
+
73
+ export const iconPrimary = gray10;
74
+ export const iconSecondary = gray30;
75
+ export const iconOnColor = white;
76
+ export const iconInverse = gray100;
77
+
78
+ export const supportError = red40;
79
+ export const supportSuccess = green40;
80
+ export const supportWarning = yellow30;
81
+ export const supportInfo = blue50;
82
+ export const supportErrorInverse = red60;
83
+ export const supportSuccessInverse = green50;
84
+ export const supportWarningInverse = yellow30;
85
+ export const supportInfoInverse = blue60;
86
+
87
+ export const overlay = rgba(gray100, 0.7);
88
+ export const toggleOff = gray50;
89
+
90
+ export const buttonPrimary = blue60;
91
+ export const buttonSecondary = gray60;
92
+ export const buttonTertiary = white;
93
+ export const buttonDangerPrimary = red60;
94
+ export const buttonDangerSecondary = red40;
95
+ export const buttonSeparator = gray100;
96
+
97
+ export const backgroundActive = gray70;
98
+ export const layerActive = gray60;
99
+
100
+ export const buttonDangerActive = red80;
101
+ export const buttonPrimaryActive = blue80;
102
+ export const buttonSecondaryActive = gray70;
103
+ export const buttonTertiaryActive = gray30;
104
+
105
+ export const focus = white;
106
+ export const focusInset = gray100;
107
+ export const focusInverse = blue60;
108
+ export const highlight = blue70;
109
+
110
+ export const backgroundHover = adjustLightness(background, +6);
111
+ export const layerHover = adjustLightness(layer, +7);
112
+ export const fieldHover = adjustLightness(field, +7);
113
+ export const backgroundInverseHover = adjustLightness(backgroundInverse, -5);
114
+
115
+ export const linkPrimaryHover = blue30;
116
+
117
+ export const buttonDangerHover = adjustLightness(buttonDangerPrimary, -8);
118
+ export const buttonPrimaryHover = adjustLightness(buttonPrimary, -8);
119
+ export const buttonSecondaryHover = adjustLightness(buttonSecondary, -7);
120
+ export const buttonTertiaryHover = white;
121
+
122
+ export const backgroundSelected = gray70;
123
+ export const backgroundSelectedHover = adjustLightness(backgroundSelected, +7);
124
+ export const layerSelected = gray60;
125
+ export const layerSelectedHover = adjustLightness(layerSelected, -6);
126
+ export const layerSelectedInverse = gray10;
127
+ export const borderSubtleSelected = gray50;
128
+
129
+ export const layerDisabled = gray70;
130
+ export const fieldDisabled = gray70;
131
+ export const borderDisabled = gray70;
132
+
133
+ export const textDisabled = gray50;
134
+ export const buttonDisabled = gray50;
135
+ export const iconDisabled = gray50;
136
+
137
+ export const textOnColorDisabled = gray30;
138
+ export const iconOnColorDisabled = gray30;
139
+ export const layerSelectedDisabled = gray30;
140
+
141
+ export const skeletonBackground = adjustLightness(background, +6);
142
+ export const skeletonElement = gray60;
143
+
144
+ //////////////////////////////////////
145
+ // Old tokens needed to pass tests //
146
+ //////////////////////////////////////
147
+ export const interactive01 = backgroundBrand;
148
+ export const interactive02 = buttonSecondary;
149
+ export const interactive03 = buttonTertiary;
150
+ export const interactive04 = interactive;
151
+
152
+ export const uiBackground = background;
153
+
154
+ export const ui01 = layer;
155
+ export const ui02 = gray70;
156
+ export const ui03 = layerAccent;
157
+ export const ui04 = borderStrong;
158
+ export const ui05 = borderInverse;
159
+
160
+ export const text01 = textPrimary;
161
+ export const text02 = textSecondary;
162
+ export const text03 = textPlaceholder;
163
+ export const text04 = textOnColor;
164
+ export const text05 = textHelper;
165
+
166
+ export const icon01 = iconPrimary;
167
+ export const icon02 = iconSecondary;
168
+ export const icon03 = iconOnColor;
169
+
170
+ export const link01 = linkPrimary;
171
+ export const link02 = linkSecondary;
172
+
173
+ export const inverseLink = linkInverse;
174
+
175
+ export const field01 = field;
176
+ export const field02 = gray60;
177
+
178
+ export const inverse01 = textInverse;
179
+ export const inverse02 = backgroundInverse;
180
+
181
+ export const support01 = supportError;
182
+ export const support02 = supportSuccess;
183
+ export const support03 = supportWarning;
184
+ export const support04 = supportInfo;
185
+
186
+ export const inverseSupport01 = supportErrorInverse;
187
+ export const inverseSupport02 = supportSuccessInverse;
188
+ export const inverseSupport03 = supportWarningInverse;
189
+ export const inverseSupport04 = supportInfoInverse;
190
+
191
+ export const overlay01 = overlay;
192
+
193
+ export const danger01 = buttonDangerPrimary;
194
+ export const danger02 = buttonDangerSecondary;
195
+
196
+ // Interaction states
197
+ export const inverseFocusUi = focusInverse;
198
+
199
+ export const hoverPrimary = buttonPrimaryHover;
200
+ export const activePrimary = buttonPrimaryActive;
201
+
202
+ export const hoverPrimaryText = linkPrimaryHover;
203
+
204
+ export const hoverSecondary = buttonSecondaryHover;
205
+ export const activeSecondary = buttonSecondaryActive;
206
+
207
+ export const hoverTertiary = buttonTertiaryHover;
208
+ export const activeTertiary = buttonTertiaryActive;
209
+
210
+ export const hoverUI = backgroundHover;
211
+ export const hoverLightUI = '#5E5E5E';
212
+ export const activeUI = backgroundActive;
213
+ export const activeLightUI = gray50;
214
+ export const selectedUI = backgroundSelected;
215
+ export const selectedLightUI = gray50;
216
+ export const inverseHoverUI = backgroundInverseHover;
217
+
218
+ export const hoverSelectedUI = layerSelectedHover;
219
+
220
+ export const hoverDanger = buttonDangerHover;
221
+ export const activeDanger = buttonDangerActive;
222
+
223
+ export const hoverRow = layerHover;
224
+
225
+ export const visitedLink = linkVisited;
226
+
227
+ export const disabled01 = layerDisabled;
228
+ export const disabled02 = textDisabled;
229
+ export const disabled03 = textOnColorDisabled;
230
+
231
+ export const decorative01 = gray60;
232
+
233
+ export const skeleton01 = skeletonBackground;
234
+ export const skeleton02 = skeletonElement;
235
+
236
+ export {
237
+ // Type
238
+ caption01,
239
+ label01,
240
+ helperText01,
241
+ bodyShort01,
242
+ bodyLong01,
243
+ bodyShort02,
244
+ bodyLong02,
245
+ code01,
246
+ code02,
247
+ heading01,
248
+ productiveHeading01,
249
+ heading02,
250
+ productiveHeading02,
251
+ productiveHeading03,
252
+ productiveHeading04,
253
+ productiveHeading05,
254
+ productiveHeading06,
255
+ productiveHeading07,
256
+ expressiveHeading01,
257
+ expressiveHeading02,
258
+ expressiveHeading03,
259
+ expressiveHeading04,
260
+ expressiveHeading05,
261
+ expressiveHeading06,
262
+ expressiveParagraph01,
263
+ quotation01,
264
+ quotation02,
265
+ display01,
266
+ display02,
267
+ display03,
268
+ display04,
269
+ // Layout
270
+ // Spacing
271
+ spacing01,
272
+ spacing02,
273
+ spacing03,
274
+ spacing04,
275
+ spacing05,
276
+ spacing06,
277
+ spacing07,
278
+ spacing08,
279
+ spacing09,
280
+ spacing10,
281
+ spacing11,
282
+ spacing12,
283
+ spacing13,
284
+ // Fluid spacing
285
+ fluidSpacing01,
286
+ fluidSpacing02,
287
+ fluidSpacing03,
288
+ fluidSpacing04,
289
+ // Layout
290
+ // Deprecated -- Remove in v11
291
+ layout01,
292
+ layout02,
293
+ layout03,
294
+ layout04,
295
+ layout05,
296
+ layout06,
297
+ layout07,
298
+ // Containers
299
+ container01,
300
+ container02,
301
+ container03,
302
+ container04,
303
+ container05,
304
+ // Icon sizes
305
+ iconSize01,
306
+ iconSize02,
307
+ } from './white';
308
+
309
+ // Deprecated ☠️
310
+ export const brand01 = interactive01;
311
+ export const brand02 = interactive02;
312
+ export const brand03 = interactive03;
313
+ export const active01 = activeUI;
314
+ export const hoverField = hoverUI;
315
+ export const danger = danger01;
package/src/g90.js CHANGED
@@ -138,6 +138,99 @@ export const buttonSeparator = '#161616';
138
138
  export const skeleton01 = '#353535';
139
139
  export const skeleton02 = gray70;
140
140
 
141
+ // New color tokens
142
+ // TO-DO: remove fallback color when v11 is released and assign carbon colors to new tokens
143
+ export const background = uiBackground;
144
+ export const layer = ui01;
145
+ export const layerAccent = ui03;
146
+ export const field = field01;
147
+ export const backgroundInverse = inverse02;
148
+ export const backgroundBrand = interactive01;
149
+ export const interactive = interactive04;
150
+
151
+ export const borderSubtle = ui03;
152
+ export const borderStrong = ui04;
153
+ export const borderInverse = ui05;
154
+ export const borderInteractive = interactive04;
155
+
156
+ export const textPrimary = text01;
157
+ export const textSecondary = text02;
158
+ export const textPlaceholder = text03;
159
+ export const textHelper = text05;
160
+ export const textOnColor = text04;
161
+ export const textInverse = inverse01;
162
+
163
+ export const linkPrimary = link01;
164
+ export const linkSecondary = link02;
165
+ export const linkVisited = visitedLink;
166
+ export const linkInverse = inverseLink;
167
+
168
+ export const iconPrimary = icon01;
169
+ export const iconSecondary = icon02;
170
+ export const iconOnColor = icon03;
171
+ export const iconInverse = inverse01;
172
+
173
+ export const supportError = support01;
174
+ export const supportSuccess = support02;
175
+ export const supportWarning = support03;
176
+ export const supportInfo = support04;
177
+ export const supportErrorInverse = inverseSupport01;
178
+ export const supportSuccessInverse = inverseSupport02;
179
+ export const supportWarningInverse = inverseSupport03;
180
+ export const supportInfoInverse = inverseSupport04;
181
+
182
+ export const overlay = overlay01;
183
+ export const toggleOff = ui04;
184
+
185
+ export const buttonPrimary = interactive01;
186
+ export const buttonSecondary = interactive02;
187
+ export const buttonTertiary = interactive03;
188
+ export const buttonDangerPrimary = danger01;
189
+ export const buttonDangerSecondary = danger02;
190
+
191
+ export const backgroundActive = activeUI;
192
+ export const layerActive = activeUI;
193
+
194
+ export const buttonDangerActive = activeDanger;
195
+ export const buttonPrimaryActive = activePrimary;
196
+ export const buttonSecondaryActive = activeSecondary;
197
+ export const buttonTertiaryActive = activeTertiary;
198
+
199
+ export const focusInset = inverse01;
200
+ export const focusInverse = inverseFocusUi;
201
+
202
+ export const backgroundHover = hoverUI;
203
+ export const layerHover = hoverUI;
204
+ export const fieldHover = hoverUI;
205
+ export const backgroundInverseHover = inverseHoverUI;
206
+ export const linkPrimaryHover = hoverPrimaryText;
207
+ export const buttonDangerHover = hoverDanger;
208
+ export const buttonPrimaryHover = hoverPrimary;
209
+ export const buttonSecondaryHover = hoverSecondary;
210
+ export const buttonTertiaryHover = hoverTertiary;
211
+
212
+ export const backgroundSelected = selectedUI;
213
+ export const backgroundSelectedHover = hoverSelectedUI;
214
+ export const layerSelected = selectedUI;
215
+ export const layerSelectedHover = hoverSelectedUI;
216
+ export const layerSelectedInverse = ui05;
217
+ export const borderSubtleSelected = activeUI;
218
+
219
+ export const layerDisabled = disabled01;
220
+ export const fieldDisabled = disabled01;
221
+ export const borderDisabled = disabled01;
222
+
223
+ export const textDisabled = disabled02;
224
+ export const buttonDisabled = disabled02;
225
+ export const iconDisabled = disabled02;
226
+
227
+ export const textOnColorDisabled = disabled03;
228
+ export const iconOnColorDisabled = disabled03;
229
+ export const layerSelectedDisabled = disabled03;
230
+
231
+ export const skeletonBackground = skeleton01;
232
+ export const skeletonElement = skeleton02;
233
+
141
234
  export {
142
235
  // Type
143
236
  caption01,
package/src/index.js CHANGED
@@ -10,15 +10,17 @@ export * from './white';
10
10
  import * as g10 from './g10';
11
11
  import * as g100 from './g100';
12
12
  import * as white from './white';
13
+ import * as g80 from './g80';
13
14
  import * as g90 from './g90';
14
15
  import * as v9 from './v9';
15
16
  import { tokens, formatTokenName, unstable__meta } from './tokens';
16
17
 
17
- export { g10, g90, g100, white, v9 };
18
+ export { g10, g80, g90, g100, white, v9 };
18
19
  export { tokens, formatTokenName, unstable__meta };
19
20
  export const themes = {
20
21
  white,
21
22
  g10,
23
+ g80,
22
24
  g90,
23
25
  g100,
24
26
  v9,
package/src/tokens.js CHANGED
@@ -105,6 +105,99 @@ const colors = [
105
105
  'skeleton01',
106
106
  'skeleton02',
107
107
 
108
+ // New color tokens
109
+ // TO-DO: remove fallback color when v11 is released and assign carbon colors to new tokens
110
+ 'background',
111
+ 'layer',
112
+ 'layerAccent',
113
+ 'field',
114
+ 'backgroundInverse',
115
+ 'backgroundBrand',
116
+ 'interactive',
117
+
118
+ 'borderSubtle',
119
+ 'borderStrong',
120
+ 'borderInverse',
121
+ 'borderInteractive',
122
+
123
+ 'textPrimary',
124
+ 'textSecondary',
125
+ 'textPlaceholder',
126
+ 'textHelper',
127
+ 'textOnColor',
128
+ 'textInverse',
129
+
130
+ 'linkPrimary',
131
+ 'linkSecondary',
132
+ 'linkVisited',
133
+ 'linkInverse',
134
+
135
+ 'iconPrimary',
136
+ 'iconSecondary',
137
+ 'iconOnColor',
138
+ 'iconInverse',
139
+
140
+ 'supportError',
141
+ 'supportSuccess',
142
+ 'supportWarning',
143
+ 'supportInfo',
144
+ 'supportErrorInverse',
145
+ 'supportSuccessInverse',
146
+ 'supportWarningInverse',
147
+ 'supportInfoInverse',
148
+
149
+ 'overlay',
150
+ 'toggleOff',
151
+
152
+ 'buttonPrimary',
153
+ 'buttonSecondary',
154
+ 'buttonTertiary',
155
+ 'buttonDangerPrimary',
156
+ 'buttonDangerSecondary',
157
+
158
+ 'backgroundActive',
159
+ 'layerActive',
160
+
161
+ 'buttonDangerActive',
162
+ 'buttonPrimaryActive',
163
+ 'buttonSecondaryActive',
164
+ 'buttonTertiaryActive',
165
+
166
+ 'focusInset',
167
+ 'focusInverse',
168
+
169
+ 'backgroundHover',
170
+ 'layerHover',
171
+ 'fieldHover',
172
+ 'backgroundInverseHover',
173
+ 'linkPrimaryHover',
174
+ 'buttonDangerHover',
175
+ 'buttonPrimaryHover',
176
+ 'buttonSecondaryHover',
177
+ 'buttonTertiaryHover',
178
+
179
+ 'backgroundSelected',
180
+ 'backgroundSelectedHover',
181
+ 'layerSelected',
182
+ 'layerSelectedHover',
183
+ 'layerSelectedInverse',
184
+ 'borderSubtleSelected',
185
+
186
+ 'layerDisabled',
187
+ 'fieldDisabled',
188
+ 'borderDisabled',
189
+
190
+ 'textDisabled',
191
+ 'buttonDisabled',
192
+ 'iconDisabled',
193
+
194
+ 'textOnColorDisabled',
195
+ 'iconOnColorDisabled',
196
+ 'layerSelectedDisabled',
197
+
198
+ 'skeletonBackground',
199
+ 'skeletonElement',
200
+
108
201
  // Deprecated
109
202
  'brand01',
110
203
  'brand02',
@@ -206,6 +299,55 @@ export const unstable__meta = {
206
299
  'inverseSupport03',
207
300
  'inverseSupport04',
208
301
  'overlay01',
302
+
303
+ //new tokens
304
+ 'background',
305
+ 'layer',
306
+ 'layerAccent',
307
+ 'field',
308
+ 'backgroundInverse',
309
+ 'backgroundBrand',
310
+ 'interactive',
311
+
312
+ 'borderSubtle',
313
+ 'borderStrong',
314
+ 'borderInverse',
315
+ 'borderInteractive',
316
+
317
+ 'textPrimary',
318
+ 'textSecondary',
319
+ 'textPlaceholder',
320
+ 'textHelper',
321
+ 'textOnColor',
322
+ 'textInverse',
323
+
324
+ 'linkPrimary',
325
+ 'linkSecondary',
326
+ 'linkVisited',
327
+ 'linkInverse',
328
+
329
+ 'iconPrimary',
330
+ 'iconSecondary',
331
+ 'iconOnColor',
332
+ 'iconInverse',
333
+
334
+ 'supportError',
335
+ 'supportSuccess',
336
+ 'supportWarning',
337
+ 'supportInfo',
338
+ 'supportErrorInverse',
339
+ 'supportSuccessInverse',
340
+ 'supportWarningInverse',
341
+ 'supportInfoInverse',
342
+
343
+ 'overlay',
344
+ 'toggleOff',
345
+
346
+ 'buttonPrimary',
347
+ 'buttonSecondary',
348
+ 'buttonTertiary',
349
+ 'buttonDangerPrimary',
350
+ 'buttonDangerSecondary',
209
351
  ],
210
352
  },
211
353
  {
@@ -242,6 +384,50 @@ export const unstable__meta = {
242
384
  'hoverField',
243
385
  'decorative01',
244
386
  'buttonSeparator',
387
+
388
+ // new tokens
389
+ 'backgroundActive',
390
+ 'layerActive',
391
+
392
+ 'buttonDangerActive',
393
+ 'buttonPrimaryActive',
394
+ 'buttonSecondaryActive',
395
+ 'buttonTertiaryActive',
396
+
397
+ 'focusInset',
398
+ 'focusInverse',
399
+
400
+ 'backgroundHover',
401
+ 'layerHover',
402
+ 'fieldHover',
403
+ 'backgroundInverseHover',
404
+ 'linkPrimaryHover',
405
+ 'buttonDangerHover',
406
+ 'buttonPrimaryHover',
407
+ 'buttonSecondaryHover',
408
+ 'buttonTertiaryHover',
409
+
410
+ 'backgroundSelected',
411
+ 'backgroundSelectedHover',
412
+ 'layerSelected',
413
+ 'layerSelectedHover',
414
+ 'layerSelectedInverse',
415
+ 'borderSubtleSelected',
416
+
417
+ 'layerDisabled',
418
+ 'fieldDisabled',
419
+ 'borderDisabled',
420
+
421
+ 'textDisabled',
422
+ 'buttonDisabled',
423
+ 'iconDisabled',
424
+
425
+ 'textOnColorDisabled',
426
+ 'iconOnColorDisabled',
427
+ 'layerSelectedDisabled',
428
+
429
+ 'skeletonBackground',
430
+ 'skeletonElement',
245
431
  ],
246
432
  },
247
433
  ],