@gympass/yoga 7.59.0 → 7.60.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/Card/web/PlanCard/Content.js +11 -6
- package/cjs/Drawer/web/Content.js +1 -4
- package/esm/Card/web/PlanCard/Content.js +11 -6
- package/esm/Drawer/web/Content.js +1 -4
- package/package.json +5 -5
- package/cjs/ActionRequirement/native/ActionRequirement.test.js +0 -1
- package/cjs/ActionRequirement/web/ActionRequirement.test.js +0 -40
- package/cjs/AutoComplete/web/AutoComplete.test.js +0 -156
- package/cjs/Avatar/native/Avatar.test.js +0 -1
- package/cjs/Avatar/web/Avatar.test.js +0 -72
- package/cjs/Banner/native/Banner.test.js +0 -1
- package/cjs/Banner/web/Banner.test.js +0 -121
- package/cjs/BottomSheet/web/BottomSheet.test.js +0 -61
- package/cjs/Box/native/Box.test.js +0 -1
- package/cjs/Box/web/Box.test.js +0 -23
- package/cjs/Button/native/Button.test.js +0 -1
- package/cjs/Button/web/Button.test.js +0 -778
- package/cjs/Card/native/Card/Card.test.js +0 -1
- package/cjs/Card/native/EventCard/EventCard.test.js +0 -1
- package/cjs/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -1
- package/cjs/Card/native/PlanCard/PlanCard.test.js +0 -1
- package/cjs/Card/web/Card/Card.test.js +0 -22
- package/cjs/Card/web/EventCard/EventCard.test.js +0 -35
- package/cjs/Card/web/PlanCard/PlanCard.test.js +0 -95
- package/cjs/Checkbox/native/Checkbox.test.js +0 -1
- package/cjs/Checkbox/native/Switch.test.js +0 -1
- package/cjs/Checkbox/web/Checkbox.test.js +0 -161
- package/cjs/Checkbox/web/Switch.test.js +0 -65
- package/cjs/Chips/native/Chips.test.js +0 -1
- package/cjs/Chips/web/Chips.test.js +0 -138
- package/cjs/Datepicker/web/Datepicker.test.js +0 -286
- package/cjs/Dialog/web/Dialog.test.js +0 -78
- package/cjs/Divider/native/Divider.test.js +0 -1
- package/cjs/Divider/web/Divider.test.js +0 -36
- package/cjs/Drawer/web/Drawer.test.js +0 -46
- package/cjs/Dropdown/native/Backdrop.test.js +0 -1
- package/cjs/Dropdown/native/Dropdown.test.js +0 -1
- package/cjs/Dropdown/web/Dropdown.test.js +0 -102
- package/cjs/Feedback/web/Feedback.test.js +0 -89
- package/cjs/Grid/web/Col.test.js +0 -56
- package/cjs/Grid/web/Container.test.js +0 -22
- package/cjs/Grid/web/Hide.test.js +0 -39
- package/cjs/Grid/web/Row.test.js +0 -22
- package/cjs/Header/web/Header.test.js +0 -49
- package/cjs/Heading/web/Heading.test.js +0 -68
- package/cjs/Icon/native/Icon.test.js +0 -1
- package/cjs/Icon/web/Icon.test.js +0 -53
- package/cjs/Input/native/Email.test.js +0 -1
- package/cjs/Input/native/Input.test.js +0 -1
- package/cjs/Input/native/Number.test.js +0 -1
- package/cjs/Input/native/Password.test.js +0 -1
- package/cjs/Input/native/Tel.test.js +0 -1
- package/cjs/Input/web/Email.test.js +0 -20
- package/cjs/Input/web/Input.test.js +0 -161
- package/cjs/Input/web/Number.test.js +0 -20
- package/cjs/Input/web/Password.test.js +0 -103
- package/cjs/Input/web/Tel.test.js +0 -20
- package/cjs/List/native/List.test.js +0 -1
- package/cjs/List/web/List.test.js +0 -69
- package/cjs/Menu/web/Menu.test.js +0 -123
- package/cjs/Popover/web/Popover.test.js +0 -27
- package/cjs/Progress/native/Progress.test.js +0 -1
- package/cjs/Progress/web/Progress.test.js +0 -229
- package/cjs/RadioGroup/native/Button/RadioButton.test.js +0 -1
- package/cjs/RadioGroup/native/Radio/Radio.test.js +0 -1
- package/cjs/RadioGroup/native/RadioGroup.test.js +0 -1
- package/cjs/RadioGroup/web/Button/RadioButton.test.js +0 -132
- package/cjs/RadioGroup/web/Radio/Radio.test.js +0 -119
- package/cjs/RadioGroup/web/RadioGroup.test.js +0 -93
- package/cjs/Rating/native/Rating.test.js +0 -1
- package/cjs/Rating/web/Rating.test.js +0 -201
- package/cjs/Result/native/Result.test.js +0 -1
- package/cjs/Skeleton/native/Skeleton.test.js +0 -1
- package/cjs/Skeleton/web/Skeleton.test.js +0 -84
- package/cjs/Slider/native/Slider.test.js +0 -1
- package/cjs/Slider/web/Slider.test.js +0 -95
- package/cjs/Snackbar/native/Snackbar.test.js +0 -1
- package/cjs/Snackbar/web/Snackbar.test.js +0 -137
- package/cjs/Stepper/native/Stepper.test.js +0 -1
- package/cjs/Stepper/web/Stepper.test.js +0 -75
- package/cjs/Tag/native/Tag.test.js +0 -1
- package/cjs/Tag/web/Tag.test.js +0 -87
- package/cjs/Text/native/Text.test.js +0 -1
- package/cjs/Text/web/Text.test.js +0 -157
- package/cjs/TextArea/native/TextArea.test.js +0 -1
- package/cjs/TextArea/web/TextArea.test.js +0 -18
- package/cjs/Theme/Provider/web/FontLoader.test.js +0 -19
- package/cjs/Theme/Provider/web/GlobalStyle.test.js +0 -27
- package/cjs/Theme/helpers/themeReader/native/native.test.js +0 -1
- package/cjs/Theme/helpers/themeReader/web/web.test.js +0 -54
- package/esm/ActionRequirement/index.native.js +0 -2
- package/esm/ActionRequirement/native/ActionRequirement.js +0 -48
- package/esm/ActionRequirement/native/ActionRequirement.test.js +0 -45
- package/esm/ActionRequirement/native/ActionRequirementStyles.js +0 -25
- package/esm/ActionRequirement/native/index.js +0 -6
- package/esm/ActionRequirement/web/ActionRequirement.test.js +0 -31
- package/esm/AutoComplete/web/AutoComplete.test.js +0 -139
- package/esm/Avatar/index.native.js +0 -4
- package/esm/Avatar/native/Avatar.js +0 -96
- package/esm/Avatar/native/Avatar.test.js +0 -46
- package/esm/Avatar/native/AvatarCircle.js +0 -24
- package/esm/Avatar/web/Avatar.test.js +0 -63
- package/esm/Banner/index.native.js +0 -2
- package/esm/Banner/native/Banner.js +0 -128
- package/esm/Banner/native/Banner.test.js +0 -103
- package/esm/Banner/native/index.js +0 -2
- package/esm/Banner/web/Banner.test.js +0 -109
- package/esm/BottomSheet/web/BottomSheet.test.js +0 -48
- package/esm/Box/index.native.js +0 -2
- package/esm/Box/native/Box.js +0 -4
- package/esm/Box/native/Box.test.js +0 -16
- package/esm/Box/native/index.js +0 -2
- package/esm/Box/web/Box.test.js +0 -16
- package/esm/Button/index.native.js +0 -8
- package/esm/Button/native/Button.js +0 -110
- package/esm/Button/native/Button.test.js +0 -475
- package/esm/Button/native/Icon.js +0 -82
- package/esm/Button/native/Link.js +0 -35
- package/esm/Button/native/Text.js +0 -74
- package/esm/Button/native/withTouchable.js +0 -63
- package/esm/Button/web/Button.test.js +0 -764
- package/esm/Card/index.native.js +0 -2
- package/esm/Card/native/Card/Actions.js +0 -12
- package/esm/Card/native/Card/Card.js +0 -92
- package/esm/Card/native/Card/Card.test.js +0 -15
- package/esm/Card/native/Card/Content.js +0 -8
- package/esm/Card/native/Card/Header.js +0 -8
- package/esm/Card/native/Card/index.js +0 -8
- package/esm/Card/native/EventCard/EventCard.js +0 -169
- package/esm/Card/native/EventCard/EventCard.test.js +0 -65
- package/esm/Card/native/EventCard/index.js +0 -2
- package/esm/Card/native/GymCard/CheckIn/Avatar.js +0 -17
- package/esm/Card/native/GymCard/CheckIn/CheckIn.js +0 -66
- package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -39
- package/esm/Card/native/GymCard/CheckIn/Content.js +0 -11
- package/esm/Card/native/GymCard/CheckIn/Header.js +0 -11
- package/esm/Card/native/GymCard/CheckIn/index.js +0 -2
- package/esm/Card/native/GymCard/index.js +0 -5
- package/esm/Card/native/PlanCard/Actions.js +0 -22
- package/esm/Card/native/PlanCard/Content.js +0 -75
- package/esm/Card/native/PlanCard/List.js +0 -73
- package/esm/Card/native/PlanCard/PlanCard.js +0 -51
- package/esm/Card/native/PlanCard/PlanCard.test.js +0 -84
- package/esm/Card/native/PlanCard/Subtitle.js +0 -15
- package/esm/Card/native/PlanCard/Tag.js +0 -34
- package/esm/Card/native/PlanCard/index.js +0 -15
- package/esm/Card/native/index.js +0 -5
- package/esm/Card/web/Card/Card.test.js +0 -14
- package/esm/Card/web/EventCard/EventCard.test.js +0 -27
- package/esm/Card/web/PlanCard/PlanCard.test.js +0 -85
- package/esm/Checkbox/index.native.js +0 -3
- package/esm/Checkbox/native/Checkbox.js +0 -179
- package/esm/Checkbox/native/Checkbox.test.js +0 -115
- package/esm/Checkbox/native/Switch.js +0 -115
- package/esm/Checkbox/native/Switch.test.js +0 -54
- package/esm/Checkbox/native/index.js +0 -3
- package/esm/Checkbox/web/Checkbox.test.js +0 -153
- package/esm/Checkbox/web/Switch.test.js +0 -56
- package/esm/Chips/index.native.js +0 -2
- package/esm/Chips/native/Chips.js +0 -104
- package/esm/Chips/native/Chips.test.js +0 -143
- package/esm/Chips/native/Counter.js +0 -20
- package/esm/Chips/native/index.js +0 -2
- package/esm/Chips/web/Chips.test.js +0 -128
- package/esm/Datepicker/web/Datepicker.test.js +0 -247
- package/esm/Dialog/web/Dialog.test.js +0 -62
- package/esm/Divider/index.native.js +0 -2
- package/esm/Divider/native/Divider.js +0 -29
- package/esm/Divider/native/Divider.test.js +0 -29
- package/esm/Divider/native/index.js +0 -2
- package/esm/Divider/web/Divider.test.js +0 -29
- package/esm/Drawer/web/Drawer.test.js +0 -33
- package/esm/Dropdown/index.native.js +0 -2
- package/esm/Dropdown/native/Backdrop.js +0 -93
- package/esm/Dropdown/native/Backdrop.test.js +0 -26
- package/esm/Dropdown/native/Dropdown.js +0 -142
- package/esm/Dropdown/native/Dropdown.test.js +0 -78
- package/esm/Dropdown/native/Options.android.js +0 -66
- package/esm/Dropdown/native/Options.ios.js +0 -71
- package/esm/Dropdown/native/index.js +0 -2
- package/esm/Dropdown/web/Dropdown.test.js +0 -93
- package/esm/Feedback/web/Feedback.test.js +0 -83
- package/esm/Grid/web/Col.test.js +0 -48
- package/esm/Grid/web/Container.test.js +0 -14
- package/esm/Grid/web/Hide.test.js +0 -31
- package/esm/Grid/web/Row.test.js +0 -14
- package/esm/Header/web/Header.test.js +0 -38
- package/esm/Heading/web/Heading.test.js +0 -58
- package/esm/Icon/index.native.js +0 -2
- package/esm/Icon/native/Icon.test.js +0 -47
- package/esm/Icon/native/index.js +0 -2
- package/esm/Icon/web/Icon.test.js +0 -47
- package/esm/Input/index.native.js +0 -6
- package/esm/Input/native/Email.js +0 -15
- package/esm/Input/native/Email.test.js +0 -13
- package/esm/Input/native/Helper.js +0 -62
- package/esm/Input/native/Input.js +0 -234
- package/esm/Input/native/Input.test.js +0 -181
- package/esm/Input/native/Number.js +0 -12
- package/esm/Input/native/Number.test.js +0 -13
- package/esm/Input/native/Password.js +0 -112
- package/esm/Input/native/Password.test.js +0 -125
- package/esm/Input/native/Tel.js +0 -14
- package/esm/Input/native/Tel.test.js +0 -13
- package/esm/Input/native/index.js +0 -6
- package/esm/Input/web/Email.test.js +0 -13
- package/esm/Input/web/Input.test.js +0 -145
- package/esm/Input/web/Number.test.js +0 -13
- package/esm/Input/web/Password.test.js +0 -90
- package/esm/Input/web/Tel.test.js +0 -13
- package/esm/List/index.native.js +0 -3
- package/esm/List/native/List.js +0 -22
- package/esm/List/native/List.test.js +0 -106
- package/esm/List/native/ListItem.js +0 -51
- package/esm/List/native/index.js +0 -3
- package/esm/List/web/List.test.js +0 -62
- package/esm/Menu/web/Menu.test.js +0 -115
- package/esm/Popover/web/Popover.test.js +0 -19
- package/esm/Progress/index.native.js +0 -2
- package/esm/Progress/native/Progress.js +0 -103
- package/esm/Progress/native/Progress.test.js +0 -222
- package/esm/Progress/native/index.js +0 -2
- package/esm/Progress/web/Progress.test.js +0 -222
- package/esm/RadioGroup/index.native.js +0 -4
- package/esm/RadioGroup/native/Button/RadioButton.js +0 -64
- package/esm/RadioGroup/native/Button/RadioButton.test.js +0 -96
- package/esm/RadioGroup/native/Radio/Radio.js +0 -88
- package/esm/RadioGroup/native/Radio/Radio.test.js +0 -112
- package/esm/RadioGroup/native/RadioGroup.js +0 -66
- package/esm/RadioGroup/native/RadioGroup.test.js +0 -50
- package/esm/RadioGroup/native/index.js +0 -4
- package/esm/RadioGroup/web/Button/RadioButton.test.js +0 -121
- package/esm/RadioGroup/web/Radio/Radio.test.js +0 -108
- package/esm/RadioGroup/web/RadioGroup.test.js +0 -83
- package/esm/Rating/index.native.js +0 -2
- package/esm/Rating/native/Rating.js +0 -186
- package/esm/Rating/native/Rating.test.js +0 -121
- package/esm/Rating/native/index.js +0 -2
- package/esm/Rating/web/Rating.test.js +0 -184
- package/esm/Result/index.native.js +0 -8
- package/esm/Result/native/Attendances.js +0 -55
- package/esm/Result/native/Details.js +0 -97
- package/esm/Result/native/Rate.js +0 -35
- package/esm/Result/native/Result.js +0 -86
- package/esm/Result/native/Result.test.js +0 -107
- package/esm/Result/native/ResultButton.js +0 -13
- package/esm/Result/native/Tags.js +0 -41
- package/esm/Result/native/TinyTextIcon.js +0 -18
- package/esm/Result/native/index.js +0 -2
- package/esm/Skeleton/index.native.js +0 -2
- package/esm/Skeleton/native/Skeleton.js +0 -94
- package/esm/Skeleton/native/Skeleton.test.js +0 -78
- package/esm/Skeleton/native/index.js +0 -2
- package/esm/Skeleton/web/Skeleton.test.js +0 -77
- package/esm/Slider/index.native.js +0 -2
- package/esm/Slider/native/Label.js +0 -19
- package/esm/Slider/native/Marker.js +0 -68
- package/esm/Slider/native/Slider.js +0 -156
- package/esm/Slider/native/Slider.test.js +0 -122
- package/esm/Slider/native/Step.js +0 -14
- package/esm/Slider/native/Tooltip.js +0 -90
- package/esm/Slider/web/Slider.test.js +0 -86
- package/esm/Snackbar/index.native.js +0 -2
- package/esm/Snackbar/native/Snackbar.js +0 -199
- package/esm/Snackbar/native/Snackbar.test.js +0 -100
- package/esm/Snackbar/native/SnackbarAnimationWrapper.js +0 -124
- package/esm/Snackbar/native/index.js +0 -2
- package/esm/Snackbar/web/Snackbar.test.js +0 -118
- package/esm/Stepper/index.native.js +0 -3
- package/esm/Stepper/native/Dots.js +0 -45
- package/esm/Stepper/native/Line.js +0 -35
- package/esm/Stepper/native/Step.js +0 -19
- package/esm/Stepper/native/Stepper.js +0 -52
- package/esm/Stepper/native/Stepper.test.js +0 -70
- package/esm/Stepper/native/index.js +0 -3
- package/esm/Stepper/web/Stepper.test.js +0 -67
- package/esm/Tag/index.native.js +0 -4
- package/esm/Tag/native/Informative.js +0 -72
- package/esm/Tag/native/Tag.js +0 -75
- package/esm/Tag/native/Tag.test.js +0 -94
- package/esm/Tag/native/index.js +0 -2
- package/esm/Tag/web/Tag.test.js +0 -79
- package/esm/Text/index.native.js +0 -16
- package/esm/Text/native/Text.js +0 -69
- package/esm/Text/native/Text.test.js +0 -149
- package/esm/Text/native/index.js +0 -2
- package/esm/Text/web/Text.test.js +0 -149
- package/esm/TextArea/index.native.js +0 -2
- package/esm/TextArea/native/TextArea.js +0 -59
- package/esm/TextArea/native/TextArea.test.js +0 -11
- package/esm/TextArea/native/index.js +0 -2
- package/esm/TextArea/web/TextArea.test.js +0 -11
- package/esm/Theme/Provider/index.native.js +0 -2
- package/esm/Theme/Provider/native/index.js +0 -2
- package/esm/Theme/Provider/web/FontLoader.test.js +0 -11
- package/esm/Theme/Provider/web/GlobalStyle.test.js +0 -17
- package/esm/Theme/helpers/themeReader/native/native.test.js +0 -53
- package/esm/Theme/helpers/themeReader/web/web.test.js +0 -41
- package/esm/Theme/index.native.js +0 -5
- package/esm/index.native.js +0 -26
- package/esm/shared/index.native.js +0 -2
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var _templateObject, _templateObject2;
|
|
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
|
-
|
|
5
|
-
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
6
|
-
|
|
7
|
-
import React, { useState } from 'react';
|
|
8
|
-
import styled, { withTheme } from 'styled-components';
|
|
9
|
-
import { func, arrayOf, string, shape, oneOfType, number } from 'prop-types';
|
|
10
|
-
import { Picker } from '@react-native-picker/picker';
|
|
11
|
-
import Button from '../../Button';
|
|
12
|
-
var PickerStyled = styled(Picker)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 190px;\n"])));
|
|
13
|
-
var PickerActions = styled.View(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
14
|
-
var dropdown = _ref.theme.yoga.components.dropdown;
|
|
15
|
-
return "\n flex-direction: row;\n justify-content: space-between;\n\n padding:\n " + dropdown.backdrop.content.actions.padding.top + "px\n " + dropdown.backdrop.content.actions.padding.right + "px\n " + dropdown.backdrop.content.actions.padding.bottom + "px\n " + dropdown.backdrop.content.actions.padding.left + "px;\n ";
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
var Options = function Options(_ref2) {
|
|
19
|
-
var options = _ref2.options,
|
|
20
|
-
selectedOption = _ref2.selectedOption,
|
|
21
|
-
cancelActionLabel = _ref2.cancelActionLabel,
|
|
22
|
-
confirmActionLabel = _ref2.confirmActionLabel,
|
|
23
|
-
onSelect = _ref2.onSelect,
|
|
24
|
-
onClose = _ref2.onClose,
|
|
25
|
-
baseFont = _ref2.theme.yoga.baseFont;
|
|
26
|
-
|
|
27
|
-
var _useState = useState(selectedOption),
|
|
28
|
-
selected = _useState[0],
|
|
29
|
-
setSelected = _useState[1];
|
|
30
|
-
|
|
31
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PickerStyled, {
|
|
32
|
-
selectedValue: selected && selected.value,
|
|
33
|
-
onValueChange: function onValueChange(itemValue) {
|
|
34
|
-
return setSelected(options.find(function (option) {
|
|
35
|
-
return option.value === itemValue;
|
|
36
|
-
}));
|
|
37
|
-
},
|
|
38
|
-
itemStyle: {
|
|
39
|
-
fontFamily: baseFont.family
|
|
40
|
-
}
|
|
41
|
-
}, options.map(function (item) {
|
|
42
|
-
return /*#__PURE__*/React.createElement(Picker.Item, _extends({
|
|
43
|
-
key: item
|
|
44
|
-
}, item));
|
|
45
|
-
})), /*#__PURE__*/React.createElement(PickerActions, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
46
|
-
onPress: onClose
|
|
47
|
-
}, cancelActionLabel), /*#__PURE__*/React.createElement(Button.Link, {
|
|
48
|
-
onPress: function onPress() {
|
|
49
|
-
return onSelect(selected);
|
|
50
|
-
}
|
|
51
|
-
}, confirmActionLabel)));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var optionShape = {
|
|
55
|
-
label: string,
|
|
56
|
-
value: oneOfType([string, number])
|
|
57
|
-
};
|
|
58
|
-
Options.propTypes = {
|
|
59
|
-
options: arrayOf(shape(optionShape)).isRequired,
|
|
60
|
-
selectedOption: shape(optionShape),
|
|
61
|
-
cancelActionLabel: string.isRequired,
|
|
62
|
-
confirmActionLabel: string.isRequired,
|
|
63
|
-
onSelect: func,
|
|
64
|
-
onClose: func
|
|
65
|
-
};
|
|
66
|
-
Options.defaultProps = {
|
|
67
|
-
selectedOption: null,
|
|
68
|
-
onSelect: function onSelect() {},
|
|
69
|
-
onClose: function onClose() {}
|
|
70
|
-
};
|
|
71
|
-
export default withTheme(Options);
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
5
|
-
import { ThemeProvider, Dropdown } from '../..';
|
|
6
|
-
var dropdownProps = {
|
|
7
|
-
label: 'Find an activity to love',
|
|
8
|
-
options: [{
|
|
9
|
-
label: 'Yoga',
|
|
10
|
-
value: 'yoga'
|
|
11
|
-
}, {
|
|
12
|
-
label: 'Crossfit',
|
|
13
|
-
value: 'crossfit'
|
|
14
|
-
}, {
|
|
15
|
-
label: 'Tenis',
|
|
16
|
-
value: 'tenis'
|
|
17
|
-
}, {
|
|
18
|
-
label: 'Soccer',
|
|
19
|
-
value: 'soccer'
|
|
20
|
-
}, {
|
|
21
|
-
label: 'Pilates',
|
|
22
|
-
value: 'pilates'
|
|
23
|
-
}, {
|
|
24
|
-
label: 'Run',
|
|
25
|
-
value: 'running'
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
describe('<Dropdown />', function () {
|
|
29
|
-
it('should match snapshot', function () {
|
|
30
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, dropdownProps))),
|
|
31
|
-
container = _render.container;
|
|
32
|
-
|
|
33
|
-
expect(container).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
it('should match snapshot when disabled', function () {
|
|
36
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, _extends({}, dropdownProps, {
|
|
37
|
-
disabled: true
|
|
38
|
-
})))),
|
|
39
|
-
container = _render2.container;
|
|
40
|
-
|
|
41
|
-
expect(container).toMatchSnapshot();
|
|
42
|
-
});
|
|
43
|
-
it('should match snapshot when full', function () {
|
|
44
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, _extends({}, dropdownProps, {
|
|
45
|
-
full: true
|
|
46
|
-
})))),
|
|
47
|
-
container = _render3.container;
|
|
48
|
-
|
|
49
|
-
expect(container).toMatchSnapshot();
|
|
50
|
-
});
|
|
51
|
-
it('should match snapshot when has a selected value', function () {
|
|
52
|
-
var selectedOption = {
|
|
53
|
-
label: 'Swimming',
|
|
54
|
-
value: 'swimming',
|
|
55
|
-
selected: true
|
|
56
|
-
};
|
|
57
|
-
var props = dropdownProps;
|
|
58
|
-
props.options.push(selectedOption);
|
|
59
|
-
|
|
60
|
-
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, _extends({}, props, {
|
|
61
|
-
disabled: true
|
|
62
|
-
})))),
|
|
63
|
-
container = _render4.container;
|
|
64
|
-
|
|
65
|
-
expect(container).toMatchSnapshot();
|
|
66
|
-
});
|
|
67
|
-
it('should match snapshot with error', function () {
|
|
68
|
-
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, _extends({}, dropdownProps, {
|
|
69
|
-
error: "Please, select one activity"
|
|
70
|
-
})))),
|
|
71
|
-
container = _render5.container;
|
|
72
|
-
|
|
73
|
-
expect(container).toMatchSnapshot();
|
|
74
|
-
});
|
|
75
|
-
it('should make label visible when open dropdown', function () {
|
|
76
|
-
var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, dropdownProps))),
|
|
77
|
-
getByRole = _render6.getByRole;
|
|
78
|
-
|
|
79
|
-
fireEvent.click(getByRole('button'));
|
|
80
|
-
screen.getAllByText('Find an activity to love');
|
|
81
|
-
});
|
|
82
|
-
it('should make label visible when has a selected option', function () {
|
|
83
|
-
var selectedOption = {
|
|
84
|
-
label: 'Swimming',
|
|
85
|
-
value: 'swimming',
|
|
86
|
-
selected: true
|
|
87
|
-
};
|
|
88
|
-
var props = dropdownProps;
|
|
89
|
-
props.options.push(selectedOption);
|
|
90
|
-
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Dropdown, props)));
|
|
91
|
-
screen.getAllByText('Find an activity to love');
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider, Feedback } from '../..';
|
|
4
|
-
|
|
5
|
-
function renderWithTheme(ui) {
|
|
6
|
-
return render(ui, {
|
|
7
|
-
wrapper: ThemeProvider
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var title = 'Welcome to Yoga';
|
|
12
|
-
var description = 'Enjoy your membership!';
|
|
13
|
-
describe('<Feedback />', function () {
|
|
14
|
-
it('should render the title and description', function () {
|
|
15
|
-
var _renderWithTheme = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
16
|
-
variant: "success",
|
|
17
|
-
title: title,
|
|
18
|
-
description: description
|
|
19
|
-
})),
|
|
20
|
-
getByText = _renderWithTheme.getByText;
|
|
21
|
-
|
|
22
|
-
expect(getByText(title)).toBeTruthy();
|
|
23
|
-
expect(getByText(description)).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
it('should render the title children', function () {
|
|
26
|
-
var _renderWithTheme2 = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
27
|
-
variant: "success",
|
|
28
|
-
description: "Enjoy your membership!"
|
|
29
|
-
}, /*#__PURE__*/React.createElement(Feedback.Title, {
|
|
30
|
-
as: "h1"
|
|
31
|
-
}, title))),
|
|
32
|
-
getByRole = _renderWithTheme2.getByRole;
|
|
33
|
-
|
|
34
|
-
expect(getByRole('heading', {
|
|
35
|
-
name: title
|
|
36
|
-
})).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
it('should render the buttons', function () {
|
|
39
|
-
var _renderWithTheme3 = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
40
|
-
variant: "success",
|
|
41
|
-
title: title,
|
|
42
|
-
description: description
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Feedback.PrimaryButton, null, "Ok"), /*#__PURE__*/React.createElement(Feedback.SecondaryButton, null, "Cancel"))),
|
|
44
|
-
getByRole = _renderWithTheme3.getByRole;
|
|
45
|
-
|
|
46
|
-
expect(getByRole('button', {
|
|
47
|
-
name: 'Ok'
|
|
48
|
-
})).toBeTruthy();
|
|
49
|
-
expect(getByRole('button', {
|
|
50
|
-
name: 'Cancel'
|
|
51
|
-
})).toBeTruthy();
|
|
52
|
-
});
|
|
53
|
-
it('should render the icon for success variant', function () {
|
|
54
|
-
var _renderWithTheme4 = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
55
|
-
variant: "success",
|
|
56
|
-
title: title,
|
|
57
|
-
description: description
|
|
58
|
-
})),
|
|
59
|
-
getByTestId = _renderWithTheme4.getByTestId;
|
|
60
|
-
|
|
61
|
-
expect(getByTestId('feedback-icon')).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
it('should render the icon for informative variant', function () {
|
|
64
|
-
var _renderWithTheme5 = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
65
|
-
variant: "informative",
|
|
66
|
-
title: title,
|
|
67
|
-
description: description
|
|
68
|
-
})),
|
|
69
|
-
getByTestId = _renderWithTheme5.getByTestId;
|
|
70
|
-
|
|
71
|
-
expect(getByTestId('feedback-icon')).toMatchSnapshot();
|
|
72
|
-
});
|
|
73
|
-
it('should render the icon for attention variant', function () {
|
|
74
|
-
var _renderWithTheme6 = renderWithTheme( /*#__PURE__*/React.createElement(Feedback, {
|
|
75
|
-
variant: "attention",
|
|
76
|
-
title: title,
|
|
77
|
-
description: description
|
|
78
|
-
})),
|
|
79
|
-
getByTestId = _renderWithTheme6.getByTestId;
|
|
80
|
-
|
|
81
|
-
expect(getByTestId('feedback-icon')).toMatchSnapshot();
|
|
82
|
-
});
|
|
83
|
-
});
|
package/esm/Grid/web/Col.test.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider } from '../..';
|
|
4
|
-
import { Col } from '.';
|
|
5
|
-
describe('<Col />', function () {
|
|
6
|
-
describe('Snapshots', function () {
|
|
7
|
-
it('should match snapshot with default Col', function () {
|
|
8
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Col, null))),
|
|
9
|
-
container = _render.container;
|
|
10
|
-
|
|
11
|
-
expect(container).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
it('should match snapshot with different Col size', function () {
|
|
14
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Col, {
|
|
15
|
-
xxs: 6
|
|
16
|
-
}))),
|
|
17
|
-
container = _render2.container;
|
|
18
|
-
|
|
19
|
-
expect(container).toMatchSnapshot();
|
|
20
|
-
});
|
|
21
|
-
it('should be the same column size from medium to xxxl', function () {
|
|
22
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Col, {
|
|
23
|
-
md: 6
|
|
24
|
-
}))),
|
|
25
|
-
container = _render3.container;
|
|
26
|
-
|
|
27
|
-
expect(container).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
it('should set column offsets', function () {
|
|
30
|
-
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Col, {
|
|
31
|
-
"md-start": 3,
|
|
32
|
-
md: 6
|
|
33
|
-
}))),
|
|
34
|
-
container = _render4.container;
|
|
35
|
-
|
|
36
|
-
expect(container).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
it('should hide Col in a xs and xm breakpoints', function () {
|
|
39
|
-
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Col, {
|
|
40
|
-
hide: ['xs', 'sm'],
|
|
41
|
-
md: 6
|
|
42
|
-
}))),
|
|
43
|
-
container = _render5.container;
|
|
44
|
-
|
|
45
|
-
expect(container).toMatchSnapshot();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider } from '../..';
|
|
4
|
-
import { Container } from '.';
|
|
5
|
-
describe('<Container />', function () {
|
|
6
|
-
describe('Snapshots', function () {
|
|
7
|
-
it('should match snapshot with default Container', function () {
|
|
8
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Container, null))),
|
|
9
|
-
container = _render.container;
|
|
10
|
-
|
|
11
|
-
expect(container).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider } from '../..';
|
|
4
|
-
import { Hide } from '.';
|
|
5
|
-
describe('<Hide />', function () {
|
|
6
|
-
describe('Snapshots', function () {
|
|
7
|
-
it('should match snapshot', function () {
|
|
8
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Hide, {
|
|
9
|
-
xxs: true,
|
|
10
|
-
xs: true,
|
|
11
|
-
sm: true,
|
|
12
|
-
md: true,
|
|
13
|
-
lg: true,
|
|
14
|
-
xl: true,
|
|
15
|
-
xxl: true,
|
|
16
|
-
xxxl: true
|
|
17
|
-
}, /*#__PURE__*/React.createElement("div", null, "foo")))),
|
|
18
|
-
container = _render.container;
|
|
19
|
-
|
|
20
|
-
expect(container).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
it('should hide starting from md breakpoint', function () {
|
|
23
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Hide, {
|
|
24
|
-
"md-start": true
|
|
25
|
-
}, /*#__PURE__*/React.createElement("div", null, "foo")))),
|
|
26
|
-
container = _render2.container;
|
|
27
|
-
|
|
28
|
-
expect(container).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
package/esm/Grid/web/Row.test.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider } from '../..';
|
|
4
|
-
import { Row } from '.';
|
|
5
|
-
describe('<Row />', function () {
|
|
6
|
-
describe('Snapshots', function () {
|
|
7
|
-
it('should match snapshot with default Row', function () {
|
|
8
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Row, null))),
|
|
9
|
-
container = _render.container;
|
|
10
|
-
|
|
11
|
-
expect(container).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { screen, render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider, Header } from '../..';
|
|
4
|
-
describe('<Header />', function () {
|
|
5
|
-
it('should match snapshot', function () {
|
|
6
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Header, null))),
|
|
7
|
-
container = _render.container;
|
|
8
|
-
|
|
9
|
-
expect(container).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
it('should have link', function () {
|
|
12
|
-
var gympassLink = 'https://site.gympass.com/br';
|
|
13
|
-
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Header, {
|
|
14
|
-
link: gympassLink
|
|
15
|
-
})));
|
|
16
|
-
screen.getByRole('link', {
|
|
17
|
-
href: gympassLink
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
it('should show gympass logo', function () {
|
|
21
|
-
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Header, null)));
|
|
22
|
-
screen.getByTitle('Gympass Logo');
|
|
23
|
-
});
|
|
24
|
-
it('should show custom logo', function () {
|
|
25
|
-
var CustomLogo = function CustomLogo() {
|
|
26
|
-
return /*#__PURE__*/React.createElement("div", null, "Custom logo");
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Header, {
|
|
30
|
-
logo: CustomLogo
|
|
31
|
-
})));
|
|
32
|
-
screen.getByText('Custom logo');
|
|
33
|
-
});
|
|
34
|
-
it('should show children', function () {
|
|
35
|
-
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("p", null, "Make wellbeing universal"))));
|
|
36
|
-
screen.getByText('Make wellbeing universal');
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { Upload2 } from '@gympass/yoga-icons/src';
|
|
4
|
-
import { ThemeProvider, Heading } from '../..';
|
|
5
|
-
import Title from './Title';
|
|
6
|
-
import BackButton from './BackButton';
|
|
7
|
-
import RightButton from './RightButton';
|
|
8
|
-
|
|
9
|
-
var onClick = function onClick() {};
|
|
10
|
-
|
|
11
|
-
describe('<Heading />', function () {
|
|
12
|
-
it('should match snapshot with title', function () {
|
|
13
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Heading, null, /*#__PURE__*/React.createElement(Title, null, "Gympass")))),
|
|
14
|
-
container = _render.container;
|
|
15
|
-
|
|
16
|
-
expect(container).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
it('should match snapshot with title and back button', function () {
|
|
19
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Heading, null, /*#__PURE__*/React.createElement(Title, null, "Gympass"), /*#__PURE__*/React.createElement(BackButton, {
|
|
20
|
-
onClick: onClick
|
|
21
|
-
})))),
|
|
22
|
-
container = _render2.container;
|
|
23
|
-
|
|
24
|
-
expect(container).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
it('should match snapshot with all components', function () {
|
|
27
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Heading, null, /*#__PURE__*/React.createElement(Title, null, "Gympass"), /*#__PURE__*/React.createElement(BackButton, {
|
|
28
|
-
onClick: onClick
|
|
29
|
-
}), /*#__PURE__*/React.createElement(RightButton, {
|
|
30
|
-
icon: Upload2,
|
|
31
|
-
onClick: onClick
|
|
32
|
-
})))),
|
|
33
|
-
container = _render3.container;
|
|
34
|
-
|
|
35
|
-
expect(container).toMatchSnapshot();
|
|
36
|
-
});
|
|
37
|
-
it('should match snapshot with back button', function () {
|
|
38
|
-
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Heading, null, /*#__PURE__*/React.createElement(BackButton, {
|
|
39
|
-
onClick: onClick
|
|
40
|
-
})))),
|
|
41
|
-
container = _render4.container;
|
|
42
|
-
|
|
43
|
-
expect(container).toMatchSnapshot();
|
|
44
|
-
});
|
|
45
|
-
it('should match snapshot no padding', function () {
|
|
46
|
-
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Heading, {
|
|
47
|
-
noPadding: true
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Title, null, "Gympass"), /*#__PURE__*/React.createElement(BackButton, {
|
|
49
|
-
onClick: onClick
|
|
50
|
-
}), /*#__PURE__*/React.createElement(RightButton, {
|
|
51
|
-
icon: Upload2,
|
|
52
|
-
onClick: onClick
|
|
53
|
-
})))),
|
|
54
|
-
container = _render5.container;
|
|
55
|
-
|
|
56
|
-
expect(container).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
});
|
package/esm/Icon/index.native.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react-native';
|
|
3
|
-
import { ThemeProvider, Icon } from '../..';
|
|
4
|
-
|
|
5
|
-
var Circle = function Circle(props) {
|
|
6
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("circle", {
|
|
7
|
-
cx: "16",
|
|
8
|
-
cy: "16",
|
|
9
|
-
r: "16"
|
|
10
|
-
}));
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
describe('Snapshots', function () {
|
|
14
|
-
it('should match snapshot', function () {
|
|
15
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
16
|
-
as: Circle,
|
|
17
|
-
width: "small",
|
|
18
|
-
height: "small",
|
|
19
|
-
fill: "stamina"
|
|
20
|
-
}))),
|
|
21
|
-
toJSON = _render.toJSON;
|
|
22
|
-
|
|
23
|
-
expect(toJSON()).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
it('should match snapshot with size prop', function () {
|
|
26
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
27
|
-
as: Circle,
|
|
28
|
-
size: "small",
|
|
29
|
-
fill: "stamina"
|
|
30
|
-
}))),
|
|
31
|
-
toJSON = _render2.toJSON;
|
|
32
|
-
|
|
33
|
-
expect(toJSON()).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
it('should match snapshot with system props', function () {
|
|
36
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
-
as: Circle,
|
|
38
|
-
size: "small",
|
|
39
|
-
fill: "stamina",
|
|
40
|
-
margin: "medium",
|
|
41
|
-
elevation: "medium"
|
|
42
|
-
}))),
|
|
43
|
-
toJSON = _render3.toJSON;
|
|
44
|
-
|
|
45
|
-
expect(toJSON()).toMatchSnapshot();
|
|
46
|
-
});
|
|
47
|
-
});
|
package/esm/Icon/native/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider, Icon } from '../..';
|
|
4
|
-
|
|
5
|
-
var Circle = function Circle(props) {
|
|
6
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("circle", {
|
|
7
|
-
cx: "16",
|
|
8
|
-
cy: "16",
|
|
9
|
-
r: "16"
|
|
10
|
-
}));
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
describe('Snapshots', function () {
|
|
14
|
-
it('should match snapshot', function () {
|
|
15
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
16
|
-
as: Circle,
|
|
17
|
-
width: "small",
|
|
18
|
-
height: "small",
|
|
19
|
-
fill: "stamina"
|
|
20
|
-
}))),
|
|
21
|
-
container = _render.container;
|
|
22
|
-
|
|
23
|
-
expect(container).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
it('should match snapshot with size prop', function () {
|
|
26
|
-
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
27
|
-
as: Circle,
|
|
28
|
-
size: "small",
|
|
29
|
-
fill: "stamina"
|
|
30
|
-
}))),
|
|
31
|
-
container = _render2.container;
|
|
32
|
-
|
|
33
|
-
expect(container).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
it('should match snapshot with system props', function () {
|
|
36
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
-
as: Circle,
|
|
38
|
-
size: "small",
|
|
39
|
-
fill: "stamina",
|
|
40
|
-
margin: "medium",
|
|
41
|
-
elevation: "medium"
|
|
42
|
-
}))),
|
|
43
|
-
container = _render3.container;
|
|
44
|
-
|
|
45
|
-
expect(container).toMatchSnapshot();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import Input from './Input';
|
|
5
|
-
var Email = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
6
|
-
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
7
|
-
ref: ref
|
|
8
|
-
}, props, {
|
|
9
|
-
autoCompleteType: "email",
|
|
10
|
-
autoCapitalize: "none",
|
|
11
|
-
keyboardType: "email-address",
|
|
12
|
-
textContentType: "emailAddress"
|
|
13
|
-
}));
|
|
14
|
-
});
|
|
15
|
-
export default Email;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react-native';
|
|
3
|
-
import { ThemeProvider, Input } from '../..';
|
|
4
|
-
describe('<Input.Email />', function () {
|
|
5
|
-
describe('Snapshots', function () {
|
|
6
|
-
it('should match with default input', function () {
|
|
7
|
-
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Input.Email, null))),
|
|
8
|
-
toJSON = _render.toJSON;
|
|
9
|
-
|
|
10
|
-
expect(toJSON()).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { string, bool, number } from 'prop-types';
|
|
4
|
-
import Text from '../../Text';
|
|
5
|
-
var HelperWrapper = styled.View(function (_ref) {
|
|
6
|
-
var full = _ref.full,
|
|
7
|
-
input = _ref.theme.yoga.components.input;
|
|
8
|
-
return "\n width: " + (full ? '100%' : input.width + "px") + ";\n max-width: " + input.width + "px;\n flex-direction: row;\n justify-content: space-between;\n\n margin-top: " + input.helper.margin.top + "px;\n ";
|
|
9
|
-
});
|
|
10
|
-
var Info = styled(Text.Regular)(function (_ref2) {
|
|
11
|
-
var disabled = _ref2.disabled,
|
|
12
|
-
focused = _ref2.focused,
|
|
13
|
-
error = _ref2.error,
|
|
14
|
-
_ref2$theme$yoga = _ref2.theme.yoga,
|
|
15
|
-
colors = _ref2$theme$yoga.colors,
|
|
16
|
-
input = _ref2$theme$yoga.components.input;
|
|
17
|
-
return "\n flex-wrap: wrap;\n\n color: " + input.helper.color["default"] + ";\n font-size: " + input.helper.font.size + "px;\n\n " + (disabled ? "color: " + colors.text.disabled + ";" : '') + "\n " + (focused ? "color: " + input.helper.color.focus + ";" : '') + "\n " + (error ? "color: " + colors.feedback.attention.dark + ";" : '') + "\n ";
|
|
18
|
-
});
|
|
19
|
-
var Helper = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
20
|
-
var full = _ref3.full,
|
|
21
|
-
error = _ref3.error,
|
|
22
|
-
helper = _ref3.helper,
|
|
23
|
-
disabled = _ref3.disabled,
|
|
24
|
-
focused = _ref3.focused,
|
|
25
|
-
maxLength = _ref3.maxLength,
|
|
26
|
-
length = _ref3.length,
|
|
27
|
-
hideMaxLength = _ref3.hideMaxLength;
|
|
28
|
-
return /*#__PURE__*/React.createElement(HelperWrapper, {
|
|
29
|
-
ref: ref,
|
|
30
|
-
full: full,
|
|
31
|
-
disabled: disabled
|
|
32
|
-
}, (error || helper) && /*#__PURE__*/React.createElement(Info, {
|
|
33
|
-
disabled: disabled,
|
|
34
|
-
focused: focused,
|
|
35
|
-
error: error
|
|
36
|
-
}, error || helper), !hideMaxLength && maxLength && /*#__PURE__*/React.createElement(Info, {
|
|
37
|
-
disabled: disabled,
|
|
38
|
-
focused: focused,
|
|
39
|
-
error: error
|
|
40
|
-
}, length, "/", maxLength));
|
|
41
|
-
});
|
|
42
|
-
Helper.propTypes = {
|
|
43
|
-
disabled: bool,
|
|
44
|
-
error: string,
|
|
45
|
-
focused: bool,
|
|
46
|
-
full: bool,
|
|
47
|
-
helper: string,
|
|
48
|
-
maxLength: number,
|
|
49
|
-
length: number,
|
|
50
|
-
hideMaxLength: bool
|
|
51
|
-
};
|
|
52
|
-
Helper.defaultProps = {
|
|
53
|
-
disabled: undefined,
|
|
54
|
-
error: undefined,
|
|
55
|
-
focused: false,
|
|
56
|
-
full: false,
|
|
57
|
-
helper: undefined,
|
|
58
|
-
maxLength: undefined,
|
|
59
|
-
length: undefined,
|
|
60
|
-
hideMaxLength: false
|
|
61
|
-
};
|
|
62
|
-
export default Helper;
|