@instructure/ui-side-nav-bar 10.26.1 → 11.0.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 +23 -2
- package/es/SideNavBar/SideNavBarItem/index.js +6 -6
- package/es/SideNavBar/SideNavBarItem/props.js +2 -12
- package/es/SideNavBar/index.js +6 -6
- package/es/SideNavBar/props.js +1 -17
- package/lib/SideNavBar/SideNavBarItem/index.js +5 -5
- package/lib/SideNavBar/SideNavBarItem/props.js +1 -13
- package/lib/SideNavBar/index.js +5 -5
- package/lib/SideNavBar/props.js +1 -19
- package/package.json +16 -19
- package/src/SideNavBar/SideNavBarItem/index.tsx +2 -4
- package/src/SideNavBar/SideNavBarItem/props.ts +2 -15
- package/src/SideNavBar/index.tsx +2 -5
- package/src/SideNavBar/props.ts +1 -25
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/SideNavBar/SideNavBarItem/index.d.ts +0 -10
- package/types/SideNavBar/SideNavBarItem/index.d.ts.map +1 -1
- package/types/SideNavBar/SideNavBarItem/props.d.ts +2 -3
- package/types/SideNavBar/SideNavBarItem/props.d.ts.map +1 -1
- package/types/SideNavBar/index.d.ts +0 -13
- package/types/SideNavBar/index.d.ts.map +1 -1
- package/types/SideNavBar/props.d.ts +2 -3
- package/types/SideNavBar/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,30 @@
|
|
|
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.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
+
- React 16 and 17 are no longer supported
|
|
18
|
+
- remove `PropTypes` from all packages
|
|
19
|
+
- remove `CodeEditor` component
|
|
20
|
+
- remove `@instui/theme-registry` package
|
|
21
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
+
- `variables` field on theme objects are removed
|
|
26
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
+
`isStacked`, `hover`, and `headers`
|
|
28
|
+
- `Table`'s `caption` prop is now required
|
|
29
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
9
30
|
|
|
10
31
|
|
|
11
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _SideNavBarItem;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -24,14 +24,13 @@ var _dec, _dec2, _class, _SideNavBarItem;
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
|
-
import { testable } from '@instructure/ui-testable';
|
|
28
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils';
|
|
29
28
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
30
29
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
31
30
|
import { withStyle } from '@instructure/emotion';
|
|
32
31
|
import generateStyle from './styles';
|
|
33
32
|
import generateComponentTheme from './theme';
|
|
34
|
-
import { allowedProps
|
|
33
|
+
import { allowedProps } from './props';
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
---
|
|
@@ -40,7 +39,7 @@ id: SideNavBar.Item
|
|
|
40
39
|
---
|
|
41
40
|
**/
|
|
42
41
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
43
|
-
let SideNavBarItem = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
42
|
+
let SideNavBarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_SideNavBarItem = class SideNavBarItem extends Component {
|
|
44
43
|
constructor(...args) {
|
|
45
44
|
super(...args);
|
|
46
45
|
this.ref = null;
|
|
@@ -80,6 +79,7 @@ let SideNavBarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
80
79
|
ref: addRef ? this.handleRef : void 0,
|
|
81
80
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.navigationItem,
|
|
82
81
|
"aria-label": this.props.minimized ? label : void 0,
|
|
82
|
+
"data-cid": "SideNavBarItem",
|
|
83
83
|
children: [_jsx("div", {
|
|
84
84
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.icon,
|
|
85
85
|
children: icon
|
|
@@ -102,10 +102,10 @@ let SideNavBarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
102
102
|
children: link
|
|
103
103
|
}) : link;
|
|
104
104
|
}
|
|
105
|
-
}, _SideNavBarItem.displayName = "SideNavBarItem", _SideNavBarItem.componentId = 'SideNavBar.Item', _SideNavBarItem.allowedProps = allowedProps, _SideNavBarItem.
|
|
105
|
+
}, _SideNavBarItem.displayName = "SideNavBarItem", _SideNavBarItem.componentId = 'SideNavBar.Item', _SideNavBarItem.allowedProps = allowedProps, _SideNavBarItem.defaultProps = {
|
|
106
106
|
as: 'a',
|
|
107
107
|
selected: false,
|
|
108
108
|
minimized: false
|
|
109
|
-
}, _SideNavBarItem)) || _class)
|
|
109
|
+
}, _SideNavBarItem)) || _class);
|
|
110
110
|
export default SideNavBarItem;
|
|
111
111
|
export { SideNavBarItem };
|
|
@@ -21,16 +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
|
-
elementRef: PropTypes.func,
|
|
27
|
-
icon: PropTypes.node.isRequired,
|
|
28
|
-
label: PropTypes.node.isRequired,
|
|
29
|
-
as: PropTypes.elementType,
|
|
30
|
-
href: PropTypes.string,
|
|
31
|
-
onClick: PropTypes.func,
|
|
32
|
-
selected: PropTypes.bool,
|
|
33
|
-
minimized: PropTypes.bool
|
|
34
|
-
};
|
|
24
|
+
|
|
35
25
|
const allowedProps = ['elementRef', 'icon', 'label', 'as', 'href', 'onClick', 'selected', 'minimized'];
|
|
36
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/SideNavBar/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _SideNavBar;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -23,7 +23,6 @@ var _dec, _dec2, _class, _SideNavBar;
|
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
import { Component, Children, isValidElement } from 'react';
|
|
26
|
-
import { testable } from '@instructure/ui-testable';
|
|
27
26
|
import { omitProps, safeCloneElement } from '@instructure/ui-react-utils';
|
|
28
27
|
import { IconMoveStartLine } from '@instructure/ui-icons';
|
|
29
28
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
@@ -31,7 +30,7 @@ import { withStyle } from '@instructure/emotion';
|
|
|
31
30
|
import { SideNavBarItem } from './SideNavBarItem';
|
|
32
31
|
import generateStyle from './styles';
|
|
33
32
|
import generateComponentTheme from './theme';
|
|
34
|
-
import { allowedProps
|
|
33
|
+
import { allowedProps } from './props';
|
|
35
34
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
36
35
|
const navMinimized = ({
|
|
37
36
|
minimized
|
|
@@ -44,7 +43,7 @@ const navMinimized = ({
|
|
|
44
43
|
category: components
|
|
45
44
|
---
|
|
46
45
|
**/
|
|
47
|
-
let SideNavBar = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
46
|
+
let SideNavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_SideNavBar = class SideNavBar extends Component {
|
|
48
47
|
constructor(props) {
|
|
49
48
|
super(props);
|
|
50
49
|
this.ref = null;
|
|
@@ -104,6 +103,7 @@ let SideNavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
104
103
|
return _jsxs("nav", {
|
|
105
104
|
...props,
|
|
106
105
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
|
|
106
|
+
"data-cid": "SideNavBar",
|
|
107
107
|
"aria-label": label,
|
|
108
108
|
ref: element => {
|
|
109
109
|
this.ref = element;
|
|
@@ -124,11 +124,11 @@ let SideNavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
124
124
|
})]
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
}, _SideNavBar.displayName = "SideNavBar", _SideNavBar.componentId = 'SideNavBar', _SideNavBar.allowedProps = allowedProps, _SideNavBar.
|
|
127
|
+
}, _SideNavBar.displayName = "SideNavBar", _SideNavBar.componentId = 'SideNavBar', _SideNavBar.allowedProps = allowedProps, _SideNavBar.defaultProps = {
|
|
128
128
|
children: null,
|
|
129
129
|
defaultMinimized: false,
|
|
130
130
|
// TODO we should investigate later if it used or not
|
|
131
131
|
onClick: function (_e) {}
|
|
132
|
-
}, _SideNavBar.Item = SideNavBarItem, _SideNavBar)) || _class)
|
|
132
|
+
}, _SideNavBar.Item = SideNavBarItem, _SideNavBar)) || _class);
|
|
133
133
|
export default SideNavBar;
|
|
134
134
|
export { SideNavBar, SideNavBarItem };
|
package/es/SideNavBar/props.js
CHANGED
|
@@ -22,21 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { controllable, Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
27
|
-
import { SideNavBarItem } from './SideNavBarItem';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
children: ChildrenPropTypes.oneOf([SideNavBarItem]),
|
|
30
|
-
minimized: controllable(PropTypes.bool, 'onMinimized', 'defaultMinimized'),
|
|
31
|
-
defaultMinimized: PropTypes.bool,
|
|
32
|
-
onMinimized: PropTypes.func,
|
|
33
|
-
label: PropTypes.string.isRequired,
|
|
34
|
-
toggleLabel: PropTypes.shape({
|
|
35
|
-
expandedLabel: PropTypes.string,
|
|
36
|
-
minimizedLabel: PropTypes.string
|
|
37
|
-
}).isRequired,
|
|
38
|
-
href: PropTypes.string,
|
|
39
|
-
onClick: PropTypes.func
|
|
40
|
-
};
|
|
41
25
|
const allowedProps = ['children', 'minimized', 'defaultMinimized', 'onMinimized', 'label', 'toggleLabel', 'href', 'onClick'];
|
|
42
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.SideNavBarItem = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
10
9
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
11
10
|
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
12
11
|
var _Tooltip = require("@instructure/ui-tooltip/lib/Tooltip");
|
|
@@ -16,7 +15,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
16
15
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
17
16
|
var _props = require("./props");
|
|
18
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var _dec,
|
|
18
|
+
var _dec, _class, _SideNavBarItem;
|
|
20
19
|
/*
|
|
21
20
|
* The MIT License (MIT)
|
|
22
21
|
*
|
|
@@ -46,7 +45,7 @@ parent: SideNavBar
|
|
|
46
45
|
id: SideNavBar.Item
|
|
47
46
|
---
|
|
48
47
|
**/
|
|
49
|
-
let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
48
|
+
let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_SideNavBarItem = class SideNavBarItem extends _react.Component {
|
|
50
49
|
constructor(...args) {
|
|
51
50
|
super(...args);
|
|
52
51
|
this.ref = null;
|
|
@@ -86,6 +85,7 @@ let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyle)(_s
|
|
|
86
85
|
ref: addRef ? this.handleRef : void 0,
|
|
87
86
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.navigationItem,
|
|
88
87
|
"aria-label": this.props.minimized ? label : void 0,
|
|
88
|
+
"data-cid": "SideNavBarItem",
|
|
89
89
|
children: [(0, _jsxRuntime.jsx)("div", {
|
|
90
90
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.icon,
|
|
91
91
|
children: icon
|
|
@@ -108,9 +108,9 @@ let SideNavBarItem = exports.SideNavBarItem = (_dec = (0, _emotion.withStyle)(_s
|
|
|
108
108
|
children: link
|
|
109
109
|
}) : link;
|
|
110
110
|
}
|
|
111
|
-
}, _SideNavBarItem.displayName = "SideNavBarItem", _SideNavBarItem.componentId = 'SideNavBar.Item', _SideNavBarItem.allowedProps = _props.allowedProps, _SideNavBarItem.
|
|
111
|
+
}, _SideNavBarItem.displayName = "SideNavBarItem", _SideNavBarItem.componentId = 'SideNavBar.Item', _SideNavBarItem.allowedProps = _props.allowedProps, _SideNavBarItem.defaultProps = {
|
|
112
112
|
as: 'a',
|
|
113
113
|
selected: false,
|
|
114
114
|
minimized: false
|
|
115
|
-
}, _SideNavBarItem)) || _class)
|
|
115
|
+
}, _SideNavBarItem)) || _class);
|
|
116
116
|
var _default = exports.default = SideNavBarItem;
|
|
@@ -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,14 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
elementRef: _propTypes.default.func,
|
|
35
|
-
icon: _propTypes.default.node.isRequired,
|
|
36
|
-
label: _propTypes.default.node.isRequired,
|
|
37
|
-
as: _propTypes.default.elementType,
|
|
38
|
-
href: _propTypes.default.string,
|
|
39
|
-
onClick: _propTypes.default.func,
|
|
40
|
-
selected: _propTypes.default.bool,
|
|
41
|
-
minimized: _propTypes.default.bool
|
|
42
|
-
};
|
|
43
31
|
const allowedProps = exports.allowedProps = ['elementRef', 'icon', 'label', 'as', 'href', 'onClick', 'selected', 'minimized'];
|
package/lib/SideNavBar/index.js
CHANGED
|
@@ -13,7 +13,6 @@ Object.defineProperty(exports, "SideNavBarItem", {
|
|
|
13
13
|
});
|
|
14
14
|
exports.default = void 0;
|
|
15
15
|
var _react = require("react");
|
|
16
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
17
16
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
18
17
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
19
18
|
var _IconMoveStartLine = require("@instructure/ui-icons/lib/IconMoveStartLine.js");
|
|
@@ -24,7 +23,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
24
23
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
25
24
|
var _props = require("./props");
|
|
26
25
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
27
|
-
var _dec,
|
|
26
|
+
var _dec, _class, _SideNavBar;
|
|
28
27
|
/*
|
|
29
28
|
* The MIT License (MIT)
|
|
30
29
|
*
|
|
@@ -59,7 +58,7 @@ const navMinimized = ({
|
|
|
59
58
|
category: components
|
|
60
59
|
---
|
|
61
60
|
**/
|
|
62
|
-
let SideNavBar = exports.SideNavBar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
61
|
+
let SideNavBar = exports.SideNavBar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_SideNavBar = class SideNavBar extends _react.Component {
|
|
63
62
|
constructor(props) {
|
|
64
63
|
super(props);
|
|
65
64
|
this.ref = null;
|
|
@@ -119,6 +118,7 @@ let SideNavBar = exports.SideNavBar = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
119
118
|
return (0, _jsxRuntime.jsxs)("nav", {
|
|
120
119
|
...props,
|
|
121
120
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
|
|
121
|
+
"data-cid": "SideNavBar",
|
|
122
122
|
"aria-label": label,
|
|
123
123
|
ref: element => {
|
|
124
124
|
this.ref = element;
|
|
@@ -139,10 +139,10 @@ let SideNavBar = exports.SideNavBar = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
139
139
|
})]
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
}, _SideNavBar.displayName = "SideNavBar", _SideNavBar.componentId = 'SideNavBar', _SideNavBar.allowedProps = _props.allowedProps, _SideNavBar.
|
|
142
|
+
}, _SideNavBar.displayName = "SideNavBar", _SideNavBar.componentId = 'SideNavBar', _SideNavBar.allowedProps = _props.allowedProps, _SideNavBar.defaultProps = {
|
|
143
143
|
children: null,
|
|
144
144
|
defaultMinimized: false,
|
|
145
145
|
// TODO we should investigate later if it used or not
|
|
146
146
|
onClick: function (_e) {}
|
|
147
|
-
}, _SideNavBar.Item = _SideNavBarItem.SideNavBarItem, _SideNavBar)) || _class)
|
|
147
|
+
}, _SideNavBar.Item = _SideNavBarItem.SideNavBarItem, _SideNavBar)) || _class);
|
|
148
148
|
var _default = exports.default = SideNavBar;
|
package/lib/SideNavBar/props.js
CHANGED
|
@@ -1,14 +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 _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
10
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
11
|
-
var _SideNavBarItem = require("./SideNavBarItem");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
12
7
|
/*
|
|
13
8
|
* The MIT License (MIT)
|
|
14
9
|
*
|
|
@@ -33,17 +28,4 @@ var _SideNavBarItem = require("./SideNavBarItem");
|
|
|
33
28
|
* SOFTWARE.
|
|
34
29
|
*/
|
|
35
30
|
|
|
36
|
-
const propTypes = exports.propTypes = {
|
|
37
|
-
children: _Children.Children.oneOf([_SideNavBarItem.SideNavBarItem]),
|
|
38
|
-
minimized: (0, _controllable.controllable)(_propTypes.default.bool, 'onMinimized', 'defaultMinimized'),
|
|
39
|
-
defaultMinimized: _propTypes.default.bool,
|
|
40
|
-
onMinimized: _propTypes.default.func,
|
|
41
|
-
label: _propTypes.default.string.isRequired,
|
|
42
|
-
toggleLabel: _propTypes.default.shape({
|
|
43
|
-
expandedLabel: _propTypes.default.string,
|
|
44
|
-
minimizedLabel: _propTypes.default.string
|
|
45
|
-
}).isRequired,
|
|
46
|
-
href: _propTypes.default.string,
|
|
47
|
-
onClick: _propTypes.default.func
|
|
48
|
-
};
|
|
49
31
|
const allowedProps = exports.allowedProps = ['children', 'minimized', 'defaultMinimized', 'onMinimized', 'label', 'toggleLabel', 'href', 'onClick'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-side-nav-bar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.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,32 +23,29 @@
|
|
|
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-themes": "
|
|
26
|
+
"@instructure/ui-axe-check": "11.0.0",
|
|
27
|
+
"@instructure/ui-babel-preset": "11.0.0",
|
|
28
|
+
"@instructure/ui-color-utils": "11.0.0",
|
|
29
|
+
"@instructure/ui-themes": "11.0.0",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
|
-
"@testing-library/react": "
|
|
31
|
+
"@testing-library/react": "15.0.7",
|
|
32
32
|
"@testing-library/user-event": "^14.6.1",
|
|
33
33
|
"vitest": "^3.2.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.27.6",
|
|
37
|
-
"@instructure/debounce": "
|
|
38
|
-
"@instructure/emotion": "
|
|
39
|
-
"@instructure/shared-types": "
|
|
40
|
-
"@instructure/ui-a11y-content": "
|
|
41
|
-
"@instructure/ui-a11y-utils": "
|
|
42
|
-
"@instructure/ui-badge": "
|
|
43
|
-
"@instructure/ui-icons": "
|
|
44
|
-
"@instructure/ui-
|
|
45
|
-
"@instructure/ui-
|
|
46
|
-
"@instructure/ui-testable": "10.26.1",
|
|
47
|
-
"@instructure/ui-tooltip": "10.26.1",
|
|
48
|
-
"prop-types": "^15.8.1"
|
|
37
|
+
"@instructure/debounce": "11.0.0",
|
|
38
|
+
"@instructure/emotion": "11.0.0",
|
|
39
|
+
"@instructure/shared-types": "11.0.0",
|
|
40
|
+
"@instructure/ui-a11y-content": "11.0.0",
|
|
41
|
+
"@instructure/ui-a11y-utils": "11.0.0",
|
|
42
|
+
"@instructure/ui-badge": "11.0.0",
|
|
43
|
+
"@instructure/ui-icons": "11.0.0",
|
|
44
|
+
"@instructure/ui-react-utils": "11.0.0",
|
|
45
|
+
"@instructure/ui-tooltip": "11.0.0"
|
|
49
46
|
},
|
|
50
47
|
"peerDependencies": {
|
|
51
|
-
"react": ">=
|
|
48
|
+
"react": ">=18 <=19"
|
|
52
49
|
},
|
|
53
50
|
"publishConfig": {
|
|
54
51
|
"access": "public"
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
|
-
import { testable } from '@instructure/ui-testable'
|
|
28
27
|
import { omitProps, getElementType } from '@instructure/ui-react-utils'
|
|
29
28
|
import { Tooltip } from '@instructure/ui-tooltip'
|
|
30
29
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
|
|
@@ -33,7 +32,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
33
32
|
import generateStyle from './styles'
|
|
34
33
|
import generateComponentTheme from './theme'
|
|
35
34
|
import type { SideNavBarItemProps } from './props'
|
|
36
|
-
import { allowedProps
|
|
35
|
+
import { allowedProps } from './props'
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
38
|
---
|
|
@@ -42,12 +41,10 @@ id: SideNavBar.Item
|
|
|
42
41
|
---
|
|
43
42
|
**/
|
|
44
43
|
@withStyle(generateStyle, generateComponentTheme)
|
|
45
|
-
@testable()
|
|
46
44
|
class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
47
45
|
static readonly componentId = 'SideNavBar.Item'
|
|
48
46
|
|
|
49
47
|
static allowedProps = allowedProps
|
|
50
|
-
static propTypes = propTypes
|
|
51
48
|
|
|
52
49
|
static defaultProps = {
|
|
53
50
|
as: 'a',
|
|
@@ -88,6 +85,7 @@ class SideNavBarItem extends Component<SideNavBarItemProps> {
|
|
|
88
85
|
ref={addRef ? this.handleRef : undefined}
|
|
89
86
|
css={this.props.styles?.navigationItem}
|
|
90
87
|
aria-label={this.props.minimized ? (label as string) : undefined}
|
|
88
|
+
data-cid="SideNavBarItem"
|
|
91
89
|
>
|
|
92
90
|
<div css={this.props.styles?.icon}>{icon}</div>
|
|
93
91
|
{!this.props.minimized ? (
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
import React from 'react'
|
|
26
26
|
import type {
|
|
27
27
|
AsElementType,
|
|
28
|
-
PropValidators,
|
|
29
28
|
SideNavBarItemTheme,
|
|
30
29
|
OtherHTMLAttributes
|
|
31
30
|
} from '@instructure/shared-types'
|
|
@@ -75,18 +74,6 @@ type SideNavBarItemProps = SideNavBarItemOwnProps &
|
|
|
75
74
|
OtherHTMLAttributes<SideNavBarItemOwnProps>
|
|
76
75
|
|
|
77
76
|
type SideNavBarItemStyle = ComponentStyle<'navigationItem' | 'icon' | 'label'>
|
|
78
|
-
|
|
79
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
80
|
-
elementRef: PropTypes.func,
|
|
81
|
-
icon: PropTypes.node.isRequired,
|
|
82
|
-
label: PropTypes.node.isRequired,
|
|
83
|
-
as: PropTypes.elementType,
|
|
84
|
-
href: PropTypes.string,
|
|
85
|
-
onClick: PropTypes.func,
|
|
86
|
-
selected: PropTypes.bool,
|
|
87
|
-
minimized: PropTypes.bool
|
|
88
|
-
}
|
|
89
|
-
|
|
90
77
|
const allowedProps: AllowedPropKeys = [
|
|
91
78
|
'elementRef',
|
|
92
79
|
'icon',
|
|
@@ -99,4 +86,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
99
86
|
]
|
|
100
87
|
|
|
101
88
|
export type { SideNavBarItemProps, SideNavBarItemStyle }
|
|
102
|
-
export {
|
|
89
|
+
export { allowedProps }
|
package/src/SideNavBar/index.tsx
CHANGED
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { Component, Children, ReactElement, isValidElement } from 'react'
|
|
25
25
|
|
|
26
|
-
import { testable } from '@instructure/ui-testable'
|
|
27
|
-
|
|
28
26
|
import { omitProps, safeCloneElement } from '@instructure/ui-react-utils'
|
|
29
27
|
import { IconMoveStartLine } from '@instructure/ui-icons'
|
|
30
28
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
|
@@ -35,7 +33,7 @@ import { SideNavBarItem } from './SideNavBarItem'
|
|
|
35
33
|
import generateStyle from './styles'
|
|
36
34
|
import generateComponentTheme from './theme'
|
|
37
35
|
import type { SideNavBarProps, SideNavBarState } from './props'
|
|
38
|
-
import { allowedProps
|
|
36
|
+
import { allowedProps } from './props'
|
|
39
37
|
|
|
40
38
|
const navMinimized = ({ minimized }: { minimized: boolean }) => ({
|
|
41
39
|
minimized: !minimized
|
|
@@ -47,12 +45,10 @@ category: components
|
|
|
47
45
|
---
|
|
48
46
|
**/
|
|
49
47
|
@withStyle(generateStyle, generateComponentTheme)
|
|
50
|
-
@testable()
|
|
51
48
|
class SideNavBar extends Component<SideNavBarProps, SideNavBarState> {
|
|
52
49
|
static readonly componentId = 'SideNavBar'
|
|
53
50
|
|
|
54
51
|
static allowedProps = allowedProps
|
|
55
|
-
static propTypes = propTypes
|
|
56
52
|
|
|
57
53
|
static defaultProps = {
|
|
58
54
|
children: null,
|
|
@@ -128,6 +124,7 @@ class SideNavBar extends Component<SideNavBarProps, SideNavBarState> {
|
|
|
128
124
|
<nav
|
|
129
125
|
{...props}
|
|
130
126
|
css={this.props.styles?.navigation}
|
|
127
|
+
data-cid="SideNavBar"
|
|
131
128
|
aria-label={label}
|
|
132
129
|
ref={(element) => {
|
|
133
130
|
this.ref = element
|
package/src/SideNavBar/props.ts
CHANGED
|
@@ -22,17 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import React from 'react'
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
controllable,
|
|
29
|
-
Children as ChildrenPropTypes
|
|
30
|
-
} from '@instructure/ui-prop-types'
|
|
31
|
-
|
|
32
|
-
import { SideNavBarItem } from './SideNavBarItem'
|
|
33
25
|
|
|
34
26
|
import type {
|
|
35
|
-
PropValidators,
|
|
36
27
|
SideNavBarTheme,
|
|
37
28
|
OtherHTMLAttributes
|
|
38
29
|
} from '@instructure/shared-types'
|
|
@@ -88,21 +79,6 @@ type SideNavBarProps = SideNavBarOwnProps &
|
|
|
88
79
|
type SideNavBarStyle = ComponentStyle<
|
|
89
80
|
'navigation' | 'list' | 'content' | 'toggleIcon'
|
|
90
81
|
>
|
|
91
|
-
|
|
92
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
93
|
-
children: ChildrenPropTypes.oneOf([SideNavBarItem]),
|
|
94
|
-
minimized: controllable(PropTypes.bool, 'onMinimized', 'defaultMinimized'),
|
|
95
|
-
defaultMinimized: PropTypes.bool,
|
|
96
|
-
onMinimized: PropTypes.func,
|
|
97
|
-
label: PropTypes.string.isRequired,
|
|
98
|
-
toggleLabel: PropTypes.shape({
|
|
99
|
-
expandedLabel: PropTypes.string,
|
|
100
|
-
minimizedLabel: PropTypes.string
|
|
101
|
-
}).isRequired,
|
|
102
|
-
href: PropTypes.string,
|
|
103
|
-
onClick: PropTypes.func
|
|
104
|
-
}
|
|
105
|
-
|
|
106
82
|
const allowedProps: AllowedPropKeys = [
|
|
107
83
|
'children',
|
|
108
84
|
'minimized',
|
|
@@ -115,4 +91,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
115
91
|
]
|
|
116
92
|
|
|
117
93
|
export type { SideNavBarProps, SideNavBarState, SideNavBarStyle }
|
|
118
|
-
export {
|
|
94
|
+
export { allowedProps }
|
package/tsconfig.build.json
CHANGED
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
{ "path": "../ui-a11y-utils/tsconfig.build.json" },
|
|
19
19
|
{ "path": "../ui-badge/tsconfig.build.json" },
|
|
20
20
|
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
21
|
-
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
|
22
21
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
23
|
-
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
24
22
|
{ "path": "../ui-tooltip/tsconfig.build.json" }
|
|
25
23
|
]
|
|
26
24
|
}
|