@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.
Files changed (301) hide show
  1. package/cjs/Card/web/PlanCard/Content.js +11 -6
  2. package/cjs/Drawer/web/Content.js +1 -4
  3. package/esm/Card/web/PlanCard/Content.js +11 -6
  4. package/esm/Drawer/web/Content.js +1 -4
  5. package/package.json +5 -5
  6. package/cjs/ActionRequirement/native/ActionRequirement.test.js +0 -1
  7. package/cjs/ActionRequirement/web/ActionRequirement.test.js +0 -40
  8. package/cjs/AutoComplete/web/AutoComplete.test.js +0 -156
  9. package/cjs/Avatar/native/Avatar.test.js +0 -1
  10. package/cjs/Avatar/web/Avatar.test.js +0 -72
  11. package/cjs/Banner/native/Banner.test.js +0 -1
  12. package/cjs/Banner/web/Banner.test.js +0 -121
  13. package/cjs/BottomSheet/web/BottomSheet.test.js +0 -61
  14. package/cjs/Box/native/Box.test.js +0 -1
  15. package/cjs/Box/web/Box.test.js +0 -23
  16. package/cjs/Button/native/Button.test.js +0 -1
  17. package/cjs/Button/web/Button.test.js +0 -778
  18. package/cjs/Card/native/Card/Card.test.js +0 -1
  19. package/cjs/Card/native/EventCard/EventCard.test.js +0 -1
  20. package/cjs/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -1
  21. package/cjs/Card/native/PlanCard/PlanCard.test.js +0 -1
  22. package/cjs/Card/web/Card/Card.test.js +0 -22
  23. package/cjs/Card/web/EventCard/EventCard.test.js +0 -35
  24. package/cjs/Card/web/PlanCard/PlanCard.test.js +0 -95
  25. package/cjs/Checkbox/native/Checkbox.test.js +0 -1
  26. package/cjs/Checkbox/native/Switch.test.js +0 -1
  27. package/cjs/Checkbox/web/Checkbox.test.js +0 -161
  28. package/cjs/Checkbox/web/Switch.test.js +0 -65
  29. package/cjs/Chips/native/Chips.test.js +0 -1
  30. package/cjs/Chips/web/Chips.test.js +0 -138
  31. package/cjs/Datepicker/web/Datepicker.test.js +0 -286
  32. package/cjs/Dialog/web/Dialog.test.js +0 -78
  33. package/cjs/Divider/native/Divider.test.js +0 -1
  34. package/cjs/Divider/web/Divider.test.js +0 -36
  35. package/cjs/Drawer/web/Drawer.test.js +0 -46
  36. package/cjs/Dropdown/native/Backdrop.test.js +0 -1
  37. package/cjs/Dropdown/native/Dropdown.test.js +0 -1
  38. package/cjs/Dropdown/web/Dropdown.test.js +0 -102
  39. package/cjs/Feedback/web/Feedback.test.js +0 -89
  40. package/cjs/Grid/web/Col.test.js +0 -56
  41. package/cjs/Grid/web/Container.test.js +0 -22
  42. package/cjs/Grid/web/Hide.test.js +0 -39
  43. package/cjs/Grid/web/Row.test.js +0 -22
  44. package/cjs/Header/web/Header.test.js +0 -49
  45. package/cjs/Heading/web/Heading.test.js +0 -68
  46. package/cjs/Icon/native/Icon.test.js +0 -1
  47. package/cjs/Icon/web/Icon.test.js +0 -53
  48. package/cjs/Input/native/Email.test.js +0 -1
  49. package/cjs/Input/native/Input.test.js +0 -1
  50. package/cjs/Input/native/Number.test.js +0 -1
  51. package/cjs/Input/native/Password.test.js +0 -1
  52. package/cjs/Input/native/Tel.test.js +0 -1
  53. package/cjs/Input/web/Email.test.js +0 -20
  54. package/cjs/Input/web/Input.test.js +0 -161
  55. package/cjs/Input/web/Number.test.js +0 -20
  56. package/cjs/Input/web/Password.test.js +0 -103
  57. package/cjs/Input/web/Tel.test.js +0 -20
  58. package/cjs/List/native/List.test.js +0 -1
  59. package/cjs/List/web/List.test.js +0 -69
  60. package/cjs/Menu/web/Menu.test.js +0 -123
  61. package/cjs/Popover/web/Popover.test.js +0 -27
  62. package/cjs/Progress/native/Progress.test.js +0 -1
  63. package/cjs/Progress/web/Progress.test.js +0 -229
  64. package/cjs/RadioGroup/native/Button/RadioButton.test.js +0 -1
  65. package/cjs/RadioGroup/native/Radio/Radio.test.js +0 -1
  66. package/cjs/RadioGroup/native/RadioGroup.test.js +0 -1
  67. package/cjs/RadioGroup/web/Button/RadioButton.test.js +0 -132
  68. package/cjs/RadioGroup/web/Radio/Radio.test.js +0 -119
  69. package/cjs/RadioGroup/web/RadioGroup.test.js +0 -93
  70. package/cjs/Rating/native/Rating.test.js +0 -1
  71. package/cjs/Rating/web/Rating.test.js +0 -201
  72. package/cjs/Result/native/Result.test.js +0 -1
  73. package/cjs/Skeleton/native/Skeleton.test.js +0 -1
  74. package/cjs/Skeleton/web/Skeleton.test.js +0 -84
  75. package/cjs/Slider/native/Slider.test.js +0 -1
  76. package/cjs/Slider/web/Slider.test.js +0 -95
  77. package/cjs/Snackbar/native/Snackbar.test.js +0 -1
  78. package/cjs/Snackbar/web/Snackbar.test.js +0 -137
  79. package/cjs/Stepper/native/Stepper.test.js +0 -1
  80. package/cjs/Stepper/web/Stepper.test.js +0 -75
  81. package/cjs/Tag/native/Tag.test.js +0 -1
  82. package/cjs/Tag/web/Tag.test.js +0 -87
  83. package/cjs/Text/native/Text.test.js +0 -1
  84. package/cjs/Text/web/Text.test.js +0 -157
  85. package/cjs/TextArea/native/TextArea.test.js +0 -1
  86. package/cjs/TextArea/web/TextArea.test.js +0 -18
  87. package/cjs/Theme/Provider/web/FontLoader.test.js +0 -19
  88. package/cjs/Theme/Provider/web/GlobalStyle.test.js +0 -27
  89. package/cjs/Theme/helpers/themeReader/native/native.test.js +0 -1
  90. package/cjs/Theme/helpers/themeReader/web/web.test.js +0 -54
  91. package/esm/ActionRequirement/index.native.js +0 -2
  92. package/esm/ActionRequirement/native/ActionRequirement.js +0 -48
  93. package/esm/ActionRequirement/native/ActionRequirement.test.js +0 -45
  94. package/esm/ActionRequirement/native/ActionRequirementStyles.js +0 -25
  95. package/esm/ActionRequirement/native/index.js +0 -6
  96. package/esm/ActionRequirement/web/ActionRequirement.test.js +0 -31
  97. package/esm/AutoComplete/web/AutoComplete.test.js +0 -139
  98. package/esm/Avatar/index.native.js +0 -4
  99. package/esm/Avatar/native/Avatar.js +0 -96
  100. package/esm/Avatar/native/Avatar.test.js +0 -46
  101. package/esm/Avatar/native/AvatarCircle.js +0 -24
  102. package/esm/Avatar/web/Avatar.test.js +0 -63
  103. package/esm/Banner/index.native.js +0 -2
  104. package/esm/Banner/native/Banner.js +0 -128
  105. package/esm/Banner/native/Banner.test.js +0 -103
  106. package/esm/Banner/native/index.js +0 -2
  107. package/esm/Banner/web/Banner.test.js +0 -109
  108. package/esm/BottomSheet/web/BottomSheet.test.js +0 -48
  109. package/esm/Box/index.native.js +0 -2
  110. package/esm/Box/native/Box.js +0 -4
  111. package/esm/Box/native/Box.test.js +0 -16
  112. package/esm/Box/native/index.js +0 -2
  113. package/esm/Box/web/Box.test.js +0 -16
  114. package/esm/Button/index.native.js +0 -8
  115. package/esm/Button/native/Button.js +0 -110
  116. package/esm/Button/native/Button.test.js +0 -475
  117. package/esm/Button/native/Icon.js +0 -82
  118. package/esm/Button/native/Link.js +0 -35
  119. package/esm/Button/native/Text.js +0 -74
  120. package/esm/Button/native/withTouchable.js +0 -63
  121. package/esm/Button/web/Button.test.js +0 -764
  122. package/esm/Card/index.native.js +0 -2
  123. package/esm/Card/native/Card/Actions.js +0 -12
  124. package/esm/Card/native/Card/Card.js +0 -92
  125. package/esm/Card/native/Card/Card.test.js +0 -15
  126. package/esm/Card/native/Card/Content.js +0 -8
  127. package/esm/Card/native/Card/Header.js +0 -8
  128. package/esm/Card/native/Card/index.js +0 -8
  129. package/esm/Card/native/EventCard/EventCard.js +0 -169
  130. package/esm/Card/native/EventCard/EventCard.test.js +0 -65
  131. package/esm/Card/native/EventCard/index.js +0 -2
  132. package/esm/Card/native/GymCard/CheckIn/Avatar.js +0 -17
  133. package/esm/Card/native/GymCard/CheckIn/CheckIn.js +0 -66
  134. package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -39
  135. package/esm/Card/native/GymCard/CheckIn/Content.js +0 -11
  136. package/esm/Card/native/GymCard/CheckIn/Header.js +0 -11
  137. package/esm/Card/native/GymCard/CheckIn/index.js +0 -2
  138. package/esm/Card/native/GymCard/index.js +0 -5
  139. package/esm/Card/native/PlanCard/Actions.js +0 -22
  140. package/esm/Card/native/PlanCard/Content.js +0 -75
  141. package/esm/Card/native/PlanCard/List.js +0 -73
  142. package/esm/Card/native/PlanCard/PlanCard.js +0 -51
  143. package/esm/Card/native/PlanCard/PlanCard.test.js +0 -84
  144. package/esm/Card/native/PlanCard/Subtitle.js +0 -15
  145. package/esm/Card/native/PlanCard/Tag.js +0 -34
  146. package/esm/Card/native/PlanCard/index.js +0 -15
  147. package/esm/Card/native/index.js +0 -5
  148. package/esm/Card/web/Card/Card.test.js +0 -14
  149. package/esm/Card/web/EventCard/EventCard.test.js +0 -27
  150. package/esm/Card/web/PlanCard/PlanCard.test.js +0 -85
  151. package/esm/Checkbox/index.native.js +0 -3
  152. package/esm/Checkbox/native/Checkbox.js +0 -179
  153. package/esm/Checkbox/native/Checkbox.test.js +0 -115
  154. package/esm/Checkbox/native/Switch.js +0 -115
  155. package/esm/Checkbox/native/Switch.test.js +0 -54
  156. package/esm/Checkbox/native/index.js +0 -3
  157. package/esm/Checkbox/web/Checkbox.test.js +0 -153
  158. package/esm/Checkbox/web/Switch.test.js +0 -56
  159. package/esm/Chips/index.native.js +0 -2
  160. package/esm/Chips/native/Chips.js +0 -104
  161. package/esm/Chips/native/Chips.test.js +0 -143
  162. package/esm/Chips/native/Counter.js +0 -20
  163. package/esm/Chips/native/index.js +0 -2
  164. package/esm/Chips/web/Chips.test.js +0 -128
  165. package/esm/Datepicker/web/Datepicker.test.js +0 -247
  166. package/esm/Dialog/web/Dialog.test.js +0 -62
  167. package/esm/Divider/index.native.js +0 -2
  168. package/esm/Divider/native/Divider.js +0 -29
  169. package/esm/Divider/native/Divider.test.js +0 -29
  170. package/esm/Divider/native/index.js +0 -2
  171. package/esm/Divider/web/Divider.test.js +0 -29
  172. package/esm/Drawer/web/Drawer.test.js +0 -33
  173. package/esm/Dropdown/index.native.js +0 -2
  174. package/esm/Dropdown/native/Backdrop.js +0 -93
  175. package/esm/Dropdown/native/Backdrop.test.js +0 -26
  176. package/esm/Dropdown/native/Dropdown.js +0 -142
  177. package/esm/Dropdown/native/Dropdown.test.js +0 -78
  178. package/esm/Dropdown/native/Options.android.js +0 -66
  179. package/esm/Dropdown/native/Options.ios.js +0 -71
  180. package/esm/Dropdown/native/index.js +0 -2
  181. package/esm/Dropdown/web/Dropdown.test.js +0 -93
  182. package/esm/Feedback/web/Feedback.test.js +0 -83
  183. package/esm/Grid/web/Col.test.js +0 -48
  184. package/esm/Grid/web/Container.test.js +0 -14
  185. package/esm/Grid/web/Hide.test.js +0 -31
  186. package/esm/Grid/web/Row.test.js +0 -14
  187. package/esm/Header/web/Header.test.js +0 -38
  188. package/esm/Heading/web/Heading.test.js +0 -58
  189. package/esm/Icon/index.native.js +0 -2
  190. package/esm/Icon/native/Icon.test.js +0 -47
  191. package/esm/Icon/native/index.js +0 -2
  192. package/esm/Icon/web/Icon.test.js +0 -47
  193. package/esm/Input/index.native.js +0 -6
  194. package/esm/Input/native/Email.js +0 -15
  195. package/esm/Input/native/Email.test.js +0 -13
  196. package/esm/Input/native/Helper.js +0 -62
  197. package/esm/Input/native/Input.js +0 -234
  198. package/esm/Input/native/Input.test.js +0 -181
  199. package/esm/Input/native/Number.js +0 -12
  200. package/esm/Input/native/Number.test.js +0 -13
  201. package/esm/Input/native/Password.js +0 -112
  202. package/esm/Input/native/Password.test.js +0 -125
  203. package/esm/Input/native/Tel.js +0 -14
  204. package/esm/Input/native/Tel.test.js +0 -13
  205. package/esm/Input/native/index.js +0 -6
  206. package/esm/Input/web/Email.test.js +0 -13
  207. package/esm/Input/web/Input.test.js +0 -145
  208. package/esm/Input/web/Number.test.js +0 -13
  209. package/esm/Input/web/Password.test.js +0 -90
  210. package/esm/Input/web/Tel.test.js +0 -13
  211. package/esm/List/index.native.js +0 -3
  212. package/esm/List/native/List.js +0 -22
  213. package/esm/List/native/List.test.js +0 -106
  214. package/esm/List/native/ListItem.js +0 -51
  215. package/esm/List/native/index.js +0 -3
  216. package/esm/List/web/List.test.js +0 -62
  217. package/esm/Menu/web/Menu.test.js +0 -115
  218. package/esm/Popover/web/Popover.test.js +0 -19
  219. package/esm/Progress/index.native.js +0 -2
  220. package/esm/Progress/native/Progress.js +0 -103
  221. package/esm/Progress/native/Progress.test.js +0 -222
  222. package/esm/Progress/native/index.js +0 -2
  223. package/esm/Progress/web/Progress.test.js +0 -222
  224. package/esm/RadioGroup/index.native.js +0 -4
  225. package/esm/RadioGroup/native/Button/RadioButton.js +0 -64
  226. package/esm/RadioGroup/native/Button/RadioButton.test.js +0 -96
  227. package/esm/RadioGroup/native/Radio/Radio.js +0 -88
  228. package/esm/RadioGroup/native/Radio/Radio.test.js +0 -112
  229. package/esm/RadioGroup/native/RadioGroup.js +0 -66
  230. package/esm/RadioGroup/native/RadioGroup.test.js +0 -50
  231. package/esm/RadioGroup/native/index.js +0 -4
  232. package/esm/RadioGroup/web/Button/RadioButton.test.js +0 -121
  233. package/esm/RadioGroup/web/Radio/Radio.test.js +0 -108
  234. package/esm/RadioGroup/web/RadioGroup.test.js +0 -83
  235. package/esm/Rating/index.native.js +0 -2
  236. package/esm/Rating/native/Rating.js +0 -186
  237. package/esm/Rating/native/Rating.test.js +0 -121
  238. package/esm/Rating/native/index.js +0 -2
  239. package/esm/Rating/web/Rating.test.js +0 -184
  240. package/esm/Result/index.native.js +0 -8
  241. package/esm/Result/native/Attendances.js +0 -55
  242. package/esm/Result/native/Details.js +0 -97
  243. package/esm/Result/native/Rate.js +0 -35
  244. package/esm/Result/native/Result.js +0 -86
  245. package/esm/Result/native/Result.test.js +0 -107
  246. package/esm/Result/native/ResultButton.js +0 -13
  247. package/esm/Result/native/Tags.js +0 -41
  248. package/esm/Result/native/TinyTextIcon.js +0 -18
  249. package/esm/Result/native/index.js +0 -2
  250. package/esm/Skeleton/index.native.js +0 -2
  251. package/esm/Skeleton/native/Skeleton.js +0 -94
  252. package/esm/Skeleton/native/Skeleton.test.js +0 -78
  253. package/esm/Skeleton/native/index.js +0 -2
  254. package/esm/Skeleton/web/Skeleton.test.js +0 -77
  255. package/esm/Slider/index.native.js +0 -2
  256. package/esm/Slider/native/Label.js +0 -19
  257. package/esm/Slider/native/Marker.js +0 -68
  258. package/esm/Slider/native/Slider.js +0 -156
  259. package/esm/Slider/native/Slider.test.js +0 -122
  260. package/esm/Slider/native/Step.js +0 -14
  261. package/esm/Slider/native/Tooltip.js +0 -90
  262. package/esm/Slider/web/Slider.test.js +0 -86
  263. package/esm/Snackbar/index.native.js +0 -2
  264. package/esm/Snackbar/native/Snackbar.js +0 -199
  265. package/esm/Snackbar/native/Snackbar.test.js +0 -100
  266. package/esm/Snackbar/native/SnackbarAnimationWrapper.js +0 -124
  267. package/esm/Snackbar/native/index.js +0 -2
  268. package/esm/Snackbar/web/Snackbar.test.js +0 -118
  269. package/esm/Stepper/index.native.js +0 -3
  270. package/esm/Stepper/native/Dots.js +0 -45
  271. package/esm/Stepper/native/Line.js +0 -35
  272. package/esm/Stepper/native/Step.js +0 -19
  273. package/esm/Stepper/native/Stepper.js +0 -52
  274. package/esm/Stepper/native/Stepper.test.js +0 -70
  275. package/esm/Stepper/native/index.js +0 -3
  276. package/esm/Stepper/web/Stepper.test.js +0 -67
  277. package/esm/Tag/index.native.js +0 -4
  278. package/esm/Tag/native/Informative.js +0 -72
  279. package/esm/Tag/native/Tag.js +0 -75
  280. package/esm/Tag/native/Tag.test.js +0 -94
  281. package/esm/Tag/native/index.js +0 -2
  282. package/esm/Tag/web/Tag.test.js +0 -79
  283. package/esm/Text/index.native.js +0 -16
  284. package/esm/Text/native/Text.js +0 -69
  285. package/esm/Text/native/Text.test.js +0 -149
  286. package/esm/Text/native/index.js +0 -2
  287. package/esm/Text/web/Text.test.js +0 -149
  288. package/esm/TextArea/index.native.js +0 -2
  289. package/esm/TextArea/native/TextArea.js +0 -59
  290. package/esm/TextArea/native/TextArea.test.js +0 -11
  291. package/esm/TextArea/native/index.js +0 -2
  292. package/esm/TextArea/web/TextArea.test.js +0 -11
  293. package/esm/Theme/Provider/index.native.js +0 -2
  294. package/esm/Theme/Provider/native/index.js +0 -2
  295. package/esm/Theme/Provider/web/FontLoader.test.js +0 -11
  296. package/esm/Theme/Provider/web/GlobalStyle.test.js +0 -17
  297. package/esm/Theme/helpers/themeReader/native/native.test.js +0 -53
  298. package/esm/Theme/helpers/themeReader/web/web.test.js +0 -41
  299. package/esm/Theme/index.native.js +0 -5
  300. package/esm/index.native.js +0 -26
  301. package/esm/shared/index.native.js +0 -2
@@ -1,179 +0,0 @@
1
- var _excluded = ["label", "helper", "disabled", "checked", "error", "style", "onPressIn", "onPressOut", "inverted", "theme"];
2
-
3
- var _templateObject;
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, { useState } from 'react';
12
- import { bool, func, string, shape } from 'prop-types';
13
- import styled, { withTheme } from 'styled-components';
14
- import { TouchableWithoutFeedback, View } from 'react-native';
15
- import { hexToRgb } from '@gympass/yoga-common';
16
- import { Check } from '@gympass/yoga-icons';
17
- import Text from '../../Text';
18
- var CheckboxWrapper = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n flex-direction: row;\n align-items: center;\n"])));
19
- var Label = styled(Text.Regular)(function (_ref) {
20
- var checkbox = _ref.theme.yoga.components.checkbox;
21
- return "\n padding-left: " + checkbox.label.padding.left + "px;\n\n font-size: " + checkbox.label.font.size + "px;\n\n color: " + checkbox.label.font.color + ";\n";
22
- });
23
- var HelperWrapper = styled.View(function (_ref2) {
24
- var checkbox = _ref2.theme.yoga.components.checkbox;
25
- return "\n margin-top: " + checkbox.helper.margin.top + "px;\n";
26
- });
27
- var Helper = styled(Text.Regular)(function (_ref3) {
28
- var error = _ref3.error,
29
- _ref3$theme$yoga = _ref3.theme.yoga,
30
- feedback = _ref3$theme$yoga.colors.feedback,
31
- checkbox = _ref3$theme$yoga.components.checkbox;
32
- return "\n font-size: " + checkbox.helper.font.size + "px;\n\n color: " + (error ? feedback.attention[1] : checkbox.helper.font.color) + ";\n";
33
- });
34
- var CheckBackground = styled.View(function (_ref4) {
35
- var checked = _ref4.checked,
36
- disabled = _ref4.disabled,
37
- inverted = _ref4.inverted,
38
- error = _ref4.error,
39
- _ref4$theme$yoga = _ref4.theme.yoga,
40
- _ref4$theme$yoga$colo = _ref4$theme$yoga.colors,
41
- primary = _ref4$theme$yoga$colo.primary,
42
- feedback = _ref4$theme$yoga$colo.feedback,
43
- elements = _ref4$theme$yoga$colo.elements,
44
- white = _ref4$theme$yoga$colo.white,
45
- checkbox = _ref4$theme$yoga.components.checkbox;
46
- var borderColor = primary;
47
- var bgColor = 'transparent';
48
-
49
- if (error) {
50
- var _feedback$attention = feedback.attention;
51
- borderColor = _feedback$attention[1];
52
-
53
- if (checked) {
54
- var _feedback$attention2 = feedback.attention;
55
- bgColor = _feedback$attention2[1];
56
- }
57
- } else if (disabled) {
58
- borderColor = checkbox.disabled.border.color;
59
-
60
- if (checked) {
61
- bgColor = checkbox.disabled.backgroundColor;
62
- borderColor = elements.lineAndBorders;
63
- }
64
- } else if (checked) {
65
- borderColor = primary;
66
- bgColor = primary;
67
-
68
- if (inverted) {
69
- bgColor = white;
70
- borderColor = white;
71
- }
72
- } else if (inverted) {
73
- borderColor = white;
74
- }
75
-
76
- return "\n position: absolute;\n\n width: " + checkbox.size + "px;\n height: " + checkbox.size + "px;\n\n border-radius: " + checkbox.border.radius + "px;\n border-width: " + checkbox.border.width + "px;\n border-style: solid;\n\n background-color: " + bgColor + ";\n\n border-color: " + borderColor + ";\n ";
77
- });
78
- var Shadow = styled.View(function (_ref5) {
79
- var checked = _ref5.checked,
80
- inverted = _ref5.inverted,
81
- _ref5$theme$yoga = _ref5.theme.yoga,
82
- _ref5$theme$yoga$colo = _ref5$theme$yoga.colors,
83
- primary = _ref5$theme$yoga$colo.primary,
84
- elements = _ref5$theme$yoga$colo.elements,
85
- white = _ref5$theme$yoga$colo.white,
86
- checkbox = _ref5$theme$yoga.components.checkbox;
87
- var size = checkbox.size * 1.67;
88
- var shadowColor = checked ? primary : elements.backgroundAndDisabled;
89
- return "\n width: " + size + "px;\n height: " + size + "px;\n\n background-color: " + hexToRgb(inverted ? white : shadowColor, 0.75) + ";\n border-radius: " + checkbox.hover.border.radius + "px;\n ";
90
- });
91
- var CheckArea = styled.View(function (_ref6) {
92
- var checkbox = _ref6.theme.yoga.components.checkbox;
93
- return "\n justify-content: center;\n align-items: center;\n\n width: " + checkbox.size + "px;\n height: " + checkbox.size + "px;\n";
94
- });
95
- /** The checkbox component is used when the user needs to select one or more
96
- * items on a task. This component can also allow the user to turn an option on
97
- * or off. */
98
-
99
- var Checkbox = function Checkbox(_ref7) {
100
- var label = _ref7.label,
101
- helper = _ref7.helper,
102
- disabled = _ref7.disabled,
103
- checked = _ref7.checked,
104
- error = _ref7.error,
105
- style = _ref7.style,
106
- _onPressIn = _ref7.onPressIn,
107
- _onPressOut = _ref7.onPressOut,
108
- inverted = _ref7.inverted,
109
- _ref7$theme$yoga = _ref7.theme.yoga,
110
- checkbox = _ref7$theme$yoga.components.checkbox,
111
- colors = _ref7$theme$yoga.colors,
112
- rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
113
-
114
- var _useState = useState(false),
115
- pressed = _useState[0],
116
- setPressed = _useState[1];
117
-
118
- return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, _extends({}, rest, {
119
- disabled: disabled,
120
- onPressIn: function onPressIn(e) {
121
- setPressed(true);
122
-
123
- _onPressIn(e);
124
- },
125
- onPressOut: function onPressOut(e) {
126
- setPressed(false);
127
-
128
- _onPressOut(e);
129
- }
130
- }), /*#__PURE__*/React.createElement(CheckboxWrapper, {
131
- style: style
132
- }, /*#__PURE__*/React.createElement(CheckArea, null, pressed && !disabled && /*#__PURE__*/React.createElement(Shadow, {
133
- pressed: pressed,
134
- checked: checked,
135
- inverted: inverted
136
- }), /*#__PURE__*/React.createElement(CheckBackground, {
137
- disabled: disabled,
138
- checked: checked,
139
- error: error,
140
- pressed: pressed,
141
- inverted: inverted
142
- }), checked && /*#__PURE__*/React.createElement(Check, {
143
- fill: inverted ? colors.primary : checkbox.checked.icon.color,
144
- style: {
145
- position: 'absolute'
146
- },
147
- width: 24,
148
- height: 24
149
- })), label && /*#__PURE__*/React.createElement(Label, null, label))), (helper || error) && /*#__PURE__*/React.createElement(HelperWrapper, null, /*#__PURE__*/React.createElement(Helper, {
150
- error: error
151
- }, error || helper)));
152
- };
153
-
154
- Checkbox.propTypes = {
155
- label: string,
156
-
157
- /** set a short helper text under checkbox */
158
- helper: string,
159
- checked: bool,
160
- disabled: bool,
161
- inverted: bool,
162
- error: string,
163
- style: shape({}),
164
- onPressIn: func,
165
- onPressOut: func
166
- };
167
- Checkbox.defaultProps = {
168
- label: undefined,
169
- helper: undefined,
170
- checked: false,
171
- disabled: false,
172
- inverted: false,
173
- error: undefined,
174
- style: {},
175
- onPressIn: function onPressIn() {},
176
- onPressOut: function onPressOut() {}
177
- };
178
- Checkbox.displayName = 'Checkbox';
179
- export default withTheme(Checkbox);
@@ -1,115 +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, fireEvent } from '@testing-library/react-native';
5
- import Checkbox from '..';
6
- import ThemeProvider from '../../Theme';
7
- var data = {
8
- label: 'Checkbox Component',
9
- helper: 'Helper Text'
10
- };
11
- describe('<Checkbox />', function () {
12
- describe('Snapshots', function () {
13
- it('should match snapshot without label', function () {
14
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, null))),
15
- toJSON = _render.toJSON;
16
-
17
- expect(toJSON()).toMatchSnapshot();
18
- });
19
- it('should match snapshot without label', function () {
20
- var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, null))),
21
- toJSON = _render2.toJSON;
22
-
23
- expect(toJSON()).toMatchSnapshot();
24
- });
25
- it('should match snapshot with default checkbox', function () {
26
- var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, data))),
27
- toJSON = _render3.toJSON;
28
-
29
- expect(toJSON()).toMatchSnapshot();
30
- });
31
- it('should match snapshot with disabled checkbox', function () {
32
- var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
33
- disabled: true
34
- })))),
35
- toJSON = _render4.toJSON;
36
-
37
- expect(toJSON()).toMatchSnapshot();
38
- });
39
- it('should match snapshot with checked checkbox', function () {
40
- var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
41
- checked: true
42
- })))),
43
- toJSON = _render5.toJSON;
44
-
45
- expect(toJSON()).toMatchSnapshot();
46
- });
47
- it('should match snapshot with disabled and checked checkbox', function () {
48
- var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
49
- disabled: true,
50
- checked: true
51
- })))),
52
- toJSON = _render6.toJSON;
53
-
54
- expect(toJSON()).toMatchSnapshot();
55
- });
56
- it('should match snapshot with error checkbox', function () {
57
- var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
58
- error: "Error text"
59
- })))),
60
- toJSON = _render7.toJSON;
61
-
62
- expect(toJSON()).toMatchSnapshot();
63
- });
64
- it('should match snapshot with error and checked checkbox', function () {
65
- var _render8 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
66
- error: "Error text",
67
- checked: true
68
- })))),
69
- toJSON = _render8.toJSON;
70
-
71
- expect(toJSON()).toMatchSnapshot();
72
- });
73
- it('should match snapshot with inverted', function () {
74
- var _render9 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
75
- inverted: true
76
- })))),
77
- toJSON = _render9.toJSON;
78
-
79
- expect(toJSON()).toMatchSnapshot();
80
- });
81
- it('should match snapshot with inverted and checked', function () {
82
- var _render10 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
83
- inverted: true,
84
- checked: true
85
- })))),
86
- toJSON = _render10.toJSON;
87
-
88
- expect(toJSON()).toMatchSnapshot();
89
- });
90
- it('should match snapshot with inverted and checked and disabled', function () {
91
- var _render11 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
92
- inverted: true,
93
- checked: true,
94
- disabled: true
95
- })))),
96
- toJSON = _render11.toJSON;
97
-
98
- expect(toJSON()).toMatchSnapshot();
99
- });
100
- });
101
- describe('Events', function () {
102
- it('should call onChange function when press on Checkbox', function () {
103
- var onChangeMock = jest.fn();
104
-
105
- var _render12 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
106
- onPress: onChangeMock,
107
- testID: "checkbox"
108
- })))),
109
- getByTestId = _render12.getByTestId;
110
-
111
- fireEvent.press(getByTestId('checkbox'));
112
- expect(onChangeMock).toHaveBeenCalled();
113
- });
114
- });
115
- });
@@ -1,115 +0,0 @@
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, { useEffect, useState } from 'react';
6
- import { bool } from 'prop-types';
7
- import styled, { withTheme } from 'styled-components';
8
- import { hexToRgb } from '@gympass/yoga-common';
9
- import { Animated } from 'react-native';
10
- import withTouchable from '../../Button/native/withTouchable';
11
- import Box from '../../Box';
12
- var SwitchTrack = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", ";\n"])), function (_ref) {
13
- var checkboxswitch = _ref.theme.yoga.components.checkboxswitch,
14
- checked = _ref.checked,
15
- disabled = _ref.disabled;
16
- return "\n display: flex;\n justify-content: center;\n width: " + checkboxswitch.track.width + "px;\n height: " + checkboxswitch.track.height + "px;\n borderRadius: " + checkboxswitch.track.radii + "px;\n background-color: " + (checked ? checkboxswitch.track.checked.backgroundColor : checkboxswitch.track.backgroundColor) + ";\n\n " + (disabled ? "\n background-color: " + checkboxswitch.track.disabled.backgroundColor + ";" : '') + "\n ";
17
- });
18
- var ThumbShadow = styled.View(function (_ref2) {
19
- var _ref2$theme$yoga = _ref2.theme.yoga,
20
- colors = _ref2$theme$yoga.colors,
21
- checkboxswitch = _ref2$theme$yoga.components.checkboxswitch,
22
- checked = _ref2.checked;
23
- var width = checkboxswitch.thumb.width * checkboxswitch.thumb.shadowScale;
24
- var height = checkboxswitch.thumb.height * checkboxswitch.thumb.shadowScale;
25
- return "\n width: " + width + "px;\n height: " + height + "px;\n position: absolute;\n background-color: " + (checked ? hexToRgb(colors.primary, 0.75) : hexToRgb(colors.elements.backgroundAndDisabled, 0.75)) + ";\n border-radius: " + checkboxswitch.thumb.radii + "px;\n ";
26
- });
27
- var SwitchThumb = styled(Box).attrs(function (_ref3) {
28
- var checkboxswitch = _ref3.theme.yoga.components.checkboxswitch,
29
- disabled = _ref3.disabled;
30
- return {
31
- width: checkboxswitch.thumb.width,
32
- height: checkboxswitch.thumb.height,
33
- borderRadius: checkboxswitch.thumb.radii,
34
- bgColor: disabled ? checkboxswitch.thumb.disabled.backgroundColor : checkboxswitch.thumb.backgroundColor,
35
- elevation: checkboxswitch.thumb.shadow
36
- };
37
- })(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose([""])));
38
-
39
- var CheckboxSwitch = function CheckboxSwitch(_ref4) {
40
- var checked = _ref4.checked,
41
- pressed = _ref4.pressed,
42
- disabled = _ref4.disabled,
43
- checkboxswitch = _ref4.theme.yoga.components.checkboxswitch;
44
-
45
- var _useState = useState(new Animated.Value(Number(checked))),
46
- thumbPosition = _useState[0];
47
-
48
- var thumbTo = checkboxswitch.track.width - checkboxswitch.thumb.width - checkboxswitch.thumb.left;
49
- var thumbFrom = checkboxswitch.thumb.left;
50
- var shadowDiameter = checkboxswitch.thumb.width * checkboxswitch.thumb.shadowScale;
51
- var shadowAndThumbDiff = shadowDiameter - checkboxswitch.thumb.width;
52
- var halfDiff = shadowAndThumbDiff / 2;
53
- var thumbShadowFrom = (halfDiff - checkboxswitch.thumb.left) * -1;
54
- var thumbShadowTo = thumbTo - halfDiff;
55
- useEffect(function () {
56
- var toggle = function toggle(isChecked, position) {
57
- var animValue = {
58
- fromValue: isChecked ? 0 : 1,
59
- toValue: isChecked ? 1 : 0,
60
- duration: 100,
61
- useNativeDriver: false
62
- };
63
- Animated.timing(position, animValue).start();
64
- };
65
-
66
- toggle(!checked, thumbPosition);
67
- }, [checked]);
68
- return /*#__PURE__*/React.createElement(SwitchTrack, {
69
- checked: checked,
70
- disabled: disabled,
71
- as: Animated.View,
72
- style: !disabled && {
73
- backgroundColor: thumbPosition.interpolate({
74
- inputRange: [0, 1],
75
- outputRange: [checkboxswitch.track.checked.backgroundColor, checkboxswitch.track.backgroundColor]
76
- })
77
- }
78
- }, pressed && !disabled && /*#__PURE__*/React.createElement(ThumbShadow, {
79
- checked: checked,
80
- as: Animated.View,
81
- style: {
82
- transform: [{
83
- translateX: thumbPosition.interpolate({
84
- inputRange: [0, 1],
85
- outputRange: [thumbShadowTo, thumbShadowFrom]
86
- })
87
- }]
88
- }
89
- }), /*#__PURE__*/React.createElement(SwitchThumb, {
90
- checked: checked,
91
- disabled: disabled,
92
- as: Animated.View,
93
- style: {
94
- transform: [{
95
- translateX: thumbPosition.interpolate({
96
- inputRange: [0, 1],
97
- outputRange: [thumbTo, thumbFrom]
98
- })
99
- }]
100
- }
101
- }));
102
- };
103
-
104
- CheckboxSwitch.propTypes = {
105
- checked: bool,
106
- disabled: bool,
107
- pressed: bool
108
- };
109
- CheckboxSwitch.defaultProps = {
110
- checked: false,
111
- disabled: false,
112
- pressed: false
113
- };
114
- CheckboxSwitch.displayName = 'Checkbox.Switch';
115
- export default withTouchable(withTheme(CheckboxSwitch));
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@testing-library/react-native';
3
- import Checkbox from '..';
4
- import ThemeProvider from '../../Theme';
5
- jest.useFakeTimers();
6
- describe('<Checkbox />', function () {
7
- describe('<Checkbox.Switch />', function () {
8
- describe('Snapshots', function () {
9
- it('should match snapshot with default switch', function () {
10
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, null))),
11
- toJSON = _render.toJSON;
12
-
13
- expect(toJSON()).toMatchSnapshot();
14
- });
15
- it('should match snapshot with disabled switch', function () {
16
- var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
17
- disabled: true
18
- }))),
19
- toJSON = _render2.toJSON;
20
-
21
- expect(toJSON()).toMatchSnapshot();
22
- });
23
- it('should match snapshot with checked switch', function () {
24
- var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
25
- checked: true
26
- }))),
27
- toJSON = _render3.toJSON;
28
-
29
- expect(toJSON()).toMatchSnapshot();
30
- });
31
- it('should match snapshot with disabled and checked switch', function () {
32
- var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
33
- disabled: true,
34
- checked: true
35
- }))),
36
- toJSON = _render4.toJSON;
37
-
38
- expect(toJSON()).toMatchSnapshot();
39
- });
40
- it('should call onChange function when click on Checkbox.Switch', function () {
41
- var onChangeMock = jest.fn();
42
-
43
- var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
44
- onChange: onChangeMock,
45
- accessibilityRole: "button"
46
- }))),
47
- getByRole = _render5.getByRole;
48
-
49
- fireEvent.press(getByRole('button'));
50
- expect(onChangeMock).toHaveBeenCalled();
51
- });
52
- });
53
- });
54
- });
@@ -1,3 +0,0 @@
1
- import Switch from './Switch';
2
- import Checkbox from './Checkbox';
3
- export { Checkbox, Switch };
@@ -1,153 +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
- /* eslint-disable no-console */
4
- import React from 'react';
5
- import { render, fireEvent } from '@testing-library/react';
6
- import Checkbox from '..';
7
- import ThemeProvider from '../../Theme';
8
- var data = {
9
- label: 'Checkbox Component',
10
- helper: 'Helper Text'
11
- };
12
- var originalError = console.error;
13
- beforeEach(function () {
14
- console.error = jest.fn();
15
- });
16
- afterEach(function () {
17
- console.error = originalError;
18
- });
19
- describe('<Checkbox />', function () {
20
- describe('Snapshots', function () {
21
- it('should match snapshot without props', function () {
22
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, null))),
23
- container = _render.container;
24
-
25
- expect(container).toMatchSnapshot();
26
- });
27
- it('should match snapshot with default checkbox', function () {
28
- var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, data))),
29
- container = _render2.container;
30
-
31
- expect(container).toMatchSnapshot();
32
- });
33
- it('should match snapshot with disabled checkbox', function () {
34
- var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
35
- disabled: true
36
- })))),
37
- container = _render3.container;
38
-
39
- expect(container).toMatchSnapshot();
40
- });
41
- it('should match snapshot with checked checkbox', function () {
42
- var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
43
- checked: true
44
- })))),
45
- container = _render4.container;
46
-
47
- expect(container).toMatchSnapshot();
48
- });
49
- it('should match snapshot with disabled and checked checkbox', function () {
50
- var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
51
- disabled: true,
52
- checked: true
53
- })))),
54
- container = _render5.container;
55
-
56
- expect(container).toMatchSnapshot();
57
- });
58
- it('should match snapshot with error checkbox', function () {
59
- var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
60
- error: "Error msg"
61
- })))),
62
- container = _render6.container;
63
-
64
- expect(container).toMatchSnapshot();
65
- });
66
- it('should match snapshot with error and checked checkbox', function () {
67
- var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
68
- error: "Error msg",
69
- checked: true
70
- })))),
71
- container = _render7.container;
72
-
73
- expect(container).toMatchSnapshot();
74
- });
75
- it('should match snapshot with inverted', function () {
76
- var _render8 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
77
- inverted: true
78
- })))),
79
- container = _render8.container;
80
-
81
- expect(container).toMatchSnapshot();
82
- });
83
- it('should match snapshot with inverted and checked', function () {
84
- var _render9 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
85
- inverted: true,
86
- checked: true
87
- })))),
88
- container = _render9.container;
89
-
90
- expect(container).toMatchSnapshot();
91
- });
92
- it('should match snapshot with inverted and checked and disabled', function () {
93
- var _render10 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
94
- inverted: true,
95
- checked: true,
96
- disabled: true
97
- })))),
98
- container = _render10.container;
99
-
100
- expect(container).toMatchSnapshot();
101
- });
102
- it('should match snapshot with indeterminate', function () {
103
- var _render11 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, {
104
- indeterminate: true
105
- }))),
106
- container = _render11.container;
107
-
108
- expect(container).toMatchSnapshot();
109
- });
110
- it('should match snapshot with indeterminate and disabled checkbox', function () {
111
- var _render12 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, {
112
- indeterminate: true,
113
- disabled: true
114
- }))),
115
- container = _render12.container;
116
-
117
- expect(container).toMatchSnapshot();
118
- });
119
- it('should match snapshot with error and indeterminate checkbox', function () {
120
- var _render13 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
121
- error: "Error msg",
122
- indeterminate: true
123
- })))),
124
- container = _render13.container;
125
-
126
- expect(container).toMatchSnapshot();
127
- });
128
- it('should match snapshot with inverted and indeterminate', function () {
129
- var _render14 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
130
- inverted: true,
131
- indeterminate: true
132
- })))),
133
- container = _render14.container;
134
-
135
- expect(container).toMatchSnapshot();
136
- });
137
- });
138
- describe('Events', function () {
139
- it('should call onChange function when press on Checkbox', function () {
140
- var onChangeMock = jest.fn();
141
-
142
- var _render15 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, data, {
143
- onChange: onChangeMock
144
- })))),
145
- getByRole = _render15.getByRole;
146
-
147
- fireEvent.click(getByRole('checkbox', {
148
- hidden: true
149
- }));
150
- expect(onChangeMock).toHaveBeenCalled();
151
- });
152
- });
153
- });
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@testing-library/react';
3
- import Checkbox from '..';
4
- import ThemeProvider from '../../Theme';
5
- describe('<Checkbox />', function () {
6
- describe('<Checkbox.Switch />', function () {
7
- describe('Snapshots', function () {
8
- it('should match snapshot with default switch', function () {
9
- var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, null))),
10
- container = _render.container;
11
-
12
- expect(container).toMatchSnapshot();
13
- });
14
- it('should match snapshot with disabled switch', function () {
15
- var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
16
- disabled: true
17
- }))),
18
- container = _render2.container;
19
-
20
- expect(container).toMatchSnapshot();
21
- });
22
- it('should match snapshot with checked switch', function () {
23
- var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
24
- checked: true
25
- }))),
26
- container = _render3.container;
27
-
28
- expect(container).toMatchSnapshot();
29
- });
30
- it('should match snapshot with disabled and checked switch', function () {
31
- var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
32
- disabled: true,
33
- checked: true
34
- }))),
35
- container = _render4.container;
36
-
37
- expect(container).toMatchSnapshot();
38
- });
39
- it('should call onChange function when click on Checkbox.Switch', function () {
40
- var onChangeMock = jest.fn();
41
-
42
- var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Checkbox.Switch, {
43
- disabled: true,
44
- checked: true,
45
- onChange: onChangeMock
46
- }))),
47
- getByRole = _render5.getByRole;
48
-
49
- fireEvent.click(getByRole('switch', {
50
- hidden: true
51
- }));
52
- expect(onChangeMock).toHaveBeenCalled();
53
- });
54
- });
55
- });
56
- });
@@ -1,2 +0,0 @@
1
- import Chips from './native';
2
- export default Chips;