@gympass/yoga 7.86.0 → 7.87.1
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/cjs/Avatar/native/Avatar.js +1 -1
- package/cjs/Button/web/Button.js +26 -4
- package/cjs/Button/web/Icon.js +17 -7
- package/cjs/Button/web/Link.js +15 -12
- package/cjs/Button/web/Outline.js +2 -1
- package/cjs/Button/web/StyledButton.js +2 -1
- package/cjs/Button/web/Text.js +34 -1
- package/cjs/Spinner/web/Spinner.js +3 -2
- package/esm/Avatar/native/Avatar.js +14 -17
- package/esm/Button/web/Button.js +22 -4
- package/esm/Button/web/Button.test.js +1188 -585
- package/esm/Button/web/Icon.js +16 -7
- package/esm/Button/web/Link.js +11 -12
- package/esm/Button/web/Outline.js +2 -1
- package/esm/Button/web/StyledButton.js +2 -1
- package/esm/Button/web/Text.js +28 -1
- package/esm/Spinner/web/Spinner.js +3 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _yogaIcons=require("@gympass/yoga-icons");var _propTypes=require("prop-types");var _deprecatedReactNativePropTypes=require("deprecated-react-native-prop-types");var _reactNative=require("react-native");var _styledComponents=_interopRequireDefault(require("styled-components"));var _yogaCommon=require("@gympass/yoga-common");var _Box=_interopRequireDefault(require("../../Box"));var _Icon=_interopRequireDefault(require("../../Icon"));var _excluded=["icon","src","children","fill","stroke","borderRadius","width","height"];var _templateObject;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{"default":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj["default"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}var BORDER_WIDTH=
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _yogaIcons=require("@gympass/yoga-icons");var _propTypes=require("prop-types");var _deprecatedReactNativePropTypes=require("deprecated-react-native-prop-types");var _reactNative=require("react-native");var _styledComponents=_interopRequireDefault(require("styled-components"));var _yogaCommon=require("@gympass/yoga-common");var _Box=_interopRequireDefault(require("../../Box"));var _Icon=_interopRequireDefault(require("../../Icon"));var _excluded=["icon","src","children","fill","stroke","borderRadius","width","height"];var _templateObject;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{"default":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj["default"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}var BORDER_WIDTH=1;var BORDER_OPACITY=0.25;var BorderImage=(0,_styledComponents["default"])(_Box["default"]).attrs(function(_ref){var yoga=_ref.theme.yoga;return{borderColor:(0,_yogaCommon.hexToRgb)(yoga.colors.secondary,BORDER_OPACITY),borderWidth:BORDER_WIDTH};})(_templateObject||(_templateObject=(0,_taggedTemplateLiteralLoose2["default"])(["\n position: absolute;\n"])));var Content=function Content(_ref2){var icon=_ref2.icon,src=_ref2.src,fill=_ref2.fill,content=_ref2.content,stroke=_ref2.stroke;if(src){return _react["default"].createElement(_Box["default"],{as:_reactNative.Image,width:"100%",height:"100%",source:src});}if(content){return content;}return _react["default"].createElement(_Icon["default"],{as:icon,width:"50%",height:"50%",fill:fill,stroke:stroke});};var Avatar=(0,_react.forwardRef)(function(_ref3,ref){var _ref3$icon=_ref3.icon,icon=_ref3$icon===void 0?_yogaIcons.BuildingFilled:_ref3$icon,src=_ref3.src,children=_ref3.children,fill=_ref3.fill,stroke=_ref3.stroke,borderRadius=_ref3.borderRadius,width=_ref3.width,height=_ref3.height,props=(0,_objectWithoutProperties2["default"])(_ref3,_excluded);return _react["default"].createElement(_Box["default"],(0,_extends2["default"])({ref:ref,bgColor:"elements.selectionAndIcons",display:"flex",alignItems:"center",justifyContent:"center",width:width,height:height,overflow:"hidden",borderRadius:borderRadius},props),_react["default"].createElement(Content,{icon:icon,src:src,fill:fill,stroke:stroke,content:children}),_react["default"].createElement(BorderImage,{width:"100%",height:"100%",borderRadius:borderRadius}));});Content.propTypes=(0,_extends2["default"])({src:_deprecatedReactNativePropTypes.ImagePropTypes.source,icon:_propTypes.func,fill:_propTypes.string},_Box["default"].propTypes);Content.defaultProps={src:undefined,fill:'white',icon:_yogaIcons.BuildingFilled};Avatar.propTypes=(0,_extends2["default"])({src:_deprecatedReactNativePropTypes.ImagePropTypes.source,icon:_propTypes.func,fill:_propTypes.string,width:_propTypes.number,height:_propTypes.number,borderRadius:_propTypes.string},_Box["default"].propTypes);Avatar.defaultProps=(0,_extends2["default"])({src:undefined,fill:'white',width:48,height:48,borderRadius:'small'},_Box["default"].defaultProps);Avatar.displayName='Avatar';var _default=Avatar;exports["default"]=_default;
|
package/cjs/Button/web/Button.js
CHANGED
|
@@ -7,9 +7,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
10
12
|
var _StyledButton = _interopRequireDefault(require("./StyledButton"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _Spinner = _interopRequireDefault(require("../../Spinner"));
|
|
15
|
+
|
|
16
|
+
var _excluded = ["children", "onClick", "full", "disabled", "inverted", "small", "secondary", "icon", "isLoading"];
|
|
17
|
+
|
|
18
|
+
var _templateObject;
|
|
13
19
|
|
|
14
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
21
|
|
|
@@ -21,7 +27,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
21
27
|
|
|
22
28
|
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; }
|
|
23
29
|
|
|
30
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
31
|
+
|
|
32
|
+
var SpinnerContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
24
33
|
/** Buttons make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them. */
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
26
37
|
var children = _ref.children,
|
|
27
38
|
onClick = _ref.onClick,
|
|
@@ -31,6 +42,7 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
31
42
|
small = _ref.small,
|
|
32
43
|
secondary = _ref.secondary,
|
|
33
44
|
Icon = _ref.icon,
|
|
45
|
+
isLoading = _ref.isLoading,
|
|
34
46
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
35
47
|
|
|
36
48
|
var finalProps = _extends({}, props);
|
|
@@ -41,20 +53,28 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
41
53
|
|
|
42
54
|
return /*#__PURE__*/_react["default"].createElement(_StyledButton["default"], _extends({
|
|
43
55
|
ref: ref,
|
|
44
|
-
disabled: disabled,
|
|
56
|
+
disabled: disabled || isLoading,
|
|
45
57
|
"aria-disabled": disabled,
|
|
46
58
|
full: full,
|
|
47
59
|
inverted: inverted,
|
|
48
60
|
onClick: onClick,
|
|
49
61
|
small: small,
|
|
50
|
-
secondary: secondary
|
|
51
|
-
|
|
62
|
+
secondary: secondary,
|
|
63
|
+
isLoading: isLoading
|
|
64
|
+
}, finalProps), Icon && /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
65
|
+
role: "img"
|
|
66
|
+
}), children, isLoading && /*#__PURE__*/_react["default"].createElement(SpinnerContainer, null, /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
67
|
+
color: "deep",
|
|
68
|
+
size: small ? 'small' : 'medium'
|
|
69
|
+
})));
|
|
52
70
|
});
|
|
53
71
|
Button.propTypes = {
|
|
72
|
+
ariaLabel: _propTypes.string,
|
|
54
73
|
children: _propTypes.node,
|
|
55
74
|
disabled: _propTypes.bool,
|
|
56
75
|
full: _propTypes.bool,
|
|
57
76
|
inverted: _propTypes.bool,
|
|
77
|
+
isLoading: _propTypes.bool,
|
|
58
78
|
onClick: _propTypes.func,
|
|
59
79
|
small: _propTypes.bool,
|
|
60
80
|
secondary: _propTypes.bool,
|
|
@@ -64,10 +84,12 @@ Button.propTypes = {
|
|
|
64
84
|
href: _propTypes.string
|
|
65
85
|
};
|
|
66
86
|
Button.defaultProps = {
|
|
87
|
+
ariaLabel: undefined,
|
|
67
88
|
children: 'Button',
|
|
68
89
|
disabled: undefined,
|
|
69
90
|
full: false,
|
|
70
91
|
inverted: false,
|
|
92
|
+
isLoading: false,
|
|
71
93
|
onClick: function onClick() {},
|
|
72
94
|
small: false,
|
|
73
95
|
secondary: false,
|
package/cjs/Button/web/Icon.js
CHANGED
|
@@ -13,7 +13,9 @@ var _StyledButton = _interopRequireDefault(require("./StyledButton"));
|
|
|
13
13
|
|
|
14
14
|
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _Spinner = _interopRequireDefault(require("../../Spinner"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["icon", "theme", "small", "disabled", "isLoading"];
|
|
17
19
|
|
|
18
20
|
var _templateObject;
|
|
19
21
|
|
|
@@ -39,16 +41,22 @@ var ButtonIcon = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
39
41
|
button = _ref2.theme.yoga.components.button,
|
|
40
42
|
small = _ref2.small,
|
|
41
43
|
disabled = _ref2.disabled,
|
|
44
|
+
isLoading = _ref2.isLoading,
|
|
42
45
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
43
46
|
|
|
44
47
|
return /*#__PURE__*/_react["default"].createElement(IconStyled, _extends({}, props, {
|
|
45
48
|
ref: ref,
|
|
46
49
|
small: small,
|
|
47
|
-
disabled: disabled,
|
|
48
|
-
"aria-disabled": disabled
|
|
49
|
-
|
|
50
|
+
disabled: disabled || isLoading,
|
|
51
|
+
"aria-disabled": disabled,
|
|
52
|
+
isLoading: isLoading
|
|
53
|
+
}), isLoading ? /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
54
|
+
color: "deep",
|
|
55
|
+
size: small ? 'small' : 'medium'
|
|
56
|
+
}) : /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
50
57
|
as: icon,
|
|
51
|
-
size: small ? button.icon.size.small : button.icon.size["default"]
|
|
58
|
+
size: small ? button.icon.size.small : button.icon.size["default"],
|
|
59
|
+
role: "img"
|
|
52
60
|
}));
|
|
53
61
|
});
|
|
54
62
|
ButtonIcon.propTypes = {
|
|
@@ -56,14 +64,16 @@ ButtonIcon.propTypes = {
|
|
|
56
64
|
disabled: _propTypes.bool,
|
|
57
65
|
secondary: _propTypes.bool,
|
|
58
66
|
inverted: _propTypes.bool,
|
|
59
|
-
icon: (0, _propTypes.oneOfType)([_propTypes.node, _propTypes.func])
|
|
67
|
+
icon: (0, _propTypes.oneOfType)([_propTypes.node, _propTypes.func]),
|
|
68
|
+
isLoading: _propTypes.bool
|
|
60
69
|
};
|
|
61
70
|
ButtonIcon.defaultProps = {
|
|
62
71
|
small: false,
|
|
63
72
|
disabled: undefined,
|
|
64
73
|
secondary: false,
|
|
65
74
|
inverted: false,
|
|
66
|
-
icon: undefined
|
|
75
|
+
icon: undefined,
|
|
76
|
+
isLoading: false
|
|
67
77
|
};
|
|
68
78
|
ButtonIcon.displayName = 'Button.Icon';
|
|
69
79
|
|
package/cjs/Button/web/Link.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
|
|
@@ -13,15 +13,15 @@ var _yogaCommon = require("@gympass/yoga-common");
|
|
|
13
13
|
|
|
14
14
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
15
15
|
|
|
16
|
-
var _excluded = ["disabled"];
|
|
17
|
-
|
|
18
16
|
var _templateObject;
|
|
19
17
|
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
19
|
|
|
22
|
-
function
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
21
|
|
|
24
|
-
function
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
25
|
|
|
26
26
|
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
27
27
|
|
|
@@ -32,17 +32,20 @@ var Link = (0, _styledComponents["default"])(_Button["default"])(_templateObject
|
|
|
32
32
|
var state = secondary ? 'secondary' : 'primary';
|
|
33
33
|
return "\n height: unset;\n padding: 0;\n background-color: unset;\n border: none;\n border-radius: 0;\n color: " + button.types.link.font[state].color + ";\n\n svg {\n margin-right: " + button.types.link.icon.margin.right + "px;\n fill: " + button.types.link.font[state].color + ";\n }\n\n &:disabled,\n &:not([disabled]):hover,\n &:not([disabled]):focus,\n &:not([disabled]):active {\n box-shadow: unset;\n background-color: unset;\n }\n\n &:not([disabled]):hover {\n color: " + (0, _yogaCommon.hexToRgb)(button.types.link.font[state].color, 0.5) + ";\n\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(button.types.link.font[state].color, 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + (0, _yogaCommon.hexToRgb)(button.types.link.font[state].color, 0.75) + ";\n\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(button.types.link.font[state].color, 0.75) + ";\n }\n }\n\n &:disabled {\n color: " + button.types.link.font.disabled.color + ";\n\n svg {\n fill: " + button.types.link.font.disabled.color + ";\n }\n }\n\n " + (full ? 'width: 100%' : '') + "\n ";
|
|
34
34
|
});
|
|
35
|
+
var ButtonLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
36
|
+
var rest = _extends({}, _ref2);
|
|
35
37
|
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
var props = Object.fromEntries(Object.entries(rest).filter(function (_ref3) {
|
|
39
|
+
var key = _ref3[0];
|
|
40
|
+
return key !== 'isLoading';
|
|
41
|
+
}));
|
|
42
|
+
var disabled = props.disabled;
|
|
40
43
|
return /*#__PURE__*/_react["default"].createElement(Link, _extends({}, props, {
|
|
41
44
|
disabled: disabled,
|
|
42
|
-
"aria-disabled": disabled
|
|
45
|
+
"aria-disabled": disabled,
|
|
46
|
+
ref: ref
|
|
43
47
|
}));
|
|
44
|
-
};
|
|
45
|
-
|
|
48
|
+
});
|
|
46
49
|
ButtonLink.propTypes = {
|
|
47
50
|
disabled: _propTypes.bool,
|
|
48
51
|
secondary: _propTypes.bool,
|
|
@@ -18,11 +18,12 @@ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.s
|
|
|
18
18
|
var ButtonOutline = (0, _styledComponents["default"])(_Button["default"])(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
19
19
|
var inverted = _ref.inverted,
|
|
20
20
|
secondary = _ref.secondary,
|
|
21
|
+
isLoading = _ref.isLoading,
|
|
21
22
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
22
23
|
white = _ref$theme$yoga.colors.white,
|
|
23
24
|
outline = _ref$theme$yoga.components.button.types.outline;
|
|
24
25
|
var state = secondary ? 'secondary' : 'primary';
|
|
25
|
-
return "\n background-color: " + outline.backgroundColor["default"] + ";\n border: " + outline.border.width + "px solid;\n border-color: " + outline.font["default"][state].color + ";\n color: " + outline.font["default"][state].color + ";\n\n svg {\n fill: " + outline.font["default"][state].color + ";\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n background-color: " + outline.backgroundColor[state].hover + ";\n color: " + outline.font.hover.color + ";\n\n svg {\n fill: " + outline.font.hover.color + ";\n }\n }\n\n &:not([disabled]):active {\n background-color: " + outline.backgroundColor["default"] + ";\n border-color: " + outline.font.pressed[state].color + ";\n color: " + outline.font.pressed[state].color + ";\n box-shadow: none;\n\n svg {\n fill: " + outline.font.pressed[state].color + ";\n }\n }\n\n &:disabled {\n background-color: " + outline.backgroundColor["default"] + ";\n border-color: " + outline.font.disabled.color + ";\n color: " + outline.font.disabled.color + ";\n\n
|
|
26
|
+
return "\n background-color: " + outline.backgroundColor["default"] + ";\n border: " + outline.border.width + "px solid;\n border-color: " + outline.font["default"][state].color + ";\n color: " + outline.font["default"][state].color + ";\n\n svg {\n fill: " + outline.font["default"][state].color + ";\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n background-color: " + outline.backgroundColor[state].hover + ";\n color: " + outline.font.hover.color + ";\n\n svg {\n fill: " + outline.font.hover.color + ";\n }\n }\n\n &:not([disabled]):active {\n background-color: " + outline.backgroundColor["default"] + ";\n border-color: " + outline.font.pressed[state].color + ";\n color: " + outline.font.pressed[state].color + ";\n box-shadow: none;\n\n svg {\n fill: " + outline.font.pressed[state].color + ";\n }\n }\n\n &:disabled {\n background-color: " + outline.backgroundColor["default"] + ";\n border-color: " + outline.font.disabled.color + ";\n color: " + outline.font.disabled.color + ";\n\n svg {\n fill: " + outline.font.disabled.color + ";\n }\n }\n\n " + (inverted ? "\n border-color: " + white + ";\n color: " + white + ";\n\n svg {\n fill: " + white + ";\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n background-color: " + white + ";\n color: " + outline.font["default"][state].color + ";\n\n svg {\n fill: " + outline.font["default"][state].color + ";\n }\n }\n\n &:not([disabled]):active {\n background-color: " + outline.backgroundColor["default"] + ";\n border-color: " + (0, _yogaCommon.hexToRgb)(white, 0.75) + ";\n color: " + (0, _yogaCommon.hexToRgb)(white, 0.75) + ";\n\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(white, 0.75) + ";\n }\n }\n\n &:disabled {\n border-color: " + outline.font.disabled.color + ";\n color: " + outline.font.disabled.color + ";\n svg {\n fill: " + outline.font.disabled.color + ";\n }\n }\n " : '') + "\n\n " + (isLoading ? "\n &:disabled {\n color: transparent;\n\n svg {\n fill: transparent;\n }\n }\n " : '') + "\n ";
|
|
26
27
|
});
|
|
27
28
|
ButtonOutline.displayName = 'Button.Outline';
|
|
28
29
|
var _default = ButtonOutline;
|
|
@@ -19,11 +19,12 @@ var StyledButton = _styledComponents["default"].button(_templateObject || (_temp
|
|
|
19
19
|
inverted = _ref.inverted,
|
|
20
20
|
secondary = _ref.secondary,
|
|
21
21
|
disabled = _ref.disabled,
|
|
22
|
+
isLoading = _ref.isLoading,
|
|
22
23
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
23
24
|
baseFont = _ref$theme$yoga.baseFont,
|
|
24
25
|
button = _ref$theme$yoga.components.button;
|
|
25
26
|
var state = secondary ? 'secondary' : 'primary';
|
|
26
|
-
return "\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: " + (full ? '100%' : 'auto') + ";\n height: " + (small ? button.height.small : button.height["default"]) + "px;\n padding-left: " + (small ? button.padding.small.left : button.padding["default"].left) + "px;\n padding-right: " + (small ? button.padding.small.right : button.padding["default"].right) + "px;\n\n background-color: " + button.types.contained.backgroundColor[state]["default"] + ";\n border: none;\n border-radius: " + button.border.radius + "px;\n color: " + button.types.contained.font["default"].color + ";\n\n font-size: " + (small ? button.font.size.small : button.font.size["default"]) + "px;\n font-weight: " + button.font.weight + ";\n font-family: " + baseFont.family + ";\n letter-spacing: normal;\n line-height: 1;\n text-decoration: none;\n\n svg {\n width: " + (small ? button.icon.size.small : button.icon.size["default"]) + "px;\n height: " + (small ? button.icon.size.small : button.icon.size["default"]) + "px;\n fill: " + button.types.contained.font["default"].color + ";\n margin-right: " + button.icon.margin.right + "px;\n\n transition: fill 0.2s;\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n box-shadow: 0 4px 8px " + (0, _yogaCommon.hexToRgb)(button.types.contained.backgroundColor[state]["default"], 0.45) + ";\n }\n\n &:active {\n background-color: " + button.types.contained.backgroundColor[state].pressed + ";\n color: " + button.types.contained.font.pressed.color + ";\n\n svg {\n fill: " + button.types.contained.font.pressed.color + ";\n }\n }\n\n " + (disabled ? "\n \n background-color " + button.types.contained.backgroundColor.disabled + ";\n color: " + button.types.contained.font.disabled.color + ";\n pointer-events: none;\n\n svg {\n fill: " + button.types.contained.font.disabled.color + ";\n }\n\n cursor: not-allowed;\n \n " : '') + "\n
|
|
27
|
+
return "\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: " + (full ? '100%' : 'auto') + ";\n height: " + (small ? button.height.small : button.height["default"]) + "px;\n padding-left: " + (small ? button.padding.small.left : button.padding["default"].left) + "px;\n padding-right: " + (small ? button.padding.small.right : button.padding["default"].right) + "px;\n\n background-color: " + button.types.contained.backgroundColor[state]["default"] + ";\n border: none;\n border-radius: " + button.border.radius + "px;\n color: " + button.types.contained.font["default"].color + ";\n\n font-size: " + (small ? button.font.size.small : button.font.size["default"]) + "px;\n font-weight: " + button.font.weight + ";\n font-family: " + baseFont.family + ";\n letter-spacing: normal;\n line-height: 1;\n text-decoration: none;\n\n svg {\n width: " + (small ? button.icon.size.small : button.icon.size["default"]) + "px;\n height: " + (small ? button.icon.size.small : button.icon.size["default"]) + "px;\n fill: " + button.types.contained.font["default"].color + ";\n margin-right: " + button.icon.margin.right + "px;\n\n transition: fill 0.2s;\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n box-shadow: 0 4px 8px " + (0, _yogaCommon.hexToRgb)(button.types.contained.backgroundColor[state]["default"], 0.45) + ";\n }\n\n &:active {\n background-color: " + button.types.contained.backgroundColor[state].pressed + ";\n color: " + button.types.contained.font.pressed.color + ";\n\n svg {\n fill: " + button.types.contained.font.pressed.color + ";\n }\n }\n\n " + (disabled ? "\n \n background-color " + button.types.contained.backgroundColor.disabled + ";\n color: " + button.types.contained.font.disabled.color + ";\n pointer-events: none;\n\n svg {\n fill: " + button.types.contained.font.disabled.color + ";\n }\n\n cursor: not-allowed;\n \n " : '') + "\n\n " + (inverted ? "\n background-color: " + button.types.contained.font["default"].color + ";\n color: " + button.types.contained.backgroundColor[state]["default"] + ";\n\n svg {\n fill: " + button.types.contained.backgroundColor[state]["default"] + ";\n }\n\n &:active {\n background-color: " + (0, _yogaCommon.hexToRgb)(button.types.contained.font["default"].color, 0.75) + ";\n color: " + button.types.contained.backgroundColor[state].pressed + ";\n\n svg {\n fill: " + button.types.contained.backgroundColor[state].pressed + ";\n }\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus {\n box-shadow: 0 4px 8px " + (0, _yogaCommon.hexToRgb)(button.types.contained.font["default"].color, 0.45) + ";\n }\n " : '') + "\n\n " + (isLoading ? "\n position: relative;\n color: transparent;\n " : '') + "\n\n " + (isLoading && inverted || isLoading && disabled ? "\n svg {\n fill: transparent;\n }\n " : '') + "\n ";
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
var _default = StyledButton;
|
package/cjs/Button/web/Text.js
CHANGED
|
@@ -3,19 +3,29 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
5
|
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
6
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
9
|
|
|
8
10
|
var _yogaCommon = require("@gympass/yoga-common");
|
|
9
11
|
|
|
12
|
+
var _propTypes = require("prop-types");
|
|
13
|
+
|
|
10
14
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
11
15
|
|
|
12
16
|
var _templateObject;
|
|
13
17
|
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
19
|
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
16
26
|
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
17
27
|
|
|
18
|
-
var
|
|
28
|
+
var StyledButton = (0, _styledComponents["default"])(_Button["default"])(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
19
29
|
var secondary = _ref.secondary,
|
|
20
30
|
inverted = _ref.inverted,
|
|
21
31
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
@@ -24,6 +34,29 @@ var ButtonText = (0, _styledComponents["default"])(_Button["default"])(_template
|
|
|
24
34
|
var state = secondary ? 'secondary' : 'primary';
|
|
25
35
|
return "\n background-color: " + button.types.text.backgroundColor + ";\n border-color: " + button.types.text.backgroundColor + ";\n color: " + colors[state] + ";\n\n svg {\n fill: " + colors[state] + ";\n }\n\n &:not([disabled]):hover, &:not([disabled]):focus, &:not([disabled]):active {\n background-color: " + button.types.text.backgroundColor + ";\n box-shadow: none;\n }\n\n &:not([disabled]):hover {\n color: " + (0, _yogaCommon.hexToRgb)(colors[state], 0.5) + ";\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(colors[state], 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + (0, _yogaCommon.hexToRgb)(colors[state], 0.75) + ";\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(colors[state], 0.75) + ";\n }\n }\n\n " + (inverted ? "\n color: " + colors.white + ";\n svg {\n fill: " + colors.white + ";\n }\n\n &:not([disabled]):hover {\n color: " + (0, _yogaCommon.hexToRgb)(colors.white, 0.5) + ";\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(colors.white, 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + (0, _yogaCommon.hexToRgb)(colors.white, 0.75) + ";\n svg {\n fill: " + (0, _yogaCommon.hexToRgb)(colors.white, 0.75) + ";\n }\n }\n " : '') + "\n\n &:disabled {\n background-color: " + button.types.text.backgroundColor + ";\n border-color: " + button.types.text.backgroundColor + ";\n color: " + button.types.text.disabled + ";\n svg {\n fill: " + button.types.text.disabled + ";\n }\n }\n ";
|
|
26
36
|
});
|
|
37
|
+
var ButtonText = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
38
|
+
var rest = _extends({}, _ref2);
|
|
39
|
+
|
|
40
|
+
var props = Object.fromEntries(Object.entries(rest).filter(function (_ref3) {
|
|
41
|
+
var key = _ref3[0];
|
|
42
|
+
return key !== 'isLoading';
|
|
43
|
+
}));
|
|
44
|
+
var secondary = props.secondary,
|
|
45
|
+
inverted = props.inverted;
|
|
46
|
+
return /*#__PURE__*/_react["default"].createElement(StyledButton, _extends({}, props, {
|
|
47
|
+
secondary: secondary,
|
|
48
|
+
inverted: inverted,
|
|
49
|
+
ref: ref
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
ButtonText.propTypes = {
|
|
53
|
+
inverted: _propTypes.bool,
|
|
54
|
+
secondary: _propTypes.bool
|
|
55
|
+
};
|
|
56
|
+
ButtonText.defaultProps = {
|
|
57
|
+
inverted: false,
|
|
58
|
+
secondary: false
|
|
59
|
+
};
|
|
27
60
|
ButtonText.displayName = 'Button.Text';
|
|
28
61
|
var _default = ButtonText;
|
|
29
62
|
exports["default"] = _default;
|
|
@@ -24,7 +24,7 @@ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.s
|
|
|
24
24
|
var StyledSpinner = _styledComponents["default"].span(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
25
25
|
var color = _ref.color,
|
|
26
26
|
size = _ref.size;
|
|
27
|
-
return "\n .spinner {\n display: inline-block;\n width: " + size + "px;\n height: " + size + "px;\n color: " + color + ";\n animation: 1.4s linear 0s infinite normal none running rotation;\n }\n
|
|
27
|
+
return "\n .spinner {\n display: inline-block;\n width: " + size + "px;\n height: " + size + "px;\n color: " + color + ";\n animation: 1.4s linear 0s infinite normal none running rotation;\n }\n .circular {\n display: block;\n height: 100%;\n width: 100%;\n }\n .path {\n stroke-dasharray: 80px, 200px;\n stroke-dashoffset: 0;\n -webkit-animation: 1.4s ease-in-out 0s infinite normal none running dash;\n animation: 1.6s ease-in-out 0s infinite normal none running dash;\n stroke-linecap: round;\n stroke: " + color + ";\n }\n @keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n @keyframes dash {\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n }\n ";
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
var Spinner = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
@@ -34,7 +34,8 @@ var Spinner = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
34
34
|
return /*#__PURE__*/_react["default"].createElement(StyledSpinner, {
|
|
35
35
|
color: (0, _lodash["default"])(theme.yoga.colors, color, color),
|
|
36
36
|
size: (0, _lodash["default"])(theme.yoga.spacing, size, size),
|
|
37
|
-
ref: ref
|
|
37
|
+
ref: ref,
|
|
38
|
+
"aria-label": "loading-icon"
|
|
38
39
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
39
40
|
className: "spinner"
|
|
40
41
|
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
@@ -12,19 +12,20 @@ import React, { forwardRef } from 'react';
|
|
|
12
12
|
import { BuildingFilled } from '@gympass/yoga-icons';
|
|
13
13
|
import { string, func, number } from 'prop-types';
|
|
14
14
|
import { ImagePropTypes } from 'deprecated-react-native-prop-types';
|
|
15
|
-
import { Image
|
|
15
|
+
import { Image } from 'react-native';
|
|
16
16
|
import styled from 'styled-components';
|
|
17
17
|
import { hexToRgb } from '@gympass/yoga-common';
|
|
18
18
|
import Box from '../../Box';
|
|
19
19
|
import Icon from '../../Icon';
|
|
20
|
-
var BORDER_WIDTH =
|
|
20
|
+
var BORDER_WIDTH = 1;
|
|
21
21
|
var BORDER_OPACITY = 0.25;
|
|
22
|
-
var
|
|
22
|
+
var BorderImage = styled(Box).attrs(function (_ref) {
|
|
23
23
|
var yoga = _ref.theme.yoga;
|
|
24
24
|
return {
|
|
25
|
-
|
|
25
|
+
borderColor: hexToRgb(yoga.colors.secondary, BORDER_OPACITY),
|
|
26
|
+
borderWidth: BORDER_WIDTH
|
|
26
27
|
};
|
|
27
|
-
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n
|
|
28
|
+
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n position: absolute;\n"])));
|
|
28
29
|
|
|
29
30
|
var Content = function Content(_ref2) {
|
|
30
31
|
var icon = _ref2.icon,
|
|
@@ -72,22 +73,14 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
72
73
|
height = _ref3.height,
|
|
73
74
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
74
75
|
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
-
width: width,
|
|
77
|
-
height: height,
|
|
78
|
-
borderRadius: borderRadius,
|
|
79
|
-
display: "flex",
|
|
80
|
-
alignItems: "center",
|
|
81
|
-
justifyContent: "center",
|
|
82
|
-
overflow: "hidden"
|
|
83
|
-
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
76
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
84
77
|
ref: ref,
|
|
85
78
|
bgColor: "elements.selectionAndIcons",
|
|
86
79
|
display: "flex",
|
|
87
80
|
alignItems: "center",
|
|
88
81
|
justifyContent: "center",
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
82
|
+
width: width,
|
|
83
|
+
height: height,
|
|
91
84
|
overflow: "hidden",
|
|
92
85
|
borderRadius: borderRadius
|
|
93
86
|
}, props), /*#__PURE__*/React.createElement(Content, {
|
|
@@ -96,7 +89,11 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
96
89
|
fill: fill,
|
|
97
90
|
stroke: stroke,
|
|
98
91
|
content: children
|
|
99
|
-
})
|
|
92
|
+
}), /*#__PURE__*/React.createElement(BorderImage, {
|
|
93
|
+
width: "100%",
|
|
94
|
+
height: "100%",
|
|
95
|
+
borderRadius: borderRadius
|
|
96
|
+
}));
|
|
100
97
|
});
|
|
101
98
|
Content.propTypes = _extends({
|
|
102
99
|
src: ImagePropTypes.source,
|
package/esm/Button/web/Button.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
var _excluded = ["children", "onClick", "full", "disabled", "inverted", "small", "secondary", "icon"];
|
|
1
|
+
var _excluded = ["children", "onClick", "full", "disabled", "inverted", "small", "secondary", "icon", "isLoading"];
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
2
4
|
|
|
3
5
|
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
6
|
|
|
5
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
8
|
|
|
9
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
10
|
+
|
|
7
11
|
import React, { forwardRef } from 'react';
|
|
8
12
|
import { func, node, oneOfType, bool, string } from 'prop-types';
|
|
13
|
+
import styled from 'styled-components';
|
|
9
14
|
import StyledButton from './StyledButton';
|
|
15
|
+
import Spinner from '../../Spinner';
|
|
16
|
+
var SpinnerContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
10
17
|
/** Buttons make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them. */
|
|
11
18
|
|
|
12
19
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -18,6 +25,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18
25
|
small = _ref.small,
|
|
19
26
|
secondary = _ref.secondary,
|
|
20
27
|
Icon = _ref.icon,
|
|
28
|
+
isLoading = _ref.isLoading,
|
|
21
29
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
30
|
|
|
23
31
|
var finalProps = _extends({}, props);
|
|
@@ -28,20 +36,28 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
28
36
|
|
|
29
37
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
30
38
|
ref: ref,
|
|
31
|
-
disabled: disabled,
|
|
39
|
+
disabled: disabled || isLoading,
|
|
32
40
|
"aria-disabled": disabled,
|
|
33
41
|
full: full,
|
|
34
42
|
inverted: inverted,
|
|
35
43
|
onClick: onClick,
|
|
36
44
|
small: small,
|
|
37
|
-
secondary: secondary
|
|
38
|
-
|
|
45
|
+
secondary: secondary,
|
|
46
|
+
isLoading: isLoading
|
|
47
|
+
}, finalProps), Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
+
role: "img"
|
|
49
|
+
}), children, isLoading && /*#__PURE__*/React.createElement(SpinnerContainer, null, /*#__PURE__*/React.createElement(Spinner, {
|
|
50
|
+
color: "deep",
|
|
51
|
+
size: small ? 'small' : 'medium'
|
|
52
|
+
})));
|
|
39
53
|
});
|
|
40
54
|
Button.propTypes = {
|
|
55
|
+
ariaLabel: string,
|
|
41
56
|
children: node,
|
|
42
57
|
disabled: bool,
|
|
43
58
|
full: bool,
|
|
44
59
|
inverted: bool,
|
|
60
|
+
isLoading: bool,
|
|
45
61
|
onClick: func,
|
|
46
62
|
small: bool,
|
|
47
63
|
secondary: bool,
|
|
@@ -51,10 +67,12 @@ Button.propTypes = {
|
|
|
51
67
|
href: string
|
|
52
68
|
};
|
|
53
69
|
Button.defaultProps = {
|
|
70
|
+
ariaLabel: undefined,
|
|
54
71
|
children: 'Button',
|
|
55
72
|
disabled: undefined,
|
|
56
73
|
full: false,
|
|
57
74
|
inverted: false,
|
|
75
|
+
isLoading: false,
|
|
58
76
|
onClick: function onClick() {},
|
|
59
77
|
small: false,
|
|
60
78
|
secondary: false,
|