@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,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
const propTypes = {
|
|
26
|
+
children: PropTypes.func,
|
|
27
|
+
breakpoint: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
28
|
+
mediaQueryMatch: PropTypes.oneOf(['element', 'media']),
|
|
29
|
+
inverseColor: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
30
|
+
elementRef: PropTypes.func
|
|
31
|
+
};
|
|
32
|
+
const allowedProps = ['children', 'breakpoint', 'mediaQueryMatch', 'inverseColor', 'elementRef'];
|
|
33
|
+
export { propTypes, allowedProps };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { Drilldown } from '@instructure/ui-drilldown';
|
|
26
|
+
import { IconQuestionLine, IconAlertsLine, IconConfigureLine, IconSearchLine, IconDiscussionLine, IconDashboardLine } from '@instructure/ui-icons';
|
|
27
|
+
import { TopNavBarContext } from '../TopNavBarContext';
|
|
28
|
+
import { TopNavBar } from '../index';
|
|
29
|
+
import { elevateIcon, elevateLogo, elevateLogoInverse } from './exampleSvgFiles';
|
|
30
|
+
const avatarExample = {
|
|
31
|
+
avatarName: 'User Name',
|
|
32
|
+
avatarSrc: 'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'
|
|
33
|
+
};
|
|
34
|
+
const itemSubmenuExample = /*#__PURE__*/React.createElement(Drilldown, {
|
|
35
|
+
rootPageId: "root"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Drilldown.Page, {
|
|
37
|
+
id: "root"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Drilldown.Option, {
|
|
39
|
+
id: "linkExampleOption1",
|
|
40
|
+
href: "/#One"
|
|
41
|
+
}, "Link One"), /*#__PURE__*/React.createElement(Drilldown.Option, {
|
|
42
|
+
id: "linkExampleOption2",
|
|
43
|
+
href: "/#Two"
|
|
44
|
+
}, "Link Two"), /*#__PURE__*/React.createElement(Drilldown.Option, {
|
|
45
|
+
id: "linkExampleOption3",
|
|
46
|
+
href: "/#Three"
|
|
47
|
+
}, "Link Three")));
|
|
48
|
+
|
|
49
|
+
const getCustomPopoverConfig = function (inverseColor) {
|
|
50
|
+
let extraProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
51
|
+
return {
|
|
52
|
+
children: getCustomPopoverContent(!inverseColor),
|
|
53
|
+
color: inverseColor ? 'primary-inverse' : 'primary',
|
|
54
|
+
isShowingContent: true,
|
|
55
|
+
placement: 'bottom center',
|
|
56
|
+
...extraProps
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const getCustomPopoverContent = inverseColor => /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
style: {
|
|
62
|
+
color: inverseColor ? 'black' : 'white',
|
|
63
|
+
padding: '0 0.5rem'
|
|
64
|
+
}
|
|
65
|
+
}, "dialog content");
|
|
66
|
+
|
|
67
|
+
const getInPlaceDialogConfig = function (inverseColor) {
|
|
68
|
+
let extraProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
69
|
+
return {
|
|
70
|
+
open: true,
|
|
71
|
+
onClose: () => {},
|
|
72
|
+
closeButtonLabel: 'Close Search and return to Navigation',
|
|
73
|
+
returnFocusElement: () => document.getElementById('Search'),
|
|
74
|
+
shouldCloseOnEscape: true,
|
|
75
|
+
shouldCloseOnDocumentClick: false,
|
|
76
|
+
shouldContainFocus: false,
|
|
77
|
+
content: () => getCustomPopoverContent(inverseColor),
|
|
78
|
+
...extraProps
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const SmallViewportModeWrapper = props => {
|
|
83
|
+
return /*#__PURE__*/React.createElement(TopNavBarContext.Provider, {
|
|
84
|
+
value: {
|
|
85
|
+
layout: props.layout || 'smallViewport',
|
|
86
|
+
inverseColor: typeof props.inverseColor === 'undefined' ? false : props.inverseColor
|
|
87
|
+
}
|
|
88
|
+
}, props.children);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
SmallViewportModeWrapper.defaultProps = {
|
|
92
|
+
layout: 'smallViewport',
|
|
93
|
+
inverseColor: false
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const getBrand = function () {
|
|
97
|
+
let config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
98
|
+
const logo = config.inverseColor ? elevateLogoInverse : elevateLogo;
|
|
99
|
+
const nameBackground = !config.hasBrandNameBackground ? void 0 : config.inverseColor ? '#F5F5F5' : '#2D3B45';
|
|
100
|
+
return /*#__PURE__*/React.createElement(TopNavBar.Brand, Object.assign({
|
|
101
|
+
screenReaderLabel: "Brand name",
|
|
102
|
+
renderName: logo,
|
|
103
|
+
renderIcon: elevateIcon,
|
|
104
|
+
iconBackground: "#0097D3",
|
|
105
|
+
nameBackground: nameBackground,
|
|
106
|
+
href: "/#TopNavBar"
|
|
107
|
+
}, config.brandProps));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const getMenuItems = function () {
|
|
111
|
+
let config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
112
|
+
const items = config.menuItemsCustomIdList || ['Overview', 'Admin', 'Settings', 'Maps', 'Assessments', 'Community'];
|
|
113
|
+
const count = typeof config.menuItemsCount !== 'undefined' ? config.menuItemsCount : 6;
|
|
114
|
+
const itemsSubset = items.slice(0, count);
|
|
115
|
+
return /*#__PURE__*/React.createElement(TopNavBar.MenuItems, Object.assign({
|
|
116
|
+
listLabel: "Page navigation",
|
|
117
|
+
currentPageId: config.currentPageId,
|
|
118
|
+
renderHiddenItemsMenuTriggerLabel: hiddenChildrenCount => `${hiddenChildrenCount} More`
|
|
119
|
+
}, config.menuItemsProps), itemsSubset.map((item, idx) => {
|
|
120
|
+
const itemProps = typeof config.menuItemsItemProps === 'function' ? config.menuItemsItemProps(item, idx) : config.menuItemsItemProps;
|
|
121
|
+
return /*#__PURE__*/React.createElement(TopNavBar.Item, Object.assign({
|
|
122
|
+
key: item,
|
|
123
|
+
id: item,
|
|
124
|
+
href: config.menuItemsWithSubmenu ? void 0 : '/#TopNavBar',
|
|
125
|
+
renderSubmenu: config.menuItemsWithSubmenu ? itemSubmenuExample : void 0
|
|
126
|
+
}, itemProps), (itemProps === null || itemProps === void 0 ? void 0 : itemProps.children) || item);
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const getActionItems = function () {
|
|
131
|
+
var _config$actionItemsPr, _config$actionItemsPr2;
|
|
132
|
+
|
|
133
|
+
let config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
134
|
+
const items = [{
|
|
135
|
+
label: 'Search',
|
|
136
|
+
icon: IconSearchLine
|
|
137
|
+
}, {
|
|
138
|
+
label: 'Info',
|
|
139
|
+
icon: IconQuestionLine
|
|
140
|
+
}, {
|
|
141
|
+
label: 'Alerts',
|
|
142
|
+
icon: IconAlertsLine
|
|
143
|
+
}, {
|
|
144
|
+
label: 'Discussions',
|
|
145
|
+
icon: IconDiscussionLine
|
|
146
|
+
}, {
|
|
147
|
+
label: 'Dashboard',
|
|
148
|
+
icon: IconDashboardLine
|
|
149
|
+
}, {
|
|
150
|
+
label: 'Settings',
|
|
151
|
+
icon: IconConfigureLine
|
|
152
|
+
}];
|
|
153
|
+
const count = typeof config.actionItemsCount !== 'undefined' ? config.actionItemsCount : 3;
|
|
154
|
+
const itemsSubset = items.slice(0, count);
|
|
155
|
+
return /*#__PURE__*/React.createElement(TopNavBar.ActionItems, Object.assign({}, config.actionItemsProps, {
|
|
156
|
+
listLabel: ((_config$actionItemsPr = config.actionItemsProps) === null || _config$actionItemsPr === void 0 ? void 0 : _config$actionItemsPr.listLabel) || 'Actions',
|
|
157
|
+
renderHiddenItemsMenuTriggerLabel: ((_config$actionItemsPr2 = config.actionItemsProps) === null || _config$actionItemsPr2 === void 0 ? void 0 : _config$actionItemsPr2.renderHiddenItemsMenuTriggerLabel) || (hiddenChildrenCount => `${hiddenChildrenCount} more actions`)
|
|
158
|
+
}), itemsSubset.map((item, idx) => {
|
|
159
|
+
const itemProps = typeof config.actionItemsItemProps === 'function' ? config.actionItemsItemProps(item.label, idx) : config.actionItemsItemProps;
|
|
160
|
+
return /*#__PURE__*/React.createElement(TopNavBar.Item, Object.assign({
|
|
161
|
+
key: item.label,
|
|
162
|
+
id: item.label,
|
|
163
|
+
renderIcon: item.icon,
|
|
164
|
+
variant: 'icon',
|
|
165
|
+
href: "/#TopNavBar",
|
|
166
|
+
customPopoverConfig: config.hasRenderInPlaceDialogConfig && item.label === 'Search' ? getCustomPopoverConfig(config.inverseColor) : void 0
|
|
167
|
+
}, itemProps), (itemProps === null || itemProps === void 0 ? void 0 : itemProps.children) || item.label);
|
|
168
|
+
}));
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const getUser = function () {
|
|
172
|
+
var _config$userProps, _config$userItemProps;
|
|
173
|
+
|
|
174
|
+
let config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
175
|
+
return /*#__PURE__*/React.createElement(TopNavBar.User, config.userProps, config.userProps && 'children' in config.userProps ? (_config$userProps = config.userProps) === null || _config$userProps === void 0 ? void 0 : _config$userProps.children : /*#__PURE__*/React.createElement(TopNavBar.Item, Object.assign({
|
|
176
|
+
id: config.userId || 'User',
|
|
177
|
+
href: config.userWithSubmenu ? void 0 : '/#TopNavBar',
|
|
178
|
+
variant: config.userVariant || 'default',
|
|
179
|
+
renderAvatar: config.userWithAvatar ? avatarExample : void 0,
|
|
180
|
+
renderSubmenu: config.userWithSubmenu ? itemSubmenuExample : void 0
|
|
181
|
+
}, config.userItemProps), ((_config$userItemProps = config.userItemProps) === null || _config$userItemProps === void 0 ? void 0 : _config$userItemProps.children) || (config.userVariant === 'button' ? 'Log In/Register' : 'User Name')));
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const getLayoutProps = function (props) {
|
|
185
|
+
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
186
|
+
return {
|
|
187
|
+
desktopConfig: {
|
|
188
|
+
hideActionsUserSeparator: config.hideActionsUserSeparator
|
|
189
|
+
},
|
|
190
|
+
smallViewportConfig: {
|
|
191
|
+
dropdownMenuToggleButtonLabel: 'Toggle Menu',
|
|
192
|
+
dropdownMenuLabel: 'Main Menu',
|
|
193
|
+
alternativeTitle: config.hasAlternativeTitle ? 'Page title' : void 0,
|
|
194
|
+
renderInPlaceDialogConfig: config.hasRenderInPlaceDialogConfig ? getInPlaceDialogConfig(props.inverseColor) : void 0
|
|
195
|
+
},
|
|
196
|
+
renderBrand: getBrand({ ...props,
|
|
197
|
+
...config
|
|
198
|
+
}),
|
|
199
|
+
renderMenuItems: getMenuItems({ ...props,
|
|
200
|
+
...config
|
|
201
|
+
}),
|
|
202
|
+
renderActionItems: getActionItems({ ...props,
|
|
203
|
+
...config
|
|
204
|
+
}),
|
|
205
|
+
renderUser: getUser({ ...props,
|
|
206
|
+
...config
|
|
207
|
+
})
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export { avatarExample, itemSubmenuExample, SmallViewportModeWrapper, getCustomPopoverConfig, getCustomPopoverContent, getInPlaceDialogConfig, getBrand, getMenuItems, getActionItems, getUser, getLayoutProps };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var _g, _path, _path2, _path3;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The MIT License (MIT)
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
import React from 'react';
|
|
27
|
+
|
|
28
|
+
const getElevateLogo = fill => /*#__PURE__*/React.createElement("svg", {
|
|
29
|
+
id: "elevateLogo",
|
|
30
|
+
width: "90",
|
|
31
|
+
height: "36",
|
|
32
|
+
viewBox: "0 0 90 36",
|
|
33
|
+
fill: fill,
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
35
|
+
}, _g || (_g = /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
36
|
+
d: "M0.0861816 10.546V0.0927734H7.63835V2.44336H2.74183V4.0713H7.5314V6.42454H2.74183V8.20601H7.63835V10.5566L0.0861816 10.546Z"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M10.3696 10.546V0.0927734H13.0279V8.20601H17.1679V10.5566L10.3696 10.546Z"
|
|
39
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
40
|
+
d: "M19.761 10.546V0.0927734H27.3132V2.44336H22.4166V4.0713H27.2036V6.42454H22.4166V8.20601H27.3132V10.5566L19.761 10.546Z"
|
|
41
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
42
|
+
d: "M32.8697 10.546L28.9932 0.0927734H32.0062L34.5549 7.62895L37.0879 0.0927734H40.0984L36.2219 10.546H32.8697Z"
|
|
43
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
44
|
+
d: "M48.407 10.546L47.8853 9.03983H43.8262L43.3175 10.546H40.3123L44.1888 0.0927734H47.541L51.4175 10.546H48.407ZM45.874 2.75571L44.5697 6.68925H47.1783L45.874 2.75571Z"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
d: "M54.7514 10.546V2.44336H51.8635V0.0927734H60.2818V2.44336H57.4122V10.546H54.7514Z"
|
|
47
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
d: "M62.781 10.546V0.0927734H70.3462V2.44336H65.4393V4.0713H70.2262V6.42454H65.4393V8.20601H70.3358V10.5566L62.781 10.546Z"
|
|
49
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
50
|
+
d: "M0.404541 31.897V18.0767H5.77584C10.0437 18.0767 13.0045 20.8322 13.0045 24.9749C13.0045 29.1599 10.0437 31.897 5.79671 31.897H0.404541ZM10.0437 24.9749C10.0437 22.5502 8.57498 20.6655 5.79671 20.6655H3.30541V29.3055H5.77584C8.47063 29.3055 10.0437 27.3387 10.0437 24.9749Z"
|
|
51
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
52
|
+
d: "M20.7236 31.8971V30.8383C20.0479 31.6668 18.8845 32.1433 17.5932 32.1433C16.0279 32.1433 14.1836 31.0659 14.1836 28.8265C14.1836 26.4653 16.0097 25.5944 17.5932 25.5944C18.921 25.5944 20.0636 26.0286 20.7236 26.8174V25.5547C20.7236 24.5409 19.8653 23.8765 18.5584 23.8765C17.4979 23.8877 16.4821 24.3112 15.7201 25.0597L14.7001 23.2068C15.8913 22.1525 17.4268 21.5863 19.0071 21.6186C21.274 21.6186 23.3375 22.5291 23.3375 25.4091V31.8971H20.7236ZM20.7236 29.4936V28.2494C20.2932 27.6697 19.4766 27.3574 18.6366 27.3574C17.6166 27.3574 16.7792 27.9186 16.7792 28.8715C16.7792 29.8244 17.6166 30.3618 18.6366 30.3618C19.4766 30.3618 20.2932 30.0733 20.7236 29.4936Z"
|
|
53
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
54
|
+
d: "M26.2148 29.3825V24.189H24.5818V21.8887H26.2148V19.1543H28.8105V21.8887H30.8114V24.189H28.8105V28.689C28.8105 29.3322 29.1366 29.8087 29.7079 29.8087C30.0347 29.8233 30.355 29.7128 30.6053 29.499L31.1583 31.5081C30.7696 31.8602 30.0757 32.1514 28.9931 32.1514C27.1748 32.1461 26.2148 31.1931 26.2148 29.3825Z"
|
|
55
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
56
|
+
d: "M38.3036 31.8971V30.8382C37.6305 31.6668 36.4775 32.1432 35.1732 32.1432C33.6079 32.1432 31.761 31.0659 31.761 28.8265C31.761 26.4653 33.6001 25.5944 35.1732 25.5944C36.4984 25.5944 37.6436 26.0285 38.3036 26.8174V25.5547C38.3036 24.5409 37.4453 23.8765 36.1384 23.8765C35.078 23.8882 34.0624 24.3116 33.3001 25.0597L32.2801 23.2068C33.4725 22.1527 35.0086 21.5866 36.5897 21.6185C38.8566 21.6185 40.9175 22.5291 40.9175 25.4091V31.8971H38.3036ZM38.3036 29.4935V28.2494C37.8758 27.6697 37.0592 27.3574 36.2166 27.3574C35.194 27.3574 34.3566 27.9185 34.3566 28.8715C34.3566 29.8244 35.194 30.3618 36.2166 30.3618C37.0592 30.3618 37.8758 30.0732 38.3036 29.4935Z"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
58
|
+
d: "M47.022 29.9489L48.6159 27.6486C49.1742 28.244 49.846 28.718 50.5904 29.042C51.3348 29.366 52.1363 29.5331 52.9463 29.5333C54.5585 29.5333 55.315 28.808 55.315 28.0006C55.3046 25.5971 47.4785 27.2647 47.4785 22.0739C47.4785 19.7736 49.4376 17.8677 52.6437 17.8677C54.8089 17.8677 56.6063 18.5321 57.9524 19.7947L56.348 21.9918C55.2592 21.004 53.8459 20.4649 52.3854 20.4803C51.162 20.4803 50.4681 21.0097 50.4681 21.8462C50.4681 24.0221 58.2941 22.5503 58.2941 27.7121C58.2941 30.24 56.4967 32.1459 52.842 32.1459C50.1889 32.1459 48.3107 31.2539 47.022 29.9489Z"
|
|
59
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
60
|
+
d: "M59.7236 33.451C59.9833 33.5569 60.2603 33.6126 60.5402 33.6151C61.2158 33.6151 61.6645 33.4298 61.9097 32.8898L62.2775 32.0216L58.2732 21.8887H61.0436L63.6158 28.8504L66.2115 21.8887H68.9871L64.3515 33.5357C63.6158 35.4231 62.3088 35.9181 60.6158 35.9604C60.1882 35.9558 59.7626 35.8998 59.348 35.7937L59.7236 33.451Z"
|
|
61
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
62
|
+
d: "M76.6122 31.8972V25.846C76.6122 24.4589 75.8974 23.993 74.7861 23.993C74.3515 24.0019 73.9244 24.1103 73.5368 24.3101C73.1492 24.51 72.8112 24.7961 72.5479 25.1472V31.8972H69.9548V21.8886H72.5479V23.1725C72.9844 22.6849 73.5175 22.2964 74.1123 22.0323C74.707 21.7681 75.35 21.6344 75.9992 21.6398C78.1853 21.6398 79.2261 22.8839 79.2261 24.8163V31.8839L76.6122 31.8972Z"
|
|
63
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
64
|
+
d: "M80.9401 26.8809C80.9401 23.8156 83.1444 21.6397 86.1574 21.6397C88.1792 21.6397 89.4053 22.5318 90.0574 23.4424L88.3618 25.0597C88.1345 24.7133 87.823 24.4322 87.4575 24.2435C87.0919 24.0548 86.6846 23.9649 86.2748 23.9824C84.7096 23.9824 83.5983 25.1418 83.5983 26.8941C83.5983 28.6465 84.7018 29.8059 86.2748 29.8059C86.6855 29.8148 87.0919 29.7189 87.4565 29.527C87.8212 29.335 88.1325 29.0532 88.3618 28.7074L90.0574 30.3247C89.4053 31.2353 88.1792 32.1485 86.1574 32.1485C83.1444 32.1459 80.9401 29.97 80.9401 26.8809Z"
|
|
65
|
+
}))));
|
|
66
|
+
|
|
67
|
+
const getElevateIcon = fill => /*#__PURE__*/React.createElement("svg", {
|
|
68
|
+
id: "elevateIcon",
|
|
69
|
+
width: "40",
|
|
70
|
+
height: "40",
|
|
71
|
+
viewBox: "0 0 40 40",
|
|
72
|
+
fill: fill,
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
74
|
+
}, _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
75
|
+
d: "M17.2933 31.0827C15.1594 30.574 13.2178 29.4599 11.7019 27.8743C10.1859 26.2887 9.16013 24.2991 8.7478 22.1445C8.33547 19.9899 8.55415 17.7621 9.37754 15.7288C10.2009 13.6955 11.594 11.9433 13.3893 10.6827L13.0666 13.9707L14.4 14.0987L14.912 8.8L9.59997 8.26666L9.47198 9.6L12.232 9.86666C9.9706 11.5897 8.35089 14.0199 7.63086 16.7701C6.91083 19.5204 7.1319 22.4326 8.25887 25.0426C9.38584 27.6527 11.3539 29.8105 13.8494 31.1724C16.345 32.5343 19.2245 33.0218 22.0293 32.5573L21.8106 31.2427C20.3095 31.4942 18.7729 31.4398 17.2933 31.0827Z"
|
|
76
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
77
|
+
d: "M30.8027 13.3335C29.4769 11.1761 27.5381 9.46282 25.2339 8.41261C22.9297 7.36241 20.3648 7.02291 17.8667 7.43748L18.0854 8.75215C20.6006 8.33221 23.184 8.76789 25.4223 9.98951C27.6607 11.2111 29.4247 13.1481 30.4323 15.4907C31.4398 17.8332 31.6327 20.446 30.98 22.911C30.3273 25.3761 28.8668 27.5511 26.832 29.0882L27.0987 26.3362L25.7654 26.2081L25.3094 30.9015L30.0027 31.3575L30.1307 30.0241L28.0374 29.8215C30.4138 27.872 32.0034 25.1275 32.5118 22.096C33.0202 19.0646 32.4131 15.9516 30.8027 13.3335Z"
|
|
78
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
79
|
+
d: "M26.7973 21.0347C26.7966 20.4238 26.5537 19.8382 26.1217 19.4063C25.6898 18.9743 25.1042 18.7314 24.4933 18.7307H24.376C24.3739 17.6701 23.9768 16.6484 23.2623 15.8647C22.5478 15.081 21.567 14.5915 20.5112 14.4916C19.4554 14.3917 18.4002 14.6886 17.5514 15.3244C16.7026 15.9602 16.121 16.8893 15.92 17.9307H15.808C15.0909 17.9307 14.4031 18.2155 13.896 18.7226C13.3889 19.2297 13.104 19.9175 13.104 20.6347C13.104 21.3518 13.3889 22.0396 13.896 22.5467C14.4031 23.0538 15.0909 23.3387 15.808 23.3387H24.4933C25.1044 23.3387 25.6904 23.0959 26.1225 22.6638C26.5546 22.2317 26.7973 21.6457 26.7973 21.0347ZM24.4933 22.0053H15.808C15.4445 22.0053 15.0958 21.8609 14.8388 21.6039C14.5817 21.3468 14.4373 20.9982 14.4373 20.6347C14.4373 20.2711 14.5817 19.9225 14.8388 19.6654C15.0958 19.4084 15.4445 19.264 15.808 19.264H17.1227L17.1627 18.64C17.1878 17.8599 17.5217 17.1217 18.0911 16.5879C18.6605 16.054 19.4186 15.7682 20.1987 15.7933C20.9788 15.8184 21.7169 16.1524 22.2508 16.7218C22.7846 17.2911 23.0704 18.0492 23.0453 18.8293V19.0587C23.0453 19.152 23.0453 19.2453 23.0293 19.3253L22.9627 20.0533H24.4933C24.7508 20.0533 24.9977 20.1556 25.1797 20.3376C25.3617 20.5197 25.464 20.7666 25.464 21.024C25.464 21.2814 25.3617 21.5283 25.1797 21.7104C24.9977 21.8924 24.7508 21.9947 24.4933 21.9947V22.0053Z"
|
|
80
|
+
})));
|
|
81
|
+
|
|
82
|
+
const elevateLogo = getElevateLogo('white');
|
|
83
|
+
const elevateLogoInverse = getElevateLogo('black');
|
|
84
|
+
const elevateIcon = getElevateIcon('white');
|
|
85
|
+
const elevateIconInverse = getElevateIcon('black');
|
|
86
|
+
export { elevateLogo, elevateLogoInverse, elevateIcon, elevateIconInverse };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import React, { Children } from 'react';
|
|
25
|
+
import { warn } from '@instructure/console';
|
|
26
|
+
import { generateId } from '@instructure/ui-utils';
|
|
27
|
+
import { matchComponentTypes, generateInstanceCounterMap } from '@instructure/ui-react-utils';
|
|
28
|
+
import { Drilldown } from '@instructure/ui-drilldown';
|
|
29
|
+
import { TopNavBarItem } from '../TopNavBarItem';
|
|
30
|
+
|
|
31
|
+
const mapItemsForDrilldown = function (itemList) {
|
|
32
|
+
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
33
|
+
const submenus = [];
|
|
34
|
+
const currentPageId = options.currentPageId,
|
|
35
|
+
renderOptionContent = options.renderOptionContent;
|
|
36
|
+
const customPopoverIdMap = generateInstanceCounterMap();
|
|
37
|
+
Children.forEach(itemList, item => {
|
|
38
|
+
if (!item || !matchComponentTypes(item, [TopNavBarItem])) return;
|
|
39
|
+
const _item$props = item.props,
|
|
40
|
+
renderSubmenu = _item$props.renderSubmenu,
|
|
41
|
+
customPopoverConfig = _item$props.customPopoverConfig,
|
|
42
|
+
id = _item$props.id,
|
|
43
|
+
children = _item$props.children,
|
|
44
|
+
status = _item$props.status,
|
|
45
|
+
variant = _item$props.variant,
|
|
46
|
+
href = _item$props.href,
|
|
47
|
+
onClick = _item$props.onClick;
|
|
48
|
+
let submenu = renderSubmenu;
|
|
49
|
+
let customPopover = customPopoverConfig;
|
|
50
|
+
let customPopoverId;
|
|
51
|
+
let optionSubPageId;
|
|
52
|
+
const submenuPages = [];
|
|
53
|
+
|
|
54
|
+
if (submenu) {
|
|
55
|
+
if (!matchComponentTypes(submenu, [Drilldown])) {
|
|
56
|
+
warn(false, `The "renderSubmenu" prop accepts only Drilldown components, but the item with id "${id}" received: "${renderSubmenu}".`);
|
|
57
|
+
submenu = void 0;
|
|
58
|
+
} // if still has submenu...
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if (submenu) {
|
|
62
|
+
optionSubPageId = submenu.props.rootPageId;
|
|
63
|
+
submenuPages.push(...Children.toArray(submenu.props.children));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (customPopover) {
|
|
68
|
+
if (!customPopover.children) {
|
|
69
|
+
warn(false, `Pass the content of the custom Popover as "customPopoverConfig.children" for the item with id: "${id}".`);
|
|
70
|
+
customPopover = void 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (submenu) {
|
|
74
|
+
warn(false, `TopNavBar.Items are not allowed to have both the "renderSubmenu" and "customPopoverConfig" props. For submenus, pass a Drilldown component via the "renderSubmenu" prop, and only use "customPopoverConfig" for custom features. Item with id: "${id}" will ignore the "customPopoverConfig" prop.`);
|
|
75
|
+
customPopover = void 0;
|
|
76
|
+
} // if still has customPopover...
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if (customPopover) {
|
|
80
|
+
customPopoverId = generateId(`TopNavBarItem__customPopoverOption`, customPopoverIdMap);
|
|
81
|
+
optionSubPageId = customPopoverId;
|
|
82
|
+
submenuPages.push( /*#__PURE__*/React.createElement(Drilldown.Page, {
|
|
83
|
+
id: customPopoverId,
|
|
84
|
+
key: customPopoverId
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Drilldown.Option, {
|
|
86
|
+
id: `${customPopoverId}__option`
|
|
87
|
+
}, customPopover.children)));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let ariaCurrent = item.props['aria-current'] || (id === currentPageId ? 'page' : void 0);
|
|
92
|
+
|
|
93
|
+
if (ariaCurrent) {
|
|
94
|
+
if (variant !== 'default') {
|
|
95
|
+
warn(false, `Only \`variant="default"\` items can be set to current/active, but the item with id "${id}" is "${variant}" variant.`);
|
|
96
|
+
ariaCurrent = void 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (status === 'disabled') {
|
|
100
|
+
warn(false, `Disabled items can not be set to current/active, but the item with id "${id}" is disabled.`);
|
|
101
|
+
ariaCurrent = void 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
submenus.push({
|
|
106
|
+
item,
|
|
107
|
+
submenuPages,
|
|
108
|
+
optionData: {
|
|
109
|
+
id,
|
|
110
|
+
disabled: status === 'disabled',
|
|
111
|
+
href,
|
|
112
|
+
onOptionClick: event => {
|
|
113
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
114
|
+
},
|
|
115
|
+
children: typeof renderOptionContent === 'function' ? renderOptionContent(children, { ...item.props,
|
|
116
|
+
status: ariaCurrent === 'page' ? 'active' : item.props.status
|
|
117
|
+
}) : children,
|
|
118
|
+
subPageId: optionSubPageId,
|
|
119
|
+
'aria-current': ariaCurrent
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
return submenus;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const renderMappedItemDrilldownSubpages = mappedItems => {
|
|
127
|
+
const subPages = mappedItems.map(option => option.submenuPages).filter(submenu => !!submenu);
|
|
128
|
+
return subPages.flat();
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const renderMappedItemsAsDrilldownOptions = mappedItems => {
|
|
132
|
+
return mappedItems.map(mappedItem => {
|
|
133
|
+
const optionData = mappedItem.optionData;
|
|
134
|
+
return /*#__PURE__*/React.createElement(Drilldown.Option, Object.assign({}, optionData, {
|
|
135
|
+
key: optionData.id,
|
|
136
|
+
afterLabelContentVAlign: "center"
|
|
137
|
+
}), optionData.children);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default mapItemsForDrilldown;
|
|
142
|
+
export { mapItemsForDrilldown, renderMappedItemDrilldownSubpages, renderMappedItemsAsDrilldownOptions };
|
package/es/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export { TopNavBar } from './TopNavBar';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TopNavBarActionItemsLocator = void 0;
|
|
7
|
+
|
|
8
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
9
|
+
|
|
10
|
+
var _TruncateListLocator = require("@instructure/ui-truncate-list/lib/TruncateList/TruncateListLocator");
|
|
11
|
+
|
|
12
|
+
var _TopNavBarItemLocator = require("../TopNavBarItem/TopNavBarItemLocator");
|
|
13
|
+
|
|
14
|
+
var _index = require("./index");
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* The MIT License (MIT)
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
20
|
+
*
|
|
21
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
23
|
+
* in the Software without restriction, including without limitation the rights
|
|
24
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
26
|
+
* furnished to do so, subject to the following conditions:
|
|
27
|
+
*
|
|
28
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
29
|
+
* copies or substantial portions of the Software.
|
|
30
|
+
*
|
|
31
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
|
+
* SOFTWARE.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/* eslint-disable no-restricted-imports */
|
|
41
|
+
// @ts-expect-error bypass no type definition found error
|
|
42
|
+
|
|
43
|
+
/* eslint-enable no-restricted-imports */
|
|
44
|
+
const TopNavBarActionItemsLocator = (0, _locator.locator)( // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
45
|
+
_index.TopNavBarActionItems.selector, {
|
|
46
|
+
findAllActionItems: function () {
|
|
47
|
+
return _TopNavBarItemLocator.TopNavBarItemLocator.findAll(...arguments);
|
|
48
|
+
},
|
|
49
|
+
findTruncateList: function () {
|
|
50
|
+
return _TruncateListLocator.TruncateListLocator.find(...arguments);
|
|
51
|
+
},
|
|
52
|
+
findTruncateListTriggerItem: async function () {
|
|
53
|
+
const truncateList = await _TruncateListLocator.TruncateListLocator.find(...arguments);
|
|
54
|
+
if (!truncateList) return void 0;
|
|
55
|
+
const allItems = await _TopNavBarItemLocator.TopNavBarItemLocator.findAll(...arguments);
|
|
56
|
+
return allItems[allItems.length - 1];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
exports.TopNavBarActionItemsLocator = TopNavBarActionItemsLocator;
|