@instructure/ui-navigation 8.33.1 → 8.33.2
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 +4 -0
- package/es/AppNav/AppNavLocator.js +3 -1
- package/es/AppNav/Item/AppNavItemLocator.js +2 -1
- package/es/AppNav/Item/index.js +9 -23
- package/es/AppNav/Item/styles.js +1 -2
- package/es/AppNav/Item/theme.js +4 -4
- package/es/AppNav/index.js +6 -16
- package/es/AppNav/locator.js +1 -0
- package/es/AppNav/props.js +1 -0
- package/es/AppNav/styles.js +0 -1
- package/es/AppNav/theme.js +5 -5
- package/es/Navigation/NavigationItem/NavigationItemLocator.js +4 -3
- package/es/Navigation/NavigationItem/index.js +7 -19
- package/es/Navigation/NavigationItem/styles.js +0 -1
- package/es/Navigation/NavigationItem/theme.js +5 -5
- package/es/Navigation/NavigationLocator.js +2 -1
- package/es/Navigation/index.js +1 -21
- package/es/Navigation/props.js +1 -0
- package/es/Navigation/styles.js +0 -1
- package/es/Navigation/theme.js +6 -6
- package/es/index.js +1 -0
- package/lib/AppNav/AppNavLocator.js +1 -4
- package/lib/AppNav/Item/AppNavItemLocator.js +1 -3
- package/lib/AppNav/Item/index.js +8 -38
- package/lib/AppNav/Item/locator.js +0 -2
- package/lib/AppNav/Item/props.js +1 -3
- package/lib/AppNav/Item/styles.js +1 -3
- package/lib/AppNav/Item/theme.js +4 -5
- package/lib/AppNav/index.js +5 -32
- package/lib/AppNav/locator.js +0 -2
- package/lib/AppNav/props.js +1 -6
- package/lib/AppNav/styles.js +0 -2
- package/lib/AppNav/theme.js +5 -6
- package/lib/Navigation/NavigationItem/NavigationItemLocator.js +2 -4
- package/lib/Navigation/NavigationItem/index.js +6 -29
- package/lib/Navigation/NavigationItem/locator.js +0 -2
- package/lib/Navigation/NavigationItem/props.js +1 -3
- package/lib/Navigation/NavigationItem/styles.js +0 -2
- package/lib/Navigation/NavigationItem/theme.js +5 -6
- package/lib/Navigation/NavigationLocator.js +1 -4
- package/lib/Navigation/index.js +1 -34
- package/lib/Navigation/locator.js +0 -2
- package/lib/Navigation/props.js +1 -6
- package/lib/Navigation/styles.js +0 -2
- package/lib/Navigation/theme.js +6 -7
- package/lib/index.js +0 -2
- package/package.json +24 -24
- package/tsconfig.build.tsbuildinfo +1 -1
package/lib/Navigation/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -15,100 +13,73 @@ Object.defineProperty(exports, "NavigationItem", {
|
|
|
15
13
|
}
|
|
16
14
|
});
|
|
17
15
|
exports.default = void 0;
|
|
18
|
-
|
|
19
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
-
|
|
21
17
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
22
|
-
|
|
23
18
|
var _deprecated = require("@instructure/ui-react-utils/lib/deprecated.js");
|
|
24
|
-
|
|
25
19
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
26
|
-
|
|
27
20
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
28
|
-
|
|
29
21
|
var _IconMoveStartLine = require("@instructure/ui-icons/lib/IconMoveStartLine.js");
|
|
30
|
-
|
|
31
22
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
32
|
-
|
|
33
23
|
var _emotion = require("@instructure/emotion");
|
|
34
|
-
|
|
35
24
|
var _NavigationItem = require("./NavigationItem");
|
|
36
|
-
|
|
37
25
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
38
|
-
|
|
39
26
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
40
|
-
|
|
41
27
|
var _props = require("./props");
|
|
42
|
-
|
|
43
28
|
var _dec, _dec2, _dec3, _class, _class2;
|
|
44
|
-
|
|
45
29
|
const navMinimized = _ref => {
|
|
46
30
|
let minimized = _ref.minimized;
|
|
47
31
|
return {
|
|
48
32
|
minimized: !minimized
|
|
49
33
|
};
|
|
50
34
|
};
|
|
35
|
+
|
|
51
36
|
/**
|
|
52
37
|
---
|
|
53
38
|
category: components/deprecated
|
|
54
39
|
---
|
|
55
40
|
@tsProps
|
|
56
41
|
**/
|
|
57
|
-
|
|
58
|
-
|
|
59
42
|
let Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec3 = (0, _deprecated.deprecated)('9.0.0', null, 'No one uses <Navigation>, so we will deprecate it.'), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Navigation extends _react.Component {
|
|
60
43
|
constructor(props) {
|
|
61
44
|
super(props);
|
|
62
45
|
this.ref = null;
|
|
63
|
-
|
|
64
46
|
this.handleNavToggle = event => {
|
|
65
47
|
if (!this.isControlled()) {
|
|
66
48
|
this.setState(navMinimized);
|
|
67
49
|
}
|
|
68
|
-
|
|
69
50
|
if (typeof this.props.onMinimized === 'function') {
|
|
70
51
|
this.props.onMinimized(event, !this.minimized);
|
|
71
52
|
}
|
|
72
53
|
};
|
|
73
|
-
|
|
74
54
|
this.state = {
|
|
75
55
|
minimized: this.isControlled(props) ? !!props.minimized : !!props.defaultMinimized
|
|
76
56
|
};
|
|
77
57
|
}
|
|
78
|
-
|
|
79
58
|
componentDidMount() {
|
|
80
59
|
var _this$props$makeStyle, _this$props;
|
|
81
|
-
|
|
82
60
|
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
|
|
83
61
|
minimized: this.minimized
|
|
84
62
|
});
|
|
85
63
|
}
|
|
86
|
-
|
|
87
64
|
componentDidUpdate() {
|
|
88
65
|
var _this$props$makeStyle2, _this$props2;
|
|
89
|
-
|
|
90
66
|
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
|
|
91
67
|
minimized: this.minimized
|
|
92
68
|
});
|
|
93
69
|
}
|
|
94
|
-
|
|
95
70
|
get minimized() {
|
|
96
71
|
if (this.isControlled()) {
|
|
97
72
|
return !!this.props.minimized;
|
|
98
73
|
}
|
|
99
|
-
|
|
100
74
|
return !!this.state.minimized;
|
|
101
75
|
}
|
|
102
|
-
|
|
103
76
|
isControlled() {
|
|
104
77
|
let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
|
|
105
78
|
return typeof props.minimized === 'boolean';
|
|
106
79
|
}
|
|
107
|
-
|
|
108
80
|
renderChildren() {
|
|
109
81
|
return _react.Children.map(this.props.children, child => {
|
|
110
82
|
var _this$props$styles;
|
|
111
|
-
|
|
112
83
|
const navItem = (0, _safeCloneElement.safeCloneElement)(child, {
|
|
113
84
|
minimized: this.state.minimized
|
|
114
85
|
});
|
|
@@ -117,14 +88,11 @@ let Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
|
|
|
117
88
|
}, navItem);
|
|
118
89
|
});
|
|
119
90
|
}
|
|
120
|
-
|
|
121
91
|
toggleMessage() {
|
|
122
92
|
return this.state.minimized ? this.props.toggleLabel.minimizedLabel : this.props.toggleLabel.expandedLabel;
|
|
123
93
|
}
|
|
124
|
-
|
|
125
94
|
render() {
|
|
126
95
|
var _this$props$styles2, _this$props$styles3, _this$props$styles4, _this$props$styles5;
|
|
127
|
-
|
|
128
96
|
const label = this.props.label;
|
|
129
97
|
const props = (0, _omitProps.omitProps)(this.props, Navigation.allowedProps, ['minimized']);
|
|
130
98
|
return (0, _emotion.jsx)("nav", Object.assign({}, props, {
|
|
@@ -147,7 +115,6 @@ let Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
|
|
|
147
115
|
label: (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, this.toggleMessage())
|
|
148
116
|
})));
|
|
149
117
|
}
|
|
150
|
-
|
|
151
118
|
}, _class2.displayName = "Navigation", _class2.componentId = 'Navigation', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
152
119
|
children: null,
|
|
153
120
|
defaultMinimized: false,
|
package/lib/Navigation/props.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
13
|
-
|
|
14
10
|
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
15
|
-
|
|
16
11
|
var _NavigationItem = require("./NavigationItem");
|
|
17
|
-
|
|
18
12
|
/*
|
|
19
13
|
* The MIT License (MIT)
|
|
20
14
|
*
|
|
@@ -38,6 +32,7 @@ var _NavigationItem = require("./NavigationItem");
|
|
|
38
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
33
|
* SOFTWARE.
|
|
40
34
|
*/
|
|
35
|
+
|
|
41
36
|
const propTypes = {
|
|
42
37
|
children: _Children.Children.oneOf([_NavigationItem.NavigationItem]),
|
|
43
38
|
minimized: (0, _controllable.controllable)(_propTypes.default.bool, 'onMinimized', 'defaultMinimized'),
|
package/lib/Navigation/styles.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/*
|
|
9
8
|
* The MIT License (MIT)
|
|
10
9
|
*
|
|
@@ -81,6 +80,5 @@ const generateStyle = (componentTheme, props, state) => {
|
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
};
|
|
84
|
-
|
|
85
83
|
var _default = generateStyle;
|
|
86
84
|
exports.default = _default;
|
package/lib/Navigation/theme.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/*
|
|
9
8
|
* The MIT License (MIT)
|
|
10
9
|
*
|
|
@@ -36,10 +35,10 @@ exports.default = void 0;
|
|
|
36
35
|
*/
|
|
37
36
|
const generateComponentTheme = theme => {
|
|
38
37
|
const colors = theme.colors,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
spacing = theme.spacing,
|
|
39
|
+
borders = theme.borders,
|
|
40
|
+
transitions = theme.transitions,
|
|
41
|
+
themeName = theme.key;
|
|
43
42
|
const themeSpecificStyle = {
|
|
44
43
|
canvas: {
|
|
45
44
|
backgroundColor: theme['ic-brand-global-nav-bgd'],
|
|
@@ -60,10 +59,10 @@ const generateComponentTheme = theme => {
|
|
|
60
59
|
marginBottom: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
61
60
|
toggleTransition: transitions === null || transitions === void 0 ? void 0 : transitions.duration
|
|
62
61
|
};
|
|
63
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
...componentVariables,
|
|
64
64
|
...themeSpecificStyle[themeName]
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
|
|
68
67
|
var _default = generateComponentTheme;
|
|
69
68
|
exports.default = _default;
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-navigation",
|
|
3
|
-
"version": "8.33.
|
|
3
|
+
"version": "8.33.2",
|
|
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,32 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.33.
|
|
27
|
-
"@instructure/ui-color-utils": "8.33.
|
|
28
|
-
"@instructure/ui-test-locator": "8.33.
|
|
29
|
-
"@instructure/ui-test-utils": "8.33.
|
|
30
|
-
"@instructure/ui-themes": "8.33.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.33.2",
|
|
27
|
+
"@instructure/ui-color-utils": "8.33.2",
|
|
28
|
+
"@instructure/ui-test-locator": "8.33.2",
|
|
29
|
+
"@instructure/ui-test-utils": "8.33.2",
|
|
30
|
+
"@instructure/ui-themes": "8.33.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/console": "8.33.
|
|
35
|
-
"@instructure/debounce": "8.33.
|
|
36
|
-
"@instructure/emotion": "8.33.
|
|
37
|
-
"@instructure/shared-types": "8.33.
|
|
38
|
-
"@instructure/ui-a11y-content": "8.33.
|
|
39
|
-
"@instructure/ui-a11y-utils": "8.33.
|
|
40
|
-
"@instructure/ui-badge": "8.33.
|
|
41
|
-
"@instructure/ui-dom-utils": "8.33.
|
|
42
|
-
"@instructure/ui-focusable": "8.33.
|
|
43
|
-
"@instructure/ui-icons": "8.33.
|
|
44
|
-
"@instructure/ui-menu": "8.33.
|
|
45
|
-
"@instructure/ui-prop-types": "8.33.
|
|
46
|
-
"@instructure/ui-react-utils": "8.33.
|
|
47
|
-
"@instructure/ui-testable": "8.33.
|
|
48
|
-
"@instructure/ui-tooltip": "8.33.
|
|
49
|
-
"@instructure/ui-truncate-list": "8.33.
|
|
50
|
-
"@instructure/ui-utils": "8.33.
|
|
51
|
-
"@instructure/ui-view": "8.33.
|
|
34
|
+
"@instructure/console": "8.33.2",
|
|
35
|
+
"@instructure/debounce": "8.33.2",
|
|
36
|
+
"@instructure/emotion": "8.33.2",
|
|
37
|
+
"@instructure/shared-types": "8.33.2",
|
|
38
|
+
"@instructure/ui-a11y-content": "8.33.2",
|
|
39
|
+
"@instructure/ui-a11y-utils": "8.33.2",
|
|
40
|
+
"@instructure/ui-badge": "8.33.2",
|
|
41
|
+
"@instructure/ui-dom-utils": "8.33.2",
|
|
42
|
+
"@instructure/ui-focusable": "8.33.2",
|
|
43
|
+
"@instructure/ui-icons": "8.33.2",
|
|
44
|
+
"@instructure/ui-menu": "8.33.2",
|
|
45
|
+
"@instructure/ui-prop-types": "8.33.2",
|
|
46
|
+
"@instructure/ui-react-utils": "8.33.2",
|
|
47
|
+
"@instructure/ui-testable": "8.33.2",
|
|
48
|
+
"@instructure/ui-tooltip": "8.33.2",
|
|
49
|
+
"@instructure/ui-truncate-list": "8.33.2",
|
|
50
|
+
"@instructure/ui-utils": "8.33.2",
|
|
51
|
+
"@instructure/ui-view": "8.33.2",
|
|
52
52
|
"prop-types": "^15"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|