@instructure/ui-navigation 10.26.1 → 11.0.1-snapshot-0
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 +30 -1
- package/es/AppNav/Item/index.js +6 -6
- package/es/AppNav/Item/props.js +2 -14
- package/es/AppNav/index.js +6 -6
- package/es/AppNav/props.js +1 -16
- package/lib/AppNav/Item/index.js +5 -5
- package/lib/AppNav/Item/props.js +1 -15
- package/lib/AppNav/index.js +5 -5
- package/lib/AppNav/props.js +1 -17
- package/package.json +24 -27
- package/src/AppNav/Item/index.tsx +2 -4
- package/src/AppNav/Item/props.ts +2 -22
- package/src/AppNav/index.tsx +2 -4
- package/src/AppNav/props.ts +1 -21
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/AppNav/Item/index.d.ts +1 -13
- package/types/AppNav/Item/index.d.ts.map +1 -1
- package/types/AppNav/Item/props.d.ts +3 -4
- package/types/AppNav/Item/props.d.ts.map +1 -1
- package/types/AppNav/index.d.ts +0 -14
- package/types/AppNav/index.d.ts.map +1 -1
- package/types/AppNav/props.d.ts +2 -3
- package/types/AppNav/props.d.ts.map +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
|
-
## [
|
|
6
|
+
## [11.0.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-0) (2025-10-07)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-navigation
|
|
9
9
|
|
|
@@ -11,6 +11,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
25
|
+
- React 16 and 17 are no longer supported
|
|
26
|
+
- remove `PropTypes` from all packages
|
|
27
|
+
- remove `CodeEditor` component
|
|
28
|
+
- remove `@instui/theme-registry` package
|
|
29
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
30
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
31
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
32
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
33
|
+
- `variables` field on theme objects are removed
|
|
34
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
35
|
+
`isStacked`, `hover`, and `headers`
|
|
36
|
+
- `Table`'s `caption` prop is now required
|
|
37
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
14
43
|
# [10.26.0](https://github.com/instructure/instructure-ui/compare/v10.25.0...v10.26.0) (2025-10-01)
|
|
15
44
|
|
|
16
45
|
**Note:** Version bump only for package @instructure/ui-navigation
|
package/es/AppNav/Item/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _Item;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -26,13 +26,12 @@ var _dec, _dec2, _class, _Item;
|
|
|
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 { testable } from '@instructure/ui-testable';
|
|
30
29
|
import { View } from '@instructure/ui-view';
|
|
31
30
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
32
31
|
import { withStyle } from '@instructure/emotion';
|
|
33
32
|
import generateStyle from './styles';
|
|
34
33
|
import generateComponentTheme from './theme';
|
|
35
|
-
import { allowedProps
|
|
34
|
+
import { allowedProps } from './props';
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
---
|
|
@@ -42,7 +41,7 @@ id: AppNav.Item
|
|
|
42
41
|
@module Item
|
|
43
42
|
**/
|
|
44
43
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
45
|
-
let Item = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
44
|
+
let Item = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Item = class Item extends Component {
|
|
46
45
|
constructor(...args) {
|
|
47
46
|
super(...args);
|
|
48
47
|
this.ref = null;
|
|
@@ -101,17 +100,18 @@ let Item = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
101
100
|
borderRadius: "medium",
|
|
102
101
|
cursor: isDisabled ? 'not-allowed' : cursor,
|
|
103
102
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.item,
|
|
103
|
+
"data-cid": "AppNav.Item",
|
|
104
104
|
children: [icon, labelIsForScreenReaders ? label : _jsx("span", {
|
|
105
105
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label,
|
|
106
106
|
children: label
|
|
107
107
|
}), renderAfter && callRenderProp(renderAfter)]
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
}, _Item.displayName = "Item", _Item.componentId = 'AppNav.Item', _Item.allowedProps = allowedProps, _Item.
|
|
110
|
+
}, _Item.displayName = "Item", _Item.componentId = 'AppNav.Item', _Item.allowedProps = allowedProps, _Item.defaultProps = {
|
|
111
111
|
children: null,
|
|
112
112
|
isSelected: false,
|
|
113
113
|
cursor: 'pointer',
|
|
114
114
|
isDisabled: false
|
|
115
|
-
}, _Item)) || _class)
|
|
115
|
+
}, _Item)) || _class);
|
|
116
116
|
export default Item;
|
|
117
117
|
export { Item };
|
package/es/AppNav/Item/props.js
CHANGED
|
@@ -21,18 +21,6 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
const propTypes = {
|
|
26
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.func]).isRequired,
|
|
27
|
-
renderAfter: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
28
|
-
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
29
|
-
href: PropTypes.string,
|
|
30
|
-
onClick: PropTypes.func,
|
|
31
|
-
isSelected: PropTypes.bool,
|
|
32
|
-
elementRef: PropTypes.func,
|
|
33
|
-
as: PropTypes.elementType,
|
|
34
|
-
cursor: PropTypes.string,
|
|
35
|
-
isDisabled: PropTypes.bool
|
|
36
|
-
};
|
|
24
|
+
|
|
37
25
|
const allowedProps = ['renderLabel', 'renderAfter', 'renderIcon', 'href', 'onClick', 'isSelected', 'elementRef', 'as', 'cursor', 'isDisabled'];
|
|
38
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/AppNav/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _AppNav;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -26,13 +26,12 @@ var _dec, _dec2, _class, _AppNav;
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
27
|
import { withStyle } from '@instructure/emotion';
|
|
28
28
|
import { callRenderProp, omitProps } from '@instructure/ui-react-utils';
|
|
29
|
-
import { testable } from '@instructure/ui-testable';
|
|
30
29
|
import { View } from '@instructure/ui-view';
|
|
31
30
|
import { Menu } from '@instructure/ui-menu';
|
|
32
31
|
import { Item } from './Item';
|
|
33
32
|
import generateStyle from './styles';
|
|
34
33
|
import generateComponentTheme from './theme';
|
|
35
|
-
import { allowedProps
|
|
34
|
+
import { allowedProps } from './props';
|
|
36
35
|
import { TruncateList } from '@instructure/ui-truncate-list';
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -41,7 +40,7 @@ category: components
|
|
|
41
40
|
---
|
|
42
41
|
**/
|
|
43
42
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
44
|
-
let AppNav = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
43
|
+
let AppNav = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_AppNav = class AppNav extends Component {
|
|
45
44
|
constructor(...args) {
|
|
46
45
|
super(...args);
|
|
47
46
|
this.state = {
|
|
@@ -96,6 +95,7 @@ let AppNav = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
96
95
|
margin: margin,
|
|
97
96
|
display: hasRenderedContent ? 'flex' : 'block',
|
|
98
97
|
elementRef: this.handleRef,
|
|
98
|
+
"data-cid": "AppNav",
|
|
99
99
|
children: [renderBeforeItems && _jsx("span", {
|
|
100
100
|
children: renderBeforeItems
|
|
101
101
|
}), _jsx(TruncateList, {
|
|
@@ -113,12 +113,12 @@ let AppNav = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
113
113
|
})]
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
}, _AppNav.displayName = "AppNav", _AppNav.componentId = 'AppNav', _AppNav.allowedProps = allowedProps, _AppNav.
|
|
116
|
+
}, _AppNav.displayName = "AppNav", _AppNav.componentId = 'AppNav', _AppNav.allowedProps = allowedProps, _AppNav.defaultProps = {
|
|
117
117
|
children: null,
|
|
118
118
|
debounce: 300,
|
|
119
119
|
margin: '0',
|
|
120
120
|
renderTruncateLabel: () => 'More',
|
|
121
121
|
visibleItemsCount: 0
|
|
122
|
-
}, _AppNav.Item = Item, _AppNav)) || _class)
|
|
122
|
+
}, _AppNav.Item = Item, _AppNav)) || _class);
|
|
123
123
|
export { AppNav };
|
|
124
124
|
export default AppNav;
|
package/es/AppNav/props.js
CHANGED
|
@@ -22,20 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
27
|
-
import { Item } from './Item';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
screenReaderLabel: PropTypes.string.isRequired,
|
|
30
|
-
children: ChildrenPropTypes.oneOf([Item]),
|
|
31
|
-
debounce: PropTypes.number,
|
|
32
|
-
renderBeforeItems: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
33
|
-
renderAfterItems: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
34
|
-
margin: PropTypes.string,
|
|
35
|
-
elementRef: PropTypes.func,
|
|
36
|
-
renderTruncateLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
37
|
-
onUpdate: PropTypes.func,
|
|
38
|
-
visibleItemsCount: PropTypes.number
|
|
39
|
-
};
|
|
40
25
|
const allowedProps = ['screenReaderLabel', 'children', 'debounce', 'renderBeforeItems', 'renderAfterItems', 'margin', 'elementRef', 'renderTruncateLabel', 'onUpdate', 'visibleItemsCount'];
|
|
41
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/lib/AppNav/Item/index.js
CHANGED
|
@@ -11,7 +11,6 @@ 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 _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
15
14
|
var _View = require("@instructure/ui-view/lib/View");
|
|
16
15
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
17
16
|
var _emotion = require("@instructure/emotion");
|
|
@@ -19,7 +18,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
19
18
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
20
19
|
var _props = require("./props");
|
|
21
20
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
22
|
-
var _dec,
|
|
21
|
+
var _dec, _class, _Item;
|
|
23
22
|
/*
|
|
24
23
|
* The MIT License (MIT)
|
|
25
24
|
*
|
|
@@ -50,7 +49,7 @@ id: AppNav.Item
|
|
|
50
49
|
---
|
|
51
50
|
@module Item
|
|
52
51
|
**/
|
|
53
|
-
let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
52
|
+
let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Item = class Item extends _react.Component {
|
|
54
53
|
constructor(...args) {
|
|
55
54
|
super(...args);
|
|
56
55
|
this.ref = null;
|
|
@@ -109,16 +108,17 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
109
108
|
borderRadius: "medium",
|
|
110
109
|
cursor: isDisabled ? 'not-allowed' : cursor,
|
|
111
110
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.item,
|
|
111
|
+
"data-cid": "AppNav.Item",
|
|
112
112
|
children: [icon, labelIsForScreenReaders ? label : (0, _jsxRuntime.jsx)("span", {
|
|
113
113
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label,
|
|
114
114
|
children: label
|
|
115
115
|
}), renderAfter && (0, _callRenderProp.callRenderProp)(renderAfter)]
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
}, _Item.displayName = "Item", _Item.componentId = 'AppNav.Item', _Item.allowedProps = _props.allowedProps, _Item.
|
|
118
|
+
}, _Item.displayName = "Item", _Item.componentId = 'AppNav.Item', _Item.allowedProps = _props.allowedProps, _Item.defaultProps = {
|
|
119
119
|
children: null,
|
|
120
120
|
isSelected: false,
|
|
121
121
|
cursor: 'pointer',
|
|
122
122
|
isDisabled: false
|
|
123
|
-
}, _Item)) || _class)
|
|
123
|
+
}, _Item)) || _class);
|
|
124
124
|
var _default = exports.default = Item;
|
package/lib/AppNav/Item/props.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,16 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string, _propTypes.default.func]).isRequired,
|
|
35
|
-
renderAfter: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
36
|
-
renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
37
|
-
href: _propTypes.default.string,
|
|
38
|
-
onClick: _propTypes.default.func,
|
|
39
|
-
isSelected: _propTypes.default.bool,
|
|
40
|
-
elementRef: _propTypes.default.func,
|
|
41
|
-
as: _propTypes.default.elementType,
|
|
42
|
-
cursor: _propTypes.default.string,
|
|
43
|
-
isDisabled: _propTypes.default.bool
|
|
44
|
-
};
|
|
45
31
|
const allowedProps = exports.allowedProps = ['renderLabel', 'renderAfter', 'renderIcon', 'href', 'onClick', 'isSelected', 'elementRef', 'as', 'cursor', 'isDisabled'];
|
package/lib/AppNav/index.js
CHANGED
|
@@ -9,7 +9,6 @@ var _react = require("react");
|
|
|
9
9
|
var _emotion = require("@instructure/emotion");
|
|
10
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
11
11
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
13
12
|
var _View = require("@instructure/ui-view/lib/View");
|
|
14
13
|
var _Menu = require("@instructure/ui-menu/lib/Menu");
|
|
15
14
|
var _Item = require("./Item");
|
|
@@ -18,7 +17,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
18
17
|
var _props = require("./props");
|
|
19
18
|
var _TruncateList = require("@instructure/ui-truncate-list/lib/TruncateList");
|
|
20
19
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
21
|
-
var _dec,
|
|
20
|
+
var _dec, _class, _AppNav;
|
|
22
21
|
/*
|
|
23
22
|
* The MIT License (MIT)
|
|
24
23
|
*
|
|
@@ -47,7 +46,7 @@ var _dec, _dec2, _class, _AppNav;
|
|
|
47
46
|
category: components
|
|
48
47
|
---
|
|
49
48
|
**/
|
|
50
|
-
let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
49
|
+
let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_AppNav = class AppNav extends _react.Component {
|
|
51
50
|
constructor(...args) {
|
|
52
51
|
super(...args);
|
|
53
52
|
this.state = {
|
|
@@ -102,6 +101,7 @@ let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _
|
|
|
102
101
|
margin: margin,
|
|
103
102
|
display: hasRenderedContent ? 'flex' : 'block',
|
|
104
103
|
elementRef: this.handleRef,
|
|
104
|
+
"data-cid": "AppNav",
|
|
105
105
|
children: [renderBeforeItems && (0, _jsxRuntime.jsx)("span", {
|
|
106
106
|
children: renderBeforeItems
|
|
107
107
|
}), (0, _jsxRuntime.jsx)(_TruncateList.TruncateList, {
|
|
@@ -119,11 +119,11 @@ let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _
|
|
|
119
119
|
})]
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
}, _AppNav.displayName = "AppNav", _AppNav.componentId = 'AppNav', _AppNav.allowedProps = _props.allowedProps, _AppNav.
|
|
122
|
+
}, _AppNav.displayName = "AppNav", _AppNav.componentId = 'AppNav', _AppNav.allowedProps = _props.allowedProps, _AppNav.defaultProps = {
|
|
123
123
|
children: null,
|
|
124
124
|
debounce: 300,
|
|
125
125
|
margin: '0',
|
|
126
126
|
renderTruncateLabel: () => 'More',
|
|
127
127
|
visibleItemsCount: 0
|
|
128
|
-
}, _AppNav.Item = _Item.Item, _AppNav)) || _class)
|
|
128
|
+
}, _AppNav.Item = _Item.Item, _AppNav)) || _class);
|
|
129
129
|
var _default = exports.default = AppNav;
|
package/lib/AppNav/props.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _Item = require("./Item");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,16 +28,4 @@ var _Item = require("./Item");
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
screenReaderLabel: _propTypes.default.string.isRequired,
|
|
37
|
-
children: _Children.Children.oneOf([_Item.Item]),
|
|
38
|
-
debounce: _propTypes.default.number,
|
|
39
|
-
renderBeforeItems: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
40
|
-
renderAfterItems: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
41
|
-
margin: _propTypes.default.string,
|
|
42
|
-
elementRef: _propTypes.default.func,
|
|
43
|
-
renderTruncateLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
44
|
-
onUpdate: _propTypes.default.func,
|
|
45
|
-
visibleItemsCount: _propTypes.default.number
|
|
46
|
-
};
|
|
47
31
|
const allowedProps = exports.allowedProps = ['screenReaderLabel', 'children', 'debounce', 'renderBeforeItems', 'renderAfterItems', 'margin', 'elementRef', 'renderTruncateLabel', 'onUpdate', 'visibleItemsCount'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-navigation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1-snapshot-0",
|
|
4
4
|
"description": "Main and application level navigational components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,40 +23,37 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "
|
|
27
|
-
"@instructure/ui-babel-preset": "
|
|
28
|
-
"@instructure/ui-color-utils": "
|
|
29
|
-
"@instructure/ui-scripts": "
|
|
30
|
-
"@instructure/ui-themes": "
|
|
26
|
+
"@instructure/ui-axe-check": "11.0.1-snapshot-0",
|
|
27
|
+
"@instructure/ui-babel-preset": "11.0.1-snapshot-0",
|
|
28
|
+
"@instructure/ui-color-utils": "11.0.1-snapshot-0",
|
|
29
|
+
"@instructure/ui-scripts": "11.0.1-snapshot-0",
|
|
30
|
+
"@instructure/ui-themes": "11.0.1-snapshot-0",
|
|
31
31
|
"@testing-library/jest-dom": "^6.6.3",
|
|
32
|
-
"@testing-library/react": "
|
|
32
|
+
"@testing-library/react": "15.0.7",
|
|
33
33
|
"@testing-library/user-event": "^14.6.1",
|
|
34
34
|
"vitest": "^3.2.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.27.6",
|
|
38
|
-
"@instructure/console": "
|
|
39
|
-
"@instructure/debounce": "
|
|
40
|
-
"@instructure/emotion": "
|
|
41
|
-
"@instructure/shared-types": "
|
|
42
|
-
"@instructure/ui-a11y-content": "
|
|
43
|
-
"@instructure/ui-a11y-utils": "
|
|
44
|
-
"@instructure/ui-badge": "
|
|
45
|
-
"@instructure/ui-dom-utils": "
|
|
46
|
-
"@instructure/ui-focusable": "
|
|
47
|
-
"@instructure/ui-icons": "
|
|
48
|
-
"@instructure/ui-menu": "
|
|
49
|
-
"@instructure/ui-
|
|
50
|
-
"@instructure/ui-
|
|
51
|
-
"@instructure/ui-
|
|
52
|
-
"@instructure/ui-
|
|
53
|
-
"@instructure/ui-
|
|
54
|
-
"@instructure/ui-utils": "10.26.1",
|
|
55
|
-
"@instructure/ui-view": "10.26.1",
|
|
56
|
-
"prop-types": "^15.8.1"
|
|
38
|
+
"@instructure/console": "11.0.1-snapshot-0",
|
|
39
|
+
"@instructure/debounce": "11.0.1-snapshot-0",
|
|
40
|
+
"@instructure/emotion": "11.0.1-snapshot-0",
|
|
41
|
+
"@instructure/shared-types": "11.0.1-snapshot-0",
|
|
42
|
+
"@instructure/ui-a11y-content": "11.0.1-snapshot-0",
|
|
43
|
+
"@instructure/ui-a11y-utils": "11.0.1-snapshot-0",
|
|
44
|
+
"@instructure/ui-badge": "11.0.1-snapshot-0",
|
|
45
|
+
"@instructure/ui-dom-utils": "11.0.1-snapshot-0",
|
|
46
|
+
"@instructure/ui-focusable": "11.0.1-snapshot-0",
|
|
47
|
+
"@instructure/ui-icons": "11.0.1-snapshot-0",
|
|
48
|
+
"@instructure/ui-menu": "11.0.1-snapshot-0",
|
|
49
|
+
"@instructure/ui-react-utils": "11.0.1-snapshot-0",
|
|
50
|
+
"@instructure/ui-tooltip": "11.0.1-snapshot-0",
|
|
51
|
+
"@instructure/ui-truncate-list": "11.0.1-snapshot-0",
|
|
52
|
+
"@instructure/ui-utils": "11.0.1-snapshot-0",
|
|
53
|
+
"@instructure/ui-view": "11.0.1-snapshot-0"
|
|
57
54
|
},
|
|
58
55
|
"peerDependencies": {
|
|
59
|
-
"react": ">=
|
|
56
|
+
"react": ">=18 <=19"
|
|
60
57
|
},
|
|
61
58
|
"publishConfig": {
|
|
62
59
|
"access": "public"
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
matchComponentTypes,
|
|
32
32
|
passthroughProps
|
|
33
33
|
} from '@instructure/ui-react-utils'
|
|
34
|
-
import { testable } from '@instructure/ui-testable'
|
|
35
34
|
|
|
36
35
|
import { View } from '@instructure/ui-view'
|
|
37
36
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
|
@@ -42,7 +41,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
42
41
|
import generateStyle from './styles'
|
|
43
42
|
import generateComponentTheme from './theme'
|
|
44
43
|
import type { AppNavItemProps } from './props'
|
|
45
|
-
import { allowedProps
|
|
44
|
+
import { allowedProps } from './props'
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
---
|
|
@@ -52,12 +51,10 @@ id: AppNav.Item
|
|
|
52
51
|
@module Item
|
|
53
52
|
**/
|
|
54
53
|
@withStyle(generateStyle, generateComponentTheme)
|
|
55
|
-
@testable()
|
|
56
54
|
class Item extends Component<AppNavItemProps> {
|
|
57
55
|
static readonly componentId = 'AppNav.Item'
|
|
58
56
|
|
|
59
57
|
static allowedProps = allowedProps
|
|
60
|
-
static propTypes = propTypes
|
|
61
58
|
|
|
62
59
|
static defaultProps = {
|
|
63
60
|
children: null,
|
|
@@ -130,6 +127,7 @@ class Item extends Component<AppNavItemProps> {
|
|
|
130
127
|
borderRadius="medium"
|
|
131
128
|
cursor={isDisabled ? 'not-allowed' : cursor}
|
|
132
129
|
css={this.props.styles?.item}
|
|
130
|
+
data-cid="AppNav.Item"
|
|
133
131
|
>
|
|
134
132
|
{icon}
|
|
135
133
|
{labelIsForScreenReaders ? (
|
package/src/AppNav/Item/props.ts
CHANGED
|
@@ -21,16 +21,14 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
import PropTypes from 'prop-types'
|
|
25
24
|
|
|
26
25
|
import type {
|
|
27
26
|
AsElementType,
|
|
28
|
-
PropValidators,
|
|
29
27
|
AppNavItemTheme,
|
|
30
28
|
OtherHTMLAttributes
|
|
31
29
|
} from '@instructure/shared-types'
|
|
32
30
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
33
|
-
import type { Cursor } from '@instructure/
|
|
31
|
+
import type { Cursor } from '@instructure/shared-types'
|
|
34
32
|
import React from 'react'
|
|
35
33
|
import { Renderable } from '@instructure/shared-types'
|
|
36
34
|
|
|
@@ -88,24 +86,6 @@ type AppNavItemProps = AppNavItemOwnProps &
|
|
|
88
86
|
OtherHTMLAttributes<AppNavItemOwnProps>
|
|
89
87
|
|
|
90
88
|
type AppNavItemStyle = ComponentStyle<'item' | 'label'>
|
|
91
|
-
|
|
92
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
93
|
-
renderLabel: PropTypes.oneOfType([
|
|
94
|
-
PropTypes.node,
|
|
95
|
-
PropTypes.string,
|
|
96
|
-
PropTypes.func
|
|
97
|
-
]).isRequired,
|
|
98
|
-
renderAfter: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
99
|
-
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
100
|
-
href: PropTypes.string,
|
|
101
|
-
onClick: PropTypes.func,
|
|
102
|
-
isSelected: PropTypes.bool,
|
|
103
|
-
elementRef: PropTypes.func,
|
|
104
|
-
as: PropTypes.elementType,
|
|
105
|
-
cursor: PropTypes.string,
|
|
106
|
-
isDisabled: PropTypes.bool
|
|
107
|
-
}
|
|
108
|
-
|
|
109
89
|
const allowedProps: AllowedPropKeys = [
|
|
110
90
|
'renderLabel',
|
|
111
91
|
'renderAfter',
|
|
@@ -120,4 +100,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
120
100
|
]
|
|
121
101
|
|
|
122
102
|
export type { AppNavItemProps, AppNavItemStyle }
|
|
123
|
-
export {
|
|
103
|
+
export { allowedProps }
|
package/src/AppNav/index.tsx
CHANGED
|
@@ -27,7 +27,6 @@ import { ComponentElement, Component } from 'react'
|
|
|
27
27
|
import { withStyle } from '@instructure/emotion'
|
|
28
28
|
|
|
29
29
|
import { callRenderProp, omitProps } from '@instructure/ui-react-utils'
|
|
30
|
-
import { testable } from '@instructure/ui-testable'
|
|
31
30
|
|
|
32
31
|
import { View } from '@instructure/ui-view'
|
|
33
32
|
import { Menu } from '@instructure/ui-menu'
|
|
@@ -36,7 +35,7 @@ import { Item } from './Item'
|
|
|
36
35
|
import generateStyle from './styles'
|
|
37
36
|
import generateComponentTheme from './theme'
|
|
38
37
|
import type { AppNavProps } from './props'
|
|
39
|
-
import { allowedProps
|
|
38
|
+
import { allowedProps } from './props'
|
|
40
39
|
import { AppNavItemProps } from './Item/props'
|
|
41
40
|
|
|
42
41
|
import { TruncateList } from '@instructure/ui-truncate-list'
|
|
@@ -47,12 +46,10 @@ category: components
|
|
|
47
46
|
---
|
|
48
47
|
**/
|
|
49
48
|
@withStyle(generateStyle, generateComponentTheme)
|
|
50
|
-
@testable()
|
|
51
49
|
class AppNav extends Component<AppNavProps> {
|
|
52
50
|
static readonly componentId = 'AppNav'
|
|
53
51
|
|
|
54
52
|
static allowedProps = allowedProps
|
|
55
|
-
static propTypes = propTypes
|
|
56
53
|
|
|
57
54
|
static defaultProps = {
|
|
58
55
|
children: null,
|
|
@@ -139,6 +136,7 @@ class AppNav extends Component<AppNavProps> {
|
|
|
139
136
|
margin={margin}
|
|
140
137
|
display={hasRenderedContent ? 'flex' : 'block'}
|
|
141
138
|
elementRef={this.handleRef}
|
|
139
|
+
data-cid="AppNav"
|
|
142
140
|
>
|
|
143
141
|
{renderBeforeItems && <span>{renderBeforeItems}</span>}
|
|
144
142
|
|
package/src/AppNav/props.ts
CHANGED
|
@@ -22,11 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import React from 'react'
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
28
|
-
|
|
29
|
-
import { Item } from './Item'
|
|
30
25
|
|
|
31
26
|
import type {
|
|
32
27
|
Spacing,
|
|
@@ -34,7 +29,6 @@ import type {
|
|
|
34
29
|
ComponentStyle
|
|
35
30
|
} from '@instructure/emotion'
|
|
36
31
|
import type {
|
|
37
|
-
PropValidators,
|
|
38
32
|
AppNavTheme,
|
|
39
33
|
OtherHTMLAttributes
|
|
40
34
|
} from '@instructure/shared-types'
|
|
@@ -102,20 +96,6 @@ type AppNavStyle = ComponentStyle<'appNav' | 'alignCenter' | 'list'> & {
|
|
|
102
96
|
horizontalMargin: string
|
|
103
97
|
menuTriggerWidth: string
|
|
104
98
|
}
|
|
105
|
-
|
|
106
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
107
|
-
screenReaderLabel: PropTypes.string.isRequired,
|
|
108
|
-
children: ChildrenPropTypes.oneOf([Item]),
|
|
109
|
-
debounce: PropTypes.number,
|
|
110
|
-
renderBeforeItems: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
111
|
-
renderAfterItems: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
112
|
-
margin: PropTypes.string,
|
|
113
|
-
elementRef: PropTypes.func,
|
|
114
|
-
renderTruncateLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
115
|
-
onUpdate: PropTypes.func,
|
|
116
|
-
visibleItemsCount: PropTypes.number
|
|
117
|
-
}
|
|
118
|
-
|
|
119
99
|
const allowedProps: AllowedPropKeys = [
|
|
120
100
|
'screenReaderLabel',
|
|
121
101
|
'children',
|
|
@@ -130,4 +110,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
130
110
|
]
|
|
131
111
|
|
|
132
112
|
export type { AppNavProps, AppNavStyle }
|
|
133
|
-
export {
|
|
113
|
+
export { allowedProps }
|
package/tsconfig.build.json
CHANGED
|
@@ -22,10 +22,8 @@
|
|
|
22
22
|
{ "path": "../ui-focusable/tsconfig.build.json" },
|
|
23
23
|
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
24
24
|
{ "path": "../ui-menu/tsconfig.build.json" },
|
|
25
|
-
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
|
26
25
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
27
26
|
{ "path": "../ui-scripts/tsconfig.build.json" },
|
|
28
|
-
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
29
27
|
{ "path": "../ui-tooltip/tsconfig.build.json" },
|
|
30
28
|
{ "path": "../ui-truncate-list/tsconfig.build.json" },
|
|
31
29
|
{ "path": "../ui-utils/tsconfig.build.json" },
|