@hipay/hipay-material-ui 2.2.0 → 2.3.0-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/HiAlertModal/HiAlertModal.js +5 -5
  3. package/HiAppBar/HiAppBar.js +4 -4
  4. package/HiBadge/HiBadge.js +2 -2
  5. package/HiBreadcrumb/HiStep.js +1 -1
  6. package/HiBreadcrumb/HiStepConnector.js +6 -6
  7. package/HiBreadcrumb/HiStepContent.js +1 -1
  8. package/HiBreadcrumb/HiStepIcon.js +1 -1
  9. package/HiBreadcrumb/HiStepLabel.js +1 -1
  10. package/HiBreadcrumb/HiStepper.js +1 -1
  11. package/HiButton/HiButton.js +41 -92
  12. package/HiCell/CellAddress.js +2 -2
  13. package/HiCell/CellDate.js +2 -2
  14. package/HiCell/CellIcon.js +2 -2
  15. package/HiCell/CellImage.js +2 -2
  16. package/HiCell/CellNumeric.js +2 -2
  17. package/HiCell/CellPinToAction.js +2 -2
  18. package/HiCell/CellRate.js +2 -2
  19. package/HiCell/CellSentinel.js +2 -2
  20. package/HiCell/CellSentinelScore.js +2 -2
  21. package/HiCell/CellText.js +5 -5
  22. package/HiCell/CellTextStyled.js +1 -1
  23. package/HiCheckbox/HiCheckbox.js +5 -5
  24. package/HiChip/HiChip.js +3 -3
  25. package/HiChip/HiChipSwitch.js +8 -8
  26. package/HiColoredLabel/HiColoredLabel.js +3 -3
  27. package/HiDatePicker/Caption.js +2 -2
  28. package/HiDatePicker/HiDatePicker.js +2 -2
  29. package/HiDatePicker/HiDatePickerMobile.js +2 -2
  30. package/HiDatePicker/HiDateRangePicker.js +2 -2
  31. package/HiDatePicker/HiDateRangeSelector.js +5 -4
  32. package/HiDatePicker/ListPicker.js +2 -2
  33. package/HiDatePicker/NavBar.js +2 -2
  34. package/HiDatePicker/Overlays/CustomOverlayLayout.js +2 -2
  35. package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +2 -2
  36. package/HiDatePicker/Overlays/MonthPickerOverlay.js +3 -3
  37. package/HiDatePicker/Overlays/Overlay.js +2 -2
  38. package/HiDatePicker/Overlays/TimePickerOverlay.js +6 -6
  39. package/HiDatePicker/Overlays/YearPickerOverlay.js +3 -3
  40. package/HiDatePicker/stylesheet.js +1 -1
  41. package/HiDotsStepper/HiDot.js +2 -2
  42. package/HiDotsStepper/HiDotsStepper.js +6 -6
  43. package/HiExpansionPanel/HiExpansionPanel.js +36 -12
  44. package/HiForm/HiAddressField.js +7 -7
  45. package/HiForm/HiEmailField.js +3 -3
  46. package/HiForm/HiFormControl.js +8 -8
  47. package/HiForm/HiFormLabel.js +3 -3
  48. package/HiForm/HiInput.js +13 -13
  49. package/HiForm/HiPasswordField.js +9 -8
  50. package/HiForm/HiSearchField.js +5 -5
  51. package/HiForm/HiSlider.js +2 -2
  52. package/HiForm/HiTextField.js +5 -5
  53. package/HiForm/HiUpload.js +2 -2
  54. package/HiForm/HiUploadInput.js +3 -3
  55. package/HiIcon/HiIcon.js +2 -2
  56. package/HiIconButton/HiIconButton.js +2 -2
  57. package/HiLoader/HiLoader.js +2 -2
  58. package/HiMap/HiMap.js +7 -7
  59. package/HiMap/HiMapExpand.js +5 -5
  60. package/HiNotice/HiKPI.js +10 -9
  61. package/HiPaymentMeans/HiPaymentMeans.js +1 -1
  62. package/HiPdfReader/HiPdfReader.js +1 -1
  63. package/HiPin/HiPin.js +2 -2
  64. package/HiRadio/HiRadio.js +1 -1
  65. package/HiSelect/HiDynamicSelect.js +7 -7
  66. package/HiSelect/HiNestedSelect.js +14 -14
  67. package/HiSelect/HiNestedSelectContent.js +9 -9
  68. package/HiSelect/HiSelect.js +9 -9
  69. package/HiSelect/HiSelectContent.js +15 -15
  70. package/HiSelect/HiSelectInput.js +9 -9
  71. package/HiSelect/HiSelectMobile.js +2 -2
  72. package/HiSelect/HiSuggestSelect.js +1 -1
  73. package/HiSelectableList/HiSelectableList.js +2 -2
  74. package/HiSelectableList/HiSelectableListHierarchic.js +2 -2
  75. package/HiSelectableList/HiSelectableListItem.js +6 -6
  76. package/HiSwitch/HiSwitch.js +2 -2
  77. package/HiSwitch/HiSwitchState.js +2 -2
  78. package/HiTable/HiTable.js +5 -5
  79. package/HiTable/HiTableHeader.js +3 -3
  80. package/HiTable/HiTableRow.js +7 -6
  81. package/es/HiAlertModal/HiAlertModal.js +1 -1
  82. package/es/HiAppBar/HiAppBar.js +1 -1
  83. package/es/HiBadge/HiBadge.js +1 -1
  84. package/es/HiBreadcrumb/HiStep.js +1 -1
  85. package/es/HiBreadcrumb/HiStepConnector.js +3 -3
  86. package/es/HiBreadcrumb/HiStepContent.js +1 -1
  87. package/es/HiBreadcrumb/HiStepIcon.js +1 -1
  88. package/es/HiBreadcrumb/HiStepLabel.js +1 -1
  89. package/es/HiBreadcrumb/HiStepper.js +1 -1
  90. package/es/HiButton/HiButton.js +56 -82
  91. package/es/HiCell/CellAddress.js +1 -1
  92. package/es/HiCell/CellDate.js +1 -1
  93. package/es/HiCell/CellIcon.js +1 -1
  94. package/es/HiCell/CellImage.js +1 -1
  95. package/es/HiCell/CellNumeric.js +1 -1
  96. package/es/HiCell/CellPinToAction.js +1 -1
  97. package/es/HiCell/CellRate.js +1 -1
  98. package/es/HiCell/CellSentinel.js +1 -1
  99. package/es/HiCell/CellSentinelScore.js +1 -1
  100. package/es/HiCell/CellText.js +1 -1
  101. package/es/HiCell/CellTextStyled.js +1 -1
  102. package/es/HiCheckbox/HiCheckbox.js +1 -1
  103. package/es/HiChip/HiChip.js +2 -2
  104. package/es/HiChip/HiChipSwitch.js +2 -2
  105. package/es/HiColoredLabel/HiColoredLabel.js +2 -2
  106. package/es/HiDatePicker/Caption.js +1 -1
  107. package/es/HiDatePicker/HiDatePicker.js +1 -1
  108. package/es/HiDatePicker/HiDatePickerMobile.js +1 -1
  109. package/es/HiDatePicker/HiDateRangePicker.js +1 -1
  110. package/es/HiDatePicker/HiDateRangeSelector.js +4 -3
  111. package/es/HiDatePicker/ListPicker.js +1 -1
  112. package/es/HiDatePicker/NavBar.js +1 -1
  113. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +1 -1
  114. package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +1 -1
  115. package/es/HiDatePicker/Overlays/Overlay.js +1 -1
  116. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +1 -1
  117. package/es/HiDatePicker/stylesheet.js +1 -1
  118. package/es/HiDotsStepper/HiDot.js +1 -1
  119. package/es/HiDotsStepper/HiDotsStepper.js +1 -1
  120. package/es/HiExpansionPanel/HiExpansionPanel.js +34 -9
  121. package/es/HiForm/HiFormControl.js +1 -1
  122. package/es/HiForm/HiFormLabel.js +2 -2
  123. package/es/HiForm/HiInput.js +1 -1
  124. package/es/HiForm/HiPasswordField.js +5 -4
  125. package/es/HiForm/HiSlider.js +1 -1
  126. package/es/HiForm/HiUpload.js +1 -1
  127. package/es/HiForm/HiUploadInput.js +2 -2
  128. package/es/HiIcon/HiIcon.js +1 -1
  129. package/es/HiIconButton/HiIconButton.js +2 -2
  130. package/es/HiLoader/HiLoader.js +1 -1
  131. package/es/HiMap/HiMap.js +1 -1
  132. package/es/HiMap/HiMapExpand.js +1 -1
  133. package/es/HiNotice/HiKPI.js +7 -6
  134. package/es/HiPaymentMeans/HiPaymentMeans.js +1 -1
  135. package/es/HiPdfReader/HiPdfReader.js +1 -1
  136. package/es/HiPin/HiPin.js +2 -2
  137. package/es/HiRadio/HiRadio.js +1 -1
  138. package/es/HiSelect/HiNestedSelect.js +1 -1
  139. package/es/HiSelect/HiSelect.js +1 -1
  140. package/es/HiSelect/HiSelectContent.js +1 -1
  141. package/es/HiSelect/HiSelectInput.js +1 -1
  142. package/es/HiSelect/HiSelectMobile.js +1 -1
  143. package/es/HiSelect/HiSuggestSelect.js +1 -1
  144. package/es/HiSelectableList/HiSelectableList.js +1 -1
  145. package/es/HiSelectableList/HiSelectableListHierarchic.js +1 -1
  146. package/es/HiSelectableList/HiSelectableListItem.js +1 -1
  147. package/es/HiSwitch/HiSwitch.js +1 -1
  148. package/es/HiSwitch/HiSwitchState.js +1 -1
  149. package/es/HiTable/HiTable.js +1 -1
  150. package/es/HiTable/HiTableHeader.js +2 -2
  151. package/es/HiTable/HiTableRow.js +3 -2
  152. package/es/hi-svg-icons/HiAccount.js +1 -1
  153. package/es/hi-svg-icons/HiActivity.js +1 -1
  154. package/es/hi-svg-icons/HiAll.js +1 -1
  155. package/es/hi-svg-icons/HiBilling.js +1 -1
  156. package/es/hi-svg-icons/HiCatalog.js +1 -1
  157. package/es/hi-svg-icons/HiCustomer.js +1 -1
  158. package/es/hi-svg-icons/HiFinance.js +1 -1
  159. package/es/hi-svg-icons/HiPermission.js +1 -1
  160. package/es/hi-svg-icons/HiRoute.js +1 -1
  161. package/es/hi-svg-icons/HiSettlement.js +1 -1
  162. package/es/hi-svg-icons/HiTransaction.js +1 -1
  163. package/es/hi-svg-icons/HiUser.js +1 -1
  164. package/es/hi-svg-icons/HiWidget.js +1 -1
  165. package/es/index.js +0 -2
  166. package/es/styles/createMixins.js +4 -4
  167. package/es/styles/spacing.js +2 -5
  168. package/es/test-utils/getClasses.js +2 -16
  169. package/es/withMobileDialog/withMobileDialog.js +1 -1
  170. package/hi-svg-icons/HiAccount.js +1 -1
  171. package/hi-svg-icons/HiActivity.js +1 -1
  172. package/hi-svg-icons/HiAll.js +1 -1
  173. package/hi-svg-icons/HiBilling.js +1 -1
  174. package/hi-svg-icons/HiCatalog.js +1 -1
  175. package/hi-svg-icons/HiCustomer.js +1 -1
  176. package/hi-svg-icons/HiFinance.js +1 -1
  177. package/hi-svg-icons/HiPermission.js +1 -1
  178. package/hi-svg-icons/HiRoute.js +1 -1
  179. package/hi-svg-icons/HiSettlement.js +1 -1
  180. package/hi-svg-icons/HiTransaction.js +1 -1
  181. package/hi-svg-icons/HiUser.js +1 -1
  182. package/hi-svg-icons/HiWidget.js +1 -1
  183. package/index.es.js +1 -3
  184. package/index.js +1 -17
  185. package/package.json +4 -5
  186. package/styles/createMixins.js +4 -4
  187. package/styles/spacing.js +5 -4
  188. package/test-utils/getClasses.js +5 -29
  189. package/withMobileDialog/withMobileDialog.js +1 -1
  190. package/es/withWidth/index.js +0 -2
  191. package/es/withWidth/withWidth.js +0 -176
  192. package/withWidth/index.js +0 -27
  193. package/withWidth/withWidth.js +0 -229
@@ -1,229 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.isWidthDown = exports.isWidthUp = void 0;
9
-
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
-
16
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
-
24
- var _react = _interopRequireDefault(require("react"));
25
-
26
- var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
- var _reactEventListener = _interopRequireDefault(require("react-event-listener"));
29
-
30
- var _debounce = _interopRequireDefault(require("debounce"));
31
-
32
- var _wrapDisplayName = _interopRequireDefault(require("recompose/wrapDisplayName"));
33
-
34
- var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
35
-
36
- var _withTheme = _interopRequireDefault(require("../styles/withTheme"));
37
-
38
- var _createBreakpoints = require("../styles/createBreakpoints");
39
-
40
- var _getThemeProps = _interopRequireDefault(require("../styles/getThemeProps"));
41
-
42
- /* eslint-disable react/no-did-mount-set-state */
43
- // < 1kb payload overhead when lodash/debounce is > 3kb.
44
- // By default, returns true if screen width is the same or greater than the given breakpoint.
45
- var isWidthUp = function isWidthUp(breakpoint, width) {
46
- var inclusive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
47
-
48
- if (inclusive) {
49
- return _createBreakpoints.keys.indexOf(breakpoint) <= _createBreakpoints.keys.indexOf(width);
50
- }
51
-
52
- return _createBreakpoints.keys.indexOf(breakpoint) < _createBreakpoints.keys.indexOf(width);
53
- }; // By default, returns true if screen width is the same or less than the given breakpoint.
54
-
55
-
56
- exports.isWidthUp = isWidthUp;
57
-
58
- var isWidthDown = function isWidthDown(breakpoint, width) {
59
- var inclusive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
60
-
61
- if (inclusive) {
62
- return _createBreakpoints.keys.indexOf(width) <= _createBreakpoints.keys.indexOf(breakpoint);
63
- }
64
-
65
- return _createBreakpoints.keys.indexOf(width) < _createBreakpoints.keys.indexOf(breakpoint);
66
- };
67
-
68
- exports.isWidthDown = isWidthDown;
69
-
70
- var withWidth = function withWidth() {
71
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
- return function (Component) {
73
- var _options$withTheme = options.withTheme,
74
- withThemeOption = _options$withTheme === void 0 ? false : _options$withTheme,
75
- _options$noSSR = options.noSSR,
76
- noSSR = _options$noSSR === void 0 ? false : _options$noSSR,
77
- initialWidthOption = options.initialWidth,
78
- _options$resizeInterv = options.resizeInterval,
79
- resizeInterval = _options$resizeInterv === void 0 ? 166 : _options$resizeInterv;
80
-
81
- var WithWidth =
82
- /*#__PURE__*/
83
- function (_React$Component) {
84
- (0, _inherits2.default)(WithWidth, _React$Component);
85
-
86
- function WithWidth(props) {
87
- var _this;
88
-
89
- (0, _classCallCheck2.default)(this, WithWidth);
90
- _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(WithWidth).call(this, props));
91
- _this.handleResize = (0, _debounce.default)(function () {
92
- var width = _this.getWidth();
93
-
94
- if (width !== _this.state.width) {
95
- _this.setState({
96
- width: width
97
- });
98
- }
99
- }, resizeInterval);
100
- _this.state = {
101
- width: undefined
102
- };
103
-
104
- if (noSSR) {
105
- _this.state.width = _this.getWidth();
106
- }
107
-
108
- return _this;
109
- }
110
-
111
- (0, _createClass2.default)(WithWidth, [{
112
- key: "componentDidMount",
113
- value: function componentDidMount() {
114
- var width = this.getWidth();
115
-
116
- if (width !== this.state.width) {
117
- this.setState({
118
- width: width
119
- });
120
- }
121
- }
122
- }, {
123
- key: "componentWillUnmount",
124
- value: function componentWillUnmount() {
125
- this.handleResize.clear();
126
- }
127
- }, {
128
- key: "getWidth",
129
- value: function getWidth() {
130
- var innerWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.innerWidth;
131
- var breakpoints = this.props.theme.breakpoints;
132
- var width = null;
133
- /**
134
- * Start with the slowest value as low end devices often have a small screen.
135
- *
136
- * innerWidth |xs sm md lg xl
137
- * |-------|-------|-------|-------|------>
138
- * width | xs | sm | md | lg | xl
139
- */
140
-
141
- var index = 1;
142
-
143
- while (width === null && index < _createBreakpoints.keys.length) {
144
- var currentWidth = _createBreakpoints.keys[index]; // @media are inclusive, so reproduce the behavior here.
145
-
146
- if (innerWidth < breakpoints.values[currentWidth]) {
147
- width = _createBreakpoints.keys[index - 1];
148
- break;
149
- }
150
-
151
- index += 1;
152
- }
153
-
154
- width = width || 'xl';
155
- return width;
156
- }
157
- }, {
158
- key: "render",
159
- value: function render() {
160
- var _this$props = this.props,
161
- initialWidth = _this$props.initialWidth,
162
- theme = _this$props.theme,
163
- width = _this$props.width,
164
- other = (0, _objectWithoutProperties2.default)(_this$props, ["initialWidth", "theme", "width"]);
165
- var props = (0, _extends2.default)({
166
- width: width || this.state.width || initialWidth || initialWidthOption || (0, _getThemeProps.default)({
167
- theme: theme,
168
- name: 'MuiWithWidth'
169
- }).initialWidth
170
- }, other);
171
- var more = {};
172
-
173
- if (withThemeOption) {
174
- more.theme = theme;
175
- } // When rendering the component on the server,
176
- // we have no idea about the client browser screen width.
177
- // In order to prevent blinks and help the reconciliation of the React tree
178
- // we are not rendering the child component.
179
- //
180
- // An alternative is to use the `initialWidth` property.
181
-
182
-
183
- if (props.width === undefined) {
184
- return null;
185
- }
186
-
187
- return _react.default.createElement(_reactEventListener.default, {
188
- target: "window",
189
- onResize: this.handleResize
190
- }, _react.default.createElement(Component, (0, _extends2.default)({}, more, props)));
191
- }
192
- }]);
193
- return WithWidth;
194
- }(_react.default.Component);
195
-
196
- WithWidth.propTypes = process.env.NODE_ENV !== "production" ? {
197
- /**
198
- * As `window.innerWidth` is unavailable on the server,
199
- * we default to rendering an empty component during the first mount.
200
- * In some situation, you might want to use an heuristic to approximate
201
- * the screen width of the client browser screen width.
202
- *
203
- * For instance, you could be using the user-agent or the client-hints.
204
- * http://caniuse.com/#search=client%20hint
205
- */
206
- initialWidth: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
207
-
208
- /**
209
- * @ignore
210
- */
211
- theme: _propTypes.default.object.isRequired,
212
-
213
- /**
214
- * Bypass the width calculation logic.
215
- */
216
- width: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl'])
217
- } : {};
218
-
219
- if (process.env.NODE_ENV !== 'production') {
220
- WithWidth.displayName = (0, _wrapDisplayName.default)(Component, 'WithWidth');
221
- }
222
-
223
- (0, _hoistNonReactStatics.default)(WithWidth, Component);
224
- return (0, _withTheme.default)()(WithWidth);
225
- };
226
- };
227
-
228
- var _default = withWidth;
229
- exports.default = _default;