@instructure/ui-link 10.2.3-snapshot-14 → 10.2.3-snapshot-15
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
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
|
-
## [10.2.3-snapshot-
|
|
6
|
+
## [10.2.3-snapshot-15](https://github.com/instructure/instructure-ui/compare/v10.2.2...v10.2.3-snapshot-15) (2024-10-03)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-link
|
|
9
9
|
|
|
@@ -56,7 +56,7 @@ describe('<Link />', () => {
|
|
|
56
56
|
});
|
|
57
57
|
it('should render a button', async () => {
|
|
58
58
|
const onClick = vi.fn();
|
|
59
|
-
render(
|
|
59
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
60
60
|
onClick: onClick
|
|
61
61
|
}, "Hello World"));
|
|
62
62
|
const button = screen.getByRole('button');
|
|
@@ -72,7 +72,7 @@ describe('<Link />', () => {
|
|
|
72
72
|
});
|
|
73
73
|
it('should focus with the focus helper', async () => {
|
|
74
74
|
let linkRef;
|
|
75
|
-
render(
|
|
75
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
76
76
|
href: "https://instructure.design",
|
|
77
77
|
elementRef: el => {
|
|
78
78
|
linkRef = el;
|
|
@@ -98,7 +98,7 @@ describe('<Link />', () => {
|
|
|
98
98
|
cy: "50",
|
|
99
99
|
r: "40"
|
|
100
100
|
})));
|
|
101
|
-
render(
|
|
101
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
102
102
|
href: "example.html",
|
|
103
103
|
renderIcon: customIcon
|
|
104
104
|
}, _TruncateText2 || (_TruncateText2 = /*#__PURE__*/React.createElement(TruncateText, null, "Hello World"))));
|
|
@@ -107,7 +107,7 @@ describe('<Link />', () => {
|
|
|
107
107
|
});
|
|
108
108
|
it('should call the onClick prop when clicked', async () => {
|
|
109
109
|
const onClick = vi.fn();
|
|
110
|
-
render(
|
|
110
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
111
111
|
onClick: onClick
|
|
112
112
|
}, "Hello World"));
|
|
113
113
|
const link = screen.getByRole('button');
|
|
@@ -118,7 +118,7 @@ describe('<Link />', () => {
|
|
|
118
118
|
});
|
|
119
119
|
it('should call the onMouseEnter prop when mouseEntered', async () => {
|
|
120
120
|
const onMouseEnter = vi.fn();
|
|
121
|
-
const _render2 = render(
|
|
121
|
+
const _render2 = render(/*#__PURE__*/React.createElement(Link, {
|
|
122
122
|
onMouseEnter: onMouseEnter
|
|
123
123
|
}, "Hello World")),
|
|
124
124
|
container = _render2.container;
|
|
@@ -138,7 +138,7 @@ describe('<Link />', () => {
|
|
|
138
138
|
cy: "50",
|
|
139
139
|
r: "40"
|
|
140
140
|
})));
|
|
141
|
-
render(
|
|
141
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
142
142
|
href: "https://instructure.design",
|
|
143
143
|
renderIcon: customIcon
|
|
144
144
|
}, "Hello World"));
|
|
@@ -167,7 +167,7 @@ describe('<Link />', () => {
|
|
|
167
167
|
});
|
|
168
168
|
it('should not be clickable when interaction is disabled', async () => {
|
|
169
169
|
const onClick = vi.fn();
|
|
170
|
-
render(
|
|
170
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
171
171
|
onClick: onClick,
|
|
172
172
|
interaction: "disabled"
|
|
173
173
|
}, "Hello World"));
|
|
@@ -176,7 +176,7 @@ describe('<Link />', () => {
|
|
|
176
176
|
});
|
|
177
177
|
it('should not be clickable when `disabled` is set', async () => {
|
|
178
178
|
const onClick = vi.fn();
|
|
179
|
-
render(
|
|
179
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
180
180
|
onClick: onClick,
|
|
181
181
|
disabled: true
|
|
182
182
|
}, "Hello World"));
|
|
@@ -188,7 +188,7 @@ describe('with `as` prop', () => {
|
|
|
188
188
|
describe('with `onClick`', () => {
|
|
189
189
|
it('should render designated tag', async () => {
|
|
190
190
|
const onClick = vi.fn();
|
|
191
|
-
render(
|
|
191
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
192
192
|
as: "a",
|
|
193
193
|
onClick: onClick
|
|
194
194
|
}, "Hello World"));
|
|
@@ -197,7 +197,7 @@ describe('with `as` prop', () => {
|
|
|
197
197
|
});
|
|
198
198
|
it('should set role="button"', async () => {
|
|
199
199
|
const onClick = vi.fn();
|
|
200
|
-
render(
|
|
200
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
201
201
|
as: "span",
|
|
202
202
|
onClick: onClick
|
|
203
203
|
}, "Hello World"));
|
|
@@ -208,7 +208,7 @@ describe('with `as` prop', () => {
|
|
|
208
208
|
describe('should not set type="button", unless it is actually a button', () => {
|
|
209
209
|
it('should not set type="button" on other things like <span>s', async () => {
|
|
210
210
|
const onClick = vi.fn();
|
|
211
|
-
render(
|
|
211
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
212
212
|
as: "span",
|
|
213
213
|
onClick: onClick
|
|
214
214
|
}, "Hello World"));
|
|
@@ -217,7 +217,7 @@ describe('with `as` prop', () => {
|
|
|
217
217
|
});
|
|
218
218
|
it('should set type="button" on <button>s', async () => {
|
|
219
219
|
const onClick = vi.fn();
|
|
220
|
-
render(
|
|
220
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
221
221
|
as: "button",
|
|
222
222
|
onClick: onClick
|
|
223
223
|
}, "Hello World"));
|
|
@@ -226,7 +226,7 @@ describe('with `as` prop', () => {
|
|
|
226
226
|
});
|
|
227
227
|
it('should set tabIndex="0"', async () => {
|
|
228
228
|
const onClick = vi.fn();
|
|
229
|
-
render(
|
|
229
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
230
230
|
as: "span",
|
|
231
231
|
onClick: onClick
|
|
232
232
|
}, "Hello World"));
|
|
@@ -305,7 +305,7 @@ describe('with `as` prop', () => {
|
|
|
305
305
|
});
|
|
306
306
|
it('should not override button role when it is forced by default', async () => {
|
|
307
307
|
const onClick = vi.fn();
|
|
308
|
-
render(
|
|
308
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
309
309
|
role: "link",
|
|
310
310
|
onClick: onClick,
|
|
311
311
|
as: "a"
|
|
@@ -317,7 +317,7 @@ describe('with `as` prop', () => {
|
|
|
317
317
|
describe('when a `forceButtonRole` is set to false', () => {
|
|
318
318
|
it('should not force button role', async () => {
|
|
319
319
|
const onClick = vi.fn();
|
|
320
|
-
render(
|
|
320
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
321
321
|
onClick: onClick,
|
|
322
322
|
as: "a",
|
|
323
323
|
forceButtonRole: false
|
|
@@ -327,7 +327,7 @@ describe('with `as` prop', () => {
|
|
|
327
327
|
});
|
|
328
328
|
it('should override button role with `role` prop', async () => {
|
|
329
329
|
const onClick = vi.fn();
|
|
330
|
-
render(
|
|
330
|
+
render(/*#__PURE__*/React.createElement(Link, {
|
|
331
331
|
role: "link",
|
|
332
332
|
onClick: onClick,
|
|
333
333
|
as: "a",
|
|
@@ -57,7 +57,7 @@ describe('<Link />', () => {
|
|
|
57
57
|
});
|
|
58
58
|
it('should render a button', async () => {
|
|
59
59
|
const onClick = _vitest.vi.fn();
|
|
60
|
-
(0, _react2.render)(
|
|
60
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
61
61
|
onClick: onClick
|
|
62
62
|
}, "Hello World"));
|
|
63
63
|
const button = _react2.screen.getByRole('button');
|
|
@@ -73,7 +73,7 @@ describe('<Link />', () => {
|
|
|
73
73
|
});
|
|
74
74
|
it('should focus with the focus helper', async () => {
|
|
75
75
|
let linkRef;
|
|
76
|
-
(0, _react2.render)(
|
|
76
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
77
77
|
href: "https://instructure.design",
|
|
78
78
|
elementRef: el => {
|
|
79
79
|
linkRef = el;
|
|
@@ -99,7 +99,7 @@ describe('<Link />', () => {
|
|
|
99
99
|
cy: "50",
|
|
100
100
|
r: "40"
|
|
101
101
|
})));
|
|
102
|
-
(0, _react2.render)(
|
|
102
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
103
103
|
href: "example.html",
|
|
104
104
|
renderIcon: customIcon
|
|
105
105
|
}, _TruncateText2 || (_TruncateText2 = /*#__PURE__*/_react.default.createElement(TruncateText, null, "Hello World"))));
|
|
@@ -108,7 +108,7 @@ describe('<Link />', () => {
|
|
|
108
108
|
});
|
|
109
109
|
it('should call the onClick prop when clicked', async () => {
|
|
110
110
|
const onClick = _vitest.vi.fn();
|
|
111
|
-
(0, _react2.render)(
|
|
111
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
112
112
|
onClick: onClick
|
|
113
113
|
}, "Hello World"));
|
|
114
114
|
const link = _react2.screen.getByRole('button');
|
|
@@ -119,7 +119,7 @@ describe('<Link />', () => {
|
|
|
119
119
|
});
|
|
120
120
|
it('should call the onMouseEnter prop when mouseEntered', async () => {
|
|
121
121
|
const onMouseEnter = _vitest.vi.fn();
|
|
122
|
-
const _render2 = (0, _react2.render)(
|
|
122
|
+
const _render2 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
123
123
|
onMouseEnter: onMouseEnter
|
|
124
124
|
}, "Hello World")),
|
|
125
125
|
container = _render2.container;
|
|
@@ -139,7 +139,7 @@ describe('<Link />', () => {
|
|
|
139
139
|
cy: "50",
|
|
140
140
|
r: "40"
|
|
141
141
|
})));
|
|
142
|
-
(0, _react2.render)(
|
|
142
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
143
143
|
href: "https://instructure.design",
|
|
144
144
|
renderIcon: customIcon
|
|
145
145
|
}, "Hello World"));
|
|
@@ -168,7 +168,7 @@ describe('<Link />', () => {
|
|
|
168
168
|
});
|
|
169
169
|
it('should not be clickable when interaction is disabled', async () => {
|
|
170
170
|
const onClick = _vitest.vi.fn();
|
|
171
|
-
(0, _react2.render)(
|
|
171
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
172
172
|
onClick: onClick,
|
|
173
173
|
interaction: "disabled"
|
|
174
174
|
}, "Hello World"));
|
|
@@ -177,7 +177,7 @@ describe('<Link />', () => {
|
|
|
177
177
|
});
|
|
178
178
|
it('should not be clickable when `disabled` is set', async () => {
|
|
179
179
|
const onClick = _vitest.vi.fn();
|
|
180
|
-
(0, _react2.render)(
|
|
180
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
181
181
|
onClick: onClick,
|
|
182
182
|
disabled: true
|
|
183
183
|
}, "Hello World"));
|
|
@@ -189,7 +189,7 @@ describe('with `as` prop', () => {
|
|
|
189
189
|
describe('with `onClick`', () => {
|
|
190
190
|
it('should render designated tag', async () => {
|
|
191
191
|
const onClick = _vitest.vi.fn();
|
|
192
|
-
(0, _react2.render)(
|
|
192
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
193
193
|
as: "a",
|
|
194
194
|
onClick: onClick
|
|
195
195
|
}, "Hello World"));
|
|
@@ -198,7 +198,7 @@ describe('with `as` prop', () => {
|
|
|
198
198
|
});
|
|
199
199
|
it('should set role="button"', async () => {
|
|
200
200
|
const onClick = _vitest.vi.fn();
|
|
201
|
-
(0, _react2.render)(
|
|
201
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
202
202
|
as: "span",
|
|
203
203
|
onClick: onClick
|
|
204
204
|
}, "Hello World"));
|
|
@@ -209,7 +209,7 @@ describe('with `as` prop', () => {
|
|
|
209
209
|
describe('should not set type="button", unless it is actually a button', () => {
|
|
210
210
|
it('should not set type="button" on other things like <span>s', async () => {
|
|
211
211
|
const onClick = _vitest.vi.fn();
|
|
212
|
-
(0, _react2.render)(
|
|
212
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
213
213
|
as: "span",
|
|
214
214
|
onClick: onClick
|
|
215
215
|
}, "Hello World"));
|
|
@@ -218,7 +218,7 @@ describe('with `as` prop', () => {
|
|
|
218
218
|
});
|
|
219
219
|
it('should set type="button" on <button>s', async () => {
|
|
220
220
|
const onClick = _vitest.vi.fn();
|
|
221
|
-
(0, _react2.render)(
|
|
221
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
222
222
|
as: "button",
|
|
223
223
|
onClick: onClick
|
|
224
224
|
}, "Hello World"));
|
|
@@ -227,7 +227,7 @@ describe('with `as` prop', () => {
|
|
|
227
227
|
});
|
|
228
228
|
it('should set tabIndex="0"', async () => {
|
|
229
229
|
const onClick = _vitest.vi.fn();
|
|
230
|
-
(0, _react2.render)(
|
|
230
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
231
231
|
as: "span",
|
|
232
232
|
onClick: onClick
|
|
233
233
|
}, "Hello World"));
|
|
@@ -306,7 +306,7 @@ describe('with `as` prop', () => {
|
|
|
306
306
|
});
|
|
307
307
|
it('should not override button role when it is forced by default', async () => {
|
|
308
308
|
const onClick = _vitest.vi.fn();
|
|
309
|
-
(0, _react2.render)(
|
|
309
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
310
310
|
role: "link",
|
|
311
311
|
onClick: onClick,
|
|
312
312
|
as: "a"
|
|
@@ -318,7 +318,7 @@ describe('with `as` prop', () => {
|
|
|
318
318
|
describe('when a `forceButtonRole` is set to false', () => {
|
|
319
319
|
it('should not force button role', async () => {
|
|
320
320
|
const onClick = _vitest.vi.fn();
|
|
321
|
-
(0, _react2.render)(
|
|
321
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
322
322
|
onClick: onClick,
|
|
323
323
|
as: "a",
|
|
324
324
|
forceButtonRole: false
|
|
@@ -328,7 +328,7 @@ describe('with `as` prop', () => {
|
|
|
328
328
|
});
|
|
329
329
|
it('should override button role with `role` prop', async () => {
|
|
330
330
|
const onClick = _vitest.vi.fn();
|
|
331
|
-
(0, _react2.render)(
|
|
331
|
+
(0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Link, {
|
|
332
332
|
role: "link",
|
|
333
333
|
onClick: onClick,
|
|
334
334
|
as: "a",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "10.2.3-snapshot-
|
|
3
|
+
"version": "10.2.3-snapshot-15",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,29 +23,29 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "^7.
|
|
27
|
-
"@instructure/console": "10.2.3-snapshot-
|
|
28
|
-
"@instructure/emotion": "10.2.3-snapshot-
|
|
29
|
-
"@instructure/shared-types": "10.2.3-snapshot-
|
|
30
|
-
"@instructure/ui-a11y-utils": "10.2.3-snapshot-
|
|
31
|
-
"@instructure/ui-color-utils": "10.2.3-snapshot-
|
|
32
|
-
"@instructure/ui-dom-utils": "10.2.3-snapshot-
|
|
33
|
-
"@instructure/ui-icons": "10.2.3-snapshot-
|
|
34
|
-
"@instructure/ui-prop-types": "10.2.3-snapshot-
|
|
35
|
-
"@instructure/ui-react-utils": "10.2.3-snapshot-
|
|
36
|
-
"@instructure/ui-testable": "10.2.3-snapshot-
|
|
37
|
-
"@instructure/ui-view": "10.2.3-snapshot-
|
|
26
|
+
"@babel/runtime": "^7.25.6",
|
|
27
|
+
"@instructure/console": "10.2.3-snapshot-15",
|
|
28
|
+
"@instructure/emotion": "10.2.3-snapshot-15",
|
|
29
|
+
"@instructure/shared-types": "10.2.3-snapshot-15",
|
|
30
|
+
"@instructure/ui-a11y-utils": "10.2.3-snapshot-15",
|
|
31
|
+
"@instructure/ui-color-utils": "10.2.3-snapshot-15",
|
|
32
|
+
"@instructure/ui-dom-utils": "10.2.3-snapshot-15",
|
|
33
|
+
"@instructure/ui-icons": "10.2.3-snapshot-15",
|
|
34
|
+
"@instructure/ui-prop-types": "10.2.3-snapshot-15",
|
|
35
|
+
"@instructure/ui-react-utils": "10.2.3-snapshot-15",
|
|
36
|
+
"@instructure/ui-testable": "10.2.3-snapshot-15",
|
|
37
|
+
"@instructure/ui-view": "10.2.3-snapshot-15",
|
|
38
38
|
"prop-types": "^15.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-axe-check": "10.2.3-snapshot-
|
|
42
|
-
"@instructure/ui-babel-preset": "10.2.3-snapshot-
|
|
43
|
-
"@instructure/ui-test-utils": "10.2.3-snapshot-
|
|
44
|
-
"@instructure/ui-themes": "10.2.3-snapshot-
|
|
41
|
+
"@instructure/ui-axe-check": "10.2.3-snapshot-15",
|
|
42
|
+
"@instructure/ui-babel-preset": "10.2.3-snapshot-15",
|
|
43
|
+
"@instructure/ui-test-utils": "10.2.3-snapshot-15",
|
|
44
|
+
"@instructure/ui-themes": "10.2.3-snapshot-15",
|
|
45
45
|
"@testing-library/jest-dom": "^6.4.5",
|
|
46
|
-
"@testing-library/react": "^
|
|
46
|
+
"@testing-library/react": "^16.0.1",
|
|
47
47
|
"@testing-library/user-event": "^14.5.2",
|
|
48
|
-
"vitest": "^2.
|
|
48
|
+
"vitest": "^2.1.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": ">=16.8 <=18"
|