@gympass/yoga 7.41.0 → 7.42.0

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.
@@ -10,12 +10,14 @@ var Heading = function Heading(_ref) {
10
10
  background: colors.white,
11
11
  padding: {
12
12
  vertical: spacing.small,
13
- horizontal: spacing.huge
13
+ horizontal: spacing.huge,
14
+ horizontalMobile: spacing.medium
14
15
  },
15
- height: 48,
16
+ height: spacing.xxxlarge,
16
17
  button: {
17
- width: 48,
18
- height: spacing.xxlarge
18
+ width: spacing.large,
19
+ height: spacing.large,
20
+ marginRight: spacing.medium
19
21
  }
20
22
  };
21
23
  };
@@ -5,6 +5,8 @@ exports["default"] = void 0;
5
5
 
6
6
  var _react = _interopRequireDefault(require("react"));
7
7
 
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+
8
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
11
 
10
12
  var _yogaIcons = require("@gympass/yoga-icons");
@@ -13,17 +15,26 @@ var _Button = _interopRequireDefault(require("../../Button"));
13
15
 
14
16
  var _excluded = ["onClick"];
15
17
 
18
+ var _templateObject;
19
+
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
21
 
18
22
  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); }
19
23
 
20
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; }
21
25
 
22
- var BackButton = function BackButton(_ref) {
23
- var onClick = _ref.onClick,
24
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
26
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
27
+
28
+ var ButtonIcon = (0, _styledComponents["default"])(_Button["default"].Icon)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
29
+ var heading = _ref.theme.yoga.components.heading;
30
+ return "\n width: " + heading.button.width + "px;\n height: " + heading.button.height + "px;\n ";
31
+ });
32
+
33
+ var BackButton = function BackButton(_ref2) {
34
+ var onClick = _ref2.onClick,
35
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
25
36
 
26
- return /*#__PURE__*/_react["default"].createElement(_Button["default"].Icon, _extends({}, props, {
37
+ return /*#__PURE__*/_react["default"].createElement(ButtonIcon, _extends({}, props, {
27
38
  icon: _yogaIcons.ArrowLeft,
28
39
  inverted: true,
29
40
  onClick: onClick
@@ -28,9 +28,9 @@ var Heading = function Heading(_ref) {
28
28
  var backButton = null;
29
29
  var title = null;
30
30
  var rightButtons = [];
31
- if (!children) throw new Error('Heading needs at least one child');
32
31
 
33
32
  var defineComponent = function defineComponent(child) {
33
+ if (!child) return;
34
34
  if (child.type.displayName === _Title["default"].displayName) title = child;
35
35
  if (child.type.displayName === _BackButton["default"].displayName) backButton = child;
36
36
  if (child.type.displayName === _RightButton["default"].displayName) rightButtons.push(child);
@@ -54,8 +54,10 @@ var Heading = function Heading(_ref) {
54
54
  };
55
55
 
56
56
  Heading.propTypes = {
57
- children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
57
+ children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node])
58
+ };
59
+ Heading.defaultProps = {
60
+ children: undefined
58
61
  };
59
- Heading.defaultProps = {};
60
62
  var _default = Heading;
61
63
  exports["default"] = _default;
@@ -5,24 +5,39 @@ exports["default"] = void 0;
5
5
 
6
6
  var _react = _interopRequireDefault(require("react"));
7
7
 
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+
8
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
11
 
10
12
  var _Button = _interopRequireDefault(require("../../Button"));
11
13
 
12
14
  var _excluded = ["onClick", "icon"];
13
15
 
16
+ var _templateObject, _templateObject2;
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
14
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
23
 
16
24
  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); }
17
25
 
18
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; }
19
27
 
20
- var RightButton = function RightButton(_ref) {
21
- var onClick = _ref.onClick,
22
- icon = _ref.icon,
23
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
28
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
29
+
30
+ var ButtonIcon = (0, _styledComponents["default"])(_Button["default"].Icon)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", ";\n"])), function (_ref) {
31
+ var heading = _ref.theme.yoga.components.heading;
32
+ return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n width: ", "px;\n height: ", "px;\n\n :not(:last-of-type) {\n margin-right: ", "px;\n }\n "])), heading.button.width, heading.button.height, heading.button.marginRight);
33
+ });
34
+
35
+ var RightButton = function RightButton(_ref2) {
36
+ var onClick = _ref2.onClick,
37
+ icon = _ref2.icon,
38
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
24
39
 
25
- return /*#__PURE__*/_react["default"].createElement(_Button["default"].Icon, _extends({}, props, {
40
+ return /*#__PURE__*/_react["default"].createElement(ButtonIcon, _extends({}, props, {
26
41
  icon: icon,
27
42
  inverted: true,
28
43
  onClick: onClick
@@ -13,7 +13,7 @@ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.s
13
13
 
14
14
  var StyledHeading = _styledComponents["default"].header(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
15
15
  var heading = _ref.theme.yoga.components.heading;
16
- return "\n background: " + heading.background + ";\n padding: " + heading.padding.vertical + "px;\n width: 100%;\n min-height: " + heading.height + "px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n @media(min-width: 769px) {\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontal + "px;\n }\n ";
16
+ return "\n background: " + heading.background + ";\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontalMobile + "px;\n width: 100%;\n min-height: " + heading.height + "px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n @media(min-width: 769px) {\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontal + "px;\n }\n ";
17
17
  });
18
18
 
19
19
  var Button = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
@@ -65,17 +65,22 @@ var TagInformative = function TagInformative(_ref2) {
65
65
  };
66
66
 
67
67
  TagInformative.propTypes = {
68
- /** style the tag following the theme (success, informative, attention) */
69
- variant: (0, _propTypes.oneOf)(['success', 'informative', 'attention']).isRequired,
68
+ /** Values: neutral, success, informative, attention */
69
+ variant: (0, _propTypes.oneOf)(['neutral', 'success', 'informative', 'attention']),
70
+
71
+ /** Icon reference from our library */
70
72
  icon: _propTypes.func,
73
+
74
+ /** The tag's content */
71
75
  children: _propTypes.node.isRequired,
72
76
 
73
- /** Can send small to use this variant */
77
+ /** The tag's size */
74
78
  small: _propTypes.bool
75
79
  };
76
80
  TagInformative.defaultProps = {
77
81
  icon: undefined,
78
- small: false
82
+ small: false,
83
+ variant: 'neutral'
79
84
  };
80
85
  TagInformative.displayName = 'Tag.Informative';
81
86
 
@@ -140,7 +140,8 @@ var theme = function theme(tokens) {
140
140
  feedback: {
141
141
  success: [tokens.colors.success, tokens.colors.hope],
142
142
  informative: [tokens.colors.neutral, tokens.colors.relax],
143
- attention: [tokens.colors.attention, tokens.colors.verve]
143
+ attention: [tokens.colors.attention, tokens.colors.verve],
144
+ neutral: [tokens.colors.light, tokens.colors.medium]
144
145
  },
145
146
  text: {
146
147
  primary: tokens.colors.stamina,
@@ -163,6 +164,9 @@ var theme = function theme(tokens) {
163
164
  var _colors$feedback$atte = colors.feedback.attention;
164
165
  colors.feedback.attention.light = _colors$feedback$atte[0];
165
166
  colors.feedback.attention.dark = _colors$feedback$atte[1];
167
+ var _colors$feedback$neut = colors.feedback.neutral;
168
+ colors.feedback.neutral.light = _colors$feedback$neut[0];
169
+ colors.feedback.neutral.dark = _colors$feedback$neut[1];
166
170
  return _extends({}, tokens, {
167
171
  colors: colors,
168
172
  baseFont: baseFont,
@@ -5,12 +5,14 @@ var Heading = function Heading(_ref) {
5
5
  background: colors.white,
6
6
  padding: {
7
7
  vertical: spacing.small,
8
- horizontal: spacing.huge
8
+ horizontal: spacing.huge,
9
+ horizontalMobile: spacing.medium
9
10
  },
10
- height: 48,
11
+ height: spacing.xxxlarge,
11
12
  button: {
12
- width: 48,
13
- height: spacing.xxlarge
13
+ width: spacing.large,
14
+ height: spacing.large,
15
+ marginRight: spacing.medium
14
16
  }
15
17
  };
16
18
  };
@@ -1,19 +1,28 @@
1
1
  var _excluded = ["onClick"];
2
2
 
3
+ var _templateObject;
4
+
3
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); }
4
6
 
5
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; }
6
8
 
9
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
10
+
7
11
  import React from 'react';
12
+ import styled from 'styled-components';
8
13
  import PropTypes from 'prop-types';
9
14
  import { ArrowLeft } from '@gympass/yoga-icons';
10
15
  import Button from '../../Button';
16
+ var ButtonIcon = styled(Button.Icon)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
17
+ var heading = _ref.theme.yoga.components.heading;
18
+ return "\n width: " + heading.button.width + "px;\n height: " + heading.button.height + "px;\n ";
19
+ });
11
20
 
12
- var BackButton = function BackButton(_ref) {
13
- var onClick = _ref.onClick,
14
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
21
+ var BackButton = function BackButton(_ref2) {
22
+ var onClick = _ref2.onClick,
23
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
15
24
 
16
- return /*#__PURE__*/React.createElement(Button.Icon, _extends({}, props, {
25
+ return /*#__PURE__*/React.createElement(ButtonIcon, _extends({}, props, {
17
26
  icon: ArrowLeft,
18
27
  inverted: true,
19
28
  onClick: onClick
@@ -11,9 +11,9 @@ var Heading = function Heading(_ref) {
11
11
  var backButton = null;
12
12
  var title = null;
13
13
  var rightButtons = [];
14
- if (!children) throw new Error('Heading needs at least one child');
15
14
 
16
15
  var defineComponent = function defineComponent(child) {
16
+ if (!child) return;
17
17
  if (child.type.displayName === Title.displayName) title = child;
18
18
  if (child.type.displayName === BackButton.displayName) backButton = child;
19
19
  if (child.type.displayName === RightButton.displayName) rightButtons.push(child);
@@ -37,7 +37,9 @@ var Heading = function Heading(_ref) {
37
37
  };
38
38
 
39
39
  Heading.propTypes = {
40
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
40
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
41
+ };
42
+ Heading.defaultProps = {
43
+ children: undefined
41
44
  };
42
- Heading.defaultProps = {};
43
45
  export default Heading;
@@ -1,19 +1,28 @@
1
1
  var _excluded = ["onClick", "icon"];
2
2
 
3
+ var _templateObject, _templateObject2;
4
+
3
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); }
4
6
 
5
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; }
6
8
 
9
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
10
+
7
11
  import React from 'react';
12
+ import styled, { css } from 'styled-components';
8
13
  import PropTypes from 'prop-types';
9
14
  import Button from '../../Button';
15
+ var ButtonIcon = styled(Button.Icon)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", ";\n"])), function (_ref) {
16
+ var heading = _ref.theme.yoga.components.heading;
17
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n width: ", "px;\n height: ", "px;\n\n :not(:last-of-type) {\n margin-right: ", "px;\n }\n "])), heading.button.width, heading.button.height, heading.button.marginRight);
18
+ });
10
19
 
11
- var RightButton = function RightButton(_ref) {
12
- var onClick = _ref.onClick,
13
- icon = _ref.icon,
14
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
+ var RightButton = function RightButton(_ref2) {
21
+ var onClick = _ref2.onClick,
22
+ icon = _ref2.icon,
23
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
15
24
 
16
- return /*#__PURE__*/React.createElement(Button.Icon, _extends({}, props, {
25
+ return /*#__PURE__*/React.createElement(ButtonIcon, _extends({}, props, {
17
26
  icon: icon,
18
27
  inverted: true,
19
28
  onClick: onClick
@@ -5,7 +5,7 @@ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.s
5
5
  import styled from 'styled-components';
6
6
  var StyledHeading = styled.header(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref) {
7
7
  var heading = _ref.theme.yoga.components.heading;
8
- return "\n background: " + heading.background + ";\n padding: " + heading.padding.vertical + "px;\n width: 100%;\n min-height: " + heading.height + "px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n @media(min-width: 769px) {\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontal + "px;\n }\n ";
8
+ return "\n background: " + heading.background + ";\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontalMobile + "px;\n width: 100%;\n min-height: " + heading.height + "px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n @media(min-width: 769px) {\n padding: " + heading.padding.vertical + "px " + heading.padding.horizontal + "px;\n }\n ";
9
9
  });
10
10
  export var Button = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
11
11
  var heading = _ref2.theme.yoga.components.heading;
@@ -48,17 +48,22 @@ var TagInformative = function TagInformative(_ref2) {
48
48
  };
49
49
 
50
50
  TagInformative.propTypes = {
51
- /** style the tag following the theme (success, informative, attention) */
52
- variant: oneOf(['success', 'informative', 'attention']).isRequired,
51
+ /** Values: neutral, success, informative, attention */
52
+ variant: oneOf(['neutral', 'success', 'informative', 'attention']),
53
+
54
+ /** Icon reference from our library */
53
55
  icon: func,
56
+
57
+ /** The tag's content */
54
58
  children: node.isRequired,
55
59
 
56
- /** Can send small to use this variant */
60
+ /** The tag's size */
57
61
  small: bool
58
62
  };
59
63
  TagInformative.defaultProps = {
60
64
  icon: undefined,
61
- small: false
65
+ small: false,
66
+ variant: 'neutral'
62
67
  };
63
68
  TagInformative.displayName = 'Tag.Informative';
64
69
  export default withTheme(TagInformative);
@@ -102,7 +102,8 @@ var theme = function theme(tokens) {
102
102
  feedback: {
103
103
  success: [tokens.colors.success, tokens.colors.hope],
104
104
  informative: [tokens.colors.neutral, tokens.colors.relax],
105
- attention: [tokens.colors.attention, tokens.colors.verve]
105
+ attention: [tokens.colors.attention, tokens.colors.verve],
106
+ neutral: [tokens.colors.light, tokens.colors.medium]
106
107
  },
107
108
  text: {
108
109
  primary: tokens.colors.stamina,
@@ -125,6 +126,9 @@ var theme = function theme(tokens) {
125
126
  var _colors$feedback$atte = colors.feedback.attention;
126
127
  colors.feedback.attention.light = _colors$feedback$atte[0];
127
128
  colors.feedback.attention.dark = _colors$feedback$atte[1];
129
+ var _colors$feedback$neut = colors.feedback.neutral;
130
+ colors.feedback.neutral.light = _colors$feedback$neut[0];
131
+ colors.feedback.neutral.dark = _colors$feedback$neut[1];
128
132
  return _extends({}, tokens, {
129
133
  colors: colors,
130
134
  baseFont: baseFont,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.41.0",
3
+ "version": "7.42.0",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "sideEffects": false,
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@gympass/yoga-common": "^1.1.1",
29
29
  "@gympass/yoga-helpers": "^1.0.3",
30
- "@gympass/yoga-icons": "^1.4.2",
30
+ "@gympass/yoga-icons": "^1.4.3",
31
31
  "@gympass/yoga-system": "^0.10.2",
32
32
  "@gympass/yoga-tokens": "^3.1.4",
33
33
  "@ptomasroos/react-native-multi-slider": "^1.0.0",
@@ -50,7 +50,7 @@
50
50
  "react": ">=16",
51
51
  "styled-components": "^4.4.0"
52
52
  },
53
- "gitHead": "f55cf489067ae134514499080def584244ad04c0",
53
+ "gitHead": "fb8a710f2a672a1a8a56095154232c33abc9f066",
54
54
  "module": "./esm",
55
55
  "private": false,
56
56
  "react-native": "./cjs/index.native.js"