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