@gympass/yoga 7.59.0 → 7.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Card/web/PlanCard/Content.js +11 -6
- package/cjs/Drawer/web/Content.js +1 -4
- package/esm/Card/web/PlanCard/Content.js +11 -6
- package/esm/Drawer/web/Content.js +1 -4
- package/package.json +5 -5
- package/cjs/ActionRequirement/native/ActionRequirement.test.js +0 -1
- package/cjs/ActionRequirement/web/ActionRequirement.test.js +0 -40
- package/cjs/AutoComplete/web/AutoComplete.test.js +0 -156
- package/cjs/Avatar/native/Avatar.test.js +0 -1
- package/cjs/Avatar/web/Avatar.test.js +0 -72
- package/cjs/Banner/native/Banner.test.js +0 -1
- package/cjs/Banner/web/Banner.test.js +0 -121
- package/cjs/BottomSheet/web/BottomSheet.test.js +0 -61
- package/cjs/Box/native/Box.test.js +0 -1
- package/cjs/Box/web/Box.test.js +0 -23
- package/cjs/Button/native/Button.test.js +0 -1
- package/cjs/Button/web/Button.test.js +0 -778
- package/cjs/Card/native/Card/Card.test.js +0 -1
- package/cjs/Card/native/EventCard/EventCard.test.js +0 -1
- package/cjs/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -1
- package/cjs/Card/native/PlanCard/PlanCard.test.js +0 -1
- package/cjs/Card/web/Card/Card.test.js +0 -22
- package/cjs/Card/web/EventCard/EventCard.test.js +0 -35
- package/cjs/Card/web/PlanCard/PlanCard.test.js +0 -95
- package/cjs/Checkbox/native/Checkbox.test.js +0 -1
- package/cjs/Checkbox/native/Switch.test.js +0 -1
- package/cjs/Checkbox/web/Checkbox.test.js +0 -161
- package/cjs/Checkbox/web/Switch.test.js +0 -65
- package/cjs/Chips/native/Chips.test.js +0 -1
- package/cjs/Chips/web/Chips.test.js +0 -138
- package/cjs/Datepicker/web/Datepicker.test.js +0 -286
- package/cjs/Dialog/web/Dialog.test.js +0 -78
- package/cjs/Divider/native/Divider.test.js +0 -1
- package/cjs/Divider/web/Divider.test.js +0 -36
- package/cjs/Drawer/web/Drawer.test.js +0 -46
- package/cjs/Dropdown/native/Backdrop.test.js +0 -1
- package/cjs/Dropdown/native/Dropdown.test.js +0 -1
- package/cjs/Dropdown/web/Dropdown.test.js +0 -102
- package/cjs/Feedback/web/Feedback.test.js +0 -89
- package/cjs/Grid/web/Col.test.js +0 -56
- package/cjs/Grid/web/Container.test.js +0 -22
- package/cjs/Grid/web/Hide.test.js +0 -39
- package/cjs/Grid/web/Row.test.js +0 -22
- package/cjs/Header/web/Header.test.js +0 -49
- package/cjs/Heading/web/Heading.test.js +0 -68
- package/cjs/Icon/native/Icon.test.js +0 -1
- package/cjs/Icon/web/Icon.test.js +0 -53
- package/cjs/Input/native/Email.test.js +0 -1
- package/cjs/Input/native/Input.test.js +0 -1
- package/cjs/Input/native/Number.test.js +0 -1
- package/cjs/Input/native/Password.test.js +0 -1
- package/cjs/Input/native/Tel.test.js +0 -1
- package/cjs/Input/web/Email.test.js +0 -20
- package/cjs/Input/web/Input.test.js +0 -161
- package/cjs/Input/web/Number.test.js +0 -20
- package/cjs/Input/web/Password.test.js +0 -103
- package/cjs/Input/web/Tel.test.js +0 -20
- package/cjs/List/native/List.test.js +0 -1
- package/cjs/List/web/List.test.js +0 -69
- package/cjs/Menu/web/Menu.test.js +0 -123
- package/cjs/Popover/web/Popover.test.js +0 -27
- package/cjs/Progress/native/Progress.test.js +0 -1
- package/cjs/Progress/web/Progress.test.js +0 -229
- package/cjs/RadioGroup/native/Button/RadioButton.test.js +0 -1
- package/cjs/RadioGroup/native/Radio/Radio.test.js +0 -1
- package/cjs/RadioGroup/native/RadioGroup.test.js +0 -1
- package/cjs/RadioGroup/web/Button/RadioButton.test.js +0 -132
- package/cjs/RadioGroup/web/Radio/Radio.test.js +0 -119
- package/cjs/RadioGroup/web/RadioGroup.test.js +0 -93
- package/cjs/Rating/native/Rating.test.js +0 -1
- package/cjs/Rating/web/Rating.test.js +0 -201
- package/cjs/Result/native/Result.test.js +0 -1
- package/cjs/Skeleton/native/Skeleton.test.js +0 -1
- package/cjs/Skeleton/web/Skeleton.test.js +0 -84
- package/cjs/Slider/native/Slider.test.js +0 -1
- package/cjs/Slider/web/Slider.test.js +0 -95
- package/cjs/Snackbar/native/Snackbar.test.js +0 -1
- package/cjs/Snackbar/web/Snackbar.test.js +0 -137
- package/cjs/Stepper/native/Stepper.test.js +0 -1
- package/cjs/Stepper/web/Stepper.test.js +0 -75
- package/cjs/Tag/native/Tag.test.js +0 -1
- package/cjs/Tag/web/Tag.test.js +0 -87
- package/cjs/Text/native/Text.test.js +0 -1
- package/cjs/Text/web/Text.test.js +0 -157
- package/cjs/TextArea/native/TextArea.test.js +0 -1
- package/cjs/TextArea/web/TextArea.test.js +0 -18
- package/cjs/Theme/Provider/web/FontLoader.test.js +0 -19
- package/cjs/Theme/Provider/web/GlobalStyle.test.js +0 -27
- package/cjs/Theme/helpers/themeReader/native/native.test.js +0 -1
- package/cjs/Theme/helpers/themeReader/web/web.test.js +0 -54
- package/esm/ActionRequirement/index.native.js +0 -2
- package/esm/ActionRequirement/native/ActionRequirement.js +0 -48
- package/esm/ActionRequirement/native/ActionRequirement.test.js +0 -45
- package/esm/ActionRequirement/native/ActionRequirementStyles.js +0 -25
- package/esm/ActionRequirement/native/index.js +0 -6
- package/esm/ActionRequirement/web/ActionRequirement.test.js +0 -31
- package/esm/AutoComplete/web/AutoComplete.test.js +0 -139
- package/esm/Avatar/index.native.js +0 -4
- package/esm/Avatar/native/Avatar.js +0 -96
- package/esm/Avatar/native/Avatar.test.js +0 -46
- package/esm/Avatar/native/AvatarCircle.js +0 -24
- package/esm/Avatar/web/Avatar.test.js +0 -63
- package/esm/Banner/index.native.js +0 -2
- package/esm/Banner/native/Banner.js +0 -128
- package/esm/Banner/native/Banner.test.js +0 -103
- package/esm/Banner/native/index.js +0 -2
- package/esm/Banner/web/Banner.test.js +0 -109
- package/esm/BottomSheet/web/BottomSheet.test.js +0 -48
- package/esm/Box/index.native.js +0 -2
- package/esm/Box/native/Box.js +0 -4
- package/esm/Box/native/Box.test.js +0 -16
- package/esm/Box/native/index.js +0 -2
- package/esm/Box/web/Box.test.js +0 -16
- package/esm/Button/index.native.js +0 -8
- package/esm/Button/native/Button.js +0 -110
- package/esm/Button/native/Button.test.js +0 -475
- package/esm/Button/native/Icon.js +0 -82
- package/esm/Button/native/Link.js +0 -35
- package/esm/Button/native/Text.js +0 -74
- package/esm/Button/native/withTouchable.js +0 -63
- package/esm/Button/web/Button.test.js +0 -764
- package/esm/Card/index.native.js +0 -2
- package/esm/Card/native/Card/Actions.js +0 -12
- package/esm/Card/native/Card/Card.js +0 -92
- package/esm/Card/native/Card/Card.test.js +0 -15
- package/esm/Card/native/Card/Content.js +0 -8
- package/esm/Card/native/Card/Header.js +0 -8
- package/esm/Card/native/Card/index.js +0 -8
- package/esm/Card/native/EventCard/EventCard.js +0 -169
- package/esm/Card/native/EventCard/EventCard.test.js +0 -65
- package/esm/Card/native/EventCard/index.js +0 -2
- package/esm/Card/native/GymCard/CheckIn/Avatar.js +0 -17
- package/esm/Card/native/GymCard/CheckIn/CheckIn.js +0 -66
- package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +0 -39
- package/esm/Card/native/GymCard/CheckIn/Content.js +0 -11
- package/esm/Card/native/GymCard/CheckIn/Header.js +0 -11
- package/esm/Card/native/GymCard/CheckIn/index.js +0 -2
- package/esm/Card/native/GymCard/index.js +0 -5
- package/esm/Card/native/PlanCard/Actions.js +0 -22
- package/esm/Card/native/PlanCard/Content.js +0 -75
- package/esm/Card/native/PlanCard/List.js +0 -73
- package/esm/Card/native/PlanCard/PlanCard.js +0 -51
- package/esm/Card/native/PlanCard/PlanCard.test.js +0 -84
- package/esm/Card/native/PlanCard/Subtitle.js +0 -15
- package/esm/Card/native/PlanCard/Tag.js +0 -34
- package/esm/Card/native/PlanCard/index.js +0 -15
- package/esm/Card/native/index.js +0 -5
- package/esm/Card/web/Card/Card.test.js +0 -14
- package/esm/Card/web/EventCard/EventCard.test.js +0 -27
- package/esm/Card/web/PlanCard/PlanCard.test.js +0 -85
- package/esm/Checkbox/index.native.js +0 -3
- package/esm/Checkbox/native/Checkbox.js +0 -179
- package/esm/Checkbox/native/Checkbox.test.js +0 -115
- package/esm/Checkbox/native/Switch.js +0 -115
- package/esm/Checkbox/native/Switch.test.js +0 -54
- package/esm/Checkbox/native/index.js +0 -3
- package/esm/Checkbox/web/Checkbox.test.js +0 -153
- package/esm/Checkbox/web/Switch.test.js +0 -56
- package/esm/Chips/index.native.js +0 -2
- package/esm/Chips/native/Chips.js +0 -104
- package/esm/Chips/native/Chips.test.js +0 -143
- package/esm/Chips/native/Counter.js +0 -20
- package/esm/Chips/native/index.js +0 -2
- package/esm/Chips/web/Chips.test.js +0 -128
- package/esm/Datepicker/web/Datepicker.test.js +0 -247
- package/esm/Dialog/web/Dialog.test.js +0 -62
- package/esm/Divider/index.native.js +0 -2
- package/esm/Divider/native/Divider.js +0 -29
- package/esm/Divider/native/Divider.test.js +0 -29
- package/esm/Divider/native/index.js +0 -2
- package/esm/Divider/web/Divider.test.js +0 -29
- package/esm/Drawer/web/Drawer.test.js +0 -33
- package/esm/Dropdown/index.native.js +0 -2
- package/esm/Dropdown/native/Backdrop.js +0 -93
- package/esm/Dropdown/native/Backdrop.test.js +0 -26
- package/esm/Dropdown/native/Dropdown.js +0 -142
- package/esm/Dropdown/native/Dropdown.test.js +0 -78
- package/esm/Dropdown/native/Options.android.js +0 -66
- package/esm/Dropdown/native/Options.ios.js +0 -71
- package/esm/Dropdown/native/index.js +0 -2
- package/esm/Dropdown/web/Dropdown.test.js +0 -93
- package/esm/Feedback/web/Feedback.test.js +0 -83
- package/esm/Grid/web/Col.test.js +0 -48
- package/esm/Grid/web/Container.test.js +0 -14
- package/esm/Grid/web/Hide.test.js +0 -31
- package/esm/Grid/web/Row.test.js +0 -14
- package/esm/Header/web/Header.test.js +0 -38
- package/esm/Heading/web/Heading.test.js +0 -58
- package/esm/Icon/index.native.js +0 -2
- package/esm/Icon/native/Icon.test.js +0 -47
- package/esm/Icon/native/index.js +0 -2
- package/esm/Icon/web/Icon.test.js +0 -47
- package/esm/Input/index.native.js +0 -6
- package/esm/Input/native/Email.js +0 -15
- package/esm/Input/native/Email.test.js +0 -13
- package/esm/Input/native/Helper.js +0 -62
- package/esm/Input/native/Input.js +0 -234
- package/esm/Input/native/Input.test.js +0 -181
- package/esm/Input/native/Number.js +0 -12
- package/esm/Input/native/Number.test.js +0 -13
- package/esm/Input/native/Password.js +0 -112
- package/esm/Input/native/Password.test.js +0 -125
- package/esm/Input/native/Tel.js +0 -14
- package/esm/Input/native/Tel.test.js +0 -13
- package/esm/Input/native/index.js +0 -6
- package/esm/Input/web/Email.test.js +0 -13
- package/esm/Input/web/Input.test.js +0 -145
- package/esm/Input/web/Number.test.js +0 -13
- package/esm/Input/web/Password.test.js +0 -90
- package/esm/Input/web/Tel.test.js +0 -13
- package/esm/List/index.native.js +0 -3
- package/esm/List/native/List.js +0 -22
- package/esm/List/native/List.test.js +0 -106
- package/esm/List/native/ListItem.js +0 -51
- package/esm/List/native/index.js +0 -3
- package/esm/List/web/List.test.js +0 -62
- package/esm/Menu/web/Menu.test.js +0 -115
- package/esm/Popover/web/Popover.test.js +0 -19
- package/esm/Progress/index.native.js +0 -2
- package/esm/Progress/native/Progress.js +0 -103
- package/esm/Progress/native/Progress.test.js +0 -222
- package/esm/Progress/native/index.js +0 -2
- package/esm/Progress/web/Progress.test.js +0 -222
- package/esm/RadioGroup/index.native.js +0 -4
- package/esm/RadioGroup/native/Button/RadioButton.js +0 -64
- package/esm/RadioGroup/native/Button/RadioButton.test.js +0 -96
- package/esm/RadioGroup/native/Radio/Radio.js +0 -88
- package/esm/RadioGroup/native/Radio/Radio.test.js +0 -112
- package/esm/RadioGroup/native/RadioGroup.js +0 -66
- package/esm/RadioGroup/native/RadioGroup.test.js +0 -50
- package/esm/RadioGroup/native/index.js +0 -4
- package/esm/RadioGroup/web/Button/RadioButton.test.js +0 -121
- package/esm/RadioGroup/web/Radio/Radio.test.js +0 -108
- package/esm/RadioGroup/web/RadioGroup.test.js +0 -83
- package/esm/Rating/index.native.js +0 -2
- package/esm/Rating/native/Rating.js +0 -186
- package/esm/Rating/native/Rating.test.js +0 -121
- package/esm/Rating/native/index.js +0 -2
- package/esm/Rating/web/Rating.test.js +0 -184
- package/esm/Result/index.native.js +0 -8
- package/esm/Result/native/Attendances.js +0 -55
- package/esm/Result/native/Details.js +0 -97
- package/esm/Result/native/Rate.js +0 -35
- package/esm/Result/native/Result.js +0 -86
- package/esm/Result/native/Result.test.js +0 -107
- package/esm/Result/native/ResultButton.js +0 -13
- package/esm/Result/native/Tags.js +0 -41
- package/esm/Result/native/TinyTextIcon.js +0 -18
- package/esm/Result/native/index.js +0 -2
- package/esm/Skeleton/index.native.js +0 -2
- package/esm/Skeleton/native/Skeleton.js +0 -94
- package/esm/Skeleton/native/Skeleton.test.js +0 -78
- package/esm/Skeleton/native/index.js +0 -2
- package/esm/Skeleton/web/Skeleton.test.js +0 -77
- package/esm/Slider/index.native.js +0 -2
- package/esm/Slider/native/Label.js +0 -19
- package/esm/Slider/native/Marker.js +0 -68
- package/esm/Slider/native/Slider.js +0 -156
- package/esm/Slider/native/Slider.test.js +0 -122
- package/esm/Slider/native/Step.js +0 -14
- package/esm/Slider/native/Tooltip.js +0 -90
- package/esm/Slider/web/Slider.test.js +0 -86
- package/esm/Snackbar/index.native.js +0 -2
- package/esm/Snackbar/native/Snackbar.js +0 -199
- package/esm/Snackbar/native/Snackbar.test.js +0 -100
- package/esm/Snackbar/native/SnackbarAnimationWrapper.js +0 -124
- package/esm/Snackbar/native/index.js +0 -2
- package/esm/Snackbar/web/Snackbar.test.js +0 -118
- package/esm/Stepper/index.native.js +0 -3
- package/esm/Stepper/native/Dots.js +0 -45
- package/esm/Stepper/native/Line.js +0 -35
- package/esm/Stepper/native/Step.js +0 -19
- package/esm/Stepper/native/Stepper.js +0 -52
- package/esm/Stepper/native/Stepper.test.js +0 -70
- package/esm/Stepper/native/index.js +0 -3
- package/esm/Stepper/web/Stepper.test.js +0 -67
- package/esm/Tag/index.native.js +0 -4
- package/esm/Tag/native/Informative.js +0 -72
- package/esm/Tag/native/Tag.js +0 -75
- package/esm/Tag/native/Tag.test.js +0 -94
- package/esm/Tag/native/index.js +0 -2
- package/esm/Tag/web/Tag.test.js +0 -79
- package/esm/Text/index.native.js +0 -16
- package/esm/Text/native/Text.js +0 -69
- package/esm/Text/native/Text.test.js +0 -149
- package/esm/Text/native/index.js +0 -2
- package/esm/Text/web/Text.test.js +0 -149
- package/esm/TextArea/index.native.js +0 -2
- package/esm/TextArea/native/TextArea.js +0 -59
- package/esm/TextArea/native/TextArea.test.js +0 -11
- package/esm/TextArea/native/index.js +0 -2
- package/esm/TextArea/web/TextArea.test.js +0 -11
- package/esm/Theme/Provider/index.native.js +0 -2
- package/esm/Theme/Provider/native/index.js +0 -2
- package/esm/Theme/Provider/web/FontLoader.test.js +0 -11
- package/esm/Theme/Provider/web/GlobalStyle.test.js +0 -17
- package/esm/Theme/helpers/themeReader/native/native.test.js +0 -53
- package/esm/Theme/helpers/themeReader/web/web.test.js +0 -41
- package/esm/Theme/index.native.js +0 -5
- package/esm/index.native.js +0 -26
- package/esm/shared/index.native.js +0 -2
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
var _excluded = ["icon", "theme", "small", "pressed", "disabled", "inverted", "secondary"];
|
|
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, { forwardRef } from 'react';
|
|
12
|
-
import styled, { withTheme } from 'styled-components';
|
|
13
|
-
import { node, oneOfType, func, bool } from 'prop-types';
|
|
14
|
-
import Icon from '../../Icon';
|
|
15
|
-
import withTouchable from './withTouchable';
|
|
16
|
-
var ButtonContainer = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n ", "\n"])), function (_ref) {
|
|
17
|
-
var small = _ref.small,
|
|
18
|
-
secondary = _ref.secondary,
|
|
19
|
-
button = _ref.theme.yoga.components.button,
|
|
20
|
-
disabled = _ref.disabled,
|
|
21
|
-
inverted = _ref.inverted,
|
|
22
|
-
pressed = _ref.pressed;
|
|
23
|
-
var state = secondary ? 'secondary' : 'primary';
|
|
24
|
-
return "\n border-radius: " + button.border.radius + "px;\n\n background-color: " + button.types.contained.backgroundColor[state]["default"] + ";\n\n width: " + (small ? button.height.small : button.height["default"]) + "px;\n height: " + (small ? button.height.small : button.height["default"]) + "px;\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 ";
|
|
25
|
-
});
|
|
26
|
-
var ButtonIcon = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
27
|
-
var icon = _ref2.icon,
|
|
28
|
-
button = _ref2.theme.yoga.components.button,
|
|
29
|
-
small = _ref2.small,
|
|
30
|
-
pressed = _ref2.pressed,
|
|
31
|
-
disabled = _ref2.disabled,
|
|
32
|
-
inverted = _ref2.inverted,
|
|
33
|
-
secondary = _ref2.secondary,
|
|
34
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
35
|
-
|
|
36
|
-
var state = secondary ? 'secondary' : 'primary';
|
|
37
|
-
var textColor = button.types.contained.font["default"].color;
|
|
38
|
-
|
|
39
|
-
if (disabled) {
|
|
40
|
-
textColor = button.types.contained.font.disabled.color;
|
|
41
|
-
} else if (inverted) {
|
|
42
|
-
textColor = button.types.contained.backgroundColor[state]["default"];
|
|
43
|
-
|
|
44
|
-
if (pressed) {
|
|
45
|
-
textColor = button.types.contained.backgroundColor[state].pressed;
|
|
46
|
-
}
|
|
47
|
-
} else if (pressed) {
|
|
48
|
-
textColor = button.types.contained.font.pressed.color;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/React.createElement(ButtonContainer, _extends({}, props, {
|
|
52
|
-
ref: ref,
|
|
53
|
-
small: small,
|
|
54
|
-
pressed: pressed,
|
|
55
|
-
disabled: disabled,
|
|
56
|
-
inverted: inverted,
|
|
57
|
-
secondary: secondary,
|
|
58
|
-
accessibilityRole: "button"
|
|
59
|
-
}), /*#__PURE__*/React.createElement(Icon, {
|
|
60
|
-
as: icon,
|
|
61
|
-
fill: textColor,
|
|
62
|
-
size: small ? button.icon.size.small : button.icon.size["default"]
|
|
63
|
-
}));
|
|
64
|
-
});
|
|
65
|
-
ButtonIcon.propTypes = {
|
|
66
|
-
small: bool,
|
|
67
|
-
disabled: bool,
|
|
68
|
-
pressed: bool,
|
|
69
|
-
inverted: bool,
|
|
70
|
-
secondary: bool,
|
|
71
|
-
icon: oneOfType([node, func])
|
|
72
|
-
};
|
|
73
|
-
ButtonIcon.defaultProps = {
|
|
74
|
-
small: false,
|
|
75
|
-
disabled: false,
|
|
76
|
-
pressed: false,
|
|
77
|
-
inverted: false,
|
|
78
|
-
secondary: false,
|
|
79
|
-
icon: undefined
|
|
80
|
-
};
|
|
81
|
-
ButtonIcon.displayName = 'Button.Icon';
|
|
82
|
-
export default withTouchable(withTheme(ButtonIcon));
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
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, { forwardRef } from 'react';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
|
-
import { bool } from 'prop-types';
|
|
10
|
-
import { hexToRgb } from '@gympass/yoga-common';
|
|
11
|
-
import withTouchable from './withTouchable';
|
|
12
|
-
import { Label } from './Button';
|
|
13
|
-
var Link = styled(Label)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
14
|
-
var disabled = _ref.disabled,
|
|
15
|
-
pressed = _ref.pressed,
|
|
16
|
-
secondary = _ref.secondary,
|
|
17
|
-
link = _ref.theme.yoga.components.button.types.link;
|
|
18
|
-
var state = secondary ? 'secondary' : 'primary';
|
|
19
|
-
return "\n color: " + link.font[state].color + ";\n\n " + (disabled ? "color: " + link.font.disabled.color + ";" : '') + "\n " + (!disabled && pressed ? "color: " + hexToRgb(link.font[state].color, 0.75) + ";" : '') + "\n ";
|
|
20
|
-
});
|
|
21
|
-
var ButtonLink = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(Link, _extends({}, props, {
|
|
23
|
-
ref: ref
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
ButtonLink.propTypes = {
|
|
27
|
-
disabled: bool,
|
|
28
|
-
secondary: bool
|
|
29
|
-
};
|
|
30
|
-
ButtonLink.defaultProps = {
|
|
31
|
-
disabled: false,
|
|
32
|
-
secondary: false
|
|
33
|
-
};
|
|
34
|
-
ButtonLink.displayName = 'Button.Link';
|
|
35
|
-
export default withTouchable(ButtonLink);
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children", "disabled", "pressed", "small", "secondary", "inverted", "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 { hexToRgb } from '@gympass/yoga-common';
|
|
14
|
-
import withTouchable from './withTouchable';
|
|
15
|
-
import { Label, ButtonContainer } from './Button';
|
|
16
|
-
var LabelText = styled(Label)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
|
|
17
|
-
var color = _ref.color;
|
|
18
|
-
return "color: " + color + ";";
|
|
19
|
-
});
|
|
20
|
-
var ButtonContainerText = styled(ButtonContainer)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
|
|
21
|
-
var button = _ref2.theme.yoga.components.button;
|
|
22
|
-
return "\n background-color: " + button.types.text.backgroundColor + ";\n ";
|
|
23
|
-
});
|
|
24
|
-
var ButtonText = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
25
|
-
var children = _ref3.children,
|
|
26
|
-
disabled = _ref3.disabled,
|
|
27
|
-
pressed = _ref3.pressed,
|
|
28
|
-
small = _ref3.small,
|
|
29
|
-
secondary = _ref3.secondary,
|
|
30
|
-
inverted = _ref3.inverted,
|
|
31
|
-
Icon = _ref3.icon,
|
|
32
|
-
_ref3$theme$yoga = _ref3.theme.yoga,
|
|
33
|
-
colors = _ref3$theme$yoga.colors,
|
|
34
|
-
button = _ref3$theme$yoga.components.button,
|
|
35
|
-
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
36
|
-
|
|
37
|
-
var state = secondary ? 'secondary' : 'primary';
|
|
38
|
-
var textColor = colors[state];
|
|
39
|
-
|
|
40
|
-
if (disabled) {
|
|
41
|
-
textColor = button.types.text.disabled;
|
|
42
|
-
} else if (inverted) {
|
|
43
|
-
textColor = colors.white;
|
|
44
|
-
|
|
45
|
-
if (pressed) {
|
|
46
|
-
textColor = hexToRgb(colors.white, 0.75);
|
|
47
|
-
}
|
|
48
|
-
} else if (pressed) {
|
|
49
|
-
textColor = hexToRgb(colors[state], 0.75);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return /*#__PURE__*/React.createElement(ButtonContainerText, _extends({}, rest, {
|
|
53
|
-
disabled: disabled,
|
|
54
|
-
pressed: pressed,
|
|
55
|
-
small: small,
|
|
56
|
-
ref: ref
|
|
57
|
-
}), Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
58
|
-
width: small ? button.icon.size.small : button.icon.size["default"],
|
|
59
|
-
height: small ? button.icon.size.small : button.icon.size["default"],
|
|
60
|
-
fill: textColor,
|
|
61
|
-
style: {
|
|
62
|
-
marginRight: button.icon.margin.right
|
|
63
|
-
}
|
|
64
|
-
}), /*#__PURE__*/React.createElement(LabelText, {
|
|
65
|
-
disabled: disabled,
|
|
66
|
-
pressed: pressed,
|
|
67
|
-
small: small,
|
|
68
|
-
secondary: secondary,
|
|
69
|
-
color: textColor
|
|
70
|
-
}, children));
|
|
71
|
-
});
|
|
72
|
-
ButtonText.propTypes = ButtonContainer.propTypes;
|
|
73
|
-
ButtonText.defaultProps = ButtonContainer.defaultProps;
|
|
74
|
-
export default withTouchable(withTheme(ButtonText));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var _excluded = ["onPressIn", "onPressOut", "onChange", "onPress"];
|
|
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 _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; }
|
|
6
|
-
|
|
7
|
-
import React, { useState } from 'react';
|
|
8
|
-
import { View, TouchableWithoutFeedback } from 'react-native';
|
|
9
|
-
import { element, func } from 'prop-types';
|
|
10
|
-
|
|
11
|
-
var withTouchable = function withTouchable(Component) {
|
|
12
|
-
var WithTouchable = function WithTouchable(_ref) {
|
|
13
|
-
var _onPressIn = _ref.onPressIn,
|
|
14
|
-
_onPressOut = _ref.onPressOut,
|
|
15
|
-
onChange = _ref.onChange,
|
|
16
|
-
_ref$onPress = _ref.onPress,
|
|
17
|
-
onPress = _ref$onPress === void 0 ? onChange : _ref$onPress,
|
|
18
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
-
|
|
20
|
-
var _useState = useState(false),
|
|
21
|
-
pressed = _useState[0],
|
|
22
|
-
setPressed = _useState[1];
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, _extends({
|
|
25
|
-
onPressIn: function onPressIn(e) {
|
|
26
|
-
setPressed(true);
|
|
27
|
-
|
|
28
|
-
_onPressIn(e);
|
|
29
|
-
},
|
|
30
|
-
onPressOut: function onPressOut(e) {
|
|
31
|
-
setPressed(false);
|
|
32
|
-
|
|
33
|
-
_onPressOut(e);
|
|
34
|
-
},
|
|
35
|
-
onPress: onPress
|
|
36
|
-
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
37
|
-
style: {
|
|
38
|
-
flexDirection: 'row'
|
|
39
|
-
}
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
41
|
-
pressed: pressed
|
|
42
|
-
}))));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
WithTouchable.propTypes = {
|
|
46
|
-
onPressIn: func,
|
|
47
|
-
onPressOut: func,
|
|
48
|
-
onChange: func,
|
|
49
|
-
onPress: func
|
|
50
|
-
};
|
|
51
|
-
WithTouchable.defaultProps = {
|
|
52
|
-
onPressIn: function onPressIn() {},
|
|
53
|
-
onPressOut: function onPressOut() {},
|
|
54
|
-
onChange: undefined,
|
|
55
|
-
onPress: undefined
|
|
56
|
-
};
|
|
57
|
-
return WithTouchable;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
withTouchable.propTypes = {
|
|
61
|
-
Component: element
|
|
62
|
-
};
|
|
63
|
-
export default withTouchable;
|