@carbon/layout 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.
- package/CHANGELOG.md +464 -0
- package/LICENSE +2 -2
- package/README.md +23 -19
- package/docs/sass.md +1681 -0
- package/es/index.js +6 -3
- package/lib/index.js +8 -2
- package/package.json +4 -4
- package/scss/_breakpoint.scss +63 -25
- package/scss/_convert.scss +12 -5
- package/scss/_key-height.scss +14 -7
- package/scss/_mini-unit.scss +8 -3
- package/scss/_spacing.scss +274 -1
- package/scss/_utilities.scss +10 -8
- package/scss/index.scss +8 -0
- package/src/index.js +7 -1
- package/umd/index.js +8 -2
package/scss/_utilities.scss
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
/// @access public
|
|
11
11
|
/// @param {Map} $map - Map
|
|
12
12
|
/// @param {Arglist} $keys - Key chain
|
|
13
|
-
/// @return {*}
|
|
13
|
+
/// @return {*} Desired value
|
|
14
|
+
/// @group @carbon/layout
|
|
14
15
|
@function map-deep-get($map, $keys...) {
|
|
15
16
|
@each $key in $keys {
|
|
16
17
|
$map: map-get($map, $key);
|
|
@@ -18,21 +19,22 @@
|
|
|
18
19
|
@return $map;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
///
|
|
22
|
-
///
|
|
23
|
-
/// key value.
|
|
22
|
+
/// Provide a map and index, and get back the relevant key value
|
|
23
|
+
/// @access public
|
|
24
24
|
/// @param {Map} $map - Map
|
|
25
25
|
/// @param {Integer} $index - Key chain
|
|
26
|
-
/// @return {String}
|
|
26
|
+
/// @return {String} Desired value
|
|
27
|
+
/// @group @carbon/layout
|
|
27
28
|
@function carbon--key-by-index($map, $index) {
|
|
28
29
|
$keys: map-keys($map);
|
|
29
30
|
@return nth($keys, $index);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
///
|
|
33
|
-
///
|
|
33
|
+
/// Pass in a map, and get the last one in the list back
|
|
34
|
+
/// @access public
|
|
34
35
|
/// @param {Map} $map - Map
|
|
35
|
-
/// @return {*}
|
|
36
|
+
/// @return {*} Desired value
|
|
37
|
+
/// @group @carbon/layout
|
|
36
38
|
@function last-map-item($map) {
|
|
37
39
|
$total-length: length($map);
|
|
38
40
|
@return map-get($map, carbon--key-by-index($map, $total-length));
|
package/scss/index.scss
ADDED
package/src/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export function em(px) {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Convert a given px unit to its string representation
|
|
32
|
-
* @param {number}
|
|
32
|
+
* @param {number} value - number of pixels
|
|
33
33
|
* @returns {string}
|
|
34
34
|
*/
|
|
35
35
|
export function px(value) {
|
|
@@ -95,6 +95,9 @@ export const spacing06 = miniUnits(3);
|
|
|
95
95
|
export const spacing07 = miniUnits(4);
|
|
96
96
|
export const spacing08 = miniUnits(5);
|
|
97
97
|
export const spacing09 = miniUnits(6);
|
|
98
|
+
export const spacing10 = miniUnits(8);
|
|
99
|
+
export const spacing11 = miniUnits(10);
|
|
100
|
+
export const spacing12 = miniUnits(12);
|
|
98
101
|
export const spacing = [
|
|
99
102
|
spacing01,
|
|
100
103
|
spacing02,
|
|
@@ -105,6 +108,9 @@ export const spacing = [
|
|
|
105
108
|
spacing07,
|
|
106
109
|
spacing08,
|
|
107
110
|
spacing09,
|
|
111
|
+
spacing10,
|
|
112
|
+
spacing11,
|
|
113
|
+
spacing12,
|
|
108
114
|
];
|
|
109
115
|
|
|
110
116
|
// Layout
|
package/umd/index.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Convert a given px unit to its string representation
|
|
36
|
-
* @param {number}
|
|
36
|
+
* @param {number} value - number of pixels
|
|
37
37
|
* @returns {string}
|
|
38
38
|
*/
|
|
39
39
|
|
|
@@ -93,7 +93,10 @@
|
|
|
93
93
|
var spacing07 = miniUnits(4);
|
|
94
94
|
var spacing08 = miniUnits(5);
|
|
95
95
|
var spacing09 = miniUnits(6);
|
|
96
|
-
var
|
|
96
|
+
var spacing10 = miniUnits(8);
|
|
97
|
+
var spacing11 = miniUnits(10);
|
|
98
|
+
var spacing12 = miniUnits(12);
|
|
99
|
+
var spacing = [spacing01, spacing02, spacing03, spacing04, spacing05, spacing06, spacing07, spacing08, spacing09, spacing10, spacing11, spacing12]; // Layout
|
|
97
100
|
|
|
98
101
|
var layout01 = miniUnits(2);
|
|
99
102
|
var layout02 = miniUnits(3);
|
|
@@ -123,6 +126,9 @@
|
|
|
123
126
|
exports.spacing07 = spacing07;
|
|
124
127
|
exports.spacing08 = spacing08;
|
|
125
128
|
exports.spacing09 = spacing09;
|
|
129
|
+
exports.spacing10 = spacing10;
|
|
130
|
+
exports.spacing11 = spacing11;
|
|
131
|
+
exports.spacing12 = spacing12;
|
|
126
132
|
exports.spacing = spacing;
|
|
127
133
|
exports.layout01 = layout01;
|
|
128
134
|
exports.layout02 = layout02;
|