@instructure/ui-global-nav 0.0.0-stage → 11.7.10
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 +0 -0
- package/LICENSE.md +28 -0
- package/README.md +25 -2
- package/es/GlobalNav/v1/CollapseButton/index.js +80 -0
- package/es/GlobalNav/v1/CollapseButton/props.js +1 -0
- package/es/GlobalNav/v1/CollapseButton/styles.js +64 -0
- package/es/GlobalNav/v1/CollapsedSubNav/index.js +59 -0
- package/es/GlobalNav/v1/CollapsedSubNav/props.js +1 -0
- package/es/GlobalNav/v1/CollapsedSubNav/styles.js +82 -0
- package/es/GlobalNav/v1/InstitutionLogo/index.js +93 -0
- package/es/GlobalNav/v1/InstitutionLogo/props.js +1 -0
- package/es/GlobalNav/v1/InstitutionLogo/styles.js +69 -0
- package/es/GlobalNav/v1/MainNavItem/index.js +129 -0
- package/es/GlobalNav/v1/MainNavItem/props.js +1 -0
- package/es/GlobalNav/v1/MainNavItem/styles.js +117 -0
- package/es/GlobalNav/v1/SubNav/index.js +121 -0
- package/es/GlobalNav/v1/SubNav/props.js +1 -0
- package/es/GlobalNav/v1/SubNav/styles.js +52 -0
- package/es/GlobalNav/v1/SubNavItem/index.js +78 -0
- package/es/GlobalNav/v1/SubNavItem/props.js +1 -0
- package/es/GlobalNav/v1/SubNavItem/styles.js +94 -0
- package/es/GlobalNav/v1/SubNavLevel/index.js +160 -0
- package/es/GlobalNav/v1/SubNavLevel/props.js +1 -0
- package/es/GlobalNav/v1/SubNavLevel/styles.js +94 -0
- package/es/GlobalNav/v1/index.js +222 -0
- package/es/GlobalNav/v1/props.js +28 -0
- package/es/GlobalNav/v1/styles.js +110 -0
- package/es/GlobalNav/v1/utils/getItemElementProps.js +64 -0
- package/es/exports/a.js +24 -0
- package/lib/GlobalNav/v1/CollapseButton/index.js +85 -0
- package/lib/GlobalNav/v1/CollapseButton/props.js +5 -0
- package/lib/GlobalNav/v1/CollapseButton/styles.js +70 -0
- package/lib/GlobalNav/v1/CollapsedSubNav/index.js +64 -0
- package/lib/GlobalNav/v1/CollapsedSubNav/props.js +5 -0
- package/lib/GlobalNav/v1/CollapsedSubNav/styles.js +88 -0
- package/lib/GlobalNav/v1/InstitutionLogo/index.js +98 -0
- package/lib/GlobalNav/v1/InstitutionLogo/props.js +5 -0
- package/lib/GlobalNav/v1/InstitutionLogo/styles.js +75 -0
- package/lib/GlobalNav/v1/MainNavItem/index.js +134 -0
- package/lib/GlobalNav/v1/MainNavItem/props.js +5 -0
- package/lib/GlobalNav/v1/MainNavItem/styles.js +123 -0
- package/lib/GlobalNav/v1/SubNav/index.js +128 -0
- package/lib/GlobalNav/v1/SubNav/props.js +5 -0
- package/lib/GlobalNav/v1/SubNav/styles.js +58 -0
- package/lib/GlobalNav/v1/SubNavItem/index.js +83 -0
- package/lib/GlobalNav/v1/SubNavItem/props.js +5 -0
- package/lib/GlobalNav/v1/SubNavItem/styles.js +100 -0
- package/lib/GlobalNav/v1/SubNavLevel/index.js +165 -0
- package/lib/GlobalNav/v1/SubNavLevel/props.js +5 -0
- package/lib/GlobalNav/v1/SubNavLevel/styles.js +100 -0
- package/lib/GlobalNav/v1/index.js +228 -0
- package/lib/GlobalNav/v1/props.js +33 -0
- package/lib/GlobalNav/v1/styles.js +116 -0
- package/lib/GlobalNav/v1/utils/getItemElementProps.js +70 -0
- package/lib/exports/a.js +12 -0
- package/lib/package.json +1 -0
- package/package.json +77 -3
- package/src/GlobalNav/v1/CollapseButton/index.tsx +87 -0
- package/src/GlobalNav/v1/CollapseButton/props.ts +64 -0
- package/src/GlobalNav/v1/CollapseButton/styles.ts +76 -0
- package/src/GlobalNav/v1/CollapsedSubNav/index.tsx +60 -0
- package/src/GlobalNav/v1/CollapsedSubNav/props.ts +42 -0
- package/src/GlobalNav/v1/CollapsedSubNav/styles.ts +92 -0
- package/src/GlobalNav/v1/InstitutionLogo/index.tsx +86 -0
- package/src/GlobalNav/v1/InstitutionLogo/props.ts +42 -0
- package/src/GlobalNav/v1/InstitutionLogo/styles.ts +82 -0
- package/src/GlobalNav/v1/MainNavItem/index.tsx +132 -0
- package/src/GlobalNav/v1/MainNavItem/props.ts +65 -0
- package/src/GlobalNav/v1/MainNavItem/styles.ts +137 -0
- package/src/GlobalNav/v1/README.md +234 -0
- package/src/GlobalNav/v1/SubNav/index.tsx +132 -0
- package/src/GlobalNav/v1/SubNav/props.ts +81 -0
- package/src/GlobalNav/v1/SubNav/styles.ts +58 -0
- package/src/GlobalNav/v1/SubNavItem/index.tsx +79 -0
- package/src/GlobalNav/v1/SubNavItem/props.ts +48 -0
- package/src/GlobalNav/v1/SubNavItem/styles.ts +110 -0
- package/src/GlobalNav/v1/SubNavLevel/index.tsx +193 -0
- package/src/GlobalNav/v1/SubNavLevel/props.ts +75 -0
- package/src/GlobalNav/v1/SubNavLevel/styles.ts +103 -0
- package/src/GlobalNav/v1/index.tsx +256 -0
- package/src/GlobalNav/v1/props.ts +328 -0
- package/src/GlobalNav/v1/styles.ts +132 -0
- package/src/GlobalNav/v1/utils/getItemElementProps.ts +80 -0
- package/src/exports/a.ts +35 -0
- package/tsconfig.build.json +53 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +4 -0
- package/types/GlobalNav/v1/CollapseButton/index.d.ts +11 -0
- package/types/GlobalNav/v1/CollapseButton/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/CollapseButton/props.d.ts +31 -0
- package/types/GlobalNav/v1/CollapseButton/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/CollapseButton/styles.d.ts +22 -0
- package/types/GlobalNav/v1/CollapseButton/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/CollapsedSubNav/index.d.ts +11 -0
- package/types/GlobalNav/v1/CollapsedSubNav/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/CollapsedSubNav/props.d.ts +15 -0
- package/types/GlobalNav/v1/CollapsedSubNav/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/CollapsedSubNav/styles.d.ts +14 -0
- package/types/GlobalNav/v1/CollapsedSubNav/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/InstitutionLogo/index.d.ts +11 -0
- package/types/GlobalNav/v1/InstitutionLogo/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/InstitutionLogo/props.d.ts +15 -0
- package/types/GlobalNav/v1/InstitutionLogo/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/InstitutionLogo/styles.d.ts +20 -0
- package/types/GlobalNav/v1/InstitutionLogo/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/MainNavItem/index.d.ts +11 -0
- package/types/GlobalNav/v1/MainNavItem/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/MainNavItem/props.d.ts +32 -0
- package/types/GlobalNav/v1/MainNavItem/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/MainNavItem/styles.d.ts +19 -0
- package/types/GlobalNav/v1/MainNavItem/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNav/index.d.ts +11 -0
- package/types/GlobalNav/v1/SubNav/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNav/props.d.ts +52 -0
- package/types/GlobalNav/v1/SubNav/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNav/styles.d.ts +13 -0
- package/types/GlobalNav/v1/SubNav/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavItem/index.d.ts +11 -0
- package/types/GlobalNav/v1/SubNavItem/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavItem/props.d.ts +20 -0
- package/types/GlobalNav/v1/SubNavItem/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavItem/styles.d.ts +18 -0
- package/types/GlobalNav/v1/SubNavItem/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavLevel/index.d.ts +11 -0
- package/types/GlobalNav/v1/SubNavLevel/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavLevel/props.d.ts +45 -0
- package/types/GlobalNav/v1/SubNavLevel/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/SubNavLevel/styles.d.ts +14 -0
- package/types/GlobalNav/v1/SubNavLevel/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/index.d.ts +59 -0
- package/types/GlobalNav/v1/index.d.ts.map +1 -0
- package/types/GlobalNav/v1/props.d.ts +247 -0
- package/types/GlobalNav/v1/props.d.ts.map +1 -0
- package/types/GlobalNav/v1/styles.d.ts +23 -0
- package/types/GlobalNav/v1/styles.d.ts.map +1 -0
- package/types/GlobalNav/v1/utils/getItemElementProps.d.ts +37 -0
- package/types/GlobalNav/v1/utils/getItemElementProps.d.ts.map +1 -0
- package/types/exports/a.d.ts +3 -0
- package/types/exports/a.d.ts.map +1 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateIconStyle = exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ---
|
|
33
|
+
* private: true
|
|
34
|
+
* ---
|
|
35
|
+
* Generates the style object from the theme and provided additional information
|
|
36
|
+
* @param componentTheme The theme variable object.
|
|
37
|
+
* @param params Additional parameters to customize the style.
|
|
38
|
+
* @return The final style object, which will be used in the component
|
|
39
|
+
*/
|
|
40
|
+
const generateStyle = (componentTheme, params) => {
|
|
41
|
+
const {
|
|
42
|
+
collapsed
|
|
43
|
+
} = params;
|
|
44
|
+
return {
|
|
45
|
+
collapseButton: {
|
|
46
|
+
label: 'collapseButton',
|
|
47
|
+
// the collapsed rail centers the button
|
|
48
|
+
marginInlineEnd: collapsed ? 0 : componentTheme.rightMargin
|
|
49
|
+
},
|
|
50
|
+
iconButtonThemeOverride: {
|
|
51
|
+
secondaryGhostHoverBackground: componentTheme.hoverBackgroundColor,
|
|
52
|
+
secondaryGhostActiveBackground: componentTheme.activeBackgroundColor
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Generates the icon color from the `MainNavItem` tokens
|
|
59
|
+
*/
|
|
60
|
+
const generateIconStyle = componentTheme => {
|
|
61
|
+
return {
|
|
62
|
+
// the default IconButton icon is unreadable on the dark legacy rail, and the
|
|
63
|
+
// CollapseButton tokens have no icon color
|
|
64
|
+
iconButtonThemeOverride: {
|
|
65
|
+
secondaryGhostColor: componentTheme.fontColor
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
exports.generateIconStyle = generateIconStyle;
|
|
70
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.CollapsedSubNav = void 0;
|
|
8
|
+
var _emotion = require("@instructure/emotion");
|
|
9
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
10
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
11
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
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
|
+
|
|
36
|
+
/**
|
|
37
|
+
---
|
|
38
|
+
private: true
|
|
39
|
+
id: GlobalNav.CollapsedSubNav
|
|
40
|
+
---
|
|
41
|
+
**/const CollapsedSubNav = props => {
|
|
42
|
+
const {
|
|
43
|
+
label,
|
|
44
|
+
onExpand
|
|
45
|
+
} = props;
|
|
46
|
+
const styles = (0, _emotion.useStyleNew)({
|
|
47
|
+
generateStyle: _styles.default,
|
|
48
|
+
componentId: 'SubNav'
|
|
49
|
+
});
|
|
50
|
+
return (0, _jsxRuntime.jsx)("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-label": label,
|
|
53
|
+
css: styles?.collapsedSubNav,
|
|
54
|
+
onClick: onExpand,
|
|
55
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
56
|
+
css: styles?.icon,
|
|
57
|
+
children: (0, _jsxRuntime.jsx)(_uiIcons.PanelLeftOpenInstUIIcon, {
|
|
58
|
+
size: "sm"
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
exports.CollapsedSubNav = CollapsedSubNav;
|
|
64
|
+
var _default = exports.default = CollapsedSubNav;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _emotion = require("@instructure/emotion");
|
|
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 componentTheme The theme variable object.
|
|
38
|
+
* @param sharedTokens Shared token object that stores common values for the theme.
|
|
39
|
+
* @return The final style object, which will be used in the component
|
|
40
|
+
*/
|
|
41
|
+
const generateStyle = (componentTheme, _params, sharedTokens) => {
|
|
42
|
+
// SubNav has no border width token
|
|
43
|
+
const borderWidth = '0.0625rem';
|
|
44
|
+
return {
|
|
45
|
+
collapsedSubNav: {
|
|
46
|
+
label: 'collapsedSubNav',
|
|
47
|
+
width: componentTheme.minimizedWidth,
|
|
48
|
+
flexShrink: 0,
|
|
49
|
+
boxSizing: 'border-box',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
// the strip widens on hover, and the icon moves out with its outer edge
|
|
53
|
+
alignItems: 'flex-end',
|
|
54
|
+
margin: 0,
|
|
55
|
+
padding: 0,
|
|
56
|
+
paddingTop: `var(--globalNav-collapseButtonTop, ${componentTheme.minimizedVerticalPadding})`,
|
|
57
|
+
border: 'none',
|
|
58
|
+
borderInlineStart: `${borderWidth} solid ${componentTheme.borderColor}`,
|
|
59
|
+
// the strip is the end of the rail card, so it takes the card's end corners
|
|
60
|
+
borderStartEndRadius: 'inherit',
|
|
61
|
+
borderEndEndRadius: 'inherit',
|
|
62
|
+
backgroundColor: componentTheme.backgroundColor,
|
|
63
|
+
color: componentTheme.textColor,
|
|
64
|
+
cursor: 'pointer',
|
|
65
|
+
...(0, _emotion.calcFocusOutlineStyles)({
|
|
66
|
+
...sharedTokens.focusOutline,
|
|
67
|
+
// an outside ring would cover the main nav divider and the card border
|
|
68
|
+
inset: `calc(-1 * ${sharedTokens.focusOutline.width})`
|
|
69
|
+
}, {
|
|
70
|
+
focusPosition: 'inset'
|
|
71
|
+
}),
|
|
72
|
+
'&:hover': {
|
|
73
|
+
width: componentTheme.minimizedHoverWidth
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
icon: {
|
|
77
|
+
label: 'collapsedSubNav__icon',
|
|
78
|
+
display: 'flex',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
// the width of the strip at rest, so the icon is centered until the strip widens
|
|
82
|
+
width: `calc(${componentTheme.minimizedWidth} - ${borderWidth})`,
|
|
83
|
+
// the height of the rail's collapse button, so both icons share a center line
|
|
84
|
+
height: 'var(--globalNav-collapseButtonHeight)'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.InstitutionLogo = void 0;
|
|
8
|
+
var _emotion = require("@instructure/emotion");
|
|
9
|
+
var _latest = require("@instructure/ui-text/latest");
|
|
10
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
11
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
12
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
|
+
/*
|
|
14
|
+
* The MIT License (MIT)
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
17
|
+
*
|
|
18
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
20
|
+
* in the Software without restriction, including without limitation the rights
|
|
21
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
22
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
23
|
+
* furnished to do so, subject to the following conditions:
|
|
24
|
+
*
|
|
25
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
26
|
+
* copies or substantial portions of the Software.
|
|
27
|
+
*
|
|
28
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
* SOFTWARE.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
---
|
|
39
|
+
private: true
|
|
40
|
+
id: GlobalNav.InstitutionLogo
|
|
41
|
+
---
|
|
42
|
+
**/const InstitutionLogo = props => {
|
|
43
|
+
const {
|
|
44
|
+
logo,
|
|
45
|
+
collapsed
|
|
46
|
+
} = props;
|
|
47
|
+
const isLink = !!logo.href;
|
|
48
|
+
const {
|
|
49
|
+
showName: showNameProp = true
|
|
50
|
+
} = logo;
|
|
51
|
+
const showName = !collapsed && showNameProp;
|
|
52
|
+
const styles = (0, _emotion.useStyleNew)({
|
|
53
|
+
generateStyle: _styles.default,
|
|
54
|
+
params: {
|
|
55
|
+
collapsed,
|
|
56
|
+
isLink,
|
|
57
|
+
wordmark: !showNameProp
|
|
58
|
+
},
|
|
59
|
+
componentId: 'MainNavInstitutionLogo'
|
|
60
|
+
});
|
|
61
|
+
if (!logo.src && !showName) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const content = (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
65
|
+
children: [logo.src && (0, _jsxRuntime.jsx)("img", {
|
|
66
|
+
css: styles?.mark,
|
|
67
|
+
src: logo.src
|
|
68
|
+
// the visible name labels the logo when it shows
|
|
69
|
+
,
|
|
70
|
+
alt: showName ? '' : logo.name
|
|
71
|
+
}), showName && (0, _jsxRuntime.jsx)(_latest.Text, {
|
|
72
|
+
color: "inherit",
|
|
73
|
+
weight: "bold",
|
|
74
|
+
children: logo.name
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
if (isLink) {
|
|
78
|
+
// drops unsafe hrefs, for example javascript: URLs that would run code on click
|
|
79
|
+
const {
|
|
80
|
+
href
|
|
81
|
+
} = (0, _uiUtils.safeLinkProps)({
|
|
82
|
+
href: logo.href,
|
|
83
|
+
tag: 'a',
|
|
84
|
+
attr: 'href'
|
|
85
|
+
});
|
|
86
|
+
return (0, _jsxRuntime.jsx)("a", {
|
|
87
|
+
css: styles?.logo,
|
|
88
|
+
href: href,
|
|
89
|
+
children: content
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
93
|
+
css: styles?.logo,
|
|
94
|
+
children: content
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.InstitutionLogo = InstitutionLogo;
|
|
98
|
+
var _default = exports.default = InstitutionLogo;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _emotion = require("@instructure/emotion");
|
|
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 componentTheme The theme variable object.
|
|
38
|
+
* @param params Additional parameters to customize the style.
|
|
39
|
+
* @param sharedTokens Shared token object that stores common values for the theme.
|
|
40
|
+
* @return The final style object, which will be used in the component
|
|
41
|
+
*/
|
|
42
|
+
const generateStyle = (componentTheme, params, sharedTokens) => {
|
|
43
|
+
const {
|
|
44
|
+
collapsed,
|
|
45
|
+
isLink,
|
|
46
|
+
wordmark
|
|
47
|
+
} = params;
|
|
48
|
+
return {
|
|
49
|
+
logo: {
|
|
50
|
+
label: 'institutionLogo',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
gap: componentTheme.gap,
|
|
54
|
+
padding: collapsed ? 0 : componentTheme.padding,
|
|
55
|
+
flex: collapsed ? undefined : 1,
|
|
56
|
+
...(collapsed && {
|
|
57
|
+
width: componentTheme.minimizedWidth,
|
|
58
|
+
height: componentTheme.minimizedHeight,
|
|
59
|
+
justifyContent: 'center'
|
|
60
|
+
}),
|
|
61
|
+
color: componentTheme.textColor,
|
|
62
|
+
textDecoration: 'none',
|
|
63
|
+
...(isLink && (0, _emotion.calcFocusOutlineStyles)(sharedTokens.focusOutline))
|
|
64
|
+
},
|
|
65
|
+
mark: {
|
|
66
|
+
label: 'institutionLogo__mark',
|
|
67
|
+
// the mark has the collapsed logo size in both rail states
|
|
68
|
+
width: wordmark ? 'auto' : componentTheme.minimizedWidth,
|
|
69
|
+
height: wordmark ? componentTheme.wordmarkHeight : componentTheme.minimizedHeight,
|
|
70
|
+
objectFit: 'contain',
|
|
71
|
+
flexShrink: 0
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.MainNavItem = void 0;
|
|
8
|
+
var _emotion = require("@instructure/emotion");
|
|
9
|
+
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
10
|
+
var _latest = require("@instructure/ui-badge/latest");
|
|
11
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
12
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
13
|
+
var _latest2 = require("@instructure/ui-tooltip/latest");
|
|
14
|
+
var _getItemElementProps = require("../utils/getItemElementProps.js");
|
|
15
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
16
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
+
/*
|
|
18
|
+
* The MIT License (MIT)
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
21
|
+
*
|
|
22
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
24
|
+
* in the Software without restriction, including without limitation the rights
|
|
25
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
27
|
+
* furnished to do so, subject to the following conditions:
|
|
28
|
+
*
|
|
29
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
30
|
+
* copies or substantial portions of the Software.
|
|
31
|
+
*
|
|
32
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
+
* SOFTWARE.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
---
|
|
43
|
+
private: true
|
|
44
|
+
id: GlobalNav.MainNavItem
|
|
45
|
+
---
|
|
46
|
+
**/const MainNavItem = props => {
|
|
47
|
+
const {
|
|
48
|
+
item,
|
|
49
|
+
collapsed,
|
|
50
|
+
open,
|
|
51
|
+
subNavId,
|
|
52
|
+
onActivate,
|
|
53
|
+
elementRef
|
|
54
|
+
} = props;
|
|
55
|
+
const current = !!item.current;
|
|
56
|
+
const styles = (0, _emotion.useStyleNew)({
|
|
57
|
+
generateStyle: _styles.default,
|
|
58
|
+
params: {
|
|
59
|
+
collapsed,
|
|
60
|
+
current,
|
|
61
|
+
open
|
|
62
|
+
},
|
|
63
|
+
componentId: 'MainNavItem'
|
|
64
|
+
});
|
|
65
|
+
const label = item.label;
|
|
66
|
+
const badgeCount = item.badgeCount ?? 0;
|
|
67
|
+
const badgeLabel = typeof item.badgeLabel === 'function' ? item.badgeLabel(badgeCount) : item.badgeLabel;
|
|
68
|
+
const formatBadge = formattedCount => badgeLabel ? (0, _jsxRuntime.jsx)(_uiA11yContent.AccessibleContent, {
|
|
69
|
+
alt: badgeLabel,
|
|
70
|
+
children: formattedCount
|
|
71
|
+
}) : formattedCount;
|
|
72
|
+
const badge = badgeCount > 0 && (0, _jsxRuntime.jsx)(_latest.Badge, {
|
|
73
|
+
standalone: true,
|
|
74
|
+
count: badgeCount,
|
|
75
|
+
formatOutput: formatBadge
|
|
76
|
+
});
|
|
77
|
+
const content = collapsed ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
78
|
+
children: [(0, _jsxRuntime.jsx)(_uiA11yContent.ScreenReaderContent, {
|
|
79
|
+
children: label
|
|
80
|
+
}), (0, _jsxRuntime.jsxs)("span", {
|
|
81
|
+
css: styles?.icon,
|
|
82
|
+
children: [(0, _uiReactUtils.callRenderProp)(item.icon), badge && (0, _jsxRuntime.jsx)("span", {
|
|
83
|
+
css: styles?.badge,
|
|
84
|
+
children: badge
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
}) : (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
88
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
89
|
+
css: styles?.icon,
|
|
90
|
+
children: (0, _uiReactUtils.callRenderProp)(item.icon)
|
|
91
|
+
}), (0, _jsxRuntime.jsx)("span", {
|
|
92
|
+
css: styles?.label,
|
|
93
|
+
children: label
|
|
94
|
+
}), badge, item.subNav && (0, _jsxRuntime.jsx)("span", {
|
|
95
|
+
css: styles?.chevron,
|
|
96
|
+
children: (0, _jsxRuntime.jsx)(_uiIcons.ChevronRightInstUIIcon, {})
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
const {
|
|
100
|
+
isLink,
|
|
101
|
+
props: mergedProps
|
|
102
|
+
} = (0, _getItemElementProps.getItemElementProps)(item, event => onActivate(event, item), item.subNav ? {
|
|
103
|
+
'aria-expanded': open,
|
|
104
|
+
'aria-controls': subNavId
|
|
105
|
+
} : undefined);
|
|
106
|
+
let element;
|
|
107
|
+
if (isLink) {
|
|
108
|
+
element = (0, _jsxRuntime.jsx)("a", {
|
|
109
|
+
...mergedProps,
|
|
110
|
+
ref: elementRef,
|
|
111
|
+
css: styles?.item,
|
|
112
|
+
children: content
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
element = (0, _jsxRuntime.jsx)("button", {
|
|
116
|
+
...mergedProps,
|
|
117
|
+
ref: elementRef,
|
|
118
|
+
css: styles?.item,
|
|
119
|
+
children: content
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return (0, _jsxRuntime.jsx)("li", {
|
|
123
|
+
children: collapsed ? (0, _jsxRuntime.jsx)(_latest2.Tooltip, {
|
|
124
|
+
renderTip: label,
|
|
125
|
+
placement: "end",
|
|
126
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
127
|
+
css: styles?.tooltipTrigger,
|
|
128
|
+
children: element
|
|
129
|
+
})
|
|
130
|
+
}) : element
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
exports.MainNavItem = MainNavItem;
|
|
134
|
+
var _default = exports.default = MainNavItem;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ---
|
|
33
|
+
* private: true
|
|
34
|
+
* ---
|
|
35
|
+
* Generates the style object from the theme and provided additional information
|
|
36
|
+
* @param componentTheme The theme variable object.
|
|
37
|
+
* @param params Additional parameters to customize the style.
|
|
38
|
+
* @return The final style object, which will be used in the component
|
|
39
|
+
*/
|
|
40
|
+
const generateStyle = (componentTheme, params) => {
|
|
41
|
+
const {
|
|
42
|
+
collapsed,
|
|
43
|
+
current,
|
|
44
|
+
open
|
|
45
|
+
} = params;
|
|
46
|
+
return {
|
|
47
|
+
item: {
|
|
48
|
+
label: 'mainNavItem',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
// MainNavItem has no gap token
|
|
52
|
+
gap: componentTheme.horizontalPadding,
|
|
53
|
+
boxSizing: 'border-box',
|
|
54
|
+
width: collapsed ? componentTheme.minimizedItemSize : '100%',
|
|
55
|
+
height: collapsed ? componentTheme.minimizedItemSize : undefined,
|
|
56
|
+
justifyContent: collapsed ? 'center' : undefined,
|
|
57
|
+
margin: 0,
|
|
58
|
+
padding: collapsed ? 0 : `${componentTheme.verticalPadding} ${componentTheme.horizontalPadding}`,
|
|
59
|
+
border: 'none',
|
|
60
|
+
borderRadius: componentTheme.borderRadius,
|
|
61
|
+
backgroundColor: current ? componentTheme.currentBackgroundColor : open ? componentTheme.activeBackgroundColor : componentTheme.backgroundColor,
|
|
62
|
+
color: current ? componentTheme.currentTextColor : componentTheme.fontColor,
|
|
63
|
+
fontFamily: componentTheme.fontFamily,
|
|
64
|
+
fontSize: componentTheme.fontSize,
|
|
65
|
+
fontWeight: componentTheme.fontWeight,
|
|
66
|
+
lineHeight: componentTheme.lineHeight,
|
|
67
|
+
textAlign: 'start',
|
|
68
|
+
textDecoration: componentTheme.linkTextDecoration,
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
'&:hover': {
|
|
71
|
+
// a page-wide a:hover rule is more specific than the base class
|
|
72
|
+
textDecoration: componentTheme.linkTextDecoration,
|
|
73
|
+
...(!current && !open && {
|
|
74
|
+
backgroundColor: componentTheme.hoverBackgroundColor
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
...(!current && !open && {
|
|
78
|
+
'&:active': {
|
|
79
|
+
backgroundColor: componentTheme.activeBackgroundColor
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
// the other GlobalNav focus rings animate with calcFocusOutlineStyles,
|
|
83
|
+
// which can't take these tokens, because each theme colors a different ring
|
|
84
|
+
transition: 'box-shadow 0.2s',
|
|
85
|
+
// same focus ring as SideNavBarItem, which has the same focus tokens
|
|
86
|
+
'&:focus': {
|
|
87
|
+
outline: 'none',
|
|
88
|
+
boxShadow: current ? `inset 0 0 0 0.125rem ${componentTheme.selectedOuterFocusOutlineColor}, inset 0 0 0 0.25rem ${componentTheme.selectedInnerFocusOutlineColor}` : `inset 0 0 0 0.125rem ${componentTheme.outerFocusOutlineColor}, inset 0 0 0 0.25rem ${componentTheme.innerFocusOutlineColor}`
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
icon: {
|
|
92
|
+
label: 'mainNavItem__icon',
|
|
93
|
+
position: 'relative',
|
|
94
|
+
display: 'flex',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
flexShrink: 0,
|
|
97
|
+
height: componentTheme.iconWrapperHeight
|
|
98
|
+
},
|
|
99
|
+
badge: {
|
|
100
|
+
label: 'mainNavItem__badge',
|
|
101
|
+
position: 'absolute',
|
|
102
|
+
top: 0,
|
|
103
|
+
// the badge starts at the icon's center, so a longer count grows away from the icon
|
|
104
|
+
insetInlineStart: '50%',
|
|
105
|
+
// flex, so the item's line height doesn't push the badge down
|
|
106
|
+
display: 'flex'
|
|
107
|
+
},
|
|
108
|
+
label: {
|
|
109
|
+
label: 'mainNavItem__label',
|
|
110
|
+
flex: 1
|
|
111
|
+
},
|
|
112
|
+
chevron: {
|
|
113
|
+
label: 'mainNavItem__chevron',
|
|
114
|
+
display: 'flex',
|
|
115
|
+
flexShrink: 0
|
|
116
|
+
},
|
|
117
|
+
tooltipTrigger: {
|
|
118
|
+
label: 'mainNavItem__tooltipTrigger',
|
|
119
|
+
display: 'block'
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
var _default = exports.default = generateStyle;
|