@sb1/ffe-core-react 4.3.0 → 5.0.2
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/Wave.js +17 -11
- package/lib/Wave.js +16 -10
- package/package.json +3 -3
- package/types/index.d.ts +2 -1
package/es/Wave.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["waveHeight", "position", "
|
|
1
|
+
var _excluded = ["waveHeight", "position", "flip", "color", "darkmodeColor", "children"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -7,26 +7,31 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { string, bool, oneOf } from 'prop-types';
|
|
10
|
+
import { string, bool, oneOf, node } from 'prop-types';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
export default function Wave(props) {
|
|
13
13
|
var waveHeight = props.waveHeight,
|
|
14
14
|
position = props.position,
|
|
15
|
-
|
|
15
|
+
flip = props.flip,
|
|
16
16
|
color = props.color,
|
|
17
17
|
darkmodeColor = props.darkmodeColor,
|
|
18
|
+
children = props.children,
|
|
18
19
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
20
|
|
|
20
|
-
return /*#__PURE__*/React.createElement("div",
|
|
21
|
-
"aria-hidden": "true",
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
22
|
className: classNames('ffe-wave', "ffe-wave--".concat(waveHeight), "ffe-wave--bg-".concat(color), "ffe-wave--dm-bg-".concat(darkmodeColor), {
|
|
23
|
-
'ffe-wave--
|
|
24
|
-
})
|
|
23
|
+
'ffe-wave--flip': flip
|
|
24
|
+
})
|
|
25
|
+
}, children ? /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "ffe-wave__content"
|
|
27
|
+
}, children) : null, /*#__PURE__*/React.createElement("div", _extends({
|
|
28
|
+
className: "ffe-wave__wave",
|
|
29
|
+
"aria-hidden": "true",
|
|
25
30
|
style: {
|
|
26
31
|
maskPosition: position,
|
|
27
32
|
WebkitMaskPosition: position
|
|
28
33
|
}
|
|
29
|
-
}, rest));
|
|
34
|
+
}, rest)));
|
|
30
35
|
}
|
|
31
36
|
Wave.propTypes = {
|
|
32
37
|
/** Choose between small, medium and large intensity of the wave */
|
|
@@ -35,12 +40,13 @@ Wave.propTypes = {
|
|
|
35
40
|
/** Sets the mask-position property, setting a px/rem value will move the starting position of the wave */
|
|
36
41
|
position: string,
|
|
37
42
|
|
|
38
|
-
/**
|
|
39
|
-
|
|
43
|
+
/** Rotate the wave 180 degrees :*/
|
|
44
|
+
flip: bool,
|
|
40
45
|
|
|
41
46
|
/** Sets the color of the wave. Accepts ffe-color variables without the "ffe-farge-" bit of the name. */
|
|
42
47
|
color: oneOf(['hvit', 'frost-30', 'sand-30', 'sand-70', 'syrin-30', 'syrin-70', 'vann', 'vann-30', 'fjell']).isRequired,
|
|
43
48
|
|
|
44
49
|
/** Set the background color in darkmode */
|
|
45
|
-
darkmodeColor: oneOf(['svart', 'natt']).isRequired
|
|
50
|
+
darkmodeColor: oneOf(['svart', 'natt']).isRequired,
|
|
51
|
+
children: node
|
|
46
52
|
};
|
package/lib/Wave.js
CHANGED
|
@@ -11,7 +11,7 @@ var _propTypes = require("prop-types");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _excluded = ["waveHeight", "position", "
|
|
14
|
+
var _excluded = ["waveHeight", "position", "flip", "color", "darkmodeColor", "children"];
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -24,21 +24,26 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
24
24
|
function Wave(props) {
|
|
25
25
|
var waveHeight = props.waveHeight,
|
|
26
26
|
position = props.position,
|
|
27
|
-
|
|
27
|
+
flip = props.flip,
|
|
28
28
|
color = props.color,
|
|
29
29
|
darkmodeColor = props.darkmodeColor,
|
|
30
|
+
children = props.children,
|
|
30
31
|
rest = _objectWithoutProperties(props, _excluded);
|
|
31
32
|
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
33
|
-
"aria-hidden": "true",
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
34
|
className: (0, _classnames.default)('ffe-wave', "ffe-wave--".concat(waveHeight), "ffe-wave--bg-".concat(color), "ffe-wave--dm-bg-".concat(darkmodeColor), {
|
|
35
|
-
'ffe-wave--
|
|
36
|
-
})
|
|
35
|
+
'ffe-wave--flip': flip
|
|
36
|
+
})
|
|
37
|
+
}, children ? /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: "ffe-wave__content"
|
|
39
|
+
}, children) : null, /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
40
|
+
className: "ffe-wave__wave",
|
|
41
|
+
"aria-hidden": "true",
|
|
37
42
|
style: {
|
|
38
43
|
maskPosition: position,
|
|
39
44
|
WebkitMaskPosition: position
|
|
40
45
|
}
|
|
41
|
-
}, rest));
|
|
46
|
+
}, rest)));
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
Wave.propTypes = {
|
|
@@ -48,12 +53,13 @@ Wave.propTypes = {
|
|
|
48
53
|
/** Sets the mask-position property, setting a px/rem value will move the starting position of the wave */
|
|
49
54
|
position: _propTypes.string,
|
|
50
55
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
56
|
+
/** Rotate the wave 180 degrees :*/
|
|
57
|
+
flip: _propTypes.bool,
|
|
53
58
|
|
|
54
59
|
/** Sets the color of the wave. Accepts ffe-color variables without the "ffe-farge-" bit of the name. */
|
|
55
60
|
color: (0, _propTypes.oneOf)(['hvit', 'frost-30', 'sand-30', 'sand-70', 'syrin-30', 'syrin-70', 'vann', 'vann-30', 'fjell']).isRequired,
|
|
56
61
|
|
|
57
62
|
/** Set the background color in darkmode */
|
|
58
|
-
darkmodeColor: (0, _propTypes.oneOf)(['svart', 'natt']).isRequired
|
|
63
|
+
darkmodeColor: (0, _propTypes.oneOf)(['svart', 'natt']).isRequired,
|
|
64
|
+
children: _propTypes.node
|
|
59
65
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-core-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "React components for ffe-core components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prop-types": "^15.7.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@sb1/ffe-buildtool": "^0.4.
|
|
35
|
+
"@sb1/ffe-buildtool": "^0.4.1",
|
|
36
36
|
"eslint": "^5.9.0",
|
|
37
37
|
"react": "^16.9.0",
|
|
38
38
|
"react-dom": "^16.9.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "20645a84ff31b513ef2568a7eefbed950f7e1c40"
|
|
48
48
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface ParagraphProps
|
|
|
50
50
|
export interface WaveProps {
|
|
51
51
|
waveHeight: 'small' | 'medium' | 'large';
|
|
52
52
|
position?: string;
|
|
53
|
-
|
|
53
|
+
flip?: boolean;
|
|
54
54
|
color:
|
|
55
55
|
| 'hvit'
|
|
56
56
|
| 'frost-30'
|
|
@@ -62,6 +62,7 @@ export interface WaveProps {
|
|
|
62
62
|
| 'vann-30'
|
|
63
63
|
| 'fjell';
|
|
64
64
|
darkmodeColor: 'svart' | 'natt';
|
|
65
|
+
children: React.ReactNode;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
declare class DividerLine extends React.Component<DividerLineProps, any> {}
|