@dhis2-ui/chip 9.4.0-alpha.1 → 9.4.0
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/chip.js +8 -8
- package/build/es/chip.js +7 -8
- package/package.json +2 -2
package/build/cjs/chip.js
CHANGED
|
@@ -23,7 +23,11 @@ var _remove = require("./remove.js");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
+
const DEFAULT_INLINE_MARGIN = '4';
|
|
27
|
+
|
|
26
28
|
const Chip = _ref => {
|
|
29
|
+
var _ref2, _ref3, _ref4, _ref5;
|
|
30
|
+
|
|
27
31
|
let {
|
|
28
32
|
selected,
|
|
29
33
|
dense,
|
|
@@ -50,7 +54,7 @@ const Chip = _ref => {
|
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
"data-test": dataTest,
|
|
53
|
-
className: _style.default.dynamic([["3780556490", [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]], ["
|
|
57
|
+
className: _style.default.dynamic([["3780556490", [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]], ["1687525377", [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), (_ref2 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_INLINE_MARGIN, (_ref3 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_INLINE_MARGIN, marginTop && "margin-top: ".concat(marginTop, "px")]]]) + " " + ((0, _classnames.default)(className, {
|
|
54
58
|
selected,
|
|
55
59
|
dense,
|
|
56
60
|
disabled,
|
|
@@ -68,19 +72,15 @@ const Chip = _ref => {
|
|
|
68
72
|
id: "3780556490",
|
|
69
73
|
dynamic: [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]
|
|
70
74
|
}, ["span.__jsx-style-dynamic-selector{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;height:32px;border-radius:16px;background-color:".concat(_uiConstants.colors.grey200, ";font-size:14px;line-height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:").concat(_uiConstants.colors.grey900, ";}"), ".dense.__jsx-style-dynamic-selector{height:24px;font-size:13px;line-height:15px;}", "span.__jsx-style-dynamic-selector:hover{background-color:".concat(_uiConstants.colors.grey300, ";}"), ".selected.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.theme.secondary600, ";font-weight:500;}"), ".selected.__jsx-style-dynamic-selector:hover{background-color:#00695c;}", ".selected.__jsx-style-dynamic-selector,.selected.__jsx-style-dynamic-selector .icon.__jsx-style-dynamic-selector,.selected.__jsx-style-dynamic-selector .remove-icon.__jsx-style-dynamic-selector{color:".concat(_uiConstants.colors.white, ";}"), ".disabled.__jsx-style-dynamic-selector{cursor:not-allowed;opacity:0.3;}", ".disabled.__jsx-style-dynamic-selector .remove-icon.__jsx-style-dynamic-selector{pointer-events:none;}", ".dragging.__jsx-style-dynamic-selector{box-shadow:0 3px 1px -2px rgba(0,0,0,0.2), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);}"]), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
71
|
-
id: "
|
|
72
|
-
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"),
|
|
73
|
-
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), "
|
|
75
|
+
id: "1687525377",
|
|
76
|
+
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), (_ref2 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_INLINE_MARGIN, (_ref3 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_INLINE_MARGIN, marginTop && "margin-top: ".concat(marginTop, "px")]
|
|
77
|
+
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " margin-inline-start:").concat((_ref4 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref4 !== void 0 ? _ref4 : DEFAULT_INLINE_MARGIN, "px;margin-inline-end:").concat((_ref5 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_INLINE_MARGIN, "px;").concat(marginTop && "margin-top: ".concat(marginTop, "px"), ";}")]));
|
|
74
78
|
};
|
|
75
79
|
|
|
76
80
|
exports.Chip = Chip;
|
|
77
81
|
Chip.defaultProps = {
|
|
78
82
|
dataTest: 'dhis2-uicore-chip',
|
|
79
83
|
marginBottom: 4,
|
|
80
|
-
marginLeft: 4,
|
|
81
|
-
marginRight: 4,
|
|
82
|
-
marginInlineStart: 4,
|
|
83
|
-
marginInlineEnd: 4,
|
|
84
84
|
marginTop: 4
|
|
85
85
|
};
|
|
86
86
|
Chip.propTypes = {
|
package/build/es/chip.js
CHANGED
|
@@ -6,8 +6,11 @@ import React from 'react';
|
|
|
6
6
|
import { Content } from './content.js';
|
|
7
7
|
import { Icon } from './icon.js';
|
|
8
8
|
import { Remove } from './remove.js';
|
|
9
|
+
const DEFAULT_INLINE_MARGIN = '4';
|
|
9
10
|
|
|
10
11
|
const Chip = _ref => {
|
|
12
|
+
var _ref2, _ref3, _ref4, _ref5;
|
|
13
|
+
|
|
11
14
|
let {
|
|
12
15
|
selected,
|
|
13
16
|
dense,
|
|
@@ -34,7 +37,7 @@ const Chip = _ref => {
|
|
|
34
37
|
}
|
|
35
38
|
},
|
|
36
39
|
"data-test": dataTest,
|
|
37
|
-
className: _JSXStyle.dynamic([["3780556490", [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]], ["
|
|
40
|
+
className: _JSXStyle.dynamic([["3780556490", [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]], ["1687525377", [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), (_ref2 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_INLINE_MARGIN, (_ref3 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_INLINE_MARGIN, marginTop && "margin-top: ".concat(marginTop, "px")]]]) + " " + (cx(className, {
|
|
38
41
|
selected,
|
|
39
42
|
dense,
|
|
40
43
|
disabled,
|
|
@@ -52,18 +55,14 @@ const Chip = _ref => {
|
|
|
52
55
|
id: "3780556490",
|
|
53
56
|
dynamic: [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]
|
|
54
57
|
}, ["span.__jsx-style-dynamic-selector{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;height:32px;border-radius:16px;background-color:".concat(colors.grey200, ";font-size:14px;line-height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:").concat(colors.grey900, ";}"), ".dense.__jsx-style-dynamic-selector{height:24px;font-size:13px;line-height:15px;}", "span.__jsx-style-dynamic-selector:hover{background-color:".concat(colors.grey300, ";}"), ".selected.__jsx-style-dynamic-selector{background-color:".concat(theme.secondary600, ";font-weight:500;}"), ".selected.__jsx-style-dynamic-selector:hover{background-color:#00695c;}", ".selected.__jsx-style-dynamic-selector,.selected.__jsx-style-dynamic-selector .icon.__jsx-style-dynamic-selector,.selected.__jsx-style-dynamic-selector .remove-icon.__jsx-style-dynamic-selector{color:".concat(colors.white, ";}"), ".disabled.__jsx-style-dynamic-selector{cursor:not-allowed;opacity:0.3;}", ".disabled.__jsx-style-dynamic-selector .remove-icon.__jsx-style-dynamic-selector{pointer-events:none;}", ".dragging.__jsx-style-dynamic-selector{box-shadow:0 3px 1px -2px rgba(0,0,0,0.2), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);}"]), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
55
|
-
id: "
|
|
56
|
-
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"),
|
|
57
|
-
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), "
|
|
58
|
+
id: "1687525377",
|
|
59
|
+
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), (_ref2 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_INLINE_MARGIN, (_ref3 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_INLINE_MARGIN, marginTop && "margin-top: ".concat(marginTop, "px")]
|
|
60
|
+
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " margin-inline-start:").concat((_ref4 = marginInlineStart !== null && marginInlineStart !== void 0 ? marginInlineStart : marginLeft) !== null && _ref4 !== void 0 ? _ref4 : DEFAULT_INLINE_MARGIN, "px;margin-inline-end:").concat((_ref5 = marginInlineEnd !== null && marginInlineEnd !== void 0 ? marginInlineEnd : marginRight) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_INLINE_MARGIN, "px;").concat(marginTop && "margin-top: ".concat(marginTop, "px"), ";}")]));
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
Chip.defaultProps = {
|
|
61
64
|
dataTest: 'dhis2-uicore-chip',
|
|
62
65
|
marginBottom: 4,
|
|
63
|
-
marginLeft: 4,
|
|
64
|
-
marginRight: 4,
|
|
65
|
-
marginInlineStart: 4,
|
|
66
|
-
marginInlineEnd: 4,
|
|
67
66
|
marginTop: 4
|
|
68
67
|
};
|
|
69
68
|
Chip.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/chip",
|
|
3
|
-
"version": "9.4.0
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "UI Chip",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2/ui-constants": "9.4.0
|
|
36
|
+
"@dhis2/ui-constants": "9.4.0",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2"
|
|
39
39
|
},
|