@carbon/themes 10.35.0-rc.0 → 10.37.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/package.json +8 -8
- package/scss/generated/_mixins.scss +81 -0
- package/scss/modules/_theme.scss +7 -1
- package/src/next/tokens/Token.js +34 -0
- package/src/next/tokens/TokenFormat.js +37 -0
- package/src/next/tokens/TokenGroup.js +161 -0
- package/src/next/tokens/TokenSet.js +77 -0
- package/src/next/tokens/index.js +13 -0
- package/src/next/tokens/v11TokenGroup.js +357 -0
- package/src/next/tokens/v11TokenSet.js +85 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/themes",
|
|
3
3
|
"description": "Themes for applying color in the Carbon Design System",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.37.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"build": "yarn clean && carbon-cli bundle src/index.js --name CarbonThemes && node tasks/build.js && carbon-cli check \"scss/*.scss\""
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@carbon/colors": "^10.
|
|
33
|
-
"@carbon/layout": "^10.
|
|
34
|
-
"@carbon/type": "^10.
|
|
32
|
+
"@carbon/colors": "^10.27.0",
|
|
33
|
+
"@carbon/layout": "^10.26.0",
|
|
34
|
+
"@carbon/type": "^10.30.0",
|
|
35
35
|
"color": "^3.1.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@carbon/cli": "^10.
|
|
39
|
-
"@carbon/cli-reporter": "^10.
|
|
38
|
+
"@carbon/cli": "^10.25.0",
|
|
39
|
+
"@carbon/cli-reporter": "^10.5.0",
|
|
40
40
|
"@carbon/scss-generator": "^10.13.0",
|
|
41
|
-
"@carbon/test-utils": "^10.16.0
|
|
41
|
+
"@carbon/test-utils": "^10.16.0",
|
|
42
42
|
"change-case": "^4.1.1",
|
|
43
43
|
"core-js": "^3.6.5",
|
|
44
44
|
"fs-extra": "^8.1.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"node-sass": "^4.13.1",
|
|
47
47
|
"rimraf": "^3.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "74da5c7df7a93263ed79ed9b3dd6dc2b52d80024"
|
|
50
50
|
}
|
|
@@ -264,6 +264,87 @@
|
|
|
264
264
|
$icon-size-01: map-get($theme, 'icon-size-01') !global;
|
|
265
265
|
$icon-size-02: map-get($theme, 'icon-size-02') !global;
|
|
266
266
|
|
|
267
|
+
@if global-variable-exists('feature-flags') ==
|
|
268
|
+
false or
|
|
269
|
+
global-variable-exists('feature-flags') and
|
|
270
|
+
map-get($feature-flags, 'enable-v11-release') !=
|
|
271
|
+
true
|
|
272
|
+
{
|
|
273
|
+
$background: $ui-background !global;
|
|
274
|
+
$layer: $ui-01 !global;
|
|
275
|
+
$layer-accent: $ui-03 !global;
|
|
276
|
+
$field: $field-01 !global;
|
|
277
|
+
$background-inverse: $inverse-02 !global;
|
|
278
|
+
$background-brand: $interactive-01 !global;
|
|
279
|
+
$interactive: $interactive-04 !global;
|
|
280
|
+
$border-subtle: $ui-03 !global;
|
|
281
|
+
$border-strong: $ui-04 !global;
|
|
282
|
+
$border-inverse: $ui-05 !global;
|
|
283
|
+
$border-interactive: $interactive-04 !global;
|
|
284
|
+
$text-primary: $text-01 !global;
|
|
285
|
+
$text-secondary: $text-02 !global;
|
|
286
|
+
$text-placeholder: $text-03 !global;
|
|
287
|
+
$text-helper: $text-05 !global;
|
|
288
|
+
$text-on-color: $text-04 !global;
|
|
289
|
+
$text-inverse: $inverse-01 !global;
|
|
290
|
+
$link-primary: $link-01 !global;
|
|
291
|
+
$link-secondary: $link-02 !global;
|
|
292
|
+
$link-visited: $visited-link !global;
|
|
293
|
+
$link-inverse: $inverse-link !global;
|
|
294
|
+
$icon-primary: $icon-01 !global;
|
|
295
|
+
$icon-secondary: $icon-02 !global;
|
|
296
|
+
$icon-on-color: $icon-03 !global;
|
|
297
|
+
$icon-inverse: $inverse-01 !global;
|
|
298
|
+
$support-error: $support-01 !global;
|
|
299
|
+
$support-success: $support-02 !global;
|
|
300
|
+
$support-warning: $support-03 !global;
|
|
301
|
+
$support-info: $support-04 !global;
|
|
302
|
+
$support-error-inverse: $inverse-support-01 !global;
|
|
303
|
+
$support-success-inverse: $inverse-support-02 !global;
|
|
304
|
+
$support-warning-inverse: $inverse-support-03 !global;
|
|
305
|
+
$support-info-inverse: $inverse-support-04 !global;
|
|
306
|
+
$overlay: $overlay-01 !global;
|
|
307
|
+
$toggle-off: $ui-04 !global;
|
|
308
|
+
$button-primary: $interactive-01 !global;
|
|
309
|
+
$button-secondary: $interactive-02 !global;
|
|
310
|
+
$button-tertiary: $interactive-03 !global;
|
|
311
|
+
$button-danger-primary: $danger-01 !global;
|
|
312
|
+
$button-danger-secondary: $danger-02 !global;
|
|
313
|
+
$background-active: $active-ui !global;
|
|
314
|
+
$layer-active: $active-ui !global;
|
|
315
|
+
$button-danger-active: $active-danger !global;
|
|
316
|
+
$button-primary-active: $active-primary !global;
|
|
317
|
+
$button-secondary-active: $active-secondary !global;
|
|
318
|
+
$button-tertiary-active: $active-tertiary !global;
|
|
319
|
+
$focus-inset: $inverse-01 !global;
|
|
320
|
+
$focus-inverse: $inverse-focus-ui !global;
|
|
321
|
+
$background-hover: $hover-ui !global;
|
|
322
|
+
$layer-hover: $hover-ui !global;
|
|
323
|
+
$field-hover: $hover-ui !global;
|
|
324
|
+
$background-inverse-hover: $inverse-hover-ui !global;
|
|
325
|
+
$link-primary-hover: $hover-primary-text !global;
|
|
326
|
+
$button-danger-hover: $hover-danger !global;
|
|
327
|
+
$button-primary-hover: $hover-primary !global;
|
|
328
|
+
$button-secondary-hover: $hover-secondary !global;
|
|
329
|
+
$button-tertiary-hover: $hover-tertiary !global;
|
|
330
|
+
$background-selected: $selected-ui !global;
|
|
331
|
+
$background-selected-hover: $hover-selected-ui !global;
|
|
332
|
+
$layer-selected: $selected-ui !global;
|
|
333
|
+
$layer-selected-hover: $hover-selected-ui !global;
|
|
334
|
+
$layer-selected-inverse: $ui-05 !global;
|
|
335
|
+
$border-subtle-selected: $active-ui !global;
|
|
336
|
+
$layer-disabled: $disabled-01 !global;
|
|
337
|
+
$field-disabled: $disabled-01 !global;
|
|
338
|
+
$border-disabled: $disabled-01 !global;
|
|
339
|
+
$text-disabled: $disabled-02 !global;
|
|
340
|
+
$button-disabled: $disabled-02 !global;
|
|
341
|
+
$icon-disabled: $disabled-02 !global;
|
|
342
|
+
$text-on-color-disabled: $disabled-03 !global;
|
|
343
|
+
$icon-on-color-disabled: $disabled-03 !global;
|
|
344
|
+
$layer-selected-disabled: $disabled-03 !global;
|
|
345
|
+
$skeleton-background: $skeleton-01 !global;
|
|
346
|
+
$skeleton-element: $skeleton-02 !global;
|
|
347
|
+
}
|
|
267
348
|
@if global-variable-exists('feature-flags') and
|
|
268
349
|
map-get($feature-flags, 'enable-css-custom-properties')
|
|
269
350
|
{
|
package/scss/modules/_theme.scss
CHANGED
|
@@ -14,7 +14,7 @@ $-custom-property-prefix: 'cds';
|
|
|
14
14
|
|
|
15
15
|
/// @access public
|
|
16
16
|
/// @group @carbon/themes
|
|
17
|
-
@mixin theme($active-theme: $theme) {
|
|
17
|
+
@mixin theme($active-theme: $theme, $component-tokens...) {
|
|
18
18
|
$parent-theme: $theme;
|
|
19
19
|
$theme: $active-theme !global;
|
|
20
20
|
|
|
@@ -22,6 +22,12 @@ $-custom-property-prefix: 'cds';
|
|
|
22
22
|
@include -custom-property($token, $value);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
@each $group in $component-tokens {
|
|
26
|
+
@each $token, $value in $group {
|
|
27
|
+
@include -custom-property($token, $value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
@content;
|
|
26
32
|
|
|
27
33
|
$theme: $parent-theme !global;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A Token is the simplest unit in our theme. It can have a name, properties
|
|
10
|
+
* that it applies to like border or background, along with a state if the
|
|
11
|
+
* token should only be used for specific states like hover or focus.
|
|
12
|
+
*/
|
|
13
|
+
export class Token {
|
|
14
|
+
static create(token) {
|
|
15
|
+
if (typeof token === 'string') {
|
|
16
|
+
return new Token(token);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return new Token(token.name, token.properties, token.state);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
constructor(name, properties, state) {
|
|
23
|
+
this.kind = 'Token';
|
|
24
|
+
this.name = name;
|
|
25
|
+
|
|
26
|
+
if (properties) {
|
|
27
|
+
this.properties = properties;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (state) {
|
|
31
|
+
this.state = state;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
|
|
8
|
+
const formats = {
|
|
9
|
+
js: 'javascript',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const TokenFormat = {
|
|
13
|
+
formats,
|
|
14
|
+
|
|
15
|
+
convert({ name, format }) {
|
|
16
|
+
if (format === formats.js) {
|
|
17
|
+
const keywords = new Set(['ui']);
|
|
18
|
+
|
|
19
|
+
return name
|
|
20
|
+
.split('-')
|
|
21
|
+
.map((part, index) => {
|
|
22
|
+
if (index === 0) {
|
|
23
|
+
return part;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (keywords.has(part)) {
|
|
27
|
+
return part.toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return part[0].toUpperCase() + part.slice(1);
|
|
31
|
+
})
|
|
32
|
+
.join('');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return name;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
|
|
8
|
+
import { Token } from './Token';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A TokenGroup allows us to group up a collection of tokens and nested token
|
|
12
|
+
* groups. A group allows us to colocate related tokens and write information
|
|
13
|
+
* once that applies to the entire collection of tokens. For example, if all the
|
|
14
|
+
* tokens apply to the `border` color property then we can specify this property
|
|
15
|
+
* at the group level
|
|
16
|
+
*
|
|
17
|
+
* A TokenGroup allows us to colocate all this information while also providing
|
|
18
|
+
* ways to get information about the entire group, including properties and
|
|
19
|
+
* states
|
|
20
|
+
*/
|
|
21
|
+
export class TokenGroup {
|
|
22
|
+
static create({ name, properties, tokens = [] }) {
|
|
23
|
+
return new TokenGroup(name, tokens, properties);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
constructor(name, tokens, properties) {
|
|
27
|
+
this.kind = 'TokenGroup';
|
|
28
|
+
this.name = name;
|
|
29
|
+
|
|
30
|
+
if (properties) {
|
|
31
|
+
this.properties = properties;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.children = tokens.map((child) => {
|
|
35
|
+
if (child.kind === 'TokenGroup') {
|
|
36
|
+
return child;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return Token.create(child);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
*[Symbol.iterator]() {
|
|
44
|
+
yield this;
|
|
45
|
+
|
|
46
|
+
for (const child of this.children) {
|
|
47
|
+
yield child;
|
|
48
|
+
|
|
49
|
+
if (child.kind === 'TokenGroup') {
|
|
50
|
+
yield* child;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get all the tokens available in every Token Group in this TokenGroup,
|
|
57
|
+
* including itself.
|
|
58
|
+
* @returns {Array<Token>}
|
|
59
|
+
*/
|
|
60
|
+
getTokens(parentContext = {}) {
|
|
61
|
+
const context = {
|
|
62
|
+
...parentContext,
|
|
63
|
+
groups: parentContext.groups ? parentContext.groups.concat(this) : [this],
|
|
64
|
+
properties: this.properties || parentContext.properties,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return this.children.flatMap((child) => {
|
|
68
|
+
if (child.kind === 'TokenGroup') {
|
|
69
|
+
return child.getTokens(context);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const token = {
|
|
73
|
+
...context,
|
|
74
|
+
name: child.name,
|
|
75
|
+
properties: child.properties || context.properties,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
if (child.state) {
|
|
79
|
+
token.state = child.state;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return token;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get a specific token from the TokenGroup, or form one of its nested
|
|
88
|
+
* TokenGroups
|
|
89
|
+
* @returns {Token}
|
|
90
|
+
*/
|
|
91
|
+
getToken(tokenOrName) {
|
|
92
|
+
const name =
|
|
93
|
+
typeof tokenOrName === 'string' ? tokenOrName : tokenOrName.name;
|
|
94
|
+
for (const child of this) {
|
|
95
|
+
if (child.kind === 'TokenGroup') {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (child.name === name) {
|
|
100
|
+
return child;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get all the unique groups in the token group, including this group
|
|
108
|
+
* @returns {Array<TokenGroup>}
|
|
109
|
+
*/
|
|
110
|
+
getTokenGroups() {
|
|
111
|
+
const set = new Set();
|
|
112
|
+
|
|
113
|
+
for (const child of this) {
|
|
114
|
+
if (child.kind !== 'TokenGroup') {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
set.add(child);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return Array.from(set);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get all the unique properties in the token group, including this group
|
|
125
|
+
* @returns {Array<string>}
|
|
126
|
+
*/
|
|
127
|
+
getTokenProperties() {
|
|
128
|
+
const set = new Set();
|
|
129
|
+
|
|
130
|
+
for (const child of this) {
|
|
131
|
+
if (!Array.isArray(child.properties)) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
for (const property of child.properties) {
|
|
136
|
+
set.add(property);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return Array.from(set);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get all the unique states in the token group, including this group
|
|
145
|
+
* @returns {Array<string>}
|
|
146
|
+
*/
|
|
147
|
+
getTokenStates() {
|
|
148
|
+
const set = new Set();
|
|
149
|
+
|
|
150
|
+
for (const child of this) {
|
|
151
|
+
if (child.kind !== 'Token') {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (child.state) {
|
|
155
|
+
set.add(child.state);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return Array.from(set);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A token set is a collection of tokens which should be along with each other.
|
|
10
|
+
* For example, we have tokens that correspond to a layer level in a UI. A
|
|
11
|
+
* token set allows us to group these tokens together in a way that's different
|
|
12
|
+
* than their token group.
|
|
13
|
+
*/
|
|
14
|
+
export class TokenSet {
|
|
15
|
+
static create({ name, tokens }) {
|
|
16
|
+
return new TokenSet(name, tokens);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
constructor(name, tokens = []) {
|
|
20
|
+
this.kind = 'TokenSet';
|
|
21
|
+
this.name = name;
|
|
22
|
+
this.children = tokens;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
*[Symbol.iterator]() {
|
|
26
|
+
for (const child of this.children) {
|
|
27
|
+
yield child;
|
|
28
|
+
|
|
29
|
+
if (child.kind === 'TokenSet') {
|
|
30
|
+
yield* child;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getTokenSets() {
|
|
36
|
+
const children = this.children
|
|
37
|
+
.filter((child) => {
|
|
38
|
+
return child.kind === 'TokenSet';
|
|
39
|
+
})
|
|
40
|
+
.flatMap((child) => {
|
|
41
|
+
return child.getTokenSets();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return [this, ...children];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getTokenSet(name) {
|
|
48
|
+
for (const child of this) {
|
|
49
|
+
if (!child.kind === 'TokenSet') {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (child.name === name) {
|
|
54
|
+
return child;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
hasToken(tokenOrName) {
|
|
62
|
+
const name =
|
|
63
|
+
typeof tokenOrName === 'string' ? tokenOrName : tokenOrName.name;
|
|
64
|
+
|
|
65
|
+
for (const child of this) {
|
|
66
|
+
if (child.kind === 'TokenSet') {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (child.name === name) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
|
|
8
|
+
import { Token } from './Token';
|
|
9
|
+
import { TokenFormat } from './TokenFormat';
|
|
10
|
+
import { TokenGroup } from './TokenGroup';
|
|
11
|
+
import { TokenSet } from './TokenSet';
|
|
12
|
+
|
|
13
|
+
export { Token, TokenFormat, TokenGroup, TokenSet };
|
|
@@ -0,0 +1,357 @@
|
|
|
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
|
+
|
|
8
|
+
import { TokenGroup } from './TokenGroup';
|
|
9
|
+
|
|
10
|
+
export const background = TokenGroup.create({
|
|
11
|
+
name: 'Background',
|
|
12
|
+
properties: ['background'],
|
|
13
|
+
tokens: [
|
|
14
|
+
'background',
|
|
15
|
+
{
|
|
16
|
+
name: 'background-active',
|
|
17
|
+
state: 'active',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'background-selected',
|
|
21
|
+
state: 'selected',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'background-selected-hover',
|
|
25
|
+
state: 'hover',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'background-hover',
|
|
29
|
+
state: 'hover',
|
|
30
|
+
},
|
|
31
|
+
'background-brand',
|
|
32
|
+
'background-inverse',
|
|
33
|
+
{
|
|
34
|
+
state: 'hover',
|
|
35
|
+
name: 'background-inverse-hover',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const layer = TokenGroup.create({
|
|
41
|
+
name: 'Layer',
|
|
42
|
+
properties: ['background'],
|
|
43
|
+
tokens: [
|
|
44
|
+
{
|
|
45
|
+
name: 'layer-01',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
state: 'active',
|
|
49
|
+
name: 'layer-active-01',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
state: 'hover',
|
|
53
|
+
name: 'layer-hover-01',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
state: 'selected',
|
|
57
|
+
name: 'layer-selected-01',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
state: 'hover',
|
|
61
|
+
name: 'layer-selected-hover-01',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'layer-02',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
state: 'active',
|
|
68
|
+
name: 'layer-active-02',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
state: 'hover',
|
|
72
|
+
name: 'layer-hover-02',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
state: 'selected',
|
|
76
|
+
name: 'layer-selected-02',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
state: 'hover',
|
|
80
|
+
name: 'layer-selected-hover-02',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'layer-03',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
state: 'active',
|
|
87
|
+
name: 'layer-active-03',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
state: 'hover',
|
|
91
|
+
name: 'layer-hover-03',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
state: 'selected',
|
|
95
|
+
name: 'layer-selected-03',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
state: 'hover',
|
|
99
|
+
name: 'layer-selected-hover-03',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
state: 'disabled',
|
|
103
|
+
name: 'layer-disabled',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'layer-selected-inverse',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
state: 'disabled',
|
|
110
|
+
name: 'layer-selected-disabled',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'layer-accent-01',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
state: 'active',
|
|
117
|
+
name: 'layer-accent-active-01',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
state: 'hover',
|
|
121
|
+
name: 'layer-accent-hover-01',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'layer-accent-02',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
state: 'active',
|
|
128
|
+
name: 'layer-accent-active-02',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
state: 'hover',
|
|
132
|
+
name: 'layer-accent-hover-02',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'layer-accent-03',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
state: 'active',
|
|
139
|
+
name: 'layer-accent-active-03',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
state: 'hover',
|
|
143
|
+
name: 'layer-accent-hover-03',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export const field = TokenGroup.create({
|
|
149
|
+
name: 'Field',
|
|
150
|
+
properties: ['background'],
|
|
151
|
+
tokens: [
|
|
152
|
+
{
|
|
153
|
+
name: 'field-01',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
state: 'hover',
|
|
157
|
+
name: 'field-hover-01',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'field-02',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
state: 'hover',
|
|
164
|
+
name: 'field-hover-02',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'field-03',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
state: 'hover',
|
|
171
|
+
name: 'field-hover-03',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
state: 'disabled',
|
|
175
|
+
name: 'field-disabled',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
export const border = TokenGroup.create({
|
|
181
|
+
name: 'Borders',
|
|
182
|
+
properties: ['border'],
|
|
183
|
+
tokens: [
|
|
184
|
+
{
|
|
185
|
+
name: 'border-subtle-00',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'border-subtle-01',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
state: 'selected',
|
|
192
|
+
name: 'border-subtle-selected-01',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'border-subtle-02',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
state: 'selected',
|
|
199
|
+
name: 'border-subtle-selected-02',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'border-subtle-03',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
state: 'selected',
|
|
206
|
+
name: 'border-subtle-selected-03',
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
// Border strong
|
|
210
|
+
'border-strong-01',
|
|
211
|
+
'border-strong-02',
|
|
212
|
+
'border-strong-03',
|
|
213
|
+
|
|
214
|
+
// Border inverse
|
|
215
|
+
'border-inverse',
|
|
216
|
+
|
|
217
|
+
// Border interactive
|
|
218
|
+
'border-interactive',
|
|
219
|
+
|
|
220
|
+
{
|
|
221
|
+
state: 'disabled',
|
|
222
|
+
name: 'border-disabled',
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
export const text = TokenGroup.create({
|
|
228
|
+
name: 'Text',
|
|
229
|
+
properties: ['color'],
|
|
230
|
+
tokens: [
|
|
231
|
+
'text-primary',
|
|
232
|
+
'text-secondary',
|
|
233
|
+
'text-placeholder',
|
|
234
|
+
'text-helper',
|
|
235
|
+
'text-error',
|
|
236
|
+
'text-inverse',
|
|
237
|
+
{
|
|
238
|
+
name: 'text-on-color',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
state: 'disabled',
|
|
242
|
+
name: 'text-on-color-disabled',
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
{
|
|
246
|
+
state: 'disabled',
|
|
247
|
+
name: 'text-disabled',
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
export const link = TokenGroup.create({
|
|
253
|
+
name: 'Link',
|
|
254
|
+
properties: ['color'],
|
|
255
|
+
tokens: [
|
|
256
|
+
{
|
|
257
|
+
name: 'link-primary',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
state: 'hover',
|
|
261
|
+
name: 'link-primary-hover',
|
|
262
|
+
},
|
|
263
|
+
'link-secondary',
|
|
264
|
+
'link-inverse',
|
|
265
|
+
{
|
|
266
|
+
state: 'visited',
|
|
267
|
+
name: 'link-visited',
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export const icon = TokenGroup.create({
|
|
273
|
+
name: 'Icons',
|
|
274
|
+
properties: ['background', 'fill', 'stroke'],
|
|
275
|
+
tokens: [
|
|
276
|
+
'icon-primary',
|
|
277
|
+
'icon-secondary',
|
|
278
|
+
'icon-inverse',
|
|
279
|
+
{
|
|
280
|
+
name: 'icon-on-color',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
state: 'disabled',
|
|
284
|
+
name: 'icon-on-color-disabled',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
state: 'disabled',
|
|
288
|
+
name: 'icon-disabled',
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
export const support = TokenGroup.create({
|
|
294
|
+
name: 'Support',
|
|
295
|
+
properties: ['background', 'fill', 'stroke'],
|
|
296
|
+
tokens: [
|
|
297
|
+
'support-error',
|
|
298
|
+
'support-success',
|
|
299
|
+
'support-warning',
|
|
300
|
+
'support-info',
|
|
301
|
+
'support-error-inverse',
|
|
302
|
+
'support-success-inverse',
|
|
303
|
+
'support-warning-inverse',
|
|
304
|
+
'support-info-inverse',
|
|
305
|
+
'support-caution-major',
|
|
306
|
+
'support-caution-minor',
|
|
307
|
+
'support-caution-undefined',
|
|
308
|
+
],
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
export const focus = TokenGroup.create({
|
|
312
|
+
name: 'Focus',
|
|
313
|
+
properties: ['border'],
|
|
314
|
+
tokens: ['focus', 'focus-inset', 'focus-inverse'],
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
export const skeleton = TokenGroup.create({
|
|
318
|
+
name: 'Skeleton',
|
|
319
|
+
properties: ['background'],
|
|
320
|
+
tokens: ['skeleton-background', 'skeleton-element'],
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
export const group = TokenGroup.create({
|
|
324
|
+
name: 'v11',
|
|
325
|
+
tokens: [
|
|
326
|
+
background,
|
|
327
|
+
layer,
|
|
328
|
+
field,
|
|
329
|
+
|
|
330
|
+
// Interactive
|
|
331
|
+
{
|
|
332
|
+
name: 'interactive',
|
|
333
|
+
properties: ['background', 'color'],
|
|
334
|
+
},
|
|
335
|
+
|
|
336
|
+
border,
|
|
337
|
+
text,
|
|
338
|
+
link,
|
|
339
|
+
icon,
|
|
340
|
+
support,
|
|
341
|
+
|
|
342
|
+
// Misc
|
|
343
|
+
{
|
|
344
|
+
name: 'highlight',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'overlay',
|
|
348
|
+
properties: ['background'],
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: 'toggle-off',
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
focus,
|
|
355
|
+
skeleton,
|
|
356
|
+
],
|
|
357
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
|
|
8
|
+
import { TokenSet } from './TokenSet';
|
|
9
|
+
import { background, border, field, layer } from './v11TokenGroup';
|
|
10
|
+
|
|
11
|
+
export const set = TokenSet.create({
|
|
12
|
+
name: 'All',
|
|
13
|
+
tokens: [
|
|
14
|
+
TokenSet.create({
|
|
15
|
+
name: 'Base set',
|
|
16
|
+
tokens: [
|
|
17
|
+
background.getToken('background'),
|
|
18
|
+
background.getToken('background-hover'),
|
|
19
|
+
background.getToken('background-selected'),
|
|
20
|
+
background.getToken('background-selected-hover'),
|
|
21
|
+
border.getToken('border-subtle-00'),
|
|
22
|
+
],
|
|
23
|
+
}),
|
|
24
|
+
TokenSet.create({
|
|
25
|
+
name: '01 Layer set',
|
|
26
|
+
tokens: [
|
|
27
|
+
layer.getToken('layer-01'),
|
|
28
|
+
layer.getToken('layer-active-01'),
|
|
29
|
+
layer.getToken('layer-hover-01'),
|
|
30
|
+
layer.getToken('layer-selected-hover-01'),
|
|
31
|
+
layer.getToken('layer-accent-01'),
|
|
32
|
+
layer.getToken('layer-accent-active-01'),
|
|
33
|
+
layer.getToken('layer-accent-hover-01'),
|
|
34
|
+
|
|
35
|
+
field.getToken('field-01'),
|
|
36
|
+
field.getToken('field-hover-01'),
|
|
37
|
+
|
|
38
|
+
border.getToken('border-subtle-01'),
|
|
39
|
+
border.getToken('border-subtle-selected-01'),
|
|
40
|
+
|
|
41
|
+
border.getToken('border-strong-01'),
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
TokenSet.create({
|
|
45
|
+
name: '02 Layer set',
|
|
46
|
+
tokens: [
|
|
47
|
+
layer.getToken('layer-02'),
|
|
48
|
+
layer.getToken('layer-active-02'),
|
|
49
|
+
layer.getToken('layer-hover-02'),
|
|
50
|
+
layer.getToken('layer-selected-hover-02'),
|
|
51
|
+
layer.getToken('layer-accent-02'),
|
|
52
|
+
layer.getToken('layer-accent-active-02'),
|
|
53
|
+
layer.getToken('layer-accent-hover-02'),
|
|
54
|
+
|
|
55
|
+
field.getToken('field-02'),
|
|
56
|
+
field.getToken('field-hover-02'),
|
|
57
|
+
|
|
58
|
+
border.getToken('border-subtle-02'),
|
|
59
|
+
border.getToken('border-subtle-selected-02'),
|
|
60
|
+
|
|
61
|
+
border.getToken('border-strong-02'),
|
|
62
|
+
],
|
|
63
|
+
}),
|
|
64
|
+
TokenSet.create({
|
|
65
|
+
name: '03 Layer set',
|
|
66
|
+
tokens: [
|
|
67
|
+
layer.getToken('layer-03'),
|
|
68
|
+
layer.getToken('layer-active-03'),
|
|
69
|
+
layer.getToken('layer-hover-03'),
|
|
70
|
+
layer.getToken('layer-selected-hover-03'),
|
|
71
|
+
layer.getToken('layer-accent-03'),
|
|
72
|
+
layer.getToken('layer-accent-active-03'),
|
|
73
|
+
layer.getToken('layer-accent-hover-03'),
|
|
74
|
+
|
|
75
|
+
field.getToken('field-03'),
|
|
76
|
+
field.getToken('field-hover-03'),
|
|
77
|
+
|
|
78
|
+
border.getToken('border-subtle-03'),
|
|
79
|
+
border.getToken('border-subtle-selected-03'),
|
|
80
|
+
|
|
81
|
+
border.getToken('border-strong-03'),
|
|
82
|
+
],
|
|
83
|
+
}),
|
|
84
|
+
],
|
|
85
|
+
});
|