@instructure/ui-navigation 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-navigation
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-navigation
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['screenReaderLabel', 'children', 'debounce', 'renderBeforeItems', 'renderAfterItems', 'margin', 'elementRef', 'renderTruncateLabel', 'onUpdate', 'visibleItemsCount'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-navigation",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "Main and application level navigational components",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,33 +15,33 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/console": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/shared-types": "11.6.0",
21
- "@instructure/debounce": "11.6.0",
22
- "@instructure/ui-a11y-content": "11.6.0",
23
- "@instructure/ui-badge": "11.6.0",
24
- "@instructure/ui-a11y-utils": "11.6.0",
25
- "@instructure/ui-dom-utils": "11.6.0",
26
- "@instructure/ui-focusable": "11.6.0",
27
- "@instructure/ui-menu": "11.6.0",
28
- "@instructure/ui-icons": "11.6.0",
29
- "@instructure/ui-react-utils": "11.6.0",
30
- "@instructure/ui-tooltip": "11.6.0",
31
- "@instructure/ui-truncate-list": "11.6.0",
32
- "@instructure/ui-utils": "11.6.0",
33
- "@instructure/ui-view": "11.6.0"
18
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/emotion": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/debounce": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
22
+ "@instructure/ui-a11y-content": "11.6.1-pr-snapshot-1779894247159",
23
+ "@instructure/ui-a11y-utils": "11.6.1-pr-snapshot-1779894247159",
24
+ "@instructure/ui-badge": "11.6.1-pr-snapshot-1779894247159",
25
+ "@instructure/ui-dom-utils": "11.6.1-pr-snapshot-1779894247159",
26
+ "@instructure/ui-focusable": "11.6.1-pr-snapshot-1779894247159",
27
+ "@instructure/ui-icons": "11.6.1-pr-snapshot-1779894247159",
28
+ "@instructure/ui-menu": "11.6.1-pr-snapshot-1779894247159",
29
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
30
+ "@instructure/ui-tooltip": "11.6.1-pr-snapshot-1779894247159",
31
+ "@instructure/ui-utils": "11.6.1-pr-snapshot-1779894247159",
32
+ "@instructure/ui-truncate-list": "11.6.1-pr-snapshot-1779894247159",
33
+ "@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@testing-library/jest-dom": "^6.6.3",
37
37
  "@testing-library/react": "15.0.7",
38
38
  "@testing-library/user-event": "^14.6.1",
39
39
  "vitest": "^3.2.2",
40
- "@instructure/ui-axe-check": "11.6.0",
41
- "@instructure/ui-babel-preset": "11.6.0",
42
- "@instructure/ui-scripts": "11.6.0",
43
- "@instructure/ui-themes": "11.6.0",
44
- "@instructure/ui-color-utils": "11.6.0"
40
+ "@instructure/ui-axe-check": "11.6.1-pr-snapshot-1779894247159",
41
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
42
+ "@instructure/ui-scripts": "11.6.1-pr-snapshot-1779894247159",
43
+ "@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159",
44
+ "@instructure/ui-color-utils": "11.6.1-pr-snapshot-1779894247159"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=18 <=19"
@@ -54,10 +54,8 @@
54
54
  ".": {
55
55
  "types": "./types/index.d.ts",
56
56
  "import": "./es/index.js",
57
- "require": "./lib/index.js",
58
57
  "default": "./es/index.js"
59
58
  },
60
- "./lib/*": "./lib/*",
61
59
  "./es/*": "./es/*",
62
60
  "./types/*": "./types/*",
63
61
  "./package.json": "./package.json",
@@ -67,7 +65,7 @@
67
65
  "lint": "ui-scripts lint",
68
66
  "lint:fix": "ui-scripts lint --fix",
69
67
  "clean": "ui-scripts clean",
70
- "build": "ui-scripts build --modules es,cjs",
68
+ "build": "ui-scripts build",
71
69
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
72
70
  "build:types": "tsc -p tsconfig.build.json",
73
71
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,124 +0,0 @@
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.Item = void 0;
8
- var _react = require("react");
9
- var _console = require("@instructure/console");
10
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
11
- var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
12
- var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
13
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
14
- var _View = require("@instructure/ui-view/lib/View");
15
- var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
16
- var _emotion = require("@instructure/emotion");
17
- var _styles = _interopRequireDefault(require("./styles"));
18
- var _theme = _interopRequireDefault(require("./theme"));
19
- var _props = require("./props");
20
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
21
- var _dec, _class, _Item;
22
- /*
23
- * The MIT License (MIT)
24
- *
25
- * Copyright (c) 2015 - present Instructure, Inc.
26
- *
27
- * Permission is hereby granted, free of charge, to any person obtaining a copy
28
- * of this software and associated documentation files (the "Software"), to deal
29
- * in the Software without restriction, including without limitation the rights
30
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
- * copies of the Software, and to permit persons to whom the Software is
32
- * furnished to do so, subject to the following conditions:
33
- *
34
- * The above copyright notice and this permission notice shall be included in all
35
- * copies or substantial portions of the Software.
36
- *
37
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
- * SOFTWARE.
44
- */
45
- /**
46
- ---
47
- parent: AppNav
48
- id: AppNav.Item
49
- ---
50
- @module Item
51
- **/
52
- let Item = exports.Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Item = class Item extends _react.Component {
53
- constructor(...args) {
54
- super(...args);
55
- this.ref = null;
56
- this.handleRef = el => {
57
- const elementRef = this.props.elementRef;
58
- this.ref = el;
59
- if (typeof elementRef === 'function') {
60
- elementRef(el);
61
- }
62
- };
63
- this.handleClick = e => {
64
- const _this$props = this.props,
65
- isDisabled = _this$props.isDisabled,
66
- onClick = _this$props.onClick;
67
- if (isDisabled) {
68
- e.preventDefault();
69
- e.stopPropagation();
70
- } else if (typeof onClick === 'function') {
71
- onClick(e);
72
- }
73
- };
74
- }
75
- componentDidMount() {
76
- var _this$props$makeStyle, _this$props2;
77
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
78
- }
79
- componentDidUpdate() {
80
- var _this$props$makeStyle2, _this$props3;
81
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
82
- }
83
- render() {
84
- var _this$props$styles, _this$props$styles2;
85
- const ElementType = (0, _getElementType.getElementType)(Item, this.props);
86
- const _this$props4 = this.props,
87
- renderIcon = _this$props4.renderIcon,
88
- renderLabel = _this$props4.renderLabel,
89
- href = _this$props4.href,
90
- renderAfter = _this$props4.renderAfter,
91
- cursor = _this$props4.cursor,
92
- isDisabled = _this$props4.isDisabled;
93
- const icon = (0, _callRenderProp.callRenderProp)(renderIcon);
94
- const label = (0, _callRenderProp.callRenderProp)(renderLabel);
95
- const labelIsForScreenReaders = (0, _matchComponentTypes.matchComponentTypes)(label, [_ScreenReaderContent.ScreenReaderContent]);
96
- if (icon) {
97
- (0, _console.logError)(labelIsForScreenReaders, '[AppNav] If an icon is used, the label text should be wrapped in <ScreenReaderContent />.');
98
- }
99
- return (0, _jsxRuntime.jsxs)(_View.View, {
100
- ...(0, _passthroughProps.passthroughProps)(this.props),
101
- as: ElementType,
102
- href: href,
103
- onClick: this.handleClick,
104
- disabled: isDisabled,
105
- elementRef: this.handleRef,
106
- display: "flex",
107
- position: "relative",
108
- borderRadius: "medium",
109
- cursor: isDisabled ? 'not-allowed' : cursor,
110
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.item,
111
- "data-cid": "AppNav.Item",
112
- children: [icon, labelIsForScreenReaders ? label : (0, _jsxRuntime.jsx)("span", {
113
- css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label,
114
- children: label
115
- }), renderAfter && (0, _callRenderProp.callRenderProp)(renderAfter)]
116
- });
117
- }
118
- }, _Item.displayName = "Item", _Item.componentId = 'AppNav.Item', _Item.allowedProps = _props.allowedProps, _Item.defaultProps = {
119
- children: null,
120
- isSelected: false,
121
- cursor: 'pointer',
122
- isDisabled: false
123
- }, _Item)) || _class);
124
- var _default = exports.default = Item;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = 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
- const allowedProps = exports.allowedProps = ['renderLabel', 'renderAfter', 'renderIcon', 'href', 'onClick', 'isSelected', 'elementRef', 'as', 'cursor', 'isDisabled'];
@@ -1,91 +0,0 @@
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 {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props) => {
42
- const isSelected = props.isSelected,
43
- isDisabled = props.isDisabled;
44
- const itemStyles = {
45
- appearance: 'none',
46
- overflow: 'visible',
47
- direction: 'inherit',
48
- margin: '0',
49
- textDecoration: 'none',
50
- userSelect: 'none',
51
- touchAction: 'manipulation',
52
- background: 'transparent',
53
- border: 'none',
54
- outline: 'none',
55
- lineHeight: componentTheme.height,
56
- padding: `0 ${componentTheme.padding}`,
57
- alignItems: 'flex-start',
58
- '&:hover': {
59
- textDecoration: 'underline',
60
- textDecorationColor: componentTheme.textColor
61
- },
62
- ...(isDisabled && {
63
- pointerEvents: 'none',
64
- opacity: 0.5
65
- })
66
- };
67
- return {
68
- item: {
69
- label: 'item',
70
- ...itemStyles,
71
- // NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
72
- '&:is(a), &:is(button)': itemStyles,
73
- '&:-webkit-any(a), &:-webkit-any(button)': itemStyles
74
- },
75
- label: {
76
- label: 'item__label',
77
- whiteSpace: 'nowrap',
78
- overflow: 'hidden',
79
- textOverflow: 'ellipsis',
80
- fontFamily: componentTheme.fontFamily,
81
- fontSize: componentTheme.fontSize,
82
- fontWeight: componentTheme.fontWeight,
83
- color: componentTheme.textColor,
84
- ...(isSelected && {
85
- color: componentTheme.textColorSelected,
86
- textDecoration: 'underline'
87
- })
88
- }
89
- };
90
- };
91
- var _default = exports.default = generateStyle;
@@ -1,55 +0,0 @@
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
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3;
38
- const colors = theme.colors,
39
- spacing = theme.spacing,
40
- typography = theme.typography;
41
- const componentVariables = {
42
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
43
- fontSize: '1.125rem',
44
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
45
- textColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.blue4570,
46
- textColorSelected: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey125125,
47
- height: '2.25rem',
48
- padding: spacing === null || spacing === void 0 ? void 0 : spacing.small,
49
- backgroundColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.white1010
50
- };
51
- return {
52
- ...componentVariables
53
- };
54
- };
55
- var _default = exports.default = generateComponentTheme;
@@ -1,129 +0,0 @@
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.AppNav = void 0;
8
- var _react = require("react");
9
- var _emotion = require("@instructure/emotion");
10
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
11
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
12
- var _View = require("@instructure/ui-view/lib/View");
13
- var _Menu = require("@instructure/ui-menu/lib/Menu");
14
- var _Item = require("./Item");
15
- var _styles = _interopRequireDefault(require("./styles"));
16
- var _theme = _interopRequireDefault(require("./theme"));
17
- var _props = require("./props");
18
- var _TruncateList = require("@instructure/ui-truncate-list/lib/TruncateList");
19
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
20
- var _dec, _class, _AppNav;
21
- /*
22
- * The MIT License (MIT)
23
- *
24
- * Copyright (c) 2015 - present Instructure, Inc.
25
- *
26
- * Permission is hereby granted, free of charge, to any person obtaining a copy
27
- * of this software and associated documentation files (the "Software"), to deal
28
- * in the Software without restriction, including without limitation the rights
29
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30
- * copies of the Software, and to permit persons to whom the Software is
31
- * furnished to do so, subject to the following conditions:
32
- *
33
- * The above copyright notice and this permission notice shall be included in all
34
- * copies or substantial portions of the Software.
35
- *
36
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
- * SOFTWARE.
43
- */
44
- /**
45
- ---
46
- category: components
47
- ---
48
- **/
49
- let AppNav = exports.AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_AppNav = class AppNav extends _react.Component {
50
- constructor(...args) {
51
- super(...args);
52
- this.state = {
53
- isMeasuring: false
54
- };
55
- this.ref = null;
56
- this.handleRef = el => {
57
- const elementRef = this.props.elementRef;
58
- this.ref = el;
59
- if (typeof elementRef === 'function') {
60
- elementRef(el);
61
- }
62
- };
63
- }
64
- componentDidMount() {
65
- var _this$props$makeStyle, _this$props;
66
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
67
- }
68
- componentDidUpdate() {
69
- var _this$props$makeStyle2, _this$props2;
70
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
71
- }
72
- renderMenu(items) {
73
- return (0, _jsxRuntime.jsx)(_Menu.Menu, {
74
- trigger: (0, _jsxRuntime.jsx)(AppNav.Item, {
75
- renderLabel: (0, _callRenderProp.callRenderProp)(this.props.renderTruncateLabel)
76
- }),
77
- children: items.map((item, index) => {
78
- return (0, _jsxRuntime.jsx)(_Menu.Menu.Item, {
79
- href: item.props.href ? item.props.href : void 0,
80
- onClick: item.props.onClick && !item.props.href ? item.props.onClick : void 0,
81
- children: (0, _callRenderProp.callRenderProp)(item.props.renderLabel)
82
- }, index);
83
- })
84
- });
85
- }
86
- render() {
87
- const _this$props3 = this.props,
88
- visibleItemsCount = _this$props3.visibleItemsCount,
89
- screenReaderLabel = _this$props3.screenReaderLabel,
90
- margin = _this$props3.margin,
91
- debounce = _this$props3.debounce,
92
- styles = _this$props3.styles;
93
- const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, AppNav.allowedProps), AppNav);
94
- const renderBeforeItems = (0, _callRenderProp.callRenderProp)(this.props.renderBeforeItems);
95
- const renderAfterItems = (0, _callRenderProp.callRenderProp)(this.props.renderAfterItems);
96
- const hasRenderedContent = renderBeforeItems || renderAfterItems;
97
- return (0, _jsxRuntime.jsxs)(_View.View, {
98
- ...passthroughProps,
99
- as: "nav",
100
- css: [styles === null || styles === void 0 ? void 0 : styles.appNav, hasRenderedContent ? styles === null || styles === void 0 ? void 0 : styles.alignCenter : ''],
101
- margin: margin,
102
- display: hasRenderedContent ? 'flex' : 'block',
103
- elementRef: this.handleRef,
104
- "data-cid": "AppNav",
105
- children: [renderBeforeItems && (0, _jsxRuntime.jsx)("span", {
106
- children: renderBeforeItems
107
- }), (0, _jsxRuntime.jsx)(_TruncateList.TruncateList, {
108
- visibleItemsCount: visibleItemsCount,
109
- debounce: debounce,
110
- onUpdate: this.props.onUpdate,
111
- renderHiddenItemMenu: hiddenChildren => this.renderMenu(hiddenChildren),
112
- itemSpacing: styles === null || styles === void 0 ? void 0 : styles.horizontalMargin,
113
- fixMenuTriggerWidth: styles === null || styles === void 0 ? void 0 : styles.menuTriggerWidth,
114
- css: styles === null || styles === void 0 ? void 0 : styles.list,
115
- "aria-label": (0, _callRenderProp.callRenderProp)(screenReaderLabel),
116
- children: this.props.children
117
- }), renderAfterItems && (0, _jsxRuntime.jsx)("span", {
118
- children: renderAfterItems
119
- })]
120
- });
121
- }
122
- }, _AppNav.displayName = "AppNav", _AppNav.componentId = 'AppNav', _AppNav.allowedProps = _props.allowedProps, _AppNav.defaultProps = {
123
- children: null,
124
- debounce: 300,
125
- margin: '0',
126
- renderTruncateLabel: () => 'More',
127
- visibleItemsCount: 0
128
- }, _AppNav.Item = _Item.Item, _AppNav)) || _class);
129
- var _default = exports.default = AppNav;
@@ -1,64 +0,0 @@
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 {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = componentTheme => {
42
- return {
43
- appNav: {
44
- label: 'appNav',
45
- fontFamily: componentTheme.fontFamily,
46
- borderBottom: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`
47
- },
48
- alignCenter: {
49
- alignItems: 'center'
50
- },
51
- list: {
52
- label: 'appNav__list',
53
- height: componentTheme.height,
54
- flexGrow: 1,
55
- flexShrink: 1,
56
- flexBasis: '0',
57
- minWidth: '0.0625rem',
58
- paddingInlineStart: componentTheme.horizontalMargin
59
- },
60
- horizontalMargin: componentTheme.horizontalMargin.toString(),
61
- menuTriggerWidth: componentTheme.menuTriggerWidth.toString()
62
- };
63
- };
64
- var _default = exports.default = generateStyle;
@@ -1,56 +0,0 @@
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
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts;
38
- const colors = theme.colors,
39
- borders = theme.borders,
40
- spacing = theme.spacing,
41
- typography = theme.typography;
42
- const componentVariables = {
43
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
- height: '3.75rem',
45
- // 60px per product design
46
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey1424,
47
- borderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
48
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
49
- horizontalMargin: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall,
50
- menuTriggerWidth: '7.5rem'
51
- };
52
- return {
53
- ...componentVariables
54
- };
55
- };
56
- var _default = exports.default = generateComponentTheme;
package/lib/index.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AppNav", {
7
- enumerable: true,
8
- get: function () {
9
- return _AppNav.AppNav;
10
- }
11
- });
12
- Object.defineProperty(exports, "AppNavItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _Item.Item;
16
- }
17
- });
18
- var _AppNav = require("./AppNav");
19
- var _Item = require("./AppNav/Item");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}