@carbon/themes 12.0.0-alpha.1 → 12.0.0-alpha.2
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 +5572 -0
- package/lib/__tests__/themes-test.d.ts +1 -0
- package/lib/__tests__/tools-test.d.ts +1 -0
- package/lib/tokens/__tests__/Token-test.d.ts +1 -0
- package/lib/tokens/__tests__/TokenFormat-test.d.ts +1 -0
- package/lib/tokens/__tests__/TokenGroup-test.d.ts +1 -0
- package/lib/tokens/__tests__/TokenSet-test.d.ts +1 -0
- package/lib/tokens/__tests__/metadata-test.d.ts +1 -0
- package/lib/tokens/__tests__/v11-test.d.ts +1 -0
- package/lib/v10/__tests__/themes-test.d.ts +1 -0
- package/lib/v10/__tests__/tokens-test.d.ts +1 -0
- package/package.json +12 -4
- package/umd/index.js +6322 -0
- package/docs/sass.md +0 -189
- package/js/generated/component-tokens/button.d.ts +0 -98
- package/js/generated/component-tokens/button.js +0 -98
- package/js/generated/component-tokens/content-switcher.d.ts +0 -25
- package/js/generated/component-tokens/content-switcher.js +0 -25
- package/js/generated/component-tokens/notification.d.ts +0 -65
- package/js/generated/component-tokens/notification.js +0 -65
- package/js/generated/component-tokens/status.d.ts +0 -63
- package/js/generated/component-tokens/status.js +0 -63
- package/js/generated/component-tokens/tag.d.ts +0 -247
- package/js/generated/component-tokens/tag.js +0 -247
- package/js/generated/themes/g10.d.ts +0 -242
- package/js/generated/themes/g10.js +0 -242
- package/js/generated/themes/g100.d.ts +0 -242
- package/js/generated/themes/g100.js +0 -242
- package/js/generated/themes/g90.d.ts +0 -242
- package/js/generated/themes/g90.js +0 -242
- package/js/generated/themes/white.d.ts +0 -242
- package/js/generated/themes/white.js +0 -242
- package/src/dtcg/README.md +0 -336
- package/src/dtcg/color-palette.json +0 -4424
- package/src/dtcg/components/button.json +0 -193
- package/src/dtcg/components/content-switcher.json +0 -60
- package/src/dtcg/components/notification.json +0 -130
- package/src/dtcg/components/status.json +0 -122
- package/src/dtcg/components/tag.json +0 -486
- package/src/dtcg/themes.json +0 -3356
- package/src/index.ts +0 -129
- package/src/tokens/Token.ts +0 -41
- package/src/tokens/TokenFormat.ts +0 -93
- package/src/tokens/TokenGroup.ts +0 -185
- package/src/tokens/TokenSet.ts +0 -91
- package/src/tokens/components.ts +0 -120
- package/src/tokens/index.ts +0 -59
- package/src/tokens/layout.ts +0 -39
- package/src/tokens/type.ts +0 -49
- package/src/tokens/types.ts +0 -28
- package/src/tokens/v10.ts +0 -188
- package/src/tokens/v11TokenGroup.ts +0 -546
- package/src/tokens/v11TokenSet.ts +0 -93
- package/src/tools.ts +0 -69
- package/src/v10/g10.ts +0 -349
- package/src/v10/g100.ts +0 -348
- package/src/v10/g90.ts +0 -350
- package/src/v10/index.ts +0 -22
- package/src/v10/metadata.yml +0 -217
- package/src/v10/tokens.ts +0 -397
- package/src/v10/white.ts +0 -352
- package/style-dictionary/formats/js-component-tokens.js +0 -128
- package/style-dictionary/formats/js-themes.js +0 -84
- package/style-dictionary/formats/scss-component-tokens.js +0 -149
- package/style-dictionary/formats/scss-themes.js +0 -127
- package/style-dictionary/formats/scss-tokens.js +0 -91
- package/style-dictionary/preprocessors/component-tokens.js +0 -172
- package/style-dictionary/preprocessors/dual-role.js +0 -157
- package/style-dictionary/preprocessors/theme-metadata.js +0 -46
- package/style-dictionary/sd.config.js +0 -449
- package/style-dictionary/transforms/alpha-modifier.js +0 -68
- package/style-dictionary/transforms/color-flatten.js +0 -79
- package/test-dtcg.scss +0 -28
- package/tsconfig.json +0 -8
- package/tsconfig.types.json +0 -10
|
@@ -1,546 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2018, 2026
|
|
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
|
-
name: 'layer-background-01',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
state: 'hover',
|
|
56
|
-
name: 'layer-hover-01',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
state: 'selected',
|
|
60
|
-
name: 'layer-selected-01',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
state: 'hover',
|
|
64
|
-
name: 'layer-selected-hover-01',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'layer-02',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
state: 'active',
|
|
71
|
-
name: 'layer-active-02',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'layer-background-02',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
state: 'hover',
|
|
78
|
-
name: 'layer-hover-02',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
state: 'selected',
|
|
82
|
-
name: 'layer-selected-02',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
state: 'hover',
|
|
86
|
-
name: 'layer-selected-hover-02',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'layer-03',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
state: 'active',
|
|
93
|
-
name: 'layer-active-03',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'layer-background-03',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
state: 'hover',
|
|
100
|
-
name: 'layer-hover-03',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
state: 'selected',
|
|
104
|
-
name: 'layer-selected-03',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
state: 'hover',
|
|
108
|
-
name: 'layer-selected-hover-03',
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: 'layer-selected-inverse',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
state: 'disabled',
|
|
115
|
-
name: 'layer-selected-disabled',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'layer-accent-01',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
state: 'active',
|
|
122
|
-
name: 'layer-accent-active-01',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
state: 'hover',
|
|
126
|
-
name: 'layer-accent-hover-01',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: 'layer-accent-02',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
state: 'active',
|
|
133
|
-
name: 'layer-accent-active-02',
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
state: 'hover',
|
|
137
|
-
name: 'layer-accent-hover-02',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'layer-accent-03',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
state: 'active',
|
|
144
|
-
name: 'layer-accent-active-03',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
state: 'hover',
|
|
148
|
-
name: 'layer-accent-hover-03',
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
export const field = TokenGroup.create({
|
|
154
|
-
name: 'Field',
|
|
155
|
-
properties: ['background'],
|
|
156
|
-
tokens: [
|
|
157
|
-
{
|
|
158
|
-
name: 'field-01',
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
state: 'hover',
|
|
162
|
-
name: 'field-hover-01',
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: 'field-02',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
state: 'hover',
|
|
169
|
-
name: 'field-hover-02',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'field-03',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
state: 'hover',
|
|
176
|
-
name: 'field-hover-03',
|
|
177
|
-
},
|
|
178
|
-
],
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
export const border = TokenGroup.create({
|
|
182
|
-
name: 'Borders',
|
|
183
|
-
properties: ['border'],
|
|
184
|
-
tokens: [
|
|
185
|
-
{
|
|
186
|
-
name: 'border-subtle-00',
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: 'border-subtle-01',
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
state: 'selected',
|
|
193
|
-
name: 'border-subtle-selected-01',
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: 'border-subtle-02',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
state: 'selected',
|
|
200
|
-
name: 'border-subtle-selected-02',
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
name: 'border-subtle-03',
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
state: 'selected',
|
|
207
|
-
name: 'border-subtle-selected-03',
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
// Border strong
|
|
211
|
-
'border-strong-01',
|
|
212
|
-
'border-strong-02',
|
|
213
|
-
'border-strong-03',
|
|
214
|
-
|
|
215
|
-
// Border tile
|
|
216
|
-
'border-tile-01',
|
|
217
|
-
'border-tile-02',
|
|
218
|
-
'border-tile-03',
|
|
219
|
-
|
|
220
|
-
// Border inverse
|
|
221
|
-
'border-inverse',
|
|
222
|
-
|
|
223
|
-
// Border interactive
|
|
224
|
-
'border-interactive',
|
|
225
|
-
|
|
226
|
-
{
|
|
227
|
-
state: 'disabled',
|
|
228
|
-
name: 'border-disabled',
|
|
229
|
-
},
|
|
230
|
-
],
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
export const text = TokenGroup.create({
|
|
234
|
-
name: 'Text',
|
|
235
|
-
properties: ['text'],
|
|
236
|
-
tokens: [
|
|
237
|
-
'text-primary',
|
|
238
|
-
'text-secondary',
|
|
239
|
-
'text-placeholder',
|
|
240
|
-
'text-helper',
|
|
241
|
-
'text-error',
|
|
242
|
-
'text-inverse',
|
|
243
|
-
{
|
|
244
|
-
name: 'text-on-color',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
state: 'disabled',
|
|
248
|
-
name: 'text-on-color-disabled',
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
{
|
|
252
|
-
state: 'disabled',
|
|
253
|
-
name: 'text-disabled',
|
|
254
|
-
},
|
|
255
|
-
],
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
export const link = TokenGroup.create({
|
|
259
|
-
name: 'Link',
|
|
260
|
-
properties: ['text'],
|
|
261
|
-
tokens: [
|
|
262
|
-
{
|
|
263
|
-
name: 'link-primary',
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
state: 'hover',
|
|
267
|
-
name: 'link-primary-hover',
|
|
268
|
-
},
|
|
269
|
-
'link-secondary',
|
|
270
|
-
{
|
|
271
|
-
state: 'visited',
|
|
272
|
-
name: 'link-inverse-visited',
|
|
273
|
-
},
|
|
274
|
-
'link-visited',
|
|
275
|
-
'link-inverse',
|
|
276
|
-
'link-inverse-active',
|
|
277
|
-
'link-inverse-hover',
|
|
278
|
-
],
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
export const icon = TokenGroup.create({
|
|
282
|
-
name: 'Icons',
|
|
283
|
-
properties: ['background', 'fill', 'stroke'],
|
|
284
|
-
tokens: [
|
|
285
|
-
'icon-primary',
|
|
286
|
-
'icon-secondary',
|
|
287
|
-
'icon-inverse',
|
|
288
|
-
{
|
|
289
|
-
name: 'icon-on-color',
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
state: 'disabled',
|
|
293
|
-
name: 'icon-on-color-disabled',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
state: 'disabled',
|
|
297
|
-
name: 'icon-disabled',
|
|
298
|
-
},
|
|
299
|
-
'icon-interactive',
|
|
300
|
-
],
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
export const support = TokenGroup.create({
|
|
304
|
-
name: 'Support',
|
|
305
|
-
properties: ['background', 'fill', 'stroke'],
|
|
306
|
-
tokens: [
|
|
307
|
-
'support-error',
|
|
308
|
-
'support-success',
|
|
309
|
-
'support-warning',
|
|
310
|
-
'support-info',
|
|
311
|
-
'support-error-inverse',
|
|
312
|
-
'support-success-inverse',
|
|
313
|
-
'support-warning-inverse',
|
|
314
|
-
'support-info-inverse',
|
|
315
|
-
'support-caution-major',
|
|
316
|
-
'support-caution-minor',
|
|
317
|
-
'support-caution-undefined',
|
|
318
|
-
],
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
export const focus = TokenGroup.create({
|
|
322
|
-
name: 'Focus',
|
|
323
|
-
properties: ['border'],
|
|
324
|
-
tokens: ['focus', 'focus-inset', 'focus-inverse'],
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
export const skeleton = TokenGroup.create({
|
|
328
|
-
name: 'Skeleton',
|
|
329
|
-
properties: ['background'],
|
|
330
|
-
tokens: ['skeleton-background', 'skeleton-element'],
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
export const contextual = TokenGroup.create({
|
|
334
|
-
name: 'Contextual',
|
|
335
|
-
properties: [],
|
|
336
|
-
tokens: [
|
|
337
|
-
'layer',
|
|
338
|
-
'layer-active',
|
|
339
|
-
'layer-hover',
|
|
340
|
-
'layer-selected',
|
|
341
|
-
'layer-selected-hover',
|
|
342
|
-
'layer-accent',
|
|
343
|
-
'layer-accent-hover',
|
|
344
|
-
'layer-accent-active',
|
|
345
|
-
'field',
|
|
346
|
-
'field-hover',
|
|
347
|
-
'border-subtle',
|
|
348
|
-
'border-subtle-selected',
|
|
349
|
-
'border-strong',
|
|
350
|
-
'border-tile',
|
|
351
|
-
],
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
export const syntaxHighlight = TokenGroup.create({
|
|
355
|
-
name: 'Syntax Highlighting',
|
|
356
|
-
properties: ['text'],
|
|
357
|
-
tokens: [
|
|
358
|
-
'syntax-comment',
|
|
359
|
-
'syntax-line-comment',
|
|
360
|
-
'syntax-block-comment',
|
|
361
|
-
'syntax-doc-comment',
|
|
362
|
-
'syntax-doc-string',
|
|
363
|
-
'syntax-keyword',
|
|
364
|
-
'syntax-operator-keyword',
|
|
365
|
-
'syntax-control-keyword',
|
|
366
|
-
'syntax-definition-keyword',
|
|
367
|
-
'syntax-module-keyword',
|
|
368
|
-
'syntax-variable',
|
|
369
|
-
'syntax-name',
|
|
370
|
-
'syntax-variable-name',
|
|
371
|
-
'syntax-label-name',
|
|
372
|
-
'syntax-attribute',
|
|
373
|
-
'syntax-attribute-name',
|
|
374
|
-
'syntax-property-name',
|
|
375
|
-
'syntax-tag',
|
|
376
|
-
'syntax-tag-name',
|
|
377
|
-
'syntax-type',
|
|
378
|
-
'syntax-type-name',
|
|
379
|
-
'syntax-class-name',
|
|
380
|
-
'syntax-namespace',
|
|
381
|
-
'syntax-macro-name',
|
|
382
|
-
'syntax-atom',
|
|
383
|
-
'syntax-literal',
|
|
384
|
-
'syntax-bool',
|
|
385
|
-
'syntax-null',
|
|
386
|
-
'syntax-self',
|
|
387
|
-
'syntax-number',
|
|
388
|
-
'syntax-integer',
|
|
389
|
-
'syntax-float',
|
|
390
|
-
'syntax-unit',
|
|
391
|
-
'syntax-string',
|
|
392
|
-
'syntax-character',
|
|
393
|
-
'syntax-attribute-value',
|
|
394
|
-
'syntax-special-string',
|
|
395
|
-
'syntax-regexp',
|
|
396
|
-
'syntax-escape',
|
|
397
|
-
'syntax-url',
|
|
398
|
-
'syntax-color',
|
|
399
|
-
'syntax-operator',
|
|
400
|
-
'syntax-deref-operator',
|
|
401
|
-
'syntax-arithmetic-operator',
|
|
402
|
-
'syntax-logic-operator',
|
|
403
|
-
'syntax-bitwise-operator',
|
|
404
|
-
'syntax-compare-operator',
|
|
405
|
-
'syntax-update-operator',
|
|
406
|
-
'syntax-definition-operator',
|
|
407
|
-
'syntax-type-operator',
|
|
408
|
-
'syntax-control-operator',
|
|
409
|
-
'syntax-modifier',
|
|
410
|
-
'syntax-punctuation',
|
|
411
|
-
'syntax-separator',
|
|
412
|
-
'syntax-bracket',
|
|
413
|
-
'syntax-angle-bracket',
|
|
414
|
-
'syntax-square-bracket',
|
|
415
|
-
'syntax-paren',
|
|
416
|
-
'syntax-brace',
|
|
417
|
-
'syntax-content',
|
|
418
|
-
'syntax-heading',
|
|
419
|
-
'syntax-heading-1',
|
|
420
|
-
'syntax-heading-2',
|
|
421
|
-
'syntax-heading-3',
|
|
422
|
-
'syntax-heading-4',
|
|
423
|
-
'syntax-heading-5',
|
|
424
|
-
'syntax-heading-6',
|
|
425
|
-
'syntax-content-separator',
|
|
426
|
-
'syntax-list',
|
|
427
|
-
'syntax-quote',
|
|
428
|
-
'syntax-emphasis',
|
|
429
|
-
'syntax-strong',
|
|
430
|
-
'syntax-monospace',
|
|
431
|
-
'syntax-link',
|
|
432
|
-
'syntax-strikethrough',
|
|
433
|
-
'syntax-invalid',
|
|
434
|
-
'syntax-meta',
|
|
435
|
-
'syntax-document-meta',
|
|
436
|
-
'syntax-annotation',
|
|
437
|
-
'syntax-processing-instruction',
|
|
438
|
-
'syntax-definition',
|
|
439
|
-
'syntax-constant',
|
|
440
|
-
'syntax-function',
|
|
441
|
-
'syntax-standard',
|
|
442
|
-
'syntax-local',
|
|
443
|
-
'syntax-special',
|
|
444
|
-
'syntax-inserted',
|
|
445
|
-
'syntax-deleted',
|
|
446
|
-
],
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
export const ai = TokenGroup.create({
|
|
450
|
-
name: 'AI',
|
|
451
|
-
properties: ['background'],
|
|
452
|
-
tokens: [
|
|
453
|
-
// Phase 2
|
|
454
|
-
'ai-popover-background',
|
|
455
|
-
'ai-popover-shadow-outer-01',
|
|
456
|
-
'ai-popover-shadow-outer-02',
|
|
457
|
-
// Linear gradient refactor
|
|
458
|
-
'ai-inner-shadow',
|
|
459
|
-
'ai-aura-start-sm',
|
|
460
|
-
'ai-aura-start',
|
|
461
|
-
'ai-aura-end',
|
|
462
|
-
'ai-aura-hover-background',
|
|
463
|
-
'ai-aura-hover-start',
|
|
464
|
-
'ai-aura-hover-end',
|
|
465
|
-
'ai-border-strong',
|
|
466
|
-
'ai-border-start',
|
|
467
|
-
'ai-border-end',
|
|
468
|
-
'ai-drop-shadow',
|
|
469
|
-
'ai-skeleton-background',
|
|
470
|
-
'ai-skeleton-element-background',
|
|
471
|
-
'ai-overlay',
|
|
472
|
-
// Caret tokens
|
|
473
|
-
'ai-popover-caret-center',
|
|
474
|
-
'ai-popover-caret-bottom',
|
|
475
|
-
'ai-popover-caret-bottom-background',
|
|
476
|
-
'ai-popover-caret-bottom-background-actions',
|
|
477
|
-
// Chat tokens
|
|
478
|
-
'chat-prompt-background',
|
|
479
|
-
'chat-prompt-border-start',
|
|
480
|
-
'chat-prompt-border-end',
|
|
481
|
-
'chat-prompt-text',
|
|
482
|
-
'chat-bubble-user',
|
|
483
|
-
'chat-bubble-user-text',
|
|
484
|
-
'chat-bubble-agent',
|
|
485
|
-
'chat-bubble-agent-text',
|
|
486
|
-
'chat-bubble-border',
|
|
487
|
-
'chat-avatar-bot',
|
|
488
|
-
'chat-avatar-agent',
|
|
489
|
-
'chat-avatar-user',
|
|
490
|
-
'chat-shell-background',
|
|
491
|
-
'chat-header-background',
|
|
492
|
-
'chat-header-text',
|
|
493
|
-
// Chat button tokens
|
|
494
|
-
'chat-button',
|
|
495
|
-
'chat-button-hover',
|
|
496
|
-
'chat-button-text-hover',
|
|
497
|
-
'chat-button-active',
|
|
498
|
-
'chat-button-selected',
|
|
499
|
-
'chat-button-text-selected',
|
|
500
|
-
],
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
export const group = TokenGroup.create({
|
|
504
|
-
name: 'All',
|
|
505
|
-
tokens: [
|
|
506
|
-
background,
|
|
507
|
-
layer,
|
|
508
|
-
field,
|
|
509
|
-
|
|
510
|
-
// Interactive
|
|
511
|
-
{
|
|
512
|
-
name: 'interactive',
|
|
513
|
-
properties: ['background', 'text'],
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
border,
|
|
517
|
-
text,
|
|
518
|
-
link,
|
|
519
|
-
icon,
|
|
520
|
-
support,
|
|
521
|
-
syntaxHighlight,
|
|
522
|
-
ai,
|
|
523
|
-
|
|
524
|
-
// Misc
|
|
525
|
-
{
|
|
526
|
-
name: 'highlight',
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
name: 'overlay',
|
|
530
|
-
properties: ['background'],
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
name: 'color-scheme',
|
|
534
|
-
properties: ['color-scheme'],
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
name: 'toggle-off',
|
|
538
|
-
},
|
|
539
|
-
{
|
|
540
|
-
name: 'shadow',
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
focus,
|
|
544
|
-
skeleton,
|
|
545
|
-
],
|
|
546
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2018, 2026
|
|
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 { TokenGroup } from './TokenGroup';
|
|
10
|
-
import { background, border, field, layer } from './v11TokenGroup';
|
|
11
|
-
|
|
12
|
-
const getTokenOrThrow = (group: TokenGroup, name: string) => {
|
|
13
|
-
const token = group.getToken(name);
|
|
14
|
-
|
|
15
|
-
if (token === null) {
|
|
16
|
-
throw new Error(`Unable to find token \`${name}\` in v11 token set.`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return token;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const set = TokenSet.create({
|
|
23
|
-
name: 'All',
|
|
24
|
-
tokens: [
|
|
25
|
-
TokenSet.create({
|
|
26
|
-
name: 'Base set',
|
|
27
|
-
tokens: [
|
|
28
|
-
getTokenOrThrow(background, 'background'),
|
|
29
|
-
getTokenOrThrow(background, 'background-hover'),
|
|
30
|
-
getTokenOrThrow(background, 'background-selected'),
|
|
31
|
-
getTokenOrThrow(background, 'background-selected-hover'),
|
|
32
|
-
getTokenOrThrow(border, 'border-subtle-00'),
|
|
33
|
-
],
|
|
34
|
-
}),
|
|
35
|
-
TokenSet.create({
|
|
36
|
-
name: '01 Layer set',
|
|
37
|
-
tokens: [
|
|
38
|
-
getTokenOrThrow(layer, 'layer-01'),
|
|
39
|
-
getTokenOrThrow(layer, 'layer-active-01'),
|
|
40
|
-
getTokenOrThrow(layer, 'layer-background-01'),
|
|
41
|
-
getTokenOrThrow(layer, 'layer-hover-01'),
|
|
42
|
-
getTokenOrThrow(layer, 'layer-selected-hover-01'),
|
|
43
|
-
getTokenOrThrow(layer, 'layer-accent-01'),
|
|
44
|
-
getTokenOrThrow(layer, 'layer-accent-active-01'),
|
|
45
|
-
getTokenOrThrow(layer, 'layer-accent-hover-01'),
|
|
46
|
-
getTokenOrThrow(field, 'field-01'),
|
|
47
|
-
getTokenOrThrow(field, 'field-hover-01'),
|
|
48
|
-
getTokenOrThrow(border, 'border-subtle-01'),
|
|
49
|
-
getTokenOrThrow(border, 'border-subtle-selected-01'),
|
|
50
|
-
getTokenOrThrow(border, 'border-strong-01'),
|
|
51
|
-
getTokenOrThrow(border, 'border-tile-01'),
|
|
52
|
-
],
|
|
53
|
-
}),
|
|
54
|
-
TokenSet.create({
|
|
55
|
-
name: '02 Layer set',
|
|
56
|
-
tokens: [
|
|
57
|
-
getTokenOrThrow(layer, 'layer-02'),
|
|
58
|
-
getTokenOrThrow(layer, 'layer-active-02'),
|
|
59
|
-
getTokenOrThrow(layer, 'layer-background-02'),
|
|
60
|
-
getTokenOrThrow(layer, 'layer-hover-02'),
|
|
61
|
-
getTokenOrThrow(layer, 'layer-selected-hover-02'),
|
|
62
|
-
getTokenOrThrow(layer, 'layer-accent-02'),
|
|
63
|
-
getTokenOrThrow(layer, 'layer-accent-active-02'),
|
|
64
|
-
getTokenOrThrow(layer, 'layer-accent-hover-02'),
|
|
65
|
-
getTokenOrThrow(field, 'field-02'),
|
|
66
|
-
getTokenOrThrow(field, 'field-hover-02'),
|
|
67
|
-
getTokenOrThrow(border, 'border-subtle-02'),
|
|
68
|
-
getTokenOrThrow(border, 'border-subtle-selected-02'),
|
|
69
|
-
getTokenOrThrow(border, 'border-strong-02'),
|
|
70
|
-
getTokenOrThrow(border, 'border-tile-02'),
|
|
71
|
-
],
|
|
72
|
-
}),
|
|
73
|
-
TokenSet.create({
|
|
74
|
-
name: '03 Layer set',
|
|
75
|
-
tokens: [
|
|
76
|
-
getTokenOrThrow(layer, 'layer-03'),
|
|
77
|
-
getTokenOrThrow(layer, 'layer-active-03'),
|
|
78
|
-
getTokenOrThrow(layer, 'layer-background-03'),
|
|
79
|
-
getTokenOrThrow(layer, 'layer-hover-03'),
|
|
80
|
-
getTokenOrThrow(layer, 'layer-selected-hover-03'),
|
|
81
|
-
getTokenOrThrow(layer, 'layer-accent-03'),
|
|
82
|
-
getTokenOrThrow(layer, 'layer-accent-active-03'),
|
|
83
|
-
getTokenOrThrow(layer, 'layer-accent-hover-03'),
|
|
84
|
-
getTokenOrThrow(field, 'field-03'),
|
|
85
|
-
getTokenOrThrow(field, 'field-hover-03'),
|
|
86
|
-
getTokenOrThrow(border, 'border-subtle-03'),
|
|
87
|
-
getTokenOrThrow(border, 'border-subtle-selected-03'),
|
|
88
|
-
getTokenOrThrow(border, 'border-strong-03'),
|
|
89
|
-
getTokenOrThrow(border, 'border-tile-03'),
|
|
90
|
-
],
|
|
91
|
-
}),
|
|
92
|
-
],
|
|
93
|
-
});
|
package/src/tools.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2026
|
|
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 Color from 'color';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Adjust a given token's lightness by a specified percentage
|
|
11
|
-
* Example: token = hsl(10, 10, 10);
|
|
12
|
-
* adjustLightness(token, 5) === hsl(10, 10, 15);
|
|
13
|
-
* adjustLightness(token, -5) === hsl(10, 10, 5);
|
|
14
|
-
*/
|
|
15
|
-
export const adjustLightness = (token: string, shift: number) => {
|
|
16
|
-
const original = Color(token).hsl().object();
|
|
17
|
-
|
|
18
|
-
return Color({ ...original, l: (original.l += shift) })
|
|
19
|
-
.round()
|
|
20
|
-
.hex()
|
|
21
|
-
.toLowerCase();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Adjust a given token's alpha by a specified amount
|
|
26
|
-
* Example: token = rgba(10, 10, 10, 1.0);
|
|
27
|
-
* adjustAlpha(token, 0.3) === rgba(10, 10, 10, 0.3);
|
|
28
|
-
*/
|
|
29
|
-
export const adjustAlpha = (token: string, alpha: number) => {
|
|
30
|
-
return Color(token).rgb().alpha(alpha).string();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Format a given token into the format expected in CSS/SCSS-based projects.
|
|
37
|
-
*/
|
|
38
|
-
export const formatTokenName = (token: string) => {
|
|
39
|
-
let string = '';
|
|
40
|
-
|
|
41
|
-
for (let i = 0; i < token.length; i++) {
|
|
42
|
-
// If we run into a number, we hit the scale step at the end of a token name
|
|
43
|
-
// and can safely truncate the rest of the token
|
|
44
|
-
if (numbers.indexOf(token[i]) !== -1) {
|
|
45
|
-
string += '-' + token.slice(i);
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// When encountering an uppercase name, we will want to start adding `-`
|
|
50
|
-
// between words
|
|
51
|
-
if (token[i] === token[i].toUpperCase()) {
|
|
52
|
-
// Check backwards to see if previous letter was also capitalized, if so
|
|
53
|
-
// we are in a special case like UI where each piece should be connected
|
|
54
|
-
if (token[i - 1] && token[i - 1] === token[i - 1].toUpperCase()) {
|
|
55
|
-
string += token[i].toLowerCase();
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Otherwise, just concatenate this new part on to the existing string
|
|
60
|
-
string += '-' + token[i].toLowerCase();
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// By default, we add the current character to the output string
|
|
65
|
-
string += token[i];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return string;
|
|
69
|
-
};
|