@gympass/yoga 2.5.7 → 2.5.10
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/LICENSE +21 -0
- package/cjs/AutoComplete/AutoComplete.theme.js +2 -2
- package/cjs/AutoComplete/web/AutoComplete.js +61 -15
- package/cjs/Button/native/Button.js +1 -1
- package/cjs/Button/native/Link.js +1 -1
- package/cjs/Button/native/Outline.js +1 -1
- package/cjs/Button/native/Text.js +1 -1
- package/cjs/Button/native/withTouchable.js +1 -1
- package/cjs/Button/web/Button.js +2 -4
- package/cjs/Button/web/Link.js +11 -3
- package/cjs/Button/web/Outline.js +11 -3
- package/cjs/Button/web/StyledButton.js +11 -3
- package/cjs/Button/web/Text.js +11 -3
- package/cjs/Card/index.js +4 -4
- package/cjs/Card/index.native.js +1 -1
- package/cjs/Card/native/Card/Actions.js +1 -1
- package/cjs/Card/native/Card/Card.js +1 -1
- package/cjs/Card/native/Card/Content.js +1 -1
- package/cjs/Card/native/Card/Header.js +1 -1
- package/cjs/Card/native/EventCard/EventCard.js +1 -1
- package/cjs/Card/native/GymCard/CheckIn/Avatar.js +1 -1
- package/cjs/Card/native/GymCard/CheckIn/CheckIn.js +1 -1
- package/cjs/Card/native/GymCard/CheckIn/Content.js +1 -1
- package/cjs/Card/native/GymCard/CheckIn/Header.js +1 -1
- package/cjs/Card/native/PlanCard/Actions.js +1 -1
- package/cjs/Card/native/PlanCard/Content.js +1 -1
- package/cjs/Card/native/PlanCard/PlanCard.js +1 -1
- package/cjs/Card/native/index.js +1 -1
- package/cjs/Card/web/Card/Actions.js +11 -3
- package/cjs/Card/web/Card/Card.js +23 -7
- package/cjs/Card/web/Card/Content.js +11 -3
- package/cjs/Card/web/Card/Header.js +11 -3
- package/cjs/Card/web/EventCard/EventCard.js +82 -16
- package/cjs/Card/web/PlanCard/Actions.js +11 -3
- package/cjs/Card/web/PlanCard/Content.js +34 -8
- package/cjs/Card/web/PlanCard/PlanCard.js +12 -4
- package/cjs/Card/web/index.js +4 -4
- package/cjs/Checkbox/native/Checkbox.js +1 -1
- package/cjs/Checkbox/native/Switch.js +1 -1
- package/cjs/Checkbox/native/index.js +1 -1
- package/cjs/Checkbox/web/Checkbox.js +80 -14
- package/cjs/Checkbox/web/Switch.js +100 -14
- package/cjs/Checkbox/web/index.js +4 -4
- package/cjs/Dropdown/native/Backdrop.js +1 -1
- package/cjs/Dropdown/native/Dropdown.js +1 -1
- package/cjs/Dropdown/native/Options.android.js +1 -1
- package/cjs/Dropdown/native/Options.ios.js +1 -1
- package/cjs/Dropdown/web/Dropdown.js +80 -15
- package/cjs/Grid/index.js +8 -8
- package/cjs/Grid/web/Col.js +34 -6
- package/cjs/Grid/web/Container.js +68 -10
- package/cjs/Grid/web/Hide.js +11 -3
- package/cjs/Grid/web/Row.js +33 -5
- package/cjs/Grid/web/hideQuery.js +164 -16
- package/cjs/Grid/web/index.js +8 -8
- package/cjs/Grid/web/query.js +11 -3
- package/cjs/Grid/web/query.test.js +22 -4
- package/cjs/Input/native/Input.js +1 -1
- package/cjs/Input/native/Password.js +1 -1
- package/cjs/Input/native/index.js +1 -1
- package/cjs/Input/web/Email.js +1 -1
- package/cjs/Input/web/Field.js +45 -7
- package/cjs/Input/web/Fieldset.js +11 -3
- package/cjs/Input/web/Helper.js +22 -4
- package/cjs/Input/web/Input.js +31 -14
- package/cjs/Input/web/Label.js +27 -11
- package/cjs/Input/web/Legend.js +24 -8
- package/cjs/Input/web/Number.js +1 -1
- package/cjs/Input/web/Password.js +39 -13
- package/cjs/Input/web/Tel.js +1 -1
- package/cjs/Input/web/Wrapper.js +11 -3
- package/cjs/Input/web/index.js +8 -8
- package/cjs/List/native/List.js +1 -1
- package/cjs/List/native/ListItem.js +1 -1
- package/cjs/List/native/index.js +1 -1
- package/cjs/List/web/LinkItem.js +12 -4
- package/cjs/List/web/List.js +13 -7
- package/cjs/List/web/ListItem.js +12 -4
- package/cjs/List/web/index.js +4 -4
- package/cjs/Progress/native/Progress.js +1 -1
- package/cjs/Progress/web/Progress.js +35 -9
- package/cjs/RadioGroup/RadioGroupContext.js +1 -1
- package/cjs/RadioGroup/native/Button/RadioButton.js +1 -1
- package/cjs/RadioGroup/native/Radio/Radio.js +1 -1
- package/cjs/RadioGroup/native/RadioGroup.js +1 -1
- package/cjs/RadioGroup/native/index.js +1 -1
- package/cjs/RadioGroup/web/Button/RadioButton.js +28 -13
- package/cjs/RadioGroup/web/Radio/Radio.js +41 -15
- package/cjs/RadioGroup/web/RadioGroup.js +15 -9
- package/cjs/RadioGroup/web/index.js +4 -4
- package/cjs/Rating/native/Rating.js +1 -1
- package/cjs/Rating/web/Rating.js +17 -11
- package/cjs/Slider/native/Label.js +1 -1
- package/cjs/Slider/native/Slider.js +1 -1
- package/cjs/Slider/native/Tooltip.js +1 -1
- package/cjs/Slider/web/Marker.js +13 -7
- package/cjs/Slider/web/Slider.js +31 -17
- package/cjs/Slider/web/Tooltip.js +68 -12
- package/cjs/Stepper/native/Dots.js +1 -1
- package/cjs/Stepper/native/Line.js +1 -1
- package/cjs/Stepper/native/Step.js +1 -1
- package/cjs/Stepper/native/Stepper.js +1 -1
- package/cjs/Stepper/native/index.js +1 -1
- package/cjs/Stepper/web/Dots.js +80 -12
- package/cjs/Stepper/web/Line.js +24 -6
- package/cjs/Stepper/web/Step.js +11 -3
- package/cjs/Stepper/web/Stepper.js +37 -11
- package/cjs/Stepper/web/index.js +4 -4
- package/cjs/Tag/native/Tag.js +1 -1
- package/cjs/Tag/web/Tag.js +16 -10
- package/cjs/Text/native/Text.js +1 -1
- package/cjs/Text/native/index.js +1 -1
- package/cjs/Text/textStyle.js +10 -2
- package/cjs/Text/web/Text.js +12 -4
- package/cjs/Text/web/index.js +6 -6
- package/cjs/TextArea/native/TextArea.js +1 -1
- package/cjs/TextArea/web/TextArea.js +40 -14
- package/cjs/Theme/Provider/Provider.js +5 -7
- package/cjs/Theme/Provider/index.js +4 -4
- package/cjs/Theme/Provider/web/GlobalStyle.js +10 -2
- package/cjs/Theme/Provider/web/ThemeProvider.js +1 -3
- package/cjs/Theme/Provider/web/index.js +4 -4
- package/cjs/Theme/helpers/themeReader/base.test.js +1 -1
- package/cjs/Theme/helpers/themeReader/index.js +1 -1
- package/cjs/Theme/index.js +7 -7
- package/cjs/Theme/index.native.js +1 -1
- package/cjs/Theme/themes/BaseTheme.js +3 -3
- package/cjs/Theme/themes/Corporate.js +2 -2
- package/cjs/Theme/themes/EndUser.js +2 -2
- package/cjs/Theme/themes/Gyms.js +2 -2
- package/cjs/Theme/themes/Wellness.js +2 -2
- package/cjs/Theme/themes/index.js +6 -6
- package/cjs/index.js +51 -51
- package/cjs/index.native.js +1 -1
- package/cjs/shared/HiddenInput.js +11 -3
- package/cjs/shared/index.js +8 -8
- package/cjs/shared/index.native.js +1 -1
- package/cjs/shared/propTypes/index.js +8 -8
- package/esm/AutoComplete/AutoComplete.theme.js +2 -2
- package/esm/AutoComplete/web/AutoComplete.js +58 -12
- package/esm/Button/web/Button.js +2 -4
- package/esm/Button/web/Link.js +10 -2
- package/esm/Button/web/Outline.js +10 -2
- package/esm/Button/web/StyledButton.js +10 -2
- package/esm/Button/web/Text.js +10 -2
- package/esm/Card/web/Card/Actions.js +10 -2
- package/esm/Card/web/Card/Card.js +23 -7
- package/esm/Card/web/Card/Content.js +10 -2
- package/esm/Card/web/Card/Header.js +10 -2
- package/esm/Card/web/EventCard/EventCard.js +80 -14
- package/esm/Card/web/PlanCard/Actions.js +10 -2
- package/esm/Card/web/PlanCard/Content.js +34 -8
- package/esm/Card/web/PlanCard/PlanCard.js +11 -3
- package/esm/Checkbox/web/Checkbox.js +81 -15
- package/esm/Checkbox/web/Switch.js +97 -11
- package/esm/Dropdown/web/Dropdown.js +80 -15
- package/esm/Grid/web/Col.js +33 -5
- package/esm/Grid/web/Container.js +64 -6
- package/esm/Grid/web/Hide.js +10 -2
- package/esm/Grid/web/Row.js +32 -4
- package/esm/Grid/web/hideQuery.js +164 -16
- package/esm/Grid/web/query.js +10 -2
- package/esm/Grid/web/query.test.js +21 -3
- package/esm/Input/web/Email.js +1 -1
- package/esm/Input/web/Field.js +42 -4
- package/esm/Input/web/Fieldset.js +10 -2
- package/esm/Input/web/Helper.js +21 -3
- package/esm/Input/web/Input.js +28 -11
- package/esm/Input/web/Label.js +24 -8
- package/esm/Input/web/Legend.js +24 -8
- package/esm/Input/web/Number.js +1 -1
- package/esm/Input/web/Password.js +36 -10
- package/esm/Input/web/Tel.js +1 -1
- package/esm/Input/web/Wrapper.js +10 -2
- package/esm/List/web/LinkItem.js +11 -3
- package/esm/List/web/List.js +13 -7
- package/esm/List/web/ListItem.js +11 -3
- package/esm/Progress/web/Progress.js +35 -9
- package/esm/RadioGroup/RadioGroupContext.js +1 -1
- package/esm/RadioGroup/web/Button/RadioButton.js +25 -10
- package/esm/RadioGroup/web/Radio/Radio.js +38 -12
- package/esm/RadioGroup/web/RadioGroup.js +15 -9
- package/esm/Rating/web/Rating.js +14 -8
- package/esm/Slider/web/Marker.js +13 -7
- package/esm/Slider/web/Slider.js +28 -14
- package/esm/Slider/web/Tooltip.js +68 -12
- package/esm/Stepper/web/Dots.js +76 -8
- package/esm/Stepper/web/Line.js +21 -3
- package/esm/Stepper/web/Step.js +10 -2
- package/esm/Stepper/web/Stepper.js +34 -8
- package/esm/Tag/web/Tag.js +13 -7
- package/esm/Text/textStyle.js +10 -2
- package/esm/Text/web/Text.js +10 -2
- package/esm/TextArea/web/TextArea.js +37 -11
- package/esm/Theme/Provider/Provider.js +2 -4
- package/esm/Theme/Provider/web/GlobalStyle.js +10 -2
- package/esm/Theme/Provider/web/ThemeProvider.js +1 -3
- package/esm/Theme/helpers/themeReader/base.test.js +1 -1
- package/esm/Theme/helpers/themeReader/index.js +1 -1
- package/esm/Theme/themes/BaseTheme.js +3 -3
- package/esm/Theme/themes/Corporate.js +2 -2
- package/esm/Theme/themes/EndUser.js +2 -2
- package/esm/Theme/themes/Gyms.js +2 -2
- package/esm/Theme/themes/Wellness.js +2 -2
- package/esm/shared/HiddenInput.js +10 -2
- package/package.json +5 -2
|
@@ -17,23 +17,89 @@ var _yogaIcons = require("@gympass/yoga-icons");
|
|
|
17
17
|
|
|
18
18
|
var _shared = require("../../shared");
|
|
19
19
|
|
|
20
|
-
var _excluded = ["value", "label", "helper", "disabled", "checked", "error", "style", "className", "variant"];
|
|
21
|
-
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
23
|
-
|
|
24
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
21
|
|
|
26
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
27
23
|
|
|
28
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
25
|
|
|
30
26
|
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; }
|
|
31
27
|
|
|
28
|
+
function _templateObject7() {
|
|
29
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
30
|
+
|
|
31
|
+
_templateObject7 = function _templateObject7() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _templateObject6() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n width: 100%;\n\n ", "\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject6 = function _templateObject6() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject5() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n\n ", "\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject5 = function _templateObject5() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject4() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n position: absolute;\n display: none;\n\n ", "\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject4 = function _templateObject4() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject3() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n cursor: pointer;\n\n ", "\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject3 = function _templateObject3() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _templateObject2() {
|
|
79
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n\n border-style: solid;\n\n ", "\n"]);
|
|
80
|
+
|
|
81
|
+
_templateObject2 = function _templateObject2() {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _templateObject() {
|
|
89
|
+
var data = _taggedTemplateLiteral(["\n display: inline-block;\n\n * {\n box-sizing: border-box;\n }\n"]);
|
|
90
|
+
|
|
91
|
+
_templateObject = function _templateObject() {
|
|
92
|
+
return data;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
|
|
32
98
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
99
|
|
|
34
|
-
var CheckboxWrapper = _styledComponents["default"].div(_templateObject
|
|
100
|
+
var CheckboxWrapper = _styledComponents["default"].div(_templateObject());
|
|
35
101
|
|
|
36
|
-
var CheckMark = _styledComponents["default"].div(_templateObject2
|
|
102
|
+
var CheckMark = _styledComponents["default"].div(_templateObject2(), function (_ref) {
|
|
37
103
|
var checked = _ref.checked,
|
|
38
104
|
disabled = _ref.disabled,
|
|
39
105
|
error = _ref.error,
|
|
@@ -47,17 +113,17 @@ var CheckMark = _styledComponents["default"].div(_templateObject2 || (_templateO
|
|
|
47
113
|
return "\n width: ".concat(checkbox.size, "px;\n height: ").concat(checkbox.size, "px;\n\n margin-right: ").concat(checkbox.margin.right, "px;\n\n border-radius: ").concat(checkbox.border.radius, "px;\n border-width: ").concat(checkbox.border.width, "px;\n border-color: ").concat(disabled ? checkbox.disabled.border.color : color[3], ";\n\n ").concat(checked ? "\n background-color: ".concat(color[3], "; \n\n svg {\n position: absolute;\n top: 50%;\n left: 50%;\n \n fill: ").concat(checkbox.checked.icon.color, ";\n\n transform: translate(-50%, -50%);\n }\n ") : '', "\n\n ").concat(disabled && checked ? "background-color: ".concat(checkbox.disabled.backgroundColor, ";") : '', "\n\n ").concat(error ? "border-color: ".concat(negative[1], ";") : '', "\n\n ").concat(error && checked ? "background-color: ".concat(negative[1], ";") : '', "\n ");
|
|
48
114
|
});
|
|
49
115
|
|
|
50
|
-
var Label = _styledComponents["default"].label(_templateObject3
|
|
116
|
+
var Label = _styledComponents["default"].label(_templateObject3(), function (_ref2) {
|
|
51
117
|
var checkbox = _ref2.theme.yoga.components.checkbox;
|
|
52
118
|
return "\n font-size: ".concat(checkbox.label.font.size, "px;\n color: ").concat(checkbox.label.font.color, ";\n ");
|
|
53
119
|
});
|
|
54
120
|
|
|
55
|
-
var Shadow = _styledComponents["default"].span(_templateObject4
|
|
121
|
+
var Shadow = _styledComponents["default"].span(_templateObject4(), function (_ref3) {
|
|
56
122
|
var checkbox = _ref3.theme.yoga.components.checkbox;
|
|
57
123
|
return "\n width: ".concat(checkbox.size, "px;\n height: ").concat(checkbox.size, "px;\n border-radius: ").concat(checkbox.hover.border.radius, "px;\n ");
|
|
58
124
|
});
|
|
59
125
|
|
|
60
|
-
var CheckboxStyled = _styledComponents["default"].div(_templateObject5
|
|
126
|
+
var CheckboxStyled = _styledComponents["default"].div(_templateObject5(), function (_ref4) {
|
|
61
127
|
var variant = _ref4.variant,
|
|
62
128
|
_ref4$theme$yoga = _ref4.theme.yoga,
|
|
63
129
|
_ref4$theme$yoga$colo = _ref4$theme$yoga.colors[variant],
|
|
@@ -67,12 +133,12 @@ var CheckboxStyled = _styledComponents["default"].div(_templateObject5 || (_temp
|
|
|
67
133
|
return "\n ".concat(Label, ":active,\n &:focus-within,\n &:hover {\n ").concat(Shadow, " {\n display: block;\n }\n }\n\n ").concat(Label, ":active {\n ").concat(Shadow, " {\n background-color: ").concat((0, _yogaCommon.hexToRgb)(color[1], 0.75), ";\n\n box-shadow: 0 0 0 ").concat(shadowSize, "px ").concat((0, _yogaCommon.hexToRgb)(color[1], 0.75), ";\n }\n }\n\n &:focus-within, &:hover {\n ").concat(Shadow, " {\n background-color: ").concat((0, _yogaCommon.hexToRgb)(color[1], 0.5), ";\n \n box-shadow: 0 0 0 ").concat(shadowSize, "px ").concat((0, _yogaCommon.hexToRgb)(color[1], 0.5), ";\n }\n }\n ");
|
|
68
134
|
});
|
|
69
135
|
|
|
70
|
-
var HelperWrapper = _styledComponents["default"].div(_templateObject6
|
|
136
|
+
var HelperWrapper = _styledComponents["default"].div(_templateObject6(), function (_ref5) {
|
|
71
137
|
var checkbox = _ref5.theme.yoga.components.checkbox;
|
|
72
138
|
return "\n margin-top: ".concat(checkbox.helper.margin.top, "px;\n ");
|
|
73
139
|
});
|
|
74
140
|
|
|
75
|
-
var Helper = _styledComponents["default"].span(_templateObject7
|
|
141
|
+
var Helper = _styledComponents["default"].span(_templateObject7(), function (_ref6) {
|
|
76
142
|
var error = _ref6.error,
|
|
77
143
|
_ref6$theme$yoga = _ref6.theme.yoga,
|
|
78
144
|
negative = _ref6$theme$yoga.colors.negative,
|
|
@@ -94,7 +160,7 @@ var Checkbox = function Checkbox(_ref7) {
|
|
|
94
160
|
style = _ref7.style,
|
|
95
161
|
className = _ref7.className,
|
|
96
162
|
variant = _ref7.variant,
|
|
97
|
-
rest = _objectWithoutProperties(_ref7,
|
|
163
|
+
rest = _objectWithoutProperties(_ref7, ["value", "label", "helper", "disabled", "checked", "error", "style", "className", "variant"]);
|
|
98
164
|
|
|
99
165
|
return /*#__PURE__*/_react["default"].createElement(CheckboxWrapper, {
|
|
100
166
|
style: style,
|
|
@@ -106,7 +172,7 @@ var Checkbox = function Checkbox(_ref7) {
|
|
|
106
172
|
checked: checked,
|
|
107
173
|
error: error,
|
|
108
174
|
variant: variant
|
|
109
|
-
}, checked && /*#__PURE__*/_react["default"].createElement(_yogaIcons.
|
|
175
|
+
}, checked && /*#__PURE__*/_react["default"].createElement(_yogaIcons.Check, null)), /*#__PURE__*/_react["default"].createElement(_shared.HiddenInput, _extends({
|
|
110
176
|
type: "checkbox",
|
|
111
177
|
checked: checked,
|
|
112
178
|
disabled: disabled
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -13,40 +13,126 @@ var _propTypes = require("prop-types");
|
|
|
13
13
|
|
|
14
14
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
19
|
|
|
24
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
21
|
|
|
26
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
27
23
|
|
|
28
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
25
|
|
|
30
26
|
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; }
|
|
31
27
|
|
|
28
|
+
function _templateObject9() {
|
|
29
|
+
var data = _taggedTemplateLiteral(["\n ", ":focus + &,\n ", ":hover + & {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n "]);
|
|
30
|
+
|
|
31
|
+
_templateObject9 = function _templateObject9() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _templateObject8() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n cursor: not-allowed;\n "]);
|
|
40
|
+
|
|
41
|
+
_templateObject8 = function _templateObject8() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject7() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n left: calc(100% - ", "px);\n transform: translateX(-100%);\n "]);
|
|
50
|
+
|
|
51
|
+
_templateObject7 = function _templateObject7() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject6() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n left: ", "px;\n\n width: ", "px;\n height: ", "px;\n\n background-color: ", ";\n border-radius: ", "px;\n\n transition-property: left, transform;\n transition-duration: 300ms;\n transition-timing-function: ease;\n\n ", "\n ", "\n "]);
|
|
60
|
+
|
|
61
|
+
_templateObject6 = function _templateObject6() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject5() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n\n pointer-events: none;\n\n ", ";\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject5 = function _templateObject5() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _templateObject4() {
|
|
79
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n cursor: not-allowed;\n "]);
|
|
80
|
+
|
|
81
|
+
_templateObject4 = function _templateObject4() {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _templateObject3() {
|
|
89
|
+
var data = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n\n background-color: ", ";\n\n border-radius: ", "px;\n\n transition-property: background-color;\n transition-duration: 300ms;\n\n ", "\n "]);
|
|
90
|
+
|
|
91
|
+
_templateObject3 = function _templateObject3() {
|
|
92
|
+
return data;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function _templateObject2() {
|
|
99
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n cursor: pointer;\n\n * {\n box-sizing: border-box;\n }\n\n ", ";\n"]);
|
|
100
|
+
|
|
101
|
+
_templateObject2 = function _templateObject2() {
|
|
102
|
+
return data;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _templateObject() {
|
|
109
|
+
var data = _taggedTemplateLiteral(["\n position: absolute;\n\n width: 100%;\n height: 100%;\n\n opacity: 0;\n\n cursor: inherit;\n"]);
|
|
110
|
+
|
|
111
|
+
_templateObject = function _templateObject() {
|
|
112
|
+
return data;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return data;
|
|
116
|
+
}
|
|
117
|
+
|
|
32
118
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
119
|
|
|
34
|
-
var SwitchInput = _styledComponents["default"].input(_templateObject
|
|
120
|
+
var SwitchInput = _styledComponents["default"].input(_templateObject());
|
|
35
121
|
|
|
36
|
-
var SwitchTrack = _styledComponents["default"].label(_templateObject2
|
|
122
|
+
var SwitchTrack = _styledComponents["default"].label(_templateObject2(), function (_ref) {
|
|
37
123
|
var checkboxswitch = _ref.theme.yoga.components.checkboxswitch,
|
|
38
124
|
checked = _ref.checked,
|
|
39
125
|
disabled = _ref.disabled;
|
|
40
|
-
return (0, _styledComponents.css)(_templateObject3
|
|
126
|
+
return (0, _styledComponents.css)(_templateObject3(), checkboxswitch.track.width, checkboxswitch.track.height, checked ? checkboxswitch.track.checked.backgroundColor : checkboxswitch.track.backgroundColor, checkboxswitch.track.radii, disabled ? (0, _styledComponents.css)(_templateObject4(), checkboxswitch.track.disabled.backgroundColor) : '');
|
|
41
127
|
});
|
|
42
128
|
|
|
43
|
-
var SwitchThumb = _styledComponents["default"].span(_templateObject5
|
|
129
|
+
var SwitchThumb = _styledComponents["default"].span(_templateObject5(), function (_ref2) {
|
|
44
130
|
var _ref2$theme$yoga = _ref2.theme.yoga,
|
|
45
131
|
checkboxswitch = _ref2$theme$yoga.components.checkboxswitch,
|
|
46
132
|
spacing = _ref2$theme$yoga.spacing,
|
|
47
133
|
checked = _ref2.checked,
|
|
48
134
|
disabled = _ref2.disabled;
|
|
49
|
-
return (0, _styledComponents.css)(_templateObject6
|
|
135
|
+
return (0, _styledComponents.css)(_templateObject6(), checkboxswitch.thumb.left, checkboxswitch.thumb.width, checkboxswitch.thumb.height, checkboxswitch.thumb.backgroundColor, checkboxswitch.thumb.radii, checked ? (0, _styledComponents.css)(_templateObject7(), checkboxswitch.thumb.left) : '', disabled ? (0, _styledComponents.css)(_templateObject8(), checkboxswitch.thumb.disabled.backgroundColor) : (0, _styledComponents.css)(_templateObject9(), SwitchInput, SwitchInput, spacing.xsmall, checked ? checkboxswitch.focus.checked.backgroundColor : checkboxswitch.focus.disabled.backgroundColor));
|
|
50
136
|
});
|
|
51
137
|
/** Switches allow users to turn an individual option on or off. They are usually used to activate or deactivate a specific setting. */
|
|
52
138
|
|
|
@@ -55,7 +141,7 @@ var CheckboxSwitch = function CheckboxSwitch(_ref3) {
|
|
|
55
141
|
var checked = _ref3.checked,
|
|
56
142
|
disabled = _ref3.disabled,
|
|
57
143
|
onChange = _ref3.onChange,
|
|
58
|
-
rest = _objectWithoutProperties(_ref3,
|
|
144
|
+
rest = _objectWithoutProperties(_ref3, ["checked", "disabled", "onChange"]);
|
|
59
145
|
|
|
60
146
|
return /*#__PURE__*/_react["default"].createElement(SwitchTrack, _extends({
|
|
61
147
|
checked: checked,
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "Switch", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _Switch["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _Checkbox["default"];
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _styledComponents=_interopRequireWildcard(require("styled-components"));var _propTypes=require("prop-types");var _reactNative=require("react-native");var _yoga=require("@gympass/yoga");function _templateObject4(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject4=function _templateObject4(){return data;};return data;}function _templateObject3(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject3=function _templateObject3(){return data;};return data;}function _templateObject2(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n position: absolute;\n justify-content: flex-end;\n\n width: 100%;\n"]);_templateObject2=function _templateObject2(){return data;};return data;}function _templateObject(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject=function _templateObject(){return data;};return data;}var ClosableArea=(0,_styledComponents["default"])(_reactNative.Animated.View)(_templateObject(),function(_ref){var colors=_ref.theme.yoga.colors;return"\n position: relative;\n width: 100%;\n height: 100%;\n\n background-color: "+colors.dark+";\n ";});var ContentWrapper=(0,_styledComponents["default"])(_reactNative.Animated.View)(_templateObject2());var Content=_styledComponents["default"].View(_templateObject3(),function(_ref2){var dropdown=_ref2.theme.yoga.components.dropdown;return"\n justify-content: center;\n width: 100%;\n\n background-color: "+dropdown.backdrop.content.backgroundColor+";\n border-top-left-radius: "+dropdown.backdrop.content.border.radius.topLeft+"px;\n border-top-right-radius: "+dropdown.backdrop.content.border.radius.topRight+"px;\n ";});var Title=(0,_styledComponents["default"])(_yoga.Text.H4)(_templateObject4(),function(_ref3){var dropdown=_ref3.theme.yoga.components.dropdown;return"\n width: 100%;\n padding: \n "+dropdown.backdrop.content.title.padding.top+"px \n "+dropdown.backdrop.content.title.padding.right+"px \n "+dropdown.backdrop.content.title.padding.bottom+"px \n "+dropdown.backdrop.content.title.padding.left+"px;\n\n text-align: center;\n ";});var Backdrop=function Backdrop(_ref4){var visible=_ref4.visible,title=_ref4.title,children=_ref4.children,onClose=_ref4.onClose,_ref4$theme$yoga=_ref4.theme.yoga,transition=_ref4$theme$yoga.transition,dropdown=_ref4$theme$yoga.components.dropdown,props=(0,_objectWithoutProperties2["default"])(_ref4,["visible","title","children","onClose","theme"]);var _useState=(0,_react.useState)(visible),_useState2=(0,_slicedToArray2["default"])(_useState,2),isOpen=_useState2[0],toggleIsOpen=_useState2[1];var _useState3=(0,_react.useState)(new _reactNative.Animated.Value(0)),_useState4=(0,_slicedToArray2["default"])(_useState3,1),backgroundAnimation=_useState4[0];var _useState5=(0,_react.useState)(new _reactNative.Animated.Value(-dropdown.backdrop.content.height)),_useState6=(0,_slicedToArray2["default"])(_useState5,1),contentAnimation=_useState6[0];var animate=function animate(animation,toValue){return _reactNative.Animated.timing(animation,{toValue:toValue,duration:transition.duration[0],easing:_reactNative.Easing.out(_reactNative.Easing.ease)}).start(function(){return!visible&&toggleIsOpen(false);});};(0,_react.useEffect)(function(){if(visible)toggleIsOpen(true);animate(backgroundAnimation,visible?0.5:0);animate(contentAnimation,visible?0:-dropdown.backdrop.content.height);},[visible]);return isOpen&&_react["default"].createElement(_reactNative.Modal,(0,_extends2["default"])({},props,{transparent:true,animationType:"none"}),_react["default"].createElement(_reactNative.TouchableWithoutFeedback,{onPress:onClose},_react["default"].createElement(ClosableArea,{style:{opacity:backgroundAnimation}})),_react["default"].createElement(ContentWrapper,{style:{bottom:contentAnimation}},_react["default"].createElement(Content,null,title&&_react["default"].createElement(Title,null,title),children)));};Backdrop.propTypes={visible:_propTypes.bool,title:_propTypes.string,children:_propTypes.node.isRequired,onClose:_propTypes.func};Backdrop.defaultProps={visible:false,title:null,onClose:function onClose(){}};var _default=(0,_styledComponents.withTheme)(Backdrop);exports["default"]=_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _styledComponents=_interopRequireWildcard(require("styled-components"));var _propTypes=require("prop-types");var _reactNative=require("react-native");var _yogaIcons=require("@gympass/yoga-icons");var _Options=_interopRequireDefault(require("./Options"));var _Backdrop=_interopRequireDefault(require("./Backdrop"));function _templateObject2(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject2=function _templateObject2(){return data;};return data;}function _templateObject(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject=function _templateObject(){return data;};return data;}var Selector=_styledComponents["default"].View(_templateObject(),function(_ref){var disabled=_ref.disabled,selected=_ref.selected,full=_ref.full,dropdown=_ref.theme.yoga.components.dropdown;return"\n position: relative;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n\n width: "+(full?'100%':dropdown.width+"px")+";\n padding: "+dropdown.selector.padding.top+"px \n "+dropdown.selector.padding.right+"px \n "+dropdown.selector.padding.bottom+"px\n "+dropdown.selector.padding.left+"px;\n\n background-color: "+dropdown.selector.background+";\n border-radius: "+dropdown.selector.border.radius+"px;\n border-width: "+dropdown.selector.border.width+"px;\n border-style: solid;\n border-color: "+dropdown.selector.border.color+";\n\n "+(disabled?"border-color: "+dropdown.disabled.selector.border.color+";":'')+";\n "+(selected?"border-color: "+dropdown.selected.selector.border.color+";":'')+";\n ";});var Label=_styledComponents["default"].Text(_templateObject2(),function(_ref2){var disabled=_ref2.disabled,selected=_ref2.selected,dropdown=_ref2.theme.yoga.components.dropdown;return"\n color: "+dropdown.input.font.color+";\n "+(disabled?"color: "+dropdown.disabled.input.font.color+";":'')+"\n "+(selected?"color: "+dropdown.selected.input.font.color+";":'')+"\n ";});var getSelectedOption=function getSelectedOption(options){return options.find(function(item){return item.selected===true;});};var Dropdown=function Dropdown(_ref3){var label=_ref3.label,disabled=_ref3.disabled,full=_ref3.full,options=_ref3.options,cancelActionLabel=_ref3.cancelActionLabel,confirmActionLabel=_ref3.confirmActionLabel,onChange=_ref3.onChange,dropdown=_ref3.theme.yoga.components.dropdown,rest=(0,_objectWithoutProperties2["default"])(_ref3,["label","disabled","full","options","cancelActionLabel","confirmActionLabel","onChange","theme"]);var _useState=(0,_react.useState)(getSelectedOption(options)),_useState2=(0,_slicedToArray2["default"])(_useState,2),selected=_useState2[0],toggleIsSelected=_useState2[1];var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2["default"])(_useState3,2),isOpen=_useState4[0],toggleIsOpen=_useState4[1];var iconColor=function iconColor(){if(disabled)return dropdown.disabled.arrow.fill;if(selected)return dropdown.selected.arrow.fill;return dropdown.arrow.fill;};return _react["default"].createElement(_react["default"].Fragment,null,_react["default"].createElement(_reactNative.TouchableWithoutFeedback,{accessibilityRole:"button",onPress:function onPress(){return!disabled&&toggleIsOpen(true);}},_react["default"].createElement(Selector,(0,_extends2["default"])({full:full,disabled:disabled,selected:selected},rest),_react["default"].createElement(Label,{disabled:disabled,selected:selected},selected&&selected.label||label),_react["default"].createElement(_yogaIcons.ArrowDown,{fill:iconColor()}))),_react["default"].createElement(_Backdrop["default"],{visible:isOpen,title:label,onClose:function onClose(){return toggleIsOpen(false);}},_react["default"].createElement(_Options["default"],{options:options,selectedOption:selected,cancelActionLabel:cancelActionLabel,confirmActionLabel:confirmActionLabel,onClose:function onClose(){return toggleIsOpen(false);},onSelect:function onSelect(item){toggleIsSelected(item);onChange(item);toggleIsOpen(false);}})));};Dropdown.propTypes={label:_propTypes.string,disabled:_propTypes.bool,full:_propTypes.bool,options:(0,_propTypes.arrayOf)((0,_propTypes.shape)({label:_propTypes.string,value:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.number]),selected:_propTypes.bool})).isRequired,cancelActionLabel:_propTypes.string,confirmActionLabel:_propTypes.string,onChange:_propTypes.func};Dropdown.defaultProps={label:'',full:false,cancelActionLabel:'Cancel',confirmActionLabel:'Confirm',disabled:false,onChange:function onChange(){}};var _default=(0,_styledComponents.withTheme)(Dropdown);exports["default"]=_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireDefault(require("react"));var _styledComponents=_interopRequireDefault(require("styled-components"));var _propTypes=require("prop-types");var _reactNative=require("react-native");var _yoga=require("@gympass/yoga");
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireDefault(require("react"));var _styledComponents=_interopRequireDefault(require("styled-components"));var _propTypes=require("prop-types");var _reactNative=require("react-native");var _yoga=require("@gympass/yoga");function _templateObject(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject=function _templateObject(){return data;};return data;}var Option=(0,_styledComponents["default"])(_yoga.List.Item)(_templateObject(),function(_ref){var isSelected=_ref.isSelected,_ref$theme$yoga=_ref.theme.yoga,baseFont=_ref$theme$yoga.baseFont,dropdown=_ref$theme$yoga.components.dropdown;return"\n padding:\n "+dropdown.backdrop.content.option.padding.top+"px \n "+dropdown.backdrop.content.option.padding.right+"px \n "+dropdown.backdrop.content.option.padding.bottom+"px \n "+dropdown.backdrop.content.option.padding.left+"px;\n\n border-bottom-width: "+dropdown.option.border.width+"px;\n background-color: "+(isSelected?""+dropdown.hover.option.backgroundColor:'transparent')+"; \n \n font-family: "+baseFont.family+";\n font-size: "+dropdown.option.font.size+"px;\n line-height: "+dropdown.option.font.lineHeight+"px;\n font-weight: "+(isSelected?""+dropdown.selected.option.font.weight:""+dropdown.option.font.weight)+"; \n color: "+(isSelected?""+dropdown.selected.option.font.color:""+dropdown.option.font.color)+";\n ";});var Options=function Options(_ref2){var options=_ref2.options,selectedOption=_ref2.selectedOption,onSelect=_ref2.onSelect;return _react["default"].createElement(_reactNative.ScrollView,{contentContainerStyle:{width:'100%',height:60*3.6}},_react["default"].createElement(_yoga.List,{data:options.map(function(item){return item;}),keyExtractor:function keyExtractor(_,index){return index.toString();},renderItem:function renderItem(_ref3){var item=_ref3.item;return _react["default"].createElement(_reactNative.TouchableWithoutFeedback,{onPress:function onPress(){return onSelect(item);}},_react["default"].createElement(Option,{key:item.value,isSelected:selectedOption&&selectedOption.value===item.value},_react["default"].createElement(_yoga.Text,null,item.label)));}}));};var optionShape={label:_propTypes.string,value:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.number])};Options.propTypes={options:(0,_propTypes.arrayOf)((0,_propTypes.shape)(optionShape)).isRequired,selectedOption:(0,_propTypes.shape)(optionShape),onSelect:_propTypes.func};Options.defaultProps={selectedOption:null,onSelect:function onSelect(){}};var _default=Options;exports["default"]=_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _taggedTemplateLiteralLoose2=_interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _react=_interopRequireWildcard(require("react"));var _styledComponents=_interopRequireDefault(require("styled-components"));var _propTypes=require("prop-types");var _picker=require("@react-native-picker/picker");var _yoga=require("@gympass/yoga");function _templateObject2(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n ","\n"]);_templateObject2=function _templateObject2(){return data;};return data;}function _templateObject(){var data=(0,_taggedTemplateLiteralLoose2["default"])(["\n width: 100%;\n height: 190px;\n"]);_templateObject=function _templateObject(){return data;};return data;}var PickerStyled=(0,_styledComponents["default"])(_picker.Picker)(_templateObject());var PickerActions=_styledComponents["default"].View(_templateObject2(),function(_ref){var dropdown=_ref.theme.yoga.components.dropdown;return"\n flex-direction: row;\n justify-content: space-between;\n\n padding:\n "+dropdown.backdrop.content.actions.padding.top+"px\n "+dropdown.backdrop.content.actions.padding.right+"px\n "+dropdown.backdrop.content.actions.padding.bottom+"px\n "+dropdown.backdrop.content.actions.padding.left+"px;\n ";});var Options=function Options(_ref2){var options=_ref2.options,selectedOption=_ref2.selectedOption,cancelActionLabel=_ref2.cancelActionLabel,confirmActionLabel=_ref2.confirmActionLabel,onSelect=_ref2.onSelect,onClose=_ref2.onClose;var _useState=(0,_react.useState)(selectedOption),_useState2=(0,_slicedToArray2["default"])(_useState,2),selected=_useState2[0],setSelected=_useState2[1];return _react["default"].createElement(_react["default"].Fragment,null,_react["default"].createElement(PickerStyled,{selectedValue:selected&&selected.value,onValueChange:function onValueChange(itemValue){return setSelected(options.find(function(option){return option.value===itemValue;}));}},options.map(function(item){return _react["default"].createElement(_picker.Picker.Item,(0,_extends2["default"])({key:item},item));})),_react["default"].createElement(PickerActions,null,_react["default"].createElement(_yoga.Button.Link,{onPress:onClose},cancelActionLabel),_react["default"].createElement(_yoga.Button.Link,{onPress:function onPress(){return onSelect(selected);}},confirmActionLabel)));};var optionShape={label:_propTypes.string,value:(0,_propTypes.oneOfType)([_propTypes.string,_propTypes.number])};Options.propTypes={options:(0,_propTypes.arrayOf)((0,_propTypes.shape)(optionShape)).isRequired,selectedOption:(0,_propTypes.shape)(optionShape),cancelActionLabel:_propTypes.string.isRequired,confirmActionLabel:_propTypes.string.isRequired,onSelect:_propTypes.func,onClose:_propTypes.func};Options.defaultProps={selectedOption:null,onSelect:function onSelect(){},onClose:function onClose(){}};var _default=Options;exports["default"]=_default;
|
|
@@ -15,28 +15,93 @@ var _propTypes = require("prop-types");
|
|
|
15
15
|
|
|
16
16
|
var _yogaIcons = require("@gympass/yoga-icons");
|
|
17
17
|
|
|
18
|
-
var _excluded = ["isOpen", "disabled", "selected"],
|
|
19
|
-
_excluded2 = ["label", "disabled", "full", "options", "onChange"];
|
|
20
|
-
|
|
21
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
22
|
-
|
|
23
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24
19
|
|
|
25
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
26
21
|
|
|
27
22
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
23
|
|
|
29
24
|
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; }
|
|
30
25
|
|
|
26
|
+
function _templateObject7() {
|
|
27
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
28
|
+
|
|
29
|
+
_templateObject7 = function _templateObject7() {
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function _templateObject6() {
|
|
37
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
38
|
+
|
|
39
|
+
_templateObject6 = function _templateObject6() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _templateObject5() {
|
|
47
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
48
|
+
|
|
49
|
+
_templateObject5 = function _templateObject5() {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _templateObject4() {
|
|
57
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
58
|
+
|
|
59
|
+
_templateObject4 = function _templateObject4() {
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _templateObject3() {
|
|
67
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
68
|
+
|
|
69
|
+
_templateObject3 = function _templateObject3() {
|
|
70
|
+
return data;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _templateObject2() {
|
|
77
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
78
|
+
|
|
79
|
+
_templateObject2 = function _templateObject2() {
|
|
80
|
+
return data;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return data;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _templateObject() {
|
|
87
|
+
var data = _taggedTemplateLiteral(["\n ", "\n"]);
|
|
88
|
+
|
|
89
|
+
_templateObject = function _templateObject() {
|
|
90
|
+
return data;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
|
|
31
96
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
97
|
|
|
33
|
-
var Wrapper = _styledComponents["default"].div(_templateObject
|
|
98
|
+
var Wrapper = _styledComponents["default"].div(_templateObject(), function (_ref) {
|
|
34
99
|
var full = _ref.full,
|
|
35
100
|
dropdown = _ref.theme.yoga.components.dropdown;
|
|
36
101
|
return "\n position: relative;\n display: inline-block;\n vertical-align: top;\n\n width: ".concat(full ? '100%' : "".concat(dropdown.width, "px"), ";\n ");
|
|
37
102
|
});
|
|
38
103
|
|
|
39
|
-
var Selector = _styledComponents["default"].div(_templateObject2
|
|
104
|
+
var Selector = _styledComponents["default"].div(_templateObject2(), function (_ref2) {
|
|
40
105
|
var disabled = _ref2.disabled,
|
|
41
106
|
selected = _ref2.selected,
|
|
42
107
|
isOpen = _ref2.isOpen,
|
|
@@ -44,7 +109,7 @@ var Selector = _styledComponents["default"].div(_templateObject2 || (_templateOb
|
|
|
44
109
|
return "\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n\n width: 100%;\n padding: ".concat(dropdown.selector.padding.top, "px \n ").concat(dropdown.selector.padding.right, "px\n ").concat(dropdown.selector.padding.bottom, "px\n ").concat(dropdown.selector.padding.left, "px;\n\n background-color: ").concat(dropdown.selector.background, ";\n border-radius: ").concat(dropdown.selector.border.radius, "px;\n border-width: ").concat(dropdown.selector.border.width, "px;\n border-style: solid;\n border-color: ").concat(dropdown.selector.border.color, ";\n\n &:hover{\n ").concat(!disabled ? "border-color: ".concat(dropdown.hover.selector.border.color, ";") : '', ";\n }\n ").concat(disabled ? "border-color: ".concat(dropdown.disabled.selector.border.color, ";") : '', ";\n ").concat(selected ? "border-color: ".concat(dropdown.selected.selector.border.color, ";") : '', ";\n ").concat(isOpen && !disabled ? "border-color: ".concat(dropdown.hover.selector.border.color, ";") : '', "\n ");
|
|
45
110
|
});
|
|
46
111
|
|
|
47
|
-
var Input = _styledComponents["default"].input(_templateObject3
|
|
112
|
+
var Input = _styledComponents["default"].input(_templateObject3(), function (_ref3) {
|
|
48
113
|
var disabled = _ref3.disabled,
|
|
49
114
|
selected = _ref3.selected,
|
|
50
115
|
_ref3$theme$yoga = _ref3.theme.yoga,
|
|
@@ -53,19 +118,19 @@ var Input = _styledComponents["default"].input(_templateObject3 || (_templateObj
|
|
|
53
118
|
return "\n width: 100%;\n padding: 0;\n\n background-color: transparent;\n border: none;\n\n font-family: ".concat(baseFont.family, ";\n font-size: ").concat(dropdown.input.font.size, "px;\n line-height: ").concat(dropdown.input.font.lineHeight, "px;\n cursor: ").concat(disabled ? 'not-allowed' : 'pointer', ";\n\n &, &::placeholder {\n color: ").concat(dropdown.input.font.color, ";\n ").concat(selected ? "color: ".concat(dropdown.selected.input.font.color, ";") : '', "\n ").concat(disabled ? "color: ".concat(dropdown.disabled.input.font.color, ";") : '', "\n }\n ");
|
|
54
119
|
});
|
|
55
120
|
|
|
56
|
-
var Button = _styledComponents["default"].button(_templateObject4
|
|
121
|
+
var Button = _styledComponents["default"].button(_templateObject4(), function (_ref4) {
|
|
57
122
|
var disabled = _ref4.disabled,
|
|
58
123
|
dropdown = _ref4.theme.yoga.components.dropdown;
|
|
59
124
|
return "\n display: flex;\n align-content: center;\n align-items: center;\n justify-content: flex-end;\n position: absolute;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n padding-right: ".concat(dropdown.button.padding.right, "px;\n\n border: none;\n outline: none;\n background-color: transparent;\n cursor: ").concat(disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
60
125
|
});
|
|
61
126
|
|
|
62
|
-
var OptionsList = _styledComponents["default"].ul(_templateObject5
|
|
127
|
+
var OptionsList = _styledComponents["default"].ul(_templateObject5(), function (_ref5) {
|
|
63
128
|
var selected = _ref5.selected,
|
|
64
129
|
dropdown = _ref5.theme.yoga.components.dropdown;
|
|
65
130
|
return "\n position: absolute;\n top: 46px;\n z-index: 1;\n box-sizing: border-box;\n\n width: 100%;\n max-height: ".concat(dropdown.option.height * 3.5, "px;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style-type: none;\n\n background: ").concat(dropdown.optionsList.backgroundColor, ";\n border-width: ").concat(dropdown.optionsList.border.width, "px;\n border-style: solid;\n border-color: ").concat(dropdown.optionsList.border.color, ";\n border-top: none;\n\n ").concat(selected ? "border-color: ".concat(dropdown.selected.optionsList.border.color, ";") : '', ";\n\n border-radius: \n ").concat(dropdown.option.border.radius.topLeft, "px \n ").concat(dropdown.option.border.radius.topRight, "px \n ").concat(dropdown.option.border.radius.bottomRight, "px \n ").concat(dropdown.option.border.radius.bottomLeft, "px;\n ");
|
|
66
131
|
});
|
|
67
132
|
|
|
68
|
-
var Option = _styledComponents["default"].li(_templateObject6
|
|
133
|
+
var Option = _styledComponents["default"].li(_templateObject6(), function (_ref6) {
|
|
69
134
|
var isSelected = _ref6.isSelected,
|
|
70
135
|
highlighted = _ref6.highlighted,
|
|
71
136
|
_ref6$theme$yoga = _ref6.theme.yoga,
|
|
@@ -78,10 +143,10 @@ var ArrowIcon = (0, _styledComponents["default"])(function (_ref7) {
|
|
|
78
143
|
var isOpen = _ref7.isOpen,
|
|
79
144
|
disabled = _ref7.disabled,
|
|
80
145
|
selected = _ref7.selected,
|
|
81
|
-
props = _objectWithoutProperties(_ref7,
|
|
146
|
+
props = _objectWithoutProperties(_ref7, ["isOpen", "disabled", "selected"]);
|
|
82
147
|
|
|
83
148
|
return /*#__PURE__*/_react["default"].createElement(_yogaIcons.ArrowDown, props);
|
|
84
|
-
})(_templateObject7
|
|
149
|
+
})(_templateObject7(), function (_ref8) {
|
|
85
150
|
var isOpen = _ref8.isOpen,
|
|
86
151
|
disabled = _ref8.disabled,
|
|
87
152
|
selected = _ref8.selected,
|
|
@@ -103,7 +168,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
103
168
|
full = _ref9.full,
|
|
104
169
|
options = _ref9.options,
|
|
105
170
|
onChange = _ref9.onChange,
|
|
106
|
-
rest = _objectWithoutProperties(_ref9,
|
|
171
|
+
rest = _objectWithoutProperties(_ref9, ["label", "disabled", "full", "options", "onChange"]);
|
|
107
172
|
|
|
108
173
|
return /*#__PURE__*/_react["default"].createElement(_downshift["default"], {
|
|
109
174
|
initialSelectedItem: getSelectedOption(options),
|