@instructure/ui-link 11.7.9-snapshot-0 → 11.7.9-snapshot-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/CHANGELOG.md +1 -1
- package/lib/Link/v1/index.js +14 -20
- package/lib/Link/v1/theme.js +3 -3
- package/lib/Link/v2/index.js +13 -18
- package/lib/Link/v2/styles.js +2 -2
- package/package.json +14 -14
- 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
|
-
## [11.7.9-snapshot-
|
|
6
|
+
## [11.7.9-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-link
|
|
9
9
|
|
package/lib/Link/v1/index.js
CHANGED
|
@@ -7,16 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.Link = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
15
|
-
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
16
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
17
|
-
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
18
|
-
var _combineDataCid = require("@instructure/ui-utils/lib/combineDataCid.js");
|
|
19
|
-
var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
|
|
10
|
+
var _uiA11yUtils = require("@instructure/ui-a11y-utils");
|
|
11
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
12
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
13
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
20
14
|
var _console = require("@instructure/console");
|
|
21
15
|
var _emotion = require("@instructure/emotion");
|
|
22
16
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
@@ -125,7 +119,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
125
119
|
get containsTruncateText() {
|
|
126
120
|
let truncateText = false;
|
|
127
121
|
_react.Children.forEach(this.props.children, child => {
|
|
128
|
-
if (child && (0,
|
|
122
|
+
if (child && (0, _uiReactUtils.matchComponentTypes)(child, ['TruncateText'])) {
|
|
129
123
|
truncateText = true;
|
|
130
124
|
}
|
|
131
125
|
});
|
|
@@ -148,22 +142,22 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
148
142
|
}
|
|
149
143
|
}
|
|
150
144
|
get interaction() {
|
|
151
|
-
return (0,
|
|
145
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
152
146
|
props: this.props,
|
|
153
147
|
interactionTypes: ['disabled']
|
|
154
148
|
});
|
|
155
149
|
}
|
|
156
150
|
get element() {
|
|
157
|
-
return (0,
|
|
151
|
+
return (0, _uiReactUtils.getElementType)(Link, this.props);
|
|
158
152
|
}
|
|
159
153
|
get focused() {
|
|
160
|
-
return (0,
|
|
154
|
+
return (0, _uiDomUtils.isActiveElement)(this.ref);
|
|
161
155
|
}
|
|
162
156
|
get focusable() {
|
|
163
|
-
return (0,
|
|
157
|
+
return (0, _uiDomUtils.findFocusable)(this.ref);
|
|
164
158
|
}
|
|
165
159
|
get hasVisibleChildren() {
|
|
166
|
-
return (0,
|
|
160
|
+
return (0, _uiA11yUtils.hasVisibleChildren)(this.props.children);
|
|
167
161
|
}
|
|
168
162
|
get role() {
|
|
169
163
|
const {
|
|
@@ -185,7 +179,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
185
179
|
this.props.display === undefined, '[Link] Using the display property with an icon may cause layout issues.');
|
|
186
180
|
return (0, _jsxRuntime.jsx)("span", {
|
|
187
181
|
css: this.props.styles?.icon,
|
|
188
|
-
children: (0,
|
|
182
|
+
children: (0, _uiReactUtils.callRenderProp)(this.props.renderIcon)
|
|
189
183
|
});
|
|
190
184
|
}
|
|
191
185
|
render() {
|
|
@@ -204,7 +198,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
204
198
|
const {
|
|
205
199
|
href,
|
|
206
200
|
rel
|
|
207
|
-
} = (0,
|
|
201
|
+
} = (0, _uiUtils.safeLinkProps)({
|
|
208
202
|
attr: 'href',
|
|
209
203
|
tag: typeof this.element === 'string' ? this.element : 'a',
|
|
210
204
|
href: rawHref,
|
|
@@ -218,7 +212,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
218
212
|
const type = this.element === 'button' || this.element === 'input' ? 'button' : undefined;
|
|
219
213
|
const tabIndex = this.role === 'button' && !isDisabled ? 0 : undefined;
|
|
220
214
|
return (0, _jsxRuntime.jsxs)(_v11_.View, {
|
|
221
|
-
...(0,
|
|
215
|
+
...(0, _uiReactUtils.passthroughProps)(props),
|
|
222
216
|
elementRef: this.handleElementRef,
|
|
223
217
|
as: this.element,
|
|
224
218
|
display: this.display,
|
|
@@ -234,7 +228,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
234
228
|
type: type,
|
|
235
229
|
tabIndex: tabIndex,
|
|
236
230
|
css: this.props.styles?.link,
|
|
237
|
-
"data-cid": (0,
|
|
231
|
+
"data-cid": (0, _uiUtils.combineDataCid)('Link', this.props),
|
|
238
232
|
children: [renderIcon && iconPlacement === 'start' ? this.renderIcon() : null, children, renderIcon && iconPlacement === 'end' ? this.renderIcon() : null]
|
|
239
233
|
});
|
|
240
234
|
}
|
package/lib/Link/v1/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
|
*
|
|
@@ -49,7 +49,7 @@ const generateComponentTheme = theme => {
|
|
|
49
49
|
canvas: {
|
|
50
50
|
color: theme['ic-link-color'],
|
|
51
51
|
focusOutlineColor: theme['ic-brand-primary'],
|
|
52
|
-
hoverColor: (0,
|
|
52
|
+
hoverColor: (0, _uiColorUtils.darken)(theme['ic-link-color'], 10)
|
|
53
53
|
},
|
|
54
54
|
'canvas-high-contrast': {
|
|
55
55
|
textDecorationOutsideText: 'underline',
|
|
@@ -73,7 +73,7 @@ const generateComponentTheme = theme => {
|
|
|
73
73
|
focusOutlineColor: colors?.contrasts?.blue4570,
|
|
74
74
|
focusOutlineStyle: borders?.style,
|
|
75
75
|
focusOutlineBorderRadius: borders?.radiusSmall,
|
|
76
|
-
hoverColor: (0,
|
|
76
|
+
hoverColor: (0, _uiColorUtils.darken)(colors?.contrasts?.blue5782, 10),
|
|
77
77
|
colorInverse: colors?.contrasts?.grey1111,
|
|
78
78
|
focusInverseOutlineColor: colors?.contrasts?.white1010,
|
|
79
79
|
focusInverseIconOutlineColor: colors?.contrasts?.white1010,
|
package/lib/Link/v2/index.js
CHANGED
|
@@ -7,16 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.Link = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _latest = require("@instructure/ui-view/latest");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
|
|
14
|
-
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
15
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
16
|
-
var _combineDataCid = require("@instructure/ui-utils/lib/combineDataCid.js");
|
|
17
|
-
var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
12
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
18
13
|
var _console = require("@instructure/console");
|
|
19
|
-
var
|
|
14
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
20
15
|
var _emotion = require("@instructure/emotion");
|
|
21
16
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
22
17
|
var _props = require("./props.js");
|
|
@@ -113,7 +108,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
113
108
|
get containsTruncateText() {
|
|
114
109
|
let truncateText = false;
|
|
115
110
|
_react.Children.forEach(this.props.children, child => {
|
|
116
|
-
if (child && (0,
|
|
111
|
+
if (child && (0, _uiReactUtils.matchComponentTypes)(child, ['TruncateText'])) {
|
|
117
112
|
truncateText = true;
|
|
118
113
|
}
|
|
119
114
|
});
|
|
@@ -136,19 +131,19 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
get interaction() {
|
|
139
|
-
return (0,
|
|
134
|
+
return (0, _uiReactUtils.getInteraction)({
|
|
140
135
|
props: this.props,
|
|
141
136
|
interactionTypes: ['disabled']
|
|
142
137
|
});
|
|
143
138
|
}
|
|
144
139
|
get element() {
|
|
145
|
-
return (0,
|
|
140
|
+
return (0, _uiReactUtils.getElementType)(Link, this.props);
|
|
146
141
|
}
|
|
147
142
|
get focused() {
|
|
148
|
-
return (0,
|
|
143
|
+
return (0, _uiDomUtils.isActiveElement)(this.ref);
|
|
149
144
|
}
|
|
150
145
|
get focusable() {
|
|
151
|
-
return (0,
|
|
146
|
+
return (0, _uiDomUtils.findFocusable)(this.ref);
|
|
152
147
|
}
|
|
153
148
|
get role() {
|
|
154
149
|
const {
|
|
@@ -188,7 +183,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
188
183
|
const iconSize = linkSizeToIconSize[size || 'medium'];
|
|
189
184
|
return (0, _jsxRuntime.jsx)("span", {
|
|
190
185
|
css: this.props.styles?.icon,
|
|
191
|
-
children: (0,
|
|
186
|
+
children: (0, _uiIcons.renderIconWithProps)(renderIcon, iconSize, undefined)
|
|
192
187
|
});
|
|
193
188
|
}
|
|
194
189
|
render() {
|
|
@@ -206,7 +201,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
206
201
|
const {
|
|
207
202
|
href,
|
|
208
203
|
rel
|
|
209
|
-
} = (0,
|
|
204
|
+
} = (0, _uiUtils.safeLinkProps)({
|
|
210
205
|
attr: 'href',
|
|
211
206
|
tag: typeof this.element === 'string' ? this.element : 'a',
|
|
212
207
|
href: rawHref,
|
|
@@ -220,7 +215,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
220
215
|
const type = this.element === 'button' || this.element === 'input' ? 'button' : undefined;
|
|
221
216
|
const tabIndex = this.role === 'button' && !isDisabled ? 0 : undefined;
|
|
222
217
|
return (0, _jsxRuntime.jsxs)(_latest.View, {
|
|
223
|
-
...(0,
|
|
218
|
+
...(0, _uiReactUtils.passthroughProps)(props),
|
|
224
219
|
elementRef: this.handleElementRef,
|
|
225
220
|
as: this.element,
|
|
226
221
|
display: this.display,
|
|
@@ -236,7 +231,7 @@ let Link = exports.Link = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
236
231
|
type: type,
|
|
237
232
|
tabIndex: tabIndex,
|
|
238
233
|
css: this.props.styles?.link,
|
|
239
|
-
"data-cid": (0,
|
|
234
|
+
"data-cid": (0, _uiUtils.combineDataCid)('Link', this.props),
|
|
240
235
|
children: [renderIcon && iconPlacement === 'start' ? this.renderIcon() : null, children, renderIcon && iconPlacement === 'end' ? this.renderIcon() : null]
|
|
241
236
|
});
|
|
242
237
|
}
|
package/lib/Link/v2/styles.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 _uiA11yUtils = require("@instructure/ui-a11y-utils");
|
|
8
8
|
var _emotion = require("@instructure/emotion");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -51,7 +51,7 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
51
51
|
children
|
|
52
52
|
} = props;
|
|
53
53
|
const size = !props.size && (variant === 'inline' || variant === 'standalone') ? 'medium' : props.size;
|
|
54
|
-
const hasVisibleContent = (0,
|
|
54
|
+
const hasVisibleContent = (0, _uiA11yUtils.hasVisibleChildren)(children);
|
|
55
55
|
const isInverseStyle = color === 'link-inverse';
|
|
56
56
|
const inlineLinkSizeStyles = {
|
|
57
57
|
small: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "11.7.9-snapshot-
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/console": "11.7.9-snapshot-
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/ui-a11y-utils": "11.7.9-snapshot-
|
|
21
|
-
"@instructure/ui-color-utils": "11.7.9-snapshot-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/ui-view": "11.7.9-snapshot-
|
|
28
|
-
"@instructure/ui-utils": "11.7.9-snapshot-
|
|
18
|
+
"@instructure/console": "11.7.9-snapshot-1",
|
|
19
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
20
|
+
"@instructure/ui-a11y-utils": "11.7.9-snapshot-1",
|
|
21
|
+
"@instructure/ui-color-utils": "11.7.9-snapshot-1",
|
|
22
|
+
"@instructure/emotion": "11.7.9-snapshot-1",
|
|
23
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1",
|
|
24
|
+
"@instructure/ui-icons": "11.7.9-snapshot-1",
|
|
25
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-1",
|
|
26
|
+
"@instructure/ui-themes": "11.7.9-snapshot-1",
|
|
27
|
+
"@instructure/ui-view": "11.7.9-snapshot-1",
|
|
28
|
+
"@instructure/ui-utils": "11.7.9-snapshot-1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"vitest": "^5.0.0",
|
|
32
|
-
"@instructure/ui-axe-check": "11.7.9-snapshot-
|
|
33
|
-
"@instructure/ui-babel-preset": "11.7.9-snapshot-
|
|
32
|
+
"@instructure/ui-axe-check": "11.7.9-snapshot-1",
|
|
33
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18 <=19"
|