carbon-react 109.7.1 → 110.0.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/esm/components/link/link.component.d.ts +0 -2
- package/esm/components/link/link.component.js +0 -4
- package/esm/components/menu/__internal__/submenu/submenu.component.js +1 -2
- package/esm/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/lib/components/link/link.component.d.ts +0 -2
- package/lib/components/link/link.component.js +0 -4
- package/lib/components/menu/__internal__/submenu/submenu.component.js +1 -2
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/package.json +1 -1
|
@@ -15,8 +15,6 @@ export interface LinkProps extends React.AriaAttributes {
|
|
|
15
15
|
onKeyDown?: (ev: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
16
|
/** Function called when a mouse down event triggers. */
|
|
17
17
|
onMouseDown?: (ev: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
|
-
/** Whether to include the link in the tab order of the page */
|
|
19
|
-
tabbable?: boolean;
|
|
20
18
|
/** A message to display as a tooltip to the link. */
|
|
21
19
|
tooltipMessage?: string;
|
|
22
20
|
/** Positions the tooltip with the link. */
|
|
@@ -22,12 +22,10 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
22
22
|
rel,
|
|
23
23
|
tooltipMessage,
|
|
24
24
|
tooltipPosition,
|
|
25
|
-
tabbable = true,
|
|
26
25
|
target,
|
|
27
26
|
...rest
|
|
28
27
|
}, ref) => {
|
|
29
28
|
const l = useLocale();
|
|
30
|
-
const tabIndex = tabbable && !disabled ? "0" : "-1";
|
|
31
29
|
|
|
32
30
|
const handleOnKeyDown = ev => {
|
|
33
31
|
if (onKeyDown) {
|
|
@@ -70,7 +68,6 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
70
68
|
onMouseDown,
|
|
71
69
|
onClick,
|
|
72
70
|
disabled,
|
|
73
|
-
tabIndex,
|
|
74
71
|
target,
|
|
75
72
|
ref,
|
|
76
73
|
href,
|
|
@@ -160,7 +157,6 @@ Link.propTypes = {
|
|
|
160
157
|
"onKeyDown": PropTypes.func,
|
|
161
158
|
"onMouseDown": PropTypes.func,
|
|
162
159
|
"rel": PropTypes.string,
|
|
163
|
-
"tabbable": PropTypes.bool,
|
|
164
160
|
"target": PropTypes.string,
|
|
165
161
|
"tooltipMessage": PropTypes.string,
|
|
166
162
|
"tooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"])
|
|
@@ -220,9 +220,8 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
220
220
|
menuType: menuContext.menuType,
|
|
221
221
|
ref: ref,
|
|
222
222
|
as: asPassiveItem ? "div" : Link,
|
|
223
|
-
href:
|
|
223
|
+
href: href,
|
|
224
224
|
icon: icon,
|
|
225
|
-
tabIndex: asPassiveItem ? -1 : 0,
|
|
226
225
|
variant: variant,
|
|
227
226
|
inFullscreenView: inFullscreenView
|
|
228
227
|
}), title), /*#__PURE__*/React.createElement(StyledSubmenu, {
|
|
@@ -31,12 +31,11 @@ const EditorLink = ({
|
|
|
31
31
|
|
|
32
32
|
}, [validUrl]);
|
|
33
33
|
return /*#__PURE__*/React.createElement(StyledLink, _extends({
|
|
34
|
-
href: validUrl,
|
|
34
|
+
href: !editMode ? validUrl : undefined,
|
|
35
35
|
title: validUrl,
|
|
36
|
-
"aria-label": validUrl,
|
|
36
|
+
"aria-label": !editMode ? validUrl : undefined,
|
|
37
37
|
target: "_blank",
|
|
38
|
-
rel: "noopener noreferrer"
|
|
39
|
-
tabbable: !editMode
|
|
38
|
+
rel: "noopener noreferrer"
|
|
40
39
|
}, rest), children);
|
|
41
40
|
};
|
|
42
41
|
|
|
@@ -15,8 +15,6 @@ export interface LinkProps extends React.AriaAttributes {
|
|
|
15
15
|
onKeyDown?: (ev: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
16
|
/** Function called when a mouse down event triggers. */
|
|
17
17
|
onMouseDown?: (ev: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
|
-
/** Whether to include the link in the tab order of the page */
|
|
19
|
-
tabbable?: boolean;
|
|
20
18
|
/** A message to display as a tooltip to the link. */
|
|
21
19
|
tooltipMessage?: string;
|
|
22
20
|
/** Positions the tooltip with the link. */
|
|
@@ -42,12 +42,10 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
42
42
|
rel,
|
|
43
43
|
tooltipMessage,
|
|
44
44
|
tooltipPosition,
|
|
45
|
-
tabbable = true,
|
|
46
45
|
target,
|
|
47
46
|
...rest
|
|
48
47
|
}, ref) => {
|
|
49
48
|
const l = (0, _useLocale.default)();
|
|
50
|
-
const tabIndex = tabbable && !disabled ? "0" : "-1";
|
|
51
49
|
|
|
52
50
|
const handleOnKeyDown = ev => {
|
|
53
51
|
if (onKeyDown) {
|
|
@@ -90,7 +88,6 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
90
88
|
onMouseDown,
|
|
91
89
|
onClick,
|
|
92
90
|
disabled,
|
|
93
|
-
tabIndex,
|
|
94
91
|
target,
|
|
95
92
|
ref,
|
|
96
93
|
href,
|
|
@@ -182,7 +179,6 @@ Link.propTypes = {
|
|
|
182
179
|
"onKeyDown": _propTypes.default.func,
|
|
183
180
|
"onMouseDown": _propTypes.default.func,
|
|
184
181
|
"rel": _propTypes.default.string,
|
|
185
|
-
"tabbable": _propTypes.default.bool,
|
|
186
182
|
"target": _propTypes.default.string,
|
|
187
183
|
"tooltipMessage": _propTypes.default.string,
|
|
188
184
|
"tooltipPosition": _propTypes.default.oneOf(["bottom", "left", "right", "top"])
|
|
@@ -247,9 +247,8 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
247
247
|
menuType: menuContext.menuType,
|
|
248
248
|
ref: ref,
|
|
249
249
|
as: asPassiveItem ? "div" : _link.default,
|
|
250
|
-
href:
|
|
250
|
+
href: href,
|
|
251
251
|
icon: icon,
|
|
252
|
-
tabIndex: asPassiveItem ? -1 : 0,
|
|
253
252
|
variant: variant,
|
|
254
253
|
inFullscreenView: inFullscreenView
|
|
255
254
|
}), title), /*#__PURE__*/_react.default.createElement(_submenu.StyledSubmenu, {
|
|
@@ -47,12 +47,11 @@ const EditorLink = ({
|
|
|
47
47
|
|
|
48
48
|
}, [validUrl]);
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_editorLink.default, _extends({
|
|
50
|
-
href: validUrl,
|
|
50
|
+
href: !editMode ? validUrl : undefined,
|
|
51
51
|
title: validUrl,
|
|
52
|
-
"aria-label": validUrl,
|
|
52
|
+
"aria-label": !editMode ? validUrl : undefined,
|
|
53
53
|
target: "_blank",
|
|
54
|
-
rel: "noopener noreferrer"
|
|
55
|
-
tabbable: !editMode
|
|
54
|
+
rel: "noopener noreferrer"
|
|
56
55
|
}, rest), children);
|
|
57
56
|
};
|
|
58
57
|
|