@carbon/type 10.33.0 → 10.35.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.
@@ -4,6 +4,20 @@
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
+ //-------------------------------------------
8
+ // Compatibility notes
9
+ // ------------------------------------------
10
+ //
11
+ // This file is intended to be consumed and processed with node-sass/libsass.
12
+ // Sass language features only available in dart-sass, such as `math.div`,
13
+ // should not be used.
14
+ //
15
+ // The `.import` suffixed version of this file eg. `_filename.import.scss`
16
+ // is intended to be compatible with dart-sass.
17
+ //
18
+ // Styles authored within this file must be duplicated to the corresponding
19
+ // compatibility file to ensure we continue to support node-sass and dart-sass
20
+ // in v10.
7
21
 
8
22
  @import 'breakpoint';
9
23
  @import 'utilities';
@@ -57,7 +57,7 @@ $grid-breakpoints: (
57
57
  ) !default;
58
58
 
59
59
  /// Get the value of the next breakpoint, or null for the last breakpoint
60
- /// @param {String} $name - The name of the brekapoint
60
+ /// @param {String} $name - The name of the breakpoint
61
61
  /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
62
62
  /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
63
63
  /// @return {String}
@@ -76,7 +76,7 @@ $grid-breakpoints: (
76
76
  }
77
77
 
78
78
  /// Get the value of the previous breakpoint, or null for the first breakpoint
79
- /// @param {String} $name - The name of the brekapoint
79
+ /// @param {String} $name - The name of the breakpoint
80
80
  /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
81
81
  /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
82
82
  /// @return {String}
@@ -95,7 +95,7 @@ $grid-breakpoints: (
95
95
  }
96
96
 
97
97
  /// Check to see if the given breakpoint name
98
- /// @param {String} $name - The name of the brekapoint
98
+ /// @param {String} $name - The name of the breakpoint
99
99
  /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
100
100
  /// @return {Bool}
101
101
  /// @access public
@@ -114,7 +114,7 @@ $grid-breakpoints: (
114
114
  @return key-by-index($breakpoints, $total-breakpoints);
115
115
  }
116
116
 
117
- /// Get the infix for a given breakpoint in a list of breakpoints. Usesful for generate the size part in a selector, for example: `.prefix--col-sm-2`.
117
+ /// Get the infix for a given breakpoint in a list of breakpoints. Useful for generating the size part in a selector, for example: `.prefix--col-sm-2`.
118
118
  /// @param {String} $name - The name of the breakpoint
119
119
  /// @return {String}
120
120
  /// @access public
@@ -5,6 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use 'sass:math';
9
+
8
10
  /// Default font size
9
11
  /// @type Number
10
12
  /// @access public
@@ -22,7 +24,7 @@ $base-font-size: 16px !default;
22
24
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
23
25
  }
24
26
 
25
- @return ($px / $base-font-size) * 1rem;
27
+ @return math.div($px, $base-font-size) * 1rem;
26
28
  }
27
29
 
28
30
  /// Convert a given px unit to a em unit
@@ -36,5 +38,5 @@ $base-font-size: 16px !default;
36
38
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
37
39
  }
38
40
 
39
- @return ($px / $base-font-size) * 1em;
41
+ @return math.div($px, $base-font-size) * 1em;
40
42
  }
@@ -1,9 +1,37 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`styles body01 should be printable 1`] = `
4
+ "font-size: 0.875rem;
5
+ font-weight: 400;
6
+ line-height: 1.42857;
7
+ letter-spacing: 0.16px;"
8
+ `;
9
+
10
+ exports[`styles body02 should be printable 1`] = `
11
+ "font-size: 1rem;
12
+ font-weight: 400;
13
+ line-height: 1.5;
14
+ letter-spacing: 0;"
15
+ `;
16
+
17
+ exports[`styles bodyCompact01 should be printable 1`] = `
18
+ "font-size: 0.875rem;
19
+ font-weight: 400;
20
+ line-height: 1.28572;
21
+ letter-spacing: 0.16px;"
22
+ `;
23
+
24
+ exports[`styles bodyCompact02 should be printable 1`] = `
25
+ "font-size: 1rem;
26
+ font-weight: 400;
27
+ line-height: 1.375;
28
+ letter-spacing: 0;"
29
+ `;
30
+
3
31
  exports[`styles bodyLong01 should be printable 1`] = `
4
32
  "font-size: 0.875rem;
5
33
  font-weight: 400;
6
- line-height: 1.43;
34
+ line-height: 1.42857;
7
35
  letter-spacing: 0.16px;"
8
36
  `;
9
37
 
@@ -17,7 +45,7 @@ letter-spacing: 0;"
17
45
  exports[`styles bodyShort01 should be printable 1`] = `
18
46
  "font-size: 0.875rem;
19
47
  font-weight: 400;
20
- line-height: 1.29;
48
+ line-height: 1.28572;
21
49
  letter-spacing: 0.16px;"
22
50
  `;
23
51
 
@@ -31,14 +59,14 @@ letter-spacing: 0;"
31
59
  exports[`styles caption01 should be printable 1`] = `
32
60
  "font-size: 0.75rem;
33
61
  font-weight: 400;
34
- line-height: 1.34;
62
+ line-height: 1.33333;
35
63
  letter-spacing: 0.32px;"
36
64
  `;
37
65
 
38
66
  exports[`styles caption02 should be printable 1`] = `
39
67
  "font-size: 0.875rem;
40
68
  font-weight: 400;
41
- line-height: 1.29;
69
+ line-height: 1.28572;
42
70
  letter-spacing: 0.32px;"
43
71
  `;
44
72
 
@@ -46,7 +74,7 @@ exports[`styles code01 should be printable 1`] = `
46
74
  "font-family: 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace;
47
75
  font-size: 0.75rem;
48
76
  font-weight: 400;
49
- line-height: 1.34;
77
+ line-height: 1.33333;
50
78
  letter-spacing: 0.32px;"
51
79
  `;
52
80
 
@@ -54,7 +82,7 @@ exports[`styles code02 should be printable 1`] = `
54
82
  "font-family: 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace;
55
83
  font-size: 0.875rem;
56
84
  font-weight: 400;
57
- line-height: 1.43;
85
+ line-height: 1.42857;
58
86
  letter-spacing: 0.32px;"
59
87
  `;
60
88
 
@@ -110,7 +138,7 @@ letter-spacing: 0;"
110
138
  exports[`styles expressiveHeading04 should be printable 1`] = `
111
139
  "font-size: 1.75rem;
112
140
  font-weight: 400;
113
- line-height: 1.29;
141
+ line-height: 1.28572;
114
142
  letter-spacing: 0;"
115
143
  `;
116
144
 
@@ -135,50 +163,192 @@ line-height: 1.334;
135
163
  letter-spacing: 0;"
136
164
  `;
137
165
 
166
+ exports[`styles fluidDisplay01 should be printable 1`] = `
167
+ "font-size: 2.625rem;
168
+ font-weight: 300;
169
+ line-height: 1.19;
170
+ letter-spacing: 0;"
171
+ `;
172
+
173
+ exports[`styles fluidDisplay02 should be printable 1`] = `
174
+ "font-size: 2.625rem;
175
+ font-weight: 600;
176
+ line-height: 1.19;
177
+ letter-spacing: 0;"
178
+ `;
179
+
180
+ exports[`styles fluidDisplay03 should be printable 1`] = `
181
+ "font-size: 2.625rem;
182
+ font-weight: 300;
183
+ line-height: 1.19;
184
+ letter-spacing: 0;"
185
+ `;
186
+
187
+ exports[`styles fluidDisplay04 should be printable 1`] = `
188
+ "font-size: 2.625rem;
189
+ font-weight: 600;
190
+ line-height: 1.19;
191
+ letter-spacing: 0;"
192
+ `;
193
+
194
+ exports[`styles fluidHeading03 should be printable 1`] = `
195
+ "font-size: 1.25rem;
196
+ font-weight: 400;
197
+ line-height: 1.4;
198
+ letter-spacing: 0;"
199
+ `;
200
+
201
+ exports[`styles fluidHeading04 should be printable 1`] = `
202
+ "font-size: 1.75rem;
203
+ font-weight: 400;
204
+ line-height: 1.28572;
205
+ letter-spacing: 0;"
206
+ `;
207
+
208
+ exports[`styles fluidHeading05 should be printable 1`] = `
209
+ "font-size: 2rem;
210
+ font-weight: 400;
211
+ line-height: 1.25;
212
+ letter-spacing: 0;"
213
+ `;
214
+
215
+ exports[`styles fluidHeading06 should be printable 1`] = `
216
+ "font-size: 2rem;
217
+ font-weight: 600;
218
+ line-height: 1.25;
219
+ letter-spacing: 0;"
220
+ `;
221
+
222
+ exports[`styles fluidParagraph01 should be printable 1`] = `
223
+ "font-size: 1.5rem;
224
+ font-weight: 300;
225
+ line-height: 1.334;
226
+ letter-spacing: 0;"
227
+ `;
228
+
229
+ exports[`styles fluidQuotation01 should be printable 1`] = `
230
+ "font-family: 'IBM Plex Serif', 'Georgia', Times, serif;
231
+ font-size: 1.25rem;
232
+ font-weight: 400;
233
+ line-height: 1.3;
234
+ letter-spacing: 0;"
235
+ `;
236
+
237
+ exports[`styles fluidQuotation02 should be printable 1`] = `
238
+ "font-family: 'IBM Plex Serif', 'Georgia', Times, serif;
239
+ font-size: 2rem;
240
+ font-weight: 300;
241
+ line-height: 1.25;
242
+ letter-spacing: 0;"
243
+ `;
244
+
138
245
  exports[`styles heading01 should be printable 1`] = `
139
246
  "font-size: 0.875rem;
140
247
  font-weight: 600;
141
- line-height: 1.29;
248
+ line-height: 1.42857;
142
249
  letter-spacing: 0.16px;"
143
250
  `;
144
251
 
145
252
  exports[`styles heading02 should be printable 1`] = `
146
253
  "font-size: 1rem;
147
254
  font-weight: 600;
255
+ line-height: 1.5;
256
+ letter-spacing: 0;"
257
+ `;
258
+
259
+ exports[`styles heading03 should be printable 1`] = `
260
+ "font-size: 1.25rem;
261
+ font-weight: 400;
262
+ line-height: 1.4;
263
+ letter-spacing: 0;"
264
+ `;
265
+
266
+ exports[`styles heading04 should be printable 1`] = `
267
+ "font-size: 1.75rem;
268
+ font-weight: 400;
269
+ line-height: 1.28572;
270
+ letter-spacing: 0;"
271
+ `;
272
+
273
+ exports[`styles heading05 should be printable 1`] = `
274
+ "font-size: 2rem;
275
+ font-weight: 400;
276
+ line-height: 1.25;
277
+ letter-spacing: 0;"
278
+ `;
279
+
280
+ exports[`styles heading06 should be printable 1`] = `
281
+ "font-size: 2.625rem;
282
+ font-weight: 300;
283
+ line-height: 1.199;
284
+ letter-spacing: 0;"
285
+ `;
286
+
287
+ exports[`styles heading07 should be printable 1`] = `
288
+ "font-size: 3.375rem;
289
+ font-weight: 300;
290
+ line-height: 1.199;
291
+ letter-spacing: 0;"
292
+ `;
293
+
294
+ exports[`styles headingCompact01 should be printable 1`] = `
295
+ "font-size: 0.875rem;
296
+ font-weight: 600;
297
+ line-height: 1.28572;
298
+ letter-spacing: 0.16px;"
299
+ `;
300
+
301
+ exports[`styles headingCompact02 should be printable 1`] = `
302
+ "font-size: 1rem;
303
+ font-weight: 600;
148
304
  line-height: 1.375;
149
305
  letter-spacing: 0;"
150
306
  `;
151
307
 
152
308
  exports[`styles helperText01 should be printable 1`] = `
153
309
  "font-size: 0.75rem;
154
- line-height: 1.34;
310
+ line-height: 1.33333;
155
311
  letter-spacing: 0.32px;"
156
312
  `;
157
313
 
158
314
  exports[`styles helperText02 should be printable 1`] = `
159
315
  "font-size: 0.875rem;
160
- line-height: 1.29;
161
- letter-spacing: 0.32px;"
316
+ line-height: 1.28572;
317
+ letter-spacing: 0.16px;"
162
318
  `;
163
319
 
164
320
  exports[`styles label01 should be printable 1`] = `
165
321
  "font-size: 0.75rem;
166
322
  font-weight: 400;
167
- line-height: 1.34;
323
+ line-height: 1.33333;
168
324
  letter-spacing: 0.32px;"
169
325
  `;
170
326
 
171
327
  exports[`styles label02 should be printable 1`] = `
172
328
  "font-size: 0.875rem;
173
329
  font-weight: 400;
174
- line-height: 1.29;
330
+ line-height: 1.28572;
331
+ letter-spacing: 0.16px;"
332
+ `;
333
+
334
+ exports[`styles legal01 should be printable 1`] = `
335
+ "font-size: 0.75rem;
336
+ font-weight: 400;
337
+ line-height: 1.33333;
175
338
  letter-spacing: 0.32px;"
176
339
  `;
177
340
 
341
+ exports[`styles legal02 should be printable 1`] = `
342
+ "font-size: 0.875rem;
343
+ font-weight: 400;
344
+ line-height: 1.28572;
345
+ letter-spacing: 0.16px;"
346
+ `;
347
+
178
348
  exports[`styles productiveHeading01 should be printable 1`] = `
179
349
  "font-size: 0.875rem;
180
350
  font-weight: 600;
181
- line-height: 1.29;
351
+ line-height: 1.28572;
182
352
  letter-spacing: 0.16px;"
183
353
  `;
184
354
 
@@ -199,7 +369,7 @@ letter-spacing: 0;"
199
369
  exports[`styles productiveHeading04 should be printable 1`] = `
200
370
  "font-size: 1.75rem;
201
371
  font-weight: 400;
202
- line-height: 1.29;
372
+ line-height: 1.28572;
203
373
  letter-spacing: 0;"
204
374
  `;
205
375
 
@@ -220,19 +390,21 @@ letter-spacing: 0;"
220
390
  exports[`styles productiveHeading07 should be printable 1`] = `
221
391
  "font-size: 3.375rem;
222
392
  font-weight: 300;
223
- line-height: 1.19;
393
+ line-height: 1.199;
224
394
  letter-spacing: 0;"
225
395
  `;
226
396
 
227
397
  exports[`styles quotation01 should be printable 1`] = `
228
- "font-size: 1.25rem;
398
+ "font-family: 'IBM Plex Serif', 'Georgia', Times, serif;
399
+ font-size: 1.25rem;
229
400
  font-weight: 400;
230
401
  line-height: 1.3;
231
402
  letter-spacing: 0;"
232
403
  `;
233
404
 
234
405
  exports[`styles quotation02 should be printable 1`] = `
235
- "font-size: 2rem;
406
+ "font-family: 'IBM Plex Serif', 'Georgia', Times, serif;
407
+ font-size: 2rem;
236
408
  font-weight: 300;
237
409
  line-height: 1.25;
238
410
  letter-spacing: 0;"
@@ -12,53 +12,77 @@ 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
- "fluid",
25
- "unstable_tokens",
26
- "styles",
27
- "caption01",
28
- "caption02",
29
- "label01",
30
- "label02",
31
- "helperText01",
32
- "helperText02",
33
- "bodyShort01",
34
- "bodyLong01",
35
- "bodyShort02",
36
- "bodyLong02",
37
- "code01",
38
- "code02",
39
- "heading01",
40
- "productiveHeading01",
41
- "heading02",
42
- "productiveHeading02",
43
- "productiveHeading03",
44
- "productiveHeading04",
45
- "productiveHeading05",
46
- "productiveHeading06",
47
- "productiveHeading07",
48
- "expressiveHeading01",
49
- "expressiveHeading02",
50
- "expressiveHeading03",
51
- "expressiveHeading04",
52
- "expressiveHeading05",
53
- "expressiveHeading06",
54
- "expressiveParagraph01",
55
- "quotation01",
56
- "quotation02",
57
- "display01",
58
- "display02",
59
- "display03",
60
- "display04",
61
- ]
62
- `);
15
+ Array [
16
+ "fontFamilies",
17
+ "fontFamily",
18
+ "fontWeights",
19
+ "fontWeight",
20
+ "print",
21
+ "reset",
22
+ "getTypeSize",
23
+ "scale",
24
+ "fluid",
25
+ "unstable_tokens",
26
+ "styles",
27
+ "caption01",
28
+ "caption02",
29
+ "label01",
30
+ "label02",
31
+ "helperText01",
32
+ "helperText02",
33
+ "bodyShort01",
34
+ "bodyLong01",
35
+ "bodyShort02",
36
+ "bodyLong02",
37
+ "code01",
38
+ "code02",
39
+ "heading01",
40
+ "productiveHeading01",
41
+ "heading02",
42
+ "productiveHeading02",
43
+ "productiveHeading03",
44
+ "productiveHeading04",
45
+ "productiveHeading05",
46
+ "productiveHeading06",
47
+ "productiveHeading07",
48
+ "expressiveHeading01",
49
+ "expressiveHeading02",
50
+ "expressiveHeading03",
51
+ "expressiveHeading04",
52
+ "expressiveHeading05",
53
+ "expressiveHeading06",
54
+ "expressiveParagraph01",
55
+ "quotation01",
56
+ "quotation02",
57
+ "display01",
58
+ "display02",
59
+ "display03",
60
+ "display04",
61
+ "legal01",
62
+ "legal02",
63
+ "bodyCompact01",
64
+ "bodyCompact02",
65
+ "body01",
66
+ "body02",
67
+ "headingCompact01",
68
+ "headingCompact02",
69
+ "heading03",
70
+ "heading04",
71
+ "heading05",
72
+ "heading06",
73
+ "heading07",
74
+ "fluidHeading03",
75
+ "fluidHeading04",
76
+ "fluidHeading05",
77
+ "fluidHeading06",
78
+ "fluidParagraph01",
79
+ "fluidQuotation01",
80
+ "fluidQuotation02",
81
+ "fluidDisplay01",
82
+ "fluidDisplay02",
83
+ "fluidDisplay03",
84
+ "fluidDisplay04",
85
+ ]
86
+ `);
63
87
  });
64
88
  });