@gympass/yoga 7.60.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.
Files changed (299) hide show
  1. package/cjs/Drawer/web/Content.js +1 -4
  2. package/esm/Drawer/web/Content.js +1 -4
  3. package/package.json +5 -5
  4. package/cjs/ActionRequirement/native/ActionRequirement.test.js +0 -1
  5. package/cjs/ActionRequirement/web/ActionRequirement.test.js +0 -40
  6. package/cjs/AutoComplete/web/AutoComplete.test.js +0 -156
  7. package/cjs/Avatar/native/Avatar.test.js +0 -1
  8. package/cjs/Avatar/web/Avatar.test.js +0 -72
  9. package/cjs/Banner/native/Banner.test.js +0 -1
  10. package/cjs/Banner/web/Banner.test.js +0 -121
  11. package/cjs/BottomSheet/web/BottomSheet.test.js +0 -61
  12. package/cjs/Box/native/Box.test.js +0 -1
  13. package/cjs/Box/web/Box.test.js +0 -23
  14. package/cjs/Button/native/Button.test.js +0 -1
  15. package/cjs/Button/web/Button.test.js +0 -778
  16. package/cjs/Card/native/Card/Card.test.js +0 -1
  17. package/cjs/Card/native/EventCard/EventCard.test.js +0 -1
  18. package/cjs/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -1
  19. package/cjs/Card/native/PlanCard/PlanCard.test.js +0 -1
  20. package/cjs/Card/web/Card/Card.test.js +0 -22
  21. package/cjs/Card/web/EventCard/EventCard.test.js +0 -35
  22. package/cjs/Card/web/PlanCard/PlanCard.test.js +0 -104
  23. package/cjs/Checkbox/native/Checkbox.test.js +0 -1
  24. package/cjs/Checkbox/native/Switch.test.js +0 -1
  25. package/cjs/Checkbox/web/Checkbox.test.js +0 -161
  26. package/cjs/Checkbox/web/Switch.test.js +0 -65
  27. package/cjs/Chips/native/Chips.test.js +0 -1
  28. package/cjs/Chips/web/Chips.test.js +0 -138
  29. package/cjs/Datepicker/web/Datepicker.test.js +0 -286
  30. package/cjs/Dialog/web/Dialog.test.js +0 -78
  31. package/cjs/Divider/native/Divider.test.js +0 -1
  32. package/cjs/Divider/web/Divider.test.js +0 -36
  33. package/cjs/Drawer/web/Drawer.test.js +0 -46
  34. package/cjs/Dropdown/native/Backdrop.test.js +0 -1
  35. package/cjs/Dropdown/native/Dropdown.test.js +0 -1
  36. package/cjs/Dropdown/web/Dropdown.test.js +0 -102
  37. package/cjs/Feedback/web/Feedback.test.js +0 -89
  38. package/cjs/Grid/web/Col.test.js +0 -56
  39. package/cjs/Grid/web/Container.test.js +0 -22
  40. package/cjs/Grid/web/Hide.test.js +0 -39
  41. package/cjs/Grid/web/Row.test.js +0 -22
  42. package/cjs/Header/web/Header.test.js +0 -49
  43. package/cjs/Heading/web/Heading.test.js +0 -68
  44. package/cjs/Icon/native/Icon.test.js +0 -1
  45. package/cjs/Icon/web/Icon.test.js +0 -53
  46. package/cjs/Input/native/Email.test.js +0 -1
  47. package/cjs/Input/native/Input.test.js +0 -1
  48. package/cjs/Input/native/Number.test.js +0 -1
  49. package/cjs/Input/native/Password.test.js +0 -1
  50. package/cjs/Input/native/Tel.test.js +0 -1
  51. package/cjs/Input/web/Email.test.js +0 -20
  52. package/cjs/Input/web/Input.test.js +0 -161
  53. package/cjs/Input/web/Number.test.js +0 -20
  54. package/cjs/Input/web/Password.test.js +0 -103
  55. package/cjs/Input/web/Tel.test.js +0 -20
  56. package/cjs/List/native/List.test.js +0 -1
  57. package/cjs/List/web/List.test.js +0 -69
  58. package/cjs/Menu/web/Menu.test.js +0 -123
  59. package/cjs/Popover/web/Popover.test.js +0 -27
  60. package/cjs/Progress/native/Progress.test.js +0 -1
  61. package/cjs/Progress/web/Progress.test.js +0 -229
  62. package/cjs/RadioGroup/native/Button/RadioButton.test.js +0 -1
  63. package/cjs/RadioGroup/native/Radio/Radio.test.js +0 -1
  64. package/cjs/RadioGroup/native/RadioGroup.test.js +0 -1
  65. package/cjs/RadioGroup/web/Button/RadioButton.test.js +0 -132
  66. package/cjs/RadioGroup/web/Radio/Radio.test.js +0 -119
  67. package/cjs/RadioGroup/web/RadioGroup.test.js +0 -93
  68. package/cjs/Rating/native/Rating.test.js +0 -1
  69. package/cjs/Rating/web/Rating.test.js +0 -201
  70. package/cjs/Result/native/Result.test.js +0 -1
  71. package/cjs/Skeleton/native/Skeleton.test.js +0 -1
  72. package/cjs/Skeleton/web/Skeleton.test.js +0 -84
  73. package/cjs/Slider/native/Slider.test.js +0 -1
  74. package/cjs/Slider/web/Slider.test.js +0 -95
  75. package/cjs/Snackbar/native/Snackbar.test.js +0 -1
  76. package/cjs/Snackbar/web/Snackbar.test.js +0 -137
  77. package/cjs/Stepper/native/Stepper.test.js +0 -1
  78. package/cjs/Stepper/web/Stepper.test.js +0 -75
  79. package/cjs/Tag/native/Tag.test.js +0 -1
  80. package/cjs/Tag/web/Tag.test.js +0 -87
  81. package/cjs/Text/native/Text.test.js +0 -1
  82. package/cjs/Text/web/Text.test.js +0 -157
  83. package/cjs/TextArea/native/TextArea.test.js +0 -1
  84. package/cjs/TextArea/web/TextArea.test.js +0 -18
  85. package/cjs/Theme/Provider/web/FontLoader.test.js +0 -19
  86. package/cjs/Theme/Provider/web/GlobalStyle.test.js +0 -27
  87. package/cjs/Theme/helpers/themeReader/native/native.test.js +0 -1
  88. package/cjs/Theme/helpers/themeReader/web/web.test.js +0 -54
  89. package/esm/ActionRequirement/index.native.js +0 -2
  90. package/esm/ActionRequirement/native/ActionRequirement.js +0 -48
  91. package/esm/ActionRequirement/native/ActionRequirement.test.js +0 -45
  92. package/esm/ActionRequirement/native/ActionRequirementStyles.js +0 -25
  93. package/esm/ActionRequirement/native/index.js +0 -6
  94. package/esm/ActionRequirement/web/ActionRequirement.test.js +0 -31
  95. package/esm/AutoComplete/web/AutoComplete.test.js +0 -139
  96. package/esm/Avatar/index.native.js +0 -4
  97. package/esm/Avatar/native/Avatar.js +0 -96
  98. package/esm/Avatar/native/Avatar.test.js +0 -46
  99. package/esm/Avatar/native/AvatarCircle.js +0 -24
  100. package/esm/Avatar/web/Avatar.test.js +0 -63
  101. package/esm/Banner/index.native.js +0 -2
  102. package/esm/Banner/native/Banner.js +0 -128
  103. package/esm/Banner/native/Banner.test.js +0 -103
  104. package/esm/Banner/native/index.js +0 -2
  105. package/esm/Banner/web/Banner.test.js +0 -109
  106. package/esm/BottomSheet/web/BottomSheet.test.js +0 -48
  107. package/esm/Box/index.native.js +0 -2
  108. package/esm/Box/native/Box.js +0 -4
  109. package/esm/Box/native/Box.test.js +0 -16
  110. package/esm/Box/native/index.js +0 -2
  111. package/esm/Box/web/Box.test.js +0 -16
  112. package/esm/Button/index.native.js +0 -8
  113. package/esm/Button/native/Button.js +0 -110
  114. package/esm/Button/native/Button.test.js +0 -475
  115. package/esm/Button/native/Icon.js +0 -82
  116. package/esm/Button/native/Link.js +0 -35
  117. package/esm/Button/native/Text.js +0 -74
  118. package/esm/Button/native/withTouchable.js +0 -63
  119. package/esm/Button/web/Button.test.js +0 -764
  120. package/esm/Card/index.native.js +0 -2
  121. package/esm/Card/native/Card/Actions.js +0 -12
  122. package/esm/Card/native/Card/Card.js +0 -92
  123. package/esm/Card/native/Card/Card.test.js +0 -15
  124. package/esm/Card/native/Card/Content.js +0 -8
  125. package/esm/Card/native/Card/Header.js +0 -8
  126. package/esm/Card/native/Card/index.js +0 -8
  127. package/esm/Card/native/EventCard/EventCard.js +0 -169
  128. package/esm/Card/native/EventCard/EventCard.test.js +0 -65
  129. package/esm/Card/native/EventCard/index.js +0 -2
  130. package/esm/Card/native/GymCard/CheckIn/Avatar.js +0 -17
  131. package/esm/Card/native/GymCard/CheckIn/CheckIn.js +0 -66
  132. package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -39
  133. package/esm/Card/native/GymCard/CheckIn/Content.js +0 -11
  134. package/esm/Card/native/GymCard/CheckIn/Header.js +0 -11
  135. package/esm/Card/native/GymCard/CheckIn/index.js +0 -2
  136. package/esm/Card/native/GymCard/index.js +0 -5
  137. package/esm/Card/native/PlanCard/Actions.js +0 -22
  138. package/esm/Card/native/PlanCard/Content.js +0 -75
  139. package/esm/Card/native/PlanCard/List.js +0 -73
  140. package/esm/Card/native/PlanCard/PlanCard.js +0 -51
  141. package/esm/Card/native/PlanCard/PlanCard.test.js +0 -84
  142. package/esm/Card/native/PlanCard/Subtitle.js +0 -15
  143. package/esm/Card/native/PlanCard/Tag.js +0 -34
  144. package/esm/Card/native/PlanCard/index.js +0 -15
  145. package/esm/Card/native/index.js +0 -5
  146. package/esm/Card/web/Card/Card.test.js +0 -14
  147. package/esm/Card/web/EventCard/EventCard.test.js +0 -27
  148. package/esm/Card/web/PlanCard/PlanCard.test.js +0 -94
  149. package/esm/Checkbox/index.native.js +0 -3
  150. package/esm/Checkbox/native/Checkbox.js +0 -179
  151. package/esm/Checkbox/native/Checkbox.test.js +0 -115
  152. package/esm/Checkbox/native/Switch.js +0 -115
  153. package/esm/Checkbox/native/Switch.test.js +0 -54
  154. package/esm/Checkbox/native/index.js +0 -3
  155. package/esm/Checkbox/web/Checkbox.test.js +0 -153
  156. package/esm/Checkbox/web/Switch.test.js +0 -56
  157. package/esm/Chips/index.native.js +0 -2
  158. package/esm/Chips/native/Chips.js +0 -104
  159. package/esm/Chips/native/Chips.test.js +0 -143
  160. package/esm/Chips/native/Counter.js +0 -20
  161. package/esm/Chips/native/index.js +0 -2
  162. package/esm/Chips/web/Chips.test.js +0 -128
  163. package/esm/Datepicker/web/Datepicker.test.js +0 -247
  164. package/esm/Dialog/web/Dialog.test.js +0 -62
  165. package/esm/Divider/index.native.js +0 -2
  166. package/esm/Divider/native/Divider.js +0 -29
  167. package/esm/Divider/native/Divider.test.js +0 -29
  168. package/esm/Divider/native/index.js +0 -2
  169. package/esm/Divider/web/Divider.test.js +0 -29
  170. package/esm/Drawer/web/Drawer.test.js +0 -33
  171. package/esm/Dropdown/index.native.js +0 -2
  172. package/esm/Dropdown/native/Backdrop.js +0 -93
  173. package/esm/Dropdown/native/Backdrop.test.js +0 -26
  174. package/esm/Dropdown/native/Dropdown.js +0 -142
  175. package/esm/Dropdown/native/Dropdown.test.js +0 -78
  176. package/esm/Dropdown/native/Options.android.js +0 -66
  177. package/esm/Dropdown/native/Options.ios.js +0 -71
  178. package/esm/Dropdown/native/index.js +0 -2
  179. package/esm/Dropdown/web/Dropdown.test.js +0 -93
  180. package/esm/Feedback/web/Feedback.test.js +0 -83
  181. package/esm/Grid/web/Col.test.js +0 -48
  182. package/esm/Grid/web/Container.test.js +0 -14
  183. package/esm/Grid/web/Hide.test.js +0 -31
  184. package/esm/Grid/web/Row.test.js +0 -14
  185. package/esm/Header/web/Header.test.js +0 -38
  186. package/esm/Heading/web/Heading.test.js +0 -58
  187. package/esm/Icon/index.native.js +0 -2
  188. package/esm/Icon/native/Icon.test.js +0 -47
  189. package/esm/Icon/native/index.js +0 -2
  190. package/esm/Icon/web/Icon.test.js +0 -47
  191. package/esm/Input/index.native.js +0 -6
  192. package/esm/Input/native/Email.js +0 -15
  193. package/esm/Input/native/Email.test.js +0 -13
  194. package/esm/Input/native/Helper.js +0 -62
  195. package/esm/Input/native/Input.js +0 -234
  196. package/esm/Input/native/Input.test.js +0 -181
  197. package/esm/Input/native/Number.js +0 -12
  198. package/esm/Input/native/Number.test.js +0 -13
  199. package/esm/Input/native/Password.js +0 -112
  200. package/esm/Input/native/Password.test.js +0 -125
  201. package/esm/Input/native/Tel.js +0 -14
  202. package/esm/Input/native/Tel.test.js +0 -13
  203. package/esm/Input/native/index.js +0 -6
  204. package/esm/Input/web/Email.test.js +0 -13
  205. package/esm/Input/web/Input.test.js +0 -145
  206. package/esm/Input/web/Number.test.js +0 -13
  207. package/esm/Input/web/Password.test.js +0 -90
  208. package/esm/Input/web/Tel.test.js +0 -13
  209. package/esm/List/index.native.js +0 -3
  210. package/esm/List/native/List.js +0 -22
  211. package/esm/List/native/List.test.js +0 -106
  212. package/esm/List/native/ListItem.js +0 -51
  213. package/esm/List/native/index.js +0 -3
  214. package/esm/List/web/List.test.js +0 -62
  215. package/esm/Menu/web/Menu.test.js +0 -115
  216. package/esm/Popover/web/Popover.test.js +0 -19
  217. package/esm/Progress/index.native.js +0 -2
  218. package/esm/Progress/native/Progress.js +0 -103
  219. package/esm/Progress/native/Progress.test.js +0 -222
  220. package/esm/Progress/native/index.js +0 -2
  221. package/esm/Progress/web/Progress.test.js +0 -222
  222. package/esm/RadioGroup/index.native.js +0 -4
  223. package/esm/RadioGroup/native/Button/RadioButton.js +0 -64
  224. package/esm/RadioGroup/native/Button/RadioButton.test.js +0 -96
  225. package/esm/RadioGroup/native/Radio/Radio.js +0 -88
  226. package/esm/RadioGroup/native/Radio/Radio.test.js +0 -112
  227. package/esm/RadioGroup/native/RadioGroup.js +0 -66
  228. package/esm/RadioGroup/native/RadioGroup.test.js +0 -50
  229. package/esm/RadioGroup/native/index.js +0 -4
  230. package/esm/RadioGroup/web/Button/RadioButton.test.js +0 -121
  231. package/esm/RadioGroup/web/Radio/Radio.test.js +0 -108
  232. package/esm/RadioGroup/web/RadioGroup.test.js +0 -83
  233. package/esm/Rating/index.native.js +0 -2
  234. package/esm/Rating/native/Rating.js +0 -186
  235. package/esm/Rating/native/Rating.test.js +0 -121
  236. package/esm/Rating/native/index.js +0 -2
  237. package/esm/Rating/web/Rating.test.js +0 -184
  238. package/esm/Result/index.native.js +0 -8
  239. package/esm/Result/native/Attendances.js +0 -55
  240. package/esm/Result/native/Details.js +0 -97
  241. package/esm/Result/native/Rate.js +0 -35
  242. package/esm/Result/native/Result.js +0 -86
  243. package/esm/Result/native/Result.test.js +0 -107
  244. package/esm/Result/native/ResultButton.js +0 -13
  245. package/esm/Result/native/Tags.js +0 -41
  246. package/esm/Result/native/TinyTextIcon.js +0 -18
  247. package/esm/Result/native/index.js +0 -2
  248. package/esm/Skeleton/index.native.js +0 -2
  249. package/esm/Skeleton/native/Skeleton.js +0 -94
  250. package/esm/Skeleton/native/Skeleton.test.js +0 -78
  251. package/esm/Skeleton/native/index.js +0 -2
  252. package/esm/Skeleton/web/Skeleton.test.js +0 -77
  253. package/esm/Slider/index.native.js +0 -2
  254. package/esm/Slider/native/Label.js +0 -19
  255. package/esm/Slider/native/Marker.js +0 -68
  256. package/esm/Slider/native/Slider.js +0 -156
  257. package/esm/Slider/native/Slider.test.js +0 -122
  258. package/esm/Slider/native/Step.js +0 -14
  259. package/esm/Slider/native/Tooltip.js +0 -90
  260. package/esm/Slider/web/Slider.test.js +0 -86
  261. package/esm/Snackbar/index.native.js +0 -2
  262. package/esm/Snackbar/native/Snackbar.js +0 -199
  263. package/esm/Snackbar/native/Snackbar.test.js +0 -100
  264. package/esm/Snackbar/native/SnackbarAnimationWrapper.js +0 -124
  265. package/esm/Snackbar/native/index.js +0 -2
  266. package/esm/Snackbar/web/Snackbar.test.js +0 -118
  267. package/esm/Stepper/index.native.js +0 -3
  268. package/esm/Stepper/native/Dots.js +0 -45
  269. package/esm/Stepper/native/Line.js +0 -35
  270. package/esm/Stepper/native/Step.js +0 -19
  271. package/esm/Stepper/native/Stepper.js +0 -52
  272. package/esm/Stepper/native/Stepper.test.js +0 -70
  273. package/esm/Stepper/native/index.js +0 -3
  274. package/esm/Stepper/web/Stepper.test.js +0 -67
  275. package/esm/Tag/index.native.js +0 -4
  276. package/esm/Tag/native/Informative.js +0 -72
  277. package/esm/Tag/native/Tag.js +0 -75
  278. package/esm/Tag/native/Tag.test.js +0 -94
  279. package/esm/Tag/native/index.js +0 -2
  280. package/esm/Tag/web/Tag.test.js +0 -79
  281. package/esm/Text/index.native.js +0 -16
  282. package/esm/Text/native/Text.js +0 -69
  283. package/esm/Text/native/Text.test.js +0 -149
  284. package/esm/Text/native/index.js +0 -2
  285. package/esm/Text/web/Text.test.js +0 -149
  286. package/esm/TextArea/index.native.js +0 -2
  287. package/esm/TextArea/native/TextArea.js +0 -59
  288. package/esm/TextArea/native/TextArea.test.js +0 -11
  289. package/esm/TextArea/native/index.js +0 -2
  290. package/esm/TextArea/web/TextArea.test.js +0 -11
  291. package/esm/Theme/Provider/index.native.js +0 -2
  292. package/esm/Theme/Provider/native/index.js +0 -2
  293. package/esm/Theme/Provider/web/FontLoader.test.js +0 -11
  294. package/esm/Theme/Provider/web/GlobalStyle.test.js +0 -17
  295. package/esm/Theme/helpers/themeReader/native/native.test.js +0 -53
  296. package/esm/Theme/helpers/themeReader/web/web.test.js +0 -41
  297. package/esm/Theme/index.native.js +0 -5
  298. package/esm/index.native.js +0 -26
  299. package/esm/shared/index.native.js +0 -2
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import { ThemeProvider, Box } from '../..';
4
- describe('<Box />', function () {
5
- it('should match snapshot', function () {
6
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Box, {
7
- b: "small",
8
- p: "small",
9
- borderRadius: "small",
10
- color: "feedback.success.dark"
11
- }, "Making wellbeing universal"))),
12
- container = _render.container;
13
-
14
- expect(container).toMatchSnapshot();
15
- });
16
- });
@@ -1,8 +0,0 @@
1
- import Button from './native/Button';
2
- import ButtonText from './native/Text';
3
- import ButtonLink from './native/Link';
4
- import ButtonIcon from './native/Icon';
5
- Button.Text = ButtonText;
6
- Button.Link = ButtonLink;
7
- Button.Icon = ButtonIcon;
8
- export default Button;
@@ -1,110 +0,0 @@
1
- var _excluded = ["children", "full", "disabled", "small", "pressed", "inverted", "secondary", "icon", "theme"];
2
-
3
- var _templateObject, _templateObject2;
4
-
5
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
-
7
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
-
9
- function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
10
-
11
- import React, { forwardRef } from 'react';
12
- import styled, { withTheme } from 'styled-components';
13
- import { node, oneOfType, func, bool } from 'prop-types';
14
- import withTouchable from './withTouchable';
15
- import Text from '../../Text';
16
- var Label = styled(Text.Medium)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n text-align: center;\n ", "\n"])), function (_ref) {
17
- var small = _ref.small,
18
- color = _ref.color,
19
- button = _ref.theme.yoga.components.button;
20
- return "\n font-size: " + (small ? button.font.size.small : button.font.size["default"]) + "px;\n color: " + color + ";\n ";
21
- });
22
- var ButtonContainer = styled.View(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
23
- var pressed = _ref2.pressed,
24
- disabled = _ref2.disabled,
25
- full = _ref2.full,
26
- small = _ref2.small,
27
- inverted = _ref2.inverted,
28
- secondary = _ref2.secondary,
29
- button = _ref2.theme.yoga.components.button;
30
- var state = secondary ? 'secondary' : 'primary';
31
- return "\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n background-color: " + button.types.contained.backgroundColor[state]["default"] + ";\n border-radius: " + button.border.radius + "px;\n height: " + (small ? button.height.small : button.height["default"]) + ";\n justify-content: center;\n padding-left: " + (small ? button.padding.small.left : button.padding["default"].left) + "px;\n padding-right: " + (small ? button.padding.small.right : button.padding["default"].right) + "px;\n " + (full ? 'width: 100%;' : '') + "\n\n " + (!disabled && pressed ? "\n background-color: " + button.types.contained.backgroundColor[state].pressed + ";\n " : '') + "\n\n " + (disabled ? "\n background-color: " + button.types.contained.backgroundColor.disabled + ";\n " : '') + "\n\n " + (inverted && !disabled ? "\n background-color: " + button.types.contained.font["default"].color + ";\n " : '') + "\n ";
32
- });
33
- /** Buttons make common actions more obvious and help users more easily perform
34
- them. Buttons use labels and sometimes icons to communicate the action that will
35
- occur when the user touches them. */
36
-
37
- var Button = /*#__PURE__*/forwardRef(function (_ref3, ref) {
38
- var children = _ref3.children,
39
- full = _ref3.full,
40
- disabled = _ref3.disabled,
41
- small = _ref3.small,
42
- pressed = _ref3.pressed,
43
- inverted = _ref3.inverted,
44
- secondary = _ref3.secondary,
45
- Icon = _ref3.icon,
46
- button = _ref3.theme.yoga.components.button,
47
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
48
-
49
- var state = secondary ? 'secondary' : 'primary';
50
- var textColor = button.types.contained.font["default"].color;
51
-
52
- if (disabled) {
53
- textColor = button.types.contained.font.disabled.color;
54
- } else if (inverted) {
55
- textColor = button.types.contained.backgroundColor[state]["default"];
56
-
57
- if (pressed) {
58
- textColor = button.types.contained.backgroundColor[state].pressed;
59
- }
60
- } else if (pressed) {
61
- textColor = button.types.contained.font.pressed.color;
62
- }
63
-
64
- return /*#__PURE__*/React.createElement(ButtonContainer, _extends({}, rest, {
65
- full: full,
66
- pressed: pressed,
67
- disabled: disabled,
68
- small: small,
69
- inverted: inverted,
70
- secondary: secondary,
71
- ref: ref
72
- }), Icon && /*#__PURE__*/React.createElement(Icon, {
73
- width: small ? button.icon.size.small : button.icon.size["default"],
74
- height: small ? button.icon.size.small : button.icon.size["default"],
75
- fill: textColor,
76
- style: {
77
- marginRight: button.icon.margin.right
78
- }
79
- }), /*#__PURE__*/React.createElement(Label, {
80
- disabled: disabled,
81
- pressed: pressed,
82
- inverted: inverted,
83
- small: small,
84
- color: textColor
85
- }, children));
86
- });
87
- Button.propTypes = {
88
- children: node,
89
- full: bool,
90
- disabled: bool,
91
- small: bool,
92
- pressed: bool,
93
- inverted: bool,
94
- secondary: bool,
95
-
96
- /** an Icon from yoga-icons package */
97
- icon: oneOfType([bool, func])
98
- };
99
- Button.defaultProps = {
100
- children: 'Button',
101
- full: false,
102
- disabled: false,
103
- small: false,
104
- pressed: false,
105
- inverted: false,
106
- secondary: false,
107
- icon: undefined
108
- };
109
- var ButtonWithTouchable = withTouchable(withTheme(Button));
110
- export { Label, ButtonContainer, ButtonWithTouchable as default };
@@ -1,475 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@testing-library/react-native';
3
- import { Booking } from '@gympass/yoga-icons';
4
- import ThemeProvider from '../../Theme';
5
- import Button from '..';
6
- describe('<Button />', function () {
7
- describe('Snapshots', function () {
8
- describe('primary buttons', function () {
9
- describe('Without props', function () {
10
- it('should match snapshot with default Button', function () {
11
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, null))),
12
- toJSON = _render.toJSON;
13
-
14
- expect(toJSON()).toMatchSnapshot();
15
- });
16
- it('should match snapshot with text Button', function () {
17
- var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, null))),
18
- toJSON = _render2.toJSON;
19
-
20
- expect(toJSON()).toMatchSnapshot();
21
- });
22
- it('should match snapshot with link Button', function () {
23
- var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, null))),
24
- toJSON = _render3.toJSON;
25
-
26
- expect(toJSON()).toMatchSnapshot();
27
- });
28
- it('should match snapshot with default Button with Icon', function () {
29
- var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
30
- icon: Booking
31
- }))),
32
- toJSON = _render4.toJSON;
33
-
34
- expect(toJSON()).toMatchSnapshot();
35
- });
36
- it('should match snapshot with text Button with Icon', function () {
37
- var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
38
- icon: Booking
39
- }))),
40
- toJSON = _render5.toJSON;
41
-
42
- expect(toJSON()).toMatchSnapshot();
43
- });
44
- });
45
- describe('With inverted prop', function () {
46
- it('should match snapshot with default Button', function () {
47
- var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
48
- inverted: true
49
- }))),
50
- toJSON = _render6.toJSON;
51
-
52
- expect(toJSON()).toMatchSnapshot();
53
- });
54
- it('should match snapshot with text Button', function () {
55
- var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
56
- inverted: true
57
- }))),
58
- toJSON = _render7.toJSON;
59
-
60
- expect(toJSON()).toMatchSnapshot();
61
- });
62
- it('should match snapshot with default Button with Icon', function () {
63
- var _render8 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
64
- inverted: true,
65
- icon: Booking
66
- }))),
67
- toJSON = _render8.toJSON;
68
-
69
- expect(toJSON()).toMatchSnapshot();
70
- });
71
- it('should match snapshot with text Button with Icon', function () {
72
- var _render9 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
73
- inverted: true,
74
- icon: Booking
75
- }))),
76
- toJSON = _render9.toJSON;
77
-
78
- expect(toJSON()).toMatchSnapshot();
79
- });
80
- it('should match snapshot with icon Button', function () {
81
- var _render10 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
82
- icon: Booking,
83
- inverted: true
84
- }))),
85
- toJSON = _render10.toJSON;
86
-
87
- expect(toJSON()).toMatchSnapshot();
88
- });
89
- });
90
- describe('With small prop', function () {
91
- it('should match snapshot with default Button', function () {
92
- var _render11 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
93
- small: true
94
- }))),
95
- toJSON = _render11.toJSON;
96
-
97
- expect(toJSON()).toMatchSnapshot();
98
- });
99
- it('should match snapshot with text Button', function () {
100
- var _render12 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
101
- small: true
102
- }))),
103
- toJSON = _render12.toJSON;
104
-
105
- expect(toJSON()).toMatchSnapshot();
106
- });
107
- it('should match snapshot with default Button with Icon', function () {
108
- var _render13 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
109
- small: true,
110
- icon: Booking
111
- }))),
112
- toJSON = _render13.toJSON;
113
-
114
- expect(toJSON()).toMatchSnapshot();
115
- });
116
- it('should match snapshot with text Button with Icon', function () {
117
- var _render14 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
118
- small: true,
119
- icon: Booking
120
- }))),
121
- toJSON = _render14.toJSON;
122
-
123
- expect(toJSON()).toMatchSnapshot();
124
- });
125
- });
126
- describe('With full prop', function () {
127
- it('should match snapshot with default Button', function () {
128
- var _render15 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
129
- full: true
130
- }))),
131
- toJSON = _render15.toJSON;
132
-
133
- expect(toJSON()).toMatchSnapshot();
134
- });
135
- it('should match snapshot with text Button', function () {
136
- var _render16 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
137
- full: true
138
- }))),
139
- toJSON = _render16.toJSON;
140
-
141
- expect(toJSON()).toMatchSnapshot();
142
- });
143
- it('should match snapshot with default Button with Icon', function () {
144
- var _render17 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
145
- full: true,
146
- icon: Booking
147
- }))),
148
- toJSON = _render17.toJSON;
149
-
150
- expect(toJSON()).toMatchSnapshot();
151
- });
152
- it('should match snapshot with text Button with Icon', function () {
153
- var _render18 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
154
- full: true,
155
- icon: Booking
156
- }))),
157
- toJSON = _render18.toJSON;
158
-
159
- expect(toJSON()).toMatchSnapshot();
160
- });
161
- });
162
- describe('With large prop', function () {
163
- it('should match snapshot icon Button with large prop', function () {
164
- var _render19 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
165
- icon: Booking,
166
- large: true
167
- }))),
168
- toJSON = _render19.toJSON;
169
-
170
- expect(toJSON()).toMatchSnapshot();
171
- });
172
- });
173
- });
174
- describe('secondary buttons', function () {
175
- describe('Without props', function () {
176
- it('should match snapshot with default Button', function () {
177
- var _render20 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
178
- secondary: true
179
- }))),
180
- toJSON = _render20.toJSON;
181
-
182
- expect(toJSON()).toMatchSnapshot();
183
- });
184
- it('should match snapshot with text Button', function () {
185
- var _render21 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
186
- secondary: true
187
- }))),
188
- toJSON = _render21.toJSON;
189
-
190
- expect(toJSON()).toMatchSnapshot();
191
- });
192
- it('should match snapshot with link Button', function () {
193
- var _render22 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
194
- secondary: true
195
- }))),
196
- toJSON = _render22.toJSON;
197
-
198
- expect(toJSON()).toMatchSnapshot();
199
- });
200
- it('should match snapshot with default Button with Icon', function () {
201
- var _render23 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
202
- icon: Booking,
203
- secondary: true
204
- }))),
205
- toJSON = _render23.toJSON;
206
-
207
- expect(toJSON()).toMatchSnapshot();
208
- });
209
- it('should match snapshot with text Button with Icon', function () {
210
- var _render24 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
211
- icon: Booking,
212
- secondary: true
213
- }))),
214
- toJSON = _render24.toJSON;
215
-
216
- expect(toJSON()).toMatchSnapshot();
217
- });
218
- it('should match snapshot with icon Button with Icon', function () {
219
- var _render25 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
220
- icon: Booking,
221
- secondary: true
222
- }))),
223
- toJSON = _render25.toJSON;
224
-
225
- expect(toJSON()).toMatchSnapshot();
226
- });
227
- });
228
- describe('With inverted prop', function () {
229
- it('should match snapshot with default Button', function () {
230
- var _render26 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
231
- inverted: true,
232
- secondary: true
233
- }))),
234
- toJSON = _render26.toJSON;
235
-
236
- expect(toJSON()).toMatchSnapshot();
237
- });
238
- it('should match snapshot with text Button', function () {
239
- var _render27 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
240
- inverted: true,
241
- secondary: true
242
- }))),
243
- toJSON = _render27.toJSON;
244
-
245
- expect(toJSON()).toMatchSnapshot();
246
- });
247
- it('should match snapshot with default Button with Icon', function () {
248
- var _render28 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
249
- inverted: true,
250
- icon: Booking,
251
- secondary: true
252
- }))),
253
- toJSON = _render28.toJSON;
254
-
255
- expect(toJSON()).toMatchSnapshot();
256
- });
257
- it('should match snapshot with text Button with Icon', function () {
258
- var _render29 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
259
- inverted: true,
260
- icon: Booking,
261
- secondary: true
262
- }))),
263
- toJSON = _render29.toJSON;
264
-
265
- expect(toJSON()).toMatchSnapshot();
266
- });
267
- it('should match snapshot with icon Button with Icon', function () {
268
- var _render30 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
269
- inverted: true,
270
- icon: Booking,
271
- secondary: true
272
- }))),
273
- toJSON = _render30.toJSON;
274
-
275
- expect(toJSON()).toMatchSnapshot();
276
- });
277
- });
278
- describe('With small prop', function () {
279
- it('should match snapshot with default Button', function () {
280
- var _render31 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
281
- small: true,
282
- secondary: true
283
- }))),
284
- toJSON = _render31.toJSON;
285
-
286
- expect(toJSON()).toMatchSnapshot();
287
- });
288
- it('should match snapshot with text Button', function () {
289
- var _render32 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
290
- small: true,
291
- secondary: true
292
- }))),
293
- toJSON = _render32.toJSON;
294
-
295
- expect(toJSON()).toMatchSnapshot();
296
- });
297
- it('should match snapshot with default Button with Icon', function () {
298
- var _render33 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
299
- small: true,
300
- icon: Booking,
301
- secondary: true
302
- }))),
303
- toJSON = _render33.toJSON;
304
-
305
- expect(toJSON()).toMatchSnapshot();
306
- });
307
- it('should match snapshot with text Button with Icon', function () {
308
- var _render34 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
309
- small: true,
310
- icon: Booking,
311
- secondary: true
312
- }))),
313
- toJSON = _render34.toJSON;
314
-
315
- expect(toJSON()).toMatchSnapshot();
316
- });
317
- });
318
- describe('With full prop', function () {
319
- it('should match snapshot with default Button', function () {
320
- var _render35 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
321
- full: true,
322
- secondary: true
323
- }))),
324
- toJSON = _render35.toJSON;
325
-
326
- expect(toJSON()).toMatchSnapshot();
327
- });
328
- it('should match snapshot with text Button', function () {
329
- var _render36 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
330
- full: true,
331
- secondary: true
332
- }))),
333
- toJSON = _render36.toJSON;
334
-
335
- expect(toJSON()).toMatchSnapshot();
336
- });
337
- it('should match snapshot with default Button with Icon', function () {
338
- var _render37 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
339
- full: true,
340
- icon: Booking,
341
- secondary: true
342
- }))),
343
- toJSON = _render37.toJSON;
344
-
345
- expect(toJSON()).toMatchSnapshot();
346
- });
347
- it('should match snapshot with text Button with Icon', function () {
348
- var _render38 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
349
- full: true,
350
- icon: Booking,
351
- secondary: true
352
- }))),
353
- toJSON = _render38.toJSON;
354
-
355
- expect(toJSON()).toMatchSnapshot();
356
- });
357
- });
358
- describe('With large prop', function () {
359
- it('should match snapshot icon Button with large prop', function () {
360
- var _render39 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
361
- large: true,
362
- icon: Booking,
363
- secondary: true
364
- }))),
365
- toJSON = _render39.toJSON;
366
-
367
- expect(toJSON()).toMatchSnapshot();
368
- });
369
- });
370
- });
371
- describe('disabled buttons', function () {
372
- describe('With disabled prop', function () {
373
- it('should match snapshot with default Button', function () {
374
- var _render40 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
375
- disabled: true
376
- }))),
377
- toJSON = _render40.toJSON;
378
-
379
- expect(toJSON()).toMatchSnapshot();
380
- });
381
- it('should match snapshot with text Button', function () {
382
- var _render41 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
383
- disabled: true
384
- }))),
385
- toJSON = _render41.toJSON;
386
-
387
- expect(toJSON()).toMatchSnapshot();
388
- });
389
- it('should match snapshot with link Button', function () {
390
- var _render42 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
391
- disabled: true
392
- }))),
393
- toJSON = _render42.toJSON;
394
-
395
- expect(toJSON()).toMatchSnapshot();
396
- });
397
- it('should match snapshot with default Button with Icon', function () {
398
- var _render43 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
399
- disabled: true,
400
- icon: Booking
401
- }))),
402
- toJSON = _render43.toJSON;
403
-
404
- expect(toJSON()).toMatchSnapshot();
405
- });
406
- it('should match snapshot with text Button with Icon', function () {
407
- var _render44 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
408
- disabled: true,
409
- icon: Booking
410
- }))),
411
- toJSON = _render44.toJSON;
412
-
413
- expect(toJSON()).toMatchSnapshot();
414
- });
415
- it('should match snapshot with icon Button with Icon', function () {
416
- var _render45 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
417
- disabled: true,
418
- icon: Booking
419
- }))),
420
- toJSON = _render45.toJSON;
421
-
422
- expect(toJSON()).toMatchSnapshot();
423
- });
424
- });
425
- });
426
- });
427
- describe('onPress prop', function () {
428
- it('should call onPress function when click on Button', function () {
429
- var onPressMock = jest.fn();
430
-
431
- var _render46 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
432
- onPress: onPressMock
433
- }, "Button"))),
434
- getByText = _render46.getByText;
435
-
436
- fireEvent.press(getByText('Button'));
437
- expect(onPressMock).toHaveBeenCalled();
438
- });
439
- it('should call onPress function when press on Button.Text', function () {
440
- var onPressMock = jest.fn();
441
-
442
- var _render47 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
443
- onPress: onPressMock
444
- }, "Button.Text"))),
445
- getByText = _render47.getByText;
446
-
447
- fireEvent.press(getByText('Button.Text'));
448
- expect(onPressMock).toHaveBeenCalled();
449
- });
450
- it('should call onPress function when press on Button.Icon', function () {
451
- var onPressMock = jest.fn();
452
-
453
- var _render48 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
454
- onPress: onPressMock,
455
- icon: Booking
456
- }))),
457
- getByRole = _render48.getByRole;
458
-
459
- fireEvent.press(getByRole('button'));
460
- expect(onPressMock).toHaveBeenCalled();
461
- });
462
- it('should not call onPress function when press on Button disabled', function () {
463
- var onPressMock = jest.fn();
464
-
465
- var _render49 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
466
- disabled: true,
467
- onPress: onPressMock
468
- }, "Button"))),
469
- getByText = _render49.getByText;
470
-
471
- fireEvent.press(getByText('Button'));
472
- expect(onPressMock).not.toHaveBeenCalled();
473
- });
474
- });
475
- });