@carbon/type 11.60.0 → 11.61.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.
Files changed (44) hide show
  1. package/es/index.js +87 -99
  2. package/lib/__tests__/exports-test.d.ts +1 -0
  3. package/lib/__tests__/fluid-test.d.ts +1 -0
  4. package/lib/__tests__/fontFamily-test.d.ts +1 -0
  5. package/lib/__tests__/fontWeight-test.d.ts +1 -0
  6. package/lib/__tests__/reset-test.d.ts +1 -0
  7. package/lib/__tests__/scale-test.d.ts +1 -0
  8. package/lib/__tests__/styles-test.d.ts +1 -0
  9. package/lib/__tests__/tokens-test.d.ts +1 -0
  10. package/lib/fluid.d.ts +15 -0
  11. package/lib/fontFamily.d.ts +16 -0
  12. package/lib/fontWeight.d.ts +14 -0
  13. package/lib/index.d.ts +15 -0
  14. package/lib/index.js +87 -99
  15. package/lib/print.d.ts +9 -0
  16. package/lib/reset.d.ts +8 -0
  17. package/lib/scale.d.ts +16 -0
  18. package/lib/styles.d.ts +744 -0
  19. package/lib/tokens.d.ts +65 -0
  20. package/lib/types.d.ts +16 -0
  21. package/package.json +8 -5
  22. package/umd/index.js +87 -99
  23. package/src/__tests__/__snapshots__/fontFamily-test.js.snap +0 -13
  24. package/src/__tests__/__snapshots__/fontWeight-test.js.snap +0 -11
  25. package/src/__tests__/__snapshots__/reset-test.js.snap +0 -11
  26. package/src/__tests__/__snapshots__/scale-test.js.snap +0 -29
  27. package/src/__tests__/__snapshots__/styles-test.js.snap +0 -411
  28. package/src/__tests__/exports-test.js +0 -88
  29. package/src/__tests__/fluid-test.js +0 -71
  30. package/src/__tests__/fontFamily-test.js +0 -33
  31. package/src/__tests__/fontWeight-test.js +0 -33
  32. package/src/__tests__/reset-test.js +0 -23
  33. package/src/__tests__/scale-test.js +0 -31
  34. package/src/__tests__/styles-test.js +0 -18
  35. package/src/__tests__/tokens-test.js +0 -21
  36. package/src/fluid.js +0 -86
  37. package/src/fontFamily.js +0 -30
  38. package/src/fontWeight.js +0 -24
  39. package/src/index.js +0 -28
  40. package/src/print.js +0 -36
  41. package/src/reset.js +0 -29
  42. package/src/scale.js +0 -30
  43. package/src/styles.js +0 -488
  44. package/src/tokens.js +0 -129
package/src/styles.js DELETED
@@ -1,488 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2018, 2023
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 { px, rem } from '@carbon/layout';
9
- import { fontWeights } from './fontWeight';
10
- import { fontFamilies } from './fontFamily';
11
- import { scale } from './scale';
12
-
13
- export const caption01 = {
14
- fontSize: rem(scale[0]),
15
- fontWeight: fontWeights.regular,
16
- lineHeight: 1.33333,
17
- letterSpacing: px(0.32),
18
- };
19
-
20
- export const caption02 = {
21
- fontSize: rem(scale[1]),
22
- fontWeight: fontWeights.regular,
23
- lineHeight: 1.28572,
24
- letterSpacing: px(0.32),
25
- };
26
-
27
- export const label01 = {
28
- fontSize: rem(scale[0]),
29
- fontWeight: fontWeights.regular,
30
- lineHeight: 1.33333,
31
- letterSpacing: px(0.32),
32
- };
33
-
34
- export const label02 = {
35
- fontSize: rem(scale[1]),
36
- fontWeight: fontWeights.regular,
37
- lineHeight: 1.28572,
38
- letterSpacing: px(0.16),
39
- };
40
-
41
- export const helperText01 = {
42
- fontSize: rem(scale[0]),
43
- lineHeight: 1.33333,
44
- letterSpacing: px(0.32),
45
- };
46
-
47
- export const helperText02 = {
48
- fontSize: rem(scale[1]),
49
- lineHeight: 1.28572,
50
- letterSpacing: px(0.16),
51
- };
52
-
53
- export const bodyShort01 = {
54
- fontSize: rem(scale[1]),
55
- fontWeight: fontWeights.regular,
56
- lineHeight: 1.28572,
57
- letterSpacing: px(0.16),
58
- };
59
-
60
- export const bodyLong01 = {
61
- fontSize: rem(scale[1]),
62
- fontWeight: fontWeights.regular,
63
- lineHeight: 1.42857,
64
- letterSpacing: px(0.16),
65
- };
66
-
67
- export const bodyShort02 = {
68
- fontSize: rem(scale[2]),
69
- fontWeight: fontWeights.regular,
70
- lineHeight: 1.375,
71
- letterSpacing: 0,
72
- };
73
-
74
- export const bodyLong02 = {
75
- fontSize: rem(scale[2]),
76
- fontWeight: fontWeights.regular,
77
- lineHeight: 1.5,
78
- letterSpacing: 0,
79
- };
80
-
81
- export const code01 = {
82
- fontFamily: fontFamilies.mono,
83
- fontSize: rem(scale[0]),
84
- fontWeight: fontWeights.regular,
85
- lineHeight: 1.33333,
86
- letterSpacing: px(0.32),
87
- };
88
-
89
- export const code02 = {
90
- fontFamily: fontFamilies.mono,
91
- fontSize: rem(scale[1]),
92
- fontWeight: fontWeights.regular,
93
- lineHeight: 1.42857,
94
- letterSpacing: px(0.32),
95
- };
96
-
97
- export const heading01 = {
98
- fontSize: rem(scale[1]),
99
- fontWeight: fontWeights.semibold,
100
- lineHeight: 1.42857,
101
- letterSpacing: px(0.16),
102
- };
103
-
104
- export const productiveHeading01 = {
105
- fontSize: rem(scale[1]),
106
- fontWeight: fontWeights.semibold,
107
- lineHeight: 1.28572,
108
- letterSpacing: px(0.16),
109
- };
110
-
111
- export const heading02 = {
112
- fontSize: rem(scale[2]),
113
- fontWeight: fontWeights.semibold,
114
- lineHeight: 1.5,
115
- letterSpacing: 0,
116
- };
117
-
118
- export const productiveHeading02 = {
119
- fontSize: rem(scale[2]),
120
- fontWeight: fontWeights.semibold,
121
- lineHeight: 1.375,
122
- letterSpacing: 0,
123
- };
124
-
125
- export const productiveHeading03 = {
126
- fontSize: rem(scale[4]),
127
- fontWeight: fontWeights.regular,
128
- lineHeight: 1.4,
129
- letterSpacing: 0,
130
- };
131
-
132
- export const productiveHeading04 = {
133
- fontSize: rem(scale[6]),
134
- fontWeight: fontWeights.regular,
135
- lineHeight: 1.28572,
136
- letterSpacing: 0,
137
- };
138
-
139
- export const productiveHeading05 = {
140
- fontSize: rem(scale[7]),
141
- fontWeight: fontWeights.regular,
142
- lineHeight: 1.25,
143
- letterSpacing: 0,
144
- };
145
-
146
- export const productiveHeading06 = {
147
- fontSize: rem(scale[9]),
148
- fontWeight: fontWeights.light,
149
- lineHeight: 1.199,
150
- letterSpacing: 0,
151
- };
152
-
153
- export const productiveHeading07 = {
154
- fontSize: rem(scale[11]),
155
- fontWeight: fontWeights.light,
156
- lineHeight: 1.199,
157
- letterSpacing: 0,
158
- };
159
-
160
- export const expressiveHeading01 = {
161
- ...heading01,
162
- lineHeight: 1.25,
163
- };
164
-
165
- export const expressiveHeading02 = {
166
- ...heading02,
167
- lineHeight: 1.5,
168
- };
169
-
170
- export const expressiveHeading03 = {
171
- fontSize: rem(scale[4]),
172
- fontWeight: fontWeights.regular,
173
- lineHeight: 1.4,
174
- letterSpacing: 0,
175
- breakpoints: {
176
- xlg: {
177
- fontSize: rem(scale[4]),
178
- lineHeight: 1.4,
179
- },
180
- max: {
181
- fontSize: rem(scale[5]),
182
- lineHeight: 1.334,
183
- },
184
- },
185
- };
186
-
187
- export const expressiveHeading04 = {
188
- fontSize: rem(scale[6]),
189
- fontWeight: fontWeights.regular,
190
- lineHeight: 1.28572,
191
- letterSpacing: 0,
192
- breakpoints: {
193
- xlg: {
194
- fontSize: rem(scale[7]),
195
- fontWeight: fontWeights.regular,
196
- lineHeight: 1.25,
197
- },
198
- max: {
199
- fontSize: rem(scale[7]),
200
- fontWeight: fontWeights.regular,
201
- },
202
- },
203
- };
204
-
205
- export const expressiveHeading05 = {
206
- fontSize: rem(scale[7]),
207
- fontWeight: fontWeights.regular,
208
- lineHeight: 1.25,
209
- letterSpacing: 0,
210
- breakpoints: {
211
- md: {
212
- fontSize: rem(scale[8]),
213
- fontWeight: fontWeights.light,
214
- lineHeight: 1.22,
215
- letterSpacing: 0,
216
- },
217
- lg: {
218
- fontSize: rem(scale[9]),
219
- lineHeight: 1.19,
220
- letterSpacing: 0,
221
- },
222
- xlg: {
223
- fontSize: rem(scale[10]),
224
- lineHeight: 1.17,
225
- letterSpacing: 0,
226
- },
227
- max: {
228
- fontSize: rem(scale[12]),
229
- letterSpacing: 0,
230
- },
231
- },
232
- };
233
-
234
- export const expressiveHeading06 = {
235
- fontSize: rem(scale[7]),
236
- fontWeight: fontWeights.semibold,
237
- lineHeight: 1.25,
238
- letterSpacing: 0,
239
- breakpoints: {
240
- md: {
241
- fontSize: rem(scale[8]),
242
- fontWeight: fontWeights.semibold,
243
- lineHeight: 1.22,
244
- letterSpacing: 0,
245
- },
246
- lg: {
247
- fontSize: rem(scale[9]),
248
- fontWeight: fontWeights.semibold,
249
- lineHeight: 1.19,
250
- letterSpacing: 0,
251
- },
252
- xlg: {
253
- fontSize: rem(scale[10]),
254
- fontWeight: fontWeights.semibold,
255
- lineHeight: 1.17,
256
- letterSpacing: 0,
257
- },
258
- max: {
259
- fontSize: rem(scale[12]),
260
- fontWeight: fontWeights.semibold,
261
- letterSpacing: 0,
262
- },
263
- },
264
- };
265
-
266
- export const expressiveParagraph01 = {
267
- fontSize: rem(scale[5]),
268
- fontWeight: fontWeights.light,
269
- lineHeight: 1.334,
270
- letterSpacing: 0,
271
- breakpoints: {
272
- lg: {
273
- fontSize: rem(scale[6]),
274
- lineHeight: 1.28572,
275
- },
276
- max: {
277
- fontSize: rem(scale[7]),
278
- lineHeight: 1.25,
279
- },
280
- },
281
- };
282
-
283
- export const quotation01 = {
284
- fontFamily: fontFamilies.serif,
285
- fontSize: rem(scale[4]),
286
- fontWeight: fontWeights.regular,
287
- lineHeight: 1.3,
288
- letterSpacing: 0,
289
- breakpoints: {
290
- md: {
291
- fontSize: rem(scale[4]),
292
- fontWeight: fontWeights.regular,
293
- letterSpacing: 0,
294
- },
295
- lg: {
296
- fontSize: rem(scale[5]),
297
- fontWeight: fontWeights.regular,
298
- lineHeight: 1.334,
299
- letterSpacing: 0,
300
- },
301
- xlg: {
302
- fontSize: rem(scale[6]),
303
- fontWeight: fontWeights.regular,
304
- lineHeight: 1.28572,
305
- letterSpacing: 0,
306
- },
307
- max: {
308
- fontSize: rem(scale[7]),
309
- fontWeight: fontWeights.regular,
310
- lineHeight: 1.25,
311
- letterSpacing: 0,
312
- },
313
- },
314
- };
315
-
316
- export const quotation02 = {
317
- fontFamily: fontFamilies.serif,
318
- fontSize: rem(scale[7]),
319
- fontWeight: fontWeights.light,
320
- lineHeight: 1.25,
321
- letterSpacing: 0,
322
- breakpoints: {
323
- md: {
324
- fontSize: rem(scale[8]),
325
- lineHeight: 1.22,
326
- },
327
- lg: {
328
- fontSize: rem(scale[9]),
329
- lineHeight: 1.19,
330
- },
331
- xlg: {
332
- fontSize: rem(scale[10]),
333
- lineHeight: 1.17,
334
- },
335
- max: {
336
- fontSize: rem(scale[12]),
337
- },
338
- },
339
- };
340
-
341
- export const display01 = {
342
- fontSize: rem(scale[9]),
343
- fontWeight: fontWeights.light,
344
- lineHeight: 1.19,
345
- letterSpacing: 0,
346
- breakpoints: {
347
- md: {
348
- fontSize: rem(scale[9]),
349
- },
350
- lg: {
351
- fontSize: rem(scale[11]),
352
- },
353
- xlg: {
354
- fontSize: rem(scale[12]),
355
- lineHeight: 1.17,
356
- },
357
- max: {
358
- fontSize: rem(scale[14]),
359
- lineHeight: 1.13,
360
- },
361
- },
362
- };
363
-
364
- export const display02 = {
365
- fontSize: rem(scale[9]),
366
- fontWeight: fontWeights.semibold,
367
- lineHeight: 1.19,
368
- letterSpacing: 0,
369
- breakpoints: {
370
- md: {
371
- fontSize: rem(scale[9]),
372
- },
373
- lg: {
374
- fontSize: rem(scale[11]),
375
- },
376
- xlg: {
377
- fontSize: rem(scale[12]),
378
- lineHeight: 1.16,
379
- },
380
- max: {
381
- fontSize: rem(scale[14]),
382
- lineHeight: 1.13,
383
- },
384
- },
385
- };
386
-
387
- export const display03 = {
388
- fontSize: rem(scale[9]),
389
- fontWeight: fontWeights.light,
390
- lineHeight: 1.19,
391
- letterSpacing: 0,
392
- breakpoints: {
393
- md: {
394
- fontSize: rem(scale[11]),
395
- lineHeight: 1.18,
396
- },
397
- lg: {
398
- fontSize: rem(scale[12]),
399
- lineHeight: 1.16,
400
- letterSpacing: px(-0.64),
401
- },
402
- xlg: {
403
- fontSize: rem(scale[14]),
404
- lineHeight: 1.13,
405
- },
406
- max: {
407
- fontSize: rem(scale[15]),
408
- lineHeight: 1.11,
409
- letterSpacing: px(-0.96),
410
- },
411
- },
412
- };
413
-
414
- export const display04 = {
415
- fontSize: rem(scale[9]),
416
- fontWeight: fontWeights.light,
417
- lineHeight: 1.19,
418
- letterSpacing: 0,
419
- breakpoints: {
420
- md: {
421
- fontSize: rem(scale[13]),
422
- lineHeight: 1.15,
423
- },
424
- lg: {
425
- fontSize: rem(scale[16]),
426
- lineHeight: 1.11,
427
- letterSpacing: px(-0.64),
428
- },
429
- xlg: {
430
- fontSize: rem(scale[19]),
431
- lineHeight: 1.07,
432
- letterSpacing: px(-0.64),
433
- },
434
- max: {
435
- fontSize: rem(scale[22]),
436
- lineHeight: 1.05,
437
- letterSpacing: px(-0.96),
438
- },
439
- },
440
- };
441
-
442
- // Type changes - V11
443
-
444
- // Small styles
445
- // No changes for code-01, code-02, label-01, label-02
446
- export const legal01 = {
447
- fontSize: rem(scale[0]),
448
- fontWeight: fontWeights.regular,
449
- lineHeight: 1.33333,
450
- letterSpacing: px(0.32),
451
- };
452
-
453
- export const legal02 = {
454
- fontSize: rem(scale[1]),
455
- fontWeight: fontWeights.regular,
456
- lineHeight: 1.28572,
457
- letterSpacing: px(0.16),
458
- };
459
-
460
- // Body styles
461
- export const bodyCompact01 = bodyShort01;
462
- export const bodyCompact02 = bodyShort02;
463
- export const body01 = bodyLong01;
464
- export const body02 = bodyLong02;
465
-
466
- // Fixed heading styles
467
- export const headingCompact01 = productiveHeading01;
468
- export const headingCompact02 = productiveHeading02;
469
- export const heading03 = productiveHeading03;
470
- export const heading04 = productiveHeading04;
471
- export const heading05 = productiveHeading05;
472
- export const heading06 = productiveHeading06;
473
- export const heading07 = productiveHeading07;
474
-
475
- // Fluid heading styles
476
- export const fluidHeading03 = expressiveHeading03;
477
- export const fluidHeading04 = expressiveHeading04;
478
- export const fluidHeading05 = expressiveHeading05;
479
- export const fluidHeading06 = expressiveHeading06;
480
-
481
- // Additional fluid styles
482
- export const fluidParagraph01 = expressiveParagraph01;
483
- export const fluidQuotation01 = quotation01;
484
- export const fluidQuotation02 = quotation02;
485
- export const fluidDisplay01 = display01;
486
- export const fluidDisplay02 = display02;
487
- export const fluidDisplay03 = display03;
488
- export const fluidDisplay04 = display04;
package/src/tokens.js DELETED
@@ -1,129 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2018, 2023
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
- // Unstable tokens
9
- export const caption01 = 'caption01';
10
- export const caption02 = 'caption02';
11
- export const label01 = 'label01';
12
- export const label02 = 'label02';
13
- export const helperText01 = 'helperText01';
14
- export const helperText02 = 'helperText02';
15
- export const bodyShort01 = 'bodyShort01';
16
- export const bodyLong01 = 'bodyLong01';
17
- export const bodyShort02 = 'bodyShort02';
18
- export const bodyLong02 = 'bodyLong02';
19
- export const code01 = 'code01';
20
- export const code02 = 'code02';
21
- export const heading01 = 'heading01';
22
- export const productiveHeading01 = 'productiveHeading01';
23
- export const heading02 = 'heading02';
24
- export const productiveHeading02 = 'productiveHeading02';
25
- export const productiveHeading03 = 'productiveHeading03';
26
- export const productiveHeading04 = 'productiveHeading04';
27
- export const productiveHeading05 = 'productiveHeading05';
28
- export const productiveHeading06 = 'productiveHeading06';
29
- export const productiveHeading07 = 'productiveHeading07';
30
- export const expressiveHeading01 = 'expressiveHeading01';
31
- export const expressiveHeading02 = 'expressiveHeading02';
32
- export const expressiveHeading03 = 'expressiveHeading03';
33
- export const expressiveHeading04 = 'expressiveHeading04';
34
- export const expressiveHeading05 = 'expressiveHeading05';
35
- export const expressiveHeading06 = 'expressiveHeading06';
36
- export const expressiveParagraph01 = 'expressiveParagraph01';
37
- export const quotation01 = 'quotation01';
38
- export const quotation02 = 'quotation02';
39
- export const display01 = 'display01';
40
- export const display02 = 'display02';
41
- export const display03 = 'display03';
42
- export const display04 = 'display04';
43
- // V11 Tokens
44
- export const legal01 = 'legal01';
45
- export const legal02 = 'legal02';
46
- export const bodyCompact01 = 'bodyCompact01';
47
- export const bodyCompact02 = 'bodyCompact02';
48
- export const body01 = 'body01';
49
- export const body02 = 'body02';
50
- export const headingCompact01 = 'headingCompact01';
51
- export const headingCompact02 = 'headingCompact02';
52
- export const heading03 = 'heading03';
53
- export const heading04 = 'heading04';
54
- export const heading05 = 'heading05';
55
- export const heading06 = 'heading06';
56
- export const heading07 = 'heading07';
57
- export const fluidHeading03 = 'fluidHeading03';
58
- export const fluidHeading04 = 'fluidHeading04';
59
- export const fluidHeading05 = 'fluidHeading05';
60
- export const fluidHeading06 = 'fluidHeading06';
61
- export const fluidParagraph01 = 'fluidParagraph01';
62
- export const fluidQuotation01 = 'fluidQuotation01';
63
- export const fluidQuotation02 = 'fluidQuotation02';
64
- export const fluidDisplay01 = 'fluidDisplay01';
65
- export const fluidDisplay02 = 'fluidDisplay02';
66
- export const fluidDisplay03 = 'fluidDisplay03';
67
- export const fluidDisplay04 = 'fluidDisplay04';
68
-
69
- export const unstable_tokens = [
70
- caption01,
71
- caption02,
72
- label01,
73
- label02,
74
- helperText01,
75
- helperText02,
76
- bodyShort01,
77
- bodyLong01,
78
- bodyShort02,
79
- bodyLong02,
80
- code01,
81
- code02,
82
- heading01,
83
- productiveHeading01,
84
- heading02,
85
- productiveHeading02,
86
- productiveHeading03,
87
- productiveHeading04,
88
- productiveHeading05,
89
- productiveHeading06,
90
- productiveHeading07,
91
- expressiveHeading01,
92
- expressiveHeading02,
93
- expressiveHeading03,
94
- expressiveHeading04,
95
- expressiveHeading05,
96
- expressiveHeading06,
97
- expressiveParagraph01,
98
- quotation01,
99
- quotation02,
100
- display01,
101
- display02,
102
- display03,
103
- display04,
104
- // V11 Tokens
105
- legal01,
106
- legal02,
107
- bodyCompact01,
108
- bodyCompact02,
109
- body01,
110
- body02,
111
- headingCompact01,
112
- headingCompact02,
113
- heading03,
114
- heading04,
115
- heading05,
116
- heading06,
117
- heading07,
118
- fluidHeading03,
119
- fluidHeading04,
120
- fluidHeading05,
121
- fluidHeading06,
122
- fluidParagraph01,
123
- fluidQuotation01,
124
- fluidQuotation02,
125
- fluidDisplay01,
126
- fluidDisplay02,
127
- fluidDisplay03,
128
- fluidDisplay04,
129
- ];