@carbon/type 11.10.0-rc.0 → 11.11.0-rc.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 +8 -78
- package/lib/index.js +104 -174
- package/package.json +5 -4
- package/scss/_styles.scss +6 -5
- package/src/__tests__/__snapshots__/styles-test.js.snap +4 -4
- package/src/styles.js +6 -5
- package/umd/index.js +106 -178
package/es/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { px, baseFontSize, rem, breakpoint, breakpoints } from '@carbon/layout';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Copyright IBM Corp. 2018, 2018
|
|
3
5
|
*
|
|
@@ -86,79 +88,6 @@ function paramCase(string) {
|
|
|
86
88
|
return result;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
/**
|
|
90
|
-
* Copyright IBM Corp. 2018, 2018
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
93
|
-
* LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/
|
|
95
|
-
/**
|
|
96
|
-
* Copyright IBM Corp. 2018, 2018
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
99
|
-
* LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/
|
|
101
|
-
// Default, Use with em() and rem() functions
|
|
102
|
-
|
|
103
|
-
var baseFontSize = 16;
|
|
104
|
-
/**
|
|
105
|
-
* Convert a given px unit to a rem unit
|
|
106
|
-
* @param {number} px
|
|
107
|
-
* @returns {string}
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
function rem(px) {
|
|
111
|
-
return "".concat(px / baseFontSize, "rem");
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Convert a given px unit to its string representation
|
|
115
|
-
* @param {number} value - number of pixels
|
|
116
|
-
* @returns {string}
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
function px(value) {
|
|
121
|
-
return "".concat(value, "px");
|
|
122
|
-
} // Breakpoint
|
|
123
|
-
// Initial map of our breakpoints and their values
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var breakpoints = {
|
|
127
|
-
sm: {
|
|
128
|
-
width: rem(320),
|
|
129
|
-
columns: 4,
|
|
130
|
-
margin: '0'
|
|
131
|
-
},
|
|
132
|
-
md: {
|
|
133
|
-
width: rem(672),
|
|
134
|
-
columns: 8,
|
|
135
|
-
margin: rem(16)
|
|
136
|
-
},
|
|
137
|
-
lg: {
|
|
138
|
-
width: rem(1056),
|
|
139
|
-
columns: 16,
|
|
140
|
-
margin: rem(16)
|
|
141
|
-
},
|
|
142
|
-
xlg: {
|
|
143
|
-
width: rem(1312),
|
|
144
|
-
columns: 16,
|
|
145
|
-
margin: rem(16)
|
|
146
|
-
},
|
|
147
|
-
max: {
|
|
148
|
-
width: rem(1584),
|
|
149
|
-
columns: 16,
|
|
150
|
-
margin: rem(24)
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
function breakpointUp(name) {
|
|
155
|
-
return "@media (min-width: ".concat(breakpoints[name].width, ")");
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function breakpoint() {
|
|
159
|
-
return breakpointUp.apply(void 0, arguments);
|
|
160
|
-
} // Mini-unit
|
|
161
|
-
|
|
162
91
|
/**
|
|
163
92
|
* Copyright IBM Corp. 2018, 2018
|
|
164
93
|
*
|
|
@@ -410,7 +339,7 @@ var productiveHeading04$1 = {
|
|
|
410
339
|
};
|
|
411
340
|
var productiveHeading05$1 = {
|
|
412
341
|
fontSize: rem(scale[7]),
|
|
413
|
-
fontWeight: fontWeights.
|
|
342
|
+
fontWeight: fontWeights.regular,
|
|
414
343
|
lineHeight: 1.25,
|
|
415
344
|
letterSpacing: 0
|
|
416
345
|
};
|
|
@@ -440,7 +369,7 @@ var expressiveHeading03$1 = {
|
|
|
440
369
|
breakpoints: {
|
|
441
370
|
xlg: {
|
|
442
371
|
fontSize: rem(scale[4]),
|
|
443
|
-
lineHeight: 1.
|
|
372
|
+
lineHeight: 1.4
|
|
444
373
|
},
|
|
445
374
|
max: {
|
|
446
375
|
fontSize: rem(scale[5]),
|
|
@@ -456,23 +385,24 @@ var expressiveHeading04$1 = {
|
|
|
456
385
|
breakpoints: {
|
|
457
386
|
xlg: {
|
|
458
387
|
fontSize: rem(scale[7]),
|
|
459
|
-
fontWeight: fontWeights.
|
|
388
|
+
fontWeight: fontWeights.regular,
|
|
460
389
|
lineHeight: 1.25
|
|
461
390
|
},
|
|
462
391
|
max: {
|
|
463
392
|
fontSize: rem(scale[7]),
|
|
464
|
-
fontWeight: fontWeights.
|
|
393
|
+
fontWeight: fontWeights.regular
|
|
465
394
|
}
|
|
466
395
|
}
|
|
467
396
|
};
|
|
468
397
|
var expressiveHeading05$1 = {
|
|
469
398
|
fontSize: rem(scale[7]),
|
|
470
|
-
fontWeight: fontWeights.
|
|
399
|
+
fontWeight: fontWeights.regular,
|
|
471
400
|
lineHeight: 1.25,
|
|
472
401
|
letterSpacing: 0,
|
|
473
402
|
breakpoints: {
|
|
474
403
|
md: {
|
|
475
404
|
fontSize: rem(scale[8]),
|
|
405
|
+
fontWeight: fontWeights.light,
|
|
476
406
|
lineHeight: 1.22,
|
|
477
407
|
letterSpacing: 0
|
|
478
408
|
},
|