@sb1/ffe-buttons-react 18.0.6 → 19.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/ActionButton.js +17 -6
- package/es/BackButton.js +6 -1
- package/es/BaseButton.js +2 -2
- package/es/ExpandButton.js +18 -14
- package/es/InlineBaseButton.js +4 -2
- package/es/InlineExpandButton.js +6 -8
- package/es/PrimaryButton.js +21 -6
- package/es/SecondaryButton.js +21 -6
- package/es/ShortcutButton.js +6 -5
- package/es/TaskButton.js +7 -3
- package/es/TertiaryButton.js +21 -6
- package/lib/ActionButton.js +17 -6
- package/lib/BackButton.js +6 -1
- package/lib/BaseButton.js +2 -2
- package/lib/ExpandButton.js +18 -14
- package/lib/InlineBaseButton.js +4 -2
- package/lib/InlineExpandButton.js +6 -8
- package/lib/PrimaryButton.js +21 -6
- package/lib/SecondaryButton.js +21 -6
- package/lib/ShortcutButton.js +6 -5
- package/lib/TaskButton.js +7 -3
- package/lib/TertiaryButton.js +21 -6
- package/package.json +4 -4
- package/types/index.d.ts +5 -6
package/es/ActionButton.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
var _excluded = ["className"];
|
|
1
|
+
var _excluded = ["className", "leftIcon", "rightIcon"];
|
|
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
6
|
import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
8
9
|
import Button from './BaseButton';
|
|
9
10
|
export default function ActionButton(props) {
|
|
10
11
|
var className = props.className,
|
|
12
|
+
leftIcon = props.leftIcon,
|
|
13
|
+
rightIcon = props.rightIcon,
|
|
11
14
|
rest = _objectWithoutProperties(props, _excluded);
|
|
12
15
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
13
16
|
buttonType: "action",
|
|
14
|
-
className: classNames(className)
|
|
17
|
+
className: classNames(className),
|
|
18
|
+
leftIcon: leftIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
19
|
+
ariaLabel: "",
|
|
20
|
+
size: "sm"
|
|
21
|
+
}, leftIcon),
|
|
22
|
+
rightIcon: rightIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
23
|
+
ariaLabel: "",
|
|
24
|
+
size: "sm"
|
|
25
|
+
}, rightIcon)
|
|
15
26
|
}, rest));
|
|
16
27
|
}
|
|
17
28
|
ActionButton.propTypes = {
|
|
@@ -31,8 +42,8 @@ ActionButton.propTypes = {
|
|
|
31
42
|
})]),
|
|
32
43
|
/** Shows a loader if true */
|
|
33
44
|
isLoading: bool,
|
|
34
|
-
/** Icon shown to the left of the label */
|
|
35
|
-
leftIcon:
|
|
36
|
-
/** Icon shown to the right of the label */
|
|
37
|
-
rightIcon:
|
|
45
|
+
/** Name of Icon shown to the left of the label */
|
|
46
|
+
leftIcon: string,
|
|
47
|
+
/** Name of Icon shown to the right of the label */
|
|
48
|
+
rightIcon: string
|
|
38
49
|
};
|
package/es/BackButton.js
CHANGED
|
@@ -2,9 +2,14 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { oneOfType, func, node, string, object, shape, elementType } from 'prop-types';
|
|
4
4
|
import InlineButton from './InlineBaseButton';
|
|
5
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
5
6
|
var BackButton = function BackButton(props) {
|
|
6
7
|
return /*#__PURE__*/React.createElement(InlineButton, _extends({
|
|
7
|
-
buttonType: "back"
|
|
8
|
+
buttonType: "back",
|
|
9
|
+
leftIcon: /*#__PURE__*/React.createElement(_Symbol, {
|
|
10
|
+
ariaLabel: "",
|
|
11
|
+
size: "md"
|
|
12
|
+
}, "chevron_left")
|
|
8
13
|
}, props));
|
|
9
14
|
};
|
|
10
15
|
BackButton.propTypes = {
|
package/es/BaseButton.js
CHANGED
|
@@ -41,10 +41,10 @@ var BaseButton = function BaseButton(props) {
|
|
|
41
41
|
className: "ffe-button__label"
|
|
42
42
|
}, leftIcon && /*#__PURE__*/React.cloneElement(leftIcon, {
|
|
43
43
|
className: 'ffe-button__icon ffe-button__icon--left',
|
|
44
|
-
|
|
44
|
+
weight: 300
|
|
45
45
|
}), children, rightIcon && /*#__PURE__*/React.cloneElement(rightIcon, {
|
|
46
46
|
className: 'ffe-button__icon ffe-button__icon--right',
|
|
47
|
-
|
|
47
|
+
weight: 300
|
|
48
48
|
})), supportsSpinner && isLoading && /*#__PURE__*/React.createElement("span", {
|
|
49
49
|
"aria-label": ariaLoadingMessage,
|
|
50
50
|
role: "img",
|
package/es/ExpandButton.js
CHANGED
|
@@ -5,7 +5,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { bool, func, oneOfType, string, node, object, shape, elementType } from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
9
9
|
var ExpandButton = function ExpandButton(props) {
|
|
10
10
|
var children = props.children,
|
|
11
11
|
className = props.className,
|
|
@@ -23,16 +23,20 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
23
23
|
'ffe-button--expanded': isExpanded
|
|
24
24
|
}, className),
|
|
25
25
|
ref: innerRef
|
|
26
|
-
}, rest), isExpanded && /*#__PURE__*/React.createElement(
|
|
26
|
+
}, rest), isExpanded && /*#__PURE__*/React.createElement(_Symbol, {
|
|
27
27
|
className: "ffe-button__icon",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
28
|
+
ariaLabel: "",
|
|
29
|
+
size: "sm",
|
|
30
|
+
weight: 300
|
|
31
|
+
}, "close"), !isExpanded && /*#__PURE__*/React.createElement("span", null, leftIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
32
|
+
className: "ffe-button__icon ffe-button__icon--left",
|
|
33
|
+
ariaLabel: "",
|
|
34
|
+
weight: 300
|
|
35
|
+
}, leftIcon), children, rightIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
36
|
+
className: "ffe-button__icon ffe-button__icon--right",
|
|
37
|
+
ariaLabel: "",
|
|
38
|
+
weight: 300
|
|
39
|
+
}, rightIcon)));
|
|
36
40
|
};
|
|
37
41
|
ExpandButton.propTypes = {
|
|
38
42
|
/** The button label */
|
|
@@ -43,10 +47,10 @@ ExpandButton.propTypes = {
|
|
|
43
47
|
element: oneOfType([func, string, elementType]),
|
|
44
48
|
/** An accessible label for the close-button, only shown in the "isExpanded" state */
|
|
45
49
|
closeLabel: string,
|
|
46
|
-
/** Icon shown to the left of the label */
|
|
47
|
-
leftIcon:
|
|
48
|
-
/** Icon shown to the right of the label */
|
|
49
|
-
rightIcon:
|
|
50
|
+
/** Name of Icon shown to the left of the label */
|
|
51
|
+
leftIcon: string,
|
|
52
|
+
/** Name of Icon shown to the right of the label */
|
|
53
|
+
rightIcon: string,
|
|
50
54
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
51
55
|
innerRef: oneOfType([func, shape({
|
|
52
56
|
current: object
|
package/es/InlineBaseButton.js
CHANGED
|
@@ -23,11 +23,13 @@ var InlineBaseButton = function InlineBaseButton(props) {
|
|
|
23
23
|
className: classNames('ffe-inline-button', "ffe-inline-button--".concat(buttonType), className),
|
|
24
24
|
ref: innerRef
|
|
25
25
|
}, rest), leftIcon && /*#__PURE__*/React.cloneElement(leftIcon, {
|
|
26
|
-
className: 'ffe-inline-button__icon ffe-inline-button__icon--left'
|
|
26
|
+
className: 'ffe-inline-button__icon ffe-inline-button__icon--left',
|
|
27
|
+
weight: 300
|
|
27
28
|
}), /*#__PURE__*/React.createElement("span", {
|
|
28
29
|
className: "ffe-inline-button__label"
|
|
29
30
|
}, children), rightIcon && /*#__PURE__*/React.cloneElement(rightIcon, {
|
|
30
|
-
className: 'ffe-inline-button__icon ffe-inline-button__icon--right'
|
|
31
|
+
className: 'ffe-inline-button__icon ffe-inline-button__icon--right',
|
|
32
|
+
weight: 300
|
|
31
33
|
}));
|
|
32
34
|
};
|
|
33
35
|
InlineBaseButton.propTypes = {
|
package/es/InlineExpandButton.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
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
6
|
import { bool, func, node, oneOfType, object, shape } from 'prop-types';
|
|
7
|
-
import
|
|
7
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
8
8
|
import InlineButton from './InlineBaseButton';
|
|
9
9
|
var InlineExpandButton = function InlineExpandButton(props) {
|
|
10
10
|
var isExpanded = props.isExpanded,
|
|
@@ -12,13 +12,11 @@ var InlineExpandButton = function InlineExpandButton(props) {
|
|
|
12
12
|
return /*#__PURE__*/React.createElement(InlineButton, _extends({
|
|
13
13
|
buttonType: "expand",
|
|
14
14
|
type: "button",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
})
|
|
15
|
+
className: isExpanded ? 'ffe-inline-button--expanded' : '',
|
|
16
|
+
rightIcon: /*#__PURE__*/React.createElement(_Symbol, {
|
|
17
|
+
size: "md",
|
|
18
|
+
ariaLabel: ""
|
|
19
|
+
}, "expand_more")
|
|
22
20
|
}, rest));
|
|
23
21
|
};
|
|
24
22
|
InlineExpandButton.propTypes = {
|
package/es/PrimaryButton.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
1
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
|
+
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
|
+
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; }
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { bool, func, oneOfType, node, string, object, shape, elementType } from 'prop-types';
|
|
4
7
|
import Button from './BaseButton';
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
5
9
|
var PrimaryButton = function PrimaryButton(props) {
|
|
10
|
+
var leftIcon = props.leftIcon,
|
|
11
|
+
rightIcon = props.rightIcon,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
6
13
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7
|
-
buttonType: "primary"
|
|
8
|
-
|
|
14
|
+
buttonType: "primary",
|
|
15
|
+
leftIcon: leftIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
16
|
+
ariaLabel: "",
|
|
17
|
+
size: "sm"
|
|
18
|
+
}, leftIcon),
|
|
19
|
+
rightIcon: rightIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
20
|
+
ariaLabel: "",
|
|
21
|
+
size: "sm"
|
|
22
|
+
}, rightIcon)
|
|
23
|
+
}, rest));
|
|
9
24
|
};
|
|
10
25
|
PrimaryButton.propTypes = {
|
|
11
26
|
/** Aria label for loading indicator */
|
|
@@ -24,9 +39,9 @@ PrimaryButton.propTypes = {
|
|
|
24
39
|
})]),
|
|
25
40
|
/** Shows a loader if true */
|
|
26
41
|
isLoading: bool,
|
|
27
|
-
/**
|
|
28
|
-
leftIcon:
|
|
29
|
-
/**
|
|
30
|
-
rightIcon:
|
|
42
|
+
/** Name of icon shown to the left of the label */
|
|
43
|
+
leftIcon: string,
|
|
44
|
+
/** Name of icon shown to the right of the label */
|
|
45
|
+
rightIcon: string
|
|
31
46
|
};
|
|
32
47
|
export default PrimaryButton;
|
package/es/SecondaryButton.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
1
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
|
+
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
|
+
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; }
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { bool, func, oneOfType, string, node, object, shape, elementType } from 'prop-types';
|
|
4
7
|
import Button from './BaseButton';
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
5
9
|
var SecondaryButton = function SecondaryButton(props) {
|
|
10
|
+
var leftIcon = props.leftIcon,
|
|
11
|
+
rightIcon = props.rightIcon,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
6
13
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7
|
-
buttonType: "secondary"
|
|
8
|
-
|
|
14
|
+
buttonType: "secondary",
|
|
15
|
+
leftIcon: leftIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
16
|
+
ariaLabel: "",
|
|
17
|
+
size: "sm"
|
|
18
|
+
}, leftIcon),
|
|
19
|
+
rightIcon: rightIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
20
|
+
ariaLabel: "",
|
|
21
|
+
size: "sm"
|
|
22
|
+
}, rightIcon)
|
|
23
|
+
}, rest));
|
|
9
24
|
};
|
|
10
25
|
SecondaryButton.propTypes = {
|
|
11
26
|
/** Aria label for loading indicator */
|
|
@@ -24,9 +39,9 @@ SecondaryButton.propTypes = {
|
|
|
24
39
|
})]),
|
|
25
40
|
/** Shows a loader if true */
|
|
26
41
|
isLoading: bool,
|
|
27
|
-
/**
|
|
28
|
-
leftIcon:
|
|
29
|
-
/**
|
|
30
|
-
rightIcon:
|
|
42
|
+
/** Name of icon shown to the left of the label */
|
|
43
|
+
leftIcon: string,
|
|
44
|
+
/** Name of icon shown to the right of the label */
|
|
45
|
+
rightIcon: string
|
|
31
46
|
};
|
|
32
47
|
export default SecondaryButton;
|
package/es/ShortcutButton.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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
2
|
import React from 'react';
|
|
3
3
|
import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
|
|
4
|
-
import ChevronIkon from "@sb1/ffe-icons-react/es/chevron-ikon";
|
|
5
4
|
import Button from './BaseButton';
|
|
5
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
6
6
|
var ShortcutButton = function ShortcutButton(props) {
|
|
7
7
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
8
8
|
buttonType: "shortcut",
|
|
9
|
-
rightIcon: /*#__PURE__*/React.createElement(
|
|
9
|
+
rightIcon: /*#__PURE__*/React.createElement(_Symbol, {
|
|
10
|
+
ariaLabel: "",
|
|
11
|
+
size: "md"
|
|
12
|
+
}, "chevron_right")
|
|
10
13
|
}, props));
|
|
11
14
|
};
|
|
12
15
|
ShortcutButton.propTypes = {
|
|
@@ -21,8 +24,6 @@ ShortcutButton.propTypes = {
|
|
|
21
24
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
22
25
|
innerRef: oneOfType([func, shape({
|
|
23
26
|
current: object
|
|
24
|
-
})])
|
|
25
|
-
/** Icon shown to the left of the label */
|
|
26
|
-
leftIcon: node
|
|
27
|
+
})])
|
|
27
28
|
};
|
|
28
29
|
export default ShortcutButton;
|
package/es/TaskButton.js
CHANGED
|
@@ -5,12 +5,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { bool, func, node, string, oneOfType, object, shape, elementType } from 'prop-types';
|
|
7
7
|
import Button from './BaseButton';
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
8
9
|
var TaskButton = function TaskButton(_ref) {
|
|
9
10
|
var icon = _ref.icon,
|
|
10
11
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
11
12
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
12
13
|
buttonType: "task",
|
|
13
|
-
leftIcon:
|
|
14
|
+
leftIcon: /*#__PURE__*/React.createElement(_Symbol, {
|
|
15
|
+
ariaLabel: "",
|
|
16
|
+
size: "sm"
|
|
17
|
+
}, icon)
|
|
14
18
|
}, rest));
|
|
15
19
|
};
|
|
16
20
|
TaskButton.propTypes = {
|
|
@@ -22,8 +26,8 @@ TaskButton.propTypes = {
|
|
|
22
26
|
disabled: bool,
|
|
23
27
|
/** The rendered element, like an `<a />` or `<Link />` */
|
|
24
28
|
element: oneOfType([func, string, elementType]),
|
|
25
|
-
/** Task icon,
|
|
26
|
-
icon:
|
|
29
|
+
/** Name of Task icon, shown to the left of the label */
|
|
30
|
+
icon: string.isRequired,
|
|
27
31
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
28
32
|
innerRef: oneOfType([func, shape({
|
|
29
33
|
current: object
|
package/es/TertiaryButton.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
1
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
|
+
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
|
+
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; }
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { func, node, oneOfType, string, object, shape, elementType } from 'prop-types';
|
|
4
7
|
import InlineButton from './InlineBaseButton';
|
|
8
|
+
import _Symbol from '@sb1/ffe-symbols-react';
|
|
5
9
|
var TertiaryButton = function TertiaryButton(props) {
|
|
10
|
+
var leftIcon = props.leftIcon,
|
|
11
|
+
rightIcon = props.rightIcon,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
6
13
|
return /*#__PURE__*/React.createElement(InlineButton, _extends({
|
|
7
|
-
buttonType: "tertiary"
|
|
8
|
-
|
|
14
|
+
buttonType: "tertiary",
|
|
15
|
+
leftIcon: leftIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
16
|
+
ariaLabel: "",
|
|
17
|
+
size: "sm"
|
|
18
|
+
}, leftIcon),
|
|
19
|
+
rightIcon: rightIcon && /*#__PURE__*/React.createElement(_Symbol, {
|
|
20
|
+
ariaLabel: "",
|
|
21
|
+
size: "sm"
|
|
22
|
+
}, rightIcon)
|
|
23
|
+
}, rest));
|
|
9
24
|
};
|
|
10
25
|
TertiaryButton.propTypes = {
|
|
11
26
|
/** The button label */
|
|
@@ -18,9 +33,9 @@ TertiaryButton.propTypes = {
|
|
|
18
33
|
innerRef: oneOfType([func, shape({
|
|
19
34
|
current: object
|
|
20
35
|
})]),
|
|
21
|
-
/**
|
|
22
|
-
leftIcon:
|
|
23
|
-
/**
|
|
24
|
-
rightIcon:
|
|
36
|
+
/** Name of icon shown to the left of the label */
|
|
37
|
+
leftIcon: string,
|
|
38
|
+
/** Name of icon shown to the right of the label */
|
|
39
|
+
rightIcon: string
|
|
25
40
|
};
|
|
26
41
|
export default TertiaryButton;
|
package/lib/ActionButton.js
CHANGED
|
@@ -7,18 +7,29 @@ exports.default = ActionButton;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
10
11
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
11
|
-
var _excluded = ["className"];
|
|
12
|
+
var _excluded = ["className", "leftIcon", "rightIcon"];
|
|
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
|
function ActionButton(props) {
|
|
17
18
|
var className = props.className,
|
|
19
|
+
leftIcon = props.leftIcon,
|
|
20
|
+
rightIcon = props.rightIcon,
|
|
18
21
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
22
|
return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
|
|
20
23
|
buttonType: "action",
|
|
21
|
-
className: (0, _classnames.default)(className)
|
|
24
|
+
className: (0, _classnames.default)(className),
|
|
25
|
+
leftIcon: leftIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
26
|
+
ariaLabel: "",
|
|
27
|
+
size: "sm"
|
|
28
|
+
}, leftIcon),
|
|
29
|
+
rightIcon: rightIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
30
|
+
ariaLabel: "",
|
|
31
|
+
size: "sm"
|
|
32
|
+
}, rightIcon)
|
|
22
33
|
}, rest));
|
|
23
34
|
}
|
|
24
35
|
ActionButton.propTypes = {
|
|
@@ -38,8 +49,8 @@ ActionButton.propTypes = {
|
|
|
38
49
|
})]),
|
|
39
50
|
/** Shows a loader if true */
|
|
40
51
|
isLoading: _propTypes.bool,
|
|
41
|
-
/** Icon shown to the left of the label */
|
|
42
|
-
leftIcon: _propTypes.
|
|
43
|
-
/** Icon shown to the right of the label */
|
|
44
|
-
rightIcon: _propTypes.
|
|
52
|
+
/** Name of Icon shown to the left of the label */
|
|
53
|
+
leftIcon: _propTypes.string,
|
|
54
|
+
/** Name of Icon shown to the right of the label */
|
|
55
|
+
rightIcon: _propTypes.string
|
|
45
56
|
};
|
package/lib/BackButton.js
CHANGED
|
@@ -7,11 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _InlineBaseButton = _interopRequireDefault(require("./InlineBaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
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); }
|
|
12
13
|
var BackButton = function BackButton(props) {
|
|
13
14
|
return /*#__PURE__*/_react.default.createElement(_InlineBaseButton.default, _extends({
|
|
14
|
-
buttonType: "back"
|
|
15
|
+
buttonType: "back",
|
|
16
|
+
leftIcon: /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
17
|
+
ariaLabel: "",
|
|
18
|
+
size: "md"
|
|
19
|
+
}, "chevron_left")
|
|
15
20
|
}, props));
|
|
16
21
|
};
|
|
17
22
|
BackButton.propTypes = {
|
package/lib/BaseButton.js
CHANGED
|
@@ -47,10 +47,10 @@ var BaseButton = function BaseButton(props) {
|
|
|
47
47
|
className: "ffe-button__label"
|
|
48
48
|
}, leftIcon && /*#__PURE__*/_react.default.cloneElement(leftIcon, {
|
|
49
49
|
className: 'ffe-button__icon ffe-button__icon--left',
|
|
50
|
-
|
|
50
|
+
weight: 300
|
|
51
51
|
}), children, rightIcon && /*#__PURE__*/_react.default.cloneElement(rightIcon, {
|
|
52
52
|
className: 'ffe-button__icon ffe-button__icon--right',
|
|
53
|
-
|
|
53
|
+
weight: 300
|
|
54
54
|
})), supportsSpinner && isLoading && /*#__PURE__*/_react.default.createElement("span", {
|
|
55
55
|
"aria-label": ariaLoadingMessage,
|
|
56
56
|
role: "img",
|
package/lib/ExpandButton.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
11
|
var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded", "leftIcon", "rightIcon"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
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); }
|
|
@@ -30,16 +30,20 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
30
30
|
'ffe-button--expanded': isExpanded
|
|
31
31
|
}, className),
|
|
32
32
|
ref: innerRef
|
|
33
|
-
}, rest), isExpanded && /*#__PURE__*/_react.default.createElement(
|
|
33
|
+
}, rest), isExpanded && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
34
34
|
className: "ffe-button__icon",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
35
|
+
ariaLabel: "",
|
|
36
|
+
size: "sm",
|
|
37
|
+
weight: 300
|
|
38
|
+
}, "close"), !isExpanded && /*#__PURE__*/_react.default.createElement("span", null, leftIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
39
|
+
className: "ffe-button__icon ffe-button__icon--left",
|
|
40
|
+
ariaLabel: "",
|
|
41
|
+
weight: 300
|
|
42
|
+
}, leftIcon), children, rightIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
43
|
+
className: "ffe-button__icon ffe-button__icon--right",
|
|
44
|
+
ariaLabel: "",
|
|
45
|
+
weight: 300
|
|
46
|
+
}, rightIcon)));
|
|
43
47
|
};
|
|
44
48
|
ExpandButton.propTypes = {
|
|
45
49
|
/** The button label */
|
|
@@ -50,10 +54,10 @@ ExpandButton.propTypes = {
|
|
|
50
54
|
element: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.string, _propTypes.elementType]),
|
|
51
55
|
/** An accessible label for the close-button, only shown in the "isExpanded" state */
|
|
52
56
|
closeLabel: _propTypes.string,
|
|
53
|
-
/** Icon shown to the left of the label */
|
|
54
|
-
leftIcon: _propTypes.
|
|
55
|
-
/** Icon shown to the right of the label */
|
|
56
|
-
rightIcon: _propTypes.
|
|
57
|
+
/** Name of Icon shown to the left of the label */
|
|
58
|
+
leftIcon: _propTypes.string,
|
|
59
|
+
/** Name of Icon shown to the right of the label */
|
|
60
|
+
rightIcon: _propTypes.string,
|
|
57
61
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
58
62
|
innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
|
|
59
63
|
current: _propTypes.object
|
package/lib/InlineBaseButton.js
CHANGED
|
@@ -29,11 +29,13 @@ var InlineBaseButton = function InlineBaseButton(props) {
|
|
|
29
29
|
className: (0, _classnames.default)('ffe-inline-button', "ffe-inline-button--".concat(buttonType), className),
|
|
30
30
|
ref: innerRef
|
|
31
31
|
}, rest), leftIcon && /*#__PURE__*/_react.default.cloneElement(leftIcon, {
|
|
32
|
-
className: 'ffe-inline-button__icon ffe-inline-button__icon--left'
|
|
32
|
+
className: 'ffe-inline-button__icon ffe-inline-button__icon--left',
|
|
33
|
+
weight: 300
|
|
33
34
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
34
35
|
className: "ffe-inline-button__label"
|
|
35
36
|
}, children), rightIcon && /*#__PURE__*/_react.default.cloneElement(rightIcon, {
|
|
36
|
-
className: 'ffe-inline-button__icon ffe-inline-button__icon--right'
|
|
37
|
+
className: 'ffe-inline-button__icon ffe-inline-button__icon--right',
|
|
38
|
+
weight: 300
|
|
37
39
|
}));
|
|
38
40
|
};
|
|
39
41
|
InlineBaseButton.propTypes = {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
-
var
|
|
9
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
10
10
|
var _InlineBaseButton = _interopRequireDefault(require("./InlineBaseButton"));
|
|
11
11
|
var _excluded = ["isExpanded"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -19,13 +19,11 @@ var InlineExpandButton = function InlineExpandButton(props) {
|
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_InlineBaseButton.default, _extends({
|
|
20
20
|
buttonType: "expand",
|
|
21
21
|
type: "button",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
})
|
|
22
|
+
className: isExpanded ? 'ffe-inline-button--expanded' : '',
|
|
23
|
+
rightIcon: /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
24
|
+
size: "md",
|
|
25
|
+
ariaLabel: ""
|
|
26
|
+
}, "expand_more")
|
|
29
27
|
}, rest));
|
|
30
28
|
};
|
|
31
29
|
InlineExpandButton.propTypes = {
|
package/lib/PrimaryButton.js
CHANGED
|
@@ -7,12 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
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; }
|
|
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; }
|
|
12
16
|
var PrimaryButton = function PrimaryButton(props) {
|
|
17
|
+
var leftIcon = props.leftIcon,
|
|
18
|
+
rightIcon = props.rightIcon,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
13
20
|
return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
|
|
14
|
-
buttonType: "primary"
|
|
15
|
-
|
|
21
|
+
buttonType: "primary",
|
|
22
|
+
leftIcon: leftIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
23
|
+
ariaLabel: "",
|
|
24
|
+
size: "sm"
|
|
25
|
+
}, leftIcon),
|
|
26
|
+
rightIcon: rightIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
27
|
+
ariaLabel: "",
|
|
28
|
+
size: "sm"
|
|
29
|
+
}, rightIcon)
|
|
30
|
+
}, rest));
|
|
16
31
|
};
|
|
17
32
|
PrimaryButton.propTypes = {
|
|
18
33
|
/** Aria label for loading indicator */
|
|
@@ -31,9 +46,9 @@ PrimaryButton.propTypes = {
|
|
|
31
46
|
})]),
|
|
32
47
|
/** Shows a loader if true */
|
|
33
48
|
isLoading: _propTypes.bool,
|
|
34
|
-
/**
|
|
35
|
-
leftIcon: _propTypes.
|
|
36
|
-
/**
|
|
37
|
-
rightIcon: _propTypes.
|
|
49
|
+
/** Name of icon shown to the left of the label */
|
|
50
|
+
leftIcon: _propTypes.string,
|
|
51
|
+
/** Name of icon shown to the right of the label */
|
|
52
|
+
rightIcon: _propTypes.string
|
|
38
53
|
};
|
|
39
54
|
var _default = exports.default = PrimaryButton;
|
package/lib/SecondaryButton.js
CHANGED
|
@@ -7,12 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
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; }
|
|
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; }
|
|
12
16
|
var SecondaryButton = function SecondaryButton(props) {
|
|
17
|
+
var leftIcon = props.leftIcon,
|
|
18
|
+
rightIcon = props.rightIcon,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
13
20
|
return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
|
|
14
|
-
buttonType: "secondary"
|
|
15
|
-
|
|
21
|
+
buttonType: "secondary",
|
|
22
|
+
leftIcon: leftIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
23
|
+
ariaLabel: "",
|
|
24
|
+
size: "sm"
|
|
25
|
+
}, leftIcon),
|
|
26
|
+
rightIcon: rightIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
27
|
+
ariaLabel: "",
|
|
28
|
+
size: "sm"
|
|
29
|
+
}, rightIcon)
|
|
30
|
+
}, rest));
|
|
16
31
|
};
|
|
17
32
|
SecondaryButton.propTypes = {
|
|
18
33
|
/** Aria label for loading indicator */
|
|
@@ -31,9 +46,9 @@ SecondaryButton.propTypes = {
|
|
|
31
46
|
})]),
|
|
32
47
|
/** Shows a loader if true */
|
|
33
48
|
isLoading: _propTypes.bool,
|
|
34
|
-
/**
|
|
35
|
-
leftIcon: _propTypes.
|
|
36
|
-
/**
|
|
37
|
-
rightIcon: _propTypes.
|
|
49
|
+
/** Name of icon shown to the left of the label */
|
|
50
|
+
leftIcon: _propTypes.string,
|
|
51
|
+
/** Name of icon shown to the right of the label */
|
|
52
|
+
rightIcon: _propTypes.string
|
|
38
53
|
};
|
|
39
54
|
var _default = exports.default = SecondaryButton;
|
package/lib/ShortcutButton.js
CHANGED
|
@@ -6,14 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
-
var _chevronIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/chevron-ikon"));
|
|
10
9
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
var ShortcutButton = function ShortcutButton(props) {
|
|
14
14
|
return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
|
|
15
15
|
buttonType: "shortcut",
|
|
16
|
-
rightIcon: /*#__PURE__*/_react.default.createElement(
|
|
16
|
+
rightIcon: /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
17
|
+
ariaLabel: "",
|
|
18
|
+
size: "md"
|
|
19
|
+
}, "chevron_right")
|
|
17
20
|
}, props));
|
|
18
21
|
};
|
|
19
22
|
ShortcutButton.propTypes = {
|
|
@@ -28,8 +31,6 @@ ShortcutButton.propTypes = {
|
|
|
28
31
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
29
32
|
innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
|
|
30
33
|
current: _propTypes.object
|
|
31
|
-
})])
|
|
32
|
-
/** Icon shown to the left of the label */
|
|
33
|
-
leftIcon: _propTypes.node
|
|
34
|
+
})])
|
|
34
35
|
};
|
|
35
36
|
var _default = exports.default = ShortcutButton;
|
package/lib/TaskButton.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
10
11
|
var _excluded = ["icon"];
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
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); }
|
|
@@ -17,7 +18,10 @@ var TaskButton = function TaskButton(_ref) {
|
|
|
17
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
19
|
return /*#__PURE__*/_react.default.createElement(_BaseButton.default, _extends({
|
|
19
20
|
buttonType: "task",
|
|
20
|
-
leftIcon:
|
|
21
|
+
leftIcon: /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
22
|
+
ariaLabel: "",
|
|
23
|
+
size: "sm"
|
|
24
|
+
}, icon)
|
|
21
25
|
}, rest));
|
|
22
26
|
};
|
|
23
27
|
TaskButton.propTypes = {
|
|
@@ -29,8 +33,8 @@ TaskButton.propTypes = {
|
|
|
29
33
|
disabled: _propTypes.bool,
|
|
30
34
|
/** The rendered element, like an `<a />` or `<Link />` */
|
|
31
35
|
element: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.string, _propTypes.elementType]),
|
|
32
|
-
/** Task icon,
|
|
33
|
-
icon: _propTypes.
|
|
36
|
+
/** Name of Task icon, shown to the left of the label */
|
|
37
|
+
icon: _propTypes.string.isRequired,
|
|
34
38
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
35
39
|
innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
|
|
36
40
|
current: _propTypes.object
|
package/lib/TertiaryButton.js
CHANGED
|
@@ -7,12 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _InlineBaseButton = _interopRequireDefault(require("./InlineBaseButton"));
|
|
10
|
+
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
|
+
var _excluded = ["leftIcon", "rightIcon"];
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
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; }
|
|
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; }
|
|
12
16
|
var TertiaryButton = function TertiaryButton(props) {
|
|
17
|
+
var leftIcon = props.leftIcon,
|
|
18
|
+
rightIcon = props.rightIcon,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
13
20
|
return /*#__PURE__*/_react.default.createElement(_InlineBaseButton.default, _extends({
|
|
14
|
-
buttonType: "tertiary"
|
|
15
|
-
|
|
21
|
+
buttonType: "tertiary",
|
|
22
|
+
leftIcon: leftIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
23
|
+
ariaLabel: "",
|
|
24
|
+
size: "sm"
|
|
25
|
+
}, leftIcon),
|
|
26
|
+
rightIcon: rightIcon && /*#__PURE__*/_react.default.createElement(_ffeSymbolsReact.default, {
|
|
27
|
+
ariaLabel: "",
|
|
28
|
+
size: "sm"
|
|
29
|
+
}, rightIcon)
|
|
30
|
+
}, rest));
|
|
16
31
|
};
|
|
17
32
|
TertiaryButton.propTypes = {
|
|
18
33
|
/** The button label */
|
|
@@ -25,9 +40,9 @@ TertiaryButton.propTypes = {
|
|
|
25
40
|
innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
|
|
26
41
|
current: _propTypes.object
|
|
27
42
|
})]),
|
|
28
|
-
/**
|
|
29
|
-
leftIcon: _propTypes.
|
|
30
|
-
/**
|
|
31
|
-
rightIcon: _propTypes.
|
|
43
|
+
/** Name of icon shown to the left of the label */
|
|
44
|
+
leftIcon: _propTypes.string,
|
|
45
|
+
/** Name of icon shown to the right of the label */
|
|
46
|
+
rightIcon: _propTypes.string
|
|
32
47
|
};
|
|
33
48
|
var _default = exports.default = TertiaryButton;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-buttons-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"description": "React implementation of ffe-buttons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"test:watch": "ffe-buildtool jest --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sb1/ffe-buttons": "^
|
|
32
|
-
"@sb1/ffe-
|
|
31
|
+
"@sb1/ffe-buttons": "^18.0.0",
|
|
32
|
+
"@sb1/ffe-symbols-react": "^2.0.1",
|
|
33
33
|
"classnames": "^2.3.1",
|
|
34
34
|
"prop-types": "^15.7.2"
|
|
35
35
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "45731cae0e1ac73920dc71426a4f9028ab431570"
|
|
50
50
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export type BaseButtonProps = {
|
|
|
11
11
|
ariaLoadingMessage?: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
isLoading?: boolean;
|
|
14
|
-
leftIcon?:
|
|
15
|
-
rightIcon?:
|
|
14
|
+
leftIcon?: string;
|
|
15
|
+
rightIcon?: string;
|
|
16
16
|
} & MinimalBaseButtonProps;
|
|
17
17
|
|
|
18
18
|
type ActionButtonProps = BaseButtonProps;
|
|
@@ -51,19 +51,18 @@ export type SecondaryButtonProps = BaseButtonProps;
|
|
|
51
51
|
export type ShortcutButtonProps = {
|
|
52
52
|
children?: React.ReactNode;
|
|
53
53
|
disabled?: boolean;
|
|
54
|
-
leftIcon?: React.ReactNode;
|
|
55
54
|
} & MinimalBaseButtonProps;
|
|
56
55
|
|
|
57
56
|
export type TaskButtonProps = {
|
|
58
57
|
children?: React.ReactNode;
|
|
59
58
|
disabled?: boolean;
|
|
60
|
-
icon:
|
|
59
|
+
icon: string;
|
|
61
60
|
} & MinimalBaseButtonProps;
|
|
62
61
|
|
|
63
62
|
export type TertiaryButtonProps = {
|
|
64
63
|
children?: React.ReactNode;
|
|
65
|
-
leftIcon?:
|
|
66
|
-
rightIcon?:
|
|
64
|
+
leftIcon?: string;
|
|
65
|
+
rightIcon?: string;
|
|
67
66
|
} & MinimalBaseButtonProps;
|
|
68
67
|
|
|
69
68
|
type NoInfer<T> = [T][T extends any ? 0 : never];
|