carbon-react 114.2.1 → 114.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.
|
@@ -17,6 +17,8 @@ export interface PillProps extends StyledPillProps {
|
|
|
17
17
|
onDelete?: (ev: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
18
|
/** Sets the type of pill in use. */
|
|
19
19
|
pillRole?: "tag" | "status";
|
|
20
|
+
/** Sets custom aria-label attribute on the remove button */
|
|
21
|
+
ariaLabelOfRemoveButton?: string;
|
|
20
22
|
}
|
|
21
|
-
export declare const Pill: ({ wrapText, borderColor, colorVariant, children, fill, maxWidth, onClick, onDelete, pillRole, size, ...rest }: PillProps) => JSX.Element;
|
|
23
|
+
export declare const Pill: ({ wrapText, borderColor, colorVariant, children, fill, maxWidth, onClick, onDelete, pillRole, size, ariaLabelOfRemoveButton, ...rest }: PillProps) => JSX.Element;
|
|
22
24
|
export default Pill;
|
|
@@ -18,6 +18,7 @@ const Pill = ({
|
|
|
18
18
|
onDelete,
|
|
19
19
|
pillRole = "tag",
|
|
20
20
|
size = "M",
|
|
21
|
+
ariaLabelOfRemoveButton = "remove pill",
|
|
21
22
|
...rest
|
|
22
23
|
}) => /*#__PURE__*/React.createElement(StyledPill, _extends({
|
|
23
24
|
inFill: fill,
|
|
@@ -33,12 +34,13 @@ const Pill = ({
|
|
|
33
34
|
}, rest), children, onDelete && /*#__PURE__*/React.createElement(IconButton, {
|
|
34
35
|
onAction: onDelete,
|
|
35
36
|
"data-element": "close",
|
|
36
|
-
"aria-label":
|
|
37
|
+
"aria-label": ariaLabelOfRemoveButton
|
|
37
38
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
38
39
|
type: "cross"
|
|
39
40
|
})));
|
|
40
41
|
|
|
41
42
|
Pill.propTypes = {
|
|
43
|
+
"ariaLabelOfRemoveButton": PropTypes.string,
|
|
42
44
|
"borderColor": PropTypes.string,
|
|
43
45
|
"children": PropTypes.string.isRequired,
|
|
44
46
|
"colorVariant": PropTypes.oneOf(["negative", "neutral", "positive", "warning"]),
|
|
@@ -17,6 +17,8 @@ export interface PillProps extends StyledPillProps {
|
|
|
17
17
|
onDelete?: (ev: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
18
|
/** Sets the type of pill in use. */
|
|
19
19
|
pillRole?: "tag" | "status";
|
|
20
|
+
/** Sets custom aria-label attribute on the remove button */
|
|
21
|
+
ariaLabelOfRemoveButton?: string;
|
|
20
22
|
}
|
|
21
|
-
export declare const Pill: ({ wrapText, borderColor, colorVariant, children, fill, maxWidth, onClick, onDelete, pillRole, size, ...rest }: PillProps) => JSX.Element;
|
|
23
|
+
export declare const Pill: ({ wrapText, borderColor, colorVariant, children, fill, maxWidth, onClick, onDelete, pillRole, size, ariaLabelOfRemoveButton, ...rest }: PillProps) => JSX.Element;
|
|
22
24
|
export default Pill;
|
|
@@ -32,6 +32,7 @@ const Pill = ({
|
|
|
32
32
|
onDelete,
|
|
33
33
|
pillRole = "tag",
|
|
34
34
|
size = "M",
|
|
35
|
+
ariaLabelOfRemoveButton = "remove pill",
|
|
35
36
|
...rest
|
|
36
37
|
}) => /*#__PURE__*/_react.default.createElement(_pill.default, _extends({
|
|
37
38
|
inFill: fill,
|
|
@@ -47,13 +48,14 @@ const Pill = ({
|
|
|
47
48
|
}, rest), children, onDelete && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
48
49
|
onAction: onDelete,
|
|
49
50
|
"data-element": "close",
|
|
50
|
-
"aria-label":
|
|
51
|
+
"aria-label": ariaLabelOfRemoveButton
|
|
51
52
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
52
53
|
type: "cross"
|
|
53
54
|
})));
|
|
54
55
|
|
|
55
56
|
exports.Pill = Pill;
|
|
56
57
|
Pill.propTypes = {
|
|
58
|
+
"ariaLabelOfRemoveButton": _propTypes.default.string,
|
|
57
59
|
"borderColor": _propTypes.default.string,
|
|
58
60
|
"children": _propTypes.default.string.isRequired,
|
|
59
61
|
"colorVariant": _propTypes.default.oneOf(["negative", "neutral", "positive", "warning"]),
|