carbon-react 120.2.0 → 120.2.1
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/esm/components/breadcrumbs/crumb/crumb.component.js +2 -1
- package/esm/components/link/link.component.d.ts +2 -0
- package/esm/components/link/link.component.js +3 -1
- package/esm/components/menu/menu-item/menu-item.component.js +1 -0
- package/esm/components/note/note.component.js +3 -1
- package/esm/components/portrait/portrait.config.d.ts +8 -31
- package/lib/components/breadcrumbs/crumb/crumb.component.js +2 -1
- package/lib/components/link/link.component.d.ts +2 -0
- package/lib/components/link/link.component.js +3 -1
- package/lib/components/menu/menu-item/menu-item.component.js +1 -0
- package/lib/components/note/note.component.js +3 -1
- package/lib/components/portrait/portrait.config.d.ts +8 -31
- package/package.json +1 -1
|
@@ -75,7 +75,8 @@ Crumb.propTypes = {
|
|
|
75
75
|
"onClick": PropTypes.func,
|
|
76
76
|
"onKeyDown": PropTypes.func,
|
|
77
77
|
"onMouseDown": PropTypes.func,
|
|
78
|
-
"placeholderTabIndex": PropTypes.bool
|
|
78
|
+
"placeholderTabIndex": PropTypes.bool,
|
|
79
|
+
"removeAriaLabelOnIcon": PropTypes.bool
|
|
79
80
|
};
|
|
80
81
|
Crumb.displayName = "Crumb";
|
|
81
82
|
export default Crumb;
|
|
@@ -28,6 +28,8 @@ export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
|
|
|
28
28
|
rel?: string;
|
|
29
29
|
/** @ignore @private internal prop to be set when no href or onClick passed */
|
|
30
30
|
placeholderTabIndex?: boolean;
|
|
31
|
+
/** @ignore @private internal prop to be set when no aria-label should be specified */
|
|
32
|
+
removeAriaLabelOnIcon?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
|
|
33
35
|
export default Link;
|
|
@@ -26,6 +26,7 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
26
26
|
variant = "default",
|
|
27
27
|
isDarkBackground,
|
|
28
28
|
placeholderTabIndex,
|
|
29
|
+
removeAriaLabelOnIcon,
|
|
29
30
|
...rest
|
|
30
31
|
}, ref) => {
|
|
31
32
|
const l = useLocale();
|
|
@@ -52,7 +53,7 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
52
53
|
type: icon,
|
|
53
54
|
bgSize: "extra-small",
|
|
54
55
|
disabled: disabled,
|
|
55
|
-
ariaLabel: ariaLabel,
|
|
56
|
+
ariaLabel: removeAriaLabelOnIcon ? undefined : ariaLabel,
|
|
56
57
|
tooltipMessage: tooltipMessage,
|
|
57
58
|
tooltipPosition: tooltipPosition
|
|
58
59
|
}) : null;
|
|
@@ -171,6 +172,7 @@ Link.propTypes = {
|
|
|
171
172
|
"onMouseDown": PropTypes.func,
|
|
172
173
|
"placeholderTabIndex": PropTypes.bool,
|
|
173
174
|
"rel": PropTypes.string,
|
|
175
|
+
"removeAriaLabelOnIcon": PropTypes.bool,
|
|
174
176
|
"target": PropTypes.string,
|
|
175
177
|
"tooltipMessage": PropTypes.string,
|
|
176
178
|
"tooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
@@ -68,7 +68,9 @@ export const Note = ({
|
|
|
68
68
|
}) : preview), createdDate && /*#__PURE__*/React.createElement(StyledNoteContent, {
|
|
69
69
|
hasPreview: !!React.Children.count(previews),
|
|
70
70
|
hasInlineControl: !!inlineControl
|
|
71
|
-
}, /*#__PURE__*/React.createElement(StyledFooter,
|
|
71
|
+
}, /*#__PURE__*/React.createElement(StyledFooter, {
|
|
72
|
+
"data-element": "note-footer"
|
|
73
|
+
}, name && /*#__PURE__*/React.createElement(StyledFooterContent, {
|
|
72
74
|
hasName: !!name
|
|
73
75
|
}, name), /*#__PURE__*/React.createElement(StyledFooterContent, {
|
|
74
76
|
hasName: !!name
|
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
export declare const PORTRAIT_SHAPES: string[];
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
iconDimensions: number;
|
|
11
|
-
};
|
|
12
|
-
M: {
|
|
13
|
-
dimensions: number;
|
|
14
|
-
iconDimensions: number;
|
|
15
|
-
};
|
|
16
|
-
ML: {
|
|
17
|
-
dimensions: number;
|
|
18
|
-
iconDimensions: number;
|
|
19
|
-
};
|
|
20
|
-
L: {
|
|
21
|
-
dimensions: number;
|
|
22
|
-
iconDimensions: number;
|
|
23
|
-
};
|
|
24
|
-
XL: {
|
|
25
|
-
dimensions: number;
|
|
26
|
-
iconDimensions: number;
|
|
27
|
-
};
|
|
28
|
-
XXL: {
|
|
29
|
-
dimensions: number;
|
|
30
|
-
iconDimensions: number;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
2
|
+
declare type PortraitSize = "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
3
|
+
export declare const PORTRAIT_SIZES: PortraitSize[];
|
|
4
|
+
declare type PortraitSizeParams = Record<PortraitSize, {
|
|
5
|
+
dimensions: number;
|
|
6
|
+
iconDimensions: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const PORTRAIT_SIZE_PARAMS: PortraitSizeParams;
|
|
9
|
+
export {};
|
|
@@ -82,7 +82,8 @@ Crumb.propTypes = {
|
|
|
82
82
|
"onClick": _propTypes.default.func,
|
|
83
83
|
"onKeyDown": _propTypes.default.func,
|
|
84
84
|
"onMouseDown": _propTypes.default.func,
|
|
85
|
-
"placeholderTabIndex": _propTypes.default.bool
|
|
85
|
+
"placeholderTabIndex": _propTypes.default.bool,
|
|
86
|
+
"removeAriaLabelOnIcon": _propTypes.default.bool
|
|
86
87
|
};
|
|
87
88
|
Crumb.displayName = "Crumb";
|
|
88
89
|
var _default = Crumb;
|
|
@@ -28,6 +28,8 @@ export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
|
|
|
28
28
|
rel?: string;
|
|
29
29
|
/** @ignore @private internal prop to be set when no href or onClick passed */
|
|
30
30
|
placeholderTabIndex?: boolean;
|
|
31
|
+
/** @ignore @private internal prop to be set when no aria-label should be specified */
|
|
32
|
+
removeAriaLabelOnIcon?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
|
|
33
35
|
export default Link;
|
|
@@ -35,6 +35,7 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
35
35
|
variant = "default",
|
|
36
36
|
isDarkBackground,
|
|
37
37
|
placeholderTabIndex,
|
|
38
|
+
removeAriaLabelOnIcon,
|
|
38
39
|
...rest
|
|
39
40
|
}, ref) => {
|
|
40
41
|
const l = (0, _useLocale.default)();
|
|
@@ -61,7 +62,7 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
61
62
|
type: icon,
|
|
62
63
|
bgSize: "extra-small",
|
|
63
64
|
disabled: disabled,
|
|
64
|
-
ariaLabel: ariaLabel,
|
|
65
|
+
ariaLabel: removeAriaLabelOnIcon ? undefined : ariaLabel,
|
|
65
66
|
tooltipMessage: tooltipMessage,
|
|
66
67
|
tooltipPosition: tooltipPosition
|
|
67
68
|
}) : null;
|
|
@@ -181,6 +182,7 @@ Link.propTypes = {
|
|
|
181
182
|
"onMouseDown": _propTypes.default.func,
|
|
182
183
|
"placeholderTabIndex": _propTypes.default.bool,
|
|
183
184
|
"rel": _propTypes.default.string,
|
|
185
|
+
"removeAriaLabelOnIcon": _propTypes.default.bool,
|
|
184
186
|
"target": _propTypes.default.string,
|
|
185
187
|
"tooltipMessage": _propTypes.default.string,
|
|
186
188
|
"tooltipPosition": _propTypes.default.oneOf(["bottom", "left", "right", "top"]),
|
|
@@ -75,7 +75,9 @@ const Note = ({
|
|
|
75
75
|
}) : preview), createdDate && /*#__PURE__*/_react.default.createElement(_note.StyledNoteContent, {
|
|
76
76
|
hasPreview: !!_react.default.Children.count(previews),
|
|
77
77
|
hasInlineControl: !!inlineControl
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_note.StyledFooter,
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_note.StyledFooter, {
|
|
79
|
+
"data-element": "note-footer"
|
|
80
|
+
}, name && /*#__PURE__*/_react.default.createElement(_note.StyledFooterContent, {
|
|
79
81
|
hasName: !!name
|
|
80
82
|
}, name), /*#__PURE__*/_react.default.createElement(_note.StyledFooterContent, {
|
|
81
83
|
hasName: !!name
|
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
export declare const PORTRAIT_SHAPES: string[];
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
iconDimensions: number;
|
|
11
|
-
};
|
|
12
|
-
M: {
|
|
13
|
-
dimensions: number;
|
|
14
|
-
iconDimensions: number;
|
|
15
|
-
};
|
|
16
|
-
ML: {
|
|
17
|
-
dimensions: number;
|
|
18
|
-
iconDimensions: number;
|
|
19
|
-
};
|
|
20
|
-
L: {
|
|
21
|
-
dimensions: number;
|
|
22
|
-
iconDimensions: number;
|
|
23
|
-
};
|
|
24
|
-
XL: {
|
|
25
|
-
dimensions: number;
|
|
26
|
-
iconDimensions: number;
|
|
27
|
-
};
|
|
28
|
-
XXL: {
|
|
29
|
-
dimensions: number;
|
|
30
|
-
iconDimensions: number;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
2
|
+
declare type PortraitSize = "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
3
|
+
export declare const PORTRAIT_SIZES: PortraitSize[];
|
|
4
|
+
declare type PortraitSizeParams = Record<PortraitSize, {
|
|
5
|
+
dimensions: number;
|
|
6
|
+
iconDimensions: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const PORTRAIT_SIZE_PARAMS: PortraitSizeParams;
|
|
9
|
+
export {};
|