@dhis2-ui/tag 8.2.0 → 8.2.3
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/features/accepts_max_width/index.js +2 -1
- package/build/cjs/tag-icon.js +12 -9
- package/build/cjs/tag-text.js +12 -9
- package/build/cjs/tag.js +27 -24
- package/build/cjs/tag.stories.js +3 -14
- package/build/es/features/accepts_max_width/index.js +2 -1
- package/build/es/tag-icon.js +12 -9
- package/build/es/tag-text.js +12 -9
- package/build/es/tag.js +27 -24
- package/build/es/tag.stories.js +2 -13
- package/package.json +2 -2
|
@@ -13,7 +13,8 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
13
13
|
cy.get('[data-test="dhis2-uicore-tag"]').should('be.visible');
|
|
14
14
|
});
|
|
15
15
|
(0, _steps.Then)('the width of the tag should be exactly the max width', () => {
|
|
16
|
-
cy.all(() => cy.get('@maxWidth'), () => cy.get('[data-test="dhis2-uicore-tag"]')).then(
|
|
16
|
+
cy.all(() => cy.get('@maxWidth'), () => cy.get('[data-test="dhis2-uicore-tag"]')).then(_ref => {
|
|
17
|
+
let [maxWidth, tag] = _ref;
|
|
17
18
|
expect(tag).to.have.css('width', maxWidth);
|
|
18
19
|
});
|
|
19
20
|
});
|
package/build/cjs/tag-icon.js
CHANGED
|
@@ -13,15 +13,18 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const TagIcon =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
16
|
+
const TagIcon = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
dataTest
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
"data-test": dataTest,
|
|
23
|
+
className: "jsx-1699986925"
|
|
24
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
25
|
+
id: "1699986925"
|
|
26
|
+
}, [".jsx-1699986925{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-right:4px;max-height:16px;max-width:16px;}"]));
|
|
27
|
+
};
|
|
25
28
|
|
|
26
29
|
exports.TagIcon = TagIcon;
|
|
27
30
|
TagIcon.propTypes = {
|
package/build/cjs/tag-text.js
CHANGED
|
@@ -13,15 +13,18 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const TagText =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
16
|
+
const TagText = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
dataTest
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
22
|
+
"data-test": dataTest,
|
|
23
|
+
className: "jsx-1110058759"
|
|
24
|
+
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
25
|
+
id: "1110058759"
|
|
26
|
+
}, [".jsx-1110058759{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"]));
|
|
27
|
+
};
|
|
25
28
|
|
|
26
29
|
exports.TagText = TagText;
|
|
27
30
|
TagText.propTypes = {
|
package/build/cjs/tag.js
CHANGED
|
@@ -23,32 +23,35 @@ var _tagText = require("./tag-text.js");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
const Tag =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
negative,
|
|
30
|
-
positive,
|
|
31
|
-
icon,
|
|
32
|
-
bold,
|
|
33
|
-
className,
|
|
34
|
-
dataTest,
|
|
35
|
-
children
|
|
36
|
-
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
"data-test": dataTest,
|
|
38
|
-
className: _style.default.dynamic([["2409336266", [_uiConstants.colors.grey300, _uiConstants.colors.grey700, _uiConstants.colors.grey900, maxWidth, _uiConstants.colors.red100, _uiConstants.colors.red800, _uiConstants.colors.red900, _uiConstants.colors.blue100, _uiConstants.colors.blue800, _uiConstants.colors.blue900, _uiConstants.colors.green100, _uiConstants.colors.green800, _uiConstants.colors.green900, _uiConstants.colors.grey700, _uiConstants.colors.white, _uiConstants.colors.white, _uiConstants.colors.blue800, _uiConstants.colors.blue050, _uiConstants.colors.white, _uiConstants.colors.green700, _uiConstants.colors.green050, _uiConstants.colors.white, _uiConstants.colors.red700, _uiConstants.colors.red050, _uiConstants.colors.white]]]) + " " + ((0, _classnames.default)(className, {
|
|
26
|
+
const Tag = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
maxWidth,
|
|
39
29
|
neutral,
|
|
40
|
-
positive,
|
|
41
30
|
negative,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
31
|
+
positive,
|
|
32
|
+
icon,
|
|
33
|
+
bold,
|
|
34
|
+
className,
|
|
35
|
+
dataTest,
|
|
36
|
+
children
|
|
37
|
+
} = _ref;
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
"data-test": dataTest,
|
|
40
|
+
className: _style.default.dynamic([["2409336266", [_uiConstants.colors.grey300, _uiConstants.colors.grey700, _uiConstants.colors.grey900, maxWidth, _uiConstants.colors.red100, _uiConstants.colors.red800, _uiConstants.colors.red900, _uiConstants.colors.blue100, _uiConstants.colors.blue800, _uiConstants.colors.blue900, _uiConstants.colors.green100, _uiConstants.colors.green800, _uiConstants.colors.green900, _uiConstants.colors.grey700, _uiConstants.colors.white, _uiConstants.colors.white, _uiConstants.colors.blue800, _uiConstants.colors.blue050, _uiConstants.colors.white, _uiConstants.colors.green700, _uiConstants.colors.green050, _uiConstants.colors.white, _uiConstants.colors.red700, _uiConstants.colors.red050, _uiConstants.colors.white]]]) + " " + ((0, _classnames.default)(className, {
|
|
41
|
+
neutral,
|
|
42
|
+
positive,
|
|
43
|
+
negative,
|
|
44
|
+
bold
|
|
45
|
+
}) || "")
|
|
46
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_tagIcon.TagIcon, {
|
|
47
|
+
dataTest: "".concat(dataTest, "-icon")
|
|
48
|
+
}, icon), /*#__PURE__*/_react.default.createElement(_tagText.TagText, {
|
|
49
|
+
dataTest: "".concat(dataTest, "-text")
|
|
50
|
+
}, children), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
51
|
+
id: "2409336266",
|
|
52
|
+
dynamic: [_uiConstants.colors.grey300, _uiConstants.colors.grey700, _uiConstants.colors.grey900, maxWidth, _uiConstants.colors.red100, _uiConstants.colors.red800, _uiConstants.colors.red900, _uiConstants.colors.blue100, _uiConstants.colors.blue800, _uiConstants.colors.blue900, _uiConstants.colors.green100, _uiConstants.colors.green800, _uiConstants.colors.green900, _uiConstants.colors.grey700, _uiConstants.colors.white, _uiConstants.colors.white, _uiConstants.colors.blue800, _uiConstants.colors.blue050, _uiConstants.colors.white, _uiConstants.colors.green700, _uiConstants.colors.green050, _uiConstants.colors.white, _uiConstants.colors.red700, _uiConstants.colors.red050, _uiConstants.colors.white]
|
|
53
|
+
}, ["div.__jsx-style-dynamic-selector{padding:5px 6px;border-radius:3px;background-color:".concat(_uiConstants.colors.grey300, ";fill:").concat(_uiConstants.colors.grey700, ";color:").concat(_uiConstants.colors.grey900, ";max-width:").concat(maxWidth, ";display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;height:23px;}"), ".negative.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.red100, ";fill:").concat(_uiConstants.colors.red800, ";color:").concat(_uiConstants.colors.red900, ";}"), ".neutral.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.blue100, ";fill:").concat(_uiConstants.colors.blue800, ";color:").concat(_uiConstants.colors.blue900, ";}"), ".positive.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.green100, ";fill:").concat(_uiConstants.colors.green800, ";color:").concat(_uiConstants.colors.green900, ";}"), ".bold.__jsx-style-dynamic-selector{font-weight:700;background-color:".concat(_uiConstants.colors.grey700, ";color:").concat(_uiConstants.colors.white, ";fill:").concat(_uiConstants.colors.white, ";}"), ".bold.neutral.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.blue800, ";color:").concat(_uiConstants.colors.blue050, ";fill:").concat(_uiConstants.colors.white, ";}"), ".bold.positive.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.green700, ";color:").concat(_uiConstants.colors.green050, ";fill:").concat(_uiConstants.colors.white, ";}"), ".bold.negative.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.red700, ";color:").concat(_uiConstants.colors.red050, ";fill:").concat(_uiConstants.colors.white, ";}")]));
|
|
54
|
+
};
|
|
52
55
|
|
|
53
56
|
exports.Tag = Tag;
|
|
54
57
|
const tagVariantPropType = (0, _propTypes.mutuallyExclusive)(['neutral', 'positive', 'negative'], _propTypes2.default.bool);
|
package/build/cjs/tag.stories.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = exports.WithLargeIcon = exports.WithIcon = exports.WithClippedTextAndMaxWidth = exports.WithClippedLongText = exports.Positive = exports.Neutral = exports.Negative = exports.Default = exports.Bold = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -12,18 +12,7 @@ var _tag = require("./tag.js");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
14
|
const subtitle = 'Used to display categorizing labels or information for other elements in a collection.';
|
|
15
|
-
const description =
|
|
16
|
-
Tags are used whenever an element in a collection needs to display its category or status. Tags should not be used for one-off, unique information. Tags can be displayed in any kind of component.
|
|
17
|
-
|
|
18
|
-
Tags are useful when displaying multiple elements in a collection that have the same basic attributes but belong to different categories or have different statuses. Do not use tags for elements that will always be the same, instead use a heading or other grouping method.
|
|
19
|
-
|
|
20
|
-
Tags are never used for primary interaction and should not be used as buttons. Clicking a tag could sort a collection by that tag, or open a page to display all elements that have that tag type. Tags should not be used as navigation elements.
|
|
21
|
-
|
|
22
|
-
\`\`\`js
|
|
23
|
-
import { Tag } from '@dhis2/ui'
|
|
24
|
-
\`\`\`
|
|
25
|
-
|
|
26
|
-
`;
|
|
15
|
+
const description = "\nTags are used whenever an element in a collection needs to display its category or status. Tags should not be used for one-off, unique information. Tags can be displayed in any kind of component.\n\nTags are useful when displaying multiple elements in a collection that have the same basic attributes but belong to different categories or have different statuses. Do not use tags for elements that will always be the same, instead use a heading or other grouping method.\n\nTags are never used for primary interaction and should not be used as buttons. Clicking a tag could sort a collection by that tag, or open a page to display all elements that have that tag type. Tags should not be used as navigation elements.\n\n```js\nimport { Tag } from '@dhis2/ui'\n```\n\n";
|
|
27
16
|
const tagArgType = {
|
|
28
17
|
table: {
|
|
29
18
|
type: {
|
|
@@ -35,7 +24,7 @@ const tagArgType = {
|
|
|
35
24
|
}
|
|
36
25
|
};
|
|
37
26
|
var _default = {
|
|
38
|
-
title: '
|
|
27
|
+
title: 'Tag',
|
|
39
28
|
component: _tag.Tag,
|
|
40
29
|
parameters: {
|
|
41
30
|
componentSubtitle: subtitle,
|
|
@@ -10,7 +10,8 @@ Given('a tag with a max width and enough content to fill it completely is render
|
|
|
10
10
|
cy.get('[data-test="dhis2-uicore-tag"]').should('be.visible');
|
|
11
11
|
});
|
|
12
12
|
Then('the width of the tag should be exactly the max width', () => {
|
|
13
|
-
cy.all(() => cy.get('@maxWidth'), () => cy.get('[data-test="dhis2-uicore-tag"]')).then(
|
|
13
|
+
cy.all(() => cy.get('@maxWidth'), () => cy.get('[data-test="dhis2-uicore-tag"]')).then(_ref => {
|
|
14
|
+
let [maxWidth, tag] = _ref;
|
|
14
15
|
expect(tag).to.have.css('width', maxWidth);
|
|
15
16
|
});
|
|
16
17
|
});
|
package/build/es/tag-icon.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const TagIcon =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
4
|
+
export const TagIcon = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
dataTest
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
"data-test": dataTest,
|
|
11
|
+
className: "jsx-1699986925"
|
|
12
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
13
|
+
id: "1699986925"
|
|
14
|
+
}, [".jsx-1699986925{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-right:4px;max-height:16px;max-width:16px;}"]));
|
|
15
|
+
};
|
|
13
16
|
TagIcon.propTypes = {
|
|
14
17
|
dataTest: PropTypes.string.isRequired,
|
|
15
18
|
children: PropTypes.node
|
package/build/es/tag-text.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export const TagText =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
4
|
+
export const TagText = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
dataTest
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10
|
+
"data-test": dataTest,
|
|
11
|
+
className: "jsx-1110058759"
|
|
12
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
13
|
+
id: "1110058759"
|
|
14
|
+
}, [".jsx-1110058759{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"]));
|
|
15
|
+
};
|
|
13
16
|
TagText.propTypes = {
|
|
14
17
|
dataTest: PropTypes.string.isRequired,
|
|
15
18
|
children: PropTypes.node
|
package/build/es/tag.js
CHANGED
|
@@ -6,32 +6,35 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { TagIcon } from './tag-icon.js';
|
|
8
8
|
import { TagText } from './tag-text.js';
|
|
9
|
-
export const Tag =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
negative,
|
|
13
|
-
positive,
|
|
14
|
-
icon,
|
|
15
|
-
bold,
|
|
16
|
-
className,
|
|
17
|
-
dataTest,
|
|
18
|
-
children
|
|
19
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
"data-test": dataTest,
|
|
21
|
-
className: _JSXStyle.dynamic([["2409336266", [colors.grey300, colors.grey700, colors.grey900, maxWidth, colors.red100, colors.red800, colors.red900, colors.blue100, colors.blue800, colors.blue900, colors.green100, colors.green800, colors.green900, colors.grey700, colors.white, colors.white, colors.blue800, colors.blue050, colors.white, colors.green700, colors.green050, colors.white, colors.red700, colors.red050, colors.white]]]) + " " + (cx(className, {
|
|
9
|
+
export const Tag = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
maxWidth,
|
|
22
12
|
neutral,
|
|
23
|
-
positive,
|
|
24
13
|
negative,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
positive,
|
|
15
|
+
icon,
|
|
16
|
+
bold,
|
|
17
|
+
className,
|
|
18
|
+
dataTest,
|
|
19
|
+
children
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
"data-test": dataTest,
|
|
23
|
+
className: _JSXStyle.dynamic([["2409336266", [colors.grey300, colors.grey700, colors.grey900, maxWidth, colors.red100, colors.red800, colors.red900, colors.blue100, colors.blue800, colors.blue900, colors.green100, colors.green800, colors.green900, colors.grey700, colors.white, colors.white, colors.blue800, colors.blue050, colors.white, colors.green700, colors.green050, colors.white, colors.red700, colors.red050, colors.white]]]) + " " + (cx(className, {
|
|
24
|
+
neutral,
|
|
25
|
+
positive,
|
|
26
|
+
negative,
|
|
27
|
+
bold
|
|
28
|
+
}) || "")
|
|
29
|
+
}, icon && /*#__PURE__*/React.createElement(TagIcon, {
|
|
30
|
+
dataTest: "".concat(dataTest, "-icon")
|
|
31
|
+
}, icon), /*#__PURE__*/React.createElement(TagText, {
|
|
32
|
+
dataTest: "".concat(dataTest, "-text")
|
|
33
|
+
}, children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
34
|
+
id: "2409336266",
|
|
35
|
+
dynamic: [colors.grey300, colors.grey700, colors.grey900, maxWidth, colors.red100, colors.red800, colors.red900, colors.blue100, colors.blue800, colors.blue900, colors.green100, colors.green800, colors.green900, colors.grey700, colors.white, colors.white, colors.blue800, colors.blue050, colors.white, colors.green700, colors.green050, colors.white, colors.red700, colors.red050, colors.white]
|
|
36
|
+
}, ["div.__jsx-style-dynamic-selector{padding:5px 6px;border-radius:3px;background-color:".concat(colors.grey300, ";fill:").concat(colors.grey700, ";color:").concat(colors.grey900, ";max-width:").concat(maxWidth, ";display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;height:23px;}"), ".negative.__jsx-style-dynamic-selector{background-color:".concat(colors.red100, ";fill:").concat(colors.red800, ";color:").concat(colors.red900, ";}"), ".neutral.__jsx-style-dynamic-selector{background-color:".concat(colors.blue100, ";fill:").concat(colors.blue800, ";color:").concat(colors.blue900, ";}"), ".positive.__jsx-style-dynamic-selector{background-color:".concat(colors.green100, ";fill:").concat(colors.green800, ";color:").concat(colors.green900, ";}"), ".bold.__jsx-style-dynamic-selector{font-weight:700;background-color:".concat(colors.grey700, ";color:").concat(colors.white, ";fill:").concat(colors.white, ";}"), ".bold.neutral.__jsx-style-dynamic-selector{background-color:".concat(colors.blue800, ";color:").concat(colors.blue050, ";fill:").concat(colors.white, ";}"), ".bold.positive.__jsx-style-dynamic-selector{background-color:".concat(colors.green700, ";color:").concat(colors.green050, ";fill:").concat(colors.white, ";}"), ".bold.negative.__jsx-style-dynamic-selector{background-color:".concat(colors.red700, ";color:").concat(colors.red050, ";fill:").concat(colors.white, ";}")]));
|
|
37
|
+
};
|
|
35
38
|
const tagVariantPropType = mutuallyExclusive(['neutral', 'positive', 'negative'], PropTypes.bool);
|
|
36
39
|
Tag.defaultProps = {
|
|
37
40
|
dataTest: 'dhis2-uicore-tag',
|
package/build/es/tag.stories.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tag } from './tag.js';
|
|
3
3
|
const subtitle = 'Used to display categorizing labels or information for other elements in a collection.';
|
|
4
|
-
const description =
|
|
5
|
-
Tags are used whenever an element in a collection needs to display its category or status. Tags should not be used for one-off, unique information. Tags can be displayed in any kind of component.
|
|
6
|
-
|
|
7
|
-
Tags are useful when displaying multiple elements in a collection that have the same basic attributes but belong to different categories or have different statuses. Do not use tags for elements that will always be the same, instead use a heading or other grouping method.
|
|
8
|
-
|
|
9
|
-
Tags are never used for primary interaction and should not be used as buttons. Clicking a tag could sort a collection by that tag, or open a page to display all elements that have that tag type. Tags should not be used as navigation elements.
|
|
10
|
-
|
|
11
|
-
\`\`\`js
|
|
12
|
-
import { Tag } from '@dhis2/ui'
|
|
13
|
-
\`\`\`
|
|
14
|
-
|
|
15
|
-
`;
|
|
4
|
+
const description = "\nTags are used whenever an element in a collection needs to display its category or status. Tags should not be used for one-off, unique information. Tags can be displayed in any kind of component.\n\nTags are useful when displaying multiple elements in a collection that have the same basic attributes but belong to different categories or have different statuses. Do not use tags for elements that will always be the same, instead use a heading or other grouping method.\n\nTags are never used for primary interaction and should not be used as buttons. Clicking a tag could sort a collection by that tag, or open a page to display all elements that have that tag type. Tags should not be used as navigation elements.\n\n```js\nimport { Tag } from '@dhis2/ui'\n```\n\n";
|
|
16
5
|
const tagArgType = {
|
|
17
6
|
table: {
|
|
18
7
|
type: {
|
|
@@ -24,7 +13,7 @@ const tagArgType = {
|
|
|
24
13
|
}
|
|
25
14
|
};
|
|
26
15
|
export default {
|
|
27
|
-
title: '
|
|
16
|
+
title: 'Tag',
|
|
28
17
|
component: Tag,
|
|
29
18
|
parameters: {
|
|
30
19
|
componentSubtitle: subtitle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/tag",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "UI Tag",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@dhis2/prop-types": "^3.0.0-beta.1",
|
|
35
|
-
"@dhis2/ui-constants": "8.2.
|
|
35
|
+
"@dhis2/ui-constants": "8.2.3",
|
|
36
36
|
"classnames": "^2.3.1",
|
|
37
37
|
"prop-types": "^15.7.2"
|
|
38
38
|
},
|