@dhis2-ui/center 9.10.3 → 9.11.1-beta.1
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/build/cjs/center.js
CHANGED
|
@@ -4,22 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Center = void 0;
|
|
7
|
-
|
|
8
7
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
const Center = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const Center = exports.Center = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
23
15
|
let {
|
|
24
16
|
className,
|
|
25
17
|
dataTest,
|
|
@@ -36,7 +28,6 @@ const Center = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
36
28
|
id: "498096601"
|
|
37
29
|
}, [".center.jsx-498096601{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:space-around;-webkit-justify-content:space-around;-ms-flex-pack:space-around;justify-content:space-around;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;pointer-events:none;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".center.top.jsx-498096601{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}", ".center.bottom.jsx-498096601{-webkit-align-items:flex-end;-webkit-box-align:flex-end;-ms-flex-align:flex-end;align-items:flex-end;}", ".center-inner-content.jsx-498096601{pointer-events:all;}"]));
|
|
38
30
|
});
|
|
39
|
-
exports.Center = Center;
|
|
40
31
|
Center.displayName = 'Center';
|
|
41
32
|
Center.defaultProps = {
|
|
42
33
|
dataTest: 'dhis2-uicore-centeredcontent',
|
|
@@ -46,7 +37,6 @@ Center.propTypes = {
|
|
|
46
37
|
children: _propTypes.default.node,
|
|
47
38
|
className: _propTypes.default.string,
|
|
48
39
|
dataTest: _propTypes.default.string,
|
|
49
|
-
|
|
50
40
|
/** Vertical alignment */
|
|
51
41
|
position: _propTypes.default.oneOf(['top', 'middle', 'bottom'])
|
|
52
42
|
};
|
|
@@ -4,22 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Top = exports.Default = exports.Bottom = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _center = require("./center.js");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const description = `
|
|
11
|
+
Centers children horizontally, and by default, vertically.
|
|
12
|
+
Use the \`top\` or \`bottom\` props to change vertical alignment.
|
|
13
|
+
|
|
14
|
+
\`\`\`js
|
|
15
|
+
import { CenteredContent } from '@dhis2/ui'
|
|
16
|
+
\`\`\`
|
|
17
|
+
`;
|
|
16
18
|
const Wrapper = story => /*#__PURE__*/_react.default.createElement("div", {
|
|
17
19
|
style: {
|
|
18
20
|
height: '150px'
|
|
19
21
|
}
|
|
20
22
|
}, story());
|
|
21
|
-
|
|
22
|
-
var _default = {
|
|
23
|
+
var _default = exports.default = {
|
|
23
24
|
title: 'Center',
|
|
24
25
|
component: _center.Center,
|
|
25
26
|
decorators: [Wrapper],
|
|
@@ -31,19 +32,13 @@ var _default = {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
exports.default = _default;
|
|
35
|
-
|
|
36
35
|
const Template = args => /*#__PURE__*/_react.default.createElement(_center.Center, args, /*#__PURE__*/_react.default.createElement("span", null, "Center me"));
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
exports.Default = Default;
|
|
40
|
-
const Top = Template.bind({});
|
|
41
|
-
exports.Top = Top;
|
|
36
|
+
const Default = exports.Default = Template.bind({});
|
|
37
|
+
const Top = exports.Top = Template.bind({});
|
|
42
38
|
Top.args = {
|
|
43
39
|
position: 'top'
|
|
44
40
|
};
|
|
45
|
-
const Bottom = Template.bind({});
|
|
46
|
-
exports.Bottom = Bottom;
|
|
41
|
+
const Bottom = exports.Bottom = Template.bind({});
|
|
47
42
|
Bottom.args = {
|
|
48
43
|
position: 'bottom'
|
|
49
44
|
};
|
package/build/cjs/index.js
CHANGED
package/build/es/center.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Center } from './center.js';
|
|
3
|
-
const description =
|
|
3
|
+
const description = `
|
|
4
|
+
Centers children horizontally, and by default, vertically.
|
|
5
|
+
Use the \`top\` or \`bottom\` props to change vertical alignment.
|
|
4
6
|
|
|
7
|
+
\`\`\`js
|
|
8
|
+
import { CenteredContent } from '@dhis2/ui'
|
|
9
|
+
\`\`\`
|
|
10
|
+
`;
|
|
5
11
|
const Wrapper = story => /*#__PURE__*/React.createElement("div", {
|
|
6
12
|
style: {
|
|
7
13
|
height: '150px'
|
|
8
14
|
}
|
|
9
15
|
}, story());
|
|
10
|
-
|
|
11
16
|
export default {
|
|
12
17
|
title: 'Center',
|
|
13
18
|
component: Center,
|
|
@@ -20,9 +25,7 @@ export default {
|
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
|
-
|
|
24
28
|
const Template = args => /*#__PURE__*/React.createElement(Center, args, /*#__PURE__*/React.createElement("span", null, "Center me"));
|
|
25
|
-
|
|
26
29
|
export const Default = Template.bind({});
|
|
27
30
|
export const Top = Template.bind({});
|
|
28
31
|
Top.args = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/center",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.11.1-beta.1",
|
|
4
4
|
"description": "UI Center",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
|
-
"start": "
|
|
25
|
+
"start": "storybook dev -c ../../storybook/config --port 5000",
|
|
26
26
|
"build": "d2-app-scripts build",
|
|
27
27
|
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"react": "^16.
|
|
31
|
-
"react-dom": "^16.
|
|
30
|
+
"react": "^16.13",
|
|
31
|
+
"react-dom": "^16.13",
|
|
32
32
|
"styled-jsx": "^4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2/ui-constants": "9.
|
|
36
|
+
"@dhis2/ui-constants": "9.11.1-beta.1",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2"
|
|
39
39
|
},
|