@instructure/ui-navigation 11.7.4-snapshot-136 → 11.7.4-snapshot-144

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,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-136](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-136) (2026-07-24)
6
+ ## [11.7.4-snapshot-144](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-144) (2026-07-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** do not allow javascript: and data: hrefs ([4a0ac03](https://github.com/instructure/instructure-ui/commit/4a0ac038c6a4102646e04d27c1c3251f97367822))
7
12
 
8
13
 
9
14
  ### Features
@@ -26,6 +26,7 @@ var _dec, _class;
26
26
  import { Component } from 'react';
27
27
  import { logError as error } from '@instructure/console';
28
28
  import { callRenderProp, getElementType, matchComponentTypes, passthroughProps } from '@instructure/ui-react-utils';
29
+ import { safeLinkProps } from '@instructure/ui-utils';
29
30
  import { View } from '@instructure/ui-view/v11_6';
30
31
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
31
32
  import { withStyle } from '@instructure/emotion';
@@ -84,11 +85,21 @@ let Item = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
84
85
  const {
85
86
  renderIcon,
86
87
  renderLabel,
87
- href,
88
+ href: rawHref,
88
89
  renderAfter,
89
90
  cursor,
90
91
  isDisabled
91
92
  } = this.props;
93
+ const {
94
+ href,
95
+ rel
96
+ } = safeLinkProps({
97
+ attr: 'href',
98
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
99
+ href: rawHref,
100
+ target: this.props.target,
101
+ rel: this.props.rel
102
+ });
92
103
  const icon = callRenderProp(renderIcon);
93
104
  const label = callRenderProp(renderLabel);
94
105
  const labelIsForScreenReaders = matchComponentTypes(label, [ScreenReaderContent]);
@@ -99,6 +110,7 @@ let Item = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
99
110
  ...passthroughProps(this.props),
100
111
  as: ElementType,
101
112
  href: href,
113
+ rel: rel,
102
114
  onClick: this.handleClick,
103
115
  disabled: isDisabled,
104
116
  elementRef: this.handleRef,
@@ -26,6 +26,7 @@ var _dec, _class;
26
26
  import { Component } from 'react';
27
27
  import { logError as error } from '@instructure/console';
28
28
  import { callRenderProp, getElementType, matchComponentTypes, passthroughProps } from '@instructure/ui-react-utils';
29
+ import { safeLinkProps } from '@instructure/ui-utils';
29
30
  import { View } from '@instructure/ui-view/latest';
30
31
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
31
32
  import { withStyleNew } from '@instructure/emotion';
@@ -83,11 +84,21 @@ let Item = (_dec = withStyleNew(generateStyle), _dec(_class = class Item extends
83
84
  const {
84
85
  renderIcon,
85
86
  renderLabel,
86
- href,
87
+ href: rawHref,
87
88
  renderAfter,
88
89
  cursor,
89
90
  isDisabled
90
91
  } = this.props;
92
+ const {
93
+ href,
94
+ rel
95
+ } = safeLinkProps({
96
+ attr: 'href',
97
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
98
+ href: rawHref,
99
+ target: this.props.target,
100
+ rel: this.props.rel
101
+ });
91
102
  const icon = callRenderProp(renderIcon);
92
103
  const label = callRenderProp(renderLabel);
93
104
  const labelIsForScreenReaders = matchComponentTypes(label, [ScreenReaderContent]);
@@ -98,6 +109,7 @@ let Item = (_dec = withStyleNew(generateStyle), _dec(_class = class Item extends
98
109
  ...passthroughProps(this.props),
99
110
  as: ElementType,
100
111
  href: href,
112
+ rel: rel,
101
113
  onClick: this.handleClick,
102
114
  disabled: isDisabled,
103
115
  elementRef: this.handleRef,
@@ -11,6 +11,7 @@ var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js
11
11
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
12
12
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
13
13
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
14
+ var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
14
15
  var _v11_ = require("@instructure/ui-view/v11_6");
15
16
  var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
16
17
  var _emotion = require("@instructure/emotion");
@@ -92,11 +93,21 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
92
93
  const {
93
94
  renderIcon,
94
95
  renderLabel,
95
- href,
96
+ href: rawHref,
96
97
  renderAfter,
97
98
  cursor,
98
99
  isDisabled
99
100
  } = this.props;
101
+ const {
102
+ href,
103
+ rel
104
+ } = (0, _safeLinkProps.safeLinkProps)({
105
+ attr: 'href',
106
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
107
+ href: rawHref,
108
+ target: this.props.target,
109
+ rel: this.props.rel
110
+ });
100
111
  const icon = (0, _callRenderProp.callRenderProp)(renderIcon);
101
112
  const label = (0, _callRenderProp.callRenderProp)(renderLabel);
102
113
  const labelIsForScreenReaders = (0, _matchComponentTypes.matchComponentTypes)(label, [_ScreenReaderContent.ScreenReaderContent]);
@@ -107,6 +118,7 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
107
118
  ...(0, _passthroughProps.passthroughProps)(this.props),
108
119
  as: ElementType,
109
120
  href: href,
121
+ rel: rel,
110
122
  onClick: this.handleClick,
111
123
  disabled: isDisabled,
112
124
  elementRef: this.handleRef,
@@ -11,6 +11,7 @@ var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js
11
11
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
12
12
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
13
13
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
14
+ var _safeLinkProps = require("@instructure/ui-utils/lib/safeLinkProps.js");
14
15
  var _latest = require("@instructure/ui-view/latest");
15
16
  var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
16
17
  var _emotion = require("@instructure/emotion");
@@ -91,11 +92,21 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
91
92
  const {
92
93
  renderIcon,
93
94
  renderLabel,
94
- href,
95
+ href: rawHref,
95
96
  renderAfter,
96
97
  cursor,
97
98
  isDisabled
98
99
  } = this.props;
100
+ const {
101
+ href,
102
+ rel
103
+ } = (0, _safeLinkProps.safeLinkProps)({
104
+ attr: 'href',
105
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
106
+ href: rawHref,
107
+ target: this.props.target,
108
+ rel: this.props.rel
109
+ });
99
110
  const icon = (0, _callRenderProp.callRenderProp)(renderIcon);
100
111
  const label = (0, _callRenderProp.callRenderProp)(renderLabel);
101
112
  const labelIsForScreenReaders = (0, _matchComponentTypes.matchComponentTypes)(label, [_ScreenReaderContent.ScreenReaderContent]);
@@ -106,6 +117,7 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
106
117
  ...(0, _passthroughProps.passthroughProps)(this.props),
107
118
  as: ElementType,
108
119
  href: href,
120
+ rel: rel,
109
121
  onClick: this.handleClick,
110
122
  disabled: isDisabled,
111
123
  elementRef: this.handleRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-navigation",
3
- "version": "11.7.4-snapshot-136",
3
+ "version": "11.7.4-snapshot-144",
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,33 +15,33 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.29.7",
18
- "@instructure/console": "11.7.4-snapshot-136",
19
- "@instructure/emotion": "11.7.4-snapshot-136",
20
- "@instructure/shared-types": "11.7.4-snapshot-136",
21
- "@instructure/ui-a11y-utils": "11.7.4-snapshot-136",
22
- "@instructure/ui-a11y-content": "11.7.4-snapshot-136",
23
- "@instructure/debounce": "11.7.4-snapshot-136",
24
- "@instructure/ui-badge": "11.7.4-snapshot-136",
25
- "@instructure/ui-dom-utils": "11.7.4-snapshot-136",
26
- "@instructure/ui-focusable": "11.7.4-snapshot-136",
27
- "@instructure/ui-icons": "11.7.4-snapshot-136",
28
- "@instructure/ui-themes": "11.7.4-snapshot-136",
29
- "@instructure/ui-tooltip": "11.7.4-snapshot-136",
30
- "@instructure/ui-react-utils": "11.7.4-snapshot-136",
31
- "@instructure/ui-menu": "11.7.4-snapshot-136",
32
- "@instructure/ui-view": "11.7.4-snapshot-136",
33
- "@instructure/ui-truncate-list": "11.7.4-snapshot-136",
34
- "@instructure/ui-utils": "11.7.4-snapshot-136"
18
+ "@instructure/debounce": "11.7.4-snapshot-144",
19
+ "@instructure/console": "11.7.4-snapshot-144",
20
+ "@instructure/shared-types": "11.7.4-snapshot-144",
21
+ "@instructure/emotion": "11.7.4-snapshot-144",
22
+ "@instructure/ui-a11y-content": "11.7.4-snapshot-144",
23
+ "@instructure/ui-a11y-utils": "11.7.4-snapshot-144",
24
+ "@instructure/ui-badge": "11.7.4-snapshot-144",
25
+ "@instructure/ui-focusable": "11.7.4-snapshot-144",
26
+ "@instructure/ui-dom-utils": "11.7.4-snapshot-144",
27
+ "@instructure/ui-menu": "11.7.4-snapshot-144",
28
+ "@instructure/ui-icons": "11.7.4-snapshot-144",
29
+ "@instructure/ui-themes": "11.7.4-snapshot-144",
30
+ "@instructure/ui-react-utils": "11.7.4-snapshot-144",
31
+ "@instructure/ui-tooltip": "11.7.4-snapshot-144",
32
+ "@instructure/ui-truncate-list": "11.7.4-snapshot-144",
33
+ "@instructure/ui-utils": "11.7.4-snapshot-144",
34
+ "@instructure/ui-view": "11.7.4-snapshot-144"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@testing-library/jest-dom": "^6.9.1",
38
38
  "@testing-library/react": "16.3.2",
39
39
  "@testing-library/user-event": "^14.6.1",
40
40
  "vitest": "^4.1.9",
41
- "@instructure/ui-axe-check": "11.7.4-snapshot-136",
42
- "@instructure/ui-babel-preset": "11.7.4-snapshot-136",
43
- "@instructure/ui-color-utils": "11.7.4-snapshot-136",
44
- "@instructure/ui-scripts": "11.7.4-snapshot-136"
41
+ "@instructure/ui-axe-check": "11.7.4-snapshot-144",
42
+ "@instructure/ui-babel-preset": "11.7.4-snapshot-144",
43
+ "@instructure/ui-color-utils": "11.7.4-snapshot-144",
44
+ "@instructure/ui-scripts": "11.7.4-snapshot-144"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=18 <=19"
@@ -31,6 +31,7 @@ import {
31
31
  matchComponentTypes,
32
32
  passthroughProps
33
33
  } from '@instructure/ui-react-utils'
34
+ import { safeLinkProps } from '@instructure/ui-utils'
34
35
 
35
36
  import { View } from '@instructure/ui-view/v11_6'
36
37
  import { ScreenReaderContent } from '@instructure/ui-a11y-content'
@@ -98,8 +99,21 @@ class Item extends Component<AppNavItemProps> {
98
99
  render() {
99
100
  const ElementType = getElementType(Item, this.props)
100
101
 
101
- const { renderIcon, renderLabel, href, renderAfter, cursor, isDisabled } =
102
- this.props
102
+ const {
103
+ renderIcon,
104
+ renderLabel,
105
+ href: rawHref,
106
+ renderAfter,
107
+ cursor,
108
+ isDisabled
109
+ } = this.props
110
+ const { href, rel } = safeLinkProps({
111
+ attr: 'href',
112
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
113
+ href: rawHref,
114
+ target: (this.props as { target?: string }).target,
115
+ rel: (this.props as { rel?: string }).rel
116
+ })
103
117
 
104
118
  const icon = callRenderProp(renderIcon)
105
119
  const label = callRenderProp(renderLabel)
@@ -120,6 +134,7 @@ class Item extends Component<AppNavItemProps> {
120
134
  {...passthroughProps(this.props)}
121
135
  as={ElementType}
122
136
  href={href}
137
+ rel={rel}
123
138
  onClick={this.handleClick}
124
139
  disabled={isDisabled}
125
140
  elementRef={this.handleRef}
@@ -31,6 +31,7 @@ import {
31
31
  matchComponentTypes,
32
32
  passthroughProps
33
33
  } from '@instructure/ui-react-utils'
34
+ import { safeLinkProps } from '@instructure/ui-utils'
34
35
 
35
36
  import { View } from '@instructure/ui-view/latest'
36
37
  import { ScreenReaderContent } from '@instructure/ui-a11y-content'
@@ -97,8 +98,21 @@ class Item extends Component<AppNavItemProps> {
97
98
  render() {
98
99
  const ElementType = getElementType(Item, this.props)
99
100
 
100
- const { renderIcon, renderLabel, href, renderAfter, cursor, isDisabled } =
101
- this.props
101
+ const {
102
+ renderIcon,
103
+ renderLabel,
104
+ href: rawHref,
105
+ renderAfter,
106
+ cursor,
107
+ isDisabled
108
+ } = this.props
109
+ const { href, rel } = safeLinkProps({
110
+ attr: 'href',
111
+ tag: typeof ElementType === 'string' ? ElementType : 'a',
112
+ href: rawHref,
113
+ target: (this.props as { target?: string }).target,
114
+ rel: (this.props as { rel?: string }).rel
115
+ })
102
116
 
103
117
  const icon = callRenderProp(renderIcon)
104
118
  const label = callRenderProp(renderLabel)
@@ -119,6 +133,7 @@ class Item extends Component<AppNavItemProps> {
119
133
  {...passthroughProps(this.props)}
120
134
  as={ElementType}
121
135
  href={href}
136
+ rel={rel}
122
137
  onClick={this.handleClick}
123
138
  disabled={isDisabled}
124
139
  elementRef={this.handleRef}