@instructure/ui-top-nav-bar 10.26.1-snapshot-2 → 10.26.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 +5 -18
- package/es/TopNavBar/TopNavBarActionItems/index.js +5 -5
- package/es/TopNavBar/TopNavBarActionItems/props.js +12 -1
- package/es/TopNavBar/TopNavBarBrand/index.js +5 -5
- package/es/TopNavBar/TopNavBarBrand/props.js +11 -1
- package/es/TopNavBar/TopNavBarBreadcrumb/index.js +5 -6
- package/es/TopNavBar/TopNavBarBreadcrumb/props.js +9 -1
- package/es/TopNavBar/TopNavBarItem/index.js +6 -6
- package/es/TopNavBar/TopNavBarItem/props.js +44 -1
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +5 -5
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +7 -2
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +5 -5
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +7 -2
- package/es/TopNavBar/TopNavBarLayout/index.js +6 -5
- package/es/TopNavBar/TopNavBarLayout/props.js +45 -1
- package/es/TopNavBar/TopNavBarMenuItems/index.js +7 -8
- package/es/TopNavBar/TopNavBarMenuItems/props.js +11 -1
- package/es/TopNavBar/TopNavBarUser/index.js +5 -5
- package/es/TopNavBar/TopNavBarUser/props.js +8 -1
- package/es/TopNavBar/index.js +6 -18
- package/es/TopNavBar/props.js +9 -1
- package/es/TopNavBar/utils/mapItemsForDrilldown.js +1 -2
- package/lib/TopNavBar/TopNavBarActionItems/index.js +4 -4
- package/lib/TopNavBar/TopNavBarActionItems/props.js +13 -1
- package/lib/TopNavBar/TopNavBarBrand/index.js +4 -4
- package/lib/TopNavBar/TopNavBarBrand/props.js +12 -1
- package/lib/TopNavBar/TopNavBarBreadcrumb/index.js +4 -5
- package/lib/TopNavBar/TopNavBarBreadcrumb/props.js +10 -1
- package/lib/TopNavBar/TopNavBarItem/index.js +5 -5
- package/lib/TopNavBar/TopNavBarItem/props.js +45 -1
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +4 -4
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +6 -1
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +4 -4
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +6 -1
- package/lib/TopNavBar/TopNavBarLayout/index.js +5 -4
- package/lib/TopNavBar/TopNavBarLayout/props.js +47 -1
- package/lib/TopNavBar/TopNavBarMenuItems/index.js +6 -7
- package/lib/TopNavBar/TopNavBarMenuItems/props.js +12 -1
- package/lib/TopNavBar/TopNavBarUser/index.js +4 -4
- package/lib/TopNavBar/TopNavBarUser/props.js +9 -1
- package/lib/TopNavBar/index.js +5 -19
- package/lib/TopNavBar/props.js +10 -1
- package/lib/TopNavBar/utils/mapItemsForDrilldown.js +1 -2
- package/package.json +31 -28
- package/src/TopNavBar/TopNavBarActionItems/index.tsx +8 -2
- package/src/TopNavBar/TopNavBarActionItems/props.ts +22 -1
- package/src/TopNavBar/TopNavBarBrand/index.tsx +5 -6
- package/src/TopNavBar/TopNavBarBrand/props.ts +16 -1
- package/src/TopNavBar/TopNavBarBreadcrumb/index.tsx +9 -13
- package/src/TopNavBar/TopNavBarBreadcrumb/props.ts +15 -3
- package/src/TopNavBar/TopNavBarItem/index.tsx +5 -6
- package/src/TopNavBar/TopNavBarItem/props.ts +51 -1
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/index.tsx +4 -2
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/props.ts +19 -3
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.tsx +4 -2
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.ts +18 -3
- package/src/TopNavBar/TopNavBarLayout/index.tsx +5 -1
- package/src/TopNavBar/TopNavBarLayout/props.ts +60 -1
- package/src/TopNavBar/TopNavBarMenuItems/index.tsx +5 -10
- package/src/TopNavBar/TopNavBarMenuItems/props.ts +19 -1
- package/src/TopNavBar/TopNavBarUser/index.tsx +4 -2
- package/src/TopNavBar/TopNavBarUser/props.ts +14 -1
- package/src/TopNavBar/index.tsx +4 -2
- package/src/TopNavBar/props.ts +17 -2
- package/src/TopNavBar/utils/mapItemsForDrilldown.tsx +1 -1
- package/tsconfig.build.json +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarBrand/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarBrand/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarBrand/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarBrand/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarBreadcrumb/index.d.ts +5 -0
- package/types/TopNavBar/TopNavBarBreadcrumb/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarBreadcrumb/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarBreadcrumb/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarItem/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarItem/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarItem/props.d.ts +13 -2
- package/types/TopNavBar/TopNavBarItem/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarLayout/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarLayout/props.d.ts +6 -2
- package/types/TopNavBar/TopNavBarLayout/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarUser/index.d.ts +1 -0
- package/types/TopNavBar/TopNavBarUser/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarUser/props.d.ts +3 -2
- package/types/TopNavBar/TopNavBarUser/props.d.ts.map +1 -1
- package/types/TopNavBar/index.d.ts +1 -0
- package/types/TopNavBar/index.d.ts.map +1 -1
- package/types/TopNavBar/props.d.ts +3 -2
- package/types/TopNavBar/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,30 +3,17 @@
|
|
|
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
|
-
## [10.26.
|
|
6
|
+
## [10.26.2](https://github.com/instructure/instructure-ui/compare/v10.26.1...v10.26.2) (2025-10-13)
|
|
7
7
|
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
8
9
|
|
|
9
|
-
### Features
|
|
10
10
|
|
|
11
|
-
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
### BREAKING CHANGES
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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`
|
|
14
|
+
## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
30
17
|
|
|
31
18
|
|
|
32
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _class, _TopNavBarActionItems;
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _TopNavBarActionItems;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -25,6 +25,7 @@ var _dec, _dec2, _class, _TopNavBarActionItems;
|
|
|
25
25
|
|
|
26
26
|
import { Children, Component } from 'react';
|
|
27
27
|
import { omitProps, passthroughProps, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
|
|
28
|
+
import { testable } from '@instructure/ui-testable';
|
|
28
29
|
import { warn, error } from '@instructure/console';
|
|
29
30
|
import { withStyle } from '@instructure/emotion';
|
|
30
31
|
import { Drilldown } from '@instructure/ui-drilldown';
|
|
@@ -35,7 +36,7 @@ import { mapItemsForDrilldown, renderMappedItemDrilldownSubpages, renderMappedIt
|
|
|
35
36
|
import { TopNavBarContext } from '../TopNavBarContext';
|
|
36
37
|
import generateStyle from './styles';
|
|
37
38
|
import generateComponentTheme from './theme';
|
|
38
|
-
import { allowedProps } from './props';
|
|
39
|
+
import { propTypes, allowedProps } from './props';
|
|
39
40
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
40
41
|
import { createElement as _createElement } from "@emotion/react";
|
|
41
42
|
/**
|
|
@@ -45,7 +46,7 @@ id: TopNavBar.ActionItems
|
|
|
45
46
|
---
|
|
46
47
|
@module TopNavBarActionItems
|
|
47
48
|
**/
|
|
48
|
-
let TopNavBarActionItems = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_TopNavBarActionItems = class TopNavBarActionItems extends Component {
|
|
49
|
+
let TopNavBarActionItems = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_TopNavBarActionItems = class TopNavBarActionItems extends Component {
|
|
49
50
|
constructor(props) {
|
|
50
51
|
super(props);
|
|
51
52
|
this.ref = null;
|
|
@@ -186,13 +187,12 @@ let TopNavBarActionItems = (_dec = withDeterministicId(), _dec2 = withStyle(gene
|
|
|
186
187
|
ref: this.handleRef,
|
|
187
188
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarActionItems,
|
|
188
189
|
"aria-label": listLabel,
|
|
189
|
-
"data-cid": "TopNavBarActionItems",
|
|
190
190
|
children: this.childrenArray.map(item => _jsx("li", {
|
|
191
191
|
css: styles === null || styles === void 0 ? void 0 : styles.listItem,
|
|
192
192
|
children: item
|
|
193
193
|
}, item.props.id))
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
}, _TopNavBarActionItems.displayName = "TopNavBarActionItems", _TopNavBarActionItems.componentId = 'TopNavBar.ActionItems', _TopNavBarActionItems.allowedProps = allowedProps, _TopNavBarActionItems.defaultProps = {}, _TopNavBarActionItems.contextType = TopNavBarContext, _TopNavBarActionItems)) || _class) || _class);
|
|
196
|
+
}, _TopNavBarActionItems.displayName = "TopNavBarActionItems", _TopNavBarActionItems.componentId = 'TopNavBar.ActionItems', _TopNavBarActionItems.propTypes = propTypes, _TopNavBarActionItems.allowedProps = allowedProps, _TopNavBarActionItems.defaultProps = {}, _TopNavBarActionItems.contextType = TopNavBarContext, _TopNavBarActionItems)) || _class) || _class) || _class);
|
|
197
197
|
export { TopNavBarActionItems };
|
|
198
198
|
export default TopNavBarActionItems;
|
|
@@ -22,5 +22,16 @@
|
|
|
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 { TopNavBarItem } from '../TopNavBarItem';
|
|
28
|
+
import { topNavBarItemTooltipPropType } from '../TopNavBarItem/props';
|
|
29
|
+
const propTypes = {
|
|
30
|
+
children: ChildrenPropTypes.oneOf([TopNavBarItem]),
|
|
31
|
+
listLabel: PropTypes.string,
|
|
32
|
+
renderHiddenItemsMenuTriggerLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
33
|
+
renderHiddenItemsMenuTriggerTooltip: PropTypes.oneOfType([topNavBarItemTooltipPropType, PropTypes.func]),
|
|
34
|
+
elementRef: PropTypes.func
|
|
35
|
+
};
|
|
25
36
|
const allowedProps = ['children', 'listLabel', 'renderHiddenItemsMenuTriggerLabel', 'renderHiddenItemsMenuTriggerTooltip', 'elementRef'];
|
|
26
|
-
export { allowedProps };
|
|
37
|
+
export { propTypes, allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class, _TopNavBarBrand;
|
|
1
|
+
var _dec, _dec2, _class, _TopNavBarBrand;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -25,13 +25,14 @@ var _dec, _class, _TopNavBarBrand;
|
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
27
|
import { getElementType, omitProps } from '@instructure/ui-react-utils';
|
|
28
|
+
import { testable } from '@instructure/ui-testable';
|
|
28
29
|
import { withStyle } from '@instructure/emotion';
|
|
29
30
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
30
31
|
import { View } from '@instructure/ui-view';
|
|
31
32
|
import { TopNavBarContext } from '../TopNavBarContext';
|
|
32
33
|
import generateStyle from './styles';
|
|
33
34
|
import generateComponentTheme from './theme';
|
|
34
|
-
import { allowedProps } from './props';
|
|
35
|
+
import { propTypes, allowedProps } from './props';
|
|
35
36
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
36
37
|
/**
|
|
37
38
|
---
|
|
@@ -40,7 +41,7 @@ id: TopNavBar.Brand
|
|
|
40
41
|
---
|
|
41
42
|
@module TopNavBarBrand
|
|
42
43
|
**/
|
|
43
|
-
let TopNavBarBrand = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_TopNavBarBrand = class TopNavBarBrand extends Component {
|
|
44
|
+
let TopNavBarBrand = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_TopNavBarBrand = class TopNavBarBrand extends Component {
|
|
44
45
|
constructor(...args) {
|
|
45
46
|
super(...args);
|
|
46
47
|
this.ref = null;
|
|
@@ -81,7 +82,6 @@ let TopNavBarBrand = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
81
82
|
return _jsx("div", {
|
|
82
83
|
ref: this.handleRef,
|
|
83
84
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarBrand,
|
|
84
|
-
"data-cid": "TopNavBarBrand",
|
|
85
85
|
children: renderIcon && _jsxs(View, {
|
|
86
86
|
...omitProps(this.props, allowedProps),
|
|
87
87
|
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
@@ -106,6 +106,6 @@ let TopNavBarBrand = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
106
106
|
})
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
}, _TopNavBarBrand.displayName = "TopNavBarBrand", _TopNavBarBrand.componentId = 'TopNavBar.Brand', _TopNavBarBrand.allowedProps = allowedProps, _TopNavBarBrand.defaultProps = {}, _TopNavBarBrand.contextType = TopNavBarContext, _TopNavBarBrand)) || _class);
|
|
109
|
+
}, _TopNavBarBrand.displayName = "TopNavBarBrand", _TopNavBarBrand.componentId = 'TopNavBar.Brand', _TopNavBarBrand.propTypes = propTypes, _TopNavBarBrand.allowedProps = allowedProps, _TopNavBarBrand.defaultProps = {}, _TopNavBarBrand.contextType = TopNavBarContext, _TopNavBarBrand)) || _class) || _class);
|
|
110
110
|
export { TopNavBarBrand };
|
|
111
111
|
export default TopNavBarBrand;
|
|
@@ -22,5 +22,15 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
const propTypes = {
|
|
27
|
+
screenReaderLabel: PropTypes.string.isRequired,
|
|
28
|
+
renderIcon: PropTypes.node,
|
|
29
|
+
iconBackground: PropTypes.string,
|
|
30
|
+
href: PropTypes.string,
|
|
31
|
+
onClick: PropTypes.func,
|
|
32
|
+
as: PropTypes.elementType,
|
|
33
|
+
elementRef: PropTypes.func
|
|
34
|
+
};
|
|
25
35
|
const allowedProps = ['screenReaderLabel', 'renderIcon', 'iconBackground', 'href', 'onClick', 'as', 'elementRef'];
|
|
26
|
-
export { allowedProps };
|
|
36
|
+
export { propTypes, allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class, _TopNavBarBreadcrumb, _IconHamburgerLine;
|
|
1
|
+
var _dec, _dec2, _class, _TopNavBarBreadcrumb, _IconHamburgerLine;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -24,10 +24,11 @@ var _dec, _class, _TopNavBarBreadcrumb, _IconHamburgerLine;
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { Children, Component } from 'react';
|
|
27
|
-
import { allowedProps } from './props';
|
|
27
|
+
import { allowedProps, propTypes } from './props';
|
|
28
28
|
import TopNavBar from '../index';
|
|
29
29
|
import { withStyle } from '@instructure/emotion';
|
|
30
30
|
import generateStyle from '../TopNavBarBreadcrumb/styles';
|
|
31
|
+
import { testable } from '@instructure/ui-testable';
|
|
31
32
|
import { IconArrowOpenStartLine, IconHamburgerLine } from '@instructure/ui-icons';
|
|
32
33
|
import TopNavBarContext from '../TopNavBarContext';
|
|
33
34
|
import { error } from '@instructure/console';
|
|
@@ -41,7 +42,7 @@ id: TopNavBar.Breadcrumb
|
|
|
41
42
|
@module TopNavBarBreadcrumb
|
|
42
43
|
**/
|
|
43
44
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
44
|
-
let TopNavBarBreadcrumb = (_dec = withStyle(generateStyle, null), _dec(_class = (_TopNavBarBreadcrumb = class TopNavBarBreadcrumb extends Component {
|
|
45
|
+
let TopNavBarBreadcrumb = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec(_class = _dec2(_class = (_TopNavBarBreadcrumb = class TopNavBarBreadcrumb extends Component {
|
|
45
46
|
constructor(...args) {
|
|
46
47
|
super(...args);
|
|
47
48
|
this.ref = null;
|
|
@@ -92,7 +93,6 @@ let TopNavBarBreadcrumb = (_dec = withStyle(generateStyle, null), _dec(_class =
|
|
|
92
93
|
return this.context.inverseColor && (this.context.layout === 'desktop' ? _jsxs("div", {
|
|
93
94
|
ref: this.handleRef,
|
|
94
95
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarBreadcrumb,
|
|
95
|
-
"data-cid": "TopNavBarBreadcrumb",
|
|
96
96
|
children: [_jsx("div", {
|
|
97
97
|
css: styles === null || styles === void 0 ? void 0 : styles.iconContainer,
|
|
98
98
|
children: this.renderMenu()
|
|
@@ -103,7 +103,6 @@ let TopNavBarBreadcrumb = (_dec = withStyle(generateStyle, null), _dec(_class =
|
|
|
103
103
|
}) : _jsx("div", {
|
|
104
104
|
ref: this.handleRef,
|
|
105
105
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarBreadcrumb,
|
|
106
|
-
"data-cid": "TopNavBarBreadcrumb",
|
|
107
106
|
children: _jsx("div", {
|
|
108
107
|
css: styles === null || styles === void 0 ? void 0 : styles.linkContainer,
|
|
109
108
|
children: lastButOneLink && _jsx(Link, {
|
|
@@ -115,6 +114,6 @@ let TopNavBarBreadcrumb = (_dec = withStyle(generateStyle, null), _dec(_class =
|
|
|
115
114
|
})
|
|
116
115
|
}));
|
|
117
116
|
}
|
|
118
|
-
}, _TopNavBarBreadcrumb.displayName = "TopNavBarBreadcrumb", _TopNavBarBreadcrumb.allowedProps = allowedProps, _TopNavBarBreadcrumb.defaultProps = {}, _TopNavBarBreadcrumb.contextType = TopNavBarContext, _TopNavBarBreadcrumb)) || _class);
|
|
117
|
+
}, _TopNavBarBreadcrumb.displayName = "TopNavBarBreadcrumb", _TopNavBarBreadcrumb.propTypes = propTypes, _TopNavBarBreadcrumb.allowedProps = allowedProps, _TopNavBarBreadcrumb.defaultProps = {}, _TopNavBarBreadcrumb.contextType = TopNavBarContext, _TopNavBarBreadcrumb)) || _class) || _class);
|
|
119
118
|
export { TopNavBarBreadcrumb };
|
|
120
119
|
export default TopNavBarBreadcrumb;
|
|
@@ -22,5 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
26
|
+
import PropTypes from 'prop-types';
|
|
27
|
+
import { Breadcrumb } from '@instructure/ui-breadcrumb';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
onClick: PropTypes.func,
|
|
30
|
+
elementRef: PropTypes.func,
|
|
31
|
+
children: ChildrenPropTypes.oneOf([Breadcrumb])
|
|
32
|
+
};
|
|
25
33
|
const allowedProps = ['children', 'onClick', 'elementRef'];
|
|
26
|
-
export { allowedProps };
|
|
34
|
+
export { propTypes, allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _class, _TopNavBarItem, _IconArrowOpenUpSolid, _IconArrowOpenDownSol;
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _TopNavBarItem, _IconArrowOpenUpSolid, _IconArrowOpenDownSol;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -26,6 +26,7 @@ var _dec, _dec2, _class, _TopNavBarItem, _IconArrowOpenUpSolid, _IconArrowOpenDo
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
27
|
import { callRenderProp, matchComponentTypes, omitProps, passthroughProps, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
|
|
28
28
|
import { createChainedFunction } from '@instructure/ui-utils';
|
|
29
|
+
import { testable } from '@instructure/ui-testable';
|
|
29
30
|
import { warn, error } from '@instructure/console';
|
|
30
31
|
import { withStyle, InstUISettingsProvider } from '@instructure/emotion';
|
|
31
32
|
import { IconArrowOpenDownSolid, IconArrowOpenUpSolid } from '@instructure/ui-icons';
|
|
@@ -38,7 +39,7 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
|
38
39
|
import { TopNavBarContext } from '../TopNavBarContext';
|
|
39
40
|
import generateStyle from './styles';
|
|
40
41
|
import generateComponentTheme from './theme';
|
|
41
|
-
import { allowedProps } from './props';
|
|
42
|
+
import { propTypes, allowedProps } from './props';
|
|
42
43
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
43
44
|
const navbarStackingDefault = 10000;
|
|
44
45
|
const submenuStacking = navbarStackingDefault + 1;
|
|
@@ -51,7 +52,7 @@ id: TopNavBar.Item
|
|
|
51
52
|
---
|
|
52
53
|
@module TopNavBarItem
|
|
53
54
|
**/
|
|
54
|
-
let TopNavBarItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_TopNavBarItem = class TopNavBarItem extends Component {
|
|
55
|
+
let TopNavBarItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_TopNavBarItem = class TopNavBarItem extends Component {
|
|
55
56
|
constructor(props) {
|
|
56
57
|
super(props);
|
|
57
58
|
this.ref = null;
|
|
@@ -565,15 +566,14 @@ let TopNavBarItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateSty
|
|
|
565
566
|
return _jsx("div", {
|
|
566
567
|
ref: this.handleRef,
|
|
567
568
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarItem,
|
|
568
|
-
"data-cid": "TopNavBarItem",
|
|
569
569
|
children: content
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
-
}, _TopNavBarItem.displayName = "TopNavBarItem", _TopNavBarItem.componentId = 'TopNavBar.Item', _TopNavBarItem.allowedProps = allowedProps, _TopNavBarItem.defaultProps = {
|
|
572
|
+
}, _TopNavBarItem.displayName = "TopNavBarItem", _TopNavBarItem.componentId = 'TopNavBar.Item', _TopNavBarItem.propTypes = propTypes, _TopNavBarItem.allowedProps = allowedProps, _TopNavBarItem.defaultProps = {
|
|
573
573
|
status: 'default',
|
|
574
574
|
variant: 'default',
|
|
575
575
|
showSubmenuChevron: true,
|
|
576
576
|
shouldCloseOnClick: 'auto'
|
|
577
|
-
}, _TopNavBarItem.contextType = TopNavBarContext, _TopNavBarItem)) || _class) || _class);
|
|
577
|
+
}, _TopNavBarItem.contextType = TopNavBarContext, _TopNavBarItem)) || _class) || _class) || _class);
|
|
578
578
|
export { TopNavBarItem };
|
|
579
579
|
export default TopNavBarItem;
|
|
@@ -22,5 +22,48 @@
|
|
|
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 { Drilldown } from '@instructure/ui-drilldown';
|
|
28
|
+
const topNavBarItemTooltipPropType = PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
29
|
+
renderTip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
30
|
+
color: PropTypes.oneOf(['primary', 'primary-inverse']),
|
|
31
|
+
placement: PropTypes.string,
|
|
32
|
+
offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
33
|
+
offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
34
|
+
onShowContent: PropTypes.func,
|
|
35
|
+
onHideContent: PropTypes.func
|
|
36
|
+
})]);
|
|
37
|
+
const propTypes = {
|
|
38
|
+
id: PropTypes.string.isRequired,
|
|
39
|
+
as: PropTypes.elementType,
|
|
40
|
+
children: PropTypes.node.isRequired,
|
|
41
|
+
variant: PropTypes.oneOf(['default', 'button', 'icon', 'avatar']),
|
|
42
|
+
status: PropTypes.oneOf(['default', 'active', 'disabled']),
|
|
43
|
+
renderSubmenu: ChildrenPropTypes.oneOf([Drilldown]),
|
|
44
|
+
showSubmenuChevron: PropTypes.bool,
|
|
45
|
+
customPopoverConfig: PropTypes.object,
|
|
46
|
+
tooltip: topNavBarItemTooltipPropType,
|
|
47
|
+
renderAvatar: PropTypes.shape({
|
|
48
|
+
avatarName: PropTypes.string.isRequired,
|
|
49
|
+
avatarSrc: PropTypes.string,
|
|
50
|
+
avatarAlt: PropTypes.string
|
|
51
|
+
}),
|
|
52
|
+
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
53
|
+
href: PropTypes.string,
|
|
54
|
+
onClick: PropTypes.func,
|
|
55
|
+
onHiddenClick: PropTypes.func,
|
|
56
|
+
onSubmenuToggle: PropTypes.func,
|
|
57
|
+
onMouseOver: PropTypes.func,
|
|
58
|
+
onMouseOut: PropTypes.func,
|
|
59
|
+
onFocus: PropTypes.func,
|
|
60
|
+
onBlur: PropTypes.func,
|
|
61
|
+
onKeyDown: PropTypes.func,
|
|
62
|
+
onKeyUp: PropTypes.func,
|
|
63
|
+
elementRef: PropTypes.func,
|
|
64
|
+
itemRef: PropTypes.func,
|
|
65
|
+
shouldCloseOnClick: PropTypes.oneOf(['auto', 'always', 'never']),
|
|
66
|
+
withFocusOutline: PropTypes.bool
|
|
67
|
+
};
|
|
25
68
|
const allowedProps = ['id', 'as', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onHiddenClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef', 'shouldCloseOnClick', 'withFocusOutline'];
|
|
26
|
-
export { allowedProps };
|
|
69
|
+
export { propTypes, allowedProps, topNavBarItemTooltipPropType };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class, _TopNavBarDesktopLayout;
|
|
1
|
+
var _dec, _dec2, _class, _TopNavBarDesktopLayout;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -25,18 +25,19 @@ var _dec, _class, _TopNavBarDesktopLayout;
|
|
|
25
25
|
|
|
26
26
|
import { Children, Component } from 'react';
|
|
27
27
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
28
|
+
import { testable } from '@instructure/ui-testable';
|
|
28
29
|
import { withStyle } from '@instructure/emotion';
|
|
29
30
|
import { TopNavBarContext } from '../../TopNavBarContext';
|
|
30
31
|
import generateStyle from './styles';
|
|
31
32
|
import generateComponentTheme from './theme';
|
|
32
|
-
import { allowedProps } from './props';
|
|
33
|
+
import { propTypes, allowedProps } from './props';
|
|
33
34
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
34
35
|
/**
|
|
35
36
|
---
|
|
36
37
|
private: true
|
|
37
38
|
---
|
|
38
39
|
**/
|
|
39
|
-
let TopNavBarDesktopLayout = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_TopNavBarDesktopLayout = class TopNavBarDesktopLayout extends Component {
|
|
40
|
+
let TopNavBarDesktopLayout = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_TopNavBarDesktopLayout = class TopNavBarDesktopLayout extends Component {
|
|
40
41
|
constructor(...args) {
|
|
41
42
|
super(...args);
|
|
42
43
|
this.ref = null;
|
|
@@ -101,7 +102,6 @@ let TopNavBarDesktopLayout = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
101
102
|
ref: this.handleRef,
|
|
102
103
|
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarDesktopLayout,
|
|
103
104
|
"aria-label": navLabel,
|
|
104
|
-
"data-cid": "TopNavBarDesktopLayout",
|
|
105
105
|
children: [this.hasBrandBlock && _jsx("div", {
|
|
106
106
|
css: styles === null || styles === void 0 ? void 0 : styles.brandContainer,
|
|
107
107
|
children: renderBrand
|
|
@@ -119,6 +119,6 @@ let TopNavBarDesktopLayout = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
119
119
|
})]
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
}, _TopNavBarDesktopLayout.displayName = "TopNavBarDesktopLayout", _TopNavBarDesktopLayout.componentId = 'TopNavBar.DesktopLayout', _TopNavBarDesktopLayout.allowedProps = allowedProps, _TopNavBarDesktopLayout.defaultProps = {}, _TopNavBarDesktopLayout.contextType = TopNavBarContext, _TopNavBarDesktopLayout)) || _class);
|
|
122
|
+
}, _TopNavBarDesktopLayout.displayName = "TopNavBarDesktopLayout", _TopNavBarDesktopLayout.componentId = 'TopNavBar.DesktopLayout', _TopNavBarDesktopLayout.propTypes = propTypes, _TopNavBarDesktopLayout.allowedProps = allowedProps, _TopNavBarDesktopLayout.defaultProps = {}, _TopNavBarDesktopLayout.contextType = TopNavBarContext, _TopNavBarDesktopLayout)) || _class) || _class);
|
|
123
123
|
export { TopNavBarDesktopLayout };
|
|
124
124
|
export default TopNavBarDesktopLayout;
|
|
@@ -22,8 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { commonAllowedProps, desktopAllowedProps } from '../props';
|
|
25
|
+
import { commonPropTypes, commonAllowedProps, desktopPropTypes, desktopAllowedProps } from '../props';
|
|
26
|
+
const propTypes = {
|
|
27
|
+
// Edit PropTypes in TopNabBarLayout/props.ts
|
|
28
|
+
...commonPropTypes,
|
|
29
|
+
...desktopPropTypes
|
|
30
|
+
};
|
|
26
31
|
const allowedProps = [
|
|
27
32
|
// Edit allowed props in TopNabBarLayout/props.ts
|
|
28
33
|
...commonAllowedProps, ...desktopAllowedProps];
|
|
29
|
-
export { allowedProps };
|
|
34
|
+
export { propTypes, allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _class, _TopNavBarSmallViewportLayout, _IconXLine, _IconHamburgerLine;
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _TopNavBarSmallViewportLayout, _IconXLine, _IconHamburgerLine;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -27,6 +27,7 @@ import { Fragment, Children, Component } from 'react';
|
|
|
27
27
|
import { omitProps, withDeterministicId, callRenderProp } from '@instructure/ui-react-utils';
|
|
28
28
|
import { px } from '@instructure/ui-utils';
|
|
29
29
|
import { warn } from '@instructure/console';
|
|
30
|
+
import { testable } from '@instructure/ui-testable';
|
|
30
31
|
import { getBoundingClientRect, requestAnimationFrame } from '@instructure/ui-dom-utils';
|
|
31
32
|
import { withStyle, Global } from '@instructure/emotion';
|
|
32
33
|
import { Tray } from '@instructure/ui-tray';
|
|
@@ -39,14 +40,14 @@ import { mapItemsForDrilldown, renderMappedItemDrilldownSubpages, renderMappedIt
|
|
|
39
40
|
import { TopNavBarContext } from '../../TopNavBarContext';
|
|
40
41
|
import generateStyle from './styles';
|
|
41
42
|
import generateComponentTheme from './theme';
|
|
42
|
-
import { allowedProps } from './props';
|
|
43
|
+
import { propTypes, allowedProps } from './props';
|
|
43
44
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
44
45
|
/**
|
|
45
46
|
---
|
|
46
47
|
private: true
|
|
47
48
|
---
|
|
48
49
|
**/
|
|
49
|
-
let TopNavBarSmallViewportLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_TopNavBarSmallViewportLayout = class TopNavBarSmallViewportLayout extends Component {
|
|
50
|
+
let TopNavBarSmallViewportLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_TopNavBarSmallViewportLayout = class TopNavBarSmallViewportLayout extends Component {
|
|
50
51
|
constructor(props) {
|
|
51
52
|
var _props$styles;
|
|
52
53
|
super(props);
|
|
@@ -444,7 +445,6 @@ let TopNavBarSmallViewportLayout = (_dec = withDeterministicId(), _dec2 = withSt
|
|
|
444
445
|
...omitProps(this.props, allowedProps),
|
|
445
446
|
ref: this.handleRef,
|
|
446
447
|
"aria-label": navLabel,
|
|
447
|
-
"data-cid": "TopNavBarSmallViewportLayout",
|
|
448
448
|
children: [_jsx(Global, {
|
|
449
449
|
styles: styles === null || styles === void 0 ? void 0 : styles.globalStyles
|
|
450
450
|
}), this.hasBreadcrumbBlock && _jsx("div", {
|
|
@@ -456,6 +456,6 @@ let TopNavBarSmallViewportLayout = (_dec = withDeterministicId(), _dec2 = withSt
|
|
|
456
456
|
}), !this.hasBreadcrumbBlock && this.renderInPlaceDialog(), !this.hasBreadcrumbBlock && this.renderDropdownMenuTray()]
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
|
-
}, _TopNavBarSmallViewportLayout.displayName = "TopNavBarSmallViewportLayout", _TopNavBarSmallViewportLayout.componentId = 'TopNavBar.SmallViewportLayout', _TopNavBarSmallViewportLayout.allowedProps = allowedProps, _TopNavBarSmallViewportLayout.defaultProps = {}, _TopNavBarSmallViewportLayout.contextType = TopNavBarContext, _TopNavBarSmallViewportLayout)) || _class) || _class);
|
|
459
|
+
}, _TopNavBarSmallViewportLayout.displayName = "TopNavBarSmallViewportLayout", _TopNavBarSmallViewportLayout.componentId = 'TopNavBar.SmallViewportLayout', _TopNavBarSmallViewportLayout.propTypes = propTypes, _TopNavBarSmallViewportLayout.allowedProps = allowedProps, _TopNavBarSmallViewportLayout.defaultProps = {}, _TopNavBarSmallViewportLayout.contextType = TopNavBarContext, _TopNavBarSmallViewportLayout)) || _class) || _class) || _class);
|
|
460
460
|
export { TopNavBarSmallViewportLayout };
|
|
461
461
|
export default TopNavBarSmallViewportLayout;
|
|
@@ -22,8 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { commonAllowedProps, smallViewportAllowedProps } from '../props';
|
|
25
|
+
import { commonAllowedProps, commonPropTypes, smallViewportPropTypes, smallViewportAllowedProps } from '../props';
|
|
26
|
+
const propTypes = {
|
|
27
|
+
// Edit PropTypes in TopNavBarLayout/props.ts
|
|
28
|
+
...commonPropTypes,
|
|
29
|
+
...smallViewportPropTypes
|
|
30
|
+
};
|
|
26
31
|
const allowedProps = [
|
|
27
32
|
// Edit allowed props in TopNavBarLayout/props.ts
|
|
28
33
|
...commonAllowedProps, ...smallViewportAllowedProps];
|
|
29
|
-
export { allowedProps };
|
|
34
|
+
export { propTypes, allowedProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["smallViewportConfig", "styles", "makeStyles"];
|
|
3
|
-
var _dec, _class, _TopNavBarLayout;
|
|
3
|
+
var _dec, _dec2, _class, _TopNavBarLayout;
|
|
4
4
|
/*
|
|
5
5
|
* The MIT License (MIT)
|
|
6
6
|
*
|
|
@@ -26,12 +26,13 @@ var _dec, _class, _TopNavBarLayout;
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { Component } from 'react';
|
|
29
|
+
import { testable } from '@instructure/ui-testable';
|
|
29
30
|
import { withStyle } from '@instructure/emotion';
|
|
30
31
|
import { TopNavBarContext } from '../TopNavBarContext';
|
|
31
32
|
import generateComponentTheme from './theme';
|
|
32
33
|
import { TopNavBarSmallViewportLayout } from './SmallViewportLayout';
|
|
33
34
|
import { TopNavBarDesktopLayout } from './DesktopLayout';
|
|
34
|
-
import { allowedProps } from './props';
|
|
35
|
+
import { propTypes, allowedProps } from './props';
|
|
35
36
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
36
37
|
/**
|
|
37
38
|
---
|
|
@@ -40,7 +41,7 @@ id: TopNavBar.Layout
|
|
|
40
41
|
---
|
|
41
42
|
@module TopNavBarLayout
|
|
42
43
|
**/
|
|
43
|
-
let TopNavBarLayout = (_dec = withStyle(null, generateComponentTheme), _dec(_class = (_TopNavBarLayout = class TopNavBarLayout extends Component {
|
|
44
|
+
let TopNavBarLayout = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_TopNavBarLayout = class TopNavBarLayout extends Component {
|
|
44
45
|
constructor(...args) {
|
|
45
46
|
super(...args);
|
|
46
47
|
this.ref = null;
|
|
@@ -103,8 +104,8 @@ let TopNavBarLayout = (_dec = withStyle(null, generateComponentTheme), _dec(_cla
|
|
|
103
104
|
elementRef: this.handleRef
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
|
-
}, _TopNavBarLayout.displayName = "TopNavBarLayout", _TopNavBarLayout.componentId = 'TopNavBar.Layout', _TopNavBarLayout.allowedProps = allowedProps, _TopNavBarLayout.defaultProps = {
|
|
107
|
+
}, _TopNavBarLayout.displayName = "TopNavBarLayout", _TopNavBarLayout.componentId = 'TopNavBar.Layout', _TopNavBarLayout.propTypes = propTypes, _TopNavBarLayout.allowedProps = allowedProps, _TopNavBarLayout.defaultProps = {
|
|
107
108
|
smallViewportConfig: {}
|
|
108
|
-
}, _TopNavBarLayout.contextType = TopNavBarContext, _TopNavBarLayout)) || _class);
|
|
109
|
+
}, _TopNavBarLayout.contextType = TopNavBarContext, _TopNavBarLayout)) || _class) || _class);
|
|
109
110
|
export { TopNavBarLayout };
|
|
110
111
|
export default TopNavBarLayout;
|
|
@@ -22,8 +22,52 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
import { Children as ChildrenPropTypes, element } from '@instructure/ui-prop-types';
|
|
27
|
+
import { TopNavBarActionItems } from '../TopNavBarActionItems';
|
|
28
|
+
import { TopNavBarBrand } from '../TopNavBarBrand';
|
|
29
|
+
import { TopNavBarMenuItems } from '../TopNavBarMenuItems';
|
|
30
|
+
import { TopNavBarUser } from '../TopNavBarUser';
|
|
31
|
+
import { topNavBarItemTooltipPropType } from '../TopNavBarItem/props';
|
|
32
|
+
import { TopNavBarBreadcrumb } from '../TopNavBarBreadcrumb';
|
|
33
|
+
const commonPropTypes = {
|
|
34
|
+
renderBrand: ChildrenPropTypes.oneOf([TopNavBarBrand]),
|
|
35
|
+
renderMenuItems: ChildrenPropTypes.oneOf([TopNavBarMenuItems]),
|
|
36
|
+
renderActionItems: ChildrenPropTypes.oneOf([TopNavBarActionItems]),
|
|
37
|
+
renderUser: ChildrenPropTypes.oneOf([TopNavBarUser]),
|
|
38
|
+
renderBreadcrumb: ChildrenPropTypes.oneOf([TopNavBarBreadcrumb]),
|
|
39
|
+
navLabel: PropTypes.string,
|
|
40
|
+
elementRef: PropTypes.func
|
|
41
|
+
};
|
|
42
|
+
const desktopPropTypes = {
|
|
43
|
+
hideActionsUserSeparator: PropTypes.bool
|
|
44
|
+
};
|
|
45
|
+
const smallViewportPropTypes = {
|
|
46
|
+
dropdownMenuToggleButtonLabel: PropTypes.string.isRequired,
|
|
47
|
+
dropdownMenuToggleButtonTooltip: topNavBarItemTooltipPropType,
|
|
48
|
+
dropdownMenuLabel: PropTypes.string,
|
|
49
|
+
alternativeTitle: PropTypes.node,
|
|
50
|
+
renderInPlaceDialogConfig: PropTypes.shape({
|
|
51
|
+
open: PropTypes.bool.isRequired,
|
|
52
|
+
onClose: PropTypes.func.isRequired,
|
|
53
|
+
closeButtonLabel: PropTypes.string.isRequired,
|
|
54
|
+
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
55
|
+
returnFocusElement: PropTypes.func,
|
|
56
|
+
shouldContainFocus: PropTypes.bool,
|
|
57
|
+
shouldCloseOnDocumentClick: PropTypes.bool,
|
|
58
|
+
shouldCloseOnEscape: PropTypes.bool
|
|
59
|
+
}),
|
|
60
|
+
trayMountNode: PropTypes.oneOfType([element, PropTypes.func]),
|
|
61
|
+
onDropdownMenuToggle: PropTypes.func,
|
|
62
|
+
onDropdownMenuSelect: PropTypes.func,
|
|
63
|
+
renderNavbarStartDangerousHack: PropTypes.node
|
|
64
|
+
};
|
|
65
|
+
const propTypes = {
|
|
66
|
+
...commonPropTypes,
|
|
67
|
+
smallViewportConfig: PropTypes.shape(smallViewportPropTypes).isRequired
|
|
68
|
+
};
|
|
25
69
|
const commonAllowedProps = ['renderBrand', 'renderMenuItems', 'renderActionItems', 'renderUser', 'renderBreadcrumb', 'navLabel', 'elementRef'];
|
|
26
70
|
const desktopAllowedProps = ['hideActionsUserSeparator'];
|
|
27
71
|
const smallViewportAllowedProps = ['dropdownMenuToggleButtonLabel', 'dropdownMenuToggleButtonTooltip', 'dropdownMenuLabel', 'alternativeTitle', 'renderInPlaceDialogConfig', 'trayMountNode', 'onDropdownMenuToggle', 'onDropdownMenuSelect'];
|
|
28
72
|
const allowedProps = [...commonAllowedProps, 'smallViewportConfig'];
|
|
29
|
-
export { allowedProps, commonAllowedProps, desktopAllowedProps, smallViewportAllowedProps };
|
|
73
|
+
export { propTypes, allowedProps, commonPropTypes, commonAllowedProps, desktopPropTypes, smallViewportPropTypes, desktopAllowedProps, smallViewportAllowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _class, _TopNavBarMenuItems, _span;
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _TopNavBarMenuItems, _span;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -26,6 +26,7 @@ var _dec, _dec2, _class, _TopNavBarMenuItems, _span;
|
|
|
26
26
|
import { Children, Component } from 'react';
|
|
27
27
|
import { omitProps, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
|
|
28
28
|
import { warn, error } from '@instructure/console';
|
|
29
|
+
import { testable } from '@instructure/ui-testable';
|
|
29
30
|
import { withStyle } from '@instructure/emotion';
|
|
30
31
|
import { Drilldown } from '@instructure/ui-drilldown';
|
|
31
32
|
import { TruncateList } from '@instructure/ui-truncate-list';
|
|
@@ -34,7 +35,7 @@ import { TopNavBarItem } from '../TopNavBarItem';
|
|
|
34
35
|
import { mapItemsForDrilldown, renderMappedItemDrilldownSubpages, renderMappedItemsAsDrilldownOptions } from '../utils/mapItemsForDrilldown';
|
|
35
36
|
import generateStyle from './styles';
|
|
36
37
|
import generateComponentTheme from './theme';
|
|
37
|
-
import { allowedProps } from './props';
|
|
38
|
+
import { propTypes, allowedProps } from './props';
|
|
38
39
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
39
40
|
import { createElement as _createElement } from "@emotion/react";
|
|
40
41
|
/**
|
|
@@ -44,7 +45,7 @@ id: TopNavBar.MenuItems
|
|
|
44
45
|
---
|
|
45
46
|
@module TopNavBarMenuItems
|
|
46
47
|
**/
|
|
47
|
-
let TopNavBarMenuItems = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_TopNavBarMenuItems = class TopNavBarMenuItems extends Component {
|
|
48
|
+
let TopNavBarMenuItems = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_TopNavBarMenuItems = class TopNavBarMenuItems extends Component {
|
|
48
49
|
constructor(props) {
|
|
49
50
|
super(props);
|
|
50
51
|
this._hiddenMenuItemsMenuTriggerId = void 0;
|
|
@@ -124,8 +125,7 @@ let TopNavBarMenuItems = (_dec = withDeterministicId(), _dec2 = withStyle(genera
|
|
|
124
125
|
const _child$props = child.props,
|
|
125
126
|
id = _child$props.id,
|
|
126
127
|
status = _child$props.status,
|
|
127
|
-
|
|
128
|
-
variant = _child$props$variant === void 0 ? 'default' : _child$props$variant,
|
|
128
|
+
variant = _child$props.variant,
|
|
129
129
|
renderSubmenu = _child$props.renderSubmenu,
|
|
130
130
|
renderAvatar = _child$props.renderAvatar;
|
|
131
131
|
const isCurrentPage = currentPageId === id;
|
|
@@ -182,10 +182,9 @@ let TopNavBarMenuItems = (_dec = withDeterministicId(), _dec2 = withStyle(genera
|
|
|
182
182
|
...((styles === null || styles === void 0 ? void 0 : styles.itemSpacing) && {
|
|
183
183
|
itemSpacing: styles.itemSpacing
|
|
184
184
|
}),
|
|
185
|
-
"aria-label": listLabel
|
|
186
|
-
"data-cid": "TopNavBarMenuItems"
|
|
185
|
+
"aria-label": listLabel
|
|
187
186
|
}, this.renderChildren());
|
|
188
187
|
}
|
|
189
|
-
}, _TopNavBarMenuItems.displayName = "TopNavBarMenuItems", _TopNavBarMenuItems.componentId = 'TopNavBar.MenuItems', _TopNavBarMenuItems.allowedProps = allowedProps, _TopNavBarMenuItems.defaultProps = {}, _TopNavBarMenuItems.contextType = TopNavBarContext, _TopNavBarMenuItems)) || _class) || _class);
|
|
188
|
+
}, _TopNavBarMenuItems.displayName = "TopNavBarMenuItems", _TopNavBarMenuItems.componentId = 'TopNavBar.MenuItems', _TopNavBarMenuItems.propTypes = propTypes, _TopNavBarMenuItems.allowedProps = allowedProps, _TopNavBarMenuItems.defaultProps = {}, _TopNavBarMenuItems.contextType = TopNavBarContext, _TopNavBarMenuItems)) || _class) || _class) || _class);
|
|
190
189
|
export { TopNavBarMenuItems };
|
|
191
190
|
export default TopNavBarMenuItems;
|
|
@@ -22,5 +22,15 @@
|
|
|
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 { TopNavBarItem } from '../TopNavBarItem';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
children: ChildrenPropTypes.oneOf([TopNavBarItem]),
|
|
30
|
+
currentPageId: PropTypes.string,
|
|
31
|
+
renderHiddenItemsMenuTriggerLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired,
|
|
32
|
+
listLabel: PropTypes.string,
|
|
33
|
+
elementRef: PropTypes.func
|
|
34
|
+
};
|
|
25
35
|
const allowedProps = ['children', 'currentPageId', 'renderHiddenItemsMenuTriggerLabel', 'listLabel', 'elementRef'];
|
|
26
|
-
export { allowedProps };
|
|
36
|
+
export { propTypes, allowedProps };
|