@sb1/ffe-buttons-react 21.0.2 → 21.0.3

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,19 +1,23 @@
1
- var _excluded = ["isExpanded"];
1
+ var _excluded = ["isExpanded", "className"];
2
2
  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); }
3
3
  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; }
4
4
  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; }
5
5
  import React from 'react';
6
- import { bool, func, node, oneOfType, object, shape } from 'prop-types';
6
+ import { bool, func, node, oneOfType, object, shape, string } from 'prop-types';
7
7
  import { Icon } from '@sb1/ffe-icons-react';
8
+ import classNames from 'classnames';
8
9
  import InlineButton from './InlineBaseButton';
9
10
  var InlineExpandButton = function InlineExpandButton(props) {
10
11
  var isExpanded = props.isExpanded,
12
+ className = props.className,
11
13
  rest = _objectWithoutProperties(props, _excluded);
12
14
  var expandMoreIcon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik00ODAtMzczLjUzOXEtNy4yMzEgMC0xMy40NjEtMi4zMDgtNi4yMzEtMi4zMDgtMTEuODQ2LTcuOTIzTDI3NC45MjQtNTYzLjUzOXEtOC4zMDgtOC4zMDctOC41LTIwLjg4NC0uMTkzLTEyLjU3NyA4LjUtMjEuMjY5IDguNjkyLTguNjkyIDIxLjA3Ni04LjY5MnQyMS4wNzYgOC42OTJMNDgwLTQ0Mi43NjhsMTYyLjkyNC0xNjIuOTI0cTguMzA3LTguMzA3IDIwLjg4NC04LjUgMTIuNTc2LS4xOTIgMjEuMjY4IDguNSA4LjY5MyA4LjY5MiA4LjY5MyAyMS4wNzcgMCAxMi4zODQtOC42OTMgMjEuMDc2TDUwNS4zMDctMzgzLjc3cS01LjYxNSA1LjYxNS0xMS44NDYgNy45MjMtNi4yMyAyLjMwOC0xMy40NjEgMi4zMDhaIi8+PC9zdmc+';
13
15
  return /*#__PURE__*/React.createElement(InlineButton, _extends({
14
16
  buttonType: "expand",
15
17
  type: "button",
16
- className: isExpanded ? 'ffe-inline-button--expanded' : '',
18
+ className: classNames(className, {
19
+ 'ffe-inline-button--expanded': isExpanded
20
+ }),
17
21
  rightIcon: /*#__PURE__*/React.createElement(Icon, {
18
22
  size: "md",
19
23
  fileUrl: expandMoreIcon
@@ -30,6 +34,8 @@ InlineExpandButton.propTypes = {
30
34
  /** When true it will indicate the button is in its open state */
31
35
  isExpanded: bool.isRequired,
32
36
  /** Listen for clicks to toggle the isExpanded state. */
33
- onClick: func.isRequired
37
+ onClick: func.isRequired,
38
+ /** Extra class names */
39
+ className: string
34
40
  };
35
41
  export default InlineExpandButton;
@@ -7,20 +7,24 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = require("prop-types");
9
9
  var _ffeIconsReact = require("@sb1/ffe-icons-react");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _InlineBaseButton = _interopRequireDefault(require("./InlineBaseButton"));
11
- var _excluded = ["isExpanded"];
12
+ var _excluded = ["isExpanded", "className"];
12
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14
  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); }
14
15
  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; }
15
16
  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; }
16
17
  var InlineExpandButton = function InlineExpandButton(props) {
17
18
  var isExpanded = props.isExpanded,
19
+ className = props.className,
18
20
  rest = _objectWithoutProperties(props, _excluded);
19
21
  var expandMoreIcon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik00ODAtMzczLjUzOXEtNy4yMzEgMC0xMy40NjEtMi4zMDgtNi4yMzEtMi4zMDgtMTEuODQ2LTcuOTIzTDI3NC45MjQtNTYzLjUzOXEtOC4zMDgtOC4zMDctOC41LTIwLjg4NC0uMTkzLTEyLjU3NyA4LjUtMjEuMjY5IDguNjkyLTguNjkyIDIxLjA3Ni04LjY5MnQyMS4wNzYgOC42OTJMNDgwLTQ0Mi43NjhsMTYyLjkyNC0xNjIuOTI0cTguMzA3LTguMzA3IDIwLjg4NC04LjUgMTIuNTc2LS4xOTIgMjEuMjY4IDguNSA4LjY5MyA4LjY5MiA4LjY5MyAyMS4wNzcgMCAxMi4zODQtOC42OTMgMjEuMDc2TDUwNS4zMDctMzgzLjc3cS01LjYxNSA1LjYxNS0xMS44NDYgNy45MjMtNi4yMyAyLjMwOC0xMy40NjEgMi4zMDhaIi8+PC9zdmc+';
20
22
  return /*#__PURE__*/_react.default.createElement(_InlineBaseButton.default, _extends({
21
23
  buttonType: "expand",
22
24
  type: "button",
23
- className: isExpanded ? 'ffe-inline-button--expanded' : '',
25
+ className: (0, _classnames.default)(className, {
26
+ 'ffe-inline-button--expanded': isExpanded
27
+ }),
24
28
  rightIcon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
25
29
  size: "md",
26
30
  fileUrl: expandMoreIcon
@@ -37,6 +41,8 @@ InlineExpandButton.propTypes = {
37
41
  /** When true it will indicate the button is in its open state */
38
42
  isExpanded: _propTypes.bool.isRequired,
39
43
  /** Listen for clicks to toggle the isExpanded state. */
40
- onClick: _propTypes.func.isRequired
44
+ onClick: _propTypes.func.isRequired,
45
+ /** Extra class names */
46
+ className: _propTypes.string
41
47
  };
42
48
  var _default = exports.default = InlineExpandButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-buttons-react",
3
- "version": "21.0.2",
3
+ "version": "21.0.3",
4
4
  "description": "React implementation of ffe-buttons",
5
5
  "keywords": [
6
6
  "ffe"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "0ff375001e4b4c81f9005e99687de4a53e959d7c"
49
+ "gitHead": "7bb36b7b7b27b37824d612c1d91552c911da130e"
50
50
  }