@instructure/ui-side-nav-bar 11.6.0 → 11.6.1-snapshot-129

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +34 -290
  2. package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.js +2 -2
  3. package/es/SideNavBar/{index.js → v1/index.js} +1 -1
  4. package/es/SideNavBar/v2/SideNavBarItem/index.js +109 -0
  5. package/{src/index.ts → es/SideNavBar/v2/SideNavBarItem/props.js} +2 -4
  6. package/es/SideNavBar/v2/SideNavBarItem/styles.js +101 -0
  7. package/es/SideNavBar/v2/index.js +135 -0
  8. package/es/SideNavBar/v2/props.js +26 -0
  9. package/es/SideNavBar/v2/styles.js +95 -0
  10. package/es/{index.js → exports/a.js} +1 -1
  11. package/es/exports/b.js +24 -0
  12. package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.js +3 -3
  13. package/lib/SideNavBar/{index.js → v1/index.js} +2 -2
  14. package/lib/SideNavBar/v2/SideNavBarItem/index.js +115 -0
  15. package/lib/SideNavBar/v2/SideNavBarItem/props.js +31 -0
  16. package/lib/SideNavBar/v2/SideNavBarItem/styles.js +107 -0
  17. package/lib/SideNavBar/v2/index.js +149 -0
  18. package/lib/SideNavBar/v2/props.js +31 -0
  19. package/lib/SideNavBar/v2/styles.js +100 -0
  20. package/lib/{index.js → exports/a.js} +3 -3
  21. package/lib/exports/b.js +18 -0
  22. package/package.json +43 -21
  23. package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.tsx +2 -2
  24. package/src/SideNavBar/{index.tsx → v1/index.tsx} +1 -1
  25. package/src/SideNavBar/v2/README.md +108 -0
  26. package/src/SideNavBar/v2/SideNavBarItem/index.tsx +112 -0
  27. package/src/SideNavBar/v2/SideNavBarItem/props.ts +89 -0
  28. package/src/SideNavBar/v2/SideNavBarItem/styles.ts +111 -0
  29. package/src/SideNavBar/v2/index.tsx +162 -0
  30. package/src/SideNavBar/v2/props.ts +94 -0
  31. package/src/SideNavBar/v2/styles.ts +105 -0
  32. package/src/exports/a.ts +28 -0
  33. package/src/exports/b.ts +28 -0
  34. package/tsconfig.build.tsbuildinfo +1 -1
  35. package/types/SideNavBar/v1/SideNavBarItem/index.d.ts.map +1 -0
  36. package/types/SideNavBar/v1/SideNavBarItem/props.d.ts.map +1 -0
  37. package/types/SideNavBar/v1/SideNavBarItem/styles.d.ts.map +1 -0
  38. package/types/SideNavBar/v1/SideNavBarItem/theme.d.ts.map +1 -0
  39. package/types/SideNavBar/v1/index.d.ts.map +1 -0
  40. package/types/SideNavBar/v1/props.d.ts.map +1 -0
  41. package/types/SideNavBar/v1/styles.d.ts.map +1 -0
  42. package/types/SideNavBar/v1/theme.d.ts.map +1 -0
  43. package/types/SideNavBar/v2/SideNavBarItem/index.d.ts +35 -0
  44. package/types/SideNavBar/v2/SideNavBarItem/index.d.ts.map +1 -0
  45. package/types/SideNavBar/v2/SideNavBarItem/props.d.ts +45 -0
  46. package/types/SideNavBar/v2/SideNavBarItem/props.d.ts.map +1 -0
  47. package/types/SideNavBar/v2/SideNavBarItem/styles.d.ts +16 -0
  48. package/types/SideNavBar/v2/SideNavBarItem/styles.d.ts.map +1 -0
  49. package/types/SideNavBar/v2/index.d.ts +44 -0
  50. package/types/SideNavBar/v2/index.d.ts.map +1 -0
  51. package/types/SideNavBar/v2/props.d.ts +48 -0
  52. package/types/SideNavBar/v2/props.d.ts.map +1 -0
  53. package/types/SideNavBar/v2/styles.d.ts +16 -0
  54. package/types/SideNavBar/v2/styles.d.ts.map +1 -0
  55. package/types/exports/a.d.ts +4 -0
  56. package/types/exports/a.d.ts.map +1 -0
  57. package/types/exports/b.d.ts +4 -0
  58. package/types/exports/b.d.ts.map +1 -0
  59. package/types/SideNavBar/SideNavBarItem/index.d.ts.map +0 -1
  60. package/types/SideNavBar/SideNavBarItem/props.d.ts.map +0 -1
  61. package/types/SideNavBar/SideNavBarItem/styles.d.ts.map +0 -1
  62. package/types/SideNavBar/SideNavBarItem/theme.d.ts.map +0 -1
  63. package/types/SideNavBar/index.d.ts.map +0 -1
  64. package/types/SideNavBar/props.d.ts.map +0 -1
  65. package/types/SideNavBar/styles.d.ts.map +0 -1
  66. package/types/SideNavBar/theme.d.ts.map +0 -1
  67. package/types/index.d.ts +0 -4
  68. package/types/index.d.ts.map +0 -1
  69. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.js +0 -0
  70. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.js +0 -0
  71. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.js +0 -0
  72. /package/es/SideNavBar/{props.js → v1/props.js} +0 -0
  73. /package/es/SideNavBar/{styles.js → v1/styles.js} +0 -0
  74. /package/es/SideNavBar/{theme.js → v1/theme.js} +0 -0
  75. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.js +0 -0
  76. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.js +0 -0
  77. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.js +0 -0
  78. /package/lib/SideNavBar/{props.js → v1/props.js} +0 -0
  79. /package/lib/SideNavBar/{styles.js → v1/styles.js} +0 -0
  80. /package/lib/SideNavBar/{theme.js → v1/theme.js} +0 -0
  81. /package/src/SideNavBar/{README.md → v1/README.md} +0 -0
  82. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.ts +0 -0
  83. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.ts +0 -0
  84. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.ts +0 -0
  85. /package/src/SideNavBar/{props.ts → v1/props.ts} +0 -0
  86. /package/src/SideNavBar/{styles.ts → v1/styles.ts} +0 -0
  87. /package/src/SideNavBar/{theme.ts → v1/theme.ts} +0 -0
  88. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.d.ts +0 -0
  89. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.d.ts +0 -0
  90. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.d.ts +0 -0
  91. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.d.ts +0 -0
  92. /package/types/SideNavBar/{index.d.ts → v1/index.d.ts} +0 -0
  93. /package/types/SideNavBar/{props.d.ts → v1/props.d.ts} +0 -0
  94. /package/types/SideNavBar/{styles.d.ts → v1/styles.d.ts} +0 -0
  95. /package/types/SideNavBar/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,31 @@
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 = ['elementRef', 'icon', 'label', 'as', 'href', 'onClick', 'selected', 'minimized'];
@@ -0,0 +1,107 @@
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} sharedTokens Shared theme token object
39
+ * @param {Object} state the state of the component, the style is applied to
40
+ * @return {Object} The final style object, which will be used in the component
41
+ */
42
+ const generateStyle = (componentTheme, props) => {
43
+ const selected = props.selected;
44
+ return {
45
+ navigationItem: {
46
+ borderRadius: componentTheme.borderRadius,
47
+ label: 'navigationItem',
48
+ fontFamily: componentTheme.fontFamily,
49
+ fontWeight: componentTheme.fontWeight,
50
+ display: 'block',
51
+ width: '100%',
52
+ textAlign: 'center',
53
+ padding: componentTheme.contentPadding,
54
+ cursor: 'pointer',
55
+ border: 'none',
56
+ boxSizing: 'border-box',
57
+ textDecoration: componentTheme.linkTextDecoration,
58
+ overflowWrap: 'break-word',
59
+ wordWrap: 'break-word',
60
+ hyphens: 'auto',
61
+ ...(selected ? {
62
+ backgroundColor: componentTheme.selectedBackgroundColor,
63
+ color: componentTheme.selectedFontColor,
64
+ '&:active, &:hover': {
65
+ backgroundColor: componentTheme.selectedBackgroundColor,
66
+ color: componentTheme.selectedFontColor,
67
+ textDecoration: componentTheme.linkTextDecoration
68
+ },
69
+ '&:focus': {
70
+ backgroundColor: componentTheme.selectedBackgroundColor,
71
+ boxShadow: `${componentTheme.selectedOuterFocusOutlineColor}, ${componentTheme.selectedInnerFocusOutlineColor}`,
72
+ outline: 'none'
73
+ }
74
+ } : {
75
+ backgroundColor: componentTheme.backgroundColor,
76
+ color: componentTheme.fontColor,
77
+ '&:active': {
78
+ backgroundColor: componentTheme.hoverBackgroundColor
79
+ },
80
+ '&:hover': {
81
+ transition: 'background-color .3s',
82
+ backgroundColor: componentTheme.hoverBackgroundColor,
83
+ color: componentTheme.fontColor,
84
+ textDecoration: componentTheme.linkTextDecoration
85
+ },
86
+ '&:focus': {
87
+ backgroundColor: componentTheme.hoverBackgroundColor,
88
+ boxShadow: `inset 0 0 0 0.125rem ${componentTheme.outerFocusOutlineColor}, inset 0 0 0 0.25rem ${componentTheme.innerFocusOutlineColor}`,
89
+ outline: 'none'
90
+ }
91
+ })
92
+ },
93
+ icon: {
94
+ label: 'navigationItem__icon',
95
+ height: componentTheme.iconWrapperHeight,
96
+ display: 'flex',
97
+ alignItems: 'center',
98
+ justifyContent: 'center'
99
+ },
100
+ label: {
101
+ label: 'navigationItem__label',
102
+ fontSize: componentTheme.fontSize,
103
+ lineHeight: componentTheme.lineHeight
104
+ }
105
+ };
106
+ };
107
+ var _default = exports.default = generateStyle;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.SideNavBar = void 0;
8
+ Object.defineProperty(exports, "SideNavBarItem", {
9
+ enumerable: true,
10
+ get: function () {
11
+ return _SideNavBarItem.SideNavBarItem;
12
+ }
13
+ });
14
+ exports.default = void 0;
15
+ var _react = require("react");
16
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
17
+ var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
18
+ var _uiIcons = require("@instructure/ui-icons");
19
+ var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
20
+ var _emotion = require("@instructure/emotion");
21
+ var _SideNavBarItem = require("./SideNavBarItem");
22
+ var _styles = _interopRequireDefault(require("./styles"));
23
+ var _props = require("./props");
24
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
25
+ var _dec, _class, _SideNavBar;
26
+ /*
27
+ * The MIT License (MIT)
28
+ *
29
+ * Copyright (c) 2015 - present Instructure, Inc.
30
+ *
31
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
32
+ * of this software and associated documentation files (the "Software"), to deal
33
+ * in the Software without restriction, including without limitation the rights
34
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35
+ * copies of the Software, and to permit persons to whom the Software is
36
+ * furnished to do so, subject to the following conditions:
37
+ *
38
+ * The above copyright notice and this permission notice shall be included in all
39
+ * copies or substantial portions of the Software.
40
+ *
41
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
+ * SOFTWARE.
48
+ */
49
+ const navMinimized = ({
50
+ minimized
51
+ }) => ({
52
+ minimized: !minimized
53
+ });
54
+
55
+ /**
56
+ ---
57
+ category: components
58
+ ---
59
+ **/
60
+ let SideNavBar = exports.SideNavBar = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_SideNavBar = class SideNavBar extends _react.Component {
61
+ constructor(props) {
62
+ super(props);
63
+ this.ref = null;
64
+ this.handleNavToggle = event => {
65
+ if (!this.isControlled()) {
66
+ this.setState(navMinimized);
67
+ }
68
+ if (typeof this.props.onMinimized === 'function') {
69
+ this.props.onMinimized(event, !this.minimized);
70
+ }
71
+ };
72
+ this.state = {
73
+ minimized: this.isControlled(props) ? !!props.minimized : !!props.defaultMinimized
74
+ };
75
+ }
76
+ componentDidMount() {
77
+ var _this$props$makeStyle, _this$props;
78
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
79
+ minimized: this.minimized
80
+ });
81
+ }
82
+ componentDidUpdate() {
83
+ var _this$props$makeStyle2, _this$props2;
84
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
85
+ minimized: this.minimized
86
+ });
87
+ }
88
+ get minimized() {
89
+ if (this.isControlled()) {
90
+ return !!this.props.minimized;
91
+ }
92
+ return !!this.state.minimized;
93
+ }
94
+ isControlled(props = this.props) {
95
+ return typeof props.minimized === 'boolean';
96
+ }
97
+ renderChildren() {
98
+ return _react.Children.map(this.props.children, child => {
99
+ var _this$props$styles;
100
+ if (! /*#__PURE__*/(0, _react.isValidElement)(child)) return null;
101
+ const navItem = (0, _safeCloneElement.safeCloneElement)(child, {
102
+ minimized: this.state.minimized
103
+ });
104
+ return (0, _jsxRuntime.jsx)("li", {
105
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.list,
106
+ children: navItem
107
+ });
108
+ });
109
+ }
110
+ renderIcon() {
111
+ const icon = this.minimized ? _uiIcons.PanelLeftOpenInstUIIcon : _uiIcons.PanelLeftCloseInstUIIcon;
112
+ const iconColor = this.props.selected ? 'sideNavActiveColor' : 'sideNavColor';
113
+ return (0, _uiIcons.renderIconWithProps)(icon, 'lg', iconColor); //TODO-rework remove after merging into v12
114
+ }
115
+ toggleMessage() {
116
+ return this.state.minimized ? this.props.toggleLabel.minimizedLabel : this.props.toggleLabel.expandedLabel;
117
+ }
118
+ render() {
119
+ var _this$props$styles2, _this$props$styles3;
120
+ const label = this.props.label;
121
+ const props = (0, _omitProps.omitProps)(this.props, SideNavBar.allowedProps, ['minimized']);
122
+ return (0, _jsxRuntime.jsxs)("nav", {
123
+ ...props,
124
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
125
+ "data-cid": "SideNavBar",
126
+ "aria-label": label,
127
+ ref: element => {
128
+ this.ref = element;
129
+ },
130
+ children: [(0, _jsxRuntime.jsx)("ul", {
131
+ css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.content,
132
+ children: this.renderChildren()
133
+ }), (0, _jsxRuntime.jsx)(_SideNavBarItem.SideNavBarItem, {
134
+ "aria-expanded": !this.minimized,
135
+ onClick: this.handleNavToggle,
136
+ icon: this.renderIcon(),
137
+ label: (0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {
138
+ children: this.toggleMessage()
139
+ })
140
+ })]
141
+ });
142
+ }
143
+ }, _SideNavBar.displayName = "SideNavBar", _SideNavBar.componentId = 'SideNavBar', _SideNavBar.allowedProps = _props.allowedProps, _SideNavBar.defaultProps = {
144
+ children: null,
145
+ defaultMinimized: false,
146
+ // TODO we should investigate later if it used or not
147
+ onClick: function (_e) {}
148
+ }, _SideNavBar.Item = _SideNavBarItem.SideNavBarItem, _SideNavBar)) || _class);
149
+ var _default = exports.default = SideNavBar;
@@ -0,0 +1,31 @@
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 = ['children', 'minimized', 'defaultMinimized', 'onMinimized', 'label', 'toggleLabel', 'href', 'onClick'];
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _uiThemes = require("@instructure/ui-themes");
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ /**
33
+ * ---
34
+ * private: true
35
+ * ---
36
+ * Generates the style object from the theme and provided additional information
37
+ * @param {Object} componentTheme The theme variable object.
38
+ * @param {Object} props the props of the component, the style is applied to
39
+ * @param {Object} sharedTokens Shared theme token object
40
+ * @param {Object} state the state of the component, the style is applied to
41
+ * @return {Object} The final style object, which will be used in the component
42
+ */
43
+ const generateStyle = (componentTheme, _props, _sharedTokens, state) => {
44
+ const minimized = state.minimized;
45
+ const layoutVariants = {
46
+ minimized: {
47
+ width: componentTheme.minimizedWidth,
48
+ margin: componentTheme.minimizedMargin,
49
+ borderRadius: componentTheme.minimizedBorderRadius
50
+ },
51
+ expanded: {
52
+ width: componentTheme.width,
53
+ margin: componentTheme.margin,
54
+ borderRadius: componentTheme.borderRadius
55
+ }
56
+ };
57
+ return {
58
+ navigation: {
59
+ label: 'navigation',
60
+ color: componentTheme.fontColor,
61
+ backgroundColor: componentTheme.backgroundColor,
62
+ boxSizing: 'border-box',
63
+ display: 'flex',
64
+ flexDirection: 'column',
65
+ height: '100%',
66
+ overflowY: 'auto',
67
+ boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(componentTheme.boxShadow),
68
+ ...layoutVariants[minimized ? 'minimized' : 'expanded'],
69
+ // The layout toggle button needs the nav's border radius to visually match the container corners.
70
+ '& > [data-cid="SideNavBarItem"]': {
71
+ borderRadius: minimized ? componentTheme.minimizedBorderRadius : componentTheme.borderRadius
72
+ }
73
+ },
74
+ list: {
75
+ label: 'navigation__list',
76
+ padding: 0,
77
+ margin: 0
78
+ },
79
+ content: {
80
+ label: 'navigation__content',
81
+ listStyleType: 'none',
82
+ margin: componentTheme.contentMargin,
83
+ padding: 0,
84
+ display: 'flex',
85
+ flex: '1 0 auto',
86
+ flexDirection: 'column',
87
+ gap: componentTheme.contentGap
88
+ },
89
+ toggleIcon: {
90
+ fill: componentTheme.fill,
91
+ margin: '0 auto',
92
+ transform: 'translate3d(0, 0, 0)',
93
+ transition: `all ${componentTheme.toggleTransition}`,
94
+ ...(minimized ? {
95
+ transform: 'rotate3d(0, 1, 0, -180deg)'
96
+ } : {})
97
+ }
98
+ };
99
+ };
100
+ var _default = exports.default = generateStyle;
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "SideNavBar", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _SideNavBar.SideNavBar;
9
+ return _v.SideNavBar;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "SideNavBarItem", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _SideNavBar.SideNavBarItem;
15
+ return _v.SideNavBarItem;
16
16
  }
17
17
  });
18
- var _SideNavBar = require("./SideNavBar");
18
+ var _v = require("../SideNavBar/v1");
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SideNavBar", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _v.SideNavBar;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SideNavBarItem", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _v.SideNavBarItem;
16
+ }
17
+ });
18
+ var _v = require("../SideNavBar/v2");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-side-nav-bar",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-snapshot-129",
4
4
  "description": "Main and application level navigational components",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -15,25 +15,25 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/debounce": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/shared-types": "11.6.0",
21
- "@instructure/ui-a11y-content": "11.6.0",
22
- "@instructure/ui-a11y-utils": "11.6.0",
23
- "@instructure/ui-badge": "11.6.0",
24
- "@instructure/ui-icons": "11.6.0",
25
- "@instructure/ui-react-utils": "11.6.0",
26
- "@instructure/ui-tooltip": "11.6.0"
18
+ "@instructure/emotion": "11.6.1-snapshot-129",
19
+ "@instructure/ui-a11y-content": "11.6.1-snapshot-129",
20
+ "@instructure/debounce": "11.6.1-snapshot-129",
21
+ "@instructure/shared-types": "11.6.1-snapshot-129",
22
+ "@instructure/ui-a11y-utils": "11.6.1-snapshot-129",
23
+ "@instructure/ui-badge": "11.6.1-snapshot-129",
24
+ "@instructure/ui-react-utils": "11.6.1-snapshot-129",
25
+ "@instructure/ui-tooltip": "11.6.1-snapshot-129",
26
+ "@instructure/ui-icons": "11.6.1-snapshot-129"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
30
  "@testing-library/react": "15.0.7",
31
31
  "@testing-library/user-event": "^14.6.1",
32
32
  "vitest": "^3.2.2",
33
- "@instructure/ui-axe-check": "11.6.0",
34
- "@instructure/ui-color-utils": "11.6.0",
35
- "@instructure/ui-babel-preset": "11.6.0",
36
- "@instructure/ui-themes": "11.6.0"
33
+ "@instructure/ui-axe-check": "11.6.1-snapshot-129",
34
+ "@instructure/ui-babel-preset": "11.6.1-snapshot-129",
35
+ "@instructure/ui-themes": "11.6.1-snapshot-129",
36
+ "@instructure/ui-color-utils": "11.6.1-snapshot-129"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18 <=19"
@@ -43,17 +43,39 @@
43
43
  },
44
44
  "sideEffects": false,
45
45
  "exports": {
46
- ".": {
47
- "types": "./types/index.d.ts",
48
- "import": "./es/index.js",
49
- "require": "./lib/index.js",
50
- "default": "./es/index.js"
51
- },
52
46
  "./lib/*": "./lib/*",
53
47
  "./es/*": "./es/*",
54
48
  "./types/*": "./types/*",
55
49
  "./package.json": "./package.json",
56
- "./src/*": "./src/*"
50
+ "./src/*": "./src/*",
51
+ ".": {
52
+ "src": "./src/exports/a.ts",
53
+ "types": "./types/exports/a.d.ts",
54
+ "import": "./es/exports/a.js",
55
+ "require": "./lib/exports/a.js",
56
+ "default": "./es/exports/a.js"
57
+ },
58
+ "./v11_6": {
59
+ "src": "./src/exports/a.ts",
60
+ "types": "./types/exports/a.d.ts",
61
+ "import": "./es/exports/a.js",
62
+ "require": "./lib/exports/a.js",
63
+ "default": "./es/exports/a.js"
64
+ },
65
+ "./v11_7": {
66
+ "src": "./src/exports/b.ts",
67
+ "types": "./types/exports/b.d.ts",
68
+ "import": "./es/exports/b.js",
69
+ "require": "./lib/exports/b.js",
70
+ "default": "./es/exports/b.js"
71
+ },
72
+ "./latest": {
73
+ "src": "./src/exports/b.ts",
74
+ "types": "./types/exports/b.d.ts",
75
+ "import": "./es/exports/b.js",
76
+ "require": "./lib/exports/b.js",
77
+ "default": "./es/exports/b.js"
78
+ }
57
79
  },
58
80
  "scripts": {
59
81
  "lint": "ui-scripts lint",
@@ -25,9 +25,9 @@
25
25
  import { Component } from 'react'
26
26
 
27
27
  import { omitProps, getElementType } from '@instructure/ui-react-utils'
28
- import { Tooltip } from '@instructure/ui-tooltip'
28
+ import { Tooltip } from '@instructure/ui-tooltip/v11_6'
29
29
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
30
- import { withStyle } from '@instructure/emotion'
30
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
31
31
 
32
32
  import generateStyle from './styles'
33
33
  import generateComponentTheme from './theme'
@@ -26,7 +26,7 @@ import { Component, Children, ReactElement, isValidElement } from 'react'
26
26
  import { omitProps, safeCloneElement } from '@instructure/ui-react-utils'
27
27
  import { IconMoveStartLine } from '@instructure/ui-icons'
28
28
  import { ScreenReaderContent } from '@instructure/ui-a11y-content'
29
- import { withStyle } from '@instructure/emotion'
29
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
30
30
 
31
31
  import { SideNavBarItem } from './SideNavBarItem'
32
32