@gympass/yoga 7.85.1 → 7.87.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/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/Spinner.theme.js +11 -0
- package/cjs/Spinner/index.js +11 -0
- package/cjs/Spinner/web/Spinner.js +66 -0
- package/cjs/Spinner/web/index.js +11 -0
- package/cjs/Theme/theme/theme.js +3 -0
- package/cjs/index.js +4 -0
- 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/Spinner.theme.js +5 -0
- package/esm/Spinner/index.js +2 -0
- package/esm/Spinner/web/Spinner.js +46 -0
- package/esm/Spinner/web/Spinner.test.js +14 -0
- package/esm/Spinner/web/index.js +2 -0
- package/esm/Theme/theme/theme.js +2 -0
- package/esm/index.js +2 -1
- package/package.json +4 -10
package/esm/Button/web/Icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["icon", "theme", "small", "disabled"];
|
|
1
|
+
var _excluded = ["icon", "theme", "small", "disabled", "isLoading"];
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
@@ -13,6 +13,7 @@ import { oneOfType, func, node, bool } from 'prop-types';
|
|
|
13
13
|
import styled, { withTheme } from 'styled-components';
|
|
14
14
|
import StyledButton from './StyledButton';
|
|
15
15
|
import Icon from '../../Icon';
|
|
16
|
+
import Spinner from '../../Spinner';
|
|
16
17
|
var IconStyled = styled(StyledButton)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n padding: 0;\n\n svg {\n width: unset;\n height: unset;\n margin-right: unset;\n\n transition: fill 0.2s;\n }\n\n ", "\n"])), function (_ref) {
|
|
17
18
|
var small = _ref.small,
|
|
18
19
|
button = _ref.theme.yoga.components.button;
|
|
@@ -23,16 +24,22 @@ var ButtonIcon = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
23
24
|
button = _ref2.theme.yoga.components.button,
|
|
24
25
|
small = _ref2.small,
|
|
25
26
|
disabled = _ref2.disabled,
|
|
27
|
+
isLoading = _ref2.isLoading,
|
|
26
28
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
27
29
|
|
|
28
30
|
return /*#__PURE__*/React.createElement(IconStyled, _extends({}, props, {
|
|
29
31
|
ref: ref,
|
|
30
32
|
small: small,
|
|
31
|
-
disabled: disabled,
|
|
32
|
-
"aria-disabled": disabled
|
|
33
|
-
|
|
33
|
+
disabled: disabled || isLoading,
|
|
34
|
+
"aria-disabled": disabled,
|
|
35
|
+
isLoading: isLoading
|
|
36
|
+
}), isLoading ? /*#__PURE__*/React.createElement(Spinner, {
|
|
37
|
+
color: "deep",
|
|
38
|
+
size: small ? 'small' : 'medium'
|
|
39
|
+
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
34
40
|
as: icon,
|
|
35
|
-
size: small ? button.icon.size.small : button.icon.size["default"]
|
|
41
|
+
size: small ? button.icon.size.small : button.icon.size["default"],
|
|
42
|
+
role: "img"
|
|
36
43
|
}));
|
|
37
44
|
});
|
|
38
45
|
ButtonIcon.propTypes = {
|
|
@@ -40,14 +47,16 @@ ButtonIcon.propTypes = {
|
|
|
40
47
|
disabled: bool,
|
|
41
48
|
secondary: bool,
|
|
42
49
|
inverted: bool,
|
|
43
|
-
icon: oneOfType([node, func])
|
|
50
|
+
icon: oneOfType([node, func]),
|
|
51
|
+
isLoading: bool
|
|
44
52
|
};
|
|
45
53
|
ButtonIcon.defaultProps = {
|
|
46
54
|
small: false,
|
|
47
55
|
disabled: undefined,
|
|
48
56
|
secondary: false,
|
|
49
57
|
inverted: false,
|
|
50
|
-
icon: undefined
|
|
58
|
+
icon: undefined,
|
|
59
|
+
isLoading: false
|
|
51
60
|
};
|
|
52
61
|
ButtonIcon.displayName = 'Button.Icon';
|
|
53
62
|
export default withTheme(ButtonIcon);
|
package/esm/Button/web/Link.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
var _excluded = ["disabled"];
|
|
2
|
-
|
|
3
1
|
var _templateObject;
|
|
4
2
|
|
|
5
3
|
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); }
|
|
6
4
|
|
|
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; }
|
|
8
|
-
|
|
9
5
|
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
10
6
|
|
|
11
|
-
import React from 'react';
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
12
8
|
import { bool, string, oneOfType, node, func } from 'prop-types';
|
|
13
9
|
import styled from 'styled-components';
|
|
14
10
|
import { hexToRgb } from '@gympass/yoga-common';
|
|
@@ -20,17 +16,20 @@ var Link = styled(Button)(_templateObject || (_templateObject = _taggedTemplateL
|
|
|
20
16
|
var state = secondary ? 'secondary' : 'primary';
|
|
21
17
|
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: " + hexToRgb(button.types.link.font[state].color, 0.5) + ";\n\n svg {\n fill: " + hexToRgb(button.types.link.font[state].color, 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + hexToRgb(button.types.link.font[state].color, 0.75) + ";\n\n svg {\n fill: " + 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 ";
|
|
22
18
|
});
|
|
19
|
+
var ButtonLink = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
20
|
+
var rest = _extends({}, _ref2);
|
|
23
21
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
var props = Object.fromEntries(Object.entries(rest).filter(function (_ref3) {
|
|
23
|
+
var key = _ref3[0];
|
|
24
|
+
return key !== 'isLoading';
|
|
25
|
+
}));
|
|
26
|
+
var disabled = props.disabled;
|
|
28
27
|
return /*#__PURE__*/React.createElement(Link, _extends({}, props, {
|
|
29
28
|
disabled: disabled,
|
|
30
|
-
"aria-disabled": disabled
|
|
29
|
+
"aria-disabled": disabled,
|
|
30
|
+
ref: ref
|
|
31
31
|
}));
|
|
32
|
-
};
|
|
33
|
-
|
|
32
|
+
});
|
|
34
33
|
ButtonLink.propTypes = {
|
|
35
34
|
disabled: bool,
|
|
36
35
|
secondary: bool,
|
|
@@ -8,11 +8,12 @@ import Button from './Button';
|
|
|
8
8
|
var ButtonOutline = styled(Button)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
9
9
|
var inverted = _ref.inverted,
|
|
10
10
|
secondary = _ref.secondary,
|
|
11
|
+
isLoading = _ref.isLoading,
|
|
11
12
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
12
13
|
white = _ref$theme$yoga.colors.white,
|
|
13
14
|
outline = _ref$theme$yoga.components.button.types.outline;
|
|
14
15
|
var state = secondary ? 'secondary' : 'primary';
|
|
15
|
-
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
|
|
16
|
+
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: " + hexToRgb(white, 0.75) + ";\n color: " + hexToRgb(white, 0.75) + ";\n\n svg {\n fill: " + 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 ";
|
|
16
17
|
});
|
|
17
18
|
ButtonOutline.displayName = 'Button.Outline';
|
|
18
19
|
export default ButtonOutline;
|
|
@@ -10,10 +10,11 @@ var StyledButton = styled.button(_templateObject || (_templateObject = _taggedTe
|
|
|
10
10
|
inverted = _ref.inverted,
|
|
11
11
|
secondary = _ref.secondary,
|
|
12
12
|
disabled = _ref.disabled,
|
|
13
|
+
isLoading = _ref.isLoading,
|
|
13
14
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
14
15
|
baseFont = _ref$theme$yoga.baseFont,
|
|
15
16
|
button = _ref$theme$yoga.components.button;
|
|
16
17
|
var state = secondary ? 'secondary' : 'primary';
|
|
17
|
-
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 " + 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
|
|
18
|
+
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 " + 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: " + 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 " + 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 ";
|
|
18
19
|
});
|
|
19
20
|
export default StyledButton;
|
package/esm/Button/web/Text.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
|
|
3
|
+
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
|
+
|
|
3
5
|
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
6
|
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
5
8
|
import styled from 'styled-components';
|
|
6
9
|
import { hexToRgb } from '@gympass/yoga-common';
|
|
10
|
+
import { bool } from 'prop-types';
|
|
7
11
|
import Button from './Button';
|
|
8
|
-
var
|
|
12
|
+
var StyledButton = styled(Button)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
9
13
|
var secondary = _ref.secondary,
|
|
10
14
|
inverted = _ref.inverted,
|
|
11
15
|
_ref$theme$yoga = _ref.theme.yoga,
|
|
@@ -14,5 +18,28 @@ var ButtonText = styled(Button)(_templateObject || (_templateObject = _taggedTem
|
|
|
14
18
|
var state = secondary ? 'secondary' : 'primary';
|
|
15
19
|
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: " + hexToRgb(colors[state], 0.5) + ";\n svg {\n fill: " + hexToRgb(colors[state], 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + hexToRgb(colors[state], 0.75) + ";\n svg {\n fill: " + 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: " + hexToRgb(colors.white, 0.5) + ";\n svg {\n fill: " + hexToRgb(colors.white, 0.5) + ";\n }\n }\n\n &:not([disabled]):focus, &:not([disabled]):active {\n color: " + hexToRgb(colors.white, 0.75) + ";\n svg {\n fill: " + 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 ";
|
|
16
20
|
});
|
|
21
|
+
var ButtonText = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
22
|
+
var rest = _extends({}, _ref2);
|
|
23
|
+
|
|
24
|
+
var props = Object.fromEntries(Object.entries(rest).filter(function (_ref3) {
|
|
25
|
+
var key = _ref3[0];
|
|
26
|
+
return key !== 'isLoading';
|
|
27
|
+
}));
|
|
28
|
+
var secondary = props.secondary,
|
|
29
|
+
inverted = props.inverted;
|
|
30
|
+
return /*#__PURE__*/React.createElement(StyledButton, _extends({}, props, {
|
|
31
|
+
secondary: secondary,
|
|
32
|
+
inverted: inverted,
|
|
33
|
+
ref: ref
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
ButtonText.propTypes = {
|
|
37
|
+
inverted: bool,
|
|
38
|
+
secondary: bool
|
|
39
|
+
};
|
|
40
|
+
ButtonText.defaultProps = {
|
|
41
|
+
inverted: false,
|
|
42
|
+
secondary: false
|
|
43
|
+
};
|
|
17
44
|
ButtonText.displayName = 'Button.Text';
|
|
18
45
|
export default ButtonText;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import styled, { withTheme } from 'styled-components';
|
|
7
|
+
import { oneOf, string, oneOfType, number } from 'prop-types';
|
|
8
|
+
import get from 'lodash.get';
|
|
9
|
+
var StyledSpinner = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
10
|
+
var color = _ref.color,
|
|
11
|
+
size = _ref.size;
|
|
12
|
+
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 ";
|
|
13
|
+
});
|
|
14
|
+
var Spinner = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
15
|
+
var size = _ref2.size,
|
|
16
|
+
color = _ref2.color,
|
|
17
|
+
theme = _ref2.theme;
|
|
18
|
+
return /*#__PURE__*/React.createElement(StyledSpinner, {
|
|
19
|
+
color: get(theme.yoga.colors, color, color),
|
|
20
|
+
size: get(theme.yoga.spacing, size, size),
|
|
21
|
+
ref: ref,
|
|
22
|
+
"aria-label": "loading-icon"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
24
|
+
className: "spinner"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
26
|
+
className: "circular",
|
|
27
|
+
viewBox: "22 22 44 44"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
29
|
+
className: "path",
|
|
30
|
+
fill: "none",
|
|
31
|
+
strokeWidth: "3.6",
|
|
32
|
+
cx: "44",
|
|
33
|
+
cy: "44",
|
|
34
|
+
r: "20.2"
|
|
35
|
+
}))));
|
|
36
|
+
});
|
|
37
|
+
var commonSizes = ['xxxsmall', 'xxsmall', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'xxxlarge', 'huge', 'xhuge'];
|
|
38
|
+
Spinner.propTypes = {
|
|
39
|
+
size: oneOfType([oneOf(commonSizes), string, number]),
|
|
40
|
+
color: string
|
|
41
|
+
};
|
|
42
|
+
Spinner.defaultProps = {
|
|
43
|
+
size: 'medium',
|
|
44
|
+
color: 'primary'
|
|
45
|
+
};
|
|
46
|
+
export default withTheme(Spinner);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { ThemeProvider, Spinner } from '../..';
|
|
4
|
+
describe('<Spinner />', function () {
|
|
5
|
+
it('should match snapshot', function () {
|
|
6
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Spinner, {
|
|
7
|
+
size: "xxxlarge",
|
|
8
|
+
color: "light"
|
|
9
|
+
}))),
|
|
10
|
+
container = _render.container;
|
|
11
|
+
|
|
12
|
+
expect(container).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
});
|
package/esm/Theme/theme/theme.js
CHANGED
|
@@ -35,6 +35,7 @@ import _componentThemes_Result$Result from "./../../Result/Result.theme.js";
|
|
|
35
35
|
import _componentThemes_Skeleton$Skeleton from "./../../Skeleton/Skeleton.theme.js";
|
|
36
36
|
import _componentThemes_Slider$Slider from "./../../Slider/Slider.theme.js";
|
|
37
37
|
import _componentThemes_Snackbar$Snackbar from "./../../Snackbar/Snackbar.theme.js";
|
|
38
|
+
import _componentThemes_Spinner$Spinner from "./../../Spinner/Spinner.theme.js";
|
|
38
39
|
import _componentThemes_Stepper$Stepper from "./../../Stepper/Stepper.theme.js";
|
|
39
40
|
import _componentThemes_Tag$Tag from "./../../Tag/Tag.theme.js";
|
|
40
41
|
import _componentThemes_Text$Text from "./../../Text/Text.theme.js";
|
|
@@ -73,6 +74,7 @@ var componentThemes = {
|
|
|
73
74
|
Skeleton$Skeleton: _componentThemes_Skeleton$Skeleton,
|
|
74
75
|
Slider$Slider: _componentThemes_Slider$Slider,
|
|
75
76
|
Snackbar$Snackbar: _componentThemes_Snackbar$Snackbar,
|
|
77
|
+
Spinner$Spinner: _componentThemes_Spinner$Spinner,
|
|
76
78
|
Stepper$Stepper: _componentThemes_Stepper$Stepper,
|
|
77
79
|
Tag$Tag: _componentThemes_Tag$Tag,
|
|
78
80
|
Text$Text: _componentThemes_Text$Text,
|
package/esm/index.js
CHANGED
|
@@ -34,4 +34,5 @@ import Drawer from './Drawer';
|
|
|
34
34
|
import Skeleton from './Skeleton';
|
|
35
35
|
import ActionRequirement from './ActionRequirement';
|
|
36
36
|
import Popover from './Popover';
|
|
37
|
-
|
|
37
|
+
import Spinner from './Spinner';
|
|
38
|
+
export { Accordion, ThemeProvider, FontLoader, createTheme, yogaTheme, theme, Button, List, Checkbox, RadioGroup, Slider, Card, PlanCard, Stepper, Container, Row, Col, Hide, Text, Rating, EventCard, Tag, Input, Progress, Dropdown, TextArea, AutoComplete, Icon, Chips, Box, Snackbar, Avatar, BottomSheet, Dialog, Divider, Header, Menu, Banner, Heading, Feedback, Datepicker, Drawer, Skeleton, ActionRequirement, Popover, Spinner };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gympass/yoga",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.87.0",
|
|
4
4
|
"description": "Gympass component library",
|
|
5
|
-
"main": "./cjs
|
|
5
|
+
"main": "./cjs",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"keywords": [
|
|
8
8
|
"Gympass",
|
|
@@ -55,15 +55,9 @@
|
|
|
55
55
|
"react-native": "0.72.3",
|
|
56
56
|
"styled-components": "^4.4.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
-
"module": "./esm
|
|
58
|
+
"gitHead": "fd59f2e9607ad89446ceea5c6bde96143f0a57d3",
|
|
59
|
+
"module": "./esm",
|
|
60
60
|
"types": "./typings/index.d.ts",
|
|
61
61
|
"private": false,
|
|
62
|
-
"exports": {
|
|
63
|
-
".": {
|
|
64
|
-
"require": "./cjs/index.js",
|
|
65
|
-
"import": "./esm/index.js"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
62
|
"react-native": "./cjs/index.native.js"
|
|
69
63
|
}
|