@instructure/ui-side-nav-bar 11.7.4-snapshot-135 → 11.7.4-snapshot-142
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 +2 -1
- package/es/SideNavBar/v1/SideNavBarItem/index.js +13 -1
- package/es/SideNavBar/v2/SideNavBarItem/index.js +13 -1
- package/lib/SideNavBar/v1/SideNavBarItem/index.js +13 -1
- package/lib/SideNavBar/v2/SideNavBarItem/index.js +13 -1
- package/package.json +15 -14
- package/src/SideNavBar/v1/SideNavBarItem/index.tsx +10 -1
- package/src/SideNavBar/v2/SideNavBarItem/index.tsx +10 -1
- package/tsconfig.build.json +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/SideNavBar/v1/SideNavBarItem/index.d.ts.map +1 -1
- package/types/SideNavBar/v2/SideNavBarItem/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
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.4-snapshot-
|
|
6
|
+
## [11.7.4-snapshot-142](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-142) (2026-07-24)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
+
* **many:** do not allow javascript: and data: hrefs ([4a0ac03](https://github.com/instructure/instructure-ui/commit/4a0ac038c6a4102646e04d27c1c3251f97367822))
|
|
11
12
|
* **ui-side-nav-bar:** show focus ring on selected item ([0dad569](https://github.com/instructure/instructure-ui/commit/0dad569e2d8e60481465893938ed93121c6d4d08))
|
|
12
13
|
|
|
13
14
|
|
|
@@ -25,6 +25,7 @@ var _dec, _class;
|
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils';
|
|
28
|
+
import { safeLinkProps } from '@instructure/ui-utils';
|
|
28
29
|
import { Tooltip } from '@instructure/ui-tooltip/v11_6';
|
|
29
30
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
30
31
|
import { withStyle } from '@instructure/emotion';
|
|
@@ -71,15 +72,26 @@ let SideNavBarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
71
72
|
renderLink(addRef) {
|
|
72
73
|
const ElementType = getElementType(SideNavBarItem, this.props);
|
|
73
74
|
const {
|
|
74
|
-
href,
|
|
75
|
+
href: rawHref,
|
|
75
76
|
onClick,
|
|
76
77
|
icon,
|
|
77
78
|
label
|
|
78
79
|
} = this.props;
|
|
80
|
+
const {
|
|
81
|
+
href,
|
|
82
|
+
rel
|
|
83
|
+
} = safeLinkProps({
|
|
84
|
+
attr: 'href',
|
|
85
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
86
|
+
href: rawHref,
|
|
87
|
+
target: this.props.target,
|
|
88
|
+
rel: this.props.rel
|
|
89
|
+
});
|
|
79
90
|
const props = omitProps(this.props, SideNavBarItem.allowedProps);
|
|
80
91
|
return _jsxs(ElementType, {
|
|
81
92
|
...props,
|
|
82
93
|
href: href,
|
|
94
|
+
rel: rel,
|
|
83
95
|
onClick: onClick,
|
|
84
96
|
ref: addRef ? this.handleRef : undefined,
|
|
85
97
|
css: this.props.styles?.navigationItem,
|
|
@@ -25,6 +25,7 @@ var _dec, _class;
|
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils';
|
|
28
|
+
import { safeLinkProps } from '@instructure/ui-utils';
|
|
28
29
|
import { Tooltip } from '@instructure/ui-tooltip/latest';
|
|
29
30
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
30
31
|
import { withStyleNew } from '@instructure/emotion';
|
|
@@ -71,15 +72,26 @@ let SideNavBarItem = (_dec = withStyleNew(generateStyle, 'SideNavBarItem'), _dec
|
|
|
71
72
|
renderLink(addRef) {
|
|
72
73
|
const ElementType = getElementType(SideNavBarItem, this.props);
|
|
73
74
|
const {
|
|
74
|
-
href,
|
|
75
|
+
href: rawHref,
|
|
75
76
|
onClick,
|
|
76
77
|
icon,
|
|
77
78
|
label
|
|
78
79
|
} = this.props;
|
|
80
|
+
const {
|
|
81
|
+
href,
|
|
82
|
+
rel
|
|
83
|
+
} = safeLinkProps({
|
|
84
|
+
attr: 'href',
|
|
85
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
86
|
+
href: rawHref,
|
|
87
|
+
target: this.props.target,
|
|
88
|
+
rel: this.props.rel
|
|
89
|
+
});
|
|
79
90
|
const props = omitProps(this.props, SideNavBarItem.allowedProps);
|
|
80
91
|
return _jsxs(ElementType, {
|
|
81
92
|
...props,
|
|
82
93
|
href: href,
|
|
94
|
+
rel: rel,
|
|
83
95
|
onClick: onClick,
|
|
84
96
|
ref: addRef ? this.handleRef : undefined,
|
|
85
97
|
css: this.props.styles?.navigationItem,
|
|
@@ -8,6 +8,7 @@ exports.default = exports.SideNavBarItem = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
10
10
|
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
11
|
+
var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
|
|
11
12
|
var _v11_ = require("@instructure/ui-tooltip/v11_6");
|
|
12
13
|
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
13
14
|
var _emotion = require("@instructure/emotion");
|
|
@@ -77,15 +78,26 @@ let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyle)(_s
|
|
|
77
78
|
renderLink(addRef) {
|
|
78
79
|
const ElementType = (0, _getElementType.getElementType)(SideNavBarItem, this.props);
|
|
79
80
|
const {
|
|
80
|
-
href,
|
|
81
|
+
href: rawHref,
|
|
81
82
|
onClick,
|
|
82
83
|
icon,
|
|
83
84
|
label
|
|
84
85
|
} = this.props;
|
|
86
|
+
const {
|
|
87
|
+
href,
|
|
88
|
+
rel
|
|
89
|
+
} = (0, _safeLinkProps.safeLinkProps)({
|
|
90
|
+
attr: 'href',
|
|
91
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
92
|
+
href: rawHref,
|
|
93
|
+
target: this.props.target,
|
|
94
|
+
rel: this.props.rel
|
|
95
|
+
});
|
|
85
96
|
const props = (0, _omitProps.omitProps)(this.props, SideNavBarItem.allowedProps);
|
|
86
97
|
return (0, _jsxRuntime.jsxs)(ElementType, {
|
|
87
98
|
...props,
|
|
88
99
|
href: href,
|
|
100
|
+
rel: rel,
|
|
89
101
|
onClick: onClick,
|
|
90
102
|
ref: addRef ? this.handleRef : undefined,
|
|
91
103
|
css: this.props.styles?.navigationItem,
|
|
@@ -8,6 +8,7 @@ exports.default = exports.SideNavBarItem = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
10
10
|
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
11
|
+
var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
|
|
11
12
|
var _latest = require("@instructure/ui-tooltip/latest");
|
|
12
13
|
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
13
14
|
var _emotion = require("@instructure/emotion");
|
|
@@ -77,15 +78,26 @@ let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyleNew)
|
|
|
77
78
|
renderLink(addRef) {
|
|
78
79
|
const ElementType = (0, _getElementType.getElementType)(SideNavBarItem, this.props);
|
|
79
80
|
const {
|
|
80
|
-
href,
|
|
81
|
+
href: rawHref,
|
|
81
82
|
onClick,
|
|
82
83
|
icon,
|
|
83
84
|
label
|
|
84
85
|
} = this.props;
|
|
86
|
+
const {
|
|
87
|
+
href,
|
|
88
|
+
rel
|
|
89
|
+
} = (0, _safeLinkProps.safeLinkProps)({
|
|
90
|
+
attr: 'href',
|
|
91
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
92
|
+
href: rawHref,
|
|
93
|
+
target: this.props.target,
|
|
94
|
+
rel: this.props.rel
|
|
95
|
+
});
|
|
85
96
|
const props = (0, _omitProps.omitProps)(this.props, SideNavBarItem.allowedProps);
|
|
86
97
|
return (0, _jsxRuntime.jsxs)(ElementType, {
|
|
87
98
|
...props,
|
|
88
99
|
href: href,
|
|
100
|
+
rel: rel,
|
|
89
101
|
onClick: onClick,
|
|
90
102
|
ref: addRef ? this.handleRef : undefined,
|
|
91
103
|
css: this.props.styles?.navigationItem,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-side-nav-bar",
|
|
3
|
-
"version": "11.7.4-snapshot-
|
|
3
|
+
"version": "11.7.4-snapshot-142",
|
|
4
4
|
"description": "Main and application level navigational components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,25 +15,26 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-a11y-
|
|
22
|
-
"@instructure/ui-
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/ui-
|
|
18
|
+
"@instructure/debounce": "11.7.4-snapshot-142",
|
|
19
|
+
"@instructure/shared-types": "11.7.4-snapshot-142",
|
|
20
|
+
"@instructure/emotion": "11.7.4-snapshot-142",
|
|
21
|
+
"@instructure/ui-a11y-utils": "11.7.4-snapshot-142",
|
|
22
|
+
"@instructure/ui-badge": "11.7.4-snapshot-142",
|
|
23
|
+
"@instructure/ui-a11y-content": "11.7.4-snapshot-142",
|
|
24
|
+
"@instructure/ui-icons": "11.7.4-snapshot-142",
|
|
25
|
+
"@instructure/ui-react-utils": "11.7.4-snapshot-142",
|
|
26
|
+
"@instructure/ui-themes": "11.7.4-snapshot-142",
|
|
27
|
+
"@instructure/ui-tooltip": "11.7.4-snapshot-142",
|
|
28
|
+
"@instructure/ui-utils": "11.7.4-snapshot-142"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@testing-library/jest-dom": "^6.9.1",
|
|
31
32
|
"@testing-library/react": "16.3.2",
|
|
32
33
|
"@testing-library/user-event": "^14.6.1",
|
|
33
34
|
"vitest": "^4.1.9",
|
|
34
|
-
"@instructure/ui-axe-check": "11.7.4-snapshot-
|
|
35
|
-
"@instructure/ui-babel-preset": "11.7.4-snapshot-
|
|
36
|
-
"@instructure/ui-color-utils": "11.7.4-snapshot-
|
|
35
|
+
"@instructure/ui-axe-check": "11.7.4-snapshot-142",
|
|
36
|
+
"@instructure/ui-babel-preset": "11.7.4-snapshot-142",
|
|
37
|
+
"@instructure/ui-color-utils": "11.7.4-snapshot-142"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": ">=18 <=19"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils'
|
|
28
|
+
import { safeLinkProps } from '@instructure/ui-utils'
|
|
28
29
|
import { Tooltip } from '@instructure/ui-tooltip/v11_6'
|
|
29
30
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
|
|
30
31
|
import { withStyle } from '@instructure/emotion'
|
|
@@ -74,7 +75,14 @@ class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
|
74
75
|
renderLink(addRef: boolean) {
|
|
75
76
|
const ElementType = getElementType(SideNavBarItem, this.props)
|
|
76
77
|
|
|
77
|
-
const { href, onClick, icon, label } = this.props
|
|
78
|
+
const { href: rawHref, onClick, icon, label } = this.props
|
|
79
|
+
const { href, rel } = safeLinkProps({
|
|
80
|
+
attr: 'href',
|
|
81
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
82
|
+
href: rawHref,
|
|
83
|
+
target: (this.props as { target?: string }).target,
|
|
84
|
+
rel: (this.props as { rel?: string }).rel
|
|
85
|
+
})
|
|
78
86
|
|
|
79
87
|
const props = omitProps(this.props, SideNavBarItem.allowedProps)
|
|
80
88
|
|
|
@@ -82,6 +90,7 @@ class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
|
82
90
|
<ElementType
|
|
83
91
|
{...props}
|
|
84
92
|
href={href}
|
|
93
|
+
rel={rel}
|
|
85
94
|
onClick={onClick}
|
|
86
95
|
ref={addRef ? this.handleRef : undefined}
|
|
87
96
|
css={this.props.styles?.navigationItem}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils'
|
|
28
|
+
import { safeLinkProps } from '@instructure/ui-utils'
|
|
28
29
|
import { Tooltip } from '@instructure/ui-tooltip/latest'
|
|
29
30
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
|
|
30
31
|
import { withStyleNew } from '@instructure/emotion'
|
|
@@ -74,7 +75,14 @@ class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
|
74
75
|
renderLink(addRef: boolean) {
|
|
75
76
|
const ElementType = getElementType(SideNavBarItem, this.props)
|
|
76
77
|
|
|
77
|
-
const { href, onClick, icon, label } = this.props
|
|
78
|
+
const { href: rawHref, onClick, icon, label } = this.props
|
|
79
|
+
const { href, rel } = safeLinkProps({
|
|
80
|
+
attr: 'href',
|
|
81
|
+
tag: typeof ElementType === 'string' ? ElementType : 'a',
|
|
82
|
+
href: rawHref,
|
|
83
|
+
target: (this.props as { target?: string }).target,
|
|
84
|
+
rel: (this.props as { rel?: string }).rel
|
|
85
|
+
})
|
|
78
86
|
|
|
79
87
|
const props = omitProps(this.props, SideNavBarItem.allowedProps)
|
|
80
88
|
|
|
@@ -82,6 +90,7 @@ class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
|
82
90
|
<ElementType
|
|
83
91
|
{...props}
|
|
84
92
|
href={href}
|
|
93
|
+
rel={rel}
|
|
85
94
|
onClick={onClick}
|
|
86
95
|
ref={addRef ? this.handleRef : undefined}
|
|
87
96
|
css={this.props.styles?.navigationItem}
|
package/tsconfig.build.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
{ "path": "../ui-badge/tsconfig.build.json" },
|
|
20
20
|
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
21
21
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
22
|
-
{ "path": "../ui-tooltip/tsconfig.build.json" }
|
|
22
|
+
{ "path": "../ui-tooltip/tsconfig.build.json" },
|
|
23
|
+
{ "path": "../ui-utils/tsconfig.build.json" }
|
|
23
24
|
]
|
|
24
25
|
}
|