@instructure/ui-link 8.56.4 → 8.56.5-pr-snapshot-1728655013879
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/CHANGELOG.md +8 -0
- package/lib/Link/LinkLocator.js +2 -2
- package/lib/Link/__examples__/Link.examples.js +2 -2
- package/lib/Link/index.js +14 -19
- package/lib/Link/theme.js +3 -3
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.56.5-pr-snapshot-1728655013879](https://github.com/instructure/instructure-ui/compare/v8.56.4...v8.56.5-pr-snapshot-1728655013879) (2024-10-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-link
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [8.56.4](https://github.com/instructure/instructure-ui/compare/v8.56.3...v8.56.4) (2024-10-02)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-link
|
package/lib/Link/LinkLocator.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.LinkLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiTestLocator = require("@instructure/ui-test-locator");
|
|
8
8
|
var _uiTestQueries = require("@instructure/ui-test-queries");
|
|
9
9
|
var _index = require("./index");
|
|
10
10
|
/*
|
|
@@ -32,7 +32,7 @@ var _index = require("./index");
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
|
-
const LinkLocator = exports.LinkLocator = (0,
|
|
35
|
+
const LinkLocator = exports.LinkLocator = (0, _uiTestLocator.locator)(_index.Link.selector, {
|
|
36
36
|
click: async (element, ...args) => {
|
|
37
37
|
return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
|
|
38
38
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -36,7 +36,7 @@ var _default = exports.default = {
|
|
|
36
36
|
propValues: {
|
|
37
37
|
children: [shortString, longString],
|
|
38
38
|
iconPlacement: [null, 'start', 'end'],
|
|
39
|
-
renderIcon: [null,
|
|
39
|
+
renderIcon: [null, _uiIcons.IconTrashSolid]
|
|
40
40
|
},
|
|
41
41
|
getComponentProps: () => {
|
|
42
42
|
return {
|
package/lib/Link/index.js
CHANGED
|
@@ -8,17 +8,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.Link = void 0;
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
16
|
-
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
17
|
-
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
18
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
19
|
-
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
11
|
+
var _uiView = require("@instructure/ui-view");
|
|
12
|
+
var _uiA11yUtils = require("@instructure/ui-a11y-utils");
|
|
13
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
14
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
20
15
|
var _console = require("@instructure/console");
|
|
21
|
-
var
|
|
16
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
22
17
|
var _emotion = require("@instructure/emotion");
|
|
23
18
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
24
19
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -54,7 +49,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
54
49
|
category: components
|
|
55
50
|
---
|
|
56
51
|
**/
|
|
57
|
-
let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
52
|
+
let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Link extends _react.Component {
|
|
58
53
|
constructor(...args) {
|
|
59
54
|
super(...args);
|
|
60
55
|
this.state = {
|
|
@@ -115,7 +110,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
115
110
|
get containsTruncateText() {
|
|
116
111
|
let truncateText = false;
|
|
117
112
|
_react.default.Children.forEach(this.props.children, child => {
|
|
118
|
-
if (child && (0,
|
|
113
|
+
if (child && (0, _uiReactUtils.matchComponentTypes)(child, ['TruncateText'])) {
|
|
119
114
|
truncateText = true;
|
|
120
115
|
}
|
|
121
116
|
});
|
|
@@ -137,22 +132,22 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
134
|
get interaction() {
|
|
140
|
-
return (0,
|
|
135
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
141
136
|
props: this.props,
|
|
142
137
|
interactionTypes: ['disabled']
|
|
143
138
|
});
|
|
144
139
|
}
|
|
145
140
|
get element() {
|
|
146
|
-
return (0,
|
|
141
|
+
return (0, _uiReactUtils.getElementType)(Link, this.props);
|
|
147
142
|
}
|
|
148
143
|
get focused() {
|
|
149
|
-
return (0,
|
|
144
|
+
return (0, _uiDomUtils.isActiveElement)(this.ref);
|
|
150
145
|
}
|
|
151
146
|
get focusable() {
|
|
152
|
-
return (0,
|
|
147
|
+
return (0, _uiDomUtils.findFocusable)(this.ref);
|
|
153
148
|
}
|
|
154
149
|
get hasVisibleChildren() {
|
|
155
|
-
return (0,
|
|
150
|
+
return (0, _uiA11yUtils.hasVisibleChildren)(this.props.children);
|
|
156
151
|
}
|
|
157
152
|
get role() {
|
|
158
153
|
const _this$props3 = this.props,
|
|
@@ -174,7 +169,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
174
169
|
this.props.display === void 0, '[Link] Using the display property with an icon may cause layout issues.');
|
|
175
170
|
return (0, _emotion.jsx)("span", {
|
|
176
171
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
|
|
177
|
-
}, (0,
|
|
172
|
+
}, (0, _uiReactUtils.callRenderProp)(this.props.renderIcon));
|
|
178
173
|
}
|
|
179
174
|
render() {
|
|
180
175
|
var _this$props$styles2;
|
|
@@ -193,7 +188,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
193
188
|
const isDisabled = interaction === 'disabled';
|
|
194
189
|
const type = this.element === 'button' || this.element === 'input' ? 'button' : void 0;
|
|
195
190
|
const tabIndex = this.role === 'button' && !isDisabled ? 0 : void 0;
|
|
196
|
-
return (0, _emotion.jsx)(
|
|
191
|
+
return (0, _emotion.jsx)(_uiView.View, Object.assign({}, (0, _uiReactUtils.passthroughProps)(props), {
|
|
197
192
|
elementRef: this.handleElementRef,
|
|
198
193
|
as: this.element,
|
|
199
194
|
display: this.display,
|
package/lib/Link/theme.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiColorUtils = require("@instructure/ui-color-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -47,7 +47,7 @@ const generateComponentTheme = theme => {
|
|
|
47
47
|
canvas: {
|
|
48
48
|
color: theme['ic-link-color'],
|
|
49
49
|
focusOutlineColor: theme['ic-brand-primary'],
|
|
50
|
-
hoverColor: (0,
|
|
50
|
+
hoverColor: (0, _uiColorUtils.darken)(theme['ic-link-color'], 10)
|
|
51
51
|
},
|
|
52
52
|
'canvas-high-contrast': {
|
|
53
53
|
textDecorationOutsideText: 'underline',
|
|
@@ -68,7 +68,7 @@ const generateComponentTheme = theme => {
|
|
|
68
68
|
focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
|
69
69
|
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
|
70
70
|
focusOutlineBorderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusSmall,
|
|
71
|
-
hoverColor: (0,
|
|
71
|
+
hoverColor: (0, _uiColorUtils.darken)(colors === null || colors === void 0 ? void 0 : colors.textLink, 10),
|
|
72
72
|
colorInverse: colors === null || colors === void 0 ? void 0 : colors.textLight,
|
|
73
73
|
focusInverseOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderLightest,
|
|
74
74
|
focusInverseIconOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderLightest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.5-pr-snapshot-1728655013879",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/console": "8.56.
|
|
28
|
-
"@instructure/emotion": "8.56.
|
|
29
|
-
"@instructure/shared-types": "8.56.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.56.
|
|
31
|
-
"@instructure/ui-color-utils": "8.56.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.56.
|
|
33
|
-
"@instructure/ui-icons": "8.56.
|
|
34
|
-
"@instructure/ui-prop-types": "8.56.
|
|
35
|
-
"@instructure/ui-react-utils": "8.56.
|
|
36
|
-
"@instructure/ui-testable": "8.56.
|
|
37
|
-
"@instructure/ui-view": "8.56.
|
|
27
|
+
"@instructure/console": "8.56.5-pr-snapshot-1728655013879",
|
|
28
|
+
"@instructure/emotion": "8.56.5-pr-snapshot-1728655013879",
|
|
29
|
+
"@instructure/shared-types": "8.56.5-pr-snapshot-1728655013879",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
31
|
+
"@instructure/ui-color-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
33
|
+
"@instructure/ui-icons": "8.56.5-pr-snapshot-1728655013879",
|
|
34
|
+
"@instructure/ui-prop-types": "8.56.5-pr-snapshot-1728655013879",
|
|
35
|
+
"@instructure/ui-react-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
36
|
+
"@instructure/ui-testable": "8.56.5-pr-snapshot-1728655013879",
|
|
37
|
+
"@instructure/ui-view": "8.56.5-pr-snapshot-1728655013879",
|
|
38
38
|
"prop-types": "^15.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
42
|
-
"@instructure/ui-test-locator": "8.56.
|
|
43
|
-
"@instructure/ui-test-queries": "8.56.
|
|
44
|
-
"@instructure/ui-test-utils": "8.56.
|
|
45
|
-
"@instructure/ui-themes": "8.56.
|
|
41
|
+
"@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1728655013879",
|
|
42
|
+
"@instructure/ui-test-locator": "8.56.5-pr-snapshot-1728655013879",
|
|
43
|
+
"@instructure/ui-test-queries": "8.56.5-pr-snapshot-1728655013879",
|
|
44
|
+
"@instructure/ui-test-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
45
|
+
"@instructure/ui-themes": "8.56.5-pr-snapshot-1728655013879"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=18"
|