@micromag/element-layout 0.3.541 → 0.3.547

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.
Files changed (2) hide show
  1. package/package.json +5 -6
  2. package/lib/index.js +0 -81
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-layout",
3
- "version": "0.3.541",
3
+ "version": "0.3.547",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -30,11 +30,10 @@
30
30
  }
31
31
  ],
32
32
  "license": "ISC",
33
- "main": "lib/index.js",
33
+ "type": "module",
34
34
  "module": "es/index.js",
35
35
  "exports": {
36
36
  ".": {
37
- "require": "./lib/index.js",
38
37
  "import": "./es/index.js"
39
38
  },
40
39
  "./assets/css/styles": "./assets/css/styles.css",
@@ -60,8 +59,8 @@
60
59
  },
61
60
  "dependencies": {
62
61
  "@babel/runtime": "^7.13.10",
63
- "@micromag/core": "^0.3.541",
64
- "@micromag/element-stack": "^0.3.541",
62
+ "@micromag/core": "^0.3.547",
63
+ "@micromag/element-stack": "^0.3.547",
65
64
  "classnames": "^2.2.6",
66
65
  "lodash": "^4.17.21",
67
66
  "prop-types": "^15.7.2",
@@ -72,5 +71,5 @@
72
71
  "access": "public",
73
72
  "registry": "https://registry.npmjs.org/"
74
73
  },
75
- "gitHead": "6c04a7e327b5fbc096785c11320b3fbd3c5751c8"
74
+ "gitHead": "3c2f5904ce61fcfa61f673c38c2a5ec56e9e2b07"
76
75
  }
package/lib/index.js DELETED
@@ -1,81 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
7
- var React = require('react');
8
- var PropTypes = require('prop-types');
9
- var classNames = require('classnames');
10
- var elementStack = require('@micromag/element-stack');
11
-
12
- var styles = {"container":"micromag-element-layout-container","fullscreen":"micromag-element-layout-fullscreen","horizontal":"micromag-element-layout-horizontal"};
13
-
14
- var propTypes = {
15
- width: PropTypes.number,
16
- height: PropTypes.number,
17
- horizontalAlign: PropTypes.oneOf(['left', 'center', 'right']),
18
- verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
19
- distribution: PropTypes.oneOf(['between', 'around', null]),
20
- fullscreen: PropTypes.bool,
21
- className: PropTypes.string,
22
- children: PropTypes.node,
23
- style: PropTypes.object // eslint-disable-line
24
- };
25
- var defaultProps = {
26
- width: null,
27
- height: null,
28
- horizontalAlign: 'left',
29
- verticalAlign: 'top',
30
- distribution: null,
31
- fullscreen: false,
32
- className: null,
33
- children: null,
34
- style: null
35
- };
36
- var Layout = function Layout(_ref) {
37
- var width = _ref.width,
38
- height = _ref.height,
39
- horizontalAlign = _ref.horizontalAlign,
40
- verticalAlign = _ref.verticalAlign,
41
- distribution = _ref.distribution,
42
- fullscreen = _ref.fullscreen,
43
- className = _ref.className,
44
- children = _ref.children,
45
- style = _ref.style;
46
- var justifyContent = null;
47
- if (distribution !== null) {
48
- justifyContent = "space-".concat(distribution);
49
- } else if (verticalAlign === 'middle') {
50
- justifyContent = 'center';
51
- } else if (verticalAlign === 'bottom') {
52
- justifyContent = 'flex-end';
53
- }
54
- var alignItems = null;
55
- if (horizontalAlign === 'center') {
56
- alignItems = 'center';
57
- } else if (horizontalAlign === 'right') {
58
- alignItems = 'flex-end';
59
- }
60
- var finalStyle = _objectSpread({
61
- width: width,
62
- height: height,
63
- justifyContent: justifyContent,
64
- alignItems: alignItems
65
- }, style);
66
- return /*#__PURE__*/React.createElement(elementStack.StackProvider, {
67
- direction: "vertical"
68
- }, /*#__PURE__*/React.createElement("div", {
69
- className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.fullscreen, fullscreen), className, className !== null)]),
70
- style: finalStyle
71
- }, children));
72
- };
73
- Layout.propTypes = propTypes;
74
- Layout.defaultProps = defaultProps;
75
- var Layout$1 = Layout;
76
-
77
- Object.defineProperty(exports, "Spacer", {
78
- enumerable: true,
79
- get: function () { return elementStack.Spacer; }
80
- });
81
- exports.default = Layout$1;