carbon-react 110.2.4 → 110.3.0
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/esm/__internal__/sticky-footer/index.d.ts +1 -0
- package/esm/__internal__/sticky-footer/sticky-footer.component.d.ts +15 -0
- package/esm/__internal__/sticky-footer/sticky-footer.style.d.ts +2 -0
- package/esm/__spec_helper__/mock-resize-observer.d.ts +1 -1
- package/esm/__spec_helper__/mock-resize-observer.js +2 -2
- package/esm/components/drawer/drawer.component.d.ts +37 -0
- package/esm/components/drawer/drawer.component.js +43 -54
- package/esm/components/drawer/drawer.style.d.ts +27 -0
- package/esm/components/drawer/drawer.style.js +2 -2
- package/esm/components/drawer/index.d.ts +2 -1
- package/esm/components/drawer/index.js +1 -2
- package/esm/components/menu/__internal__/submenu/submenu.component.js +22 -4
- package/esm/components/menu/menu-item/menu-item.component.js +6 -1
- package/esm/components/menu/menu-item/menu-item.d.ts +4 -0
- package/esm/components/menu/menu-item/menu-item.style.js +158 -149
- package/esm/components/menu/scrollable-block/scrollable-block.component.js +21 -5
- package/esm/components/menu/scrollable-block/scrollable-block.d.ts +6 -0
- package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -0
- package/esm/components/tabs/tab/tab.style.d.ts +2 -0
- package/esm/components/tabs/tabs.style.d.ts +2 -0
- package/lib/__internal__/sticky-footer/index.d.ts +1 -0
- package/lib/__internal__/sticky-footer/sticky-footer.component.d.ts +15 -0
- package/lib/__internal__/sticky-footer/sticky-footer.style.d.ts +2 -0
- package/lib/__spec_helper__/mock-resize-observer.d.ts +1 -1
- package/lib/__spec_helper__/mock-resize-observer.js +2 -2
- package/lib/components/drawer/drawer.component.d.ts +37 -0
- package/lib/components/drawer/drawer.component.js +43 -55
- package/lib/components/drawer/drawer.style.d.ts +27 -0
- package/lib/components/drawer/drawer.style.js +3 -3
- package/lib/components/drawer/index.d.ts +2 -1
- package/lib/components/menu/__internal__/submenu/submenu.component.js +23 -4
- package/lib/components/menu/menu-item/menu-item.component.js +6 -1
- package/lib/components/menu/menu-item/menu-item.d.ts +4 -0
- package/lib/components/menu/menu-item/menu-item.style.js +158 -149
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +22 -5
- package/lib/components/menu/scrollable-block/scrollable-block.d.ts +6 -0
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +6 -0
- package/lib/components/tabs/tab/tab.style.d.ts +2 -0
- package/lib/components/tabs/tabs.style.d.ts +2 -0
- package/package.json +1 -1
- package/esm/components/drawer/drawer.d.ts +0 -44
- package/lib/components/drawer/drawer.d.ts +0 -44
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./sticky-footer.component";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default StickyFooter;
|
|
2
|
+
declare function StickyFooter({ children, containerRef, disableSticky, ...rest }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
children: any;
|
|
5
|
+
containerRef: any;
|
|
6
|
+
disableSticky: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare namespace StickyFooter {
|
|
9
|
+
namespace propTypes {
|
|
10
|
+
const children: PropTypes.Validator<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
11
|
+
const containerRef: PropTypes.Validator<any>;
|
|
12
|
+
const disableSticky: PropTypes.Requireable<boolean>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import PropTypes from "prop-types";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const setupResizeObserverMock = () => {
|
|
2
|
-
if (!
|
|
2
|
+
if (!window) {
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(() => ({
|
|
7
7
|
disconnect: jest.fn(),
|
|
8
8
|
observe: jest.fn(),
|
|
9
9
|
unobserve: jest.fn()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DrawerSidebarContextProps {
|
|
3
|
+
isInSidebar: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface DrawerProps {
|
|
6
|
+
/** Duration of a animation */
|
|
7
|
+
animationDuration?: string;
|
|
8
|
+
/** Specify an aria-label for the Drawer component */
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
/** Sets color of sidebar's background */
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Set the default state of expansion of the Drawer if component is meant to be used as uncontrolled */
|
|
14
|
+
defaultExpanded?: boolean;
|
|
15
|
+
/** Sets the expansion state of the Drawer if component is meant to be used as controlled */
|
|
16
|
+
expanded?: boolean;
|
|
17
|
+
expandedWidth?: string;
|
|
18
|
+
/** Sets custom height to Drawer component */
|
|
19
|
+
height?: string;
|
|
20
|
+
/** Callback fired when expansion state changes, onChange(event: object, isExpanded: boolean) */
|
|
21
|
+
onChange?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, isExpanded: boolean) => void;
|
|
22
|
+
sidebar?: React.ReactNode;
|
|
23
|
+
/** Enables expand/collapse button that controls drawer */
|
|
24
|
+
showControls?: boolean;
|
|
25
|
+
/** Sets the heading of the drawer */
|
|
26
|
+
title?: React.ReactNode;
|
|
27
|
+
/** Content to display inside of a footer */
|
|
28
|
+
footer?: React.ReactNode;
|
|
29
|
+
/** Makes the header of the drawer sticky. Title prop must also be set. */
|
|
30
|
+
stickyHeader?: boolean;
|
|
31
|
+
/** Makes the footer of the drawer sticky. Footer prop must also be set. */
|
|
32
|
+
stickyFooter?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const DrawerSidebarContext: React.Context<{}>;
|
|
35
|
+
export declare const Drawer: ({ defaultExpanded, expanded, onChange, children, expandedWidth, sidebar, animationDuration, backgroundColor, title, footer, showControls, height, stickyHeader, stickyFooter, ...rest }: DrawerProps) => JSX.Element;
|
|
36
|
+
export { DrawerSidebarContext };
|
|
37
|
+
export default Drawer;
|
|
@@ -2,12 +2,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useCallback, useRef, useEffect } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import classNames from "classnames";
|
|
6
5
|
import invariant from "invariant";
|
|
7
6
|
import createGuid from "../../__internal__/utils/helpers/guid";
|
|
8
7
|
import usePrevious from "../../hooks/__internal__/usePrevious";
|
|
9
8
|
import Icon from "../icon";
|
|
10
|
-
import { StyledSidebarHeader, StyledDrawerWrapper, StyledDrawerContent,
|
|
9
|
+
import { StyledSidebarHeader, StyledDrawerWrapper, StyledDrawerContent, StyledSidebarToggleButton, StyledDrawerChildren, StyledDrawerSidebar, StyledSidebarTitle } from "./drawer.style";
|
|
11
10
|
import StickyFooter from "../../__internal__/sticky-footer";
|
|
12
11
|
const DrawerSidebarContext = /*#__PURE__*/React.createContext({});
|
|
13
12
|
|
|
@@ -28,17 +27,17 @@ const Drawer = ({
|
|
|
28
27
|
stickyFooter,
|
|
29
28
|
...rest
|
|
30
29
|
}) => {
|
|
31
|
-
const drawerSidebarContentRef = useRef();
|
|
32
|
-
const scrollableContentRef = useRef();
|
|
30
|
+
const drawerSidebarContentRef = useRef(null);
|
|
31
|
+
const scrollableContentRef = useRef(null);
|
|
33
32
|
const isControlled = useRef(expanded !== undefined);
|
|
34
33
|
const [isOpening, setIsOpening] = useState(false);
|
|
35
34
|
const [isClosing, setIsClosing] = useState(false);
|
|
36
35
|
const [isExpanded, setIsExpanded] = useState(isControlled.current ? expanded : defaultExpanded);
|
|
37
|
-
const timer = useRef();
|
|
36
|
+
const timer = useRef(null);
|
|
38
37
|
const getAnimationDuration = useCallback(() => {
|
|
39
38
|
if (animationDuration.indexOf("ms") !== -1) {
|
|
40
39
|
const animationTime = animationDuration.substring(0, animationDuration.length - 2);
|
|
41
|
-
return animationTime;
|
|
40
|
+
return parseInt(animationTime);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
if (animationDuration.indexOf(".") !== -1 || animationDuration.indexOf("s") !== -1) {
|
|
@@ -46,11 +45,14 @@ const Drawer = ({
|
|
|
46
45
|
return parseFloat(animationTime) * 1000;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
return animationDuration;
|
|
48
|
+
return parseInt(animationDuration);
|
|
50
49
|
}, [animationDuration]);
|
|
51
50
|
const toggleAnimation = useCallback(() => {
|
|
52
51
|
const timeout = getAnimationDuration();
|
|
53
|
-
|
|
52
|
+
|
|
53
|
+
if (timer.current) {
|
|
54
|
+
clearTimeout(timer.current);
|
|
55
|
+
}
|
|
54
56
|
|
|
55
57
|
if (!isExpanded) {
|
|
56
58
|
setIsClosing(false);
|
|
@@ -81,14 +83,16 @@ const Drawer = ({
|
|
|
81
83
|
}, [expanded, toggleAnimation, previousValue, showControls]);
|
|
82
84
|
useEffect(() => {
|
|
83
85
|
return function cleanup() {
|
|
84
|
-
|
|
86
|
+
if (timer.current) {
|
|
87
|
+
clearTimeout(timer.current);
|
|
88
|
+
}
|
|
85
89
|
};
|
|
86
90
|
}, []);
|
|
87
91
|
const toggleDrawer = useCallback(ev => {
|
|
88
92
|
setIsExpanded(!isExpanded);
|
|
89
93
|
if (onChange) onChange(ev, !isExpanded);
|
|
90
94
|
|
|
91
|
-
if (isExpanded) {
|
|
95
|
+
if (isExpanded && drawerSidebarContentRef.current) {
|
|
92
96
|
drawerSidebarContentRef.current.scrollTop = 0;
|
|
93
97
|
}
|
|
94
98
|
|
|
@@ -97,20 +101,29 @@ const Drawer = ({
|
|
|
97
101
|
const guid = useRef(createGuid());
|
|
98
102
|
const sidebarId = `DrawerSidebar_${guid.current}`;
|
|
99
103
|
const getClassNames = useCallback(() => {
|
|
100
|
-
|
|
104
|
+
const classes = [isExpanded ? "open" : "closed"];
|
|
105
|
+
|
|
106
|
+
if (isOpening) {
|
|
107
|
+
classes.push("opening");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (isClosing) {
|
|
111
|
+
classes.push("closing");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return classes.join(" ");
|
|
101
115
|
}, [isExpanded, isOpening, isClosing]);
|
|
102
116
|
|
|
103
117
|
const getControls = () => {
|
|
104
118
|
if (showControls === undefined) return null;
|
|
105
|
-
return /*#__PURE__*/React.createElement(
|
|
119
|
+
return /*#__PURE__*/React.createElement(StyledSidebarToggleButton, {
|
|
106
120
|
"aria-label": "toggle sidebar",
|
|
107
121
|
"aria-expanded": isExpanded,
|
|
108
122
|
"aria-controls": sidebarId,
|
|
109
123
|
"data-element": "drawer-toggle",
|
|
110
124
|
onClick: toggleDrawer,
|
|
111
125
|
isExpanded: isExpanded,
|
|
112
|
-
animationDuration: animationDuration
|
|
113
|
-
stickyHeader: stickyHeader
|
|
126
|
+
animationDuration: animationDuration
|
|
114
127
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
115
128
|
type: "chevron_right"
|
|
116
129
|
}));
|
|
@@ -147,46 +160,22 @@ const Drawer = ({
|
|
|
147
160
|
};
|
|
148
161
|
|
|
149
162
|
Drawer.propTypes = {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
onChange: PropTypes.func,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
expandedWidth: PropTypes.string,
|
|
166
|
-
|
|
167
|
-
/** Duration of a animation */
|
|
168
|
-
animationDuration: PropTypes.string,
|
|
169
|
-
|
|
170
|
-
/** Sets color of sidebar's background */
|
|
171
|
-
backgroundColor: PropTypes.string,
|
|
172
|
-
|
|
173
|
-
/** Sets custom height to Drawer component */
|
|
174
|
-
height: PropTypes.string,
|
|
175
|
-
|
|
176
|
-
/** Sets the heading of the drawer */
|
|
177
|
-
title: PropTypes.node,
|
|
178
|
-
|
|
179
|
-
/** Enables expand/collapse button that controls drawer */
|
|
180
|
-
showControls: PropTypes.bool,
|
|
181
|
-
|
|
182
|
-
/** Content to display inside of a footer */
|
|
183
|
-
footer: PropTypes.node,
|
|
184
|
-
|
|
185
|
-
/** Makes the header of the drawer sticky. Title prop must also be set. */
|
|
186
|
-
stickyHeader: PropTypes.bool,
|
|
187
|
-
|
|
188
|
-
/** Makes the footer of the drawer sticky. Footer prop must also be set. */
|
|
189
|
-
stickyFooter: PropTypes.bool
|
|
163
|
+
"animationDuration": PropTypes.string,
|
|
164
|
+
"aria-label": PropTypes.string,
|
|
165
|
+
"backgroundColor": PropTypes.string,
|
|
166
|
+
"children": PropTypes.node,
|
|
167
|
+
"defaultExpanded": PropTypes.bool,
|
|
168
|
+
"expanded": PropTypes.bool,
|
|
169
|
+
"expandedWidth": PropTypes.string,
|
|
170
|
+
"footer": PropTypes.node,
|
|
171
|
+
"height": PropTypes.string,
|
|
172
|
+
"onChange": PropTypes.func,
|
|
173
|
+
"showControls": PropTypes.bool,
|
|
174
|
+
"sidebar": PropTypes.node,
|
|
175
|
+
"stickyFooter": PropTypes.bool,
|
|
176
|
+
"stickyHeader": PropTypes.bool,
|
|
177
|
+
"title": PropTypes.node
|
|
190
178
|
};
|
|
179
|
+
export { Drawer };
|
|
191
180
|
export { DrawerSidebarContext };
|
|
192
181
|
export default Drawer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const StyledSidebarHeader: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isExpanded?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
declare const StyledSidebarTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
declare const StyledDrawerChildren: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
interface StyledDrawerSidebarProps {
|
|
7
|
+
isExpanded?: boolean;
|
|
8
|
+
hasControls: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const StyledDrawerSidebar: import("styled-components").StyledComponent<"div", any, import("../box").BoxProps & StyledDrawerSidebarProps, never>;
|
|
11
|
+
interface StyledDrawerContentProps {
|
|
12
|
+
animationDuration?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
expandedWidth: string;
|
|
15
|
+
}
|
|
16
|
+
declare const StyledDrawerContent: import("styled-components").StyledComponent<"div", any, StyledDrawerContentProps, never>;
|
|
17
|
+
interface StyledSidebarToggleButtonProps {
|
|
18
|
+
animationDuration?: string;
|
|
19
|
+
isExpanded?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const StyledSidebarToggleButton: import("styled-components").StyledComponent<"button", any, {
|
|
22
|
+
type: "button";
|
|
23
|
+
} & StyledSidebarToggleButtonProps, "type">;
|
|
24
|
+
declare const StyledDrawerWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
25
|
+
height: string;
|
|
26
|
+
}, never>;
|
|
27
|
+
export { StyledSidebarHeader, StyledDrawerWrapper, StyledDrawerContent, StyledDrawerChildren, StyledDrawerSidebar, StyledSidebarTitle, StyledSidebarToggleButton, };
|
|
@@ -165,7 +165,7 @@ const StyledDrawerContent = styled.div`
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
`;
|
|
168
|
-
const
|
|
168
|
+
const StyledSidebarToggleButton = styled.button.attrs({
|
|
169
169
|
type: "button"
|
|
170
170
|
})`
|
|
171
171
|
${({
|
|
@@ -207,4 +207,4 @@ const StyledDrawerWrapper = styled.div`
|
|
|
207
207
|
height
|
|
208
208
|
}) => height};
|
|
209
209
|
`;
|
|
210
|
-
export { StyledSidebarHeader, StyledDrawerWrapper, StyledDrawerContent, StyledDrawerChildren, StyledDrawerSidebar, StyledSidebarTitle,
|
|
210
|
+
export { StyledSidebarHeader, StyledDrawerWrapper, StyledDrawerContent, StyledDrawerChildren, StyledDrawerSidebar, StyledSidebarTitle, StyledSidebarToggleButton };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default, DrawerSidebarContext } from "./drawer";
|
|
1
|
+
export { default, DrawerSidebarContext } from "./drawer.component";
|
|
2
|
+
export type { DrawerSidebarContextProps, DrawerProps, } from "./drawer.component";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default } from "./drawer.component";
|
|
2
|
-
export { DrawerSidebarContext } from "./drawer.component";
|
|
1
|
+
export { default, DrawerSidebarContext } from "./drawer.component";
|
|
@@ -41,13 +41,31 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
41
41
|
const [characterString, setCharacterString] = useState("");
|
|
42
42
|
const formattedChildren = React.Children.map(children, child => {
|
|
43
43
|
if (child.type === ScrollableBlock) {
|
|
44
|
-
|
|
44
|
+
const blockChildren = [...child.props.children];
|
|
45
|
+
|
|
46
|
+
if (child.props.parent) {
|
|
47
|
+
blockChildren.unshift( /*#__PURE__*/React.createElement(MenuItem, null, child.props.parent));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return blockChildren;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
return child;
|
|
48
54
|
});
|
|
49
55
|
const arrayOfFormattedChildren = React.Children.toArray(formattedChildren);
|
|
50
56
|
const numberOfChildren = useMemo(() => React.Children.count(formattedChildren), [formattedChildren]);
|
|
57
|
+
const blockIndex = useMemo(() => {
|
|
58
|
+
var _childrenArray$index;
|
|
59
|
+
|
|
60
|
+
const childrenArray = React.Children.toArray(children);
|
|
61
|
+
let index = childrenArray.findIndex(item => item.type === ScrollableBlock);
|
|
62
|
+
|
|
63
|
+
if ((_childrenArray$index = childrenArray[index]) !== null && _childrenArray$index !== void 0 && _childrenArray$index.props.parent) {
|
|
64
|
+
index += 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return index;
|
|
68
|
+
}, [children]);
|
|
51
69
|
const characterTimer = useRef();
|
|
52
70
|
const startCharacterTimeout = useCallback(() => {
|
|
53
71
|
characterTimer.current = setTimeout(() => {
|
|
@@ -233,7 +251,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
233
251
|
isFocused: submenuFocusIndex === index,
|
|
234
252
|
focusIndex: submenuFocusIndex,
|
|
235
253
|
handleKeyDown,
|
|
236
|
-
blockIndex
|
|
254
|
+
blockIndex
|
|
237
255
|
}
|
|
238
256
|
}, child))));
|
|
239
257
|
}
|
|
@@ -266,13 +284,13 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
266
284
|
submenuDirection: submenuDirection,
|
|
267
285
|
variant: variant,
|
|
268
286
|
menuType: menuContext.menuType,
|
|
269
|
-
role: "list"
|
|
287
|
+
role: blockIndex === 0 ? "presentation" : "list"
|
|
270
288
|
}, React.Children.map(children, (child, index) => /*#__PURE__*/React.createElement(SubmenuContext.Provider, {
|
|
271
289
|
value: {
|
|
272
290
|
isFocused: !blockDoubleFocus && submenuFocusIndex === index,
|
|
273
291
|
focusIndex: submenuFocusIndex,
|
|
274
292
|
handleKeyDown,
|
|
275
|
-
blockIndex
|
|
293
|
+
blockIndex,
|
|
276
294
|
updateFocusIndex: setSubmenuFocusIndex,
|
|
277
295
|
itemIndex: child.type === MenuItem ? index : undefined
|
|
278
296
|
}
|
|
@@ -31,6 +31,7 @@ const MenuItem = ({
|
|
|
31
31
|
menuOpen,
|
|
32
32
|
onSubmenuOpen,
|
|
33
33
|
onSubmenuClose,
|
|
34
|
+
overrideColor,
|
|
34
35
|
...rest
|
|
35
36
|
}) => {
|
|
36
37
|
const menuContext = useContext(MenuContext);
|
|
@@ -95,6 +96,7 @@ const MenuItem = ({
|
|
|
95
96
|
selected,
|
|
96
97
|
variant,
|
|
97
98
|
onKeyDown: !inFullscreenView ? handleKeyDown : undefined,
|
|
99
|
+
overrideColor,
|
|
98
100
|
ref
|
|
99
101
|
};
|
|
100
102
|
const clonedChildren = isChildSearch.current ? childrenItems.map(child => /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -228,6 +230,9 @@ MenuItem.propTypes = {
|
|
|
228
230
|
onSubmenuOpen: PropTypes.func,
|
|
229
231
|
|
|
230
232
|
/** Callback triggered when submenu closes. Only valid with submenu prop */
|
|
231
|
-
onSubmenuClose: PropTypes.func
|
|
233
|
+
onSubmenuClose: PropTypes.func,
|
|
234
|
+
|
|
235
|
+
/** @ignore @private */
|
|
236
|
+
overrideColor: PropTypes.bool
|
|
232
237
|
};
|
|
233
238
|
export default MenuItem;
|
|
@@ -29,6 +29,10 @@ export interface MenuItemBaseProps extends LayoutProps, FlexboxProps {
|
|
|
29
29
|
onSubmenuOpen?: () => void;
|
|
30
30
|
/** Callback triggered when submenu closes. Only valid with submenu prop */
|
|
31
31
|
onSubmenuClose?: () => void;
|
|
32
|
+
/** @ignore @private
|
|
33
|
+
private prop, used inside ScrollableBlock to ensure the MenuItem's color variant overrides the CSS
|
|
34
|
+
for other MenuItems inside the block */
|
|
35
|
+
overrideColor?: boolean;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
export interface MenuWithChildren extends MenuItemBaseProps {
|