@zendeskgarden/react-tags 8.62.2 → 8.63.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
|
@@ -63,7 +63,7 @@ const StyledAvatar = styled__default.default(_ref => {
|
|
|
63
63
|
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
64
64
|
}).attrs({
|
|
65
65
|
'data-garden-id': COMPONENT_ID$2,
|
|
66
|
-
'data-garden-version': '8.
|
|
66
|
+
'data-garden-version': '8.63.0'
|
|
67
67
|
}).withConfig({
|
|
68
68
|
displayName: "StyledAvatar",
|
|
69
69
|
componentId: "sc-3kdmgt-0"
|
|
@@ -73,14 +73,13 @@ StyledAvatar.defaultProps = {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const COMPONENT_ID$1 = 'tags.close';
|
|
76
|
-
const StyledClose = styled__default.default.
|
|
76
|
+
const StyledClose = styled__default.default.button.attrs({
|
|
77
77
|
'data-garden-id': COMPONENT_ID$1,
|
|
78
|
-
'data-garden-version': '8.
|
|
79
|
-
'aria-label': 'Press delete to remove'
|
|
78
|
+
'data-garden-version': '8.63.0'
|
|
80
79
|
}).withConfig({
|
|
81
80
|
displayName: "StyledClose",
|
|
82
81
|
componentId: "sc-d6lrpn-0"
|
|
83
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:0;cursor:pointer;padding:0;font-size:0;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
82
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:0;background:transparent;cursor:pointer;padding:0;font-size:0;appearance:none;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
84
83
|
StyledClose.defaultProps = {
|
|
85
84
|
theme: reactTheming.DEFAULT_THEME
|
|
86
85
|
};
|
|
@@ -158,7 +157,7 @@ const sizeStyles = props => {
|
|
|
158
157
|
};
|
|
159
158
|
const StyledTag = styled__default.default.div.attrs({
|
|
160
159
|
'data-garden-id': COMPONENT_ID,
|
|
161
|
-
'data-garden-version': '8.
|
|
160
|
+
'data-garden-version': '8.63.0'
|
|
162
161
|
}).withConfig({
|
|
163
162
|
displayName: "StyledTag",
|
|
164
163
|
componentId: "sc-1jvbe03-0"
|
|
@@ -169,9 +168,7 @@ StyledTag.defaultProps = {
|
|
|
169
168
|
};
|
|
170
169
|
|
|
171
170
|
var _path;
|
|
172
|
-
|
|
173
171
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
174
|
-
|
|
175
172
|
var SvgXStroke = function SvgXStroke(props) {
|
|
176
173
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
177
174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -179,8 +176,7 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
179
176
|
height: 12,
|
|
180
177
|
focusable: "false",
|
|
181
178
|
viewBox: "0 0 12 12",
|
|
182
|
-
"aria-hidden": "true"
|
|
183
|
-
role: "img"
|
|
179
|
+
"aria-hidden": "true"
|
|
184
180
|
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
185
181
|
stroke: "currentColor",
|
|
186
182
|
strokeLinecap: "round",
|
|
@@ -188,9 +184,16 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
188
184
|
})));
|
|
189
185
|
};
|
|
190
186
|
|
|
191
|
-
const CloseComponent = React.forwardRef((props, ref) =>
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
const CloseComponent = React.forwardRef((props, ref) => {
|
|
188
|
+
const ariaLabel = reactTheming.useText(CloseComponent, props, 'aria-label', 'Remove');
|
|
189
|
+
return React__namespace.default.createElement(StyledClose, _extends$1({
|
|
190
|
+
ref: ref,
|
|
191
|
+
"aria-label": ariaLabel
|
|
192
|
+
}, props, {
|
|
193
|
+
type: "button",
|
|
194
|
+
tabIndex: -1
|
|
195
|
+
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
196
|
+
});
|
|
194
197
|
CloseComponent.displayName = 'Tag.Close';
|
|
195
198
|
const Close = CloseComponent;
|
|
196
199
|
|
package/dist/index.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ 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';
|
|
13
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
13
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, getLineHeight, useText } from '@zendeskgarden/react-theming';
|
|
14
14
|
|
|
15
15
|
function _extends$1() {
|
|
16
16
|
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -38,7 +38,7 @@ const StyledAvatar = styled(_ref => {
|
|
|
38
38
|
return React__default.cloneElement(Children.only(children), props);
|
|
39
39
|
}).attrs({
|
|
40
40
|
'data-garden-id': COMPONENT_ID$2,
|
|
41
|
-
'data-garden-version': '8.
|
|
41
|
+
'data-garden-version': '8.63.0'
|
|
42
42
|
}).withConfig({
|
|
43
43
|
displayName: "StyledAvatar",
|
|
44
44
|
componentId: "sc-3kdmgt-0"
|
|
@@ -48,14 +48,13 @@ StyledAvatar.defaultProps = {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const COMPONENT_ID$1 = 'tags.close';
|
|
51
|
-
const StyledClose = styled.
|
|
51
|
+
const StyledClose = styled.button.attrs({
|
|
52
52
|
'data-garden-id': COMPONENT_ID$1,
|
|
53
|
-
'data-garden-version': '8.
|
|
54
|
-
'aria-label': 'Press delete to remove'
|
|
53
|
+
'data-garden-version': '8.63.0'
|
|
55
54
|
}).withConfig({
|
|
56
55
|
displayName: "StyledClose",
|
|
57
56
|
componentId: "sc-d6lrpn-0"
|
|
58
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:0;cursor:pointer;padding:0;font-size:0;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
57
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:opacity 0.25s ease-in-out;opacity:0.8;border:0;background:transparent;cursor:pointer;padding:0;font-size:0;appearance:none;&:hover{opacity:0.9;}&:focus{outline:none;}", ";"], props => retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
59
58
|
StyledClose.defaultProps = {
|
|
60
59
|
theme: DEFAULT_THEME
|
|
61
60
|
};
|
|
@@ -133,7 +132,7 @@ const sizeStyles = props => {
|
|
|
133
132
|
};
|
|
134
133
|
const StyledTag = styled.div.attrs({
|
|
135
134
|
'data-garden-id': COMPONENT_ID,
|
|
136
|
-
'data-garden-version': '8.
|
|
135
|
+
'data-garden-version': '8.63.0'
|
|
137
136
|
}).withConfig({
|
|
138
137
|
displayName: "StyledTag",
|
|
139
138
|
componentId: "sc-1jvbe03-0"
|
|
@@ -144,9 +143,7 @@ StyledTag.defaultProps = {
|
|
|
144
143
|
};
|
|
145
144
|
|
|
146
145
|
var _path;
|
|
147
|
-
|
|
148
146
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
149
|
-
|
|
150
147
|
var SvgXStroke = function SvgXStroke(props) {
|
|
151
148
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
152
149
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -154,8 +151,7 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
154
151
|
height: 12,
|
|
155
152
|
focusable: "false",
|
|
156
153
|
viewBox: "0 0 12 12",
|
|
157
|
-
"aria-hidden": "true"
|
|
158
|
-
role: "img"
|
|
154
|
+
"aria-hidden": "true"
|
|
159
155
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
160
156
|
stroke: "currentColor",
|
|
161
157
|
strokeLinecap: "round",
|
|
@@ -163,9 +159,16 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
163
159
|
})));
|
|
164
160
|
};
|
|
165
161
|
|
|
166
|
-
const CloseComponent = forwardRef((props, ref) =>
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
const CloseComponent = forwardRef((props, ref) => {
|
|
163
|
+
const ariaLabel = useText(CloseComponent, props, 'aria-label', 'Remove');
|
|
164
|
+
return React__default.createElement(StyledClose, _extends$1({
|
|
165
|
+
ref: ref,
|
|
166
|
+
"aria-label": ariaLabel
|
|
167
|
+
}, props, {
|
|
168
|
+
type: "button",
|
|
169
|
+
tabIndex: -1
|
|
170
|
+
}), React__default.createElement(SvgXStroke, null));
|
|
171
|
+
});
|
|
169
172
|
CloseComponent.displayName = 'Tag.Close';
|
|
170
173
|
const Close = CloseComponent;
|
|
171
174
|
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/**
|
|
9
|
-
* @extends HTMLAttributes<
|
|
9
|
+
* @extends HTMLAttributes<HTMLButtonElement>
|
|
10
10
|
*/
|
|
11
|
-
export declare const Close: React.ForwardRefExoticComponent<React.
|
|
11
|
+
export declare const Close: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,4 +4,8 @@
|
|
|
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
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 1. <button> element reset
|
|
9
|
+
* 2. text content reset
|
|
10
|
+
*/
|
|
11
|
+
export declare const StyledClose: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -8,7 +8,7 @@ import { HTMLAttributes } from 'react';
|
|
|
8
8
|
export declare const SIZE: readonly ["small", "medium", "large"];
|
|
9
9
|
export interface ITagProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
/** Adjusts font size and padding */
|
|
11
|
-
size?: typeof SIZE[number];
|
|
11
|
+
size?: (typeof SIZE)[number];
|
|
12
12
|
/**
|
|
13
13
|
* Sets the color of the tag. Refer to
|
|
14
14
|
* [PALETTE](/components/palette#palette)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-tags",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.63.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": "^1.0.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.63.0",
|
|
36
36
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
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": "4b8715305a769881b143c7195c5b31e687422926"
|
|
49
49
|
}
|