@dhis2-ui/chip 9.3.0-alpha.1 → 9.3.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 +7 -17
- package/build/cjs/chip.stories.js +1 -9
- package/build/cjs/icon.js +3 -3
- package/build/cjs/remove.js +2 -2
- package/build/es/chip.js +7 -17
- package/build/es/chip.stories.js +0 -5
- package/build/es/icon.js +3 -3
- package/build/es/remove.js +2 -2
- package/package.json +2 -2
- package/types/index.d.ts +2 -10
package/build/cjs/chip.js
CHANGED
|
@@ -39,9 +39,7 @@ const Chip = _ref => {
|
|
|
39
39
|
marginBottom,
|
|
40
40
|
marginLeft,
|
|
41
41
|
marginRight,
|
|
42
|
-
marginTop
|
|
43
|
-
marginInlineStart,
|
|
44
|
-
marginInlineEnd
|
|
42
|
+
marginTop
|
|
45
43
|
} = _ref;
|
|
46
44
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
47
45
|
onClick: e => {
|
|
@@ -50,7 +48,7 @@ const Chip = _ref => {
|
|
|
50
48
|
}
|
|
51
49
|
},
|
|
52
50
|
"data-test": dataTest,
|
|
53
|
-
className: _style.default.dynamic([["3780556490", [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]], ["
|
|
51
|
+
className: _style.default.dynamic([["3780556490", [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]], ["2231360490", [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), marginLeft && "margin-left: ".concat(marginLeft, "px;"), marginRight && "margin-right: ".concat(marginRight, "px;"), marginTop && "margin-top: ".concat(marginTop, "px")]]]) + " " + ((0, _classnames.default)(className, {
|
|
54
52
|
selected,
|
|
55
53
|
dense,
|
|
56
54
|
disabled,
|
|
@@ -68,9 +66,9 @@ const Chip = _ref => {
|
|
|
68
66
|
id: "3780556490",
|
|
69
67
|
dynamic: [_uiConstants.colors.grey200, _uiConstants.colors.grey900, _uiConstants.colors.grey300, _uiConstants.theme.secondary600, _uiConstants.colors.white]
|
|
70
68
|
}, ["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;"), marginLeft && "margin-
|
|
73
|
-
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " ").concat(marginLeft && "margin-
|
|
69
|
+
id: "2231360490",
|
|
70
|
+
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), marginLeft && "margin-left: ".concat(marginLeft, "px;"), marginRight && "margin-right: ".concat(marginRight, "px;"), marginTop && "margin-top: ".concat(marginTop, "px")]
|
|
71
|
+
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " ").concat(marginLeft && "margin-left: ".concat(marginLeft, "px;"), " ").concat(marginRight && "margin-right: ".concat(marginRight, "px;"), " ").concat(marginTop && "margin-top: ".concat(marginTop, "px"), ";}")]));
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
exports.Chip = Chip;
|
|
@@ -79,8 +77,6 @@ Chip.defaultProps = {
|
|
|
79
77
|
marginBottom: 4,
|
|
80
78
|
marginLeft: 4,
|
|
81
79
|
marginRight: 4,
|
|
82
|
-
marginInlineStart: 4,
|
|
83
|
-
marginInlineEnd: 4,
|
|
84
80
|
marginTop: 4
|
|
85
81
|
};
|
|
86
82
|
Chip.propTypes = {
|
|
@@ -95,16 +91,10 @@ Chip.propTypes = {
|
|
|
95
91
|
/** `margin-bottom` value, applied in `px` */
|
|
96
92
|
marginBottom: _propTypes.default.number,
|
|
97
93
|
|
|
98
|
-
/** `margin-
|
|
99
|
-
marginInlineEnd: _propTypes.default.number,
|
|
100
|
-
|
|
101
|
-
/** `margin-inline-start` value, applied in `px` */
|
|
102
|
-
marginInlineStart: _propTypes.default.number,
|
|
103
|
-
|
|
104
|
-
/** `margin-inline-start` value, applied in `px` */
|
|
94
|
+
/** `margin-left` value, applied in `px` */
|
|
105
95
|
marginLeft: _propTypes.default.number,
|
|
106
96
|
|
|
107
|
-
/** `margin-
|
|
97
|
+
/** `margin-right` value, applied in `px` */
|
|
108
98
|
marginRight: _propTypes.default.number,
|
|
109
99
|
|
|
110
100
|
/** `margin-top` value, applied in `px` */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Selected = exports.Removable = exports.
|
|
6
|
+
exports.default = exports.Selected = exports.Removable = exports.Overflow = exports.IconContent = exports.Icon = exports.DenseRemoveable = exports.Dense = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
9
|
|
|
@@ -134,12 +134,4 @@ exports.DenseRemoveable = DenseRemoveable;
|
|
|
134
134
|
DenseRemoveable.args = { ...Dense.args,
|
|
135
135
|
...Removable.args,
|
|
136
136
|
children: 'Removable and dense'
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const RTLRemovable = args => /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
-
dir: "rtl"
|
|
141
|
-
}, /*#__PURE__*/_react.default.createElement(_chip.Chip, args, "RTL removable"));
|
|
142
|
-
|
|
143
|
-
exports.RTLRemovable = RTLRemovable;
|
|
144
|
-
RTLRemovable.args = { ...Removable.args
|
|
145
137
|
};
|
package/build/cjs/icon.js
CHANGED
|
@@ -27,11 +27,11 @@ const Icon = _ref => {
|
|
|
27
27
|
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
29
29
|
"data-test": dataTest,
|
|
30
|
-
className: _style.default.dynamic([["
|
|
30
|
+
className: _style.default.dynamic([["2159848327", [_uiConstants.spacers.dp4]]])
|
|
31
31
|
}, icon, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
32
|
-
id: "
|
|
32
|
+
id: "2159848327",
|
|
33
33
|
dynamic: [_uiConstants.spacers.dp4]
|
|
34
|
-
}, ["span.__jsx-style-dynamic-selector{width:24px;height:24px;margin-
|
|
34
|
+
}, ["span.__jsx-style-dynamic-selector{width:24px;height:24px;margin-left:".concat(_uiConstants.spacers.dp4, ";margin-right:-6px;border-radius:50%;overflow:hidden;}"), "span.__jsx-style-dynamic-selector>*{max-height:24px;max-width:24px;}"]));
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
exports.Icon = Icon;
|
package/build/cjs/remove.js
CHANGED
|
@@ -34,8 +34,8 @@ function CancelOutline(_ref) {
|
|
|
34
34
|
CancelOutline.propTypes = {
|
|
35
35
|
className: _propTypes.default.string
|
|
36
36
|
};
|
|
37
|
-
const containerStyle = ["span.jsx-
|
|
38
|
-
containerStyle.__hash = "
|
|
37
|
+
const containerStyle = ["span.jsx-1924786287{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:20px;width:20px;margin-right:4px;border-radius:12px;margin-left:-8px;}", "span.jsx-1924786287:hover{background:".concat(_uiConstants.colors.grey400, ";}")];
|
|
38
|
+
containerStyle.__hash = "1924786287";
|
|
39
39
|
const removeIcon = {
|
|
40
40
|
styles: /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
41
41
|
id: "2658726446"
|
package/build/es/chip.js
CHANGED
|
@@ -23,9 +23,7 @@ const Chip = _ref => {
|
|
|
23
23
|
marginBottom,
|
|
24
24
|
marginLeft,
|
|
25
25
|
marginRight,
|
|
26
|
-
marginTop
|
|
27
|
-
marginInlineStart,
|
|
28
|
-
marginInlineEnd
|
|
26
|
+
marginTop
|
|
29
27
|
} = _ref;
|
|
30
28
|
return /*#__PURE__*/React.createElement("span", {
|
|
31
29
|
onClick: e => {
|
|
@@ -34,7 +32,7 @@ const Chip = _ref => {
|
|
|
34
32
|
}
|
|
35
33
|
},
|
|
36
34
|
"data-test": dataTest,
|
|
37
|
-
className: _JSXStyle.dynamic([["3780556490", [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]], ["
|
|
35
|
+
className: _JSXStyle.dynamic([["3780556490", [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]], ["2231360490", [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), marginLeft && "margin-left: ".concat(marginLeft, "px;"), marginRight && "margin-right: ".concat(marginRight, "px;"), marginTop && "margin-top: ".concat(marginTop, "px")]]]) + " " + (cx(className, {
|
|
38
36
|
selected,
|
|
39
37
|
dense,
|
|
40
38
|
disabled,
|
|
@@ -52,9 +50,9 @@ const Chip = _ref => {
|
|
|
52
50
|
id: "3780556490",
|
|
53
51
|
dynamic: [colors.grey200, colors.grey900, colors.grey300, theme.secondary600, colors.white]
|
|
54
52
|
}, ["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;"), marginLeft && "margin-
|
|
57
|
-
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " ").concat(marginLeft && "margin-
|
|
53
|
+
id: "2231360490",
|
|
54
|
+
dynamic: [marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), marginLeft && "margin-left: ".concat(marginLeft, "px;"), marginRight && "margin-right: ".concat(marginRight, "px;"), marginTop && "margin-top: ".concat(marginTop, "px")]
|
|
55
|
+
}, ["span.__jsx-style-dynamic-selector{".concat(marginBottom && "margin-bottom: ".concat(marginBottom, "px;"), " ").concat(marginLeft && "margin-left: ".concat(marginLeft, "px;"), " ").concat(marginRight && "margin-right: ".concat(marginRight, "px;"), " ").concat(marginTop && "margin-top: ".concat(marginTop, "px"), ";}")]));
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
Chip.defaultProps = {
|
|
@@ -62,8 +60,6 @@ Chip.defaultProps = {
|
|
|
62
60
|
marginBottom: 4,
|
|
63
61
|
marginLeft: 4,
|
|
64
62
|
marginRight: 4,
|
|
65
|
-
marginInlineStart: 4,
|
|
66
|
-
marginInlineEnd: 4,
|
|
67
63
|
marginTop: 4
|
|
68
64
|
};
|
|
69
65
|
Chip.propTypes = {
|
|
@@ -78,16 +74,10 @@ Chip.propTypes = {
|
|
|
78
74
|
/** `margin-bottom` value, applied in `px` */
|
|
79
75
|
marginBottom: PropTypes.number,
|
|
80
76
|
|
|
81
|
-
/** `margin-
|
|
82
|
-
marginInlineEnd: PropTypes.number,
|
|
83
|
-
|
|
84
|
-
/** `margin-inline-start` value, applied in `px` */
|
|
85
|
-
marginInlineStart: PropTypes.number,
|
|
86
|
-
|
|
87
|
-
/** `margin-inline-start` value, applied in `px` */
|
|
77
|
+
/** `margin-left` value, applied in `px` */
|
|
88
78
|
marginLeft: PropTypes.number,
|
|
89
79
|
|
|
90
|
-
/** `margin-
|
|
80
|
+
/** `margin-right` value, applied in `px` */
|
|
91
81
|
marginRight: PropTypes.number,
|
|
92
82
|
|
|
93
83
|
/** `margin-top` value, applied in `px` */
|
package/build/es/chip.stories.js
CHANGED
|
@@ -111,9 +111,4 @@ export const DenseRemoveable = Template.bind({});
|
|
|
111
111
|
DenseRemoveable.args = { ...Dense.args,
|
|
112
112
|
...Removable.args,
|
|
113
113
|
children: 'Removable and dense'
|
|
114
|
-
};
|
|
115
|
-
export const RTLRemovable = args => /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
dir: "rtl"
|
|
117
|
-
}, /*#__PURE__*/React.createElement(Chip, args, "RTL removable"));
|
|
118
|
-
RTLRemovable.args = { ...Removable.args
|
|
119
114
|
};
|
package/build/es/icon.js
CHANGED
|
@@ -14,11 +14,11 @@ export const Icon = _ref => {
|
|
|
14
14
|
|
|
15
15
|
return /*#__PURE__*/React.createElement("span", {
|
|
16
16
|
"data-test": dataTest,
|
|
17
|
-
className: _JSXStyle.dynamic([["
|
|
17
|
+
className: _JSXStyle.dynamic([["2159848327", [spacers.dp4]]])
|
|
18
18
|
}, icon, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19
|
-
id: "
|
|
19
|
+
id: "2159848327",
|
|
20
20
|
dynamic: [spacers.dp4]
|
|
21
|
-
}, ["span.__jsx-style-dynamic-selector{width:24px;height:24px;margin-
|
|
21
|
+
}, ["span.__jsx-style-dynamic-selector{width:24px;height:24px;margin-left:".concat(spacers.dp4, ";margin-right:-6px;border-radius:50%;overflow:hidden;}"), "span.__jsx-style-dynamic-selector>*{max-height:24px;max-width:24px;}"]));
|
|
22
22
|
};
|
|
23
23
|
Icon.propTypes = {
|
|
24
24
|
dataTest: PropTypes.string.isRequired,
|
package/build/es/remove.js
CHANGED
|
@@ -22,8 +22,8 @@ function CancelOutline(_ref) {
|
|
|
22
22
|
CancelOutline.propTypes = {
|
|
23
23
|
className: PropTypes.string
|
|
24
24
|
};
|
|
25
|
-
const containerStyle = ["span.jsx-
|
|
26
|
-
containerStyle.__hash = "
|
|
25
|
+
const containerStyle = ["span.jsx-1924786287{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:20px;width:20px;margin-right:4px;border-radius:12px;margin-left:-8px;}", "span.jsx-1924786287:hover{background:".concat(colors.grey400, ";}")];
|
|
26
|
+
containerStyle.__hash = "1924786287";
|
|
27
27
|
const removeIcon = {
|
|
28
28
|
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
29
29
|
id: "2658726446"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/chip",
|
|
3
|
-
"version": "9.3.0
|
|
3
|
+
"version": "9.3.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.3.0
|
|
36
|
+
"@dhis2/ui-constants": "9.3.0",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2"
|
|
39
39
|
},
|
package/types/index.d.ts
CHANGED
|
@@ -13,21 +13,13 @@ export interface ChipProps {
|
|
|
13
13
|
*/
|
|
14
14
|
marginBottom?: number
|
|
15
15
|
/**
|
|
16
|
-
* `margin-
|
|
16
|
+
* `margin-left` value, applied in `px`
|
|
17
17
|
*/
|
|
18
18
|
marginLeft?: number
|
|
19
19
|
/**
|
|
20
|
-
* `margin-
|
|
20
|
+
* `margin-right` value, applied in `px`
|
|
21
21
|
*/
|
|
22
22
|
marginRight?: number
|
|
23
|
-
/**
|
|
24
|
-
* `margin-inline-start` value, applied in `px`
|
|
25
|
-
*/
|
|
26
|
-
marginInlineStart?: number
|
|
27
|
-
/**
|
|
28
|
-
* `margin-inline-end` value, applied in `px`
|
|
29
|
-
*/
|
|
30
|
-
marginInlineEnd?: number
|
|
31
23
|
/**
|
|
32
24
|
* `margin-top` value, applied in `px`
|
|
33
25
|
*/
|