@gympass/yoga 7.58.0 → 7.60.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/Card/web/PlanCard/Content.js +11 -6
- package/cjs/Card/web/PlanCard/PlanCard.test.js +9 -0
- package/cjs/Datepicker/web/Datepicker.js +12 -3
- package/cjs/Divider/web/Divider.js +8 -4
- package/esm/Card/web/PlanCard/Content.js +11 -6
- package/esm/Card/web/PlanCard/PlanCard.test.js +9 -0
- package/esm/Datepicker/web/Datepicker.js +12 -3
- package/esm/Divider/web/Divider.js +9 -5
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ var _Subtitle = _interopRequireDefault(require("./Subtitle"));
|
|
|
19
19
|
|
|
20
20
|
var _Divider = _interopRequireDefault(require("../../../Divider"));
|
|
21
21
|
|
|
22
|
-
var _excluded = ["title", "subtitle", "description", "currency", "suffix", "price", "period", "children"];
|
|
22
|
+
var _excluded = ["title", "subtitle", "description", "currency", "suffix", "price", "period", "extra", "children"];
|
|
23
23
|
|
|
24
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
25
25
|
|
|
@@ -61,10 +61,11 @@ var PlanCardContent = function PlanCardContent(_ref) {
|
|
|
61
61
|
suffix = _ref.suffix,
|
|
62
62
|
price = _ref.price,
|
|
63
63
|
period = _ref.period,
|
|
64
|
+
extra = _ref.extra,
|
|
64
65
|
children = _ref.children,
|
|
65
66
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
66
67
|
|
|
67
|
-
return /*#__PURE__*/_react["default"].createElement(Wrapper, rest, subtitle && /*#__PURE__*/_react["default"].createElement(_Subtitle["default"], null, subtitle), title && /*#__PURE__*/_react["default"].createElement(Title, null, title), description && /*#__PURE__*/_react["default"].createElement(Description, null, description), /*#__PURE__*/_react["default"].createElement(Price, null, currency && /*#__PURE__*/_react["default"].createElement(_Text["default"].H4, {
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, rest, subtitle && /*#__PURE__*/_react["default"].createElement(_Subtitle["default"], null, subtitle), title && /*#__PURE__*/_react["default"].createElement(Title, null, title), description && /*#__PURE__*/_react["default"].createElement(Description, null, description), !!price && /*#__PURE__*/_react["default"].createElement(Price, null, currency && /*#__PURE__*/_react["default"].createElement(_Text["default"].H4, {
|
|
68
69
|
as: "sup"
|
|
69
70
|
}, currency), price && /*#__PURE__*/_react["default"].createElement(_Text["default"].H4, {
|
|
70
71
|
as: "strong"
|
|
@@ -72,7 +73,7 @@ var PlanCardContent = function PlanCardContent(_ref) {
|
|
|
72
73
|
as: "sup"
|
|
73
74
|
}, suffix), period && /*#__PURE__*/_react["default"].createElement(EnhancePrice, {
|
|
74
75
|
as: "sub"
|
|
75
|
-
}, period)), /*#__PURE__*/_react["default"].createElement(_Divider["default"], null), children);
|
|
76
|
+
}, period)), extra, /*#__PURE__*/_react["default"].createElement(_Divider["default"], null), children);
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
PlanCardContent.propTypes = {
|
|
@@ -84,12 +85,13 @@ PlanCardContent.propTypes = {
|
|
|
84
85
|
|
|
85
86
|
/** suffix currency of the current country */
|
|
86
87
|
suffix: _propTypes.string,
|
|
87
|
-
price: _propTypes.string
|
|
88
|
+
price: _propTypes.string,
|
|
88
89
|
|
|
89
90
|
/** period that this price will be charged */
|
|
90
|
-
period: _propTypes.string
|
|
91
|
+
period: _propTypes.string,
|
|
91
92
|
description: _propTypes.string,
|
|
92
93
|
subtitle: _propTypes.string,
|
|
94
|
+
extra: _propTypes.node,
|
|
93
95
|
children: _propTypes.node
|
|
94
96
|
};
|
|
95
97
|
PlanCardContent.defaultProps = {
|
|
@@ -97,7 +99,10 @@ PlanCardContent.defaultProps = {
|
|
|
97
99
|
description: null,
|
|
98
100
|
subtitle: null,
|
|
99
101
|
currency: null,
|
|
100
|
-
suffix: null
|
|
102
|
+
suffix: null,
|
|
103
|
+
price: null,
|
|
104
|
+
period: null,
|
|
105
|
+
extra: null
|
|
101
106
|
};
|
|
102
107
|
PlanCardContent.displayName = 'PlanCard.Content';
|
|
103
108
|
var _default = PlanCardContent;
|
|
@@ -91,5 +91,14 @@ describe('<PlanCard />', function () {
|
|
|
91
91
|
|
|
92
92
|
expect(container).toMatchSnapshot();
|
|
93
93
|
});
|
|
94
|
+
it('should render the extra content', function () {
|
|
95
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_.ThemeProvider, null, /*#__PURE__*/_react["default"].createElement(_2["default"], null, /*#__PURE__*/_react["default"].createElement(_2["default"].Content, {
|
|
96
|
+
title: "Basic",
|
|
97
|
+
extra: /*#__PURE__*/_react["default"].createElement("p", null, "Hello")
|
|
98
|
+
})))),
|
|
99
|
+
container = _render3.container;
|
|
100
|
+
|
|
101
|
+
expect(container).toMatchSnapshot();
|
|
102
|
+
});
|
|
94
103
|
});
|
|
95
104
|
});
|
|
@@ -167,11 +167,20 @@ function Datepicker(_ref8) {
|
|
|
167
167
|
triggerOnOpen();
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
+
var checkInputFilled = function checkInputFilled() {
|
|
171
|
+
if (type === 'range') {
|
|
172
|
+
if (!customOnSelectRange) setInputFilled(!!(startDateLocal && endDateLocal));else {
|
|
173
|
+
setInputFilled(startDateLocal && endDateLocal);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
setInputFilled(startDate);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
170
180
|
(0, _react.useEffect)(function () {
|
|
171
|
-
|
|
172
|
-
}, [startDate,
|
|
181
|
+
checkInputFilled();
|
|
182
|
+
}, [startDate, startDateLocal, endDateLocal]);
|
|
173
183
|
(0, _react.useEffect)(function () {
|
|
174
|
-
setInputFilled(startDate || endDate);
|
|
175
184
|
setStartDateLocal(startDate);
|
|
176
185
|
setEndDateLocal(endDate);
|
|
177
186
|
|
|
@@ -28,19 +28,23 @@ var StyledDivider = _styledComponents["default"].hr(_templateObject || (_templat
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
var Divider = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
31
|
-
var vertical = _ref2.vertical
|
|
31
|
+
var vertical = _ref2.vertical,
|
|
32
|
+
style = _ref2.style;
|
|
32
33
|
return /*#__PURE__*/_react["default"].createElement(StyledDivider, {
|
|
33
34
|
vertical: vertical,
|
|
34
|
-
ref: ref
|
|
35
|
+
ref: ref,
|
|
36
|
+
style: style
|
|
35
37
|
});
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
Divider.propTypes = {
|
|
39
41
|
/** If this value is defined, the divider will be in vertical if the flexDirection is row type */
|
|
40
|
-
vertical: _propTypes.bool
|
|
42
|
+
vertical: _propTypes.bool,
|
|
43
|
+
style: (0, _propTypes.shape)({})
|
|
41
44
|
};
|
|
42
45
|
Divider.defaultProps = {
|
|
43
|
-
vertical: false
|
|
46
|
+
vertical: false,
|
|
47
|
+
style: undefined
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
var _default = (0, _styledComponents.withTheme)(Divider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["title", "subtitle", "description", "currency", "suffix", "price", "period", "children"];
|
|
1
|
+
var _excluded = ["title", "subtitle", "description", "currency", "suffix", "price", "period", "extra", "children"];
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
4
4
|
|
|
@@ -40,10 +40,11 @@ var PlanCardContent = function PlanCardContent(_ref) {
|
|
|
40
40
|
suffix = _ref.suffix,
|
|
41
41
|
price = _ref.price,
|
|
42
42
|
period = _ref.period,
|
|
43
|
+
extra = _ref.extra,
|
|
43
44
|
children = _ref.children,
|
|
44
45
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
45
46
|
|
|
46
|
-
return /*#__PURE__*/React.createElement(Wrapper, rest, subtitle && /*#__PURE__*/React.createElement(Subtitle, null, subtitle), title && /*#__PURE__*/React.createElement(Title, null, title), description && /*#__PURE__*/React.createElement(Description, null, description), /*#__PURE__*/React.createElement(Price, null, currency && /*#__PURE__*/React.createElement(Text.H4, {
|
|
47
|
+
return /*#__PURE__*/React.createElement(Wrapper, rest, subtitle && /*#__PURE__*/React.createElement(Subtitle, null, subtitle), title && /*#__PURE__*/React.createElement(Title, null, title), description && /*#__PURE__*/React.createElement(Description, null, description), !!price && /*#__PURE__*/React.createElement(Price, null, currency && /*#__PURE__*/React.createElement(Text.H4, {
|
|
47
48
|
as: "sup"
|
|
48
49
|
}, currency), price && /*#__PURE__*/React.createElement(Text.H4, {
|
|
49
50
|
as: "strong"
|
|
@@ -51,7 +52,7 @@ var PlanCardContent = function PlanCardContent(_ref) {
|
|
|
51
52
|
as: "sup"
|
|
52
53
|
}, suffix), period && /*#__PURE__*/React.createElement(EnhancePrice, {
|
|
53
54
|
as: "sub"
|
|
54
|
-
}, period)), /*#__PURE__*/React.createElement(Divider, null), children);
|
|
55
|
+
}, period)), extra, /*#__PURE__*/React.createElement(Divider, null), children);
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
PlanCardContent.propTypes = {
|
|
@@ -63,12 +64,13 @@ PlanCardContent.propTypes = {
|
|
|
63
64
|
|
|
64
65
|
/** suffix currency of the current country */
|
|
65
66
|
suffix: string,
|
|
66
|
-
price: string
|
|
67
|
+
price: string,
|
|
67
68
|
|
|
68
69
|
/** period that this price will be charged */
|
|
69
|
-
period: string
|
|
70
|
+
period: string,
|
|
70
71
|
description: string,
|
|
71
72
|
subtitle: string,
|
|
73
|
+
extra: node,
|
|
72
74
|
children: node
|
|
73
75
|
};
|
|
74
76
|
PlanCardContent.defaultProps = {
|
|
@@ -76,7 +78,10 @@ PlanCardContent.defaultProps = {
|
|
|
76
78
|
description: null,
|
|
77
79
|
subtitle: null,
|
|
78
80
|
currency: null,
|
|
79
|
-
suffix: null
|
|
81
|
+
suffix: null,
|
|
82
|
+
price: null,
|
|
83
|
+
period: null,
|
|
84
|
+
extra: null
|
|
80
85
|
};
|
|
81
86
|
PlanCardContent.displayName = 'PlanCard.Content';
|
|
82
87
|
export default PlanCardContent;
|
|
@@ -81,5 +81,14 @@ describe('<PlanCard />', function () {
|
|
|
81
81
|
|
|
82
82
|
expect(container).toMatchSnapshot();
|
|
83
83
|
});
|
|
84
|
+
it('should render the extra content', function () {
|
|
85
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(PlanCard, null, /*#__PURE__*/React.createElement(PlanCard.Content, {
|
|
86
|
+
title: "Basic",
|
|
87
|
+
extra: /*#__PURE__*/React.createElement("p", null, "Hello")
|
|
88
|
+
})))),
|
|
89
|
+
container = _render3.container;
|
|
90
|
+
|
|
91
|
+
expect(container).toMatchSnapshot();
|
|
92
|
+
});
|
|
84
93
|
});
|
|
85
94
|
});
|
|
@@ -142,11 +142,20 @@ function Datepicker(_ref8) {
|
|
|
142
142
|
triggerOnOpen();
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
+
var checkInputFilled = function checkInputFilled() {
|
|
146
|
+
if (type === 'range') {
|
|
147
|
+
if (!customOnSelectRange) setInputFilled(!!(startDateLocal && endDateLocal));else {
|
|
148
|
+
setInputFilled(startDateLocal && endDateLocal);
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
setInputFilled(startDate);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
145
155
|
useEffect(function () {
|
|
146
|
-
|
|
147
|
-
}, [startDate,
|
|
156
|
+
checkInputFilled();
|
|
157
|
+
}, [startDate, startDateLocal, endDateLocal]);
|
|
148
158
|
useEffect(function () {
|
|
149
|
-
setInputFilled(startDate || endDate);
|
|
150
159
|
setStartDateLocal(startDate);
|
|
151
160
|
setEndDateLocal(endDate);
|
|
152
161
|
|
|
@@ -2,7 +2,7 @@ var _templateObject, _templateObject2;
|
|
|
2
2
|
|
|
3
3
|
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
4
|
|
|
5
|
-
import { bool } from 'prop-types';
|
|
5
|
+
import { bool, shape } from 'prop-types';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import styled, { css, withTheme } from 'styled-components';
|
|
8
8
|
var StyledDivider = styled.hr(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
@@ -13,17 +13,21 @@ var StyledDivider = styled.hr(_templateObject || (_templateObject = _taggedTempl
|
|
|
13
13
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", ";\n border-width: 0px;\n border-left-width: ", "px;\n border-bottom-width: ", "px;\n border-color: ", ";\n "])), vertical ? 'height: auto' : 'width: 100%', vertical ? borders.small : 0, vertical ? 0 : borders.small, colors.text.disabled);
|
|
14
14
|
});
|
|
15
15
|
var Divider = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
16
|
-
var vertical = _ref2.vertical
|
|
16
|
+
var vertical = _ref2.vertical,
|
|
17
|
+
style = _ref2.style;
|
|
17
18
|
return /*#__PURE__*/React.createElement(StyledDivider, {
|
|
18
19
|
vertical: vertical,
|
|
19
|
-
ref: ref
|
|
20
|
+
ref: ref,
|
|
21
|
+
style: style
|
|
20
22
|
});
|
|
21
23
|
});
|
|
22
24
|
Divider.propTypes = {
|
|
23
25
|
/** If this value is defined, the divider will be in vertical if the flexDirection is row type */
|
|
24
|
-
vertical: bool
|
|
26
|
+
vertical: bool,
|
|
27
|
+
style: shape({})
|
|
25
28
|
};
|
|
26
29
|
Divider.defaultProps = {
|
|
27
|
-
vertical: false
|
|
30
|
+
vertical: false,
|
|
31
|
+
style: undefined
|
|
28
32
|
};
|
|
29
33
|
export default withTheme(Divider);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gympass/yoga",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.60.0",
|
|
4
4
|
"description": "Gympass component library",
|
|
5
5
|
"main": "./cjs",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"react": ">=16",
|
|
53
53
|
"styled-components": "^4.4.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d5169082be1a31b40e49e54e8dc061494e3c238d",
|
|
56
56
|
"module": "./esm",
|
|
57
57
|
"private": false,
|
|
58
58
|
"react-native": "./cjs/index.native.js"
|