@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.
Files changed (234) hide show
  1. package/cjs/Dialog/web/Dialog.js +12 -7
  2. package/cjs/Drawer/web/Drawer.js +5 -1
  3. package/cjs/Input/index.js +1 -0
  4. package/cjs/Input/web/Input.js +8 -3
  5. package/cjs/Input/web/Phone.js +144 -0
  6. package/cjs/Input/web/Phone.style.js +41 -0
  7. package/cjs/Input/web/data-images.js +10 -0
  8. package/cjs/Input/web/index.js +4 -0
  9. package/cjs/hooks/index.js +8 -0
  10. package/cjs/hooks/useCombinedRefs.js +32 -0
  11. package/esm/Accordion/web/Accordion.test.js +19 -0
  12. package/esm/ActionRequirement/index.native.js +2 -0
  13. package/esm/ActionRequirement/native/ActionRequirement.js +48 -0
  14. package/esm/ActionRequirement/native/ActionRequirement.test.js +45 -0
  15. package/esm/ActionRequirement/native/ActionRequirementStyles.js +25 -0
  16. package/esm/ActionRequirement/native/index.js +6 -0
  17. package/esm/ActionRequirement/web/ActionRequirement.test.js +36 -0
  18. package/esm/AutoComplete/web/AutoComplete.test.js +139 -0
  19. package/esm/Avatar/index.native.js +4 -0
  20. package/esm/Avatar/native/Avatar.js +96 -0
  21. package/esm/Avatar/native/Avatar.test.js +46 -0
  22. package/esm/Avatar/native/AvatarCircle.js +24 -0
  23. package/esm/Avatar/web/Avatar.test.js +63 -0
  24. package/esm/Banner/index.native.js +2 -0
  25. package/esm/Banner/native/Banner.js +128 -0
  26. package/esm/Banner/native/Banner.test.js +103 -0
  27. package/esm/Banner/native/index.js +2 -0
  28. package/esm/Banner/web/Banner.test.js +109 -0
  29. package/esm/BottomSheet/web/BottomSheet.test.js +48 -0
  30. package/esm/Box/index.native.js +2 -0
  31. package/esm/Box/native/Box.js +4 -0
  32. package/esm/Box/native/Box.test.js +16 -0
  33. package/esm/Box/native/index.js +2 -0
  34. package/esm/Box/web/Box.test.js +16 -0
  35. package/esm/Button/index.native.js +8 -0
  36. package/esm/Button/native/Button.js +110 -0
  37. package/esm/Button/native/Button.test.js +475 -0
  38. package/esm/Button/native/Icon.js +82 -0
  39. package/esm/Button/native/Link.js +35 -0
  40. package/esm/Button/native/Text.js +74 -0
  41. package/esm/Button/native/withTouchable.js +63 -0
  42. package/esm/Button/web/Button.test.js +772 -0
  43. package/esm/Card/index.native.js +2 -0
  44. package/esm/Card/native/Card/Actions.js +12 -0
  45. package/esm/Card/native/Card/Card.js +92 -0
  46. package/esm/Card/native/Card/Card.test.js +15 -0
  47. package/esm/Card/native/Card/Content.js +8 -0
  48. package/esm/Card/native/Card/Header.js +8 -0
  49. package/esm/Card/native/Card/index.js +8 -0
  50. package/esm/Card/native/EventCard/EventCard.js +169 -0
  51. package/esm/Card/native/EventCard/EventCard.test.js +65 -0
  52. package/esm/Card/native/EventCard/index.js +2 -0
  53. package/esm/Card/native/GymCard/CheckIn/Avatar.js +17 -0
  54. package/esm/Card/native/GymCard/CheckIn/CheckIn.js +66 -0
  55. package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +39 -0
  56. package/esm/Card/native/GymCard/CheckIn/Content.js +11 -0
  57. package/esm/Card/native/GymCard/CheckIn/Header.js +11 -0
  58. package/esm/Card/native/GymCard/CheckIn/index.js +2 -0
  59. package/esm/Card/native/GymCard/index.js +5 -0
  60. package/esm/Card/native/PlanCard/Actions.js +22 -0
  61. package/esm/Card/native/PlanCard/Content.js +75 -0
  62. package/esm/Card/native/PlanCard/List.js +73 -0
  63. package/esm/Card/native/PlanCard/PlanCard.js +51 -0
  64. package/esm/Card/native/PlanCard/PlanCard.test.js +84 -0
  65. package/esm/Card/native/PlanCard/Subtitle.js +15 -0
  66. package/esm/Card/native/PlanCard/Tag.js +34 -0
  67. package/esm/Card/native/PlanCard/index.js +15 -0
  68. package/esm/Card/native/index.js +5 -0
  69. package/esm/Card/web/Card/Card.test.js +14 -0
  70. package/esm/Card/web/EventCard/EventCard.test.js +27 -0
  71. package/esm/Card/web/PlanCard/PlanCard.test.js +94 -0
  72. package/esm/Checkbox/index.native.js +3 -0
  73. package/esm/Checkbox/native/Checkbox.js +179 -0
  74. package/esm/Checkbox/native/Checkbox.test.js +115 -0
  75. package/esm/Checkbox/native/Switch.js +115 -0
  76. package/esm/Checkbox/native/Switch.test.js +54 -0
  77. package/esm/Checkbox/native/index.js +3 -0
  78. package/esm/Checkbox/web/Checkbox.test.js +153 -0
  79. package/esm/Checkbox/web/Switch.test.js +56 -0
  80. package/esm/Chips/index.native.js +2 -0
  81. package/esm/Chips/native/Chips.js +104 -0
  82. package/esm/Chips/native/Chips.test.js +143 -0
  83. package/esm/Chips/native/Counter.js +20 -0
  84. package/esm/Chips/native/index.js +2 -0
  85. package/esm/Chips/web/Chips.test.js +128 -0
  86. package/esm/Datepicker/web/Datepicker.test.js +247 -0
  87. package/esm/Dialog/web/Dialog.js +13 -8
  88. package/esm/Dialog/web/Dialog.test.js +62 -0
  89. package/esm/Divider/index.native.js +2 -0
  90. package/esm/Divider/native/Divider.js +29 -0
  91. package/esm/Divider/native/Divider.test.js +29 -0
  92. package/esm/Divider/native/index.js +2 -0
  93. package/esm/Divider/web/Divider.test.js +29 -0
  94. package/esm/Drawer/web/Drawer.js +6 -2
  95. package/esm/Drawer/web/Drawer.test.js +33 -0
  96. package/esm/Dropdown/index.native.js +2 -0
  97. package/esm/Dropdown/native/Backdrop.js +93 -0
  98. package/esm/Dropdown/native/Backdrop.test.js +26 -0
  99. package/esm/Dropdown/native/Dropdown.js +142 -0
  100. package/esm/Dropdown/native/Dropdown.test.js +78 -0
  101. package/esm/Dropdown/native/Options.android.js +66 -0
  102. package/esm/Dropdown/native/Options.ios.js +71 -0
  103. package/esm/Dropdown/native/index.js +2 -0
  104. package/esm/Dropdown/web/Dropdown.test.js +93 -0
  105. package/esm/Feedback/web/Feedback.test.js +83 -0
  106. package/esm/Grid/web/Col.test.js +48 -0
  107. package/esm/Grid/web/Container.test.js +14 -0
  108. package/esm/Grid/web/Hide.test.js +31 -0
  109. package/esm/Grid/web/Row.test.js +14 -0
  110. package/esm/Header/web/Header.test.js +38 -0
  111. package/esm/Heading/web/Heading.test.js +58 -0
  112. package/esm/Icon/index.native.js +2 -0
  113. package/esm/Icon/native/Icon.test.js +47 -0
  114. package/esm/Icon/native/index.js +2 -0
  115. package/esm/Icon/web/Icon.test.js +47 -0
  116. package/esm/Input/index.js +2 -1
  117. package/esm/Input/index.native.js +6 -0
  118. package/esm/Input/native/Email.js +15 -0
  119. package/esm/Input/native/Email.test.js +13 -0
  120. package/esm/Input/native/Helper.js +62 -0
  121. package/esm/Input/native/Input.js +234 -0
  122. package/esm/Input/native/Input.test.js +181 -0
  123. package/esm/Input/native/Number.js +12 -0
  124. package/esm/Input/native/Number.test.js +13 -0
  125. package/esm/Input/native/Password.js +112 -0
  126. package/esm/Input/native/Password.test.js +125 -0
  127. package/esm/Input/native/Tel.js +14 -0
  128. package/esm/Input/native/Tel.test.js +13 -0
  129. package/esm/Input/native/index.js +6 -0
  130. package/esm/Input/web/Email.test.js +13 -0
  131. package/esm/Input/web/Input.js +9 -4
  132. package/esm/Input/web/Input.test.js +145 -0
  133. package/esm/Input/web/Number.test.js +13 -0
  134. package/esm/Input/web/Password.test.js +90 -0
  135. package/esm/Input/web/Phone.js +124 -0
  136. package/esm/Input/web/Phone.style.js +27 -0
  137. package/esm/Input/web/Phone.test.js +95 -0
  138. package/esm/Input/web/Tel.test.js +13 -0
  139. package/esm/Input/web/data-images.js +3 -0
  140. package/esm/Input/web/index.js +2 -1
  141. package/esm/List/index.native.js +3 -0
  142. package/esm/List/native/List.js +22 -0
  143. package/esm/List/native/List.test.js +106 -0
  144. package/esm/List/native/ListItem.js +51 -0
  145. package/esm/List/native/index.js +3 -0
  146. package/esm/List/web/List.test.js +62 -0
  147. package/esm/Menu/web/Menu.test.js +115 -0
  148. package/esm/Popover/web/Popover.test.js +19 -0
  149. package/esm/Progress/index.native.js +2 -0
  150. package/esm/Progress/native/Progress.js +103 -0
  151. package/esm/Progress/native/Progress.test.js +222 -0
  152. package/esm/Progress/native/index.js +2 -0
  153. package/esm/Progress/web/Progress.test.js +222 -0
  154. package/esm/RadioGroup/index.native.js +4 -0
  155. package/esm/RadioGroup/native/Button/RadioButton.js +64 -0
  156. package/esm/RadioGroup/native/Button/RadioButton.test.js +96 -0
  157. package/esm/RadioGroup/native/Radio/Radio.js +88 -0
  158. package/esm/RadioGroup/native/Radio/Radio.test.js +112 -0
  159. package/esm/RadioGroup/native/RadioGroup.js +66 -0
  160. package/esm/RadioGroup/native/RadioGroup.test.js +50 -0
  161. package/esm/RadioGroup/native/index.js +4 -0
  162. package/esm/RadioGroup/web/Button/RadioButton.test.js +121 -0
  163. package/esm/RadioGroup/web/Radio/Radio.test.js +108 -0
  164. package/esm/RadioGroup/web/RadioGroup.test.js +83 -0
  165. package/esm/Rating/index.native.js +2 -0
  166. package/esm/Rating/native/Rating.js +186 -0
  167. package/esm/Rating/native/Rating.test.js +121 -0
  168. package/esm/Rating/native/index.js +2 -0
  169. package/esm/Rating/web/Rating.test.js +184 -0
  170. package/esm/Result/index.native.js +8 -0
  171. package/esm/Result/native/Attendances.js +55 -0
  172. package/esm/Result/native/Details.js +97 -0
  173. package/esm/Result/native/Rate.js +35 -0
  174. package/esm/Result/native/Result.js +86 -0
  175. package/esm/Result/native/Result.test.js +107 -0
  176. package/esm/Result/native/ResultButton.js +13 -0
  177. package/esm/Result/native/Tags.js +41 -0
  178. package/esm/Result/native/TinyTextIcon.js +18 -0
  179. package/esm/Result/native/index.js +2 -0
  180. package/esm/Skeleton/index.native.js +2 -0
  181. package/esm/Skeleton/native/Skeleton.js +94 -0
  182. package/esm/Skeleton/native/Skeleton.test.js +78 -0
  183. package/esm/Skeleton/native/index.js +2 -0
  184. package/esm/Skeleton/web/Skeleton.test.js +77 -0
  185. package/esm/Slider/index.native.js +2 -0
  186. package/esm/Slider/native/Label.js +19 -0
  187. package/esm/Slider/native/Marker.js +68 -0
  188. package/esm/Slider/native/Slider.js +156 -0
  189. package/esm/Slider/native/Slider.test.js +122 -0
  190. package/esm/Slider/native/Step.js +14 -0
  191. package/esm/Slider/native/Tooltip.js +90 -0
  192. package/esm/Slider/web/Slider.test.js +86 -0
  193. package/esm/Snackbar/index.native.js +2 -0
  194. package/esm/Snackbar/native/Snackbar.js +199 -0
  195. package/esm/Snackbar/native/Snackbar.test.js +100 -0
  196. package/esm/Snackbar/native/SnackbarAnimationWrapper.js +124 -0
  197. package/esm/Snackbar/native/index.js +2 -0
  198. package/esm/Snackbar/web/Snackbar.test.js +118 -0
  199. package/esm/Stepper/index.native.js +3 -0
  200. package/esm/Stepper/native/Dots.js +45 -0
  201. package/esm/Stepper/native/Line.js +35 -0
  202. package/esm/Stepper/native/Step.js +19 -0
  203. package/esm/Stepper/native/Stepper.js +52 -0
  204. package/esm/Stepper/native/Stepper.test.js +70 -0
  205. package/esm/Stepper/native/index.js +3 -0
  206. package/esm/Stepper/web/Stepper.test.js +67 -0
  207. package/esm/Tag/index.native.js +4 -0
  208. package/esm/Tag/native/Informative.js +72 -0
  209. package/esm/Tag/native/Tag.js +75 -0
  210. package/esm/Tag/native/Tag.test.js +94 -0
  211. package/esm/Tag/native/index.js +2 -0
  212. package/esm/Tag/web/Tag.test.js +79 -0
  213. package/esm/Text/index.native.js +16 -0
  214. package/esm/Text/native/Text.js +69 -0
  215. package/esm/Text/native/Text.test.js +149 -0
  216. package/esm/Text/native/index.js +2 -0
  217. package/esm/Text/web/Text.test.js +149 -0
  218. package/esm/TextArea/index.native.js +2 -0
  219. package/esm/TextArea/native/TextArea.js +59 -0
  220. package/esm/TextArea/native/TextArea.test.js +11 -0
  221. package/esm/TextArea/native/index.js +2 -0
  222. package/esm/TextArea/web/TextArea.test.js +11 -0
  223. package/esm/Theme/Provider/index.native.js +2 -0
  224. package/esm/Theme/Provider/native/index.js +2 -0
  225. package/esm/Theme/Provider/web/FontLoader.test.js +11 -0
  226. package/esm/Theme/Provider/web/GlobalStyle.test.js +17 -0
  227. package/esm/Theme/helpers/themeReader/native/native.test.js +53 -0
  228. package/esm/Theme/helpers/themeReader/web/web.test.js +41 -0
  229. package/esm/Theme/index.native.js +5 -0
  230. package/esm/hooks/index.js +2 -1
  231. package/esm/hooks/useCombinedRefs.js +25 -0
  232. package/esm/index.native.js +26 -0
  233. package/esm/shared/index.native.js +2 -0
  234. package/package.json +4 -3
@@ -0,0 +1,66 @@
1
+ var _templateObject, _templateObject2;
2
+
3
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
4
+
5
+ import React from 'react';
6
+ import styled from 'styled-components';
7
+ import { func, arrayOf, string, shape, number, oneOfType } from 'prop-types';
8
+ import { TouchableWithoutFeedback } from 'react-native';
9
+ import Text from '../../Text';
10
+ import List from '../../List';
11
+ var Option = styled(List.Item)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
12
+ var isSelected = _ref.isSelected,
13
+ dropdown = _ref.theme.yoga.components.dropdown;
14
+ return "\n padding:\n " + dropdown.backdrop.content.option.padding.top + "px\n " + dropdown.backdrop.content.option.padding.right + "px\n " + dropdown.backdrop.content.option.padding.bottom + "px\n " + dropdown.backdrop.content.option.padding.left + "px;\n\n border-bottom-width: " + dropdown.option.border.width + "px;\n background-color: " + (isSelected ? "" + dropdown.hover.option.backgroundColor : 'transparent') + ";\n ";
15
+ });
16
+ var OptionText = styled.Text(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
17
+ var isSelected = _ref2.isSelected,
18
+ dropdown = _ref2.theme.yoga.components.dropdown;
19
+ return "\n font-size: " + dropdown.option.font.size + "px;\n line-height: " + dropdown.option.font.lineHeight + "px;\n color: " + (isSelected ? "" + dropdown.selected.option.font.color : "" + dropdown.option.font.color) + ";\n ";
20
+ });
21
+
22
+ var Options = function Options(_ref3) {
23
+ var options = _ref3.options,
24
+ selectedOption = _ref3.selectedOption,
25
+ onSelect = _ref3.onSelect;
26
+ return /*#__PURE__*/React.createElement(List, {
27
+ style: {
28
+ height: 60 * 3.6
29
+ },
30
+ data: options.map(function (item) {
31
+ return item;
32
+ }),
33
+ keyExtractor: function keyExtractor(_, index) {
34
+ return index.toString();
35
+ },
36
+ renderItem: function renderItem(_ref4) {
37
+ var item = _ref4.item;
38
+ return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
39
+ onPress: function onPress() {
40
+ return onSelect(item);
41
+ }
42
+ }, /*#__PURE__*/React.createElement(Option, {
43
+ key: item.value,
44
+ isSelected: selectedOption && selectedOption.value === item.value
45
+ }, /*#__PURE__*/React.createElement(OptionText, {
46
+ isSelected: selectedOption && selectedOption.value === item.value,
47
+ as: selectedOption && selectedOption.value === item.value ? Text.Bold : Text.Regular
48
+ }, item.label)));
49
+ }
50
+ });
51
+ };
52
+
53
+ var optionShape = {
54
+ label: string,
55
+ value: oneOfType([string, number])
56
+ };
57
+ Options.propTypes = {
58
+ options: arrayOf(shape(optionShape)).isRequired,
59
+ selectedOption: shape(optionShape),
60
+ onSelect: func
61
+ };
62
+ Options.defaultProps = {
63
+ selectedOption: null,
64
+ onSelect: function onSelect() {}
65
+ };
66
+ export default Options;
@@ -0,0 +1,71 @@
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);
@@ -0,0 +1,2 @@
1
+ import Dropdown from './Dropdown';
2
+ export default Dropdown;
@@ -0,0 +1,93 @@
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
+ });
@@ -0,0 +1,83 @@
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
+ });
@@ -0,0 +1,48 @@
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
+ });
@@ -0,0 +1,14 @@
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
+ });
@@ -0,0 +1,31 @@
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
+ });
@@ -0,0 +1,14 @@
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
+ });
@@ -0,0 +1,38 @@
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
+ });
@@ -0,0 +1,58 @@
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
+ });
@@ -0,0 +1,2 @@
1
+ import Icon from './native';
2
+ export default Icon;
@@ -0,0 +1,47 @@
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
+ });
@@ -0,0 +1,2 @@
1
+ import Icon from '../Icon';
2
+ export default Icon;
@@ -0,0 +1,47 @@
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,6 +1,7 @@
1
- import { Input, Password, Email, InputNumber, Tel } from './web';
1
+ import { Input, Password, Email, InputNumber, Tel, Phone } from './web';
2
2
  Input.Password = Password;
3
3
  Input.Email = Email;
4
4
  Input.Number = InputNumber;
5
5
  Input.Tel = Tel;
6
+ Input.Phone = Phone;
6
7
  export default Input;
@@ -0,0 +1,6 @@
1
+ import { Input, Password, Email, InputNumber, Tel } from './native';
2
+ Input.Password = Password;
3
+ Input.Email = Email;
4
+ Input.Number = InputNumber;
5
+ Input.Tel = Tel;
6
+ export default Input;
@@ -0,0 +1,15 @@
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;