@sb1/ffe-buttons-react 16.0.6 → 16.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,14 @@
1
1
  var _excluded = ["className"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
11
7
  import classNames from 'classnames';
12
8
  import Button from './BaseButton';
13
9
  export default function ActionButton(props) {
14
10
  var className = props.className,
15
- rest = _objectWithoutProperties(props, _excluded);
16
-
11
+ rest = _objectWithoutProperties(props, _excluded);
17
12
  return /*#__PURE__*/React.createElement(Button, _extends({
18
13
  buttonType: "action",
19
14
  className: classNames(className)
@@ -22,30 +17,22 @@ export default function ActionButton(props) {
22
17
  ActionButton.propTypes = {
23
18
  /** Aria label for loading indicator */
24
19
  ariaLoadingMessage: string,
25
-
26
20
  /** The button label */
27
21
  children: node,
28
-
29
22
  /** Extra class names */
30
23
  className: string,
31
-
32
24
  /** Disable a button in certain situations */
33
25
  disabled: bool,
34
-
35
26
  /** The rendered element, like an `<a />` or `<Link />` */
36
27
  element: oneOfType([func, string, elementType]),
37
-
38
28
  /** Ref-setting function, or ref created by useRef, passed to the button element */
39
29
  innerRef: oneOfType([func, shape({
40
30
  current: object
41
31
  })]),
42
-
43
32
  /** Shows a loader if true */
44
33
  isLoading: bool,
45
-
46
34
  /** Icon shown to the left of the label */
47
35
  leftIcon: node,
48
-
49
36
  /** Icon shown to the right of the label */
50
37
  rightIcon: node
51
38
  };
package/es/BackButton.js CHANGED
@@ -1,25 +1,19 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import { oneOfType, func, node, string, object, shape, elementType } from 'prop-types';
5
4
  import InlineButton from './InlineBaseButton';
6
-
7
5
  var BackButton = function BackButton(props) {
8
6
  return /*#__PURE__*/React.createElement(InlineButton, _extends({
9
7
  buttonType: "back"
10
8
  }, props));
11
9
  };
12
-
13
10
  BackButton.propTypes = {
14
11
  /** The button label */
15
12
  children: node,
16
-
17
13
  /** Extra class names */
18
14
  className: string,
19
-
20
15
  /** The rendered element, like an `<a />` or `<Link />` */
21
16
  element: oneOfType([func, string, elementType]),
22
-
23
17
  /** Ref-setting function, or ref created by useRef, passed to the button element */
24
18
  innerRef: oneOfType([func, shape({
25
19
  current: object
package/es/BaseButton.js CHANGED
@@ -1,31 +1,26 @@
1
1
  var _excluded = ["ariaLoadingMessage", "buttonType", "children", "className", "element", "innerRef", "isLoading", "leftIcon", "rightIcon", "onClick"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { bool, func, node, oneOf, oneOfType, string, object, shape, elementType } from 'prop-types';
11
7
  import classNames from 'classnames';
8
+
12
9
  /**
13
10
  * Internal component
14
11
  */
15
-
16
12
  var BaseButton = function BaseButton(props) {
17
13
  var ariaLoadingMessage = props.ariaLoadingMessage,
18
- buttonType = props.buttonType,
19
- children = props.children,
20
- className = props.className,
21
- Element = props.element,
22
- innerRef = props.innerRef,
23
- isLoading = props.isLoading,
24
- leftIcon = props.leftIcon,
25
- rightIcon = props.rightIcon,
26
- _onClick = props.onClick,
27
- rest = _objectWithoutProperties(props, _excluded);
28
-
14
+ buttonType = props.buttonType,
15
+ children = props.children,
16
+ className = props.className,
17
+ Element = props.element,
18
+ innerRef = props.innerRef,
19
+ isLoading = props.isLoading,
20
+ leftIcon = props.leftIcon,
21
+ rightIcon = props.rightIcon,
22
+ _onClick = props.onClick,
23
+ rest = _objectWithoutProperties(props, _excluded);
29
24
  var supportsSpinner = ['action', 'primary', 'secondary'].includes(buttonType);
30
25
  return /*#__PURE__*/React.createElement(Element, _extends({
31
26
  "aria-busy": isLoading && supportsSpinner,
@@ -56,43 +51,32 @@ var BaseButton = function BaseButton(props) {
56
51
  className: "ffe-button__spinner"
57
52
  }));
58
53
  };
59
-
60
54
  BaseButton.propTypes = {
61
55
  /** Aria label for loading indicator */
62
56
  ariaLoadingMessage: string,
63
-
64
57
  /**
65
58
  * Enum of supported prop types. Used internally only.
66
59
  * @ignore
67
60
  */
68
61
  buttonType: oneOf(['action', 'primary', 'secondary', 'shortcut', 'task']),
69
-
70
62
  /** The button label */
71
63
  children: node,
72
-
73
64
  /** Extra class names */
74
65
  className: string,
75
-
76
66
  /** Disable a button in certain situations */
77
67
  disabled: bool,
78
-
79
68
  /** The rendered element, like an `<a />` or `<Link />` */
80
69
  element: oneOfType([func, string, elementType]),
81
-
82
70
  /** Ref-setting function, or ref created by useRef, passed to the button element */
83
71
  innerRef: oneOfType([func, shape({
84
72
  current: object
85
73
  })]),
86
-
87
74
  /** Shows a loader if true */
88
75
  isLoading: bool,
89
-
90
76
  /** Icon shown to the left of the label */
91
77
  leftIcon: node,
92
-
93
78
  /** Icon shown to the right of the label */
94
79
  rightIcon: node,
95
-
96
80
  /** Called when button is clicked if not loading or disabled */
97
81
  onClick: func
98
82
  };
package/es/ButtonGroup.js CHANGED
@@ -1,21 +1,15 @@
1
1
  var _excluded = ["className", "thin", "inline"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { bool, string } from 'prop-types';
11
7
  import classNames from 'classnames';
12
-
13
8
  var ButtonGroup = function ButtonGroup(_ref) {
14
9
  var className = _ref.className,
15
- thin = _ref.thin,
16
- inline = _ref.inline,
17
- rest = _objectWithoutProperties(_ref, _excluded);
18
-
10
+ thin = _ref.thin,
11
+ inline = _ref.inline,
12
+ rest = _objectWithoutProperties(_ref, _excluded);
19
13
  return /*#__PURE__*/React.createElement("div", _extends({
20
14
  className: classNames('ffe-button-group', {
21
15
  'ffe-button-group--thin': thin
@@ -24,14 +18,11 @@ var ButtonGroup = function ButtonGroup(_ref) {
24
18
  }, className)
25
19
  }, rest));
26
20
  };
27
-
28
21
  ButtonGroup.propTypes = {
29
22
  /** Extra class name applied in addition to the FFE classes */
30
23
  className: string,
31
-
32
24
  /** Applies the thin modifier to remove margins */
33
25
  thin: bool,
34
-
35
26
  /** Applies the inline modifier to make all child buttons inline */
36
27
  inline: bool
37
28
  };
@@ -1,27 +1,21 @@
1
1
  var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded", "leftIcon", "rightIcon"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React, { Fragment } from 'react';
10
6
  import { bool, func, oneOfType, string, node, object, shape, elementType } from 'prop-types';
11
7
  import classNames from 'classnames';
12
8
  import KryssIkon from "@sb1/ffe-icons-react/es/kryss-ikon";
13
-
14
9
  var ExpandButton = function ExpandButton(props) {
15
10
  var children = props.children,
16
- className = props.className,
17
- closeLabel = props.closeLabel,
18
- Element = props.element,
19
- innerRef = props.innerRef,
20
- isExpanded = props.isExpanded,
21
- leftIcon = props.leftIcon,
22
- rightIcon = props.rightIcon,
23
- rest = _objectWithoutProperties(props, _excluded);
24
-
11
+ className = props.className,
12
+ closeLabel = props.closeLabel,
13
+ Element = props.element,
14
+ innerRef = props.innerRef,
15
+ isExpanded = props.isExpanded,
16
+ leftIcon = props.leftIcon,
17
+ rightIcon = props.rightIcon,
18
+ rest = _objectWithoutProperties(props, _excluded);
25
19
  return /*#__PURE__*/React.createElement(Element, _extends({
26
20
  "aria-expanded": isExpanded,
27
21
  "aria-label": isExpanded ? closeLabel : undefined,
@@ -40,34 +34,25 @@ var ExpandButton = function ExpandButton(props) {
40
34
  className: 'ffe-button__icon ffe-button__icon--right'
41
35
  })));
42
36
  };
43
-
44
37
  ExpandButton.propTypes = {
45
38
  /** The button label */
46
39
  children: node.isRequired,
47
-
48
40
  /** Extra class names */
49
41
  className: string,
50
-
51
42
  /** The rendered element, like an `<a />` or `<Link />` */
52
43
  element: oneOfType([func, string, elementType]),
53
-
54
44
  /** An accessible label for the close-button, only shown in the "isExpanded" state */
55
45
  closeLabel: string,
56
-
57
46
  /** Icon shown to the left of the label */
58
47
  leftIcon: node,
59
-
60
48
  /** Icon shown to the right of the label */
61
49
  rightIcon: node,
62
-
63
50
  /** Ref-setting function, or ref created by useRef, passed to the button element */
64
51
  innerRef: oneOfType([func, shape({
65
52
  current: object
66
53
  })]),
67
-
68
54
  /** When true the component will render a circle with an X indicating whatever is controlled is in an expanded state. */
69
55
  isExpanded: bool.isRequired,
70
-
71
56
  /** Use to listen for clicks and toggle the `isExpanded` property together with whatever it is you're expanding. */
72
57
  onClick: func.isRequired
73
58
  };
@@ -1,29 +1,24 @@
1
1
  var _excluded = ["buttonType", "children", "className", "element", "innerRef", "leftIcon", "rightIcon"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { func, string, oneOf, oneOfType, node, object, shape, elementType } from 'prop-types';
11
7
  import classNames from 'classnames';
8
+
12
9
  /**
13
10
  * Internal component
14
11
  * @ignore
15
12
  */
16
-
17
13
  var InlineBaseButton = function InlineBaseButton(props) {
18
14
  var buttonType = props.buttonType,
19
- children = props.children,
20
- className = props.className,
21
- Element = props.element,
22
- innerRef = props.innerRef,
23
- leftIcon = props.leftIcon,
24
- rightIcon = props.rightIcon,
25
- rest = _objectWithoutProperties(props, _excluded);
26
-
15
+ children = props.children,
16
+ className = props.className,
17
+ Element = props.element,
18
+ innerRef = props.innerRef,
19
+ leftIcon = props.leftIcon,
20
+ rightIcon = props.rightIcon,
21
+ rest = _objectWithoutProperties(props, _excluded);
27
22
  return /*#__PURE__*/React.createElement(Element, _extends({
28
23
  className: classNames('ffe-inline-button', "ffe-inline-button--".concat(buttonType), className),
29
24
  ref: innerRef
@@ -35,31 +30,24 @@ var InlineBaseButton = function InlineBaseButton(props) {
35
30
  className: 'ffe-inline-button__icon ffe-inline-button__icon--right'
36
31
  }));
37
32
  };
38
-
39
33
  InlineBaseButton.propTypes = {
40
34
  /**
41
35
  * Enum of supported prop types. Used internally only.
42
36
  * @ignore
43
37
  */
44
38
  buttonType: oneOf(['tertiary', 'back', 'expand']),
45
-
46
39
  /** The button label */
47
40
  children: node.isRequired,
48
-
49
41
  /** Extra class names */
50
42
  className: string,
51
-
52
43
  /** The rendered element, like an `<a />` or `<Link />` */
53
44
  element: oneOfType([string, func, elementType]),
54
-
55
45
  /** Ref-setting function, or ref created by useRef, passed to the button element */
56
46
  innerRef: oneOfType([func, shape({
57
47
  current: object
58
48
  })]),
59
-
60
49
  /** Icon shown to the left of the label */
61
50
  leftIcon: node,
62
-
63
51
  /** Icon shown to the right of the label */
64
52
  rightIcon: node
65
53
  };
@@ -1,20 +1,14 @@
1
1
  var _excluded = ["isExpanded"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { bool, func, node, oneOfType, object, shape } from 'prop-types';
11
7
  import ChevronIkon from "@sb1/ffe-icons-react/es/chevron-ikon";
12
8
  import InlineButton from './InlineBaseButton';
13
-
14
9
  var InlineExpandButton = function InlineExpandButton(props) {
15
10
  var isExpanded = props.isExpanded,
16
- rest = _objectWithoutProperties(props, _excluded);
17
-
11
+ rest = _objectWithoutProperties(props, _excluded);
18
12
  return /*#__PURE__*/React.createElement(InlineButton, _extends({
19
13
  buttonType: "expand",
20
14
  type: "button",
@@ -27,19 +21,15 @@ var InlineExpandButton = function InlineExpandButton(props) {
27
21
  })
28
22
  }, rest));
29
23
  };
30
-
31
24
  InlineExpandButton.propTypes = {
32
25
  /** Text that should reflect the isExpanded state. */
33
26
  children: node,
34
-
35
27
  /** Ref-setting function, or ref created by useRef, passed to the button element */
36
28
  innerRef: oneOfType([func, shape({
37
29
  current: object
38
30
  })]),
39
-
40
31
  /** When true it will indicate the button is in its open state */
41
32
  isExpanded: bool.isRequired,
42
-
43
33
  /** Listen for clicks to toggle the isExpanded state. */
44
34
  onClick: func.isRequired
45
35
  };
@@ -1,42 +1,31 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import { bool, func, oneOfType, node, string, object, shape, elementType } from 'prop-types';
5
4
  import Button from './BaseButton';
6
-
7
5
  var PrimaryButton = function PrimaryButton(props) {
8
6
  return /*#__PURE__*/React.createElement(Button, _extends({
9
7
  buttonType: "primary"
10
8
  }, props));
11
9
  };
12
-
13
10
  PrimaryButton.propTypes = {
14
11
  /** Aria label for loading indicator */
15
12
  ariaLoadingMessage: string,
16
-
17
13
  /** The button label */
18
14
  children: node,
19
-
20
15
  /** Extra class names */
21
16
  className: string,
22
-
23
17
  /** Disable a button in certain situations */
24
18
  disabled: bool,
25
-
26
19
  /** The rendered element, like an `<a />` or `<Link />` */
27
20
  element: oneOfType([func, string, elementType]),
28
-
29
21
  /** Ref-setting function, or ref created by useRef, passed to the button element */
30
22
  innerRef: oneOfType([func, shape({
31
23
  current: object
32
24
  })]),
33
-
34
25
  /** Shows a loader if true */
35
26
  isLoading: bool,
36
-
37
27
  /** Icon shown to the left of the label */
38
28
  leftIcon: node,
39
-
40
29
  /** Icon shown to the right of the label */
41
30
  rightIcon: node
42
31
  };
@@ -1,42 +1,31 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import { bool, func, oneOfType, string, node, object, shape, elementType } from 'prop-types';
5
4
  import Button from './BaseButton';
6
-
7
5
  var SecondaryButton = function SecondaryButton(props) {
8
6
  return /*#__PURE__*/React.createElement(Button, _extends({
9
7
  buttonType: "secondary"
10
8
  }, props));
11
9
  };
12
-
13
10
  SecondaryButton.propTypes = {
14
11
  /** Aria label for loading indicator */
15
12
  ariaLoadingMessage: string,
16
-
17
13
  /** The button label */
18
14
  children: node,
19
-
20
15
  /** Extra class names */
21
16
  className: string,
22
-
23
17
  /** Disable a button in certain situations */
24
18
  disabled: bool,
25
-
26
19
  /** The rendered element, like an `<a />` or `<Link />` */
27
20
  element: oneOfType([func, string, elementType]),
28
-
29
21
  /** Ref-setting function, or ref created by useRef, passed to the button element */
30
22
  innerRef: oneOfType([func, shape({
31
23
  current: object
32
24
  })]),
33
-
34
25
  /** Shows a loader if true */
35
26
  isLoading: bool,
36
-
37
27
  /** Icon shown to the left of the label */
38
28
  leftIcon: node,
39
-
40
29
  /** Icon shown to the right of the label */
41
30
  rightIcon: node
42
31
  };
@@ -1,35 +1,27 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
5
4
  import ChevronIkon from "@sb1/ffe-icons-react/es/chevron-ikon";
6
5
  import Button from './BaseButton';
7
-
8
6
  var ShortcutButton = function ShortcutButton(props) {
9
7
  return /*#__PURE__*/React.createElement(Button, _extends({
10
8
  buttonType: "shortcut",
11
9
  rightIcon: /*#__PURE__*/React.createElement(ChevronIkon, null)
12
10
  }, props));
13
11
  };
14
-
15
12
  ShortcutButton.propTypes = {
16
13
  /** The button label */
17
14
  children: node,
18
-
19
15
  /** Extra class names */
20
16
  className: string,
21
-
22
17
  /** Disable a button in certain situations */
23
18
  disabled: bool,
24
-
25
19
  /** The rendered element, like an `<a />` or `<Link />` */
26
20
  element: oneOfType([func, string, elementType]),
27
-
28
21
  /** Ref-setting function, or ref created by useRef, passed to the button element */
29
22
  innerRef: oneOfType([func, shape({
30
23
  current: object
31
24
  })]),
32
-
33
25
  /** Icon shown to the left of the label */
34
26
  leftIcon: node
35
27
  };
package/es/TaskButton.js CHANGED
@@ -1,41 +1,29 @@
1
1
  var _excluded = ["icon"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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; }
8
-
9
5
  import React from 'react';
10
6
  import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
11
7
  import Button from './BaseButton';
12
-
13
8
  var TaskButton = function TaskButton(_ref) {
14
9
  var icon = _ref.icon,
15
- rest = _objectWithoutProperties(_ref, _excluded);
16
-
10
+ rest = _objectWithoutProperties(_ref, _excluded);
17
11
  return /*#__PURE__*/React.createElement(Button, _extends({
18
12
  buttonType: "task",
19
13
  leftIcon: icon
20
14
  }, rest));
21
15
  };
22
-
23
16
  TaskButton.propTypes = {
24
17
  /** The button label */
25
18
  children: node,
26
-
27
19
  /** Extra class names */
28
20
  className: string,
29
-
30
21
  /** Disable a button in certain situations */
31
22
  disabled: bool,
32
-
33
23
  /** The rendered element, like an `<a />` or `<Link />` */
34
24
  element: oneOfType([func, string, elementType]),
35
-
36
25
  /** Task icon, show to the left of the label */
37
26
  icon: node.isRequired,
38
-
39
27
  /** Ref-setting function, or ref created by useRef, passed to the button element */
40
28
  innerRef: oneOfType([func, shape({
41
29
  current: object
@@ -1,33 +1,25 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import { func, node, oneOfType, string, object, shape, elementType } from 'prop-types';
5
4
  import InlineButton from './InlineBaseButton';
6
-
7
5
  var TertiaryButton = function TertiaryButton(props) {
8
6
  return /*#__PURE__*/React.createElement(InlineButton, _extends({
9
7
  buttonType: "tertiary"
10
8
  }, props));
11
9
  };
12
-
13
10
  TertiaryButton.propTypes = {
14
11
  /** The button label */
15
12
  children: node,
16
-
17
13
  /** Extra class names */
18
14
  className: string,
19
-
20
15
  /** The rendered element, like an `<a />` or `<Link />` */
21
16
  element: oneOfType([func, string, elementType]),
22
-
23
17
  /** Ref-setting function, or ref created by useRef, passed to the button element */
24
18
  innerRef: oneOfType([func, shape({
25
19
  current: object
26
20
  })]),
27
-
28
21
  /** Icon shown to the left of the label */
29
22
  leftIcon: node,
30
-
31
23
  /** Icon shown to the right of the label */
32
24
  rightIcon: node
33
25
  };
@@ -4,62 +4,42 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ActionButton;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = require("prop-types");
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _BaseButton = _interopRequireDefault(require("./BaseButton"));
15
-
16
11
  var _excluded = ["className"];
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  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); }
21
-
22
14
  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; }
23
-
24
15
  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; }
25
-
26
16
  function ActionButton(props) {
27
17
  var className = props.className,
28
- rest = _objectWithoutProperties(props, _excluded);
29
-
18
+ rest = _objectWithoutProperties(props, _excluded);
30
19
  return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
31
20
  buttonType: "action",
32
21
  className: (0, _classnames.default)(className)
33
22
  }, rest));
34
23
  }
35
-
36
24
  ActionButton.propTypes = {
37
25
  /** Aria label for loading indicator */
38
26
  ariaLoadingMessage: _propTypes.string,
39
-
40
27
  /** The button label */
41
28
  children: _propTypes.node,
42
-
43
29
  /** Extra class names */
44
30
  className: _propTypes.string,
45
-
46
31
  /** Disable a button in certain situations */
47
32
  disabled: _propTypes.bool,
48
-
49
33
  /** The rendered element, like an `<a />` or `<Link />` */
50
34
  element: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.string, _propTypes.elementType]),
51
-
52
35
  /** Ref-setting function, or ref created by useRef, passed to the button element */
53
36
  innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
54
37
  current: _propTypes.object
55
38
  })]),
56
-
57
39
  /** Shows a loader if true */
58
40
  isLoading: _propTypes.bool,
59
-
60
41
  /** Icon shown to the left of the label */
61
42
  leftIcon: _propTypes.node,
62
-
63
43
  /** Icon shown to the right of the label */
64
44
  rightIcon: _propTypes.node
65
45
  };