@sb1/ffe-grid-react 10.1.4 → 11.1.1
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/Grid.js +19 -69
- package/es/GridCol.js +5 -14
- package/es/GridRow.js +32 -82
- package/es/InlineGrid.js +11 -62
- package/es/background-colors.js +2 -2
- package/lib/Grid.js +20 -73
- package/lib/GridCol.js +6 -16
- package/lib/GridRow.js +34 -81
- package/lib/InlineGrid.js +11 -66
- package/lib/background-colors.js +2 -2
- package/lib/index.js +4 -4
- package/package.json +6 -8
- package/types/index.d.ts +7 -9
- package/CHANGELOG.md +0 -523
- package/es/Grid.spec.js +0 -81
- package/es/GridCol.spec.js +0 -361
- package/es/GridRow.spec.js +0 -121
- package/es/InlineGrid.spec.js +0 -62
- package/es/utils.dev.js +0 -73
- package/es/utils.js +0 -12
- package/lib/Grid.spec.js +0 -88
- package/lib/GridCol.spec.js +0 -369
- package/lib/GridRow.spec.js +0 -131
- package/lib/InlineGrid.spec.js +0 -69
- package/lib/utils.dev.js +0 -86
- package/lib/utils.js +0 -14
package/es/Grid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children", "className", "condensed", "element", "topPadding"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -6,76 +6,26 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
6
6
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
|
-
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
-
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
|
|
19
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
-
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22
|
-
|
|
23
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
|
|
25
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
-
|
|
27
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
-
|
|
29
|
-
import React, { Component } from 'react';
|
|
9
|
+
import React from 'react';
|
|
30
10
|
import classNames from 'classnames';
|
|
31
11
|
import { bool, node, string } from 'prop-types';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
50
|
-
checkForNestedComponent(this.props.children, Grid);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "render",
|
|
55
|
-
value: function render() {
|
|
56
|
-
var _this$props = this.props,
|
|
57
|
-
children = _this$props.children,
|
|
58
|
-
className = _this$props.className,
|
|
59
|
-
condensed = _this$props.condensed,
|
|
60
|
-
element = _this$props.element,
|
|
61
|
-
topPadding = _this$props.topPadding,
|
|
62
|
-
rest = _objectWithoutProperties(_this$props, ["children", "className", "condensed", "element", "topPadding"]);
|
|
63
|
-
|
|
64
|
-
var Element = element || 'div';
|
|
65
|
-
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
66
|
-
className: classNames(className, 'ffe-grid', {
|
|
67
|
-
'ffe-grid--condensed': condensed
|
|
68
|
-
}, {
|
|
69
|
-
'ffe-grid--no-top-padding': !topPadding
|
|
70
|
-
})
|
|
71
|
-
}, rest), children);
|
|
72
|
-
}
|
|
73
|
-
}]);
|
|
74
|
-
|
|
75
|
-
return Grid;
|
|
76
|
-
}(Component);
|
|
77
|
-
|
|
78
|
-
export { Grid as default };
|
|
12
|
+
export default function Grid(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
className = _ref.className,
|
|
15
|
+
condensed = _ref.condensed,
|
|
16
|
+
element = _ref.element,
|
|
17
|
+
topPadding = _ref.topPadding,
|
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
20
|
+
var Element = element || 'div';
|
|
21
|
+
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
22
|
+
className: classNames(className, 'ffe-grid', {
|
|
23
|
+
'ffe-grid--condensed': condensed
|
|
24
|
+
}, {
|
|
25
|
+
'ffe-grid--no-top-padding': !topPadding
|
|
26
|
+
})
|
|
27
|
+
}, rest), children);
|
|
28
|
+
}
|
|
79
29
|
Grid.defaultProps = {
|
|
80
30
|
topPadding: true
|
|
81
31
|
};
|
package/es/GridCol.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["bottomPadding", "children", "className", "element", "lg", "md", "sm"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
4
|
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -16,7 +18,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
16
18
|
|
|
17
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
20
|
|
|
19
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
22
|
|
|
21
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
24
|
|
|
@@ -32,7 +34,6 @@ import React, { Component, createRef } from 'react';
|
|
|
32
34
|
import { bool, node, number, oneOf, oneOfType, shape, string } from 'prop-types';
|
|
33
35
|
import classNames from 'classnames';
|
|
34
36
|
import backgroundColors, { removedColors } from './background-colors';
|
|
35
|
-
import { checkForDeprecatedModifiers, checkForNestedComponent, checkValidColumnCount } from './utils';
|
|
36
37
|
|
|
37
38
|
function camelCaseToDashCase(str) {
|
|
38
39
|
return str.split('').reduce(function (previous, current) {
|
|
@@ -95,16 +96,6 @@ var GridCol = /*#__PURE__*/function (_Component) {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
_createClass(GridCol, [{
|
|
98
|
-
key: "componentDidMount",
|
|
99
|
-
value: function componentDidMount() {
|
|
100
|
-
/* istanbul ignore else: there is no else */
|
|
101
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
102
|
-
checkForDeprecatedModifiers(this.props);
|
|
103
|
-
checkForNestedComponent(this.props.children, GridCol);
|
|
104
|
-
checkValidColumnCount(this.props, this.ref.current);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
99
|
key: "render",
|
|
109
100
|
value: function render() {
|
|
110
101
|
var _this$props = this.props,
|
|
@@ -115,7 +106,7 @@ var GridCol = /*#__PURE__*/function (_Component) {
|
|
|
115
106
|
lg = _this$props.lg,
|
|
116
107
|
md = _this$props.md,
|
|
117
108
|
sm = _this$props.sm,
|
|
118
|
-
rest = _objectWithoutProperties(_this$props,
|
|
109
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
119
110
|
|
|
120
111
|
Object.keys(rest).forEach(function (key) {
|
|
121
112
|
if (MODIFIER_LIST.includes(key)) {
|
|
@@ -142,7 +133,7 @@ GridCol.defaultProps = {
|
|
|
142
133
|
};
|
|
143
134
|
GridCol.propTypes = {
|
|
144
135
|
/** Supported background colors */
|
|
145
|
-
background: oneOf(['
|
|
136
|
+
background: oneOf(['frost-30', 'sand', 'sand-70', 'sand-30', 'syrin-70', 'syrin-30', 'vann', 'vann-30', 'fjell', 'hvit']),
|
|
146
137
|
|
|
147
138
|
/** Any extra classes are attached to the root node, in addition to ffe-grid__col classes */
|
|
148
139
|
className: string,
|
package/es/GridRow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["background", "className", "children", "element", "reverse", "topPadding"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -8,98 +8,48 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
8
8
|
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
-
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
16
|
-
|
|
17
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
|
-
|
|
19
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
-
|
|
21
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
|
-
|
|
23
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
24
|
-
|
|
25
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
-
|
|
27
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
-
|
|
29
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
|
-
|
|
31
|
-
import React, { Component } from 'react';
|
|
11
|
+
import React from 'react';
|
|
32
12
|
import { bool, node, oneOf, string } from 'prop-types';
|
|
33
13
|
import classNames from 'classnames';
|
|
34
14
|
import backgroundColors, { removedColors } from './background-colors';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
export default function GridRow(_ref) {
|
|
16
|
+
var background = _ref.background,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
element = _ref.element,
|
|
20
|
+
reverse = _ref.reverse,
|
|
21
|
+
topPadding = _ref.topPadding,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
|
|
24
|
+
var content = children;
|
|
25
|
+
var hasBackgroundColor = backgroundColors.includes(background);
|
|
26
|
+
var hasRemovedColor = removedColors.includes(background);
|
|
27
|
+
|
|
28
|
+
if (hasBackgroundColor) {
|
|
29
|
+
content = /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "ffe-grid__row-wrapper"
|
|
31
|
+
}, children);
|
|
46
32
|
}
|
|
47
33
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* istanbul ignore else: there is no else */
|
|
52
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
53
|
-
checkForNestedComponent(this.props.children, GridRow);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "render",
|
|
58
|
-
value: function render() {
|
|
59
|
-
var _this$props = this.props,
|
|
60
|
-
background = _this$props.background,
|
|
61
|
-
className = _this$props.className,
|
|
62
|
-
children = _this$props.children,
|
|
63
|
-
element = _this$props.element,
|
|
64
|
-
reverse = _this$props.reverse,
|
|
65
|
-
topPadding = _this$props.topPadding,
|
|
66
|
-
rest = _objectWithoutProperties(_this$props, ["background", "className", "children", "element", "reverse", "topPadding"]);
|
|
67
|
-
|
|
68
|
-
var content = children;
|
|
69
|
-
var hasBackgroundColor = backgroundColors.includes(background);
|
|
70
|
-
var hasRemovedColor = removedColors.includes(background);
|
|
71
|
-
|
|
72
|
-
if (hasBackgroundColor) {
|
|
73
|
-
content = /*#__PURE__*/React.createElement("div", {
|
|
74
|
-
className: "ffe-grid__row-wrapper"
|
|
75
|
-
}, children);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (hasRemovedColor) {
|
|
79
|
-
throw new Error("Support for the ".concat(background, " background on <GridRow> has been removed, please see the CHANGELOG"));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var Element = element || 'div';
|
|
83
|
-
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
84
|
-
className: classNames(className, 'ffe-grid__row', _defineProperty({}, "ffe-grid__row--bg-".concat(background), hasBackgroundColor), {
|
|
85
|
-
'ffe-grid__row--reverse': reverse
|
|
86
|
-
}, {
|
|
87
|
-
'ffe-grid__row--top-padding': topPadding
|
|
88
|
-
})
|
|
89
|
-
}, rest), content);
|
|
90
|
-
}
|
|
91
|
-
}]);
|
|
92
|
-
|
|
93
|
-
return GridRow;
|
|
94
|
-
}(Component);
|
|
34
|
+
if (hasRemovedColor) {
|
|
35
|
+
throw new Error("Support for the ".concat(background, " background on <GridRow> has been removed, please see the CHANGELOG"));
|
|
36
|
+
}
|
|
95
37
|
|
|
96
|
-
|
|
38
|
+
var Element = element || 'div';
|
|
39
|
+
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
40
|
+
className: classNames(className, 'ffe-grid__row', _defineProperty({}, "ffe-grid__row--bg-".concat(background), hasBackgroundColor), {
|
|
41
|
+
'ffe-grid__row--reverse': reverse
|
|
42
|
+
}, {
|
|
43
|
+
'ffe-grid__row--top-padding': topPadding
|
|
44
|
+
})
|
|
45
|
+
}, rest), content);
|
|
46
|
+
}
|
|
97
47
|
GridRow.defaultProps = {
|
|
98
48
|
topPadding: false
|
|
99
49
|
};
|
|
100
50
|
GridRow.propTypes = {
|
|
101
51
|
/** Supported background colors */
|
|
102
|
-
background: oneOf(['
|
|
52
|
+
background: oneOf(['frost-30', 'sand', 'sand-70', 'sand-30', 'syrin-70', 'syrin-30', 'vann', 'vann-30', 'fjell', 'hvit']),
|
|
103
53
|
|
|
104
54
|
/** Any extra classes are attached to the root node, in addition to ffe-grid__row classes */
|
|
105
55
|
className: string,
|
package/es/InlineGrid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["className", "element"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -6,69 +6,18 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
6
6
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
|
-
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
-
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
|
|
19
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
-
|
|
21
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22
|
-
|
|
23
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
-
|
|
25
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
-
|
|
27
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
-
|
|
29
|
-
import React, { Component } from 'react';
|
|
9
|
+
import React from 'react';
|
|
30
10
|
import classNames from 'classnames';
|
|
31
11
|
import { node, string } from 'prop-types';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_classCallCheck(this, InlineGrid);
|
|
42
|
-
|
|
43
|
-
return _super.apply(this, arguments);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
_createClass(InlineGrid, [{
|
|
47
|
-
key: "componentDidMount",
|
|
48
|
-
value: function componentDidMount() {
|
|
49
|
-
/* istanbul ignore else: there is no else */
|
|
50
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
51
|
-
checkForNestedComponent(this.props.children, Grid, 'InlineGrid');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "render",
|
|
56
|
-
value: function render() {
|
|
57
|
-
var _this$props = this.props,
|
|
58
|
-
className = _this$props.className,
|
|
59
|
-
Element = _this$props.element,
|
|
60
|
-
rest = _objectWithoutProperties(_this$props, ["className", "element"]);
|
|
61
|
-
|
|
62
|
-
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
63
|
-
className: classNames(className, 'ffe-grid', 'ffe-grid--inline')
|
|
64
|
-
}, rest));
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
|
|
68
|
-
return InlineGrid;
|
|
69
|
-
}(Component);
|
|
70
|
-
|
|
71
|
-
export { InlineGrid as default };
|
|
12
|
+
export default function InlineGrid(_ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
Element = _ref.element,
|
|
15
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
18
|
+
className: classNames(className, 'ffe-grid', 'ffe-grid--inline')
|
|
19
|
+
}, rest));
|
|
20
|
+
}
|
|
72
21
|
InlineGrid.propTypes = {
|
|
73
22
|
/** Any children of a InlineGrid must be a GridRow */
|
|
74
23
|
children: node,
|
package/es/background-colors.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default ['
|
|
2
|
-
export var removedColors = ['blue-cobalt', 'blue-royal', 'purple-magenta'];
|
|
1
|
+
export default ['frost-30', 'sand', 'sand-70', 'sand-30', 'syrin-70', 'syrin-30', 'vann', 'vann-30', 'fjell', 'hvit'];
|
|
2
|
+
export var removedColors = ['blue-cobalt', 'blue-royal', 'purple-magenta', 'blue-ice', 'blue-pale', 'green-mint', 'grey-cloud', 'grey-warm', 'orange-salmon', 'red', 'blue-sky', 'white'];
|
package/lib/Grid.js
CHANGED
|
@@ -1,97 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.default =
|
|
6
|
+
exports.default = Grid;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
11
|
|
|
14
12
|
var _propTypes = require("prop-types");
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _excluded = ["children", "className", "condensed", "element", "topPadding"];
|
|
17
15
|
|
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
17
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
19
|
|
|
26
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
21
|
|
|
28
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
23
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
function Grid(_ref) {
|
|
25
|
+
var children = _ref.children,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
condensed = _ref.condensed,
|
|
28
|
+
element = _ref.element,
|
|
29
|
+
topPadding = _ref.topPadding,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var Element = element || 'div';
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(Element, _extends({
|
|
34
|
+
className: (0, _classnames.default)(className, 'ffe-grid', {
|
|
35
|
+
'ffe-grid--condensed': condensed
|
|
36
|
+
}, {
|
|
37
|
+
'ffe-grid--no-top-padding': !topPadding
|
|
38
|
+
})
|
|
39
|
+
}, rest), children);
|
|
40
|
+
}
|
|
45
41
|
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
-
|
|
48
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
-
|
|
50
|
-
var Grid = /*#__PURE__*/function (_Component) {
|
|
51
|
-
_inherits(Grid, _Component);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(Grid);
|
|
54
|
-
|
|
55
|
-
function Grid() {
|
|
56
|
-
_classCallCheck(this, Grid);
|
|
57
|
-
|
|
58
|
-
return _super.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
_createClass(Grid, [{
|
|
62
|
-
key: "componentDidMount",
|
|
63
|
-
value: function componentDidMount() {
|
|
64
|
-
/* istanbul ignore else: there is no else */
|
|
65
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
-
(0, _utils.checkForNestedComponent)(this.props.children, Grid);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
key: "render",
|
|
71
|
-
value: function render() {
|
|
72
|
-
var _this$props = this.props,
|
|
73
|
-
children = _this$props.children,
|
|
74
|
-
className = _this$props.className,
|
|
75
|
-
condensed = _this$props.condensed,
|
|
76
|
-
element = _this$props.element,
|
|
77
|
-
topPadding = _this$props.topPadding,
|
|
78
|
-
rest = _objectWithoutProperties(_this$props, ["children", "className", "condensed", "element", "topPadding"]);
|
|
79
|
-
|
|
80
|
-
var Element = element || 'div';
|
|
81
|
-
return /*#__PURE__*/_react.default.createElement(Element, _extends({
|
|
82
|
-
className: (0, _classnames.default)(className, 'ffe-grid', {
|
|
83
|
-
'ffe-grid--condensed': condensed
|
|
84
|
-
}, {
|
|
85
|
-
'ffe-grid--no-top-padding': !topPadding
|
|
86
|
-
})
|
|
87
|
-
}, rest), children);
|
|
88
|
-
}
|
|
89
|
-
}]);
|
|
90
|
-
|
|
91
|
-
return Grid;
|
|
92
|
-
}(_react.Component);
|
|
93
|
-
|
|
94
|
-
exports.default = Grid;
|
|
95
42
|
Grid.defaultProps = {
|
|
96
43
|
topPadding: true
|
|
97
44
|
};
|
package/lib/GridCol.js
CHANGED
|
@@ -13,13 +13,13 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _backgroundColors = _interopRequireWildcard(require("./background-colors"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _excluded = ["bottomPadding", "children", "className", "element", "lg", "md", "sm"];
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
24
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
25
|
|
|
@@ -39,7 +39,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
39
39
|
|
|
40
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
41
|
|
|
42
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
42
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
43
|
|
|
44
44
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
45
|
|
|
@@ -112,16 +112,6 @@ var GridCol = /*#__PURE__*/function (_Component) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
_createClass(GridCol, [{
|
|
115
|
-
key: "componentDidMount",
|
|
116
|
-
value: function componentDidMount() {
|
|
117
|
-
/* istanbul ignore else: there is no else */
|
|
118
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
119
|
-
(0, _utils.checkForDeprecatedModifiers)(this.props);
|
|
120
|
-
(0, _utils.checkForNestedComponent)(this.props.children, GridCol);
|
|
121
|
-
(0, _utils.checkValidColumnCount)(this.props, this.ref.current);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
115
|
key: "render",
|
|
126
116
|
value: function render() {
|
|
127
117
|
var _this$props = this.props,
|
|
@@ -132,7 +122,7 @@ var GridCol = /*#__PURE__*/function (_Component) {
|
|
|
132
122
|
lg = _this$props.lg,
|
|
133
123
|
md = _this$props.md,
|
|
134
124
|
sm = _this$props.sm,
|
|
135
|
-
rest = _objectWithoutProperties(_this$props,
|
|
125
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
136
126
|
|
|
137
127
|
Object.keys(rest).forEach(function (key) {
|
|
138
128
|
if (MODIFIER_LIST.includes(key)) {
|
|
@@ -159,7 +149,7 @@ GridCol.defaultProps = {
|
|
|
159
149
|
};
|
|
160
150
|
GridCol.propTypes = {
|
|
161
151
|
/** Supported background colors */
|
|
162
|
-
background: (0, _propTypes.oneOf)(['
|
|
152
|
+
background: (0, _propTypes.oneOf)(['frost-30', 'sand', 'sand-70', 'sand-30', 'syrin-70', 'syrin-30', 'vann', 'vann-30', 'fjell', 'hvit']),
|
|
163
153
|
|
|
164
154
|
/** Any extra classes are attached to the root node, in addition to ffe-grid__col classes */
|
|
165
155
|
className: _propTypes.string,
|