@sb1/ffe-core-react 4.2.3 → 4.2.7

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.3",
3
+ "version": "4.2.7",
4
4
  "description": "React components for ffe-core components",
5
5
  "keywords": [
6
6
  "ffe"
@@ -21,11 +21,8 @@
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
+ "lint": "eslint src",
29
26
  "test": "jest",
30
27
  "test:watch": "jest --watch"
31
28
  },
@@ -33,24 +30,25 @@
33
30
  "setupTestFrameworkScriptFile": "../../test-setup.js"
34
31
  },
35
32
  "dependencies": {
36
- "classnames": "^2.2.5",
37
- "prop-types": "^15.7.0"
33
+ "classnames": "^2.3.1",
34
+ "prop-types": "^15.7.2"
38
35
  },
39
36
  "devDependencies": {
37
+ "@sb1/ffe-buildtool": "^0.2.0",
40
38
  "enzyme": "^3.7.0",
41
39
  "enzyme-adapter-react-16": "^1.7.0",
42
40
  "eslint": "^5.9.0",
43
- "jest": "^24.0.0",
41
+ "jest": "^26.0.0",
44
42
  "react": "^16.9.0",
45
43
  "react-dom": "^16.9.0",
46
44
  "react-test-renderer": "^16.2.0"
47
45
  },
48
46
  "peerDependencies": {
49
- "@sb1/ffe-core": "^15.2.0",
50
- "react": "^16.9.0"
47
+ "@sb1/ffe-core": "*",
48
+ "react": ">=16.9.0"
51
49
  },
52
50
  "publishConfig": {
53
51
  "access": "public"
54
52
  },
55
- "gitHead": "b421aafe6046e619e961d9ff429096ab80f3c138"
53
+ "gitHead": "10669ef6d5ebf454feb4eddb9aa4ca7bc8f439dc"
56
54
  }
package/CHANGELOG.md DELETED
@@ -1,349 +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.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-core-react@4.2.2...@sb1/ffe-core-react@4.2.3) (2021-02-02)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **ffe-core-react:** reduce vulnerabilities ([add5cba](https://github.com/SpareBank1/designsystem/commit/add5cbaabf058aea4faa0f54f0654d2a3bae5a5e))
12
-
13
-
14
-
15
-
16
-
17
- ## [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)
18
-
19
- **Note:** Version bump only for package @sb1/ffe-core-react
20
-
21
- ## [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)
22
-
23
- ### Bug Fixes
24
-
25
- - **ffe-core-react:** added prop-types for Heading ([f884467](https://github.com/SpareBank1/designsystem/commit/f8844673a842af78896e0f768a3fbd546482bd14))
26
-
27
- # [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)
28
-
29
- ### Features
30
-
31
- - **ffe-core-react:** center leading paragraph ([c12806b](https://github.com/SpareBank1/designsystem/commit/c12806b3b6602c024ea09569856e6b69f17cd755))
32
- - **ffe-core-react:** possible to center heading ([4a563b1](https://github.com/SpareBank1/designsystem/commit/4a563b1186c95468865c9ed82f5429c89fda05c7))
33
-
34
- ## [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)
35
-
36
- ### Bug Fixes
37
-
38
- - **ffe-core-react:** bump prop-types ([7f88f98](https://github.com/SpareBank1/designsystem/commit/7f88f98a524328efc72d62dee335cd10687aa53f))
39
- - **ffe-core-react:** element-type for type script ([f041763](https://github.com/SpareBank1/designsystem/commit/f04176300b4ef9e361d5a833cdc882190a9bf3a8))
40
-
41
- ## [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)
42
-
43
- ### Bug Fixes
44
-
45
- - **ffe-core-react:** element prop-type needs elementType ([95d0ce1](https://github.com/SpareBank1/designsystem/commit/95d0ce1))
46
-
47
- ## [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)
48
-
49
- **Note:** Version bump only for package @sb1/ffe-core-react
50
-
51
- # [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)
52
-
53
- ### Features
54
-
55
- - **ffe-core-react:** custom element for SmallText ([6240db0](https://github.com/SpareBank1/designsystem/commit/6240db0))
56
-
57
- # [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)
58
-
59
- ### chore
60
-
61
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
62
-
63
- ### BREAKING CHANGES
64
-
65
- - peerDep of React is raised to 16.9. While this in itself
66
- isn't a breaking change, it allows for the use of hooks in later releases.
67
- Such changes would just be a minor version, or even a patch, but without
68
- this major version bump it would result in a runtime error for consumers.
69
-
70
- # [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)
71
-
72
- ### Features
73
-
74
- - **ffe-core-react:** Added type definitions for typescript ([630b457](https://github.com/SpareBank1/designsystem/commit/630b457))
75
-
76
- ## [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)
77
-
78
- ### Bug Fixes
79
-
80
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
81
-
82
- ## [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)
83
-
84
- **Note:** Version bump only for package @sb1/ffe-core-react
85
-
86
- ## [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)
87
-
88
- **Note:** Version bump only for package @sb1/ffe-core-react
89
-
90
- ## [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)
91
-
92
- **Note:** Version bump only for package @sb1/ffe-core-react
93
-
94
- <a name="3.2.2"></a>
95
-
96
- ## [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)
97
-
98
- **Note:** Version bump only for package @sb1/ffe-core-react
99
-
100
- <a name="3.2.1"></a>
101
-
102
- ## [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)
103
-
104
- ### Bug Fixes
105
-
106
- - **ffe-core-react:** added peerDependency to ffe-core@^13.0.0 ([d1a6451](https://github.com/SpareBank1/designsystem/commit/d1a6451))
107
-
108
- <a name="3.2.0"></a>
109
-
110
- # [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)
111
-
112
- ### Features
113
-
114
- - **ffe-core-react:** Add `LinkText` component ([b51ed59](https://github.com/SpareBank1/designsystem/commit/b51ed59))
115
-
116
- <a name="3.1.0"></a>
117
-
118
- # [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)
119
-
120
- ### Features
121
-
122
- - **ffe-core-react:** Expose named exports ([4efe35a](https://github.com/SpareBank1/designsystem/commit/4efe35a))
123
-
124
- <a name="3.0.0"></a>
125
-
126
- # [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)
127
-
128
- ### Chores
129
-
130
- - **ffe-core-react:** Remove deprecated layout ([60e8863](https://github.com/SpareBank1/designsystem/commit/60e8863))
131
-
132
- ### BREAKING CHANGES
133
-
134
- - **ffe-core-react:** Removed the React components for the deprecated
135
- Hawaii layout system. Please don't use this layout when developing
136
- new functionality and please consider moving away from it when
137
- visiting old functionality.
138
-
139
- New layouts should be based on the `ffe-grid` component.
140
-
141
- <a name="2.0.3"></a>
142
-
143
- ## [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)
144
-
145
- **Note:** Version bump only for package @sb1/ffe-core-react
146
-
147
- <a name="2.0.2"></a>
148
-
149
- ## [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)
150
-
151
- ### Bug Fixes
152
-
153
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
154
-
155
- <a name="2.0.1"></a>
156
-
157
- ## [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)
158
-
159
- ### Bug Fixes
160
-
161
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
162
-
163
- <a name="2.0.0"></a>
164
-
165
- # 2.0.0 (2018-02-25)
166
-
167
- ### Bug Fixes
168
-
169
- - Fix a few issues with the documentation ([ab3d579](https://github.com/SpareBank1/designsystem/commit/ab3d579))
170
- - Run just 'jest', not 'jest src' ([6377dc5](https://github.com/SpareBank1/designsystem/commit/6377dc5))
171
- - **ffe-core-react:** Relax peerDeps to allow React 15. ([78eb5b4](https://github.com/SpareBank1/designsystem/commit/78eb5b4))
172
-
173
- ### Chores
174
-
175
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
176
-
177
- ### Features
178
-
179
- - **ffe-core-react:** Add contribute.md link to readme ([1a8aab0](https://github.com/SpareBank1/designsystem/commit/1a8aab0))
180
- - **ffe-core-react:** Add new inline prop ([148bdcb](https://github.com/SpareBank1/designsystem/commit/148bdcb))
181
- - **ffe-core-react:** Upgrade to React 16 ([ef3a686](https://github.com/SpareBank1/designsystem/commit/ef3a686))
182
-
183
- ### BREAKING CHANGES
184
-
185
- - All packages have been renamed to add the @sb1 scope.
186
-
187
- See links [1] and [2] to read more about package scopes.
188
-
189
- Unfortunately this requires you update both your dependencies in
190
- `package.json` and all `import` or `require` statements in your code.
191
- Also, you unfortunately have to upgrade all FFE packages at once due to
192
- dependency between packages. If you are on the latest version prior to
193
- this breaking change the upgrade should be a matter of updating
194
- `package.json` with new package names and versions, and updating your
195
- imports.
196
-
197
- To help find the proper package versions you can either browse to the
198
- packages you need or check out the list of Git tags either on
199
- Github [3] or by cloning the repository and running the `git tag`
200
- command. All package versions get a tag in the format
201
- _package@version_.
202
-
203
- Update your `package.json` with the latest package version and add the
204
- @sb1 scope to the package name:
205
-
206
- ```diff
207
- - "ffe-core": "11.0.2",
208
- + "@sb1/ffe-core": "11.0.2",
209
- ```
210
-
211
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
212
- case packages will be put in the `node_modules/@sb1/` directory. If your
213
- build depends on file paths (for instance for copying fonts) you need to
214
- update that path to include the scope.
215
-
216
- The directory structure also means you have to update your imports, both
217
- in Less and in JavaScript.
218
-
219
- Using `less-plugin-npm-import`:
220
-
221
- ```diff
222
- - @import 'npm://ffe-core/less/ffe';
223
- + @import 'npm://@sb1/ffe-core/less/ffe';
224
- ```
225
-
226
- Using Webpack:
227
-
228
- ```diff
229
- - @import '~ffe-core/less/ffe';
230
- + @import '~@sb1/ffe-core/less/ffe';
231
- ```
232
-
233
- Using plain old paths:
234
-
235
- ```diff
236
- - @import '../path/to/node_modules/ffe-core/less/ffe';
237
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
238
- ```
239
-
240
- JavaScript `import`:
241
-
242
- ```diff
243
- - import { ActionButton } from 'ffe-buttons-react';
244
- + import { ActionButton } from '@sb1/ffe-buttons-react';
245
- ```
246
-
247
- JavaScript `require`:
248
-
249
- ```diff
250
- - const { ActionButton } = require('ffe-buttons-react').default;
251
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
252
- ```
253
-
254
- [1]: https://docs.npmjs.com/misc/scope
255
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
256
- [3]: https://github.com/sparebank1/designsystem/tags
257
-
258
- <a name="1.2.4"></a>
259
-
260
- ## [1.2.4](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.3...ffe-core-react@1.2.4) (2018-02-23)
261
-
262
- **Note:** Version bump only for package ffe-core-react
263
-
264
- <a name="1.2.3"></a>
265
-
266
- ## [1.2.3](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.2...ffe-core-react@1.2.3) (2018-02-22)
267
-
268
- **Note:** Version bump only for package ffe-core-react
269
-
270
- <a name="1.2.2"></a>
271
-
272
- ## [1.2.2](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.1...ffe-core-react@1.2.2) (2018-02-21)
273
-
274
- **Note:** Version bump only for package ffe-core-react
275
-
276
- <a name="1.2.1"></a>
277
-
278
- ## [1.2.1](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.2.0...ffe-core-react@1.2.1) (2018-01-26)
279
-
280
- ### Bug Fixes
281
-
282
- - **ffe-core-react:** Relax peerDeps to allow React 15.
283
-
284
- <a name="1.2.0"></a>
285
-
286
- # [1.2.0](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.6...ffe-core-react@1.2.0) (2018-01-19)
287
-
288
- ### Features
289
-
290
- - **ffe-core-react:** Add new inline prop
291
-
292
- <a name="1.1.6"></a>
293
-
294
- ## [1.1.6](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.5...ffe-core-react@1.1.6) (2018-01-19)
295
-
296
- **Note:** Version bump only for package ffe-core-react
297
-
298
- <a name="1.1.5"></a>
299
-
300
- ## [1.1.5](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.4...ffe-core-react@1.1.5) (2018-01-10)
301
-
302
- ### Bug Fixes
303
-
304
- - Run just 'jest', not 'jest src'
305
-
306
- <a name="1.1.4"></a>
307
-
308
- ## [1.1.4](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.3...ffe-core-react@1.1.4) (2018-01-09)
309
-
310
- **Note:** Version bump only for package ffe-core-react
311
-
312
- <a name="1.1.3"></a>
313
-
314
- ## [1.1.3](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.2...ffe-core-react@1.1.3) (2018-01-05)
315
-
316
- **Note:** Version bump only for package ffe-core-react
317
-
318
- <a name="1.1.2"></a>
319
-
320
- ## [1.1.2](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.1...ffe-core-react@1.1.2) (2018-01-04)
321
-
322
- **Note:** Version bump only for package ffe-core-react
323
-
324
- <a name="1.1.1"></a>
325
-
326
- ## [1.1.1](https://github.com/SpareBank1/designsystem/compare/ffe-core-react@1.1.0...ffe-core-react@1.1.1) (2018-01-02)
327
-
328
- **Note:** Version bump only for package ffe-core-react
329
-
330
- <a name="1.1.0"></a>
331
-
332
- # 1.1.0 (2017-12-22)
333
-
334
- ### Bug Fixes
335
-
336
- - Fix a few issues with the documentation
337
-
338
- ### Features
339
-
340
- - **ffe-core-react:** Add contribute.md link to readme
341
- - **ffe-core-react:** Upgrade to React 16
342
-
343
- ## v.1.0.1
344
-
345
- - Fix handling of conditional classes for Heading component
346
-
347
- # v.1.0.0
348
-
349
- - 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
- });