@gympass/yoga 7.26.1 → 7.26.2

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.
@@ -23,7 +23,7 @@ var _Icon = _interopRequireDefault(require("../../Icon"));
23
23
 
24
24
  var _Text = _interopRequireDefault(require("../../Text"));
25
25
 
26
- var _excluded = ["open", "duration", "variant", "hideIcon", "message", "actionLabel", "onAction", "onClose", "theme"];
26
+ var _excluded = ["open", "duration", "variant", "hideIcon", "message", "actionLabel", "onAction", "onClose", "hideCloseButton", "theme"];
27
27
 
28
28
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
29
29
 
@@ -61,6 +61,7 @@ var Snackbar = function Snackbar(_ref2) {
61
61
  actionLabel = _ref2.actionLabel,
62
62
  onAction = _ref2.onAction,
63
63
  onClose = _ref2.onClose,
64
+ hideCloseButton = _ref2.hideCloseButton,
64
65
  snackbar = _ref2.theme.yoga.components.snackbar,
65
66
  props = _objectWithoutPropertiesLoose(_ref2, _excluded);
66
67
 
@@ -100,14 +101,13 @@ var Snackbar = function Snackbar(_ref2) {
100
101
  onClick: onAction,
101
102
  secondary: true,
102
103
  small: true
103
- }, actionLabel), !duration && onClose && /*#__PURE__*/_react["default"].createElement(IconButtonWrapper, {
104
+ }, actionLabel), !hideCloseButton && onClose && /*#__PURE__*/_react["default"].createElement(IconButtonWrapper, {
104
105
  role: "button",
105
106
  onClick: onClose
106
107
  }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
107
108
  as: _yogaIcons.Close,
108
109
  fill: "secondary",
109
- width: "large",
110
- height: "large"
110
+ size: "medium"
111
111
  }))));
112
112
  };
113
113
 
@@ -115,7 +115,13 @@ Snackbar.propTypes = {
115
115
  /** Controls the snackbar visibility. */
116
116
  open: _propTypes.bool,
117
117
 
118
- /** A number in milliseconds to close snackbar automaticaly. The `onClose` function becomes required when passing this function. */
118
+ /** The message shown when snackbar is opened. */
119
+ message: _propTypes.string.isRequired,
120
+
121
+ /** Function to close the snackbar. */
122
+ onClose: _propTypes.func.isRequired,
123
+
124
+ /** A number in milliseconds to close snackbar automaticaly. */
119
125
  duration: _propTypes.number,
120
126
 
121
127
  /** Label for a custom action. */
@@ -124,17 +130,14 @@ Snackbar.propTypes = {
124
130
  /** Controls the snackbar icon visibility. */
125
131
  hideIcon: _propTypes.bool,
126
132
 
127
- /** The message shown when snackbar is opened. */
128
- message: _propTypes.string.isRequired,
129
-
130
133
  /** Function for the custom action. The `actionLabel` becomes required when passing this function. */
131
134
  onAction: _propTypes.func,
132
135
 
133
- /** Function to close the snackbar. */
134
- onClose: _propTypes.func,
135
-
136
136
  /** The style variant, it may be "success", "failure" or "info". */
137
- variant: (0, _propTypes.oneOf)(['success', 'failure', 'info'])
137
+ variant: (0, _propTypes.oneOf)(['success', 'failure', 'info']),
138
+
139
+ /** Hides the close button. */
140
+ hideCloseButton: _propTypes.bool
138
141
  };
139
142
  Snackbar.defaultProps = {
140
143
  open: false,
@@ -142,8 +145,8 @@ Snackbar.defaultProps = {
142
145
  actionLabel: undefined,
143
146
  hideIcon: false,
144
147
  onAction: undefined,
145
- onClose: undefined,
146
- variant: 'success'
148
+ variant: 'success',
149
+ hideCloseButton: false
147
150
  };
148
151
 
149
152
  var _default = /*#__PURE__*/(0, _react.memo)((0, _styledComponents.withTheme)(Snackbar));
@@ -1,4 +1,4 @@
1
- var _excluded = ["open", "duration", "variant", "hideIcon", "message", "actionLabel", "onAction", "onClose", "theme"];
1
+ var _excluded = ["open", "duration", "variant", "hideIcon", "message", "actionLabel", "onAction", "onClose", "hideCloseButton", "theme"];
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
4
4
 
@@ -37,6 +37,7 @@ var Snackbar = function Snackbar(_ref2) {
37
37
  actionLabel = _ref2.actionLabel,
38
38
  onAction = _ref2.onAction,
39
39
  onClose = _ref2.onClose,
40
+ hideCloseButton = _ref2.hideCloseButton,
40
41
  snackbar = _ref2.theme.yoga.components.snackbar,
41
42
  props = _objectWithoutPropertiesLoose(_ref2, _excluded);
42
43
 
@@ -76,14 +77,13 @@ var Snackbar = function Snackbar(_ref2) {
76
77
  onClick: onAction,
77
78
  secondary: true,
78
79
  small: true
79
- }, actionLabel), !duration && onClose && /*#__PURE__*/React.createElement(IconButtonWrapper, {
80
+ }, actionLabel), !hideCloseButton && onClose && /*#__PURE__*/React.createElement(IconButtonWrapper, {
80
81
  role: "button",
81
82
  onClick: onClose
82
83
  }, /*#__PURE__*/React.createElement(Icon, {
83
84
  as: Close,
84
85
  fill: "secondary",
85
- width: "large",
86
- height: "large"
86
+ size: "medium"
87
87
  }))));
88
88
  };
89
89
 
@@ -91,7 +91,13 @@ Snackbar.propTypes = {
91
91
  /** Controls the snackbar visibility. */
92
92
  open: bool,
93
93
 
94
- /** A number in milliseconds to close snackbar automaticaly. The `onClose` function becomes required when passing this function. */
94
+ /** The message shown when snackbar is opened. */
95
+ message: string.isRequired,
96
+
97
+ /** Function to close the snackbar. */
98
+ onClose: func.isRequired,
99
+
100
+ /** A number in milliseconds to close snackbar automaticaly. */
95
101
  duration: number,
96
102
 
97
103
  /** Label for a custom action. */
@@ -100,17 +106,14 @@ Snackbar.propTypes = {
100
106
  /** Controls the snackbar icon visibility. */
101
107
  hideIcon: bool,
102
108
 
103
- /** The message shown when snackbar is opened. */
104
- message: string.isRequired,
105
-
106
109
  /** Function for the custom action. The `actionLabel` becomes required when passing this function. */
107
110
  onAction: func,
108
111
 
109
- /** Function to close the snackbar. */
110
- onClose: func,
111
-
112
112
  /** The style variant, it may be "success", "failure" or "info". */
113
- variant: oneOf(['success', 'failure', 'info'])
113
+ variant: oneOf(['success', 'failure', 'info']),
114
+
115
+ /** Hides the close button. */
116
+ hideCloseButton: bool
114
117
  };
115
118
  Snackbar.defaultProps = {
116
119
  open: false,
@@ -118,7 +121,7 @@ Snackbar.defaultProps = {
118
121
  actionLabel: undefined,
119
122
  hideIcon: false,
120
123
  onAction: undefined,
121
- onClose: undefined,
122
- variant: 'success'
124
+ variant: 'success',
125
+ hideCloseButton: false
123
126
  };
124
127
  export default /*#__PURE__*/memo(withTheme(Snackbar));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.26.1",
3
+ "version": "7.26.2",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "sideEffects": false,
@@ -49,7 +49,7 @@
49
49
  "react": ">=16",
50
50
  "styled-components": "^4.4.0"
51
51
  },
52
- "gitHead": "2988e560a79a4e9259f0c236e0a3aec95b1df952",
52
+ "gitHead": "b824aa6adad559c93d8f730a58ae8e4b951fc694",
53
53
  "module": "./esm",
54
54
  "private": false,
55
55
  "react-native": "./cjs/index.native.js"