@dhis2-ui/card 9.11.0 → 9.11.1-beta.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.
- package/build/cjs/card.e2e.stories.js +14 -0
- package/build/cjs/card.js +2 -10
- package/build/cjs/card.prod.stories.js +43 -0
- package/build/cjs/features/accepts_children/index.js +0 -1
- package/build/cjs/index.js +0 -1
- package/build/es/card.e2e.stories.js +6 -0
- package/build/es/card.js +1 -3
- package/build/es/card.prod.stories.js +35 -0
- package/package.json +5 -5
- package/build/cjs/card.stories.e2e.js +0 -11
- package/build/cjs/card.stories.js +0 -37
- package/build/es/card.stories.e2e.js +0 -4
- package/build/es/card.stories.js +0 -21
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithChildren = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _card = require("./card.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = {
|
|
11
|
+
title: 'Card'
|
|
12
|
+
};
|
|
13
|
+
const WithChildren = () => /*#__PURE__*/_react.default.createElement(_card.Card, null, /*#__PURE__*/_react.default.createElement("span", null, "I am a child"), /*#__PURE__*/_react.default.createElement("span", null, "I am a child"), /*#__PURE__*/_react.default.createElement("span", null, "I am a child"));
|
|
14
|
+
exports.WithChildren = WithChildren;
|
package/build/cjs/card.js
CHANGED
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Card = void 0;
|
|
7
|
-
|
|
8
7
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
-
|
|
10
8
|
var _uiConstants = require("@dhis2/ui-constants");
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
13
|
const Card = _ref => {
|
|
21
14
|
let {
|
|
22
15
|
className,
|
|
@@ -29,9 +22,8 @@ const Card = _ref => {
|
|
|
29
22
|
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
30
23
|
id: "3454125090",
|
|
31
24
|
dynamic: [_uiConstants.colors.white, _uiConstants.elevations.e100]
|
|
32
|
-
}, [
|
|
25
|
+
}, [`div.__jsx-style-dynamic-selector{display:inline-block;position:relative;width:100%;height:100%;border-radius:3px;background:${_uiConstants.colors.white};box-shadow:${_uiConstants.elevations.e100};}`]));
|
|
33
26
|
};
|
|
34
|
-
|
|
35
27
|
exports.Card = Card;
|
|
36
28
|
Card.defaultProps = {
|
|
37
29
|
dataTest: 'dhis2-uicore-card'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Default = void 0;
|
|
7
|
+
var _box = require("@dhis2-ui/box");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _card = require("./card.js");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const subtitle = `
|
|
12
|
+
A card is a container element for grouping together
|
|
13
|
+
and separating blocks of content.
|
|
14
|
+
`;
|
|
15
|
+
const description = `
|
|
16
|
+
Use a card where there is content that can be grouped together.
|
|
17
|
+
Cards are most often useful when this grouped content may be repeated,
|
|
18
|
+
for example with items on a dashboard, or different sections of patient
|
|
19
|
+
information displayed in a profile.
|
|
20
|
+
|
|
21
|
+
Note that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.
|
|
22
|
+
|
|
23
|
+
\`\`\`js
|
|
24
|
+
import { Card } from '@dhis2/ui'
|
|
25
|
+
\`\`\`
|
|
26
|
+
`;
|
|
27
|
+
var _default = exports.default = {
|
|
28
|
+
title: 'Card',
|
|
29
|
+
component: _card.Card,
|
|
30
|
+
parameters: {
|
|
31
|
+
componentSubtitle: subtitle,
|
|
32
|
+
docs: {
|
|
33
|
+
description: {
|
|
34
|
+
component: description
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const Default = args => /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
40
|
+
width: "358px",
|
|
41
|
+
height: "358px"
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_card.Card, args));
|
|
43
|
+
exports.Default = Default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
|
-
|
|
5
4
|
(0, _cypressCucumberPreprocessor.Given)('a Card with children is rendered', () => {
|
|
6
5
|
cy.visitStory('Card', 'With children');
|
|
7
6
|
cy.get('[data-test="dhis2-uicore-card"]').should('be.visible');
|
package/build/cjs/index.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Card } from './card.js';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Card'
|
|
5
|
+
};
|
|
6
|
+
export const WithChildren = () => /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("span", null, "I am a child"), /*#__PURE__*/React.createElement("span", null, "I am a child"), /*#__PURE__*/React.createElement("span", null, "I am a child"));
|
package/build/es/card.js
CHANGED
|
@@ -3,7 +3,6 @@ import { colors, elevations } from '@dhis2/ui-constants';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
|
|
7
6
|
const Card = _ref => {
|
|
8
7
|
let {
|
|
9
8
|
className,
|
|
@@ -16,9 +15,8 @@ const Card = _ref => {
|
|
|
16
15
|
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
17
16
|
id: "3454125090",
|
|
18
17
|
dynamic: [colors.white, elevations.e100]
|
|
19
|
-
}, [
|
|
18
|
+
}, [`div.__jsx-style-dynamic-selector{display:inline-block;position:relative;width:100%;height:100%;border-radius:3px;background:${colors.white};box-shadow:${elevations.e100};}`]));
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
Card.defaultProps = {
|
|
23
21
|
dataTest: 'dhis2-uicore-card'
|
|
24
22
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box } from '@dhis2-ui/box';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Card } from './card.js';
|
|
4
|
+
const subtitle = `
|
|
5
|
+
A card is a container element for grouping together
|
|
6
|
+
and separating blocks of content.
|
|
7
|
+
`;
|
|
8
|
+
const description = `
|
|
9
|
+
Use a card where there is content that can be grouped together.
|
|
10
|
+
Cards are most often useful when this grouped content may be repeated,
|
|
11
|
+
for example with items on a dashboard, or different sections of patient
|
|
12
|
+
information displayed in a profile.
|
|
13
|
+
|
|
14
|
+
Note that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.
|
|
15
|
+
|
|
16
|
+
\`\`\`js
|
|
17
|
+
import { Card } from '@dhis2/ui'
|
|
18
|
+
\`\`\`
|
|
19
|
+
`;
|
|
20
|
+
export default {
|
|
21
|
+
title: 'Card',
|
|
22
|
+
component: Card,
|
|
23
|
+
parameters: {
|
|
24
|
+
componentSubtitle: subtitle,
|
|
25
|
+
docs: {
|
|
26
|
+
description: {
|
|
27
|
+
component: description
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const Default = args => /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
width: "358px",
|
|
34
|
+
height: "358px"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Card, args));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/card",
|
|
3
|
-
"version": "9.11.
|
|
3
|
+
"version": "9.11.1-beta.2",
|
|
4
4
|
"description": "UI Card",
|
|
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.11.
|
|
36
|
+
"@dhis2/ui-constants": "9.11.1-beta.2",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2"
|
|
39
39
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = require("@storybook/react");
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _card = require("./card.js");
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
(0, _react.storiesOf)('Card', module).add('With children', () => /*#__PURE__*/_react2.default.createElement(_card.Card, null, /*#__PURE__*/_react2.default.createElement("span", null, "I am a child"), /*#__PURE__*/_react2.default.createElement("span", null, "I am a child"), /*#__PURE__*/_react2.default.createElement("span", null, "I am a child")));
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Default = void 0;
|
|
7
|
-
|
|
8
|
-
var _box = require("@dhis2-ui/box");
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _card = require("./card.js");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
const subtitle = "\nA card is a container element for grouping together\nand separating blocks of content.\n";
|
|
17
|
-
const description = "\nUse a card where there is content that can be grouped together.\nCards are most often useful when this grouped content may be repeated,\nfor example with items on a dashboard, or different sections of patient\ninformation displayed in a profile.\n\nNote that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.\n\n```js\nimport { Card } from '@dhis2/ui'\n```\n";
|
|
18
|
-
var _default = {
|
|
19
|
-
title: 'Card',
|
|
20
|
-
component: _card.Card,
|
|
21
|
-
parameters: {
|
|
22
|
-
componentSubtitle: subtitle,
|
|
23
|
-
docs: {
|
|
24
|
-
description: {
|
|
25
|
-
component: description
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.default = _default;
|
|
31
|
-
|
|
32
|
-
const Default = args => /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
33
|
-
width: "358px",
|
|
34
|
-
height: "358px"
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement(_card.Card, args));
|
|
36
|
-
|
|
37
|
-
exports.Default = Default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { storiesOf } from '@storybook/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Card } from './card.js';
|
|
4
|
-
storiesOf('Card', module).add('With children', () => /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("span", null, "I am a child"), /*#__PURE__*/React.createElement("span", null, "I am a child"), /*#__PURE__*/React.createElement("span", null, "I am a child")));
|
package/build/es/card.stories.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Box } from '@dhis2-ui/box';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Card } from './card.js';
|
|
4
|
-
const subtitle = "\nA card is a container element for grouping together\nand separating blocks of content.\n";
|
|
5
|
-
const description = "\nUse a card where there is content that can be grouped together.\nCards are most often useful when this grouped content may be repeated,\nfor example with items on a dashboard, or different sections of patient\ninformation displayed in a profile.\n\nNote that it requires a parent, like [Box](../?path=/docs/layout-box--default), to define its size.\n\n```js\nimport { Card } from '@dhis2/ui'\n```\n";
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Card',
|
|
8
|
-
component: Card,
|
|
9
|
-
parameters: {
|
|
10
|
-
componentSubtitle: subtitle,
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component: description
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export const Default = args => /*#__PURE__*/React.createElement(Box, {
|
|
19
|
-
width: "358px",
|
|
20
|
-
height: "358px"
|
|
21
|
-
}, /*#__PURE__*/React.createElement(Card, args));
|