@instructure/ui-link 10.16.1-snapshot-0 → 10.16.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/es/Link/__new-tests__/Link.test.js +165 -120
- package/es/Link/index.js +13 -10
- package/lib/Link/__new-tests__/Link.test.js +198 -153
- package/lib/Link/index.js +12 -10
- package/package.json +16 -16
- package/src/Link/__new-tests__/Link.test.tsx +5 -5
- package/src/Link/index.tsx +3 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Link/__new-tests__/Link.test.d.ts.map +1 -1
- package/types/Link/index.d.ts +4 -6
- package/types/Link/index.d.ts.map +1 -1
- package/tsconfig.json +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "10.16.1
|
|
3
|
+
"version": "10.16.1",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.26.0",
|
|
27
|
-
"@instructure/console": "10.16.1
|
|
28
|
-
"@instructure/emotion": "10.16.1
|
|
29
|
-
"@instructure/shared-types": "10.16.1
|
|
30
|
-
"@instructure/ui-a11y-utils": "10.16.1
|
|
31
|
-
"@instructure/ui-color-utils": "10.16.1
|
|
32
|
-
"@instructure/ui-dom-utils": "10.16.1
|
|
33
|
-
"@instructure/ui-icons": "10.16.1
|
|
34
|
-
"@instructure/ui-prop-types": "10.16.1
|
|
35
|
-
"@instructure/ui-react-utils": "10.16.1
|
|
36
|
-
"@instructure/ui-testable": "10.16.1
|
|
37
|
-
"@instructure/ui-view": "10.16.1
|
|
27
|
+
"@instructure/console": "10.16.1",
|
|
28
|
+
"@instructure/emotion": "10.16.1",
|
|
29
|
+
"@instructure/shared-types": "10.16.1",
|
|
30
|
+
"@instructure/ui-a11y-utils": "10.16.1",
|
|
31
|
+
"@instructure/ui-color-utils": "10.16.1",
|
|
32
|
+
"@instructure/ui-dom-utils": "10.16.1",
|
|
33
|
+
"@instructure/ui-icons": "10.16.1",
|
|
34
|
+
"@instructure/ui-prop-types": "10.16.1",
|
|
35
|
+
"@instructure/ui-react-utils": "10.16.1",
|
|
36
|
+
"@instructure/ui-testable": "10.16.1",
|
|
37
|
+
"@instructure/ui-view": "10.16.1",
|
|
38
38
|
"prop-types": "^15.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@instructure/ui-axe-check": "10.16.1
|
|
42
|
-
"@instructure/ui-babel-preset": "10.16.1
|
|
43
|
-
"@instructure/ui-test-utils": "10.16.1
|
|
44
|
-
"@instructure/ui-themes": "10.16.1
|
|
41
|
+
"@instructure/ui-axe-check": "10.16.1",
|
|
42
|
+
"@instructure/ui-babel-preset": "10.16.1",
|
|
43
|
+
"@instructure/ui-test-utils": "10.16.1",
|
|
44
|
+
"@instructure/ui-themes": "10.16.1",
|
|
45
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
46
46
|
"@testing-library/react": "^16.0.1",
|
|
47
47
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/** jsxImportSource @emotion/react */
|
|
26
|
+
import { Component, PropsWithChildren } from 'react'
|
|
26
27
|
import { userEvent } from '@testing-library/user-event'
|
|
27
28
|
import { render, screen, waitFor } from '@testing-library/react'
|
|
28
29
|
import '@testing-library/jest-dom'
|
|
29
|
-
import { vi } from 'vitest'
|
|
30
|
+
import { expect, vi } from 'vitest'
|
|
30
31
|
|
|
31
32
|
import { runAxeCheck } from '@instructure/ui-axe-check'
|
|
32
33
|
import { Link } from '../index'
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
class TruncateText extends React.Component<PropsWithChildren<unknown>> {
|
|
35
|
+
class TruncateText extends Component<PropsWithChildren> {
|
|
36
36
|
render() {
|
|
37
37
|
return <span>{this.props.children}</span>
|
|
38
38
|
}
|
|
@@ -138,7 +138,7 @@ describe('<Link />', () => {
|
|
|
138
138
|
const { container } = render(
|
|
139
139
|
<Link onMouseEnter={onMouseEnter}>Hello World</Link>
|
|
140
140
|
)
|
|
141
|
-
const link = container.querySelector('span[class
|
|
141
|
+
const link = container.querySelector('span[class*="-link"]')!
|
|
142
142
|
|
|
143
143
|
userEvent.hover(link)
|
|
144
144
|
|
package/src/Link/index.tsx
CHANGED
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
import React, { Component } from 'react'
|
|
25
|
+
import { Children, Component } from 'react'
|
|
27
26
|
|
|
28
27
|
import { View } from '@instructure/ui-view'
|
|
29
28
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
|
|
@@ -38,7 +37,7 @@ import {
|
|
|
38
37
|
import { logWarn as warn } from '@instructure/console'
|
|
39
38
|
import { testable } from '@instructure/ui-testable'
|
|
40
39
|
|
|
41
|
-
import { withStyle
|
|
40
|
+
import { withStyle } from '@instructure/emotion'
|
|
42
41
|
import generateStyle from './styles'
|
|
43
42
|
import generateComponentTheme from './theme'
|
|
44
43
|
|
|
@@ -133,7 +132,7 @@ class Link extends Component<LinkProps, LinkState> {
|
|
|
133
132
|
get containsTruncateText() {
|
|
134
133
|
let truncateText = false
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
Children.forEach(this.props.children, (child) => {
|
|
137
136
|
if (child && matchComponentTypes(child, ['TruncateText'])) {
|
|
138
137
|
truncateText = true
|
|
139
138
|
}
|