@instructure/ui-menu 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 (180) hide show
  1. package/CHANGELOG.md +41 -297
  2. package/es/Menu/{MenuItem → v1/MenuItem}/index.js +2 -2
  3. package/es/Menu/{MenuItemGroup → v1/MenuItemGroup}/index.js +1 -1
  4. package/es/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/index.js +1 -1
  5. package/es/Menu/{index.js → v1/index.js} +3 -3
  6. package/es/Menu/v2/MenuItem/index.js +262 -0
  7. package/es/Menu/v2/MenuItem/props.js +26 -0
  8. package/es/Menu/v2/MenuItem/styles.js +146 -0
  9. package/es/Menu/v2/MenuItemGroup/index.js +175 -0
  10. package/es/Menu/v2/MenuItemGroup/props.js +26 -0
  11. package/es/Menu/v2/MenuItemGroup/styles.js +60 -0
  12. package/es/Menu/v2/MenuItemSeparator/index.js +70 -0
  13. package/es/Menu/v2/MenuItemSeparator/props.js +29 -0
  14. package/es/Menu/v2/MenuItemSeparator/styles.js +46 -0
  15. package/es/Menu/v2/index.js +405 -0
  16. package/es/Menu/v2/props.js +26 -0
  17. package/es/Menu/v2/styles.js +61 -0
  18. package/es/{index.js → exports/a.js} +1 -1
  19. package/es/exports/b.js +24 -0
  20. package/es/{MenuContext.js → utils/v1/MenuContext.js} +2 -0
  21. package/lib/Menu/{MenuItem → v1/MenuItem}/index.js +4 -4
  22. package/lib/Menu/{MenuItemGroup → v1/MenuItemGroup}/index.js +1 -1
  23. package/lib/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/index.js +1 -1
  24. package/lib/Menu/v1/index.js +432 -0
  25. package/lib/Menu/v2/MenuItem/index.js +271 -0
  26. package/lib/Menu/v2/MenuItem/props.js +31 -0
  27. package/lib/Menu/v2/MenuItem/styles.js +152 -0
  28. package/lib/Menu/v2/MenuItemGroup/index.js +183 -0
  29. package/lib/Menu/v2/MenuItemGroup/props.js +31 -0
  30. package/lib/Menu/v2/MenuItemGroup/styles.js +66 -0
  31. package/lib/Menu/v2/MenuItemSeparator/index.js +75 -0
  32. package/lib/Menu/v2/MenuItemSeparator/props.js +34 -0
  33. package/lib/Menu/v2/MenuItemSeparator/styles.js +52 -0
  34. package/lib/Menu/{index.js → v2/index.js} +4 -5
  35. package/lib/Menu/v2/props.js +31 -0
  36. package/lib/Menu/v2/styles.js +66 -0
  37. package/lib/{index.js → exports/a.js} +5 -5
  38. package/lib/exports/b.js +30 -0
  39. package/lib/{MenuContext.js → utils/v1/MenuContext.js} +1 -0
  40. package/package.json +45 -23
  41. package/src/Menu/{MenuItem → v1/MenuItem}/index.tsx +2 -2
  42. package/src/Menu/{MenuItemGroup → v1/MenuItemGroup}/index.tsx +1 -1
  43. package/src/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/index.tsx +1 -1
  44. package/src/Menu/{index.tsx → v1/index.tsx} +3 -3
  45. package/src/Menu/{props.ts → v1/props.ts} +1 -1
  46. package/src/Menu/v2/MenuItem/index.tsx +318 -0
  47. package/src/Menu/v2/MenuItem/props.ts +132 -0
  48. package/src/Menu/v2/MenuItem/styles.ts +172 -0
  49. package/src/Menu/v2/MenuItemGroup/index.tsx +245 -0
  50. package/src/Menu/v2/MenuItemGroup/props.ts +105 -0
  51. package/src/Menu/v2/MenuItemGroup/styles.ts +66 -0
  52. package/src/Menu/v2/MenuItemSeparator/index.tsx +79 -0
  53. package/src/Menu/v2/MenuItemSeparator/props.ts +48 -0
  54. package/src/Menu/v2/MenuItemSeparator/styles.ts +52 -0
  55. package/src/Menu/v2/README.md +104 -0
  56. package/src/Menu/v2/index.tsx +514 -0
  57. package/src/Menu/v2/props.ts +213 -0
  58. package/src/Menu/v2/styles.ts +68 -0
  59. package/src/{index.ts → exports/a.ts} +5 -5
  60. package/src/exports/b.ts +29 -0
  61. package/src/{MenuContext.ts → utils/v1/MenuContext.ts} +3 -3
  62. package/tsconfig.build.tsbuildinfo +1 -1
  63. package/types/Menu/{MenuItem → v1/MenuItem}/index.d.ts +3 -3
  64. package/types/Menu/v1/MenuItem/index.d.ts.map +1 -0
  65. package/types/Menu/v1/MenuItem/props.d.ts.map +1 -0
  66. package/types/Menu/v1/MenuItem/styles.d.ts.map +1 -0
  67. package/types/Menu/v1/MenuItem/theme.d.ts.map +1 -0
  68. package/types/Menu/v1/MenuItemGroup/index.d.ts.map +1 -0
  69. package/types/Menu/v1/MenuItemGroup/props.d.ts.map +1 -0
  70. package/types/Menu/v1/MenuItemGroup/styles.d.ts.map +1 -0
  71. package/types/Menu/v1/MenuItemGroup/theme.d.ts.map +1 -0
  72. package/types/Menu/v1/MenuItemSeparator/index.d.ts.map +1 -0
  73. package/types/Menu/v1/MenuItemSeparator/props.d.ts.map +1 -0
  74. package/types/Menu/v1/MenuItemSeparator/styles.d.ts.map +1 -0
  75. package/types/Menu/v1/MenuItemSeparator/theme.d.ts.map +1 -0
  76. package/types/Menu/{index.d.ts → v1/index.d.ts} +3 -3
  77. package/types/Menu/v1/index.d.ts.map +1 -0
  78. package/types/Menu/{props.d.ts → v1/props.d.ts} +1 -1
  79. package/types/Menu/v1/props.d.ts.map +1 -0
  80. package/types/Menu/v1/styles.d.ts.map +1 -0
  81. package/types/Menu/v1/theme.d.ts.map +1 -0
  82. package/types/Menu/v2/MenuItem/index.d.ts +66 -0
  83. package/types/Menu/v2/MenuItem/index.d.ts.map +1 -0
  84. package/types/Menu/v2/MenuItem/props.d.ts +73 -0
  85. package/types/Menu/v2/MenuItem/props.d.ts.map +1 -0
  86. package/types/Menu/v2/MenuItem/styles.d.ts +15 -0
  87. package/types/Menu/v2/MenuItem/styles.d.ts.map +1 -0
  88. package/types/Menu/v2/MenuItemGroup/index.d.ts +52 -0
  89. package/types/Menu/v2/MenuItemGroup/index.d.ts.map +1 -0
  90. package/types/Menu/v2/MenuItemGroup/props.d.ts +51 -0
  91. package/types/Menu/v2/MenuItemGroup/props.d.ts.map +1 -0
  92. package/types/Menu/v2/MenuItemGroup/styles.d.ts +15 -0
  93. package/types/Menu/v2/MenuItemGroup/styles.d.ts.map +1 -0
  94. package/types/Menu/v2/MenuItemSeparator/index.d.ts +21 -0
  95. package/types/Menu/v2/MenuItemSeparator/index.d.ts.map +1 -0
  96. package/types/Menu/v2/MenuItemSeparator/props.d.ts +11 -0
  97. package/types/Menu/v2/MenuItemSeparator/props.d.ts.map +1 -0
  98. package/types/Menu/v2/MenuItemSeparator/styles.d.ts +15 -0
  99. package/types/Menu/v2/MenuItemSeparator/styles.d.ts.map +1 -0
  100. package/types/Menu/v2/index.d.ts +118 -0
  101. package/types/Menu/v2/index.d.ts.map +1 -0
  102. package/types/Menu/v2/props.d.ts +138 -0
  103. package/types/Menu/v2/props.d.ts.map +1 -0
  104. package/types/Menu/v2/styles.d.ts +15 -0
  105. package/types/Menu/v2/styles.d.ts.map +1 -0
  106. package/types/exports/a.d.ts +6 -0
  107. package/types/exports/a.d.ts.map +1 -0
  108. package/types/exports/b.d.ts +6 -0
  109. package/types/exports/b.d.ts.map +1 -0
  110. package/types/utils/v1/MenuContext.d.ts +13 -0
  111. package/types/utils/v1/MenuContext.d.ts.map +1 -0
  112. package/types/Menu/MenuItem/index.d.ts.map +0 -1
  113. package/types/Menu/MenuItem/props.d.ts.map +0 -1
  114. package/types/Menu/MenuItem/styles.d.ts.map +0 -1
  115. package/types/Menu/MenuItem/theme.d.ts.map +0 -1
  116. package/types/Menu/MenuItemGroup/index.d.ts.map +0 -1
  117. package/types/Menu/MenuItemGroup/props.d.ts.map +0 -1
  118. package/types/Menu/MenuItemGroup/styles.d.ts.map +0 -1
  119. package/types/Menu/MenuItemGroup/theme.d.ts.map +0 -1
  120. package/types/Menu/MenuItemSeparator/index.d.ts.map +0 -1
  121. package/types/Menu/MenuItemSeparator/props.d.ts.map +0 -1
  122. package/types/Menu/MenuItemSeparator/styles.d.ts.map +0 -1
  123. package/types/Menu/MenuItemSeparator/theme.d.ts.map +0 -1
  124. package/types/Menu/index.d.ts.map +0 -1
  125. package/types/Menu/props.d.ts.map +0 -1
  126. package/types/Menu/styles.d.ts.map +0 -1
  127. package/types/Menu/theme.d.ts.map +0 -1
  128. package/types/MenuContext.d.ts +0 -14
  129. package/types/MenuContext.d.ts.map +0 -1
  130. package/types/index.d.ts +0 -6
  131. package/types/index.d.ts.map +0 -1
  132. /package/es/Menu/{MenuItem → v1/MenuItem}/props.js +0 -0
  133. /package/es/Menu/{MenuItem → v1/MenuItem}/styles.js +0 -0
  134. /package/es/Menu/{MenuItem → v1/MenuItem}/theme.js +0 -0
  135. /package/es/Menu/{MenuItemGroup → v1/MenuItemGroup}/props.js +0 -0
  136. /package/es/Menu/{MenuItemGroup → v1/MenuItemGroup}/styles.js +0 -0
  137. /package/es/Menu/{MenuItemGroup → v1/MenuItemGroup}/theme.js +0 -0
  138. /package/es/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/props.js +0 -0
  139. /package/es/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/styles.js +0 -0
  140. /package/es/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/theme.js +0 -0
  141. /package/es/Menu/{props.js → v1/props.js} +0 -0
  142. /package/es/Menu/{styles.js → v1/styles.js} +0 -0
  143. /package/es/Menu/{theme.js → v1/theme.js} +0 -0
  144. /package/lib/Menu/{MenuItem → v1/MenuItem}/props.js +0 -0
  145. /package/lib/Menu/{MenuItem → v1/MenuItem}/styles.js +0 -0
  146. /package/lib/Menu/{MenuItem → v1/MenuItem}/theme.js +0 -0
  147. /package/lib/Menu/{MenuItemGroup → v1/MenuItemGroup}/props.js +0 -0
  148. /package/lib/Menu/{MenuItemGroup → v1/MenuItemGroup}/styles.js +0 -0
  149. /package/lib/Menu/{MenuItemGroup → v1/MenuItemGroup}/theme.js +0 -0
  150. /package/lib/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/props.js +0 -0
  151. /package/lib/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/styles.js +0 -0
  152. /package/lib/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/theme.js +0 -0
  153. /package/lib/Menu/{props.js → v1/props.js} +0 -0
  154. /package/lib/Menu/{styles.js → v1/styles.js} +0 -0
  155. /package/lib/Menu/{theme.js → v1/theme.js} +0 -0
  156. /package/src/Menu/{MenuItem → v1/MenuItem}/props.ts +0 -0
  157. /package/src/Menu/{MenuItem → v1/MenuItem}/styles.ts +0 -0
  158. /package/src/Menu/{MenuItem → v1/MenuItem}/theme.ts +0 -0
  159. /package/src/Menu/{MenuItemGroup → v1/MenuItemGroup}/props.ts +0 -0
  160. /package/src/Menu/{MenuItemGroup → v1/MenuItemGroup}/styles.ts +0 -0
  161. /package/src/Menu/{MenuItemGroup → v1/MenuItemGroup}/theme.ts +0 -0
  162. /package/src/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/props.ts +0 -0
  163. /package/src/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/styles.ts +0 -0
  164. /package/src/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/theme.ts +0 -0
  165. /package/src/Menu/{README.md → v1/README.md} +0 -0
  166. /package/src/Menu/{styles.ts → v1/styles.ts} +0 -0
  167. /package/src/Menu/{theme.ts → v1/theme.ts} +0 -0
  168. /package/types/Menu/{MenuItem → v1/MenuItem}/props.d.ts +0 -0
  169. /package/types/Menu/{MenuItem → v1/MenuItem}/styles.d.ts +0 -0
  170. /package/types/Menu/{MenuItem → v1/MenuItem}/theme.d.ts +0 -0
  171. /package/types/Menu/{MenuItemGroup → v1/MenuItemGroup}/index.d.ts +0 -0
  172. /package/types/Menu/{MenuItemGroup → v1/MenuItemGroup}/props.d.ts +0 -0
  173. /package/types/Menu/{MenuItemGroup → v1/MenuItemGroup}/styles.d.ts +0 -0
  174. /package/types/Menu/{MenuItemGroup → v1/MenuItemGroup}/theme.d.ts +0 -0
  175. /package/types/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/index.d.ts +0 -0
  176. /package/types/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/props.d.ts +0 -0
  177. /package/types/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/styles.d.ts +0 -0
  178. /package/types/Menu/{MenuItemSeparator → v1/MenuItemSeparator}/theme.d.ts +0 -0
  179. /package/types/Menu/{styles.d.ts → v1/styles.d.ts} +0 -0
  180. /package/types/Menu/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,66 @@
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
+ menuItemGroup: {
44
+ label: 'menuItemGroup',
45
+ display: 'block'
46
+ },
47
+ label: {
48
+ label: 'menuItemGroup__label',
49
+ background: componentTheme.background,
50
+ padding: `${componentTheme.paddingVertical} ${componentTheme.paddingHorizontal}`,
51
+ display: 'block',
52
+ fontSize: componentTheme.fontSize,
53
+ fontFamily: componentTheme.fontFamily,
54
+ fontWeight: componentTheme.fontWeight,
55
+ color: componentTheme.color,
56
+ textAlign: 'start'
57
+ },
58
+ items: {
59
+ label: 'menuItemGroup__items',
60
+ padding: '0',
61
+ margin: '0 0 0 0',
62
+ listStyleType: 'none'
63
+ }
64
+ };
65
+ };
66
+ var _default = exports.default = generateStyle;
@@ -0,0 +1,75 @@
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.MenuItemSeparator = void 0;
8
+ var _react = require("react");
9
+ var _emotion = require("@instructure/emotion");
10
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
+ var _styles = _interopRequireDefault(require("./styles"));
12
+ var _props = require("./props");
13
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
+ var _dec, _class, _MenuItemSeparator;
15
+ /*
16
+ * The MIT License (MIT)
17
+ *
18
+ * Copyright (c) 2015 - present Instructure, Inc.
19
+ *
20
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
21
+ * of this software and associated documentation files (the "Software"), to deal
22
+ * in the Software without restriction, including without limitation the rights
23
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24
+ * copies of the Software, and to permit persons to whom the Software is
25
+ * furnished to do so, subject to the following conditions:
26
+ *
27
+ * The above copyright notice and this permission notice shall be included in all
28
+ * copies or substantial portions of the Software.
29
+ *
30
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
+ * SOFTWARE.
37
+ */
38
+ /**
39
+ ---
40
+ parent: Menu
41
+ id: Menu.Separator
42
+ ---
43
+ @module MenuItemSeparator
44
+ **/
45
+ let MenuItemSeparator = exports.MenuItemSeparator = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_MenuItemSeparator = class MenuItemSeparator extends _react.Component {
46
+ constructor(...args) {
47
+ super(...args);
48
+ this.ref = null;
49
+ this.handleRef = el => {
50
+ this.ref = el;
51
+ };
52
+ }
53
+ componentDidMount() {
54
+ var _this$props$makeStyle, _this$props;
55
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
56
+ }
57
+ componentDidUpdate() {
58
+ var _this$props$makeStyle2, _this$props2;
59
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
60
+ }
61
+ render() {
62
+ var _this$props$styles;
63
+ const props = (0, _omitProps.omitProps)(this.props, MenuItemSeparator.allowedProps);
64
+ // role="separator" would fit better here, but it causes NVDA to stop the
65
+ // MenuItem count after it
66
+ return (0, _jsxRuntime.jsx)("div", {
67
+ ...props,
68
+ role: "presentation",
69
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.menuItemSeparator,
70
+ ref: this.handleRef,
71
+ "data-cid": "MenuItemSeparator"
72
+ });
73
+ }
74
+ }, _MenuItemSeparator.displayName = "MenuItemSeparator", _MenuItemSeparator.componentId = 'Menu.Separator', _MenuItemSeparator.allowedProps = _props.allowedProps, _MenuItemSeparator)) || _class);
75
+ var _default = exports.default = MenuItemSeparator;
@@ -0,0 +1,34 @@
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
+ // keeping here to keep the structure of props.ts
32
+ // eslint-disable-next-line
33
+
34
+ const allowedProps = exports.allowedProps = [];
@@ -0,0 +1,52 @@
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
+ menuItemSeparator: {
44
+ label: 'menuItemSeparator',
45
+ height: componentTheme.height,
46
+ margin: `${componentTheme.marginVertical} ${componentTheme.marginHorizontal}`,
47
+ overflow: 'hidden',
48
+ background: componentTheme.background
49
+ }
50
+ };
51
+ };
52
+ var _default = exports.default = generateStyle;
@@ -26,19 +26,18 @@ Object.defineProperty(exports, "MenuItemSeparator", {
26
26
  exports.default = void 0;
27
27
  var _react = require("react");
28
28
  var _keycode = _interopRequireDefault(require("keycode"));
29
- var _Popover = require("@instructure/ui-popover/lib/Popover");
29
+ var _latest = require("@instructure/ui-popover/latest");
30
30
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
31
31
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
32
32
  var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
33
33
  var _console = require("@instructure/console");
34
34
  var _containsActiveElement = require("@instructure/ui-dom-utils/lib/containsActiveElement.js");
35
- var _MenuContext = require("../MenuContext");
35
+ var _MenuContext = require("../../utils/v1/MenuContext");
36
36
  var _MenuItem = require("./MenuItem");
37
37
  var _MenuItemGroup = require("./MenuItemGroup");
38
38
  var _MenuItemSeparator = require("./MenuItemSeparator");
39
39
  var _emotion = require("@instructure/emotion");
40
40
  var _styles = _interopRequireDefault(require("./styles"));
41
- var _theme = _interopRequireDefault(require("./theme"));
42
41
  var _props = require("./props");
43
42
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
44
43
  var _dec, _dec2, _class, _Menu;
@@ -70,7 +69,7 @@ var _dec, _dec2, _class, _Menu;
70
69
  category: components
71
70
  ---
72
71
  **/
73
- let Menu = exports.Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_Menu = class Menu extends _react.Component {
72
+ let Menu = exports.Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = (_Menu = class Menu extends _react.Component {
74
73
  constructor(props) {
75
74
  super(props);
76
75
  this.state = {
@@ -364,7 +363,7 @@ let Menu = exports.Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(
364
363
  positionContainerDisplay = _this$props5.positionContainerDisplay,
365
364
  offsetX = _this$props5.offsetX,
366
365
  offsetY = _this$props5.offsetY;
367
- return trigger ? (0, _jsxRuntime.jsx)(_Popover.Popover, {
366
+ return trigger ? (0, _jsxRuntime.jsx)(_latest.Popover, {
368
367
  "data-cid": "Menu",
369
368
  isShowingContent: show,
370
369
  defaultIsShowingContent: defaultShow,
@@ -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', 'label', 'disabled', 'trigger', 'placement', 'defaultShow', 'show', 'onToggle', 'onSelect', 'onDismiss', 'onFocus', 'onMouseOver', 'onKeyDown', 'onKeyUp', 'menuRef', 'popoverRef', 'mountNode', 'constrain', 'shouldHideOnSelect', 'shouldFocusTriggerOnClose', 'positionContainerDisplay', 'type', 'id', 'withArrow', 'offsetX', 'offsetY', 'maxHeight', 'renderLabelInfo'];
@@ -0,0 +1,66 @@
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 {Object} componentTheme The theme variable object.
38
+ * @param {Object} props the props of the component, the style is applied to
39
+ * @param {Object} state the state of the component, the style is applied to
40
+ * @return {Object} The final style object, which will be used in the component
41
+ */
42
+ const generateStyle = (componentTheme, props, sharedTokens) => {
43
+ const maxHeight = props.maxHeight ? {
44
+ maxHeight: props.maxHeight,
45
+ overflow: 'auto'
46
+ } : {};
47
+ return {
48
+ menu: {
49
+ label: 'menu',
50
+ minWidth: componentTheme.minWidth,
51
+ maxWidth: componentTheme.maxWidth,
52
+ listStyleType: 'none',
53
+ margin: '0',
54
+ padding: '0.25rem 0',
55
+ // TODO-rework
56
+ //background: componentTheme.background,
57
+ //borderRadius: componentTheme.borderRadius,
58
+ display: 'block',
59
+ position: 'relative',
60
+ overflow: 'hidden',
61
+ ...maxHeight,
62
+ ...(0, _emotion.calcFocusOutlineStyles)(sharedTokens.focusOutline)
63
+ }
64
+ };
65
+ };
66
+ var _default = exports.default = generateStyle;
@@ -6,25 +6,25 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "Menu", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _Menu.Menu;
9
+ return _v.Menu;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "MenuItem", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _Menu.MenuItem;
15
+ return _v.MenuItem;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "MenuItemGroup", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _Menu.MenuItemGroup;
21
+ return _v.MenuItemGroup;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "MenuItemSeparator", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _Menu.MenuItemSeparator;
27
+ return _v.MenuItemSeparator;
28
28
  }
29
29
  });
30
- var _Menu = require("./Menu");
30
+ var _v = require("../Menu/v1");
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Menu", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _v.Menu;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "MenuItem", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _v.MenuItem;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "MenuItemGroup", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _v.MenuItemGroup;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "MenuItemSeparator", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _v.MenuItemSeparator;
28
+ }
29
+ });
30
+ var _v = require("../Menu/v2");
@@ -36,6 +36,7 @@ private: true
36
36
  @module MenuContext
37
37
  **/
38
38
  const MenuContext = exports.MenuContext = /*#__PURE__*/(0, _react.createContext)({
39
+ // This is actually a `MenuItem`, but we dont want to version this one
39
40
  registerMenuItem: _value => {},
40
41
  removeMenuItem: _value => {}
41
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-menu",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-snapshot-129",
4
4
  "description": "A dropdown menu component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -16,27 +16,27 @@
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
18
  "keycode": "^2",
19
- "@instructure/console": "11.6.0",
20
- "@instructure/emotion": "11.6.0",
21
- "@instructure/shared-types": "11.6.0",
22
- "@instructure/ui-dom-utils": "11.6.0",
23
- "@instructure/ui-a11y-utils": "11.6.0",
24
- "@instructure/ui-icons": "11.6.0",
25
- "@instructure/ui-react-utils": "11.6.0",
26
- "@instructure/ui-utils": "11.6.0",
27
- "@instructure/ui-view": "11.6.0",
28
- "@instructure/ui-popover": "11.6.0",
29
- "@instructure/ui-position": "11.6.0"
19
+ "@instructure/emotion": "11.6.1-snapshot-129",
20
+ "@instructure/shared-types": "11.6.1-snapshot-129",
21
+ "@instructure/ui-dom-utils": "11.6.1-snapshot-129",
22
+ "@instructure/console": "11.6.1-snapshot-129",
23
+ "@instructure/ui-a11y-utils": "11.6.1-snapshot-129",
24
+ "@instructure/ui-popover": "11.6.1-snapshot-129",
25
+ "@instructure/ui-react-utils": "11.6.1-snapshot-129",
26
+ "@instructure/ui-position": "11.6.1-snapshot-129",
27
+ "@instructure/ui-utils": "11.6.1-snapshot-129",
28
+ "@instructure/ui-icons": "11.6.1-snapshot-129",
29
+ "@instructure/ui-view": "11.6.1-snapshot-129"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@testing-library/jest-dom": "^6.6.3",
33
33
  "@testing-library/react": "15.0.7",
34
34
  "@testing-library/user-event": "^14.6.1",
35
35
  "vitest": "^3.2.2",
36
- "@instructure/ui-axe-check": "11.6.0",
37
- "@instructure/ui-color-utils": "11.6.0",
38
- "@instructure/ui-babel-preset": "11.6.0",
39
- "@instructure/ui-themes": "11.6.0"
36
+ "@instructure/ui-axe-check": "11.6.1-snapshot-129",
37
+ "@instructure/ui-color-utils": "11.6.1-snapshot-129",
38
+ "@instructure/ui-babel-preset": "11.6.1-snapshot-129",
39
+ "@instructure/ui-themes": "11.6.1-snapshot-129"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=18 <=19"
@@ -46,17 +46,39 @@
46
46
  },
47
47
  "sideEffects": false,
48
48
  "exports": {
49
- ".": {
50
- "types": "./types/index.d.ts",
51
- "import": "./es/index.js",
52
- "require": "./lib/index.js",
53
- "default": "./es/index.js"
54
- },
55
49
  "./lib/*": "./lib/*",
56
50
  "./es/*": "./es/*",
57
51
  "./types/*": "./types/*",
58
52
  "./package.json": "./package.json",
59
- "./src/*": "./src/*"
53
+ "./src/*": "./src/*",
54
+ ".": {
55
+ "src": "./src/exports/a.ts",
56
+ "types": "./types/exports/a.d.ts",
57
+ "import": "./es/exports/a.js",
58
+ "require": "./lib/exports/a.js",
59
+ "default": "./es/exports/a.js"
60
+ },
61
+ "./v11_6": {
62
+ "src": "./src/exports/a.ts",
63
+ "types": "./types/exports/a.d.ts",
64
+ "import": "./es/exports/a.js",
65
+ "require": "./lib/exports/a.js",
66
+ "default": "./es/exports/a.js"
67
+ },
68
+ "./v11_7": {
69
+ "src": "./src/exports/b.ts",
70
+ "types": "./types/exports/b.d.ts",
71
+ "import": "./es/exports/b.js",
72
+ "require": "./lib/exports/b.js",
73
+ "default": "./es/exports/b.js"
74
+ },
75
+ "./latest": {
76
+ "src": "./src/exports/b.ts",
77
+ "types": "./types/exports/b.d.ts",
78
+ "import": "./es/exports/b.js",
79
+ "require": "./lib/exports/b.js",
80
+ "default": "./es/exports/b.js"
81
+ }
60
82
  },
61
83
  "scripts": {
62
84
  "lint": "ui-scripts lint",
@@ -34,9 +34,9 @@ import {
34
34
  } from '@instructure/ui-react-utils'
35
35
  import { createChainedFunction } from '@instructure/ui-utils'
36
36
  import { isActiveElement, findDOMNode } from '@instructure/ui-dom-utils'
37
- import { withStyle } from '@instructure/emotion'
37
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
38
38
 
39
- import { MenuContext } from '../../MenuContext'
39
+ import { MenuContext } from '../../../utils/v1/MenuContext'
40
40
 
41
41
  import generateStyle from './styles'
42
42
  import generateComponentTheme from './theme'
@@ -24,7 +24,7 @@
24
24
 
25
25
  import { ComponentElement, Children, Component } from 'react'
26
26
 
27
- import { withStyle } from '@instructure/emotion'
27
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
28
28
  import {
29
29
  omitProps,
30
30
  safeCloneElement,
@@ -24,7 +24,7 @@
24
24
 
25
25
  import { Component } from 'react'
26
26
 
27
- import { withStyle } from '@instructure/emotion'
27
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
29
 
30
30
  import generateStyle from './styles'
@@ -25,7 +25,7 @@
25
25
  import { ComponentElement, Children, Component, ReactElement } from 'react'
26
26
  import keycode from 'keycode'
27
27
 
28
- import { Popover } from '@instructure/ui-popover'
28
+ import { Popover } from '@instructure/ui-popover/v11_6'
29
29
  import {
30
30
  safeCloneElement,
31
31
  matchComponentTypes,
@@ -34,14 +34,14 @@ import {
34
34
  import { logError as error } from '@instructure/console'
35
35
  import { containsActiveElement } from '@instructure/ui-dom-utils'
36
36
 
37
- import { MenuContext } from '../MenuContext'
37
+ import { MenuContext } from '../../utils/v1/MenuContext'
38
38
  import { MenuItem } from './MenuItem'
39
39
  import type { MenuItemProps } from './MenuItem/props'
40
40
  import { MenuItemGroup } from './MenuItemGroup'
41
41
  import type { MenuGroupProps } from './MenuItemGroup/props'
42
42
  import { MenuItemSeparator } from './MenuItemSeparator'
43
43
  import type { MenuSeparatorProps } from './MenuItemSeparator/props'
44
- import { withStyle } from '@instructure/emotion'
44
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
45
45
 
46
46
  import generateStyle from './styles'
47
47
  import generateComponentTheme from './theme'
@@ -31,7 +31,7 @@ import type {
31
31
  PositionConstraint,
32
32
  PositionMountNode
33
33
  } from '@instructure/ui-position'
34
- import type { Popover } from '@instructure/ui-popover'
34
+ import type { Popover } from '@instructure/ui-popover/v11_6'
35
35
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
36
36
 
37
37
  import { MenuItem } from './MenuItem'