@instructure/ui-navigation 8.56.2-pr-snapshot-1721749364069 → 8.56.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 +1 -1
- package/lib/AppNav/AppNavLocator.js +2 -2
- package/lib/AppNav/Item/AppNavItemLocator.js +2 -2
- package/lib/AppNav/Item/index.js +14 -11
- package/lib/AppNav/index.js +17 -16
- package/lib/AppNav/props.js +2 -2
- package/lib/Navigation/NavigationItem/NavigationItemLocator.js +3 -3
- package/lib/Navigation/NavigationItem/index.js +10 -9
- package/lib/Navigation/NavigationLocator.js +2 -2
- package/lib/Navigation/index.js +11 -9
- package/lib/Navigation/props.js +4 -3
- package/package.json +24 -24
- package/tsconfig.build.tsbuildinfo +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
|
-
## [8.56.2
|
|
6
|
+
## [8.56.2](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2) (2024-08-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-navigation
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AppNavLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
8
|
var _index = require("./index");
|
|
9
9
|
var _AppNavItemLocator = require("./Item/AppNavItemLocator");
|
|
10
10
|
/*
|
|
@@ -32,7 +32,7 @@ var _AppNavItemLocator = require("./Item/AppNavItemLocator");
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
|
-
const AppNavLocator = exports.AppNavLocator = (0,
|
|
35
|
+
const AppNavLocator = exports.AppNavLocator = (0, _locator.locator)(_index.AppNav.selector, {
|
|
36
36
|
findAllItems: (...args) => {
|
|
37
37
|
return _AppNavItemLocator.AppNavItemLocator.findAll(...args);
|
|
38
38
|
},
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AppNavItemLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
8
|
var _index = require("./index");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -31,4 +31,4 @@ var _index = require("./index");
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
34
|
-
const AppNavItemLocator = exports.AppNavItemLocator = (0,
|
|
34
|
+
const AppNavItemLocator = exports.AppNavItemLocator = (0, _locator.locator)(_index.Item.selector);
|
package/lib/AppNav/Item/index.js
CHANGED
|
@@ -8,10 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.Item = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _console = require("@instructure/console");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
12
|
+
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
13
|
+
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
14
|
+
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
15
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
16
|
+
var _View = require("@instructure/ui-view/lib/View");
|
|
17
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
15
18
|
var _emotion = require("@instructure/emotion");
|
|
16
19
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
20
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -48,7 +51,7 @@ id: AppNav.Item
|
|
|
48
51
|
---
|
|
49
52
|
@module Item
|
|
50
53
|
**/
|
|
51
|
-
let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
54
|
+
let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Item extends _react.Component {
|
|
52
55
|
constructor(...args) {
|
|
53
56
|
super(...args);
|
|
54
57
|
this.ref = null;
|
|
@@ -81,7 +84,7 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
81
84
|
}
|
|
82
85
|
render() {
|
|
83
86
|
var _this$props$styles, _this$props$styles2;
|
|
84
|
-
const ElementType = (0,
|
|
87
|
+
const ElementType = (0, _getElementType.getElementType)(Item, this.props);
|
|
85
88
|
const _this$props4 = this.props,
|
|
86
89
|
renderIcon = _this$props4.renderIcon,
|
|
87
90
|
renderLabel = _this$props4.renderLabel,
|
|
@@ -89,13 +92,13 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
89
92
|
renderAfter = _this$props4.renderAfter,
|
|
90
93
|
cursor = _this$props4.cursor,
|
|
91
94
|
isDisabled = _this$props4.isDisabled;
|
|
92
|
-
const icon = (0,
|
|
93
|
-
const label = (0,
|
|
94
|
-
const labelIsForScreenReaders = (0,
|
|
95
|
+
const icon = (0, _callRenderProp.callRenderProp)(renderIcon);
|
|
96
|
+
const label = (0, _callRenderProp.callRenderProp)(renderLabel);
|
|
97
|
+
const labelIsForScreenReaders = (0, _matchComponentTypes.matchComponentTypes)(label, [_ScreenReaderContent.ScreenReaderContent]);
|
|
95
98
|
if (icon) {
|
|
96
99
|
(0, _console.logError)(labelIsForScreenReaders, '[AppNav] If an icon is used, the label text should be wrapped in <ScreenReaderContent />.');
|
|
97
100
|
}
|
|
98
|
-
return (0, _emotion.jsx)(
|
|
101
|
+
return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(this.props), {
|
|
99
102
|
as: ElementType,
|
|
100
103
|
href: href,
|
|
101
104
|
onClick: this.handleClick,
|
|
@@ -108,7 +111,7 @@ let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
108
111
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.item
|
|
109
112
|
}), icon, labelIsForScreenReaders ? label : (0, _emotion.jsx)("span", {
|
|
110
113
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label
|
|
111
|
-
}, label), renderAfter && (0,
|
|
114
|
+
}, label), renderAfter && (0, _callRenderProp.callRenderProp)(renderAfter));
|
|
112
115
|
}
|
|
113
116
|
}, _class2.displayName = "Item", _class2.componentId = 'AppNav.Item', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
114
117
|
children: null,
|
package/lib/AppNav/index.js
CHANGED
|
@@ -8,15 +8,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.AppNav = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _emotion = require("@instructure/emotion");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
12
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
13
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
14
|
+
var _View = require("@instructure/ui-view/lib/View");
|
|
15
|
+
var _Menu = require("@instructure/ui-menu/lib/Menu");
|
|
15
16
|
var _Item = require("./Item");
|
|
16
17
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
18
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
18
19
|
var _props = require("./props");
|
|
19
|
-
var
|
|
20
|
+
var _TruncateList = require("@instructure/ui-truncate-list/lib/TruncateList");
|
|
20
21
|
var _dec, _dec2, _class, _class2;
|
|
21
22
|
/*
|
|
22
23
|
* The MIT License (MIT)
|
|
@@ -47,7 +48,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
47
48
|
category: components
|
|
48
49
|
---
|
|
49
50
|
**/
|
|
50
|
-
let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
51
|
+
let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class AppNav extends _react.Component {
|
|
51
52
|
constructor(...args) {
|
|
52
53
|
super(...args);
|
|
53
54
|
this.state = {
|
|
@@ -71,16 +72,16 @@ let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _
|
|
|
71
72
|
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
72
73
|
}
|
|
73
74
|
renderMenu(items) {
|
|
74
|
-
return (0, _emotion.jsx)(
|
|
75
|
+
return (0, _emotion.jsx)(_Menu.Menu, {
|
|
75
76
|
trigger: (0, _emotion.jsx)(AppNav.Item, {
|
|
76
|
-
renderLabel: (0,
|
|
77
|
+
renderLabel: (0, _callRenderProp.callRenderProp)(this.props.renderTruncateLabel)
|
|
77
78
|
})
|
|
78
79
|
}, items.map((item, index) => {
|
|
79
|
-
return (0, _emotion.jsx)(
|
|
80
|
+
return (0, _emotion.jsx)(_Menu.Menu.Item, {
|
|
80
81
|
href: item.props.href ? item.props.href : void 0,
|
|
81
82
|
onClick: item.props.onClick && !item.props.href ? item.props.onClick : void 0,
|
|
82
83
|
key: index
|
|
83
|
-
}, (0,
|
|
84
|
+
}, (0, _callRenderProp.callRenderProp)(item.props.renderLabel));
|
|
84
85
|
}));
|
|
85
86
|
}
|
|
86
87
|
render() {
|
|
@@ -90,17 +91,17 @@ let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _
|
|
|
90
91
|
margin = _this$props3.margin,
|
|
91
92
|
debounce = _this$props3.debounce,
|
|
92
93
|
styles = _this$props3.styles;
|
|
93
|
-
const passthroughProps =
|
|
94
|
-
const renderBeforeItems = (0,
|
|
95
|
-
const renderAfterItems = (0,
|
|
94
|
+
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, AppNav.allowedProps), AppNav);
|
|
95
|
+
const renderBeforeItems = (0, _callRenderProp.callRenderProp)(this.props.renderBeforeItems);
|
|
96
|
+
const renderAfterItems = (0, _callRenderProp.callRenderProp)(this.props.renderAfterItems);
|
|
96
97
|
const hasRenderedContent = renderBeforeItems || renderAfterItems;
|
|
97
|
-
return (0, _emotion.jsx)(
|
|
98
|
+
return (0, _emotion.jsx)(_View.View, Object.assign({}, passthroughProps, {
|
|
98
99
|
as: "nav",
|
|
99
100
|
css: [styles === null || styles === void 0 ? void 0 : styles.appNav, hasRenderedContent ? styles === null || styles === void 0 ? void 0 : styles.alignCenter : ''],
|
|
100
101
|
margin: margin,
|
|
101
102
|
display: hasRenderedContent ? 'flex' : 'block',
|
|
102
103
|
elementRef: this.handleRef
|
|
103
|
-
}), renderBeforeItems && (0, _emotion.jsx)("span", null, renderBeforeItems), (0, _emotion.jsx)(
|
|
104
|
+
}), renderBeforeItems && (0, _emotion.jsx)("span", null, renderBeforeItems), (0, _emotion.jsx)(_TruncateList.TruncateList, {
|
|
104
105
|
visibleItemsCount: visibleItemsCount,
|
|
105
106
|
debounce: debounce,
|
|
106
107
|
onUpdate: this.props.onUpdate,
|
|
@@ -108,7 +109,7 @@ let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _
|
|
|
108
109
|
itemSpacing: styles === null || styles === void 0 ? void 0 : styles.horizontalMargin,
|
|
109
110
|
fixMenuTriggerWidth: styles === null || styles === void 0 ? void 0 : styles.menuTriggerWidth,
|
|
110
111
|
css: styles === null || styles === void 0 ? void 0 : styles.list,
|
|
111
|
-
"aria-label": (0,
|
|
112
|
+
"aria-label": (0, _callRenderProp.callRenderProp)(screenReaderLabel)
|
|
112
113
|
}, this.props.children), renderAfterItems && (0, _emotion.jsx)("span", null, renderAfterItems));
|
|
113
114
|
}
|
|
114
115
|
}, _class2.displayName = "AppNav", _class2.componentId = 'AppNav', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
package/lib/AppNav/props.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
10
|
var _emotion = require("@instructure/emotion");
|
|
11
11
|
var _Item = require("./Item");
|
|
12
12
|
/*
|
|
@@ -35,7 +35,7 @@ var _Item = require("./Item");
|
|
|
35
35
|
|
|
36
36
|
const propTypes = exports.propTypes = {
|
|
37
37
|
screenReaderLabel: _propTypes.default.string.isRequired,
|
|
38
|
-
children:
|
|
38
|
+
children: _Children.Children.oneOf([_Item.Item]),
|
|
39
39
|
debounce: _propTypes.default.number,
|
|
40
40
|
renderBeforeItems: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
41
41
|
renderAfterItems: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.NavigationItemLocator = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _TooltipLocator = require("@instructure/ui-tooltip/
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
|
+
var _TooltipLocator = require("@instructure/ui-tooltip/lib/Tooltip/TooltipLocator");
|
|
9
9
|
var _index = require("./index");
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
@@ -35,6 +35,6 @@ var _index = require("./index");
|
|
|
35
35
|
// eslint-disable-next-line no-restricted-imports
|
|
36
36
|
|
|
37
37
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
38
|
-
const NavigationItemLocator = exports.NavigationItemLocator = (0,
|
|
38
|
+
const NavigationItemLocator = exports.NavigationItemLocator = (0, _locator.locator)(_index.NavigationItem.selector, {
|
|
39
39
|
findTooltipContent: (...args) => _TooltipLocator.TooltipLocator.findContent(...args)
|
|
40
40
|
});
|
|
@@ -6,10 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.NavigationItem = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
9
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
10
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
11
|
+
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
12
|
+
var _Tooltip = require("@instructure/ui-tooltip/lib/Tooltip");
|
|
13
|
+
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
13
14
|
var _emotion = require("@instructure/emotion");
|
|
14
15
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
16
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -45,7 +46,7 @@ parent: Navigation
|
|
|
45
46
|
id: Navigation.Item
|
|
46
47
|
---
|
|
47
48
|
**/
|
|
48
|
-
let NavigationItem = exports.NavigationItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
49
|
+
let NavigationItem = exports.NavigationItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class NavigationItem extends _react.Component {
|
|
49
50
|
constructor(...args) {
|
|
50
51
|
super(...args);
|
|
51
52
|
this.ref = null;
|
|
@@ -71,13 +72,13 @@ let NavigationItem = exports.NavigationItem = (_dec = (0, _emotion.withStyle)(_s
|
|
|
71
72
|
}
|
|
72
73
|
renderLink(addRef) {
|
|
73
74
|
var _this$props$styles, _this$props$styles2, _this$props$styles3;
|
|
74
|
-
const ElementType = (0,
|
|
75
|
+
const ElementType = (0, _getElementType.getElementType)(NavigationItem, this.props);
|
|
75
76
|
const _this$props3 = this.props,
|
|
76
77
|
href = _this$props3.href,
|
|
77
78
|
onClick = _this$props3.onClick,
|
|
78
79
|
icon = _this$props3.icon,
|
|
79
80
|
label = _this$props3.label;
|
|
80
|
-
const props = (0,
|
|
81
|
+
const props = (0, _omitProps.omitProps)(this.props, NavigationItem.allowedProps);
|
|
81
82
|
return (0, _emotion.jsx)(ElementType, Object.assign({}, props, {
|
|
82
83
|
href: href,
|
|
83
84
|
onClick: onClick,
|
|
@@ -95,9 +96,9 @@ let NavigationItem = exports.NavigationItem = (_dec = (0, _emotion.withStyle)(_s
|
|
|
95
96
|
const _this$props4 = this.props,
|
|
96
97
|
minimized = _this$props4.minimized,
|
|
97
98
|
label = _this$props4.label;
|
|
98
|
-
const hasTooltip = minimized && (0,
|
|
99
|
+
const hasTooltip = minimized && (0, _hasVisibleChildren.hasVisibleChildren)(label);
|
|
99
100
|
const link = this.renderLink(!hasTooltip);
|
|
100
|
-
return hasTooltip ? (0, _emotion.jsx)(
|
|
101
|
+
return hasTooltip ? (0, _emotion.jsx)(_Tooltip.Tooltip, {
|
|
101
102
|
renderTip: label,
|
|
102
103
|
placement: "end",
|
|
103
104
|
elementRef: this.handleRef
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "NavigationItemLocator", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
exports.NavigationLocator = void 0;
|
|
13
|
-
var
|
|
13
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
14
14
|
var _index = require("./index");
|
|
15
15
|
var _NavigationItemLocator = require("./NavigationItem/NavigationItemLocator");
|
|
16
16
|
/*
|
|
@@ -38,7 +38,7 @@ var _NavigationItemLocator = require("./NavigationItem/NavigationItemLocator");
|
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
41
|
-
const NavigationLocator = exports.NavigationLocator = (0,
|
|
41
|
+
const NavigationLocator = exports.NavigationLocator = (0, _locator.locator)(_index.Navigation.selector, {
|
|
42
42
|
findAllItems: (...args) => {
|
|
43
43
|
return _NavigationItemLocator.NavigationItemLocator.findAll(...args);
|
|
44
44
|
},
|
package/lib/Navigation/index.js
CHANGED
|
@@ -14,10 +14,12 @@ Object.defineProperty(exports, "NavigationItem", {
|
|
|
14
14
|
});
|
|
15
15
|
exports.default = void 0;
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
17
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
18
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
19
|
+
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
20
|
+
var _deprecated = require("@instructure/ui-react-utils/lib/deprecated.js");
|
|
21
|
+
var _IconMoveStartLine = require("@instructure/ui-icons/lib/IconMoveStartLine.js");
|
|
22
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
21
23
|
var _emotion = require("@instructure/emotion");
|
|
22
24
|
var _NavigationItem = require("./NavigationItem");
|
|
23
25
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -59,7 +61,7 @@ const navMinimized = ({
|
|
|
59
61
|
category: components/deprecated
|
|
60
62
|
---
|
|
61
63
|
**/
|
|
62
|
-
let Navigation = exports.Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
64
|
+
let Navigation = exports.Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec3 = (0, _deprecated.deprecated)('9.0.0', null, 'This component is deprecated and will be removed in a later version. Use <SideNavBar /> instead.'), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Navigation extends _react.Component {
|
|
63
65
|
constructor(props) {
|
|
64
66
|
super(props);
|
|
65
67
|
this.ref = null;
|
|
@@ -99,7 +101,7 @@ let Navigation = exports.Navigation = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
99
101
|
renderChildren() {
|
|
100
102
|
return _react.Children.map(this.props.children, child => {
|
|
101
103
|
var _this$props$styles;
|
|
102
|
-
const navItem = (0,
|
|
104
|
+
const navItem = (0, _safeCloneElement.safeCloneElement)(child, {
|
|
103
105
|
minimized: this.state.minimized
|
|
104
106
|
});
|
|
105
107
|
return (0, _emotion.jsx)("li", {
|
|
@@ -113,7 +115,7 @@ let Navigation = exports.Navigation = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
113
115
|
render() {
|
|
114
116
|
var _this$props$styles2, _this$props$styles3, _this$props$styles4, _this$props$styles5;
|
|
115
117
|
const label = this.props.label;
|
|
116
|
-
const props = (0,
|
|
118
|
+
const props = (0, _omitProps.omitProps)(this.props, Navigation.allowedProps, ['minimized']);
|
|
117
119
|
return (0, _emotion.jsx)("nav", Object.assign({}, props, {
|
|
118
120
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
|
|
119
121
|
"aria-label": label,
|
|
@@ -127,11 +129,11 @@ let Navigation = exports.Navigation = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
127
129
|
}, (0, _emotion.jsx)(_NavigationItem.NavigationItem, {
|
|
128
130
|
"aria-expanded": !this.minimized,
|
|
129
131
|
onClick: this.handleNavToggle,
|
|
130
|
-
icon: (0, _emotion.jsx)(
|
|
132
|
+
icon: (0, _emotion.jsx)(_IconMoveStartLine.IconMoveStartLine, {
|
|
131
133
|
css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.toggleIcon,
|
|
132
134
|
inline: false
|
|
133
135
|
}),
|
|
134
|
-
label: (0, _emotion.jsx)(
|
|
136
|
+
label: (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, this.toggleMessage())
|
|
135
137
|
})));
|
|
136
138
|
}
|
|
137
139
|
}, _class2.displayName = "Navigation", _class2.componentId = 'Navigation', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
package/lib/Navigation/props.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
10
|
+
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
11
|
var _NavigationItem = require("./NavigationItem");
|
|
11
12
|
/*
|
|
12
13
|
* The MIT License (MIT)
|
|
@@ -33,8 +34,8 @@ var _NavigationItem = require("./NavigationItem");
|
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
36
|
const propTypes = exports.propTypes = {
|
|
36
|
-
children:
|
|
37
|
-
minimized: (0,
|
|
37
|
+
children: _Children.Children.oneOf([_NavigationItem.NavigationItem]),
|
|
38
|
+
minimized: (0, _controllable.controllable)(_propTypes.default.bool, 'onMinimized', 'defaultMinimized'),
|
|
38
39
|
defaultMinimized: _propTypes.default.bool,
|
|
39
40
|
onMinimized: _propTypes.default.func,
|
|
40
41
|
label: _propTypes.default.string.isRequired,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-navigation",
|
|
3
|
-
"version": "8.56.2
|
|
3
|
+
"version": "8.56.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.56.2
|
|
27
|
-
"@instructure/ui-color-utils": "8.56.2
|
|
28
|
-
"@instructure/ui-test-locator": "8.56.2
|
|
29
|
-
"@instructure/ui-test-utils": "8.56.2
|
|
30
|
-
"@instructure/ui-themes": "8.56.2
|
|
26
|
+
"@instructure/ui-babel-preset": "8.56.2",
|
|
27
|
+
"@instructure/ui-color-utils": "8.56.2",
|
|
28
|
+
"@instructure/ui-test-locator": "8.56.2",
|
|
29
|
+
"@instructure/ui-test-utils": "8.56.2",
|
|
30
|
+
"@instructure/ui-themes": "8.56.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.23.2",
|
|
34
|
-
"@instructure/console": "8.56.2
|
|
35
|
-
"@instructure/debounce": "8.56.2
|
|
36
|
-
"@instructure/emotion": "8.56.2
|
|
37
|
-
"@instructure/shared-types": "8.56.2
|
|
38
|
-
"@instructure/ui-a11y-content": "8.56.2
|
|
39
|
-
"@instructure/ui-a11y-utils": "8.56.2
|
|
40
|
-
"@instructure/ui-badge": "8.56.2
|
|
41
|
-
"@instructure/ui-dom-utils": "8.56.2
|
|
42
|
-
"@instructure/ui-focusable": "8.56.2
|
|
43
|
-
"@instructure/ui-icons": "8.56.2
|
|
44
|
-
"@instructure/ui-menu": "8.56.2
|
|
45
|
-
"@instructure/ui-prop-types": "8.56.2
|
|
46
|
-
"@instructure/ui-react-utils": "8.56.2
|
|
47
|
-
"@instructure/ui-testable": "8.56.2
|
|
48
|
-
"@instructure/ui-tooltip": "8.56.2
|
|
49
|
-
"@instructure/ui-truncate-list": "8.56.2
|
|
50
|
-
"@instructure/ui-utils": "8.56.2
|
|
51
|
-
"@instructure/ui-view": "8.56.2
|
|
34
|
+
"@instructure/console": "8.56.2",
|
|
35
|
+
"@instructure/debounce": "8.56.2",
|
|
36
|
+
"@instructure/emotion": "8.56.2",
|
|
37
|
+
"@instructure/shared-types": "8.56.2",
|
|
38
|
+
"@instructure/ui-a11y-content": "8.56.2",
|
|
39
|
+
"@instructure/ui-a11y-utils": "8.56.2",
|
|
40
|
+
"@instructure/ui-badge": "8.56.2",
|
|
41
|
+
"@instructure/ui-dom-utils": "8.56.2",
|
|
42
|
+
"@instructure/ui-focusable": "8.56.2",
|
|
43
|
+
"@instructure/ui-icons": "8.56.2",
|
|
44
|
+
"@instructure/ui-menu": "8.56.2",
|
|
45
|
+
"@instructure/ui-prop-types": "8.56.2",
|
|
46
|
+
"@instructure/ui-react-utils": "8.56.2",
|
|
47
|
+
"@instructure/ui-testable": "8.56.2",
|
|
48
|
+
"@instructure/ui-tooltip": "8.56.2",
|
|
49
|
+
"@instructure/ui-truncate-list": "8.56.2",
|
|
50
|
+
"@instructure/ui-utils": "8.56.2",
|
|
51
|
+
"@instructure/ui-view": "8.56.2",
|
|
52
52
|
"prop-types": "^15.8.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|