carbon-react 110.2.3 → 110.4.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__/radio-button-mapper/index.d.ts +2 -0
- package/esm/__internal__/radio-button-mapper/index.js +1 -0
- package/esm/__internal__/radio-button-mapper/radio-button-mapper.d.ts +21 -0
- 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/__internal__/utils/helpers/tags/index.d.ts +1 -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/button-toggle/button-toggle.component.d.ts +3 -3
- package/esm/components/button-toggle/button-toggle.component.js +21 -20
- package/esm/components/button-toggle/button-toggle.style.d.ts +1 -1
- package/esm/components/button-toggle-group/button-toggle-group.component.d.ts +45 -0
- package/esm/components/button-toggle-group/button-toggle-group.component.js +187 -92
- package/esm/components/button-toggle-group/button-toggle-group.style.d.ts +4 -0
- package/esm/components/button-toggle-group/button-toggle-group.style.js +2 -2
- package/esm/components/button-toggle-group/index.d.ts +2 -1
- package/esm/components/definition-list/dd.component.d.ts +4 -1
- package/esm/components/definition-list/dd.component.js +1 -0
- package/esm/components/definition-list/dl.component.d.ts +4 -1
- package/esm/components/definition-list/dl.component.js +1 -0
- package/esm/components/definition-list/dt.component.d.ts +4 -1
- package/esm/components/definition-list/dt.component.js +1 -0
- 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__/radio-button-mapper/index.d.ts +2 -0
- package/lib/{components/button-toggle-group/documentation → __internal__/radio-button-mapper}/index.js +2 -2
- package/lib/__internal__/radio-button-mapper/package.json +6 -0
- package/lib/__internal__/radio-button-mapper/radio-button-mapper.d.ts +21 -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/__internal__/utils/helpers/tags/index.d.ts +1 -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/button-toggle/button-toggle.component.d.ts +3 -3
- package/lib/components/button-toggle/button-toggle.component.js +22 -20
- package/lib/components/button-toggle/button-toggle.style.d.ts +1 -1
- package/lib/components/button-toggle-group/button-toggle-group.component.d.ts +45 -0
- package/lib/components/button-toggle-group/button-toggle-group.component.js +190 -93
- package/lib/components/button-toggle-group/button-toggle-group.style.d.ts +4 -0
- package/lib/components/button-toggle-group/button-toggle-group.style.js +2 -2
- package/lib/components/button-toggle-group/index.d.ts +2 -1
- package/lib/components/definition-list/dd.component.d.ts +4 -1
- package/lib/components/definition-list/dd.component.js +1 -0
- package/lib/components/definition-list/dl.component.d.ts +4 -1
- package/lib/components/definition-list/dl.component.js +1 -0
- package/lib/components/definition-list/dt.component.d.ts +4 -1
- package/lib/components/definition-list/dt.component.js +1 -0
- 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/button-toggle-group/__definition__.js +0 -38
- package/esm/components/button-toggle-group/button-toggle-group.d.ts +0 -58
- package/esm/components/button-toggle-group/documentation/index.js +0 -1
- package/esm/components/drawer/drawer.d.ts +0 -44
- package/lib/components/button-toggle-group/__definition__.js +0 -50
- package/lib/components/button-toggle-group/button-toggle-group.d.ts +0 -58
- package/lib/components/button-toggle-group/documentation/package.json +0 -6
- package/lib/components/drawer/drawer.d.ts +0 -44
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.DrawerSidebarContext = void 0;
|
|
6
|
+
exports.default = exports.DrawerSidebarContext = exports.Drawer = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
12
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
15
13
|
|
|
16
14
|
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
|
|
@@ -52,17 +50,17 @@ const Drawer = ({
|
|
|
52
50
|
stickyFooter,
|
|
53
51
|
...rest
|
|
54
52
|
}) => {
|
|
55
|
-
const drawerSidebarContentRef = (0, _react.useRef)();
|
|
56
|
-
const scrollableContentRef = (0, _react.useRef)();
|
|
53
|
+
const drawerSidebarContentRef = (0, _react.useRef)(null);
|
|
54
|
+
const scrollableContentRef = (0, _react.useRef)(null);
|
|
57
55
|
const isControlled = (0, _react.useRef)(expanded !== undefined);
|
|
58
56
|
const [isOpening, setIsOpening] = (0, _react.useState)(false);
|
|
59
57
|
const [isClosing, setIsClosing] = (0, _react.useState)(false);
|
|
60
58
|
const [isExpanded, setIsExpanded] = (0, _react.useState)(isControlled.current ? expanded : defaultExpanded);
|
|
61
|
-
const timer = (0, _react.useRef)();
|
|
59
|
+
const timer = (0, _react.useRef)(null);
|
|
62
60
|
const getAnimationDuration = (0, _react.useCallback)(() => {
|
|
63
61
|
if (animationDuration.indexOf("ms") !== -1) {
|
|
64
62
|
const animationTime = animationDuration.substring(0, animationDuration.length - 2);
|
|
65
|
-
return animationTime;
|
|
63
|
+
return parseInt(animationTime);
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
if (animationDuration.indexOf(".") !== -1 || animationDuration.indexOf("s") !== -1) {
|
|
@@ -70,11 +68,14 @@ const Drawer = ({
|
|
|
70
68
|
return parseFloat(animationTime) * 1000;
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
return animationDuration;
|
|
71
|
+
return parseInt(animationDuration);
|
|
74
72
|
}, [animationDuration]);
|
|
75
73
|
const toggleAnimation = (0, _react.useCallback)(() => {
|
|
76
74
|
const timeout = getAnimationDuration();
|
|
77
|
-
|
|
75
|
+
|
|
76
|
+
if (timer.current) {
|
|
77
|
+
clearTimeout(timer.current);
|
|
78
|
+
}
|
|
78
79
|
|
|
79
80
|
if (!isExpanded) {
|
|
80
81
|
setIsClosing(false);
|
|
@@ -105,14 +106,16 @@ const Drawer = ({
|
|
|
105
106
|
}, [expanded, toggleAnimation, previousValue, showControls]);
|
|
106
107
|
(0, _react.useEffect)(() => {
|
|
107
108
|
return function cleanup() {
|
|
108
|
-
|
|
109
|
+
if (timer.current) {
|
|
110
|
+
clearTimeout(timer.current);
|
|
111
|
+
}
|
|
109
112
|
};
|
|
110
113
|
}, []);
|
|
111
114
|
const toggleDrawer = (0, _react.useCallback)(ev => {
|
|
112
115
|
setIsExpanded(!isExpanded);
|
|
113
116
|
if (onChange) onChange(ev, !isExpanded);
|
|
114
117
|
|
|
115
|
-
if (isExpanded) {
|
|
118
|
+
if (isExpanded && drawerSidebarContentRef.current) {
|
|
116
119
|
drawerSidebarContentRef.current.scrollTop = 0;
|
|
117
120
|
}
|
|
118
121
|
|
|
@@ -121,20 +124,29 @@ const Drawer = ({
|
|
|
121
124
|
const guid = (0, _react.useRef)((0, _guid.default)());
|
|
122
125
|
const sidebarId = `DrawerSidebar_${guid.current}`;
|
|
123
126
|
const getClassNames = (0, _react.useCallback)(() => {
|
|
124
|
-
|
|
127
|
+
const classes = [isExpanded ? "open" : "closed"];
|
|
128
|
+
|
|
129
|
+
if (isOpening) {
|
|
130
|
+
classes.push("opening");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (isClosing) {
|
|
134
|
+
classes.push("closing");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return classes.join(" ");
|
|
125
138
|
}, [isExpanded, isOpening, isClosing]);
|
|
126
139
|
|
|
127
140
|
const getControls = () => {
|
|
128
141
|
if (showControls === undefined) return null;
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement(_drawer.
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_drawer.StyledSidebarToggleButton, {
|
|
130
143
|
"aria-label": "toggle sidebar",
|
|
131
144
|
"aria-expanded": isExpanded,
|
|
132
145
|
"aria-controls": sidebarId,
|
|
133
146
|
"data-element": "drawer-toggle",
|
|
134
147
|
onClick: toggleDrawer,
|
|
135
148
|
isExpanded: isExpanded,
|
|
136
|
-
animationDuration: animationDuration
|
|
137
|
-
stickyHeader: stickyHeader
|
|
149
|
+
animationDuration: animationDuration
|
|
138
150
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
139
151
|
type: "chevron_right"
|
|
140
152
|
}));
|
|
@@ -170,47 +182,23 @@ const Drawer = ({
|
|
|
170
182
|
}, footer))), /*#__PURE__*/_react.default.createElement(_drawer.StyledDrawerChildren, null, children));
|
|
171
183
|
};
|
|
172
184
|
|
|
185
|
+
exports.Drawer = Drawer;
|
|
173
186
|
Drawer.propTypes = {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
onChange: _propTypes.default.func,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
expandedWidth: _propTypes.default.string,
|
|
190
|
-
|
|
191
|
-
/** Duration of a animation */
|
|
192
|
-
animationDuration: _propTypes.default.string,
|
|
193
|
-
|
|
194
|
-
/** Sets color of sidebar's background */
|
|
195
|
-
backgroundColor: _propTypes.default.string,
|
|
196
|
-
|
|
197
|
-
/** Sets custom height to Drawer component */
|
|
198
|
-
height: _propTypes.default.string,
|
|
199
|
-
|
|
200
|
-
/** Sets the heading of the drawer */
|
|
201
|
-
title: _propTypes.default.node,
|
|
202
|
-
|
|
203
|
-
/** Enables expand/collapse button that controls drawer */
|
|
204
|
-
showControls: _propTypes.default.bool,
|
|
205
|
-
|
|
206
|
-
/** Content to display inside of a footer */
|
|
207
|
-
footer: _propTypes.default.node,
|
|
208
|
-
|
|
209
|
-
/** Makes the header of the drawer sticky. Title prop must also be set. */
|
|
210
|
-
stickyHeader: _propTypes.default.bool,
|
|
211
|
-
|
|
212
|
-
/** Makes the footer of the drawer sticky. Footer prop must also be set. */
|
|
213
|
-
stickyFooter: _propTypes.default.bool
|
|
187
|
+
"animationDuration": _propTypes.default.string,
|
|
188
|
+
"aria-label": _propTypes.default.string,
|
|
189
|
+
"backgroundColor": _propTypes.default.string,
|
|
190
|
+
"children": _propTypes.default.node,
|
|
191
|
+
"defaultExpanded": _propTypes.default.bool,
|
|
192
|
+
"expanded": _propTypes.default.bool,
|
|
193
|
+
"expandedWidth": _propTypes.default.string,
|
|
194
|
+
"footer": _propTypes.default.node,
|
|
195
|
+
"height": _propTypes.default.string,
|
|
196
|
+
"onChange": _propTypes.default.func,
|
|
197
|
+
"showControls": _propTypes.default.bool,
|
|
198
|
+
"sidebar": _propTypes.default.node,
|
|
199
|
+
"stickyFooter": _propTypes.default.bool,
|
|
200
|
+
"stickyHeader": _propTypes.default.bool,
|
|
201
|
+
"title": _propTypes.default.node
|
|
214
202
|
};
|
|
215
203
|
var _default = Drawer;
|
|
216
204
|
exports.default = _default;
|
|
@@ -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, };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.StyledSidebarToggleButton = exports.StyledSidebarTitle = exports.StyledDrawerSidebar = exports.StyledDrawerChildren = exports.StyledDrawerContent = exports.StyledDrawerWrapper = exports.StyledSidebarHeader = void 0;
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
@@ -187,7 +187,7 @@ const StyledDrawerContent = _styledComponents.default.div`
|
|
|
187
187
|
}
|
|
188
188
|
`;
|
|
189
189
|
exports.StyledDrawerContent = StyledDrawerContent;
|
|
190
|
-
const
|
|
190
|
+
const StyledSidebarToggleButton = _styledComponents.default.button.attrs({
|
|
191
191
|
type: "button"
|
|
192
192
|
})`
|
|
193
193
|
${({
|
|
@@ -223,7 +223,7 @@ const StyledButton = _styledComponents.default.button.attrs({
|
|
|
223
223
|
`}
|
|
224
224
|
`}
|
|
225
225
|
`;
|
|
226
|
-
exports.
|
|
226
|
+
exports.StyledSidebarToggleButton = StyledSidebarToggleButton;
|
|
227
227
|
const StyledDrawerWrapper = _styledComponents.default.div`
|
|
228
228
|
display: flex;
|
|
229
229
|
height: ${({
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default, DrawerSidebarContext } from "./drawer";
|
|
1
|
+
export { default, DrawerSidebarContext } from "./drawer.component";
|
|
2
|
+
export type { DrawerSidebarContextProps, DrawerProps, } from "./drawer.component";
|
|
@@ -66,7 +66,13 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
66
66
|
|
|
67
67
|
const formattedChildren = _react.default.Children.map(children, child => {
|
|
68
68
|
if (child.type === _scrollableBlock.default) {
|
|
69
|
-
|
|
69
|
+
const blockChildren = [...child.props.children];
|
|
70
|
+
|
|
71
|
+
if (child.props.parent) {
|
|
72
|
+
blockChildren.unshift( /*#__PURE__*/_react.default.createElement(_menuItem2.default, null, child.props.parent));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return blockChildren;
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
return child;
|
|
@@ -75,6 +81,19 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
75
81
|
const arrayOfFormattedChildren = _react.default.Children.toArray(formattedChildren);
|
|
76
82
|
|
|
77
83
|
const numberOfChildren = (0, _react.useMemo)(() => _react.default.Children.count(formattedChildren), [formattedChildren]);
|
|
84
|
+
const blockIndex = (0, _react.useMemo)(() => {
|
|
85
|
+
var _childrenArray$index;
|
|
86
|
+
|
|
87
|
+
const childrenArray = _react.default.Children.toArray(children);
|
|
88
|
+
|
|
89
|
+
let index = childrenArray.findIndex(item => item.type === _scrollableBlock.default);
|
|
90
|
+
|
|
91
|
+
if ((_childrenArray$index = childrenArray[index]) !== null && _childrenArray$index !== void 0 && _childrenArray$index.props.parent) {
|
|
92
|
+
index += 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return index;
|
|
96
|
+
}, [children]);
|
|
78
97
|
const characterTimer = (0, _react.useRef)();
|
|
79
98
|
const startCharacterTimeout = (0, _react.useCallback)(() => {
|
|
80
99
|
characterTimer.current = setTimeout(() => {
|
|
@@ -260,7 +279,7 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
260
279
|
isFocused: submenuFocusIndex === index,
|
|
261
280
|
focusIndex: submenuFocusIndex,
|
|
262
281
|
handleKeyDown,
|
|
263
|
-
blockIndex
|
|
282
|
+
blockIndex
|
|
264
283
|
}
|
|
265
284
|
}, child))));
|
|
266
285
|
}
|
|
@@ -293,13 +312,13 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
293
312
|
submenuDirection: submenuDirection,
|
|
294
313
|
variant: variant,
|
|
295
314
|
menuType: menuContext.menuType,
|
|
296
|
-
role: "list"
|
|
315
|
+
role: blockIndex === 0 ? "presentation" : "list"
|
|
297
316
|
}, _react.default.Children.map(children, (child, index) => /*#__PURE__*/_react.default.createElement(_submenu2.default.Provider, {
|
|
298
317
|
value: {
|
|
299
318
|
isFocused: !blockDoubleFocus && submenuFocusIndex === index,
|
|
300
319
|
focusIndex: submenuFocusIndex,
|
|
301
320
|
handleKeyDown,
|
|
302
|
-
blockIndex
|
|
321
|
+
blockIndex,
|
|
303
322
|
updateFocusIndex: setSubmenuFocusIndex,
|
|
304
323
|
itemIndex: child.type === _menuItem2.default ? index : undefined
|
|
305
324
|
}
|
|
@@ -55,6 +55,7 @@ const MenuItem = ({
|
|
|
55
55
|
menuOpen,
|
|
56
56
|
onSubmenuOpen,
|
|
57
57
|
onSubmenuClose,
|
|
58
|
+
overrideColor,
|
|
58
59
|
...rest
|
|
59
60
|
}) => {
|
|
60
61
|
const menuContext = (0, _react.useContext)(_menu.default);
|
|
@@ -121,6 +122,7 @@ const MenuItem = ({
|
|
|
121
122
|
selected,
|
|
122
123
|
variant,
|
|
123
124
|
onKeyDown: !inFullscreenView ? handleKeyDown : undefined,
|
|
125
|
+
overrideColor,
|
|
124
126
|
ref
|
|
125
127
|
};
|
|
126
128
|
const clonedChildren = isChildSearch.current ? childrenItems.map(child => /*#__PURE__*/_react.default.cloneElement(child, {
|
|
@@ -254,7 +256,10 @@ MenuItem.propTypes = {
|
|
|
254
256
|
onSubmenuOpen: _propTypes.default.func,
|
|
255
257
|
|
|
256
258
|
/** Callback triggered when submenu closes. Only valid with submenu prop */
|
|
257
|
-
onSubmenuClose: _propTypes.default.func
|
|
259
|
+
onSubmenuClose: _propTypes.default.func,
|
|
260
|
+
|
|
261
|
+
/** @ignore @private */
|
|
262
|
+
overrideColor: _propTypes.default.bool
|
|
258
263
|
};
|
|
259
264
|
var _default = MenuItem;
|
|
260
265
|
exports.default = _default;
|
|
@@ -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 {
|