@carbon/type 10.0.0-rc.0 → 10.2.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/CHANGELOG.md +525 -0
  2. package/LICENSE +2 -2
  3. package/README.md +25 -21
  4. package/es/index.js +26 -38
  5. package/lib/index.js +31 -37
  6. package/package.json +7 -7
  7. package/scss/_classes.scss +3 -0
  8. package/scss/_font-family.scss +17 -4
  9. package/scss/_inlined/_classes.scss +41 -0
  10. package/scss/_inlined/_font-family.scss +70 -0
  11. package/scss/_inlined/_prefix.scss +11 -0
  12. package/scss/_inlined/_reset.scss +43 -0
  13. package/scss/_inlined/_scale.scss +59 -0
  14. package/scss/_inlined/_styles.scss +673 -0
  15. package/scss/_inlined/font-face/_mono.scss +430 -0
  16. package/scss/_inlined/font-face/_sans.scss +497 -0
  17. package/scss/_inlined/font-face/_serif.scss +430 -0
  18. package/scss/_inlined/font-face/_settings.scss +12 -0
  19. package/scss/_prefix.scss +3 -0
  20. package/scss/_reset.scss +20 -7
  21. package/scss/_scale.scss +16 -5
  22. package/scss/_styles.scss +145 -49
  23. package/scss/font-face/_mono.scss +41 -0
  24. package/scss/font-face/_sans.scss +144 -36
  25. package/scss/font-face/_serif.scss +77 -36
  26. package/scss/font-face/_settings.scss +12 -0
  27. package/scss/index.scss +11 -0
  28. package/scss/type.scss +4 -4
  29. package/scss/vendor/@carbon/import-once/import-once.scss +27 -0
  30. package/scss/vendor/@carbon/import-once/index.scss +8 -0
  31. package/scss/vendor/@carbon/layout/_breakpoint.scss +237 -0
  32. package/scss/vendor/@carbon/layout/_convert.scss +30 -0
  33. package/scss/vendor/@carbon/layout/_key-height.scss +97 -0
  34. package/scss/vendor/@carbon/layout/_mini-unit.scss +23 -0
  35. package/scss/vendor/@carbon/layout/_spacing.scss +328 -0
  36. package/scss/vendor/@carbon/layout/_utilities.scss +41 -0
  37. package/scss/vendor/@carbon/layout/index.scss +8 -0
  38. package/scss/vendor/@carbon/layout/layout.scss +12 -0
  39. package/src/__tests__/__snapshots__/styles-test.js.snap +121 -87
  40. package/src/__tests__/exports-test.js +43 -37
  41. package/src/__tests__/fluid-test.js +0 -1
  42. package/src/reset.js +3 -0
  43. package/src/styles.js +22 -38
  44. package/umd/index.js +31 -37
@@ -12,42 +12,48 @@ import * as CarbonType from '../';
12
12
  describe('type', () => {
13
13
  it('should export type helpers', () => {
14
14
  expect(Object.keys(CarbonType)).toMatchInlineSnapshot(`
15
- Array [
16
- "fontFamilies",
17
- "fontFamily",
18
- "fontWeights",
19
- "fontWeight",
20
- "print",
21
- "reset",
22
- "getTypeSize",
23
- "scale",
24
- "styles",
25
- "caption01",
26
- "label01",
27
- "helperText01",
28
- "bodyShort01",
29
- "bodyLong01",
30
- "bodyShort02",
31
- "bodyLong02",
32
- "code01",
33
- "code02",
34
- "heading01",
35
- "heading02",
36
- "productiveHeading03",
37
- "productiveHeading04",
38
- "productiveHeading05",
39
- "expressiveHeading03",
40
- "expressiveHeading04",
41
- "expressiveHeading05",
42
- "expressiveHeading06",
43
- "expressiveParagraph01",
44
- "quotation01",
45
- "quotation02",
46
- "display01",
47
- "display02",
48
- "display03",
49
- "display04",
50
- ]
51
- `);
15
+ Array [
16
+ "fontFamilies",
17
+ "fontFamily",
18
+ "fontWeights",
19
+ "fontWeight",
20
+ "print",
21
+ "reset",
22
+ "getTypeSize",
23
+ "scale",
24
+ "styles",
25
+ "caption01",
26
+ "label01",
27
+ "helperText01",
28
+ "bodyShort01",
29
+ "bodyLong01",
30
+ "bodyShort02",
31
+ "bodyLong02",
32
+ "code01",
33
+ "code02",
34
+ "heading01",
35
+ "productiveHeading01",
36
+ "heading02",
37
+ "productiveHeading02",
38
+ "productiveHeading03",
39
+ "productiveHeading04",
40
+ "productiveHeading05",
41
+ "productiveHeading06",
42
+ "productiveHeading07",
43
+ "expressiveHeading01",
44
+ "expressiveHeading02",
45
+ "expressiveHeading03",
46
+ "expressiveHeading04",
47
+ "expressiveHeading05",
48
+ "expressiveHeading06",
49
+ "expressiveParagraph01",
50
+ "quotation01",
51
+ "quotation02",
52
+ "display01",
53
+ "display02",
54
+ "display03",
55
+ "display04",
56
+ ]
57
+ `);
52
58
  });
53
59
  });
@@ -61,7 +61,6 @@ Object {
61
61
  "letterSpacing": "-0.96px",
62
62
  "lineHeight": "105%",
63
63
  },
64
- "fontFamily": "'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",
65
64
  "fontSize": "calc(2.625rem + 1.625 * ((100vw - 20rem) / 22))",
66
65
  "fontWeight": 600,
67
66
  "letterSpacing": 0,
package/src/reset.js CHANGED
@@ -23,4 +23,7 @@ export const reset = {
23
23
  strong: {
24
24
  fontWeight: fontWeights.semibold,
25
25
  },
26
+ code: {
27
+ fontFamily: fontFamilies.mono,
28
+ },
26
29
  };
package/src/styles.js CHANGED
@@ -7,12 +7,10 @@
7
7
 
8
8
  import { breakpoint, breakpoints, px, rem } from '@carbon/layout';
9
9
  import { fluid } from './fluid';
10
- import { fontFamilies } from './fontFamily';
11
10
  import { fontWeights } from './fontWeight';
12
11
  import { scale } from './scale';
13
12
 
14
13
  export const caption01 = {
15
- fontFamily: fontFamilies.sans,
16
14
  fontSize: rem(scale[0]),
17
15
  fontWeight: fontWeights.regular,
18
16
  lineHeight: rem(16),
@@ -20,7 +18,6 @@ export const caption01 = {
20
18
  };
21
19
 
22
20
  export const label01 = {
23
- fontFamily: fontFamilies.sans,
24
21
  fontSize: rem(scale[0]),
25
22
  fontWeight: fontWeights.regular,
26
23
  lineHeight: rem(16),
@@ -28,7 +25,6 @@ export const label01 = {
28
25
  };
29
26
 
30
27
  export const helperText01 = {
31
- fontFamily: fontFamilies.sans,
32
28
  fontSize: rem(scale[0]),
33
29
  fontStyle: 'italic',
34
30
  lineHeight: rem(16),
@@ -36,7 +32,6 @@ export const helperText01 = {
36
32
  };
37
33
 
38
34
  export const bodyShort01 = {
39
- fontFamily: fontFamilies.sans,
40
35
  fontSize: rem(scale[1]),
41
36
  fontWeight: fontWeights.regular,
42
37
  lineHeight: rem(18),
@@ -44,7 +39,6 @@ export const bodyShort01 = {
44
39
  };
45
40
 
46
41
  export const bodyLong01 = {
47
- fontFamily: fontFamilies.sans,
48
42
  fontSize: rem(scale[1]),
49
43
  fontWeight: fontWeights.regular,
50
44
  lineHeight: rem(20),
@@ -52,7 +46,6 @@ export const bodyLong01 = {
52
46
  };
53
47
 
54
48
  export const bodyShort02 = {
55
- fontFamily: fontFamilies.sans,
56
49
  fontSize: rem(scale[2]),
57
50
  fontWeight: fontWeights.regular,
58
51
  lineHeight: rem(22),
@@ -60,7 +53,6 @@ export const bodyShort02 = {
60
53
  };
61
54
 
62
55
  export const bodyLong02 = {
63
- fontFamily: fontFamilies.sans,
64
56
  fontSize: rem(scale[2]),
65
57
  fontWeight: fontWeights.regular,
66
58
  lineHeight: rem(24),
@@ -68,7 +60,6 @@ export const bodyLong02 = {
68
60
  };
69
61
 
70
62
  export const code01 = {
71
- fontFamily: fontFamilies.mono,
72
63
  fontSize: rem(scale[0]),
73
64
  fontWeight: fontWeights.regular,
74
65
  lineHeight: rem(16),
@@ -76,7 +67,6 @@ export const code01 = {
76
67
  };
77
68
 
78
69
  export const code02 = {
79
- fontFamily: fontFamilies.mono,
80
70
  fontSize: rem(scale[1]),
81
71
  fontWeight: fontWeights.regular,
82
72
  lineHeight: rem(20),
@@ -84,23 +74,24 @@ export const code02 = {
84
74
  };
85
75
 
86
76
  export const heading01 = {
87
- fontFamily: fontFamilies.sans,
88
77
  fontSize: rem(scale[1]),
89
78
  fontWeight: fontWeights.semibold,
90
79
  lineHeight: rem(18),
91
80
  letterSpacing: px(0.16),
92
81
  };
93
82
 
83
+ export const productiveHeading01 = heading01;
84
+
94
85
  export const heading02 = {
95
- fontFamily: fontFamilies.sans,
96
86
  fontSize: rem(scale[2]),
97
87
  fontWeight: fontWeights.semibold,
98
88
  lineHeight: rem(22),
99
89
  letterSpacing: 0,
100
90
  };
101
91
 
92
+ export const productiveHeading02 = heading02;
93
+
102
94
  export const productiveHeading03 = {
103
- fontFamily: fontFamilies.sans,
104
95
  fontSize: rem(scale[4]),
105
96
  fontWeight: fontWeights.regular,
106
97
  lineHeight: rem(26),
@@ -108,7 +99,6 @@ export const productiveHeading03 = {
108
99
  };
109
100
 
110
101
  export const productiveHeading04 = {
111
- fontFamily: fontFamilies.sans,
112
102
  fontSize: rem(scale[6]),
113
103
  fontWeight: fontWeights.regular,
114
104
  lineHeight: rem(36),
@@ -116,15 +106,31 @@ export const productiveHeading04 = {
116
106
  };
117
107
 
118
108
  export const productiveHeading05 = {
119
- fontFamily: fontFamilies.sans,
120
109
  fontSize: rem(scale[7]),
121
110
  fontWeight: fontWeights.regular,
122
111
  lineHeight: rem(40),
123
112
  letterSpacing: 0,
124
113
  };
125
114
 
115
+ export const productiveHeading06 = {
116
+ fontSize: rem(scale[9]),
117
+ fontWeight: fontWeights.light,
118
+ lineHeight: rem(50),
119
+ letterSpacing: 0,
120
+ };
121
+
122
+ export const productiveHeading07 = {
123
+ fontSize: rem(scale[11]),
124
+ fontWeight: fontWeights.light,
125
+ lineHeight: rem(64),
126
+ letterSpacing: 0,
127
+ };
128
+
129
+ export const expressiveHeading01 = heading01;
130
+
131
+ export const expressiveHeading02 = heading02;
132
+
126
133
  export const expressiveHeading03 = fluid({
127
- fontFamily: fontFamilies.sans,
128
134
  fontSize: rem(scale[4]),
129
135
  fontWeight: fontWeights.regular,
130
136
  lineHeight: '130%',
@@ -141,7 +147,6 @@ export const expressiveHeading03 = fluid({
141
147
  });
142
148
 
143
149
  export const expressiveHeading04 = fluid({
144
- fontFamily: fontFamilies.sans,
145
150
  fontSize: rem(scale[6]),
146
151
  fontWeight: fontWeights.regular,
147
152
  lineHeight: '129%',
@@ -158,7 +163,6 @@ export const expressiveHeading04 = fluid({
158
163
  });
159
164
 
160
165
  export const expressiveHeading05 = fluid({
161
- fontFamily: fontFamilies.sans,
162
166
  fontSize: rem(scale[7]),
163
167
  fontWeight: fontWeights.regular,
164
168
  lineHeight: '125%',
@@ -166,28 +170,24 @@ export const expressiveHeading05 = fluid({
166
170
  breakpoints: {
167
171
  md: {
168
172
  fontSize: rem(scale[8]),
169
- fontFamily: fontFamilies.sans,
170
173
  fontWeight: fontWeights.light,
171
174
  lineHeight: '122%',
172
175
  letterSpacing: 0,
173
176
  },
174
177
  lg: {
175
178
  fontSize: rem(scale[9]),
176
- fontFamily: fontFamilies.sans,
177
179
  fontWeight: fontWeights.light,
178
180
  lineHeight: '119%',
179
181
  letterSpacing: 0,
180
182
  },
181
183
  xlg: {
182
184
  fontSize: rem(scale[10]),
183
- fontFamily: fontFamilies.sans,
184
185
  fontWeight: fontWeights.light,
185
186
  lineHeight: '117%',
186
187
  letterSpacing: 0,
187
188
  },
188
189
  max: {
189
190
  fontSize: rem(scale[12]),
190
- fontFamily: fontFamilies.sans,
191
191
  fontWeight: fontWeights.light,
192
192
  lineHeight: rem(70),
193
193
  letterSpacing: 0,
@@ -196,7 +196,6 @@ export const expressiveHeading05 = fluid({
196
196
  });
197
197
 
198
198
  export const expressiveHeading06 = fluid({
199
- fontFamily: fontFamilies.sans,
200
199
  fontSize: rem(scale[7]),
201
200
  fontWeight: fontWeights.semibold,
202
201
  lineHeight: '125%',
@@ -204,28 +203,24 @@ export const expressiveHeading06 = fluid({
204
203
  breakpoints: {
205
204
  md: {
206
205
  fontSize: rem(scale[8]),
207
- fontFamily: fontFamilies.sans,
208
206
  fontWeight: fontWeights.semibold,
209
207
  lineHeight: '122%',
210
208
  letterSpacing: 0,
211
209
  },
212
210
  lg: {
213
211
  fontSize: rem(scale[9]),
214
- fontFamily: fontFamilies.sans,
215
212
  fontWeight: fontWeights.semibold,
216
213
  lineHeight: '119%',
217
214
  letterSpacing: 0,
218
215
  },
219
216
  xlg: {
220
217
  fontSize: rem(scale[10]),
221
- fontFamily: fontFamilies.sans,
222
218
  fontWeight: fontWeights.semibold,
223
219
  lineHeight: '117%',
224
220
  letterSpacing: 0,
225
221
  },
226
222
  max: {
227
223
  fontSize: rem(scale[12]),
228
- fontFamily: fontFamilies.sans,
229
224
  fontWeight: fontWeights.semibold,
230
225
  lineHeight: rem(70),
231
226
  letterSpacing: 0,
@@ -234,7 +229,6 @@ export const expressiveHeading06 = fluid({
234
229
  });
235
230
 
236
231
  export const expressiveParagraph01 = fluid({
237
- fontFamily: fontFamilies.sans,
238
232
  fontSize: rem(scale[5]),
239
233
  fontWeight: fontWeights.light,
240
234
  lineHeight: '125%',
@@ -250,7 +244,6 @@ export const expressiveParagraph01 = fluid({
250
244
  });
251
245
 
252
246
  export const quotation01 = fluid({
253
- fontFamily: fontFamilies.serif,
254
247
  fontSize: rem(scale[4]),
255
248
  fontWeight: fontWeights.regular,
256
249
  lineHeight: '130%',
@@ -258,27 +251,23 @@ export const quotation01 = fluid({
258
251
  breakpoints: {
259
252
  md: {
260
253
  fontSize: rem(scale[4]),
261
- fontFamily: fontFamilies.serif,
262
254
  fontWeight: fontWeights.regular,
263
255
  letterSpacing: 0,
264
256
  },
265
257
  lg: {
266
258
  fontSize: rem(scale[5]),
267
- fontFamily: fontFamilies.serif,
268
259
  fontWeight: fontWeights.regular,
269
260
  lineHeight: '125%',
270
261
  letterSpacing: 0,
271
262
  },
272
263
  xlg: {
273
264
  fontSize: rem(scale[6]),
274
- fontFamily: fontFamilies.serif,
275
265
  fontWeight: fontWeights.regular,
276
266
  lineHeight: '129%',
277
267
  letterSpacing: 0,
278
268
  },
279
269
  max: {
280
270
  fontSize: rem(scale[7]),
281
- fontFamily: fontFamilies.serif,
282
271
  fontWeight: fontWeights.regular,
283
272
  lineHeight: '125%',
284
273
  letterSpacing: 0,
@@ -287,7 +276,6 @@ export const quotation01 = fluid({
287
276
  });
288
277
 
289
278
  export const quotation02 = fluid({
290
- fontFamily: fontFamilies.serif,
291
279
  fontSize: rem(scale[7]),
292
280
  fontWeight: fontWeights.light,
293
281
  lineHeight: '125%',
@@ -312,7 +300,6 @@ export const quotation02 = fluid({
312
300
  });
313
301
 
314
302
  export const display01 = fluid({
315
- fontFamily: fontFamilies.sans,
316
303
  fontSize: rem(scale[9]),
317
304
  fontWeight: fontWeights.light,
318
305
  lineHeight: '119%',
@@ -336,7 +323,6 @@ export const display01 = fluid({
336
323
  });
337
324
 
338
325
  export const display02 = fluid({
339
- fontFamily: fontFamilies.sans,
340
326
  fontSize: rem(scale[9]),
341
327
  fontWeight: fontWeights.semibold,
342
328
  lineHeight: '119%',
@@ -360,7 +346,6 @@ export const display02 = fluid({
360
346
  });
361
347
 
362
348
  export const display03 = fluid({
363
- fontFamily: fontFamilies.sans,
364
349
  fontSize: rem(scale[9]),
365
350
  fontWeight: fontWeights.light,
366
351
  lineHeight: '119%',
@@ -388,7 +373,6 @@ export const display03 = fluid({
388
373
  });
389
374
 
390
375
  export const display04 = fluid({
391
- fontFamily: fontFamilies.sans,
392
376
  fontSize: rem(scale[9]),
393
377
  fontWeight: fontWeights.semibold,
394
378
  lineHeight: '119%',