@micromag/element-stack 0.2.396 → 0.2.404
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/es/index.js +14 -14
- package/lib/index.js +17 -17
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import React, { useContext, useMemo } from 'react';
|
|
1
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import React, { useContext, useMemo } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
4
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
7
|
-
import
|
|
5
|
+
import classNames from 'classnames';
|
|
8
6
|
import isNumber from 'lodash/isNumber';
|
|
7
|
+
import isString from 'lodash/isString';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
9
|
|
|
10
10
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
11
11
|
var StackContext = /*#__PURE__*/React.createContext({
|
|
@@ -28,7 +28,7 @@ var defaultProps$4 = {
|
|
|
28
28
|
direction: 'vertical'
|
|
29
29
|
}; // Note: this is done to avoid excessive renders on the screens that use the context
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
function StackProvider(_ref) {
|
|
32
32
|
var direction = _ref.direction,
|
|
33
33
|
children = _ref.children;
|
|
34
34
|
var value = useMemo(function () {
|
|
@@ -39,7 +39,7 @@ var StackProvider = function StackProvider(_ref) {
|
|
|
39
39
|
return /*#__PURE__*/React.createElement(StackContext.Provider, {
|
|
40
40
|
value: value
|
|
41
41
|
}, children);
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
StackProvider.propTypes = propTypes$4;
|
|
44
44
|
StackProvider.defaultProps = defaultProps$4;
|
|
45
45
|
|
|
@@ -58,7 +58,7 @@ var defaultProps$3 = {
|
|
|
58
58
|
className: null
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
function Spacer(_ref) {
|
|
62
62
|
var _ref2;
|
|
63
63
|
|
|
64
64
|
var size = _ref.size,
|
|
@@ -77,7 +77,7 @@ var Spacer = function Spacer(_ref) {
|
|
|
77
77
|
maxHeight: direction === 'vertical' ? maxSize : null
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
-
}
|
|
80
|
+
}
|
|
81
81
|
|
|
82
82
|
Spacer.propTypes = propTypes$3;
|
|
83
83
|
Spacer.defaultProps = defaultProps$3;
|
|
@@ -108,7 +108,7 @@ var defaultProps$2 = {
|
|
|
108
108
|
children: null
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
function Stack(_ref) {
|
|
112
112
|
var direction = _ref.direction,
|
|
113
113
|
align = _ref.align,
|
|
114
114
|
spacing = _ref.spacing,
|
|
@@ -144,7 +144,7 @@ var Stack = function Stack(_ref) {
|
|
|
144
144
|
size: space
|
|
145
145
|
})]) : [].concat(_toConsumableArray(allChildren), [child]);
|
|
146
146
|
}, [])));
|
|
147
|
-
}
|
|
147
|
+
}
|
|
148
148
|
|
|
149
149
|
Stack.propTypes = propTypes$2;
|
|
150
150
|
Stack.defaultProps = defaultProps$2;
|
|
@@ -153,11 +153,11 @@ Stack.defaultProps = defaultProps$2;
|
|
|
153
153
|
var propTypes$1 = {};
|
|
154
154
|
var defaultProps$1 = {};
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
function HStack(props) {
|
|
157
157
|
return /*#__PURE__*/React.createElement(Stack, Object.assign({}, props, {
|
|
158
158
|
direction: "horizontal"
|
|
159
159
|
}));
|
|
160
|
-
}
|
|
160
|
+
}
|
|
161
161
|
|
|
162
162
|
HStack.propTypes = propTypes$1;
|
|
163
163
|
HStack.defaultProps = defaultProps$1;
|
|
@@ -166,11 +166,11 @@ HStack.defaultProps = defaultProps$1;
|
|
|
166
166
|
var propTypes = {};
|
|
167
167
|
var defaultProps = {};
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
function VStack(props) {
|
|
170
170
|
return /*#__PURE__*/React.createElement(Stack, Object.assign({}, props, {
|
|
171
171
|
direction: "vertical"
|
|
172
172
|
}));
|
|
173
|
-
}
|
|
173
|
+
}
|
|
174
174
|
|
|
175
175
|
VStack.propTypes = propTypes;
|
|
176
176
|
VStack.defaultProps = defaultProps;
|
package/lib/index.js
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var React = require('react');
|
|
5
6
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
6
7
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var PropTypes = require('prop-types');
|
|
9
|
-
var classNames = require('classnames');
|
|
10
8
|
var core = require('@micromag/core');
|
|
11
|
-
var
|
|
9
|
+
var classNames = require('classnames');
|
|
12
10
|
var isNumber = require('lodash/isNumber');
|
|
11
|
+
var isString = require('lodash/isString');
|
|
12
|
+
var PropTypes = require('prop-types');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
17
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
17
18
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
20
19
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
21
|
-
var isString__default = /*#__PURE__*/_interopDefaultLegacy(isString);
|
|
22
20
|
var isNumber__default = /*#__PURE__*/_interopDefaultLegacy(isNumber);
|
|
21
|
+
var isString__default = /*#__PURE__*/_interopDefaultLegacy(isString);
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
|
|
24
24
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
25
25
|
var StackContext = /*#__PURE__*/React__default["default"].createContext({
|
|
@@ -42,7 +42,7 @@ var defaultProps$4 = {
|
|
|
42
42
|
direction: 'vertical'
|
|
43
43
|
}; // Note: this is done to avoid excessive renders on the screens that use the context
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
function StackProvider(_ref) {
|
|
46
46
|
var direction = _ref.direction,
|
|
47
47
|
children = _ref.children;
|
|
48
48
|
var value = React.useMemo(function () {
|
|
@@ -53,7 +53,7 @@ var StackProvider = function StackProvider(_ref) {
|
|
|
53
53
|
return /*#__PURE__*/React__default["default"].createElement(StackContext.Provider, {
|
|
54
54
|
value: value
|
|
55
55
|
}, children);
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
StackProvider.propTypes = propTypes$4;
|
|
58
58
|
StackProvider.defaultProps = defaultProps$4;
|
|
59
59
|
|
|
@@ -72,7 +72,7 @@ var defaultProps$3 = {
|
|
|
72
72
|
className: null
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
function Spacer(_ref) {
|
|
76
76
|
var _ref2;
|
|
77
77
|
|
|
78
78
|
var size = _ref.size,
|
|
@@ -91,7 +91,7 @@ var Spacer = function Spacer(_ref) {
|
|
|
91
91
|
maxHeight: direction === 'vertical' ? maxSize : null
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
95
|
|
|
96
96
|
Spacer.propTypes = propTypes$3;
|
|
97
97
|
Spacer.defaultProps = defaultProps$3;
|
|
@@ -122,7 +122,7 @@ var defaultProps$2 = {
|
|
|
122
122
|
children: null
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
function Stack(_ref) {
|
|
126
126
|
var direction = _ref.direction,
|
|
127
127
|
align = _ref.align,
|
|
128
128
|
spacing = _ref.spacing,
|
|
@@ -158,7 +158,7 @@ var Stack = function Stack(_ref) {
|
|
|
158
158
|
size: space
|
|
159
159
|
})]) : [].concat(_toConsumableArray__default["default"](allChildren), [child]);
|
|
160
160
|
}, [])));
|
|
161
|
-
}
|
|
161
|
+
}
|
|
162
162
|
|
|
163
163
|
Stack.propTypes = propTypes$2;
|
|
164
164
|
Stack.defaultProps = defaultProps$2;
|
|
@@ -167,11 +167,11 @@ Stack.defaultProps = defaultProps$2;
|
|
|
167
167
|
var propTypes$1 = {};
|
|
168
168
|
var defaultProps$1 = {};
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
function HStack(props) {
|
|
171
171
|
return /*#__PURE__*/React__default["default"].createElement(Stack, Object.assign({}, props, {
|
|
172
172
|
direction: "horizontal"
|
|
173
173
|
}));
|
|
174
|
-
}
|
|
174
|
+
}
|
|
175
175
|
|
|
176
176
|
HStack.propTypes = propTypes$1;
|
|
177
177
|
HStack.defaultProps = defaultProps$1;
|
|
@@ -180,11 +180,11 @@ HStack.defaultProps = defaultProps$1;
|
|
|
180
180
|
var propTypes = {};
|
|
181
181
|
var defaultProps = {};
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
function VStack(props) {
|
|
184
184
|
return /*#__PURE__*/React__default["default"].createElement(Stack, Object.assign({}, props, {
|
|
185
185
|
direction: "vertical"
|
|
186
186
|
}));
|
|
187
|
-
}
|
|
187
|
+
}
|
|
188
188
|
|
|
189
189
|
VStack.propTypes = propTypes;
|
|
190
190
|
VStack.defaultProps = defaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-stack",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.404",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.2.
|
|
52
|
+
"@micromag/core": "^0.2.404",
|
|
53
53
|
"change-case": "^4.1.2",
|
|
54
54
|
"classnames": "^2.2.6",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "34d5345cb0dad79206bb6b7a25f02742663023ee"
|
|
64
64
|
}
|