@zendeskgarden/react-tags 8.46.0 → 8.48.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/dist/index.cjs.js
CHANGED
|
@@ -26,14 +26,12 @@ function _interopNamespace(e) {
|
|
|
26
26
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
27
|
Object.defineProperty(n, k, d.get ? d : {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return e[k];
|
|
31
|
-
}
|
|
29
|
+
get: function () { return e[k]; }
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
|
-
n[
|
|
34
|
+
n["default"] = e;
|
|
37
35
|
return Object.freeze(n);
|
|
38
36
|
}
|
|
39
37
|
|
|
@@ -98,13 +96,13 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
98
96
|
|
|
99
97
|
var _excluded$1 = ["children"];
|
|
100
98
|
var COMPONENT_ID$2 = 'tags.avatar';
|
|
101
|
-
var StyledAvatar = styled__default[
|
|
99
|
+
var StyledAvatar = styled__default["default"](function (_ref) {
|
|
102
100
|
var children = _ref.children,
|
|
103
101
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
104
|
-
return React__default[
|
|
102
|
+
return React__default["default"].cloneElement(React.Children.only(children), props);
|
|
105
103
|
}).attrs({
|
|
106
104
|
'data-garden-id': COMPONENT_ID$2,
|
|
107
|
-
'data-garden-version': '8.
|
|
105
|
+
'data-garden-version': '8.48.0'
|
|
108
106
|
}).withConfig({
|
|
109
107
|
displayName: "StyledAvatar",
|
|
110
108
|
componentId: "sc-3kdmgt-0"
|
|
@@ -116,9 +114,9 @@ StyledAvatar.defaultProps = {
|
|
|
116
114
|
};
|
|
117
115
|
|
|
118
116
|
var COMPONENT_ID$1 = 'tags.close';
|
|
119
|
-
var StyledClose = styled__default[
|
|
117
|
+
var StyledClose = styled__default["default"].div.attrs({
|
|
120
118
|
'data-garden-id': COMPONENT_ID$1,
|
|
121
|
-
'data-garden-version': '8.
|
|
119
|
+
'data-garden-version': '8.48.0',
|
|
122
120
|
'aria-label': 'Press delete to remove'
|
|
123
121
|
}).withConfig({
|
|
124
122
|
displayName: "StyledClose",
|
|
@@ -201,9 +199,9 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
201
199
|
}
|
|
202
200
|
return styled.css(["border-radius:", ";padding:0 ", "px;min-width:", ";height:", "px;line-height:", ";font-size:", ";& > *{width:100%;min-width:", ";}& ", "{margin-", ":-", "px;margin-", ":", "px;border-radius:", ";width:", "px;min-width:", "px;height:", "px;}& ", "{margin-", ":-", "px;border-radius:", ";width:", "px;height:", "px;}"], borderRadius, padding, minWidth ? "".concat(minWidth, "px") : "calc(".concat(padding * 2, "px + 1ch)"), height, reactTheming.getLineHeight(height, fontSize), fontSize, minWidth ? "".concat(minWidth - padding * 2, "px") : '1ch', StyledAvatar, props.theme.rtl ? 'right' : 'left', padding - avatarMargin, props.theme.rtl ? 'left' : 'right', avatarTextMargin, avatarBorderRadius, avatarSize, avatarSize, avatarSize, StyledClose, props.theme.rtl ? 'left' : 'right', padding, borderRadius, height, height);
|
|
203
201
|
};
|
|
204
|
-
var StyledTag = styled__default[
|
|
202
|
+
var StyledTag = styled__default["default"].div.attrs({
|
|
205
203
|
'data-garden-id': COMPONENT_ID,
|
|
206
|
-
'data-garden-version': '8.
|
|
204
|
+
'data-garden-version': '8.48.0'
|
|
207
205
|
}).withConfig({
|
|
208
206
|
displayName: "StyledTag",
|
|
209
207
|
componentId: "sc-1jvbe03-0"
|
|
@@ -231,55 +229,63 @@ StyledTag.defaultProps = {
|
|
|
231
229
|
theme: reactTheming.DEFAULT_THEME
|
|
232
230
|
};
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
var _path;
|
|
235
233
|
|
|
236
|
-
var
|
|
237
|
-
stroke: "currentColor",
|
|
238
|
-
strokeLinecap: "round",
|
|
239
|
-
d: "M3 9l6-6m0 6L3 3"
|
|
240
|
-
});
|
|
234
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
241
235
|
|
|
242
|
-
function SvgXStroke(props) {
|
|
236
|
+
var SvgXStroke = function SvgXStroke(props) {
|
|
243
237
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
244
238
|
xmlns: "http://www.w3.org/2000/svg",
|
|
245
239
|
width: 12,
|
|
246
240
|
height: 12,
|
|
247
|
-
viewBox: "0 0 12 12",
|
|
248
241
|
focusable: "false",
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
242
|
+
viewBox: "0 0 12 12",
|
|
243
|
+
"aria-hidden": "true"
|
|
244
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
245
|
+
stroke: "currentColor",
|
|
246
|
+
strokeLinecap: "round",
|
|
247
|
+
d: "M3 9l6-6m0 6L3 3"
|
|
248
|
+
})));
|
|
249
|
+
};
|
|
252
250
|
|
|
253
|
-
var
|
|
254
|
-
return React__default[
|
|
251
|
+
var CloseComponent = React.forwardRef(function (props, ref) {
|
|
252
|
+
return React__default["default"].createElement(StyledClose, _extends$1({
|
|
255
253
|
ref: ref
|
|
256
|
-
}, props), React__default[
|
|
254
|
+
}, props), React__default["default"].createElement(SvgXStroke, null));
|
|
257
255
|
});
|
|
258
|
-
|
|
256
|
+
CloseComponent.displayName = 'Tag.Close';
|
|
257
|
+
var Close = CloseComponent;
|
|
258
|
+
|
|
259
|
+
var AvatarComponent = function AvatarComponent(props) {
|
|
260
|
+
return React__default["default"].createElement(StyledAvatar, props);
|
|
261
|
+
};
|
|
262
|
+
AvatarComponent.displayName = 'Tag.Avatar';
|
|
263
|
+
var Avatar = AvatarComponent;
|
|
259
264
|
|
|
260
265
|
var _excluded = ["size", "hue"];
|
|
261
|
-
var
|
|
266
|
+
var TagComponent = React.forwardRef(function (_ref, ref) {
|
|
262
267
|
var size = _ref.size,
|
|
263
268
|
hue = _ref.hue,
|
|
264
269
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
265
|
-
return React__default[
|
|
270
|
+
return React__default["default"].createElement(StyledTag, _extends$1({
|
|
266
271
|
ref: ref,
|
|
267
272
|
size: size,
|
|
268
273
|
hue: hue
|
|
269
274
|
}, otherProps));
|
|
270
275
|
});
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
size: PropTypes__default[
|
|
274
|
-
hue: PropTypes__default[
|
|
275
|
-
isPill: PropTypes__default[
|
|
276
|
-
isRound: PropTypes__default[
|
|
277
|
-
isRegular: PropTypes__default[
|
|
276
|
+
TagComponent.displayName = 'Tag';
|
|
277
|
+
TagComponent.propTypes = {
|
|
278
|
+
size: PropTypes__default["default"].oneOf(['small', 'medium', 'large']),
|
|
279
|
+
hue: PropTypes__default["default"].string,
|
|
280
|
+
isPill: PropTypes__default["default"].bool,
|
|
281
|
+
isRound: PropTypes__default["default"].bool,
|
|
282
|
+
isRegular: PropTypes__default["default"].bool
|
|
278
283
|
};
|
|
279
|
-
|
|
284
|
+
TagComponent.defaultProps = {
|
|
280
285
|
size: 'medium'
|
|
281
286
|
};
|
|
282
|
-
Tag
|
|
287
|
+
var Tag = TagComponent;
|
|
288
|
+
Tag.Avatar = Avatar;
|
|
283
289
|
Tag.Close = Close;
|
|
284
290
|
|
|
285
291
|
exports.Tag = Tag;
|
package/dist/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { Children } from 'react';
|
|
9
|
+
import React__default, { Children, forwardRef } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import styled, { css } from 'styled-components';
|
|
12
12
|
import { readableColor, math } from 'polished';
|
|
@@ -74,7 +74,7 @@ var StyledAvatar = styled(function (_ref) {
|
|
|
74
74
|
return React__default.cloneElement(Children.only(children), props);
|
|
75
75
|
}).attrs({
|
|
76
76
|
'data-garden-id': COMPONENT_ID$2,
|
|
77
|
-
'data-garden-version': '8.
|
|
77
|
+
'data-garden-version': '8.48.0'
|
|
78
78
|
}).withConfig({
|
|
79
79
|
displayName: "StyledAvatar",
|
|
80
80
|
componentId: "sc-3kdmgt-0"
|
|
@@ -88,7 +88,7 @@ StyledAvatar.defaultProps = {
|
|
|
88
88
|
var COMPONENT_ID$1 = 'tags.close';
|
|
89
89
|
var StyledClose = styled.div.attrs({
|
|
90
90
|
'data-garden-id': COMPONENT_ID$1,
|
|
91
|
-
'data-garden-version': '8.
|
|
91
|
+
'data-garden-version': '8.48.0',
|
|
92
92
|
'aria-label': 'Press delete to remove'
|
|
93
93
|
}).withConfig({
|
|
94
94
|
displayName: "StyledClose",
|
|
@@ -173,7 +173,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
173
173
|
};
|
|
174
174
|
var StyledTag = styled.div.attrs({
|
|
175
175
|
'data-garden-id': COMPONENT_ID,
|
|
176
|
-
'data-garden-version': '8.
|
|
176
|
+
'data-garden-version': '8.48.0'
|
|
177
177
|
}).withConfig({
|
|
178
178
|
displayName: "StyledTag",
|
|
179
179
|
componentId: "sc-1jvbe03-0"
|
|
@@ -201,34 +201,41 @@ StyledTag.defaultProps = {
|
|
|
201
201
|
theme: DEFAULT_THEME
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
var _path;
|
|
205
205
|
|
|
206
|
-
var
|
|
207
|
-
stroke: "currentColor",
|
|
208
|
-
strokeLinecap: "round",
|
|
209
|
-
d: "M3 9l6-6m0 6L3 3"
|
|
210
|
-
});
|
|
206
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
211
207
|
|
|
212
|
-
function SvgXStroke(props) {
|
|
208
|
+
var SvgXStroke = function SvgXStroke(props) {
|
|
213
209
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
214
210
|
xmlns: "http://www.w3.org/2000/svg",
|
|
215
211
|
width: 12,
|
|
216
212
|
height: 12,
|
|
217
|
-
viewBox: "0 0 12 12",
|
|
218
213
|
focusable: "false",
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
214
|
+
viewBox: "0 0 12 12",
|
|
215
|
+
"aria-hidden": "true"
|
|
216
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
217
|
+
stroke: "currentColor",
|
|
218
|
+
strokeLinecap: "round",
|
|
219
|
+
d: "M3 9l6-6m0 6L3 3"
|
|
220
|
+
})));
|
|
221
|
+
};
|
|
222
222
|
|
|
223
|
-
var
|
|
223
|
+
var CloseComponent = forwardRef(function (props, ref) {
|
|
224
224
|
return React__default.createElement(StyledClose, _extends$1({
|
|
225
225
|
ref: ref
|
|
226
226
|
}, props), React__default.createElement(SvgXStroke, null));
|
|
227
227
|
});
|
|
228
|
-
|
|
228
|
+
CloseComponent.displayName = 'Tag.Close';
|
|
229
|
+
var Close = CloseComponent;
|
|
230
|
+
|
|
231
|
+
var AvatarComponent = function AvatarComponent(props) {
|
|
232
|
+
return React__default.createElement(StyledAvatar, props);
|
|
233
|
+
};
|
|
234
|
+
AvatarComponent.displayName = 'Tag.Avatar';
|
|
235
|
+
var Avatar = AvatarComponent;
|
|
229
236
|
|
|
230
237
|
var _excluded = ["size", "hue"];
|
|
231
|
-
var
|
|
238
|
+
var TagComponent = forwardRef(function (_ref, ref) {
|
|
232
239
|
var size = _ref.size,
|
|
233
240
|
hue = _ref.hue,
|
|
234
241
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -238,18 +245,19 @@ var Tag = React__default.forwardRef(function (_ref, ref) {
|
|
|
238
245
|
hue: hue
|
|
239
246
|
}, otherProps));
|
|
240
247
|
});
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
TagComponent.displayName = 'Tag';
|
|
249
|
+
TagComponent.propTypes = {
|
|
243
250
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
244
251
|
hue: PropTypes.string,
|
|
245
252
|
isPill: PropTypes.bool,
|
|
246
253
|
isRound: PropTypes.bool,
|
|
247
254
|
isRegular: PropTypes.bool
|
|
248
255
|
};
|
|
249
|
-
|
|
256
|
+
TagComponent.defaultProps = {
|
|
250
257
|
size: 'medium'
|
|
251
258
|
};
|
|
252
|
-
Tag
|
|
259
|
+
var Tag = TagComponent;
|
|
260
|
+
Tag.Avatar = Avatar;
|
|
253
261
|
Tag.Close = Close;
|
|
254
262
|
|
|
255
263
|
export { Tag };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLAttributes } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* @extends HTMLAttributes<HTMLElement>
|
|
10
|
+
*/
|
|
11
|
+
export declare const Avatar: {
|
|
12
|
+
(props: HTMLAttributes<HTMLElement>): JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
@@ -8,5 +8,4 @@ import React from 'react';
|
|
|
8
8
|
/**
|
|
9
9
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
10
10
|
*/
|
|
11
|
-
declare const Close: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export default Close;
|
|
11
|
+
export declare const Close: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import React, { HTMLAttributes } from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
interface ITagProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
import { Close } from './Close';
|
|
9
|
+
import { Avatar } from './Avatar';
|
|
10
|
+
export interface ITagProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
/** Adjusts font size and padding */
|
|
12
12
|
size?: 'small' | 'medium' | 'large';
|
|
13
13
|
/**
|
|
@@ -23,8 +23,10 @@ interface ITagProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
23
23
|
/** Applies regular (non-bold) font weight */
|
|
24
24
|
isRegular?: boolean;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @extends HTMLAttributes<HTMLDivElement>
|
|
28
|
+
*/
|
|
29
|
+
export declare const Tag: React.ForwardRefExoticComponent<ITagProps & React.RefAttributes<HTMLDivElement>> & {
|
|
30
|
+
Avatar: typeof Avatar;
|
|
28
31
|
Close: typeof Close;
|
|
29
32
|
};
|
|
30
|
-
export default _default;
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { Tag } from './elements/Tag';
|
|
8
|
+
export type { ITagProps } from './elements/Tag';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-tags",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.48.0",
|
|
4
4
|
"description": "Components relating to tags in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/container-utilities": "^0.
|
|
24
|
+
"@zendeskgarden/container-utilities": "^0.7.0",
|
|
25
25
|
"polished": "^4.0.0",
|
|
26
26
|
"prop-types": "^15.5.7"
|
|
27
27
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@zendeskgarden/react-theming": "^8.
|
|
35
|
+
"@zendeskgarden/react-theming": "^8.48.0",
|
|
36
36
|
"@zendeskgarden/svg-icons": "6.30.2"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"zendeskgarden:src": "src/index.ts",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "75f36aee62043004650c3eb2e1583b98a87d71f8"
|
|
49
49
|
}
|