@sb1/ffe-core-react 4.3.0 → 5.0.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- var _excluded = ["waveHeight", "position", "rotate", "color", "darkmodeColor"];
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
- rotate = props.rotate,
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", _extends({
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--rotate': rotate
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
- /** Rotates the wave 180 degrees :*/
39
- rotate: bool,
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", "rotate", "color", "darkmodeColor"];
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
- rotate = props.rotate,
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", _extends({
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--rotate': rotate
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
- /** Rotates the wave 180 degrees :*/
52
- rotate: _propTypes.bool,
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": "4.3.0",
3
+ "version": "5.0.0",
4
4
  "description": "React components for ffe-core components",
5
5
  "keywords": [
6
6
  "ffe"
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "35f1eac68c249adc523d35b439175624cdf79da6"
47
+ "gitHead": "cce0149ec999aacfb7f4fb821ff8cadf3d945a99"
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
- rotate?: bool;
53
+ flip?: bool;
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> {}