@gympass/yoga 7.65.0 → 7.66.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/Dialog/web/Dialog.js +12 -7
- package/cjs/Drawer/web/Drawer.js +5 -1
- package/cjs/Input/index.js +1 -0
- package/cjs/Input/web/Input.js +8 -3
- package/cjs/Input/web/Phone.js +144 -0
- package/cjs/Input/web/Phone.style.js +41 -0
- package/cjs/Input/web/data-images.js +10 -0
- package/cjs/Input/web/index.js +4 -0
- package/cjs/hooks/index.js +8 -0
- package/cjs/hooks/useCombinedRefs.js +32 -0
- package/esm/Accordion/web/Accordion.test.js +19 -0
- package/esm/ActionRequirement/index.native.js +2 -0
- package/esm/ActionRequirement/native/ActionRequirement.js +48 -0
- package/esm/ActionRequirement/native/ActionRequirement.test.js +45 -0
- package/esm/ActionRequirement/native/ActionRequirementStyles.js +25 -0
- package/esm/ActionRequirement/native/index.js +6 -0
- package/esm/ActionRequirement/web/ActionRequirement.test.js +36 -0
- package/esm/AutoComplete/web/AutoComplete.test.js +139 -0
- package/esm/Avatar/index.native.js +4 -0
- package/esm/Avatar/native/Avatar.js +96 -0
- package/esm/Avatar/native/Avatar.test.js +46 -0
- package/esm/Avatar/native/AvatarCircle.js +24 -0
- package/esm/Avatar/web/Avatar.test.js +63 -0
- package/esm/Banner/index.native.js +2 -0
- package/esm/Banner/native/Banner.js +128 -0
- package/esm/Banner/native/Banner.test.js +103 -0
- package/esm/Banner/native/index.js +2 -0
- package/esm/Banner/web/Banner.test.js +109 -0
- package/esm/BottomSheet/web/BottomSheet.test.js +48 -0
- package/esm/Box/index.native.js +2 -0
- package/esm/Box/native/Box.js +4 -0
- package/esm/Box/native/Box.test.js +16 -0
- package/esm/Box/native/index.js +2 -0
- package/esm/Box/web/Box.test.js +16 -0
- package/esm/Button/index.native.js +8 -0
- package/esm/Button/native/Button.js +110 -0
- package/esm/Button/native/Button.test.js +475 -0
- package/esm/Button/native/Icon.js +82 -0
- package/esm/Button/native/Link.js +35 -0
- package/esm/Button/native/Text.js +74 -0
- package/esm/Button/native/withTouchable.js +63 -0
- package/esm/Button/web/Button.test.js +772 -0
- package/esm/Card/index.native.js +2 -0
- package/esm/Card/native/Card/Actions.js +12 -0
- package/esm/Card/native/Card/Card.js +92 -0
- package/esm/Card/native/Card/Card.test.js +15 -0
- package/esm/Card/native/Card/Content.js +8 -0
- package/esm/Card/native/Card/Header.js +8 -0
- package/esm/Card/native/Card/index.js +8 -0
- package/esm/Card/native/EventCard/EventCard.js +169 -0
- package/esm/Card/native/EventCard/EventCard.test.js +65 -0
- package/esm/Card/native/EventCard/index.js +2 -0
- package/esm/Card/native/GymCard/CheckIn/Avatar.js +17 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.js +66 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +39 -0
- package/esm/Card/native/GymCard/CheckIn/Content.js +11 -0
- package/esm/Card/native/GymCard/CheckIn/Header.js +11 -0
- package/esm/Card/native/GymCard/CheckIn/index.js +2 -0
- package/esm/Card/native/GymCard/index.js +5 -0
- package/esm/Card/native/PlanCard/Actions.js +22 -0
- package/esm/Card/native/PlanCard/Content.js +75 -0
- package/esm/Card/native/PlanCard/List.js +73 -0
- package/esm/Card/native/PlanCard/PlanCard.js +51 -0
- package/esm/Card/native/PlanCard/PlanCard.test.js +84 -0
- package/esm/Card/native/PlanCard/Subtitle.js +15 -0
- package/esm/Card/native/PlanCard/Tag.js +34 -0
- package/esm/Card/native/PlanCard/index.js +15 -0
- package/esm/Card/native/index.js +5 -0
- package/esm/Card/web/Card/Card.test.js +14 -0
- package/esm/Card/web/EventCard/EventCard.test.js +27 -0
- package/esm/Card/web/PlanCard/PlanCard.test.js +94 -0
- package/esm/Checkbox/index.native.js +3 -0
- package/esm/Checkbox/native/Checkbox.js +179 -0
- package/esm/Checkbox/native/Checkbox.test.js +115 -0
- package/esm/Checkbox/native/Switch.js +115 -0
- package/esm/Checkbox/native/Switch.test.js +54 -0
- package/esm/Checkbox/native/index.js +3 -0
- package/esm/Checkbox/web/Checkbox.test.js +153 -0
- package/esm/Checkbox/web/Switch.test.js +56 -0
- package/esm/Chips/index.native.js +2 -0
- package/esm/Chips/native/Chips.js +104 -0
- package/esm/Chips/native/Chips.test.js +143 -0
- package/esm/Chips/native/Counter.js +20 -0
- package/esm/Chips/native/index.js +2 -0
- package/esm/Chips/web/Chips.test.js +128 -0
- package/esm/Datepicker/web/Datepicker.test.js +247 -0
- package/esm/Dialog/web/Dialog.js +13 -8
- package/esm/Dialog/web/Dialog.test.js +62 -0
- package/esm/Divider/index.native.js +2 -0
- package/esm/Divider/native/Divider.js +29 -0
- package/esm/Divider/native/Divider.test.js +29 -0
- package/esm/Divider/native/index.js +2 -0
- package/esm/Divider/web/Divider.test.js +29 -0
- package/esm/Drawer/web/Drawer.js +6 -2
- package/esm/Drawer/web/Drawer.test.js +33 -0
- package/esm/Dropdown/index.native.js +2 -0
- package/esm/Dropdown/native/Backdrop.js +93 -0
- package/esm/Dropdown/native/Backdrop.test.js +26 -0
- package/esm/Dropdown/native/Dropdown.js +142 -0
- package/esm/Dropdown/native/Dropdown.test.js +78 -0
- package/esm/Dropdown/native/Options.android.js +66 -0
- package/esm/Dropdown/native/Options.ios.js +71 -0
- package/esm/Dropdown/native/index.js +2 -0
- package/esm/Dropdown/web/Dropdown.test.js +93 -0
- package/esm/Feedback/web/Feedback.test.js +83 -0
- package/esm/Grid/web/Col.test.js +48 -0
- package/esm/Grid/web/Container.test.js +14 -0
- package/esm/Grid/web/Hide.test.js +31 -0
- package/esm/Grid/web/Row.test.js +14 -0
- package/esm/Header/web/Header.test.js +38 -0
- package/esm/Heading/web/Heading.test.js +58 -0
- package/esm/Icon/index.native.js +2 -0
- package/esm/Icon/native/Icon.test.js +47 -0
- package/esm/Icon/native/index.js +2 -0
- package/esm/Icon/web/Icon.test.js +47 -0
- package/esm/Input/index.js +2 -1
- package/esm/Input/index.native.js +6 -0
- package/esm/Input/native/Email.js +15 -0
- package/esm/Input/native/Email.test.js +13 -0
- package/esm/Input/native/Helper.js +62 -0
- package/esm/Input/native/Input.js +234 -0
- package/esm/Input/native/Input.test.js +181 -0
- package/esm/Input/native/Number.js +12 -0
- package/esm/Input/native/Number.test.js +13 -0
- package/esm/Input/native/Password.js +112 -0
- package/esm/Input/native/Password.test.js +125 -0
- package/esm/Input/native/Tel.js +14 -0
- package/esm/Input/native/Tel.test.js +13 -0
- package/esm/Input/native/index.js +6 -0
- package/esm/Input/web/Email.test.js +13 -0
- package/esm/Input/web/Input.js +9 -4
- package/esm/Input/web/Input.test.js +145 -0
- package/esm/Input/web/Number.test.js +13 -0
- package/esm/Input/web/Password.test.js +90 -0
- package/esm/Input/web/Phone.js +124 -0
- package/esm/Input/web/Phone.style.js +27 -0
- package/esm/Input/web/Phone.test.js +95 -0
- package/esm/Input/web/Tel.test.js +13 -0
- package/esm/Input/web/data-images.js +3 -0
- package/esm/Input/web/index.js +2 -1
- package/esm/List/index.native.js +3 -0
- package/esm/List/native/List.js +22 -0
- package/esm/List/native/List.test.js +106 -0
- package/esm/List/native/ListItem.js +51 -0
- package/esm/List/native/index.js +3 -0
- package/esm/List/web/List.test.js +62 -0
- package/esm/Menu/web/Menu.test.js +115 -0
- package/esm/Popover/web/Popover.test.js +19 -0
- package/esm/Progress/index.native.js +2 -0
- package/esm/Progress/native/Progress.js +103 -0
- package/esm/Progress/native/Progress.test.js +222 -0
- package/esm/Progress/native/index.js +2 -0
- package/esm/Progress/web/Progress.test.js +222 -0
- package/esm/RadioGroup/index.native.js +4 -0
- package/esm/RadioGroup/native/Button/RadioButton.js +64 -0
- package/esm/RadioGroup/native/Button/RadioButton.test.js +96 -0
- package/esm/RadioGroup/native/Radio/Radio.js +88 -0
- package/esm/RadioGroup/native/Radio/Radio.test.js +112 -0
- package/esm/RadioGroup/native/RadioGroup.js +66 -0
- package/esm/RadioGroup/native/RadioGroup.test.js +50 -0
- package/esm/RadioGroup/native/index.js +4 -0
- package/esm/RadioGroup/web/Button/RadioButton.test.js +121 -0
- package/esm/RadioGroup/web/Radio/Radio.test.js +108 -0
- package/esm/RadioGroup/web/RadioGroup.test.js +83 -0
- package/esm/Rating/index.native.js +2 -0
- package/esm/Rating/native/Rating.js +186 -0
- package/esm/Rating/native/Rating.test.js +121 -0
- package/esm/Rating/native/index.js +2 -0
- package/esm/Rating/web/Rating.test.js +184 -0
- package/esm/Result/index.native.js +8 -0
- package/esm/Result/native/Attendances.js +55 -0
- package/esm/Result/native/Details.js +97 -0
- package/esm/Result/native/Rate.js +35 -0
- package/esm/Result/native/Result.js +86 -0
- package/esm/Result/native/Result.test.js +107 -0
- package/esm/Result/native/ResultButton.js +13 -0
- package/esm/Result/native/Tags.js +41 -0
- package/esm/Result/native/TinyTextIcon.js +18 -0
- package/esm/Result/native/index.js +2 -0
- package/esm/Skeleton/index.native.js +2 -0
- package/esm/Skeleton/native/Skeleton.js +94 -0
- package/esm/Skeleton/native/Skeleton.test.js +78 -0
- package/esm/Skeleton/native/index.js +2 -0
- package/esm/Skeleton/web/Skeleton.test.js +77 -0
- package/esm/Slider/index.native.js +2 -0
- package/esm/Slider/native/Label.js +19 -0
- package/esm/Slider/native/Marker.js +68 -0
- package/esm/Slider/native/Slider.js +156 -0
- package/esm/Slider/native/Slider.test.js +122 -0
- package/esm/Slider/native/Step.js +14 -0
- package/esm/Slider/native/Tooltip.js +90 -0
- package/esm/Slider/web/Slider.test.js +86 -0
- package/esm/Snackbar/index.native.js +2 -0
- package/esm/Snackbar/native/Snackbar.js +199 -0
- package/esm/Snackbar/native/Snackbar.test.js +100 -0
- package/esm/Snackbar/native/SnackbarAnimationWrapper.js +124 -0
- package/esm/Snackbar/native/index.js +2 -0
- package/esm/Snackbar/web/Snackbar.test.js +118 -0
- package/esm/Stepper/index.native.js +3 -0
- package/esm/Stepper/native/Dots.js +45 -0
- package/esm/Stepper/native/Line.js +35 -0
- package/esm/Stepper/native/Step.js +19 -0
- package/esm/Stepper/native/Stepper.js +52 -0
- package/esm/Stepper/native/Stepper.test.js +70 -0
- package/esm/Stepper/native/index.js +3 -0
- package/esm/Stepper/web/Stepper.test.js +67 -0
- package/esm/Tag/index.native.js +4 -0
- package/esm/Tag/native/Informative.js +72 -0
- package/esm/Tag/native/Tag.js +75 -0
- package/esm/Tag/native/Tag.test.js +94 -0
- package/esm/Tag/native/index.js +2 -0
- package/esm/Tag/web/Tag.test.js +79 -0
- package/esm/Text/index.native.js +16 -0
- package/esm/Text/native/Text.js +69 -0
- package/esm/Text/native/Text.test.js +149 -0
- package/esm/Text/native/index.js +2 -0
- package/esm/Text/web/Text.test.js +149 -0
- package/esm/TextArea/index.native.js +2 -0
- package/esm/TextArea/native/TextArea.js +59 -0
- package/esm/TextArea/native/TextArea.test.js +11 -0
- package/esm/TextArea/native/index.js +2 -0
- package/esm/TextArea/web/TextArea.test.js +11 -0
- package/esm/Theme/Provider/index.native.js +2 -0
- package/esm/Theme/Provider/native/index.js +2 -0
- package/esm/Theme/Provider/web/FontLoader.test.js +11 -0
- package/esm/Theme/Provider/web/GlobalStyle.test.js +17 -0
- package/esm/Theme/helpers/themeReader/native/native.test.js +53 -0
- package/esm/Theme/helpers/themeReader/web/web.test.js +41 -0
- package/esm/Theme/index.native.js +5 -0
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useCombinedRefs.js +25 -0
- package/esm/index.native.js +26 -0
- package/esm/shared/index.native.js +2 -0
- package/package.json +4 -3
package/cjs/Dialog/web/Dialog.js
CHANGED
|
@@ -17,7 +17,7 @@ var _hooks = require("../../hooks");
|
|
|
17
17
|
|
|
18
18
|
var _ = require("../..");
|
|
19
19
|
|
|
20
|
-
var _excluded = ["isOpen", "hideCloseButton", "children", "onClose"];
|
|
20
|
+
var _excluded = ["isOpen", "hideCloseButton", "children", "onClose", "zIndex"];
|
|
21
21
|
|
|
22
22
|
var _templateObject, _templateObject2;
|
|
23
23
|
|
|
@@ -41,15 +41,17 @@ var StyledDialog = (0, _styledComponents["default"])(_.Card)(_templateObject ||
|
|
|
41
41
|
exports.StyledDialog = StyledDialog;
|
|
42
42
|
|
|
43
43
|
var Overlay = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
|
|
44
|
-
var
|
|
45
|
-
|
|
44
|
+
var zIndex = _ref2.zIndex,
|
|
45
|
+
dialog = _ref2.theme.yoga.components.dialog;
|
|
46
|
+
return "\n display: flex;\n z-index: " + zIndex + ";\n justify-content: center;\n align-items: center;\n\n position: fixed;\n top: " + dialog.position["default"] + ";\n right: " + dialog.position["default"] + ";\n left: " + dialog.position["default"] + ";\n bottom: " + dialog.position["default"] + ";\n\n background-color: rgba(35, 27, 34, 0.48);\n ";
|
|
46
47
|
});
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
function Dialog(_ref3) {
|
|
49
50
|
var isOpen = _ref3.isOpen,
|
|
50
51
|
hideCloseButton = _ref3.hideCloseButton,
|
|
51
52
|
children = _ref3.children,
|
|
52
53
|
onClose = _ref3.onClose,
|
|
54
|
+
zIndex = _ref3.zIndex,
|
|
53
55
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
54
56
|
|
|
55
57
|
var dialogRef = (0, _react.useRef)(null);
|
|
@@ -78,7 +80,8 @@ var Dialog = function Dialog(_ref3) {
|
|
|
78
80
|
return isOpen ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react["default"].createElement(Overlay, {
|
|
79
81
|
onClick: closeDialog,
|
|
80
82
|
onClose: onClose,
|
|
81
|
-
ref: dialogRef
|
|
83
|
+
ref: dialogRef,
|
|
84
|
+
zIndex: zIndex
|
|
82
85
|
}, /*#__PURE__*/_react["default"].createElement(StyledDialog, _extends({
|
|
83
86
|
onClose: onClose
|
|
84
87
|
}, props), isCloseButtonVisible && /*#__PURE__*/_react["default"].createElement(_.Box, {
|
|
@@ -90,7 +93,7 @@ var Dialog = function Dialog(_ref3) {
|
|
|
90
93
|
inverted: true,
|
|
91
94
|
onClick: onClose
|
|
92
95
|
})), children)), dialogElement) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null);
|
|
93
|
-
}
|
|
96
|
+
}
|
|
94
97
|
|
|
95
98
|
Dialog.propTypes = {
|
|
96
99
|
/** Control the dialog visibility. */
|
|
@@ -101,12 +104,14 @@ Dialog.propTypes = {
|
|
|
101
104
|
|
|
102
105
|
/** Function to close the dialog. */
|
|
103
106
|
onClose: _propTypes.func,
|
|
107
|
+
zIndex: _propTypes.number,
|
|
104
108
|
children: _propTypes.node.isRequired
|
|
105
109
|
};
|
|
106
110
|
Dialog.defaultProps = {
|
|
107
111
|
isOpen: false,
|
|
108
112
|
hideCloseButton: false,
|
|
109
|
-
onClose: undefined
|
|
113
|
+
onClose: undefined,
|
|
114
|
+
zIndex: 3
|
|
110
115
|
};
|
|
111
116
|
Dialog.displayName = 'Dialog';
|
|
112
117
|
var _default = Dialog;
|
package/cjs/Drawer/web/Drawer.js
CHANGED
|
@@ -27,7 +27,11 @@ function Drawer(props) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
Drawer.propTypes = {
|
|
30
|
-
children: _propTypes.node.isRequired
|
|
30
|
+
children: _propTypes.node.isRequired,
|
|
31
|
+
zIndex: _propTypes.number
|
|
32
|
+
};
|
|
33
|
+
Drawer.defaultProps = {
|
|
34
|
+
zIndex: 3
|
|
31
35
|
};
|
|
32
36
|
var _default = Drawer;
|
|
33
37
|
exports["default"] = _default;
|
package/cjs/Input/index.js
CHANGED
package/cjs/Input/web/Input.js
CHANGED
|
@@ -23,7 +23,7 @@ var _Legend = _interopRequireDefault(require("./Legend"));
|
|
|
23
23
|
|
|
24
24
|
var _Label = _interopRequireDefault(require("./Label"));
|
|
25
25
|
|
|
26
|
-
var _excluded = ["cleanable", "disabled", "error", "full", "helper", "label", "maxLength", "readOnly", "style", "value", "onChange", "onClean", "hideMaxLength", "rightIcon"];
|
|
26
|
+
var _excluded = ["cleanable", "children", "disabled", "error", "full", "helper", "label", "maxLength", "readOnly", "style", "value", "onChange", "onClean", "hideMaxLength", "rightIcon"];
|
|
27
27
|
|
|
28
28
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
29
29
|
|
|
@@ -57,6 +57,7 @@ var IconWrapper = _styledComponents["default"].div(_templateObject3 || (_templat
|
|
|
57
57
|
|
|
58
58
|
var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
59
59
|
var cleanable = _ref3.cleanable,
|
|
60
|
+
children = _ref3.children,
|
|
60
61
|
disabled = _ref3.disabled,
|
|
61
62
|
error = _ref3.error,
|
|
62
63
|
full = _ref3.full,
|
|
@@ -91,7 +92,7 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
|
91
92
|
label: label,
|
|
92
93
|
style: style,
|
|
93
94
|
value: value
|
|
94
|
-
}, /*#__PURE__*/_react["default"].createElement(_Field["default"], _extends({}, props, {
|
|
95
|
+
}, !children ? /*#__PURE__*/_react["default"].createElement(_Field["default"], _extends({}, props, {
|
|
95
96
|
label: label,
|
|
96
97
|
cleanable: cleanable,
|
|
97
98
|
disabled: disabled,
|
|
@@ -102,7 +103,7 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
|
102
103
|
ref: inputRef,
|
|
103
104
|
value: value,
|
|
104
105
|
onChange: onChange
|
|
105
|
-
})), /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
106
|
+
})) : children, /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
106
107
|
error: error,
|
|
107
108
|
disabled: disabled
|
|
108
109
|
}, label), label && /*#__PURE__*/_react["default"].createElement(_Legend["default"], null, label), cleanable && !readOnly && value && /*#__PURE__*/_react["default"].createElement(IconWrapper, {
|
|
@@ -135,6 +136,9 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
|
135
136
|
Input.propTypes = {
|
|
136
137
|
className: _propTypes.string,
|
|
137
138
|
|
|
139
|
+
/** a children node to override default input component */
|
|
140
|
+
children: (0, _propTypes.oneOfType)([(0, _propTypes.arrayOf)(_propTypes.node), _propTypes.node]),
|
|
141
|
+
|
|
138
142
|
/** display a close icon to clean the field */
|
|
139
143
|
cleanable: _propTypes.bool,
|
|
140
144
|
disabled: _propTypes.bool,
|
|
@@ -162,6 +166,7 @@ Input.propTypes = {
|
|
|
162
166
|
};
|
|
163
167
|
Input.defaultProps = {
|
|
164
168
|
className: undefined,
|
|
169
|
+
children: undefined,
|
|
165
170
|
cleanable: true,
|
|
166
171
|
disabled: false,
|
|
167
172
|
error: undefined,
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactPhoneInput = _interopRequireDefault(require("react-phone-input-2"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireWildcard(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var S = _interopRequireWildcard(require("./Phone.style"));
|
|
13
|
+
|
|
14
|
+
var _Input = _interopRequireDefault(require("./Input"));
|
|
15
|
+
|
|
16
|
+
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
18
|
+
var _excluded = ["defaultCountry", "disabled", "readOnly", "error", "full", "helper", "label", "placeholder", "value", "onChange"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
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
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
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; }
|
|
29
|
+
|
|
30
|
+
var phoneBaseSettings = {
|
|
31
|
+
onlyCountries: ['ar', 'br', 'cl', 'de', 'es', 'gb', 'ie', 'it', 'mx', 'pt', 'us']
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var Phone = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardedRef) {
|
|
35
|
+
var defaultCountry = _ref.defaultCountry,
|
|
36
|
+
disabled = _ref.disabled,
|
|
37
|
+
readOnly = _ref.readOnly,
|
|
38
|
+
error = _ref.error,
|
|
39
|
+
full = _ref.full,
|
|
40
|
+
helper = _ref.helper,
|
|
41
|
+
label = _ref.label,
|
|
42
|
+
placeholder = _ref.placeholder,
|
|
43
|
+
value = _ref.value,
|
|
44
|
+
_onChange = _ref.onChange,
|
|
45
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
46
|
+
|
|
47
|
+
var inputRef = (0, _hooks.useCombinedRefs)(forwardedRef);
|
|
48
|
+
var currentCountry = (0, _react.useRef)(defaultCountry);
|
|
49
|
+
var onChangeCountry = (0, _react.useCallback)(function (countryCode) {
|
|
50
|
+
if (currentCountry.current !== countryCode) {
|
|
51
|
+
inputRef.current.focus();
|
|
52
|
+
currentCountry.current = countryCode;
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(_Input["default"], _extends({}, _extends({
|
|
56
|
+
disabled: disabled,
|
|
57
|
+
readOnly: readOnly,
|
|
58
|
+
error: error,
|
|
59
|
+
full: full,
|
|
60
|
+
helper: helper,
|
|
61
|
+
value: value
|
|
62
|
+
}, rest), {
|
|
63
|
+
ref: inputRef,
|
|
64
|
+
label: "",
|
|
65
|
+
onClean: function onClean(phoneNumber) {
|
|
66
|
+
return _onChange(phoneNumber);
|
|
67
|
+
}
|
|
68
|
+
}), /*#__PURE__*/_react["default"].createElement(S.Container, {
|
|
69
|
+
error: error,
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
full: full
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactPhoneInput["default"], _extends({}, phoneBaseSettings, {
|
|
73
|
+
ref: function ref(phoneRef) {
|
|
74
|
+
inputRef.current = phoneRef == null ? void 0 : phoneRef.numberInputRef;
|
|
75
|
+
},
|
|
76
|
+
inputProps: {
|
|
77
|
+
readOnly: readOnly
|
|
78
|
+
},
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
disableDropdown: readOnly,
|
|
81
|
+
country: defaultCountry,
|
|
82
|
+
specialLabel: label,
|
|
83
|
+
placeholder: placeholder,
|
|
84
|
+
onChange: function onChange(phoneNumber, options) {
|
|
85
|
+
_onChange(phoneNumber, options);
|
|
86
|
+
|
|
87
|
+
onChangeCountry(options.countryCode);
|
|
88
|
+
},
|
|
89
|
+
value: value
|
|
90
|
+
}))));
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
Phone.propTypes = {
|
|
94
|
+
className: _propTypes.string,
|
|
95
|
+
|
|
96
|
+
/** display a close icon to clean the field */
|
|
97
|
+
cleanable: _propTypes.bool,
|
|
98
|
+
|
|
99
|
+
/** default country to be selected on the dropdown */
|
|
100
|
+
defaultCountry: _propTypes["default"].string,
|
|
101
|
+
|
|
102
|
+
/** disable the whole input */
|
|
103
|
+
disabled: _propTypes.bool,
|
|
104
|
+
|
|
105
|
+
/** display a error message and error style */
|
|
106
|
+
error: _propTypes.string,
|
|
107
|
+
|
|
108
|
+
/** should occupy the whole container width */
|
|
109
|
+
full: _propTypes.bool,
|
|
110
|
+
|
|
111
|
+
/** a helper text to be displayed below field */
|
|
112
|
+
helper: _propTypes.string,
|
|
113
|
+
|
|
114
|
+
/** label for the input */
|
|
115
|
+
label: _propTypes.string,
|
|
116
|
+
|
|
117
|
+
/** make the input read only */
|
|
118
|
+
readOnly: _propTypes.bool,
|
|
119
|
+
|
|
120
|
+
/** value of the input */
|
|
121
|
+
value: _propTypes.string,
|
|
122
|
+
|
|
123
|
+
/** callback invoked when value changes, either by typing of selecting a country */
|
|
124
|
+
onChange: _propTypes.func,
|
|
125
|
+
|
|
126
|
+
/** placeholder to show when the input is cleared */
|
|
127
|
+
placeholder: _propTypes.string
|
|
128
|
+
};
|
|
129
|
+
Phone.defaultProps = {
|
|
130
|
+
className: undefined,
|
|
131
|
+
cleanable: true,
|
|
132
|
+
defaultCountry: 'br',
|
|
133
|
+
disabled: false,
|
|
134
|
+
error: undefined,
|
|
135
|
+
full: false,
|
|
136
|
+
helper: undefined,
|
|
137
|
+
label: '',
|
|
138
|
+
readOnly: false,
|
|
139
|
+
value: '',
|
|
140
|
+
onChange: function onChange() {},
|
|
141
|
+
placeholder: '+55 (11) 999999999'
|
|
142
|
+
};
|
|
143
|
+
var _default = Phone;
|
|
144
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Container = void 0;
|
|
5
|
+
|
|
6
|
+
require("react-phone-input-2/lib/material.css");
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _dataImages = require("./data-images");
|
|
11
|
+
|
|
12
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
19
|
+
|
|
20
|
+
var flagsPositioning = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n .ar {\n background-position: 0px 0px;\n }\n\n .br {\n background-position: -20px 0px;\n }\n\n .cl {\n background-position: 0px -20px;\n }\n\n .de {\n background-position: -20px -20px;\n }\n\n .es {\n background-position: -20px -40px;\n }\n\n .gb {\n background-position: -60px 0px;\n }\n\n .ie {\n background-position: -40px 0px;\n }\n\n .it {\n background-position: -40px -20px;\n }\n\n .mx {\n background-position: 0px -40px;\n }\n\n .pt {\n background-position: -40px -40px;\n }\n\n .us {\n background-position: -60px -20px;\n }\n"])));
|
|
21
|
+
var flagReset = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n position: relative;\n top: initial;\n left: initial;\n margin-top: 0;\n"])));
|
|
22
|
+
var hiddenScrollBar = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n ::-webkit-scrollbar {\n display: none;\n }\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n"])));
|
|
23
|
+
|
|
24
|
+
var labelStateColors = function labelStateColors(_ref) {
|
|
25
|
+
var disabled = _ref.disabled,
|
|
26
|
+
error = _ref.error,
|
|
27
|
+
colors = _ref.theme.yoga.colors;
|
|
28
|
+
return (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n"])), disabled ? "color: " + colors.text.disabled + ";" : '', error ? "color: " + colors.feedback.attention[1] + ";" : '');
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var Container = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n --fieldset-left-offset: 12px;\n --dropdown-zIndex: 1;\n\n height: inherit;\n\n ", "\n"])), function (_ref2) {
|
|
32
|
+
var disabled = _ref2.disabled,
|
|
33
|
+
_ref2$theme$yoga = _ref2.theme.yoga,
|
|
34
|
+
spacing = _ref2$theme$yoga.spacing,
|
|
35
|
+
colors = _ref2$theme$yoga.colors,
|
|
36
|
+
baseFont = _ref2$theme$yoga.baseFont,
|
|
37
|
+
input = _ref2$theme$yoga.components.input;
|
|
38
|
+
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n .react-tel-input {\n width: inherit;\n height: inherit;\n font-family: ", ", sans-serif;\n font-size: ", "px;\n font-weight: ", ";\n display: grid;\n grid-template-areas: 'dropdown input';\n grid-template-columns: min-content 1fr;\n\n .special-label {\n z-index: unset;\n left: unset;\n font-size: ", "px;\n color: ", ";\n letter-spacing: normal;\n ", ";\n }\n\n &:focus-within {\n .special-label {\n font-weight: ", ";\n color: ", ";\n ", ";\n }\n }\n\n .form-control {\n background: transparent;\n border: unset;\n padding: unset;\n box-sizing: border-box;\n width: 100%;\n grid-area: input;\n color: ", ";\n font-size: ", "px;\n padding-left: ", "px;\n\n &:disabled {\n cursor: not-allowed;\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &:hover,\n &:focus {\n box-shadow: none;\n }\n\n &.open {\n z-index: calc(var(--dropdown-zIndex) + 1);\n }\n }\n\n .flag-dropdown {\n border: none;\n width: inherit;\n position: unset;\n top: unset;\n bottom: unset;\n padding: unset;\n grid-area: dropdown;\n\n &.open {\n width: 100%;\n z-index: var(--dropdown-zIndex);\n }\n\n &.open,\n &.open .selected-flag,\n &:hover,\n &:focus {\n background: transparent;\n }\n }\n\n .selected-flag {\n border: none;\n padding: 0;\n padding-left: ", "px;\n display: flex;\n align-items: center;\n opacity: ", ";\n\n &::after {\n content: '';\n position: absolute;\n background-color: ", ";\n height: 28px;\n right: -", "px;\n width: 1px;\n top: 50%;\n transform: translate(0, -50%);\n }\n\n .flag {\n ", ";\n display: flex;\n align-items: center;\n\n .arrow {\n background-color: ", ";\n mask-image: url('data:image/svg+xml;utf8,", "');\n border: none;\n top: unset;\n margin-top: unset;\n width: 16px;\n height: 16px;\n transition: 0.6s, color 0.1s;\n\n &.up {\n border: none;\n transform: rotateX(180deg);\n }\n\n &:hover,\n &:focus {\n border: none;\n background-color: ", ";\n }\n }\n }\n }\n\n .flag {\n width: 20px;\n height: 20px;\n background-image: url('data:image/png;base64,", "');\n }\n\n ", ";\n\n .country-list {\n box-shadow: none;\n border-radius: unset;\n max-height: 18rem;\n margin: -", "px 0 0 calc(-1 * var(--fieldset-left-offset) -\n 1px);\n width: calc(100% + var(--fieldset-left-offset) + 2px);\n z-index: var(--dropdown-zIndex);\n border: 1px solid ", ";\n border-top: 0;\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n\n ", ";\n\n .country {\n display: flex;\n align-items: center;\n outline: 0;\n padding: ", "px ", "px ", "px\n ", "px;\n color: ", ";\n\n .flag {\n ", ";\n margin-right: ", "px;\n }\n\n .dial-code {\n color: inherit;\n display: flex;\n flex: 1;\n\n ::before {\n content: '(';\n }\n\n ::after {\n content: ')';\n }\n }\n\n &.highlight {\n background-color: transparent;\n color: ", ";\n\n &::after {\n content: '';\n background-color: ", ";\n mask-image: url('data:image/svg+xml;utf8,", "');\n width: 16px;\n height: 16px;\n }\n }\n\n &.focus,\n &:hover {\n background-color: ", ";\n }\n }\n }\n }\n "])), baseFont.family, input.font.size, input.font.weight, input.label.font.size.typed, input.label.color["default"], labelStateColors, input.label.font.weight.typed, input.label.color.focus, labelStateColors, disabled ? colors.text.disabled : input.font.color.focus, input.font.size, spacing.xsmall, input.font.color["default"], spacing.xxxsmall, disabled ? 0.5 : 1, input.border.color["default"], spacing.xxxsmall, flagReset, input.label.color["default"], _dataImages.chevronSvg, input.label.color.focus, _dataImages.flagsSprite, flagsPositioning, spacing.xxsmall, input.border.color.typed, spacing.xxsmall, spacing.xxsmall, hiddenScrollBar, spacing.xsmall, spacing.small, spacing.xsmall, spacing.small, input.font.color.focus, flagReset, spacing.small, colors.primary, colors.primary, _dataImages.checkSvg, colors.clear);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.flagsSprite = exports.chevronSvg = exports.checkSvg = void 0;
|
|
5
|
+
var chevronSvg = encodeURI("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\">\n <path fill-rule=\"evenodd\" d=\"M3.146 4.146a.5.5 0 0 1 .708 0L6 6.293l2.146-2.147a.5.5 0 0 1 .708.708l-2.5 2.5a.5.5 0 0 1-.708 0l-2.5-2.5a.5.5 0 0 1 0-.708Z\" clip-rule=\"evenodd\"/>\n </svg>\n");
|
|
6
|
+
exports.chevronSvg = chevronSvg;
|
|
7
|
+
var checkSvg = encodeURI("\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\">\n <path fill-rule=\"evenodd\" d=\"M9.854 3.146a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708 0l-2.5-2.5a.5.5 0 1 1 .708-.708L5 7.293l4.146-4.147a.5.5 0 0 1 .708 0Z\" clip-rule=\"evenodd\"/>\n </svg>\n");
|
|
8
|
+
exports.checkSvg = checkSvg;
|
|
9
|
+
var flagsSprite = encodeURI('iVBORw0KGgoAAAANSUhEUgAAAFAAAAA8CAYAAADxJz2MAAAAAXNSR0IArs4c6QAAEBZJREFUeF7NXHlwXMWZ//XoGB86ZnwIc1hostYBjrM+CCZYWTvYZCvYRIdZAnLIaljA2PEhkQXbRcUa7W7WmCRYSmxnnThItVhaUottTZBIeTEpREQKFz6mloA1EqyeBXb5nifJthgdr7e+N/NGb2bem3lvZli2/8Kj7l9//Xtf99f9/bph0CjLXNw2OHWwmnHLUg4+n4EVBKt5AAgc3H3yuZxmrbZav9U0LbONZ1iqYbEsZWDzOecyHgPzcMYFcMn9yzV/NIX37flPVN/rWLUUwHwAin0CAE96f4c762trDOOh/LANlozqfU8VLy2/1jvf91CtjDf9yH7PIT5LWPvr024c+q4mHosc8KKdg+WwsCZw2GITxAQOqT4ekRtal5czzpqAeHhcAHh9PCIVvG8VPmy7r+hhTRMn/aUB1r80CuC8nq0TYxO5+vVyBO3b+w9Fe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5FVORfms6Pn1MffVWt1c5I5OcTeGt2caWFVEpfcUDfX+uQUE/3fuZKEJ+Gez3NkDHA1Hco61hJGr0pvcnWu5cCIy4b+DijhFYV/4N/B3vwP4DC6b9fRZ67zprqIsSeHVPX4YAIirFJPCND5tg7W3CspELcrNjGdMhFj+JB+50fqkEXtqbiZn/3YaLt6/48gnc1Hp/X+Q7DMUDxeFL2PPOP+LzsYDwPCljKn74zZ/BNnmmHoGe4p58m4HLmUY/tmfzcRbSRCpnA0vGxyCUnQdYFsCvw+G+CdeP+XF+61UjmJ4SeBcYqWi0TtwgQiT+ua9dxrvXsUomj8qXEUToYvqWuUD25THcODaCqYszQevPp9+/BAomBkrqg8jGA/fVRL7DSHQbQ1nfvB/PsEnieEo0EWthuvP5aZOiNJGv2YC7z/gx/dAQrpnYxqiz0gbINlSFab3rSJDAL0Rz0Ht3ksBGOuURmBiWI1Kk5pAIgeqvm2qNRUsTMUvgF+F9IQKDJIbedZglUEtzSLXGEvnuxAyBWvYZmp8GKoXtiZR3HSYJ1NUcUq2xqN+dmCBQ1z4D/MStErWppLPxNxyr6h648/GYmshgzQ5xuPlwXE0kWc0hcgTKO5G7Dg4VxMkHGtJE4jIUp4Lurjz4P6OgKxATGsbEM4dOuk0fvI1qyIZENQc98I575lfPec9fZlbDMGSsiUr/C+U5BKMm6UjbAAAAAElFTkSuQmCC');
|
|
10
|
+
exports.flagsSprite = flagsSprite;
|
package/cjs/Input/web/index.js
CHANGED
|
@@ -10,6 +10,10 @@ var _Password = _interopRequireDefault(require("./Password"));
|
|
|
10
10
|
|
|
11
11
|
exports.Password = _Password["default"];
|
|
12
12
|
|
|
13
|
+
var _Phone = _interopRequireDefault(require("./Phone"));
|
|
14
|
+
|
|
15
|
+
exports.Phone = _Phone["default"];
|
|
16
|
+
|
|
13
17
|
var _Number = _interopRequireDefault(require("./Number"));
|
|
14
18
|
|
|
15
19
|
exports.InputNumber = _Number["default"];
|
package/cjs/hooks/index.js
CHANGED
|
@@ -16,4 +16,12 @@ Object.keys(_useKeyPress).forEach(function (key) {
|
|
|
16
16
|
if (key === "default" || key === "__esModule") return;
|
|
17
17
|
if (key in exports && exports[key] === _useKeyPress[key]) return;
|
|
18
18
|
exports[key] = _useKeyPress[key];
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _useCombinedRefs = require("./useCombinedRefs");
|
|
22
|
+
|
|
23
|
+
Object.keys(_useCombinedRefs).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (key in exports && exports[key] === _useCombinedRefs[key]) return;
|
|
26
|
+
exports[key] = _useCombinedRefs[key];
|
|
19
27
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useCombinedRefs = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A hook for combining multiple refs into one ref.
|
|
10
|
+
*/
|
|
11
|
+
var useCombinedRefs = function useCombinedRefs() {
|
|
12
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
refs[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var targetRef = (0, _react.useRef)(null);
|
|
17
|
+
(0, _react.useEffect)(function () {
|
|
18
|
+
for (var i = 0; i < refs.length; i++) {
|
|
19
|
+
var ref = refs[i];
|
|
20
|
+
if (!ref) return;
|
|
21
|
+
|
|
22
|
+
if (typeof ref === 'function') {
|
|
23
|
+
ref(targetRef.current);
|
|
24
|
+
} else {
|
|
25
|
+
ref.current = targetRef.current;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, [refs]);
|
|
29
|
+
return targetRef;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.useCombinedRefs = useCombinedRefs;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import { Text, Button } from '@gympass/yoga';
|
|
4
|
+
import { ThemeProvider } from '../..';
|
|
5
|
+
import Accordion from '.';
|
|
6
|
+
describe('<Accordion />', function () {
|
|
7
|
+
afterEach(cleanup);
|
|
8
|
+
it('should match snapshot', function () {
|
|
9
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Accordion, {
|
|
10
|
+
title: "Title"
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Accordion.Content, null, /*#__PURE__*/React.createElement(Text, null, "Content"), /*#__PURE__*/React.createElement(Button, {
|
|
12
|
+
small: true,
|
|
13
|
+
inverted: true
|
|
14
|
+
}, "Small button"))))),
|
|
15
|
+
baseElement = _render.baseElement;
|
|
16
|
+
|
|
17
|
+
expect(baseElement).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { arrayOf, node, oneOfType, string } from 'prop-types';
|
|
7
|
+
import styled from 'styled-components/native';
|
|
8
|
+
import { View } from 'react-native';
|
|
9
|
+
import Box from '../../Box';
|
|
10
|
+
import { Title } from './ActionRequirementStyles';
|
|
11
|
+
import Text from '../../Text';
|
|
12
|
+
var StyledActionRequirement = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose([""])));
|
|
13
|
+
|
|
14
|
+
function ActionRequirement(props) {
|
|
15
|
+
var title = props.title,
|
|
16
|
+
description = props.description,
|
|
17
|
+
children = props.children,
|
|
18
|
+
checkable = props.checkable,
|
|
19
|
+
illustration = props.illustration,
|
|
20
|
+
list = props.list;
|
|
21
|
+
return /*#__PURE__*/React.createElement(StyledActionRequirement, props, illustration && /*#__PURE__*/React.createElement(Box, null, illustration), /*#__PURE__*/React.createElement(Title, null, title), /*#__PURE__*/React.createElement(Text, {
|
|
22
|
+
mt: "small",
|
|
23
|
+
color: "deep"
|
|
24
|
+
}, description), list && /*#__PURE__*/React.createElement(Text, {
|
|
25
|
+
mt: "small",
|
|
26
|
+
color: "deep"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
mt: "xxxlarge"
|
|
29
|
+
}, list)), checkable && /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
mt: "xxxlarge"
|
|
31
|
+
}, checkable), /*#__PURE__*/React.createElement(View, null, children));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ActionRequirement.propTypes = {
|
|
35
|
+
title: string.isRequired,
|
|
36
|
+
children: oneOfType([arrayOf(node), node]),
|
|
37
|
+
description: string.isRequired,
|
|
38
|
+
checkable: oneOfType([arrayOf(node), node]),
|
|
39
|
+
illustration: oneOfType([arrayOf(node), node]),
|
|
40
|
+
list: oneOfType([arrayOf(node), node])
|
|
41
|
+
};
|
|
42
|
+
ActionRequirement.defaultProps = {
|
|
43
|
+
children: undefined,
|
|
44
|
+
checkable: undefined,
|
|
45
|
+
illustration: undefined,
|
|
46
|
+
list: undefined
|
|
47
|
+
};
|
|
48
|
+
export default ActionRequirement;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react-native';
|
|
3
|
+
import { Box, Checkbox, Text } from '@gympass/yoga';
|
|
4
|
+
import { Img2d01 } from '@gympass/yoga-illustrations';
|
|
5
|
+
import { Dumbbell, User, Star } from '@gympass/yoga-icons';
|
|
6
|
+
import { ThemeProvider } from '../..';
|
|
7
|
+
import ActionRequirement from './ActionRequirement';
|
|
8
|
+
|
|
9
|
+
function handleGetCheckableContent() {
|
|
10
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "row",
|
|
13
|
+
alignItems: "center"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Checkbox, null), /*#__PURE__*/React.createElement(Text, null, "I have read and agree to the Terms of Use and Privacy Policy."));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function handleGetIllustration() {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Img2d01, {
|
|
19
|
+
width: 375,
|
|
20
|
+
height: 375
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function handleGetList() {
|
|
25
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(Dumbbell, null), " 1x/day standard access"), /*#__PURE__*/React.createElement(Text, {
|
|
26
|
+
mt: "small"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(User, null), " 4x/month 1-on-1 sessions"), /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
mt: "small"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Star, null), " 2x/month premium classes"));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('<ActionRequirement />', function () {
|
|
33
|
+
it('should match snapshot', function () {
|
|
34
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(ActionRequirement, {
|
|
35
|
+
title: "Welcome to the world of feeling good!",
|
|
36
|
+
description: "Lets make it a good day!",
|
|
37
|
+
illustration: handleGetIllustration(),
|
|
38
|
+
checkable: handleGetCheckableContent(),
|
|
39
|
+
list: handleGetList()
|
|
40
|
+
}))),
|
|
41
|
+
toJSON = _render.toJSON;
|
|
42
|
+
|
|
43
|
+
expect(toJSON()).toMatchSnapshot();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
|
+
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import Text from '../../Text/index.native';
|
|
7
|
+
import Box from '../../Box/index.native';
|
|
8
|
+
import Button from '../../Button/index.native';
|
|
9
|
+
export var Title = styled(Text.H4)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
10
|
+
var fontSizes = _ref.theme.yoga.fontSizes;
|
|
11
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n @media (min-width: 769px) {\n max-width: 700px;\n font-size: ", "px;\n line-height: ", "px;\n }\n "])), fontSizes.huge, fontSizes.huge);
|
|
12
|
+
});
|
|
13
|
+
export var Actions = styled(Box)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
|
|
14
|
+
var spacing = _ref2.theme.yoga.spacing;
|
|
15
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 769px) {\n flex-direction: row;\n margin-top: ", "px;\n }\n "])), spacing.xlarge);
|
|
16
|
+
});
|
|
17
|
+
var buttonsStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref3) {
|
|
18
|
+
var spacing = _ref3.theme.yoga.spacing;
|
|
19
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n width: 100%;\n\n :last-child(:not(:first-child)) {\n margin-top: ", "px;\n }\n\n @media (min-width: 769px) {\n width: auto;\n\n :last-child(:not(:first-child)) {\n margin-top: 0;\n margin-left: ", "px;\n }\n }\n "])), spacing.small, spacing.large);
|
|
20
|
+
});
|
|
21
|
+
export var PrimaryButton = styled(Button)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n ", "\n"])), buttonsStyles);
|
|
22
|
+
export var SecondaryButton = styled(Button.Text)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n ", "\n"])), buttonsStyles);
|
|
23
|
+
Title.displayName = 'ActionRequirement.Title';
|
|
24
|
+
PrimaryButton.displayName = 'ActionRequirement.PrimaryButton';
|
|
25
|
+
SecondaryButton.displayName = 'ActionRequirement.SecondaryButton';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ActionRequirement from './ActionRequirement';
|
|
2
|
+
import { Title, PrimaryButton, SecondaryButton } from './ActionRequirementStyles';
|
|
3
|
+
ActionRequirement.Title = Title;
|
|
4
|
+
ActionRequirement.PrimaryButton = PrimaryButton;
|
|
5
|
+
ActionRequirement.SecondaryButton = SecondaryButton;
|
|
6
|
+
export default ActionRequirement;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Text } from '@gympass/yoga';
|
|
4
|
+
import { Dumbbell, User, Star } from '@gympass/yoga-icons';
|
|
5
|
+
import ActionRequirement from './ActionRequirement';
|
|
6
|
+
import { ThemeProvider } from '../..';
|
|
7
|
+
|
|
8
|
+
function handleGetList() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(Dumbbell, null), " 1x/day standard access"), /*#__PURE__*/React.createElement(Text, {
|
|
10
|
+
mt: "small"
|
|
11
|
+
}, /*#__PURE__*/React.createElement(User, null), " 4x/month 1-on-1 sessions"), /*#__PURE__*/React.createElement(Text, {
|
|
12
|
+
mt: "small"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Star, null), " 2x/month premium classes"));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe('<ActionRequirement />', function () {
|
|
17
|
+
it('should default match snapshot', function () {
|
|
18
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(ActionRequirement, {
|
|
19
|
+
title: "title",
|
|
20
|
+
description: "description"
|
|
21
|
+
}))),
|
|
22
|
+
container = _render.container;
|
|
23
|
+
|
|
24
|
+
expect(container).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
it('should match snapshot with list', function () {
|
|
27
|
+
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(ActionRequirement, {
|
|
28
|
+
title: "title",
|
|
29
|
+
description: "description",
|
|
30
|
+
list: handleGetList()
|
|
31
|
+
}))),
|
|
32
|
+
container = _render2.container;
|
|
33
|
+
|
|
34
|
+
expect(container).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
});
|