@instructure/ui-top-nav-bar 8.30.1-snapshot-15
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 +57 -0
- package/README.md +30 -0
- package/es/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +47 -0
- package/es/TopNavBar/TopNavBarActionItems/index.js +215 -0
- package/es/TopNavBar/TopNavBarActionItems/props.js +36 -0
- package/es/TopNavBar/TopNavBarActionItems/styles.js +76 -0
- package/es/TopNavBar/TopNavBarActionItems/theme.js +46 -0
- package/es/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +57 -0
- package/es/TopNavBar/TopNavBarBrand/index.js +117 -0
- package/es/TopNavBar/TopNavBarBrand/props.js +37 -0
- package/es/TopNavBar/TopNavBarBrand/styles.js +91 -0
- package/es/TopNavBar/TopNavBarBrand/theme.js +42 -0
- package/es/TopNavBar/TopNavBarContext.js +37 -0
- package/es/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +114 -0
- package/es/TopNavBar/TopNavBarItem/index.js +634 -0
- package/es/TopNavBar/TopNavBarItem/props.js +64 -0
- package/es/TopNavBar/TopNavBarItem/styles.js +124 -0
- package/es/TopNavBar/TopNavBarItem/theme.js +54 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +86 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +119 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +31 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +115 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +61 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +126 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +454 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +31 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +158 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +61 -0
- package/es/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +36 -0
- package/es/TopNavBar/TopNavBarLayout/index.js +118 -0
- package/es/TopNavBar/TopNavBarLayout/props.js +69 -0
- package/es/TopNavBar/TopNavBarLayout/theme.js +40 -0
- package/es/TopNavBar/TopNavBarLocator.js +29 -0
- package/es/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +54 -0
- package/es/TopNavBar/TopNavBarMenuItems/index.js +210 -0
- package/es/TopNavBar/TopNavBarMenuItems/props.js +35 -0
- package/es/TopNavBar/TopNavBarMenuItems/styles.js +65 -0
- package/es/TopNavBar/TopNavBarMenuItems/theme.js +45 -0
- package/es/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +29 -0
- package/es/TopNavBar/TopNavBarUser/index.js +109 -0
- package/es/TopNavBar/TopNavBarUser/props.js +32 -0
- package/es/TopNavBar/TopNavBarUser/styles.js +45 -0
- package/es/TopNavBar/index.js +110 -0
- package/es/TopNavBar/props.js +33 -0
- package/es/TopNavBar/utils/exampleHelpers.js +211 -0
- package/es/TopNavBar/utils/exampleSvgFiles.js +86 -0
- package/es/TopNavBar/utils/mapItemsForDrilldown.js +142 -0
- package/es/index.js +24 -0
- package/lib/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +59 -0
- package/lib/TopNavBar/TopNavBarActionItems/index.js +222 -0
- package/lib/TopNavBar/TopNavBarActionItems/props.js +50 -0
- package/lib/TopNavBar/TopNavBarActionItems/styles.js +84 -0
- package/lib/TopNavBar/TopNavBarActionItems/theme.js +54 -0
- package/lib/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +68 -0
- package/lib/TopNavBar/TopNavBarBrand/index.js +115 -0
- package/lib/TopNavBar/TopNavBarBrand/props.js +48 -0
- package/lib/TopNavBar/TopNavBarBrand/styles.js +99 -0
- package/lib/TopNavBar/TopNavBarBrand/theme.js +50 -0
- package/lib/TopNavBar/TopNavBarContext.js +46 -0
- package/lib/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +131 -0
- package/lib/TopNavBar/TopNavBarItem/index.js +650 -0
- package/lib/TopNavBar/TopNavBarItem/props.js +79 -0
- package/lib/TopNavBar/TopNavBarItem/styles.js +132 -0
- package/lib/TopNavBar/TopNavBarItem/theme.js +62 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +102 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +113 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +40 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +123 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +69 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +143 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +472 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +40 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +166 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +69 -0
- package/lib/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +48 -0
- package/lib/TopNavBar/TopNavBarLayout/index.js +113 -0
- package/lib/TopNavBar/TopNavBarLayout/props.js +94 -0
- package/lib/TopNavBar/TopNavBarLayout/theme.js +52 -0
- package/lib/TopNavBar/TopNavBarLocator.js +39 -0
- package/lib/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +66 -0
- package/lib/TopNavBar/TopNavBarMenuItems/index.js +213 -0
- package/lib/TopNavBar/TopNavBarMenuItems/props.js +48 -0
- package/lib/TopNavBar/TopNavBarMenuItems/styles.js +73 -0
- package/lib/TopNavBar/TopNavBarMenuItems/theme.js +53 -0
- package/lib/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +39 -0
- package/lib/TopNavBar/TopNavBarUser/index.js +104 -0
- package/lib/TopNavBar/TopNavBarUser/props.js +45 -0
- package/lib/TopNavBar/TopNavBarUser/styles.js +53 -0
- package/lib/TopNavBar/index.js +110 -0
- package/lib/TopNavBar/props.js +44 -0
- package/lib/TopNavBar/utils/exampleHelpers.js +255 -0
- package/lib/TopNavBar/utils/exampleSvgFiles.js +75 -0
- package/lib/TopNavBar/utils/mapItemsForDrilldown.js +165 -0
- package/lib/index.js +13 -0
- package/lib/package.json +1 -0
- package/package.json +64 -0
- package/src/TopNavBar/README.md +2329 -0
- package/src/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.ts +53 -0
- package/src/TopNavBar/TopNavBarActionItems/index.tsx +299 -0
- package/src/TopNavBar/TopNavBarActionItems/props.ts +152 -0
- package/src/TopNavBar/TopNavBarActionItems/styles.ts +92 -0
- package/src/TopNavBar/TopNavBarActionItems/theme.ts +51 -0
- package/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts +44 -0
- package/src/TopNavBar/TopNavBarBrand/index.tsx +139 -0
- package/src/TopNavBar/TopNavBarBrand/props.ts +146 -0
- package/src/TopNavBar/TopNavBarBrand/styles.ts +102 -0
- package/src/TopNavBar/TopNavBarBrand/theme.ts +48 -0
- package/src/TopNavBar/TopNavBarContext.ts +47 -0
- package/src/TopNavBar/TopNavBarItem/TopNavBarItemLocator.ts +111 -0
- package/src/TopNavBar/TopNavBarItem/index.tsx +752 -0
- package/src/TopNavBar/TopNavBarItem/props.ts +331 -0
- package/src/TopNavBar/TopNavBarItem/styles.ts +142 -0
- package/src/TopNavBar/TopNavBarItem/theme.ts +60 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.ts +84 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/index.tsx +148 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/props.ts +104 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/styles.ts +136 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/theme.ts +66 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.ts +125 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.tsx +600 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.ts +187 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.ts +184 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.ts +69 -0
- package/src/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.ts +46 -0
- package/src/TopNavBar/TopNavBarLayout/index.tsx +149 -0
- package/src/TopNavBar/TopNavBarLayout/props.ts +209 -0
- package/src/TopNavBar/TopNavBarLayout/theme.ts +47 -0
- package/src/TopNavBar/TopNavBarLocator.ts +31 -0
- package/src/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.ts +56 -0
- package/src/TopNavBar/TopNavBarMenuItems/index.tsx +275 -0
- package/src/TopNavBar/TopNavBarMenuItems/props.ts +133 -0
- package/src/TopNavBar/TopNavBarMenuItems/styles.ts +72 -0
- package/src/TopNavBar/TopNavBarMenuItems/theme.ts +51 -0
- package/src/TopNavBar/TopNavBarUser/TopNavBarUserLocator.ts +32 -0
- package/src/TopNavBar/TopNavBarUser/index.tsx +133 -0
- package/src/TopNavBar/TopNavBarUser/props.ts +83 -0
- package/src/TopNavBar/TopNavBarUser/styles.ts +47 -0
- package/src/TopNavBar/index.tsx +142 -0
- package/src/TopNavBar/props.ts +108 -0
- package/src/TopNavBar/utils/exampleHelpers.tsx +342 -0
- package/src/TopNavBar/utils/exampleSvgFiles.tsx +76 -0
- package/src/TopNavBar/utils/mapItemsForDrilldown.tsx +228 -0
- package/src/index.ts +62 -0
- package/tsconfig.build.json +37 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +4 -0
- package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts +2116 -0
- package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts +40 -0
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts +59 -0
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarActionItems/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarActionItems/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts +592 -0
- package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/index.d.ts +30 -0
- package/types/TopNavBar/TopNavBarBrand/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/props.d.ts +60 -0
- package/types/TopNavBar/TopNavBarBrand/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarBrand/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarBrand/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarContext.d.ts +17 -0
- package/types/TopNavBar/TopNavBarContext.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts +642 -0
- package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/index.d.ts +64 -0
- package/types/TopNavBar/TopNavBarItem/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/props.d.ts +188 -0
- package/types/TopNavBar/TopNavBarItem/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarItem/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarItem/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts +5737 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts +31 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts +29 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts +4357 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts +58 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts +89 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts +7 -0
- package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/index.d.ts +34 -0
- package/types/TopNavBar/TopNavBarLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/props.d.ts +83 -0
- package/types/TopNavBar/TopNavBarLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLocator.d.ts +566 -0
- package/types/TopNavBar/TopNavBarLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts +1351 -0
- package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts +38 -0
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts +53 -0
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts +566 -0
- package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/index.d.ts +31 -0
- package/types/TopNavBar/TopNavBarUser/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/props.d.ts +29 -0
- package/types/TopNavBar/TopNavBarUser/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/styles.d.ts +14 -0
- package/types/TopNavBar/TopNavBarUser/styles.d.ts.map +1 -0
- package/types/TopNavBar/index.d.ts +38 -0
- package/types/TopNavBar/index.d.ts.map +1 -0
- package/types/TopNavBar/props.d.ts +43 -0
- package/types/TopNavBar/props.d.ts.map +1 -0
- package/types/TopNavBar/utils/exampleHelpers.d.ts +70 -0
- package/types/TopNavBar/utils/exampleHelpers.d.ts.map +1 -0
- package/types/TopNavBar/utils/exampleSvgFiles.d.ts +7 -0
- package/types/TopNavBar/utils/exampleSvgFiles.d.ts.map +1 -0
- package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts +19 -0
- package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = exports.TopNavBarActionItems = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
15
|
+
|
|
16
|
+
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
17
|
+
|
|
18
|
+
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
19
|
+
|
|
20
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
21
|
+
|
|
22
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
23
|
+
|
|
24
|
+
var _console = require("@instructure/console");
|
|
25
|
+
|
|
26
|
+
var _emotion = require("@instructure/emotion");
|
|
27
|
+
|
|
28
|
+
var _Drilldown = require("@instructure/ui-drilldown/lib/Drilldown");
|
|
29
|
+
|
|
30
|
+
var _IconMoreLine = require("@instructure/ui-icons/lib/IconMoreLine.js");
|
|
31
|
+
|
|
32
|
+
var _TruncateList = require("@instructure/ui-truncate-list/lib/TruncateList");
|
|
33
|
+
|
|
34
|
+
var _TopNavBarItem = require("../TopNavBarItem");
|
|
35
|
+
|
|
36
|
+
var _mapItemsForDrilldown = require("../utils/mapItemsForDrilldown");
|
|
37
|
+
|
|
38
|
+
var _TopNavBarContext = require("../TopNavBarContext");
|
|
39
|
+
|
|
40
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
41
|
+
|
|
42
|
+
var _theme = _interopRequireDefault(require("./theme"));
|
|
43
|
+
|
|
44
|
+
var _props = require("./props");
|
|
45
|
+
|
|
46
|
+
var _dec, _dec2, _dec3, _class, _class2;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
---
|
|
50
|
+
parent: TopNavBar
|
|
51
|
+
id: TopNavBar.ActionItems
|
|
52
|
+
---
|
|
53
|
+
@module TopNavBarActionItems
|
|
54
|
+
@tsProps
|
|
55
|
+
**/
|
|
56
|
+
let TopNavBarActionItems = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class TopNavBarActionItems extends _react.Component {
|
|
57
|
+
constructor(props) {
|
|
58
|
+
super(props);
|
|
59
|
+
this.ref = null;
|
|
60
|
+
this._hiddenActionItemsMenuId = void 0;
|
|
61
|
+
this._hiddenActionItemsMenuTriggerId = void 0;
|
|
62
|
+
|
|
63
|
+
this.handleRef = el => {
|
|
64
|
+
const elementRef = this.props.elementRef;
|
|
65
|
+
this.ref = el;
|
|
66
|
+
|
|
67
|
+
if (typeof elementRef === 'function') {
|
|
68
|
+
elementRef(el);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
this.renderOptionContent = (children, itemProps) => {
|
|
73
|
+
const styles = this.props.styles;
|
|
74
|
+
const status = itemProps.status;
|
|
75
|
+
return (0, _emotion.jsx)("span", {
|
|
76
|
+
css: status === 'active' ? styles === null || styles === void 0 ? void 0 : styles.dropdownMenuOptionActive : styles === null || styles === void 0 ? void 0 : styles.dropdownMenuOption
|
|
77
|
+
}, children);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
this._hiddenActionItemsMenuId = props.deterministicId('TopNavBarActionItems-hiddenActionItemsMenu');
|
|
81
|
+
this._hiddenActionItemsMenuTriggerId = props.deterministicId('TopNavBarActionItems-hiddenActionItemsMenuTrigger');
|
|
82
|
+
this.state = {
|
|
83
|
+
key: 0,
|
|
84
|
+
visibleActionItemsCount: void 0
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
componentDidMount() {
|
|
89
|
+
var _this$props$makeStyle, _this$props;
|
|
90
|
+
|
|
91
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStylesVariables);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
componentDidUpdate(prevProps) {
|
|
95
|
+
var _this$props$makeStyle2, _this$props2;
|
|
96
|
+
|
|
97
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
98
|
+
|
|
99
|
+
if (this.context.layout === 'smallViewport' && _react.default.Children.count(prevProps.children) !== _react.default.Children.count(this.props.children)) {
|
|
100
|
+
this.setState({
|
|
101
|
+
key: this.state.key + 1
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get makeStylesVariables() {
|
|
107
|
+
return {
|
|
108
|
+
layout: this.context.layout
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get childrenArray() {
|
|
113
|
+
const children = _react.default.Children.toArray(this.props.children);
|
|
114
|
+
|
|
115
|
+
return children.map(child => {
|
|
116
|
+
if (!(child !== null && child !== void 0 && child.props)) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const _child$props = child.props,
|
|
121
|
+
id = _child$props.id,
|
|
122
|
+
renderAvatar = _child$props.renderAvatar,
|
|
123
|
+
renderIcon = _child$props.renderIcon,
|
|
124
|
+
variant = _child$props.variant;
|
|
125
|
+
|
|
126
|
+
if (renderAvatar) {
|
|
127
|
+
(0, _console.warn)(false, `Items in <TopNavBar.ActionItems> are not allowed to have avatars, please remove it from item with the id "${id}".`);
|
|
128
|
+
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
129
|
+
renderAvatar: void 0,
|
|
130
|
+
variant: 'default'
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (this.context.layout === 'smallViewport' && variant !== 'icon') {
|
|
135
|
+
if (!renderIcon) {
|
|
136
|
+
(0, _console.error)(false, `Items in <TopNavBar.ActionItems> are required to have the \`renderIcon\` prop, because only the icons are displayed due to the lack of space. Please add an icon to the item with the id "${id}".`);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
141
|
+
variant: 'icon'
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return child;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
renderHiddenActionItemsMenu(hiddenItems) {
|
|
150
|
+
const _this$props3 = this.props,
|
|
151
|
+
renderHiddenItemsMenuTriggerLabel = _this$props3.renderHiddenItemsMenuTriggerLabel,
|
|
152
|
+
renderHiddenItemsMenuTriggerTooltip = _this$props3.renderHiddenItemsMenuTriggerTooltip;
|
|
153
|
+
const mappedItems = (0, _mapItemsForDrilldown.mapItemsForDrilldown)(hiddenItems, {
|
|
154
|
+
renderOptionContent: this.renderOptionContent
|
|
155
|
+
});
|
|
156
|
+
const subPages = (0, _mapItemsForDrilldown.renderMappedItemDrilldownSubpages)(mappedItems);
|
|
157
|
+
const options = (0, _mapItemsForDrilldown.renderMappedItemsAsDrilldownOptions)(mappedItems);
|
|
158
|
+
const label = typeof renderHiddenItemsMenuTriggerLabel === 'function' ? renderHiddenItemsMenuTriggerLabel(hiddenItems.length) : renderHiddenItemsMenuTriggerLabel;
|
|
159
|
+
const tooltip = typeof renderHiddenItemsMenuTriggerTooltip === 'function' ? renderHiddenItemsMenuTriggerTooltip(hiddenItems.length) : renderHiddenItemsMenuTriggerTooltip;
|
|
160
|
+
return (0, _emotion.jsx)(_TopNavBarItem.TopNavBarItem, {
|
|
161
|
+
id: this._hiddenActionItemsMenuTriggerId,
|
|
162
|
+
renderIcon: _IconMoreLine.IconMoreLine,
|
|
163
|
+
variant: "icon",
|
|
164
|
+
tooltip: tooltip,
|
|
165
|
+
showSubmenuChevron: false,
|
|
166
|
+
renderSubmenu: (0, _emotion.jsx)(_Drilldown.Drilldown, {
|
|
167
|
+
rootPageId: this._hiddenActionItemsMenuId
|
|
168
|
+
}, [(0, _emotion.jsx)(_Drilldown.Drilldown.Page, {
|
|
169
|
+
id: this._hiddenActionItemsMenuId,
|
|
170
|
+
key: this._hiddenActionItemsMenuId
|
|
171
|
+
}, options), ...subPages])
|
|
172
|
+
}, label);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
renderTruncatedActionItemList() {
|
|
176
|
+
const _this$props4 = this.props,
|
|
177
|
+
listLabel = _this$props4.listLabel,
|
|
178
|
+
styles = _this$props4.styles;
|
|
179
|
+
return (0, _emotion.jsx)(_TruncateList.TruncateList, Object.assign({}, (0, _passthroughProps.passthroughProps)((0, _omitProps.omitProps)(this.props, _props.allowedProps)), {
|
|
180
|
+
key: this.state.key // rerender if child count changes
|
|
181
|
+
,
|
|
182
|
+
elementRef: this.handleRef,
|
|
183
|
+
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarActionItems,
|
|
184
|
+
visibleItemsCount: this.state.visibleActionItemsCount,
|
|
185
|
+
onUpdate: _ref => {
|
|
186
|
+
let visibleItemsCount = _ref.visibleItemsCount;
|
|
187
|
+
this.setState({
|
|
188
|
+
visibleActionItemsCount: visibleItemsCount
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
renderHiddenItemMenu: hiddenChildren => this.renderHiddenActionItemsMenu(hiddenChildren),
|
|
192
|
+
"aria-label": listLabel
|
|
193
|
+
}), this.childrenArray);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
render() {
|
|
197
|
+
const _this$props5 = this.props,
|
|
198
|
+
listLabel = _this$props5.listLabel,
|
|
199
|
+
styles = _this$props5.styles;
|
|
200
|
+
|
|
201
|
+
if (!this.childrenArray.length) {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (this.context.layout === 'smallViewport') {
|
|
206
|
+
return this.renderTruncatedActionItemList();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return (0, _emotion.jsx)("ul", Object.assign({}, (0, _omitProps.omitProps)(this.props, _props.allowedProps), {
|
|
210
|
+
ref: this.handleRef,
|
|
211
|
+
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarActionItems,
|
|
212
|
+
"aria-label": listLabel
|
|
213
|
+
}), this.childrenArray.map(item => (0, _emotion.jsx)("li", {
|
|
214
|
+
css: styles === null || styles === void 0 ? void 0 : styles.listItem,
|
|
215
|
+
key: item.props.id
|
|
216
|
+
}, item)));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}, _class2.displayName = "TopNavBarActionItems", _class2.componentId = 'TopNavBar.ActionItems', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {}, _class2.contextType = _TopNavBarContext.TopNavBarContext, _class2)) || _class) || _class) || _class);
|
|
220
|
+
exports.TopNavBarActionItems = TopNavBarActionItems;
|
|
221
|
+
var _default = TopNavBarActionItems;
|
|
222
|
+
exports.default = _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
13
|
+
|
|
14
|
+
var _TopNavBarItem = require("../TopNavBarItem");
|
|
15
|
+
|
|
16
|
+
var _props = require("../TopNavBarItem/props");
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* The MIT License (MIT)
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
22
|
+
*
|
|
23
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
* in the Software without restriction, including without limitation the rights
|
|
26
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
* furnished to do so, subject to the following conditions:
|
|
29
|
+
*
|
|
30
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
31
|
+
* copies or substantial portions of the Software.
|
|
32
|
+
*
|
|
33
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
+
* SOFTWARE.
|
|
40
|
+
*/
|
|
41
|
+
const propTypes = {
|
|
42
|
+
children: _Children.Children.oneOf([_TopNavBarItem.TopNavBarItem]),
|
|
43
|
+
listLabel: _propTypes.default.string,
|
|
44
|
+
renderHiddenItemsMenuTriggerLabel: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]).isRequired,
|
|
45
|
+
renderHiddenItemsMenuTriggerTooltip: _propTypes.default.oneOfType([_props.topNavBarItemTooltipPropType, _propTypes.default.func]),
|
|
46
|
+
elementRef: _propTypes.default.func
|
|
47
|
+
};
|
|
48
|
+
exports.propTypes = propTypes;
|
|
49
|
+
const allowedProps = ['children', 'listLabel', 'renderHiddenItemsMenuTriggerLabel', 'renderHiddenItemsMenuTriggerTooltip', 'elementRef'];
|
|
50
|
+
exports.allowedProps = allowedProps;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* The MIT License (MIT)
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
* copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
* SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* ---
|
|
34
|
+
* private: true
|
|
35
|
+
* ---
|
|
36
|
+
* Generates the style object from the theme and provided additional information
|
|
37
|
+
* @param {Object} componentTheme The theme variable object.
|
|
38
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
39
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
40
|
+
* @return {Object} The final style object, which will be used in the component
|
|
41
|
+
*/
|
|
42
|
+
const generateStyle = (componentTheme, _props, state) => {
|
|
43
|
+
const dropdownMenuOptionStyle = {
|
|
44
|
+
display: 'inline-block',
|
|
45
|
+
padding: `0 ${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorSpacing}`
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
topNavBarActionItems: {
|
|
49
|
+
label: 'topNavBarActionItems',
|
|
50
|
+
boxSizing: 'border-box',
|
|
51
|
+
listStyleType: 'none',
|
|
52
|
+
margin: '0',
|
|
53
|
+
padding: '0',
|
|
54
|
+
flex: '0 0',
|
|
55
|
+
display: 'flex',
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'stretch',
|
|
58
|
+
justifyContent: 'flex-end',
|
|
59
|
+
...(state.layout === 'smallViewport' && {
|
|
60
|
+
flex: '1 1',
|
|
61
|
+
marginInlineStart: componentTheme.smallViewportActionItemContainerMargin,
|
|
62
|
+
maxWidth: componentTheme.smallViewportActionItemContainerMaxWidth
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
listItem: {
|
|
66
|
+
label: 'topNavBarActionItems__listItem',
|
|
67
|
+
flex: '0 0'
|
|
68
|
+
},
|
|
69
|
+
dropdownMenuOption: {
|
|
70
|
+
label: 'topNavBarActionItems__dropdownMenuOption',
|
|
71
|
+
...dropdownMenuOptionStyle
|
|
72
|
+
},
|
|
73
|
+
dropdownMenuOptionActive: {
|
|
74
|
+
label: 'topNavBarActionItems__dropdownMenuOptionActive',
|
|
75
|
+
...dropdownMenuOptionStyle,
|
|
76
|
+
fontWeight: componentTheme.smallViewportDropdownMenuActiveOptionFontWeight,
|
|
77
|
+
paddingBlockEnd: componentTheme.smallViewportDropdownMenuActiveOptionIndicatorSpacing,
|
|
78
|
+
borderBottom: `${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorWidth} solid ${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorColor}`
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var _default = generateStyle;
|
|
84
|
+
exports.default = _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* The MIT License (MIT)
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
* copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
* SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
34
|
+
* @param {Object} theme The actual theme object.
|
|
35
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
36
|
+
*/
|
|
37
|
+
const generateComponentTheme = theme => {
|
|
38
|
+
const typography = theme.typography,
|
|
39
|
+
spacing = theme.spacing,
|
|
40
|
+
borders = theme.borders;
|
|
41
|
+
const componentVariables = {
|
|
42
|
+
smallViewportActionItemContainerMargin: spacing === null || spacing === void 0 ? void 0 : spacing.xxLarge,
|
|
43
|
+
smallViewportActionItemContainerMaxWidth: '50%',
|
|
44
|
+
smallViewportDropdownMenuActiveOptionFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
|
|
45
|
+
smallViewportDropdownMenuActiveOptionIndicatorSpacing: '0.25rem',
|
|
46
|
+
smallViewportDropdownMenuActiveOptionIndicatorWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
47
|
+
smallViewportDropdownMenuActiveOptionIndicatorColor: 'currentColor'
|
|
48
|
+
};
|
|
49
|
+
return { ...componentVariables
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var _default = generateComponentTheme;
|
|
54
|
+
exports.default = _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TopNavBarBrandLocator = void 0;
|
|
7
|
+
|
|
8
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
9
|
+
|
|
10
|
+
var _uiTestUtils = require("@instructure/ui-test-utils");
|
|
11
|
+
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* The MIT License (MIT)
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
18
|
+
*
|
|
19
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
21
|
+
* in the Software without restriction, including without limitation the rights
|
|
22
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
24
|
+
* furnished to do so, subject to the following conditions:
|
|
25
|
+
*
|
|
26
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
27
|
+
* copies or substantial portions of the Software.
|
|
28
|
+
*
|
|
29
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
+
* SOFTWARE.
|
|
36
|
+
*/
|
|
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 TopNavBarBrandLocator = (0, _locator.locator)(_index.TopNavBarBrand.selector, {
|
|
39
|
+
findContainer: function () {
|
|
40
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
|
+
args[_key] = arguments[_key];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (0, _uiTestUtils.find)('[class$="-topNavBarBrand__container"]', ...args);
|
|
45
|
+
},
|
|
46
|
+
findBrandNameContainer: function () {
|
|
47
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
48
|
+
args[_key2] = arguments[_key2];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (0, _uiTestUtils.find)('[class$="-topNavBarBrand__nameContainer"]', ...args);
|
|
52
|
+
},
|
|
53
|
+
findBrandIconContainer: function () {
|
|
54
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
55
|
+
args[_key3] = arguments[_key3];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (0, _uiTestUtils.find)('[class$="-topNavBarBrand__iconContainer"]', ...args);
|
|
59
|
+
},
|
|
60
|
+
findScreenReaderLabel: function () {
|
|
61
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
62
|
+
args[_key4] = arguments[_key4];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (0, _uiTestUtils.find)('[class$="-screenReaderContent"]', ...args);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
exports.TopNavBarBrandLocator = TopNavBarBrandLocator;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = exports.TopNavBarBrand = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
15
|
+
|
|
16
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
17
|
+
|
|
18
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
19
|
+
|
|
20
|
+
var _emotion = require("@instructure/emotion");
|
|
21
|
+
|
|
22
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
23
|
+
|
|
24
|
+
var _View = require("@instructure/ui-view/lib/View");
|
|
25
|
+
|
|
26
|
+
var _TopNavBarContext = require("../TopNavBarContext");
|
|
27
|
+
|
|
28
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
29
|
+
|
|
30
|
+
var _theme = _interopRequireDefault(require("./theme"));
|
|
31
|
+
|
|
32
|
+
var _props = require("./props");
|
|
33
|
+
|
|
34
|
+
var _dec, _dec2, _class, _class2;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
---
|
|
38
|
+
parent: TopNavBar
|
|
39
|
+
id: TopNavBar.Brand
|
|
40
|
+
---
|
|
41
|
+
@module TopNavBarBrand
|
|
42
|
+
@tsProps
|
|
43
|
+
**/
|
|
44
|
+
let TopNavBarBrand = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class TopNavBarBrand extends _react.Component {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
this.ref = null;
|
|
48
|
+
|
|
49
|
+
this.handleRef = el => {
|
|
50
|
+
const elementRef = this.props.elementRef;
|
|
51
|
+
this.ref = el;
|
|
52
|
+
|
|
53
|
+
if (typeof elementRef === 'function') {
|
|
54
|
+
elementRef(el);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
componentDidMount() {
|
|
60
|
+
var _this$props$makeStyle, _this$props;
|
|
61
|
+
|
|
62
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStylesVariables);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
componentDidUpdate() {
|
|
66
|
+
var _this$props$makeStyle2, _this$props2;
|
|
67
|
+
|
|
68
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get makeStylesVariables() {
|
|
72
|
+
return {
|
|
73
|
+
layout: this.context.layout
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
render() {
|
|
78
|
+
const _this$props3 = this.props,
|
|
79
|
+
screenReaderLabel = _this$props3.screenReaderLabel,
|
|
80
|
+
renderName = _this$props3.renderName,
|
|
81
|
+
renderIcon = _this$props3.renderIcon,
|
|
82
|
+
href = _this$props3.href,
|
|
83
|
+
onClick = _this$props3.onClick,
|
|
84
|
+
styles = _this$props3.styles;
|
|
85
|
+
const ElementType = (0, _getElementType.getElementType)(TopNavBarBrand, this.props);
|
|
86
|
+
return (0, _emotion.jsx)("div", {
|
|
87
|
+
ref: this.handleRef,
|
|
88
|
+
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarBrand
|
|
89
|
+
}, (renderIcon || renderName) && (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _omitProps.omitProps)(this.props, _props.allowedProps), {
|
|
90
|
+
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
91
|
+
as: ElementType,
|
|
92
|
+
href: href,
|
|
93
|
+
onClick: onClick,
|
|
94
|
+
position: "relative",
|
|
95
|
+
focusColor: this.context.inverseColor ? 'info' : 'inverse',
|
|
96
|
+
focusPosition: "inset",
|
|
97
|
+
borderRadius: "medium",
|
|
98
|
+
themeOverride: {
|
|
99
|
+
focusOutlineInset: styles === null || styles === void 0 ? void 0 : styles.focusOutlineInset
|
|
100
|
+
}
|
|
101
|
+
}), (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, screenReaderLabel), renderIcon && this.context.layout !== 'smallViewport' && (0, _emotion.jsx)("div", {
|
|
102
|
+
css: styles === null || styles === void 0 ? void 0 : styles.iconContainer,
|
|
103
|
+
role: "presentation",
|
|
104
|
+
"aria-hidden": "true"
|
|
105
|
+
}, renderIcon), renderName && (0, _emotion.jsx)("div", {
|
|
106
|
+
css: styles === null || styles === void 0 ? void 0 : styles.nameContainer,
|
|
107
|
+
role: "presentation",
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}, renderName)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}, _class2.displayName = "TopNavBarBrand", _class2.componentId = 'TopNavBar.Brand', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {}, _class2.contextType = _TopNavBarContext.TopNavBarContext, _class2)) || _class) || _class);
|
|
113
|
+
exports.TopNavBarBrand = TopNavBarBrand;
|
|
114
|
+
var _default = TopNavBarBrand;
|
|
115
|
+
exports.default = _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
screenReaderLabel: _propTypes.default.string.isRequired,
|
|
37
|
+
renderName: _propTypes.default.node,
|
|
38
|
+
renderIcon: _propTypes.default.node,
|
|
39
|
+
nameBackground: _propTypes.default.string,
|
|
40
|
+
iconBackground: _propTypes.default.string,
|
|
41
|
+
href: _propTypes.default.string,
|
|
42
|
+
onClick: _propTypes.default.func,
|
|
43
|
+
as: _propTypes.default.elementType,
|
|
44
|
+
elementRef: _propTypes.default.func
|
|
45
|
+
};
|
|
46
|
+
exports.propTypes = propTypes;
|
|
47
|
+
const allowedProps = ['screenReaderLabel', 'renderName', 'renderIcon', 'nameBackground', 'iconBackground', 'href', 'onClick', 'as', 'elementRef'];
|
|
48
|
+
exports.allowedProps = allowedProps;
|