@sb1/ffe-core-react 4.2.4 → 4.2.8

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.
@@ -1,3 +1,5 @@
1
+ var _excluded = ["className"];
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; }
@@ -9,7 +11,7 @@ import { string } from 'prop-types';
9
11
  import classNames from 'classnames';
10
12
  export default function DividerLine(props) {
11
13
  var className = props.className,
12
- rest = _objectWithoutProperties(props, ["className"]);
14
+ rest = _objectWithoutProperties(props, _excluded);
13
15
 
14
16
  return /*#__PURE__*/React.createElement("hr", _extends({
15
17
  className: classNames('ffe-divider-line', className),
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className"];
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; }
@@ -10,7 +12,7 @@ import classNames from 'classnames';
10
12
  export default function EmphasizedText(props) {
11
13
  var children = props.children,
12
14
  className = props.className,
13
- rest = _objectWithoutProperties(props, ["children", "className"]);
15
+ rest = _objectWithoutProperties(props, _excluded);
14
16
 
15
17
  return /*#__PURE__*/React.createElement("em", _extends({
16
18
  className: classNames('ffe-em-text', className)
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className", "error", "inline", "noMargin", "withBorder", "lookLike", "textCenter"];
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -20,7 +22,7 @@ var makeHeading = function makeHeading(level) {
20
22
  withBorder = props.withBorder,
21
23
  lookLike = props.lookLike,
22
24
  textCenter = props.textCenter,
23
- rest = _objectWithoutProperties(props, ["children", "className", "error", "inline", "noMargin", "withBorder", "lookLike", "textCenter"]);
25
+ rest = _objectWithoutProperties(props, _excluded);
24
26
 
25
27
  var H = "h".concat(level);
26
28
  var headingClass = "ffe-h".concat(lookLike ? lookLike : level);
@@ -1,3 +1,5 @@
1
+ var _excluded = ["className", "element", "underline"];
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; }
@@ -12,7 +14,7 @@ var LinkText = function LinkText(props) {
12
14
  var className = props.className,
13
15
  Element = props.element,
14
16
  underline = props.underline,
15
- rest = _objectWithoutProperties(props, ["className", "element", "underline"]);
17
+ rest = _objectWithoutProperties(props, _excluded);
16
18
 
17
19
  return /*#__PURE__*/React.createElement(Element, _extends({
18
20
  className: classNames('ffe-link-text', {
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className"];
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; }
@@ -10,7 +12,7 @@ import classNames from 'classnames';
10
12
  export default function MicroText(props) {
11
13
  var children = props.children,
12
14
  className = props.className,
13
- rest = _objectWithoutProperties(props, ["children", "className"]);
15
+ rest = _objectWithoutProperties(props, _excluded);
14
16
 
15
17
  return /*#__PURE__*/React.createElement("span", _extends({
16
18
  className: classNames('ffe-micro-text', className)
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className", "lead", "subLead", "textCenter", "textLeft"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -8,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
10
 
9
11
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
12
 
11
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
13
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
14
 
13
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
16
 
@@ -26,7 +28,7 @@ export default function Paragraph(props) {
26
28
  subLead = props.subLead,
27
29
  textCenter = props.textCenter,
28
30
  textLeft = props.textLeft,
29
- rest = _objectWithoutProperties(props, ["children", "className", "lead", "subLead", "textCenter", "textLeft"]);
31
+ rest = _objectWithoutProperties(props, _excluded);
30
32
 
31
33
  var _filter = [lead && 'ffe-lead-paragraph', subLead && 'ffe-sub-lead-paragraph', 'ffe-body-paragraph'].filter(Boolean),
32
34
  _filter2 = _slicedToArray(_filter, 1),
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className"];
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; }
@@ -10,7 +12,7 @@ import classNames from 'classnames';
10
12
  export default function PreformattedText(props) {
11
13
  var children = props.children,
12
14
  className = props.className,
13
- rest = _objectWithoutProperties(props, ["children", "className"]);
15
+ rest = _objectWithoutProperties(props, _excluded);
14
16
 
15
17
  return /*#__PURE__*/React.createElement("pre", _extends({
16
18
  className: classNames('ffe-pre-text', className)
@@ -1,3 +1,5 @@
1
+ var _excluded = ["className", "element"];
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; }
@@ -11,7 +13,7 @@ import classNames from 'classnames';
11
13
  var SmallText = function SmallText(_ref) {
12
14
  var className = _ref.className,
13
15
  Element = _ref.element,
14
- rest = _objectWithoutProperties(_ref, ["className", "element"]);
16
+ rest = _objectWithoutProperties(_ref, _excluded);
15
17
 
16
18
  return /*#__PURE__*/React.createElement(Element, _extends({
17
19
  className: classNames('ffe-small-text', className)
@@ -1,3 +1,5 @@
1
+ var _excluded = ["children", "className"];
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; }
@@ -10,7 +12,7 @@ import classNames from 'classnames';
10
12
  export default function StrongText(props) {
11
13
  var children = props.children,
12
14
  className = props.className,
13
- rest = _objectWithoutProperties(props, ["children", "className"]);
15
+ rest = _objectWithoutProperties(props, _excluded);
14
16
 
15
17
  return /*#__PURE__*/React.createElement("strong", _extends({
16
18
  className: classNames('ffe-strong-text', className)
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["className"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -21,7 +23,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
21
23
 
22
24
  function DividerLine(props) {
23
25
  var className = props.className,
24
- rest = _objectWithoutProperties(props, ["className"]);
26
+ rest = _objectWithoutProperties(props, _excluded);
25
27
 
26
28
  return /*#__PURE__*/_react.default.createElement("hr", _extends({
27
29
  className: (0, _classnames.default)('ffe-divider-line', className),
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["children", "className"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -22,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  function EmphasizedText(props) {
23
25
  var children = props.children,
24
26
  className = props.className,
25
- rest = _objectWithoutProperties(props, ["children", "className"]);
27
+ rest = _objectWithoutProperties(props, _excluded);
26
28
 
27
29
  return /*#__PURE__*/_react.default.createElement("em", _extends({
28
30
  className: (0, _classnames.default)('ffe-em-text', className)
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _propTypes = require("prop-types");
13
13
 
14
+ var _excluded = ["children", "className", "error", "inline", "noMargin", "withBorder", "lookLike", "textCenter"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -31,7 +33,7 @@ var makeHeading = function makeHeading(level) {
31
33
  withBorder = props.withBorder,
32
34
  lookLike = props.lookLike,
33
35
  textCenter = props.textCenter,
34
- rest = _objectWithoutProperties(props, ["children", "className", "error", "inline", "noMargin", "withBorder", "lookLike", "textCenter"]);
36
+ rest = _objectWithoutProperties(props, _excluded);
35
37
 
36
38
  var H = "h".concat(level);
37
39
  var headingClass = "ffe-h".concat(lookLike ? lookLike : level);
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["className", "element", "underline"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -23,7 +25,7 @@ var LinkText = function LinkText(props) {
23
25
  var className = props.className,
24
26
  Element = props.element,
25
27
  underline = props.underline,
26
- rest = _objectWithoutProperties(props, ["className", "element", "underline"]);
28
+ rest = _objectWithoutProperties(props, _excluded);
27
29
 
28
30
  return /*#__PURE__*/_react.default.createElement(Element, _extends({
29
31
  className: (0, _classnames.default)('ffe-link-text', {
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["children", "className"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -22,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  function MicroText(props) {
23
25
  var children = props.children,
24
26
  className = props.className,
25
- rest = _objectWithoutProperties(props, ["children", "className"]);
27
+ rest = _objectWithoutProperties(props, _excluded);
26
28
 
27
29
  return /*#__PURE__*/_react.default.createElement("span", _extends({
28
30
  className: (0, _classnames.default)('ffe-micro-text', className)
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["children", "className", "lead", "subLead", "textCenter", "textLeft"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -23,7 +25,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
23
25
 
24
26
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
27
 
26
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
28
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
27
29
 
28
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
31
 
@@ -38,7 +40,7 @@ function Paragraph(props) {
38
40
  subLead = props.subLead,
39
41
  textCenter = props.textCenter,
40
42
  textLeft = props.textLeft,
41
- rest = _objectWithoutProperties(props, ["children", "className", "lead", "subLead", "textCenter", "textLeft"]);
43
+ rest = _objectWithoutProperties(props, _excluded);
42
44
 
43
45
  var _filter = [lead && 'ffe-lead-paragraph', subLead && 'ffe-sub-lead-paragraph', 'ffe-body-paragraph'].filter(Boolean),
44
46
  _filter2 = _slicedToArray(_filter, 1),
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["children", "className"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -22,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  function PreformattedText(props) {
23
25
  var children = props.children,
24
26
  className = props.className,
25
- rest = _objectWithoutProperties(props, ["children", "className"]);
27
+ rest = _objectWithoutProperties(props, _excluded);
26
28
 
27
29
  return /*#__PURE__*/_react.default.createElement("pre", _extends({
28
30
  className: (0, _classnames.default)('ffe-pre-text', className)
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["className", "element"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -22,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  var SmallText = function SmallText(_ref) {
23
25
  var className = _ref.className,
24
26
  Element = _ref.element,
25
- rest = _objectWithoutProperties(_ref, ["className", "element"]);
27
+ rest = _objectWithoutProperties(_ref, _excluded);
26
28
 
27
29
  return /*#__PURE__*/_react.default.createElement(Element, _extends({
28
30
  className: (0, _classnames.default)('ffe-small-text', className)
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["children", "className"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
@@ -22,7 +24,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  function StrongText(props) {
23
25
  var children = props.children,
24
26
  className = props.className,
25
- rest = _objectWithoutProperties(props, ["children", "className"]);
27
+ rest = _objectWithoutProperties(props, _excluded);
26
28
 
27
29
  return /*#__PURE__*/_react.default.createElement("strong", _extends({
28
30
  className: (0, _classnames.default)('ffe-strong-text', className)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-core-react",
3
- "version": "4.2.4",
3
+ "version": "4.2.8",
4
4
  "description": "React components for ffe-core components",
5
5
  "keywords": [
6
6
  "ffe"
@@ -21,11 +21,9 @@
21
21
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
22
22
  },
23
23
  "scripts": {
24
- "build": "npm run build:cjs && npm run build:es && npm run build:types",
25
- "build:cjs": "babel -d lib/. --root-mode=upward --env-name=cjs --ignore=*.spec.js src/.",
26
- "build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
27
- "build:types": "copyfiles -f src/index.d.ts types/",
28
- "lint": "eslint src/.",
24
+ "build": "ffe-buildtool babel",
25
+ "watch": "ffe-buildtool babel-watch",
26
+ "lint": "eslint src",
29
27
  "test": "jest",
30
28
  "test:watch": "jest --watch"
31
29
  },
@@ -33,10 +31,11 @@
33
31
  "setupTestFrameworkScriptFile": "../../test-setup.js"
34
32
  },
35
33
  "dependencies": {
36
- "classnames": "^2.2.5",
37
- "prop-types": "^15.7.0"
34
+ "classnames": "^2.3.1",
35
+ "prop-types": "^15.7.2"
38
36
  },
39
37
  "devDependencies": {
38
+ "@sb1/ffe-buildtool": "^0.3.0",
40
39
  "enzyme": "^3.7.0",
41
40
  "enzyme-adapter-react-16": "^1.7.0",
42
41
  "eslint": "^5.9.0",
@@ -46,11 +45,11 @@
46
45
  "react-test-renderer": "^16.2.0"
47
46
  },
48
47
  "peerDependencies": {
49
- "@sb1/ffe-core": "^15.2.0",
50
- "react": "^16.9.0"
48
+ "@sb1/ffe-core": "*",
49
+ "react": ">=16.9.0"
51
50
  },
52
51
  "publishConfig": {
53
52
  "access": "public"
54
53
  },
55
- "gitHead": "67a0e2fa940c378759f0d706e0b62aa0efea4587"
54
+ "gitHead": "1960685a8b6055efc0653aa1643138cf4a7054fc"
56
55
  }
package/CHANGELOG.md DELETED
@@ -1,360 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [4.2.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.2.3...@sb1/ffe-core-react@4.2.4) (2021-02-03)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * packages/ffe-core-react/package.json to reduce vulnerabilities ([94d6ae8](https://github.com/SpareBank1/designsystem/commit/94d6ae8a259fd148247fac23687c65510b2bfdb4))
12
-
13
-
14
-
15
-
16
-
17
- ## [4.2.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.2.2...@sb1/ffe-core-react@4.2.3) (2021-02-02)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * **ffe-core-react:** reduce vulnerabilities ([add5cba](https://github.com/SpareBank1/designsystem/commit/add5cbaabf058aea4faa0f54f0654d2a3bae5a5e))
23
-
24
-
25
-
26
-
27
-
28
- ## [4.2.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.2.1...@sb1/ffe-core-react@4.2.2) (2019-10-16)
29
-
30
- **Note:** Version bump only for package @sb1/ffe-core-react
31
-
32
- ## [4.2.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.2.0...@sb1/ffe-core-react@4.2.1) (2019-10-16)
33
-
34
- ### Bug Fixes
35
-
36
- - **ffe-core-react:** added prop-types for Heading ([f884467](https://github.com/SpareBank1/designsystem/commit/f8844673a842af78896e0f768a3fbd546482bd14))
37
-
38
- # [4.2.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.1.3...@sb1/ffe-core-react@4.2.0) (2019-10-14)
39
-
40
- ### Features
41
-
42
- - **ffe-core-react:** center leading paragraph ([c12806b](https://github.com/SpareBank1/designsystem/commit/c12806b3b6602c024ea09569856e6b69f17cd755))
43
- - **ffe-core-react:** possible to center heading ([4a563b1](https://github.com/SpareBank1/designsystem/commit/4a563b1186c95468865c9ed82f5429c89fda05c7))
44
-
45
- ## [4.1.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.1.2...@sb1/ffe-core-react@4.1.3) (2019-10-09)
46
-
47
- ### Bug Fixes
48
-
49
- - **ffe-core-react:** bump prop-types ([7f88f98](https://github.com/SpareBank1/designsystem/commit/7f88f98a524328efc72d62dee335cd10687aa53f))
50
- - **ffe-core-react:** element-type for type script ([f041763](https://github.com/SpareBank1/designsystem/commit/f04176300b4ef9e361d5a833cdc882190a9bf3a8))
51
-
52
- ## [4.1.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.1.1...@sb1/ffe-core-react@4.1.2) (2019-10-03)
53
-
54
- ### Bug Fixes
55
-
56
- - **ffe-core-react:** element prop-type needs elementType ([95d0ce1](https://github.com/SpareBank1/designsystem/commit/95d0ce1))
57
-
58
- ## [4.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.1.0...@sb1/ffe-core-react@4.1.1) (2019-09-16)
59
-
60
- **Note:** Version bump only for package @sb1/ffe-core-react
61
-
62
- # [4.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.0.0...@sb1/ffe-core-react@4.1.0) (2019-09-10)
63
-
64
- ### Features
65
-
66
- - **ffe-core-react:** custom element for SmallText ([6240db0](https://github.com/SpareBank1/designsystem/commit/6240db0))
67
-
68
- # [4.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.3.0...@sb1/ffe-core-react@4.0.0) (2019-08-27)
69
-
70
- ### chore
71
-
72
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
73
-
74
- ### BREAKING CHANGES
75
-
76
- - peerDep of React is raised to 16.9. While this in itself
77
- isn't a breaking change, it allows for the use of hooks in later releases.
78
- Such changes would just be a minor version, or even a patch, but without
79
- this major version bump it would result in a runtime error for consumers.
80
-
81
- # [3.3.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.6...@sb1/ffe-core-react@3.3.0) (2019-05-10)
82
-
83
- ### Features
84
-
85
- - **ffe-core-react:** Added type definitions for typescript ([630b457](https://github.com/SpareBank1/designsystem/commit/630b457))
86
-
87
- ## [3.2.6](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.5...@sb1/ffe-core-react@3.2.6) (2018-12-11)
88
-
89
- ### Bug Fixes
90
-
91
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
92
-
93
- ## [3.2.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.4...@sb1/ffe-core-react@3.2.5) (2018-12-04)
94
-
95
- **Note:** Version bump only for package @sb1/ffe-core-react
96
-
97
- ## [3.2.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.3...@sb1/ffe-core-react@3.2.4) (2018-11-26)
98
-
99
- **Note:** Version bump only for package @sb1/ffe-core-react
100
-
101
- ## [3.2.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.2...@sb1/ffe-core-react@3.2.3) (2018-11-08)
102
-
103
- **Note:** Version bump only for package @sb1/ffe-core-react
104
-
105
- <a name="3.2.2"></a>
106
-
107
- ## [3.2.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.1...@sb1/ffe-core-react@3.2.2) (2018-08-09)
108
-
109
- **Note:** Version bump only for package @sb1/ffe-core-react
110
-
111
- <a name="3.2.1"></a>
112
-
113
- ## [3.2.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.2.0...@sb1/ffe-core-react@3.2.1) (2018-06-20)
114
-
115
- ### Bug Fixes
116
-
117
- - **ffe-core-react:** added peerDependency to ffe-core@^13.0.0 ([d1a6451](https://github.com/SpareBank1/designsystem/commit/d1a6451))
118
-
119
- <a name="3.2.0"></a>
120
-
121
- # [3.2.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.1.0...@sb1/ffe-core-react@3.2.0) (2018-06-19)
122
-
123
- ### Features
124
-
125
- - **ffe-core-react:** Add `LinkText` component ([b51ed59](https://github.com/SpareBank1/designsystem/commit/b51ed59))
126
-
127
- <a name="3.1.0"></a>
128
-
129
- # [3.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@3.0.0...@sb1/ffe-core-react@3.1.0) (2018-05-23)
130
-
131
- ### Features
132
-
133
- - **ffe-core-react:** Expose named exports ([4efe35a](https://github.com/SpareBank1/designsystem/commit/4efe35a))
134
-
135
- <a name="3.0.0"></a>
136
-
137
- # [3.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@2.0.3...@sb1/ffe-core-react@3.0.0) (2018-04-10)
138
-
139
- ### Chores
140
-
141
- - **ffe-core-react:** Remove deprecated layout ([60e8863](https://github.com/SpareBank1/designsystem/commit/60e8863))
142
-
143
- ### BREAKING CHANGES
144
-
145
- - **ffe-core-react:** Removed the React components for the deprecated
146
- Hawaii layout system. Please don't use this layout when developing
147
- new functionality and please consider moving away from it when
148
- visiting old functionality.
149
-
150
- New layouts should be based on the `ffe-grid` component.
151
-
152
- <a name="2.0.3"></a>
153
-
154
- ## [2.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@2.0.2...@sb1/ffe-core-react@2.0.3) (2018-03-27)
155
-
156
- **Note:** Version bump only for package @sb1/ffe-core-react
157
-
158
- <a name="2.0.2"></a>
159
-
160
- ## [2.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@2.0.0...@sb1/ffe-core-react@2.0.2) (2018-03-07)
161
-
162
- ### Bug Fixes
163
-
164
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
165
-
166
- <a name="2.0.1"></a>
167
-
168
- ## [2.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@2.0.0...@sb1/ffe-core-react@2.0.1) (2018-03-02)
169
-
170
- ### Bug Fixes
171
-
172
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
173
-
174
- <a name="2.0.0"></a>
175
-
176
- # 2.0.0 (2018-02-25)
177
-
178
- ### Bug Fixes
179
-
180
- - Fix a few issues with the documentation ([ab3d579](https://github.com/SpareBank1/designsystem/commit/ab3d579))
181
- - Run just 'jest', not 'jest src' ([6377dc5](https://github.com/SpareBank1/designsystem/commit/6377dc5))
182
- - **ffe-core-react:** Relax peerDeps to allow React 15. ([78eb5b4](https://github.com/SpareBank1/designsystem/commit/78eb5b4))
183
-
184
- ### Chores
185
-
186
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
187
-
188
- ### Features
189
-
190
- - **ffe-core-react:** Add contribute.md link to readme ([1a8aab0](https://github.com/SpareBank1/designsystem/commit/1a8aab0))
191
- - **ffe-core-react:** Add new inline prop ([148bdcb](https://github.com/SpareBank1/designsystem/commit/148bdcb))
192
- - **ffe-core-react:** Upgrade to React 16 ([ef3a686](https://github.com/SpareBank1/designsystem/commit/ef3a686))
193
-
194
- ### BREAKING CHANGES
195
-
196
- - All packages have been renamed to add the @sb1 scope.
197
-
198
- See links [1] and [2] to read more about package scopes.
199
-
200
- Unfortunately this requires you update both your dependencies in
201
- `package.json` and all `import` or `require` statements in your code.
202
- Also, you unfortunately have to upgrade all FFE packages at once due to
203
- dependency between packages. If you are on the latest version prior to
204
- this breaking change the upgrade should be a matter of updating
205
- `package.json` with new package names and versions, and updating your
206
- imports.
207
-
208
- To help find the proper package versions you can either browse to the
209
- packages you need or check out the list of Git tags either on
210
- Github [3] or by cloning the repository and running the `git tag`
211
- command. All package versions get a tag in the format
212
- _package@version_.
213
-
214
- Update your `package.json` with the latest package version and add the
215
- @sb1 scope to the package name:
216
-
217
- ```diff
218
- - "ffe-core": "11.0.2",
219
- + "@sb1/ffe-core": "11.0.2",
220
- ```
221
-
222
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
223
- case packages will be put in the `node_modules/@sb1/` directory. If your
224
- build depends on file paths (for instance for copying fonts) you need to
225
- update that path to include the scope.
226
-
227
- The directory structure also means you have to update your imports, both
228
- in Less and in JavaScript.
229
-
230
- Using `less-plugin-npm-import`:
231
-
232
- ```diff
233
- - @import 'npm://ffe-core/less/ffe';
234
- + @import 'npm://@sb1/ffe-core/less/ffe';
235
- ```
236
-
237
- Using Webpack:
238
-
239
- ```diff
240
- - @import '~ffe-core/less/ffe';
241
- + @import '~@sb1/ffe-core/less/ffe';
242
- ```
243
-
244
- Using plain old paths:
245
-
246
- ```diff
247
- - @import '../path/to/node_modules/ffe-core/less/ffe';
248
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
249
- ```
250
-
251
- JavaScript `import`:
252
-
253
- ```diff
254
- - import { ActionButton } from 'ffe-buttons-react';
255
- + import { ActionButton } from '@sb1/ffe-buttons-react';
256
- ```
257
-
258
- JavaScript `require`:
259
-
260
- ```diff
261
- - const { ActionButton } = require('ffe-buttons-react').default;
262
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
263
- ```
264
-
265
- [1]: https://docs.npmjs.com/misc/scope
266
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
267
- [3]: https://github.com/sparebank1/designsystem/tags
268
-
269
- <a name="1.2.4"></a>
270
-
271
- ## [1.2.4](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.3...ffe-core-react@1.2.4) (2018-02-23)
272
-
273
- **Note:** Version bump only for package ffe-core-react
274
-
275
- <a name="1.2.3"></a>
276
-
277
- ## [1.2.3](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.2...ffe-core-react@1.2.3) (2018-02-22)
278
-
279
- **Note:** Version bump only for package ffe-core-react
280
-
281
- <a name="1.2.2"></a>
282
-
283
- ## [1.2.2](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.1...ffe-core-react@1.2.2) (2018-02-21)
284
-
285
- **Note:** Version bump only for package ffe-core-react
286
-
287
- <a name="1.2.1"></a>
288
-
289
- ## [1.2.1](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.0...ffe-core-react@1.2.1) (2018-01-26)
290
-
291
- ### Bug Fixes
292
-
293
- - **ffe-core-react:** Relax peerDeps to allow React 15.
294
-
295
- <a name="1.2.0"></a>
296
-
297
- # [1.2.0](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.6...ffe-core-react@1.2.0) (2018-01-19)
298
-
299
- ### Features
300
-
301
- - **ffe-core-react:** Add new inline prop
302
-
303
- <a name="1.1.6"></a>
304
-
305
- ## [1.1.6](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.5...ffe-core-react@1.1.6) (2018-01-19)
306
-
307
- **Note:** Version bump only for package ffe-core-react
308
-
309
- <a name="1.1.5"></a>
310
-
311
- ## [1.1.5](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.4...ffe-core-react@1.1.5) (2018-01-10)
312
-
313
- ### Bug Fixes
314
-
315
- - Run just 'jest', not 'jest src'
316
-
317
- <a name="1.1.4"></a>
318
-
319
- ## [1.1.4](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.3...ffe-core-react@1.1.4) (2018-01-09)
320
-
321
- **Note:** Version bump only for package ffe-core-react
322
-
323
- <a name="1.1.3"></a>
324
-
325
- ## [1.1.3](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.2...ffe-core-react@1.1.3) (2018-01-05)
326
-
327
- **Note:** Version bump only for package ffe-core-react
328
-
329
- <a name="1.1.2"></a>
330
-
331
- ## [1.1.2](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.1...ffe-core-react@1.1.2) (2018-01-04)
332
-
333
- **Note:** Version bump only for package ffe-core-react
334
-
335
- <a name="1.1.1"></a>
336
-
337
- ## [1.1.1](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.0...ffe-core-react@1.1.1) (2018-01-02)
338
-
339
- **Note:** Version bump only for package ffe-core-react
340
-
341
- <a name="1.1.0"></a>
342
-
343
- # 1.1.0 (2017-12-22)
344
-
345
- ### Bug Fixes
346
-
347
- - Fix a few issues with the documentation
348
-
349
- ### Features
350
-
351
- - **ffe-core-react:** Add contribute.md link to readme
352
- - **ffe-core-react:** Upgrade to React 16
353
-
354
- ## v.1.0.1
355
-
356
- - Fix handling of conditional classes for Heading component
357
-
358
- # v.1.0.0
359
-
360
- - First release.
@@ -1,111 +0,0 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
-
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
- 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; }
8
-
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
-
11
- import React from 'react';
12
- import { shallow } from 'enzyme';
13
- import * as Headings from './Heading';
14
- var defaultProps = {
15
- el: Headings.Heading1,
16
- children: 'Heading'
17
- };
18
-
19
- var getWrapper = function getWrapper() {
20
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
-
22
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
23
- Heading = _defaultProps$props.el,
24
- finalProps = _objectWithoutProperties(_defaultProps$props, ["el"]);
25
-
26
- return shallow( /*#__PURE__*/React.createElement(Heading, finalProps));
27
- };
28
-
29
- describe('<Heading1...6 />', function () {
30
- test('renders without exploding', function () {
31
- var wrapper = getWrapper();
32
- expect(wrapper.length).toBe(1);
33
- });
34
- test('renders the correct HTML element', function () {
35
- expect(getWrapper({
36
- el: Headings.Heading1
37
- }).find('h1').length).toBe(1);
38
- expect(getWrapper({
39
- el: Headings.Heading2
40
- }).find('h2').length).toBe(1);
41
- expect(getWrapper({
42
- el: Headings.Heading3
43
- }).find('h3').length).toBe(1);
44
- expect(getWrapper({
45
- el: Headings.Heading4
46
- }).find('h4').length).toBe(1);
47
- expect(getWrapper({
48
- el: Headings.Heading5
49
- }).find('h5').length).toBe(1);
50
- expect(getWrapper({
51
- el: Headings.Heading6
52
- }).find('h6').length).toBe(1);
53
- });
54
- test('sets the correct class as default', function () {
55
- expect(getWrapper({
56
- el: Headings.Heading1
57
- }).hasClass('ffe-h1')).toBe(true);
58
- expect(getWrapper({
59
- el: Headings.Heading2
60
- }).hasClass('ffe-h2')).toBe(true);
61
- expect(getWrapper({
62
- el: Headings.Heading3
63
- }).hasClass('ffe-h3')).toBe(true);
64
- expect(getWrapper({
65
- el: Headings.Heading4
66
- }).hasClass('ffe-h4')).toBe(true);
67
- expect(getWrapper({
68
- el: Headings.Heading5
69
- }).hasClass('ffe-h5')).toBe(true);
70
- expect(getWrapper({
71
- el: Headings.Heading6
72
- }).hasClass('ffe-h6')).toBe(true);
73
- });
74
- test('overrides the class via the lookLike prop', function () {
75
- var wrapper = getWrapper({
76
- lookLike: 3
77
- });
78
- expect(wrapper.find('h1').length).toBe(1);
79
- expect(wrapper.find('h1').hasClass('ffe-h3')).toBe(true);
80
- });
81
- test('adds --error class if error prop is true', function () {
82
- var wrapper = getWrapper({
83
- error: true
84
- });
85
- expect(wrapper.hasClass('ffe-h1--error')).toBe(true);
86
- });
87
- test('adds --inline class if inline prop is true', function () {
88
- var wrapper = getWrapper({
89
- inline: true
90
- });
91
- expect(wrapper.hasClass('ffe-h1--inline')).toBe(true);
92
- });
93
- test('adds --no-margin class if noMargin prop is true', function () {
94
- var wrapper = getWrapper({
95
- noMargin: true
96
- });
97
- expect(wrapper.hasClass('ffe-h1--no-margin')).toBe(true);
98
- });
99
- test('adds --with-border class if withBorder prop is true', function () {
100
- var wrapper = getWrapper({
101
- withBorder: true
102
- });
103
- expect(wrapper.hasClass('ffe-h1--with-border')).toBe(true);
104
- });
105
- test('does not add conditional classes if no props are given', function () {
106
- var wrapper = getWrapper();
107
- expect(wrapper.hasClass('ffe-h1--error')).toBe(false);
108
- expect(wrapper.hasClass('ffe-h1--no-margin')).toBe(false);
109
- expect(wrapper.hasClass('ffe-h1--with-border')).toBe(false);
110
- });
111
- });
@@ -1,63 +0,0 @@
1
- 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
-
3
- import React from 'react';
4
- import { shallow } from 'enzyme';
5
- import LinkText from './LinkText';
6
- var defaultProps = {
7
- children: 'avtaleteksten',
8
- href: '/avtale/abc123'
9
- };
10
-
11
- var Link = function Link(props) {
12
- return /*#__PURE__*/React.createElement("span", props);
13
- };
14
-
15
- var getWrapper = function getWrapper(props) {
16
- return shallow( /*#__PURE__*/React.createElement(LinkText, _extends({}, defaultProps, props)));
17
- };
18
-
19
- describe('<LinkText />', function () {
20
- it('renders without exploding', function () {
21
- var wrapper = getWrapper();
22
- expect(wrapper.length).toBe(1);
23
- });
24
- it('renders an anchor tag by default', function () {
25
- var wrapper = getWrapper();
26
- expect(wrapper.is('a')).toBe(true);
27
- });
28
- it('lets consumers provide an element', function () {
29
- var wrapper = getWrapper({
30
- element: Link
31
- });
32
- expect(wrapper.is('Link')).toBe(true);
33
- });
34
- it('adds ffe-link-text class', function () {
35
- var wrapper = getWrapper();
36
- expect(wrapper.hasClass('ffe-link-text')).toBe(true);
37
- });
38
- it('does not add the --no-underline modifier by default', function () {
39
- var wrapper = getWrapper();
40
- expect(wrapper.hasClass('ffe-link-text--no-underline')).toBe(false);
41
- });
42
- it('adds the --no-underline modifier if underline prop is false', function () {
43
- var wrapper = getWrapper({
44
- underline: false
45
- });
46
- expect(wrapper.hasClass('ffe-link-text--no-underline')).toBe(true);
47
- });
48
- it('adds the given className next to the ffe-link-text classes', function () {
49
- var wrapper = getWrapper({
50
- className: 'some-other-class'
51
- });
52
- expect(wrapper.hasClass('ffe-link-text')).toBe(true);
53
- expect(wrapper.hasClass('some-other-class')).toBe(true);
54
- });
55
- it('passes on unrecognized props to the anchor', function () {
56
- var wrapper = getWrapper({
57
- target: '_blank',
58
- rel: 'noopener noreferrer'
59
- });
60
- expect(wrapper.props().target).toBe('_blank');
61
- expect(wrapper.props().rel).toBe('noopener noreferrer');
62
- });
63
- });
@@ -1,48 +0,0 @@
1
- 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
-
3
- import React from 'react';
4
- import { shallow } from 'enzyme';
5
- import Paragraph from './Paragraph';
6
- var defaultProps = {
7
- children: 'Test!'
8
- };
9
-
10
- var getWrapper = function getWrapper() {
11
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12
- return shallow( /*#__PURE__*/React.createElement(Paragraph, _extends({}, defaultProps, props)));
13
- };
14
-
15
- describe('<Paragraph />', function () {
16
- test('renders without exploding', function () {
17
- var wrapper = getWrapper();
18
- expect(wrapper.length).toBe(1);
19
- });
20
- test('adds ffe-body-paragraph class if lead and subLead props are false (or not set)', function () {
21
- var wrapper = getWrapper();
22
- expect(wrapper.hasClass('ffe-body-paragraph')).toBe(true);
23
- });
24
- test('adds --text-center modifier if textCenter prop is true', function () {
25
- var wrapper = getWrapper({
26
- textCenter: true
27
- });
28
- expect(wrapper.hasClass('ffe-body-paragraph--text-center')).toBe(true);
29
- });
30
- test('adds --text-left modifier if textLeft prop is true', function () {
31
- var wrapper = getWrapper({
32
- textLeft: true
33
- });
34
- expect(wrapper.hasClass('ffe-body-paragraph--text-left')).toBe(true);
35
- });
36
- test('adds ffe-lead-paragraph class if lead prop is true', function () {
37
- var wrapper = getWrapper({
38
- lead: true
39
- });
40
- expect(wrapper.hasClass('ffe-lead-paragraph')).toBe(true);
41
- });
42
- test('adds ffe-sub-lead-paragraph class if lead prop is true', function () {
43
- var wrapper = getWrapper({
44
- subLead: true
45
- });
46
- expect(wrapper.hasClass('ffe-sub-lead-paragraph')).toBe(true);
47
- });
48
- });
@@ -1,124 +0,0 @@
1
- "use strict";
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
- var _react = _interopRequireDefault(require("react"));
6
-
7
- var _enzyme = require("enzyme");
8
-
9
- var Headings = _interopRequireWildcard(require("./Heading"));
10
-
11
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
12
-
13
- 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; }
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
18
-
19
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
-
21
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
-
23
- 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; }
24
-
25
- 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; }
26
-
27
- var defaultProps = {
28
- el: Headings.Heading1,
29
- children: 'Heading'
30
- };
31
-
32
- var getWrapper = function getWrapper() {
33
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34
-
35
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
36
- Heading = _defaultProps$props.el,
37
- finalProps = _objectWithoutProperties(_defaultProps$props, ["el"]);
38
-
39
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(Heading, finalProps));
40
- };
41
-
42
- describe('<Heading1...6 />', function () {
43
- test('renders without exploding', function () {
44
- var wrapper = getWrapper();
45
- expect(wrapper.length).toBe(1);
46
- });
47
- test('renders the correct HTML element', function () {
48
- expect(getWrapper({
49
- el: Headings.Heading1
50
- }).find('h1').length).toBe(1);
51
- expect(getWrapper({
52
- el: Headings.Heading2
53
- }).find('h2').length).toBe(1);
54
- expect(getWrapper({
55
- el: Headings.Heading3
56
- }).find('h3').length).toBe(1);
57
- expect(getWrapper({
58
- el: Headings.Heading4
59
- }).find('h4').length).toBe(1);
60
- expect(getWrapper({
61
- el: Headings.Heading5
62
- }).find('h5').length).toBe(1);
63
- expect(getWrapper({
64
- el: Headings.Heading6
65
- }).find('h6').length).toBe(1);
66
- });
67
- test('sets the correct class as default', function () {
68
- expect(getWrapper({
69
- el: Headings.Heading1
70
- }).hasClass('ffe-h1')).toBe(true);
71
- expect(getWrapper({
72
- el: Headings.Heading2
73
- }).hasClass('ffe-h2')).toBe(true);
74
- expect(getWrapper({
75
- el: Headings.Heading3
76
- }).hasClass('ffe-h3')).toBe(true);
77
- expect(getWrapper({
78
- el: Headings.Heading4
79
- }).hasClass('ffe-h4')).toBe(true);
80
- expect(getWrapper({
81
- el: Headings.Heading5
82
- }).hasClass('ffe-h5')).toBe(true);
83
- expect(getWrapper({
84
- el: Headings.Heading6
85
- }).hasClass('ffe-h6')).toBe(true);
86
- });
87
- test('overrides the class via the lookLike prop', function () {
88
- var wrapper = getWrapper({
89
- lookLike: 3
90
- });
91
- expect(wrapper.find('h1').length).toBe(1);
92
- expect(wrapper.find('h1').hasClass('ffe-h3')).toBe(true);
93
- });
94
- test('adds --error class if error prop is true', function () {
95
- var wrapper = getWrapper({
96
- error: true
97
- });
98
- expect(wrapper.hasClass('ffe-h1--error')).toBe(true);
99
- });
100
- test('adds --inline class if inline prop is true', function () {
101
- var wrapper = getWrapper({
102
- inline: true
103
- });
104
- expect(wrapper.hasClass('ffe-h1--inline')).toBe(true);
105
- });
106
- test('adds --no-margin class if noMargin prop is true', function () {
107
- var wrapper = getWrapper({
108
- noMargin: true
109
- });
110
- expect(wrapper.hasClass('ffe-h1--no-margin')).toBe(true);
111
- });
112
- test('adds --with-border class if withBorder prop is true', function () {
113
- var wrapper = getWrapper({
114
- withBorder: true
115
- });
116
- expect(wrapper.hasClass('ffe-h1--with-border')).toBe(true);
117
- });
118
- test('does not add conditional classes if no props are given', function () {
119
- var wrapper = getWrapper();
120
- expect(wrapper.hasClass('ffe-h1--error')).toBe(false);
121
- expect(wrapper.hasClass('ffe-h1--no-margin')).toBe(false);
122
- expect(wrapper.hasClass('ffe-h1--with-border')).toBe(false);
123
- });
124
- });
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _LinkText = _interopRequireDefault(require("./LinkText"));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- 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); }
12
-
13
- var defaultProps = {
14
- children: 'avtaleteksten',
15
- href: '/avtale/abc123'
16
- };
17
-
18
- var Link = function Link(props) {
19
- return /*#__PURE__*/_react.default.createElement("span", props);
20
- };
21
-
22
- var getWrapper = function getWrapper(props) {
23
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_LinkText.default, _extends({}, defaultProps, props)));
24
- };
25
-
26
- describe('<LinkText />', function () {
27
- it('renders without exploding', function () {
28
- var wrapper = getWrapper();
29
- expect(wrapper.length).toBe(1);
30
- });
31
- it('renders an anchor tag by default', function () {
32
- var wrapper = getWrapper();
33
- expect(wrapper.is('a')).toBe(true);
34
- });
35
- it('lets consumers provide an element', function () {
36
- var wrapper = getWrapper({
37
- element: Link
38
- });
39
- expect(wrapper.is('Link')).toBe(true);
40
- });
41
- it('adds ffe-link-text class', function () {
42
- var wrapper = getWrapper();
43
- expect(wrapper.hasClass('ffe-link-text')).toBe(true);
44
- });
45
- it('does not add the --no-underline modifier by default', function () {
46
- var wrapper = getWrapper();
47
- expect(wrapper.hasClass('ffe-link-text--no-underline')).toBe(false);
48
- });
49
- it('adds the --no-underline modifier if underline prop is false', function () {
50
- var wrapper = getWrapper({
51
- underline: false
52
- });
53
- expect(wrapper.hasClass('ffe-link-text--no-underline')).toBe(true);
54
- });
55
- it('adds the given className next to the ffe-link-text classes', function () {
56
- var wrapper = getWrapper({
57
- className: 'some-other-class'
58
- });
59
- expect(wrapper.hasClass('ffe-link-text')).toBe(true);
60
- expect(wrapper.hasClass('some-other-class')).toBe(true);
61
- });
62
- it('passes on unrecognized props to the anchor', function () {
63
- var wrapper = getWrapper({
64
- target: '_blank',
65
- rel: 'noopener noreferrer'
66
- });
67
- expect(wrapper.props().target).toBe('_blank');
68
- expect(wrapper.props().rel).toBe('noopener noreferrer');
69
- });
70
- });
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _Paragraph = _interopRequireDefault(require("./Paragraph"));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- 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); }
12
-
13
- var defaultProps = {
14
- children: 'Test!'
15
- };
16
-
17
- var getWrapper = function getWrapper() {
18
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
19
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_Paragraph.default, _extends({}, defaultProps, props)));
20
- };
21
-
22
- describe('<Paragraph />', function () {
23
- test('renders without exploding', function () {
24
- var wrapper = getWrapper();
25
- expect(wrapper.length).toBe(1);
26
- });
27
- test('adds ffe-body-paragraph class if lead and subLead props are false (or not set)', function () {
28
- var wrapper = getWrapper();
29
- expect(wrapper.hasClass('ffe-body-paragraph')).toBe(true);
30
- });
31
- test('adds --text-center modifier if textCenter prop is true', function () {
32
- var wrapper = getWrapper({
33
- textCenter: true
34
- });
35
- expect(wrapper.hasClass('ffe-body-paragraph--text-center')).toBe(true);
36
- });
37
- test('adds --text-left modifier if textLeft prop is true', function () {
38
- var wrapper = getWrapper({
39
- textLeft: true
40
- });
41
- expect(wrapper.hasClass('ffe-body-paragraph--text-left')).toBe(true);
42
- });
43
- test('adds ffe-lead-paragraph class if lead prop is true', function () {
44
- var wrapper = getWrapper({
45
- lead: true
46
- });
47
- expect(wrapper.hasClass('ffe-lead-paragraph')).toBe(true);
48
- });
49
- test('adds ffe-sub-lead-paragraph class if lead prop is true', function () {
50
- var wrapper = getWrapper({
51
- subLead: true
52
- });
53
- expect(wrapper.hasClass('ffe-sub-lead-paragraph')).toBe(true);
54
- });
55
- });