@sb1/ffe-buttons-react 19.0.0 → 20.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/ExpandButton.js +2 -16
- package/lib/ExpandButton.js +2 -16
- package/package.json +2 -2
- package/types/index.d.ts +0 -2
package/es/ExpandButton.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded"
|
|
1
|
+
var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded"];
|
|
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; }
|
|
@@ -13,8 +13,6 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
13
13
|
Element = props.element,
|
|
14
14
|
innerRef = props.innerRef,
|
|
15
15
|
isExpanded = props.isExpanded,
|
|
16
|
-
leftIcon = props.leftIcon,
|
|
17
|
-
rightIcon = props.rightIcon,
|
|
18
16
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
17
|
return /*#__PURE__*/React.createElement(Element, _extends({
|
|
20
18
|
"aria-expanded": isExpanded,
|
|
@@ -28,15 +26,7 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
28
26
|
ariaLabel: "",
|
|
29
27
|
size: "sm",
|
|
30
28
|
weight: 300
|
|
31
|
-
}, "close"), !isExpanded && /*#__PURE__*/React.createElement("span", null,
|
|
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)));
|
|
29
|
+
}, "close"), !isExpanded && /*#__PURE__*/React.createElement("span", null, children));
|
|
40
30
|
};
|
|
41
31
|
ExpandButton.propTypes = {
|
|
42
32
|
/** The button label */
|
|
@@ -47,10 +37,6 @@ ExpandButton.propTypes = {
|
|
|
47
37
|
element: oneOfType([func, string, elementType]),
|
|
48
38
|
/** An accessible label for the close-button, only shown in the "isExpanded" state */
|
|
49
39
|
closeLabel: string,
|
|
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,
|
|
54
40
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
55
41
|
innerRef: oneOfType([func, shape({
|
|
56
42
|
current: object
|
package/lib/ExpandButton.js
CHANGED
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _ffeSymbolsReact = _interopRequireDefault(require("@sb1/ffe-symbols-react"));
|
|
11
|
-
var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded"
|
|
11
|
+
var _excluded = ["children", "className", "closeLabel", "element", "innerRef", "isExpanded"];
|
|
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); }
|
|
14
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; }
|
|
@@ -20,8 +20,6 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
20
20
|
Element = props.element,
|
|
21
21
|
innerRef = props.innerRef,
|
|
22
22
|
isExpanded = props.isExpanded,
|
|
23
|
-
leftIcon = props.leftIcon,
|
|
24
|
-
rightIcon = props.rightIcon,
|
|
25
23
|
rest = _objectWithoutProperties(props, _excluded);
|
|
26
24
|
return /*#__PURE__*/_react.default.createElement(Element, _extends({
|
|
27
25
|
"aria-expanded": isExpanded,
|
|
@@ -35,15 +33,7 @@ var ExpandButton = function ExpandButton(props) {
|
|
|
35
33
|
ariaLabel: "",
|
|
36
34
|
size: "sm",
|
|
37
35
|
weight: 300
|
|
38
|
-
}, "close"), !isExpanded && /*#__PURE__*/_react.default.createElement("span", null,
|
|
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)));
|
|
36
|
+
}, "close"), !isExpanded && /*#__PURE__*/_react.default.createElement("span", null, children));
|
|
47
37
|
};
|
|
48
38
|
ExpandButton.propTypes = {
|
|
49
39
|
/** The button label */
|
|
@@ -54,10 +44,6 @@ ExpandButton.propTypes = {
|
|
|
54
44
|
element: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.string, _propTypes.elementType]),
|
|
55
45
|
/** An accessible label for the close-button, only shown in the "isExpanded" state */
|
|
56
46
|
closeLabel: _propTypes.string,
|
|
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,
|
|
61
47
|
/** Ref-setting function, or ref created by useRef, passed to the button element */
|
|
62
48
|
innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
|
|
63
49
|
current: _propTypes.object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-buttons-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
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": "
|
|
49
|
+
"gitHead": "ff700bb3ff7a1068b7d0c80a288c25f6e1e6e213"
|
|
50
50
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -31,8 +31,6 @@ export interface ButtonGroupProps {
|
|
|
31
31
|
export type ExpandButtonProps = {
|
|
32
32
|
children: React.ReactNode;
|
|
33
33
|
closeLabel?: string;
|
|
34
|
-
leftIcon?: React.ReactNode;
|
|
35
|
-
rightIcon?: React.ReactNode;
|
|
36
34
|
isExpanded: boolean;
|
|
37
35
|
onClick: (e: React.MouseEvent | undefined) => void;
|
|
38
36
|
} & MinimalBaseButtonProps;
|