@carbon/themes 11.10.0 → 11.11.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/es/index.js +598 -140
- package/index.scss +1 -0
- package/lib/index.js +601 -139
- package/package.json +4 -4
- package/scss/_component-tokens.scss +10 -0
- package/scss/generated/_button-tokens.scss +115 -0
- package/scss/generated/_notification-tokens.scss +88 -0
- package/scss/generated/_tag-tokens.scss +219 -0
- package/src/component-tokens/button/index.js +1 -0
- package/src/component-tokens/button/tokens.js +123 -0
- package/src/component-tokens/notification/index.js +1 -0
- package/src/component-tokens/notification/tokens.js +103 -0
- package/src/component-tokens/tag/index.js +1 -0
- package/src/component-tokens/tag/tokens.js +260 -0
- package/src/index.js +17 -1
- package/src/tools.js +40 -0
- package/src/v10/tokens.js +0 -40
- package/umd/index.js +601 -139
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import {
|
|
2
|
+
red20,
|
|
3
|
+
red70,
|
|
4
|
+
red80,
|
|
5
|
+
red30,
|
|
6
|
+
red70Hover,
|
|
7
|
+
magenta20,
|
|
8
|
+
magenta70,
|
|
9
|
+
magenta80,
|
|
10
|
+
magenta30,
|
|
11
|
+
magenta70Hover,
|
|
12
|
+
purple20,
|
|
13
|
+
purple70,
|
|
14
|
+
purple80,
|
|
15
|
+
purple30,
|
|
16
|
+
purple70Hover,
|
|
17
|
+
blue20,
|
|
18
|
+
blue70,
|
|
19
|
+
blue80,
|
|
20
|
+
blue30,
|
|
21
|
+
blue70Hover,
|
|
22
|
+
cyan20,
|
|
23
|
+
cyan70,
|
|
24
|
+
cyan80,
|
|
25
|
+
cyan30,
|
|
26
|
+
cyan70Hover,
|
|
27
|
+
teal20,
|
|
28
|
+
teal70,
|
|
29
|
+
teal80,
|
|
30
|
+
teal30,
|
|
31
|
+
teal70Hover,
|
|
32
|
+
green20,
|
|
33
|
+
green70,
|
|
34
|
+
green80,
|
|
35
|
+
green30,
|
|
36
|
+
green70Hover,
|
|
37
|
+
gray20,
|
|
38
|
+
gray70,
|
|
39
|
+
gray80,
|
|
40
|
+
gray30,
|
|
41
|
+
gray70Hover,
|
|
42
|
+
warmGray20,
|
|
43
|
+
warmGray70,
|
|
44
|
+
warmGray80,
|
|
45
|
+
warmGray30,
|
|
46
|
+
warmGray70Hover,
|
|
47
|
+
coolGray20,
|
|
48
|
+
coolGray70,
|
|
49
|
+
coolGray80,
|
|
50
|
+
coolGray30,
|
|
51
|
+
coolGray70Hover,
|
|
52
|
+
} from '@carbon/colors';
|
|
53
|
+
|
|
54
|
+
export const tagBackgroundRed = {
|
|
55
|
+
whiteTheme: red20,
|
|
56
|
+
g10: red20,
|
|
57
|
+
g90: red70,
|
|
58
|
+
g100: red70,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const tagColorRed = {
|
|
62
|
+
whiteTheme: red80,
|
|
63
|
+
g10: red80,
|
|
64
|
+
g90: red20,
|
|
65
|
+
g100: red20,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const tagHoverRed = {
|
|
69
|
+
whiteTheme: red30,
|
|
70
|
+
g10: red30,
|
|
71
|
+
g90: red70Hover,
|
|
72
|
+
g100: red70Hover,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const tagBackgroundMagenta = {
|
|
76
|
+
whiteTheme: magenta20,
|
|
77
|
+
g10: magenta20,
|
|
78
|
+
g90: magenta70,
|
|
79
|
+
g100: magenta70,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const tagColorMagenta = {
|
|
83
|
+
whiteTheme: magenta80,
|
|
84
|
+
g10: magenta80,
|
|
85
|
+
g90: magenta20,
|
|
86
|
+
g100: magenta20,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const tagHoverMagenta = {
|
|
90
|
+
whiteTheme: magenta30,
|
|
91
|
+
g10: magenta30,
|
|
92
|
+
g90: magenta70Hover,
|
|
93
|
+
g100: magenta70Hover,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const tagBackgroundPurple = {
|
|
97
|
+
whiteTheme: purple20,
|
|
98
|
+
g10: purple20,
|
|
99
|
+
g90: purple70,
|
|
100
|
+
g100: purple70,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const tagColorPurple = {
|
|
104
|
+
whiteTheme: purple80,
|
|
105
|
+
g10: purple80,
|
|
106
|
+
g90: purple20,
|
|
107
|
+
g100: purple20,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const tagHoverPurple = {
|
|
111
|
+
whiteTheme: purple30,
|
|
112
|
+
g10: purple30,
|
|
113
|
+
g90: purple70Hover,
|
|
114
|
+
g100: purple70Hover,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const tagBackgroundBlue = {
|
|
118
|
+
whiteTheme: blue20,
|
|
119
|
+
g10: blue20,
|
|
120
|
+
g90: blue70,
|
|
121
|
+
g100: blue70,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const tagColorBlue = {
|
|
125
|
+
whiteTheme: blue80,
|
|
126
|
+
g10: blue80,
|
|
127
|
+
g90: blue20,
|
|
128
|
+
g100: blue20,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const tagHoverBlue = {
|
|
132
|
+
whiteTheme: blue30,
|
|
133
|
+
g10: blue30,
|
|
134
|
+
g90: blue70Hover,
|
|
135
|
+
g100: blue70Hover,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const tagBackgroundCyan = {
|
|
139
|
+
whiteTheme: cyan20,
|
|
140
|
+
g10: cyan20,
|
|
141
|
+
g90: cyan70,
|
|
142
|
+
g100: cyan70,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const tagColorCyan = {
|
|
146
|
+
whiteTheme: cyan80,
|
|
147
|
+
g10: cyan80,
|
|
148
|
+
g90: cyan20,
|
|
149
|
+
g100: cyan20,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const tagHoverCyan = {
|
|
153
|
+
whiteTheme: cyan30,
|
|
154
|
+
g10: cyan30,
|
|
155
|
+
g90: cyan70Hover,
|
|
156
|
+
g100: cyan70Hover,
|
|
157
|
+
};
|
|
158
|
+
export const tagBackgroundTeal = {
|
|
159
|
+
whiteTheme: teal20,
|
|
160
|
+
g10: teal20,
|
|
161
|
+
g90: teal70,
|
|
162
|
+
g100: teal70,
|
|
163
|
+
};
|
|
164
|
+
export const tagColorTeal = {
|
|
165
|
+
whiteTheme: teal80,
|
|
166
|
+
g10: teal80,
|
|
167
|
+
g90: teal20,
|
|
168
|
+
g100: teal20,
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const tagHoverTeal = {
|
|
172
|
+
whiteTheme: teal30,
|
|
173
|
+
g10: teal30,
|
|
174
|
+
g90: teal70Hover,
|
|
175
|
+
g100: teal70Hover,
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const tagBackgroundGreen = {
|
|
179
|
+
whiteTheme: green20,
|
|
180
|
+
g10: green20,
|
|
181
|
+
g90: green70,
|
|
182
|
+
g100: green70,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const tagColorGreen = {
|
|
186
|
+
whiteTheme: green80,
|
|
187
|
+
g10: green80,
|
|
188
|
+
g90: green20,
|
|
189
|
+
g100: green20,
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const tagHoverGreen = {
|
|
193
|
+
whiteTheme: green30,
|
|
194
|
+
g10: green30,
|
|
195
|
+
g90: green70Hover,
|
|
196
|
+
g100: green70Hover,
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const tagBackgroundGray = {
|
|
200
|
+
whiteTheme: gray20,
|
|
201
|
+
g10: gray20,
|
|
202
|
+
g90: gray70,
|
|
203
|
+
g100: gray70,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const tagColorGray = {
|
|
207
|
+
whiteTheme: gray80,
|
|
208
|
+
g10: gray80,
|
|
209
|
+
g90: gray20,
|
|
210
|
+
g100: gray20,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const tagHoverGray = {
|
|
214
|
+
whiteTheme: gray30,
|
|
215
|
+
g10: gray30,
|
|
216
|
+
g90: gray70Hover,
|
|
217
|
+
g100: gray70Hover,
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export const tagBackgroundCoolGray = {
|
|
221
|
+
whiteTheme: coolGray20,
|
|
222
|
+
g10: coolGray20,
|
|
223
|
+
g90: coolGray70,
|
|
224
|
+
g100: coolGray70,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const tagColorCoolGray = {
|
|
228
|
+
whiteTheme: coolGray80,
|
|
229
|
+
g10: coolGray80,
|
|
230
|
+
g90: coolGray20,
|
|
231
|
+
g100: coolGray20,
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export const tagHoverCoolGray = {
|
|
235
|
+
whiteTheme: coolGray30,
|
|
236
|
+
g10: coolGray30,
|
|
237
|
+
g90: coolGray70Hover,
|
|
238
|
+
g100: coolGray70Hover,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export const tagBackgroundWarmGray = {
|
|
242
|
+
whiteTheme: warmGray20,
|
|
243
|
+
g10: warmGray20,
|
|
244
|
+
g90: warmGray70,
|
|
245
|
+
g100: warmGray70,
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export const tagColorWarmGray = {
|
|
249
|
+
whiteTheme: warmGray80,
|
|
250
|
+
g10: warmGray80,
|
|
251
|
+
g90: warmGray20,
|
|
252
|
+
g100: warmGray20,
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export const tagHoverWarmGray = {
|
|
256
|
+
whiteTheme: warmGray30,
|
|
257
|
+
g10: warmGray30,
|
|
258
|
+
g90: warmGray70Hover,
|
|
259
|
+
g100: warmGray70Hover,
|
|
260
|
+
};
|
package/src/index.js
CHANGED
|
@@ -10,6 +10,10 @@ import * as g10 from './g10';
|
|
|
10
10
|
import * as g90 from './g90';
|
|
11
11
|
import * as g100 from './g100';
|
|
12
12
|
import * as v10 from './v10';
|
|
13
|
+
import * as buttonTokens from './component-tokens/button';
|
|
14
|
+
import * as tagTokens from './component-tokens/tag';
|
|
15
|
+
import * as notificationTokens from './component-tokens/notification';
|
|
16
|
+
import { formatTokenName } from './tools';
|
|
13
17
|
import { unstable_metadata } from './tokens';
|
|
14
18
|
|
|
15
19
|
const themes = {
|
|
@@ -20,4 +24,16 @@ const themes = {
|
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export * from './white';
|
|
23
|
-
export {
|
|
27
|
+
export {
|
|
28
|
+
white,
|
|
29
|
+
g10,
|
|
30
|
+
g90,
|
|
31
|
+
g100,
|
|
32
|
+
themes,
|
|
33
|
+
v10,
|
|
34
|
+
buttonTokens,
|
|
35
|
+
tagTokens,
|
|
36
|
+
notificationTokens,
|
|
37
|
+
unstable_metadata,
|
|
38
|
+
formatTokenName,
|
|
39
|
+
};
|
package/src/tools.js
CHANGED
|
@@ -35,3 +35,43 @@ export function adjustLightness(token, shift) {
|
|
|
35
35
|
export function adjustAlpha(token, alpha) {
|
|
36
36
|
return Color(token).rgb().alpha(alpha).string();
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Format a given token into the format expected in CSS/SCSS-based projects.
|
|
43
|
+
* @param {string} token
|
|
44
|
+
* @returns {string}
|
|
45
|
+
*/
|
|
46
|
+
export function formatTokenName(token) {
|
|
47
|
+
let string = '';
|
|
48
|
+
|
|
49
|
+
for (let i = 0; i < token.length; i++) {
|
|
50
|
+
// If we run into a number, we hit the scale step at the end of a token name
|
|
51
|
+
// and can safely truncate the rest of the token
|
|
52
|
+
if (numbers.indexOf(token[i]) !== -1) {
|
|
53
|
+
string += '-' + token.slice(i);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// When encountering an uppercase name, we will want to start adding `-`
|
|
58
|
+
// between words
|
|
59
|
+
if (token[i] === token[i].toUpperCase()) {
|
|
60
|
+
// Check backwards to see if previous letter was also capitalized, if so
|
|
61
|
+
// we are in a special case like UI where each piece should be connected
|
|
62
|
+
if (token[i - 1] && token[i - 1] === token[i - 1].toUpperCase()) {
|
|
63
|
+
string += token[i].toLowerCase();
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Otherwise, just concatenate this new part on to the existing string
|
|
68
|
+
string += '-' + token[i].toLowerCase();
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// By default, we add the current character to the output string
|
|
73
|
+
string += token[i];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return string;
|
|
77
|
+
}
|
package/src/v10/tokens.js
CHANGED
|
@@ -208,46 +208,6 @@ const colors = [
|
|
|
208
208
|
'danger',
|
|
209
209
|
];
|
|
210
210
|
|
|
211
|
-
const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Format a given token into the format expected in CSS/SCSS-based projects.
|
|
215
|
-
* @param {string} token
|
|
216
|
-
* @returns {string}
|
|
217
|
-
*/
|
|
218
|
-
export function formatTokenName(token) {
|
|
219
|
-
let string = '';
|
|
220
|
-
|
|
221
|
-
for (let i = 0; i < token.length; i++) {
|
|
222
|
-
// If we run into a number, we hit the scale step at the end of a token name
|
|
223
|
-
// and can safely truncate the rest of the token
|
|
224
|
-
if (numbers.indexOf(token[i]) !== -1) {
|
|
225
|
-
string += '-' + token.slice(i);
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// When encountering an uppercase name, we will want to start adding `-`
|
|
230
|
-
// between words
|
|
231
|
-
if (token[i] === token[i].toUpperCase()) {
|
|
232
|
-
// Check backwards to see if previous letter was also capitalized, if so
|
|
233
|
-
// we are in a special case like UI where each piece should be connected
|
|
234
|
-
if (token[i - 1] && token[i - 1] === token[i - 1].toUpperCase()) {
|
|
235
|
-
string += token[i].toLowerCase();
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// Otherwise, just concatenate this new part on to the existing string
|
|
240
|
-
string += '-' + token[i].toLowerCase();
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// By default, we add the current character to the output string
|
|
245
|
-
string += token[i];
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return string;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
211
|
export const tokens = {
|
|
252
212
|
colors,
|
|
253
213
|
type,
|