@instructure/ui-link 8.56.2-pr-snapshot-1721749364069 → 8.56.2
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 +1 -1
- package/lib/Link/LinkLocator.js +2 -2
- package/lib/Link/__examples__/Link.examples.js +2 -2
- package/lib/Link/index.js +19 -14
- package/lib/Link/theme.js +3 -3
- package/package.json +17 -17
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.2
|
|
6
|
+
## [8.56.2](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2) (2024-08-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-link
|
|
9
9
|
|
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 _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
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, _locator.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 _IconTrashSolid = require("@instructure/ui-icons/lib/IconTrashSolid.js");
|
|
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, _IconTrashSolid.IconTrashSolid]
|
|
40
40
|
},
|
|
41
41
|
getComponentProps: () => {
|
|
42
42
|
return {
|
package/lib/Link/index.js
CHANGED
|
@@ -8,12 +8,17 @@ 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
|
|
11
|
+
var _View = require("@instructure/ui-view/lib/View");
|
|
12
|
+
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
13
|
+
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
14
|
+
var _findFocusable = require("@instructure/ui-dom-utils/lib/findFocusable.js");
|
|
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");
|
|
15
20
|
var _console = require("@instructure/console");
|
|
16
|
-
var
|
|
21
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
17
22
|
var _emotion = require("@instructure/emotion");
|
|
18
23
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
19
24
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -49,7 +54,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
49
54
|
category: components
|
|
50
55
|
---
|
|
51
56
|
**/
|
|
52
|
-
let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
57
|
+
let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Link extends _react.Component {
|
|
53
58
|
constructor(...args) {
|
|
54
59
|
super(...args);
|
|
55
60
|
this.state = {
|
|
@@ -110,7 +115,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
110
115
|
get containsTruncateText() {
|
|
111
116
|
let truncateText = false;
|
|
112
117
|
_react.default.Children.forEach(this.props.children, child => {
|
|
113
|
-
if (child && (0,
|
|
118
|
+
if (child && (0, _matchComponentTypes.matchComponentTypes)(child, ['TruncateText'])) {
|
|
114
119
|
truncateText = true;
|
|
115
120
|
}
|
|
116
121
|
});
|
|
@@ -132,22 +137,22 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
get interaction() {
|
|
135
|
-
return (0,
|
|
140
|
+
return (0, _getInteraction.getInteraction)({
|
|
136
141
|
props: this.props,
|
|
137
142
|
interactionTypes: ['disabled']
|
|
138
143
|
});
|
|
139
144
|
}
|
|
140
145
|
get element() {
|
|
141
|
-
return (0,
|
|
146
|
+
return (0, _getElementType.getElementType)(Link, this.props);
|
|
142
147
|
}
|
|
143
148
|
get focused() {
|
|
144
|
-
return (0,
|
|
149
|
+
return (0, _isActiveElement.isActiveElement)(this.ref);
|
|
145
150
|
}
|
|
146
151
|
get focusable() {
|
|
147
|
-
return (0,
|
|
152
|
+
return (0, _findFocusable.findFocusable)(this.ref);
|
|
148
153
|
}
|
|
149
154
|
get hasVisibleChildren() {
|
|
150
|
-
return (0,
|
|
155
|
+
return (0, _hasVisibleChildren.hasVisibleChildren)(this.props.children);
|
|
151
156
|
}
|
|
152
157
|
get role() {
|
|
153
158
|
const _this$props3 = this.props,
|
|
@@ -169,7 +174,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
169
174
|
this.props.display === void 0, '[Link] Using the display property with an icon may cause layout issues.');
|
|
170
175
|
return (0, _emotion.jsx)("span", {
|
|
171
176
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
|
|
172
|
-
}, (0,
|
|
177
|
+
}, (0, _callRenderProp.callRenderProp)(this.props.renderIcon));
|
|
173
178
|
}
|
|
174
179
|
render() {
|
|
175
180
|
var _this$props$styles2;
|
|
@@ -188,7 +193,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
188
193
|
const isDisabled = interaction === 'disabled';
|
|
189
194
|
const type = this.element === 'button' || this.element === 'input' ? 'button' : void 0;
|
|
190
195
|
const tabIndex = this.role === 'button' && !isDisabled ? 0 : void 0;
|
|
191
|
-
return (0, _emotion.jsx)(
|
|
196
|
+
return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
|
|
192
197
|
elementRef: this.handleElementRef,
|
|
193
198
|
as: this.element,
|
|
194
199
|
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 _darken = require("@instructure/ui-color-utils/lib/darken.js");
|
|
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, _darken.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, _darken.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.2
|
|
3
|
+
"version": "8.56.2",
|
|
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.2
|
|
28
|
-
"@instructure/emotion": "8.56.2
|
|
29
|
-
"@instructure/shared-types": "8.56.2
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.56.2
|
|
31
|
-
"@instructure/ui-color-utils": "8.56.2
|
|
32
|
-
"@instructure/ui-dom-utils": "8.56.2
|
|
33
|
-
"@instructure/ui-icons": "8.56.2
|
|
34
|
-
"@instructure/ui-prop-types": "8.56.2
|
|
35
|
-
"@instructure/ui-react-utils": "8.56.2
|
|
36
|
-
"@instructure/ui-testable": "8.56.2
|
|
37
|
-
"@instructure/ui-view": "8.56.2
|
|
27
|
+
"@instructure/console": "8.56.2",
|
|
28
|
+
"@instructure/emotion": "8.56.2",
|
|
29
|
+
"@instructure/shared-types": "8.56.2",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.56.2",
|
|
31
|
+
"@instructure/ui-color-utils": "8.56.2",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.56.2",
|
|
33
|
+
"@instructure/ui-icons": "8.56.2",
|
|
34
|
+
"@instructure/ui-prop-types": "8.56.2",
|
|
35
|
+
"@instructure/ui-react-utils": "8.56.2",
|
|
36
|
+
"@instructure/ui-testable": "8.56.2",
|
|
37
|
+
"@instructure/ui-view": "8.56.2",
|
|
38
38
|
"prop-types": "^15.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-babel-preset": "8.56.2
|
|
42
|
-
"@instructure/ui-test-locator": "8.56.2
|
|
43
|
-
"@instructure/ui-test-queries": "8.56.2
|
|
44
|
-
"@instructure/ui-test-utils": "8.56.2
|
|
45
|
-
"@instructure/ui-themes": "8.56.2
|
|
41
|
+
"@instructure/ui-babel-preset": "8.56.2",
|
|
42
|
+
"@instructure/ui-test-locator": "8.56.2",
|
|
43
|
+
"@instructure/ui-test-queries": "8.56.2",
|
|
44
|
+
"@instructure/ui-test-utils": "8.56.2",
|
|
45
|
+
"@instructure/ui-themes": "8.56.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=18"
|