carbon-react 109.2.0 → 109.2.3
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/components/badge/badge.style.d.ts +1 -4
- package/esm/components/button/button.component.d.ts +1 -4
- package/esm/components/button/button.component.js +26 -12
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.js +2 -2
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +2 -2
- package/esm/components/menu/__internal__/submenu/submenu.component.js +1 -0
- package/esm/components/multi-action-button/multi-action-button.component.js +1 -6
- package/esm/components/search/search.style.js +22 -8
- package/esm/components/split-button/split-button.component.js +1 -6
- package/lib/components/badge/badge.style.d.ts +1 -4
- package/lib/components/button/button.component.d.ts +1 -4
- package/lib/components/button/button.component.js +29 -10
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.js +4 -2
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +2 -2
- package/lib/components/menu/__internal__/submenu/submenu.component.js +1 -0
- package/lib/components/multi-action-button/multi-action-button.component.js +1 -6
- package/lib/components/search/search.style.js +22 -8
- package/lib/components/split-button/split-button.component.js +1 -6
- package/package.json +11 -11
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const StyledBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
declare const StyledCounter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
declare const StyledButton: import("styled-components").StyledComponent<{
|
|
5
|
-
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../button").ButtonProps): JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
}, any, {}, never>;
|
|
4
|
+
declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
8
5
|
declare const StyledCrossIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
9
6
|
export { StyledBadgeWrapper, StyledButton, StyledCrossIcon, StyledCounter };
|
|
@@ -58,10 +58,7 @@ export interface ButtonProps extends SpaceProps {
|
|
|
58
58
|
/** HTML rel attribute */
|
|
59
59
|
rel?: string;
|
|
60
60
|
}
|
|
61
|
-
declare const Button:
|
|
62
|
-
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: ButtonProps): JSX.Element;
|
|
63
|
-
displayName: string;
|
|
64
|
-
};
|
|
61
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
65
62
|
declare const ButtonWithForwardRef: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
66
63
|
export { ButtonWithForwardRef };
|
|
67
64
|
export default Button;
|
|
@@ -7,6 +7,7 @@ import Icon from "../icon";
|
|
|
7
7
|
import StyledButton, { StyledButtonSubtext } from "./button.style";
|
|
8
8
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
9
9
|
import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
10
|
+
import Logger from "../../__internal__/utils/logger";
|
|
10
11
|
|
|
11
12
|
function renderChildren({
|
|
12
13
|
/* eslint-disable react/prop-types */
|
|
@@ -73,8 +74,8 @@ renderChildren.propTypes = {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
const Button = ({
|
|
77
|
+
let deprecatedForwardRefWarnTriggered = false;
|
|
78
|
+
const Button = /*#__PURE__*/React.forwardRef(({
|
|
78
79
|
size = "medium",
|
|
79
80
|
subtext = "",
|
|
80
81
|
children,
|
|
@@ -95,13 +96,18 @@ const Button = ({
|
|
|
95
96
|
iconTooltipPosition,
|
|
96
97
|
fullWidth = false,
|
|
97
98
|
...rest
|
|
98
|
-
}) => {
|
|
99
|
+
}, ref) => {
|
|
99
100
|
invariant(!!(children || iconType), "Either prop `iconType` must be defined or this node must have children.");
|
|
100
101
|
|
|
101
102
|
if (subtext) {
|
|
102
103
|
invariant(size === "large", "subtext prop has no effect unless the button is large.");
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
if (!deprecatedForwardRefWarnTriggered && forwardRef) {
|
|
107
|
+
deprecatedForwardRefWarnTriggered = true;
|
|
108
|
+
Logger.deprecate("The `forwardRef` prop in `Button` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
109
|
+
}
|
|
110
|
+
|
|
105
111
|
const [internalRef, setInternalRef] = useState();
|
|
106
112
|
const buttonType = buttonTypeProp;
|
|
107
113
|
let paddingX;
|
|
@@ -129,10 +135,11 @@ const Button = ({
|
|
|
129
135
|
|
|
130
136
|
const setRefs = useCallback(reference => {
|
|
131
137
|
setInternalRef(reference);
|
|
132
|
-
|
|
133
|
-
if (
|
|
134
|
-
if (typeof
|
|
135
|
-
|
|
138
|
+
const activeRef = ref || forwardRef;
|
|
139
|
+
if (!activeRef) return;
|
|
140
|
+
if (typeof activeRef === "object") activeRef.current = reference;
|
|
141
|
+
if (typeof activeRef === "function") activeRef(reference);
|
|
142
|
+
}, [ref, forwardRef]);
|
|
136
143
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
137
144
|
"aria-label": !children && iconType ? ariaLabel || iconType : undefined,
|
|
138
145
|
as: !disabled && href ? "a" : "button",
|
|
@@ -169,8 +176,7 @@ const Button = ({
|
|
|
169
176
|
iconTooltipPosition,
|
|
170
177
|
tooltipTarget: internalRef
|
|
171
178
|
}));
|
|
172
|
-
};
|
|
173
|
-
|
|
179
|
+
});
|
|
174
180
|
Button.propTypes = {
|
|
175
181
|
"aria-label": PropTypes.string,
|
|
176
182
|
"buttonType": PropTypes.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
@@ -507,9 +513,17 @@ Button.propTypes = {
|
|
|
507
513
|
"target": PropTypes.string,
|
|
508
514
|
"type": PropTypes.string
|
|
509
515
|
};
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
516
|
+
let deprecatedButtonForwardRefWarnTriggered = false;
|
|
517
|
+
const ButtonWithForwardRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
518
|
+
if (!deprecatedButtonForwardRefWarnTriggered) {
|
|
519
|
+
deprecatedButtonForwardRefWarnTriggered = true;
|
|
520
|
+
Logger.deprecate("The `ButtonWithForwardRef` component is deprecated and will soon be removed. Please use a basic `Button` component with `ref` instead.");
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
524
|
+
ref: ref
|
|
525
|
+
}, props));
|
|
526
|
+
});
|
|
513
527
|
ButtonWithForwardRef.propTypes = {
|
|
514
528
|
"aria-label": PropTypes.string,
|
|
515
529
|
"buttonType": PropTypes.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import Button from "../../button";
|
|
3
3
|
import { StyledButton } from "../picklist-item/picklist-item.style";
|
|
4
4
|
const StyledGroupWrapper = styled.li`
|
|
5
5
|
${({
|
|
@@ -25,7 +25,7 @@ const StyledPicklistGroup = styled.li`
|
|
|
25
25
|
width: 100%;
|
|
26
26
|
margin-bottom: 4px;
|
|
27
27
|
`;
|
|
28
|
-
const StyledGroupButton = styled(
|
|
28
|
+
const StyledGroupButton = styled(Button)`
|
|
29
29
|
${({
|
|
30
30
|
iconType
|
|
31
31
|
}) => css`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import Button from "../../button";
|
|
3
3
|
import Icon from "../../icon";
|
|
4
4
|
import StyledIcon from "../../icon/icon.style";
|
|
5
5
|
const StyledPicklistItem = styled.li`
|
|
@@ -30,7 +30,7 @@ const StyledPicklistItem = styled.li`
|
|
|
30
30
|
}
|
|
31
31
|
`}
|
|
32
32
|
`;
|
|
33
|
-
const StyledButton = styled(
|
|
33
|
+
const StyledButton = styled(Button)`
|
|
34
34
|
${({
|
|
35
35
|
iconType
|
|
36
36
|
}) => css`
|
|
@@ -215,6 +215,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
215
215
|
menuType: menuContext.menuType,
|
|
216
216
|
asPassiveItem: asPassiveItem
|
|
217
217
|
}, /*#__PURE__*/React.createElement(StyledMenuItemWrapper, _extends({}, rest, {
|
|
218
|
+
onClick: onClick,
|
|
218
219
|
className: className,
|
|
219
220
|
menuType: menuContext.menuType,
|
|
220
221
|
ref: ref,
|
|
@@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useState, useRef, useMemo } from "react"
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import useClickAwayListener from "../../hooks/__internal__/useClickAwayListener";
|
|
6
6
|
import { StyledMultiActionButton, StyledButtonChildrenContainer } from "./multi-action-button.style";
|
|
7
|
-
import Button
|
|
7
|
+
import Button from "../button";
|
|
8
8
|
import Events from "../../__internal__/utils/helpers/events";
|
|
9
9
|
import Popover from "../../__internal__/popover";
|
|
10
10
|
import { filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps } from "../../style/utils";
|
|
@@ -67,11 +67,6 @@ const MultiActionButton = ({
|
|
|
67
67
|
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
if (child.type === Button) {
|
|
72
|
-
return /*#__PURE__*/React.createElement(ButtonWithForwardRef, _extends({}, child.props, props));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
70
|
return /*#__PURE__*/React.cloneElement(child, props);
|
|
76
71
|
});
|
|
77
72
|
};
|
|
@@ -97,20 +97,34 @@ const StyledSearch = styled.div`
|
|
|
97
97
|
z-index: ${theme.zIndex.smallOverlay};
|
|
98
98
|
}
|
|
99
99
|
${StyledIcon} {
|
|
100
|
-
|
|
100
|
+
${darkVariant && css`
|
|
101
|
+
${iconColor && css`
|
|
102
|
+
color: var(--colorsUtilityMajor400);
|
|
103
|
+
|
|
104
|
+
:hover {
|
|
105
|
+
color: var(--colorsUtilityMajor500);
|
|
106
|
+
}
|
|
107
|
+
`}
|
|
108
|
+
${!iconColor && css`
|
|
109
|
+
color: var(--colorsUtilityMajor200);
|
|
110
|
+
|
|
111
|
+
:hover {
|
|
112
|
+
color: var(--colorsUtilityMajor100);
|
|
113
|
+
}
|
|
114
|
+
`}
|
|
115
|
+
`}
|
|
116
|
+
|
|
101
117
|
${!darkVariant && css`
|
|
102
|
-
color: var(--
|
|
118
|
+
color: var(--colorsActionMinor500);
|
|
119
|
+
|
|
120
|
+
:hover {
|
|
121
|
+
color: var(--colorsActionMinor600);
|
|
122
|
+
}
|
|
103
123
|
`}
|
|
104
124
|
|
|
105
125
|
width: 20px;
|
|
106
126
|
height: 20px;
|
|
107
127
|
cursor: pointer;
|
|
108
|
-
:hover {
|
|
109
|
-
color: ${iconColor ? "var(--colorsUtilityMajor500)" : "var(--colorsUtilityMajor100)"};
|
|
110
|
-
${!darkVariant && css`
|
|
111
|
-
color: var(--colorsUtilityMajor500);
|
|
112
|
-
`}
|
|
113
|
-
}
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
${StyledInputIconToggle} {
|
|
@@ -6,7 +6,7 @@ import PropTypes from "prop-types";
|
|
|
6
6
|
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
7
7
|
import useClickAwayListener from "../../hooks/__internal__/useClickAwayListener";
|
|
8
8
|
import Icon from "../icon";
|
|
9
|
-
import Button
|
|
9
|
+
import Button from "../button";
|
|
10
10
|
import StyledSplitButton from "./split-button.style";
|
|
11
11
|
import StyledSplitButtonToggle from "./split-button-toggle.style";
|
|
12
12
|
import StyledSplitButtonChildrenContainer from "./split-button-children.style";
|
|
@@ -217,11 +217,6 @@ const SplitButton = ({
|
|
|
217
217
|
(_toggleButton$current = toggleButton.current) === null || _toggleButton$current === void 0 ? void 0 : _toggleButton$current.focus();
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
|
-
|
|
221
|
-
if (child.type === Button) {
|
|
222
|
-
return /*#__PURE__*/React.createElement(ButtonWithForwardRef, _extends({}, child.props, childProps));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
220
|
return /*#__PURE__*/React.cloneElement(child, childProps);
|
|
226
221
|
});
|
|
227
222
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const StyledBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
declare const StyledCounter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
declare const StyledButton: import("styled-components").StyledComponent<{
|
|
5
|
-
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../button").ButtonProps): JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
}, any, {}, never>;
|
|
4
|
+
declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
8
5
|
declare const StyledCrossIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
9
6
|
export { StyledBadgeWrapper, StyledButton, StyledCrossIcon, StyledCounter };
|
|
@@ -58,10 +58,7 @@ export interface ButtonProps extends SpaceProps {
|
|
|
58
58
|
/** HTML rel attribute */
|
|
59
59
|
rel?: string;
|
|
60
60
|
}
|
|
61
|
-
declare const Button:
|
|
62
|
-
({ size, subtext, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: ButtonProps): JSX.Element;
|
|
63
|
-
displayName: string;
|
|
64
|
-
};
|
|
61
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
65
62
|
declare const ButtonWithForwardRef: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
66
63
|
export { ButtonWithForwardRef };
|
|
67
64
|
export default Button;
|
|
@@ -19,6 +19,8 @@ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tag
|
|
|
19
19
|
|
|
20
20
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
21
21
|
|
|
22
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
26
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -92,8 +94,9 @@ renderChildren.propTypes = {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
};
|
|
97
|
+
let deprecatedForwardRefWarnTriggered = false;
|
|
95
98
|
|
|
96
|
-
const Button = ({
|
|
99
|
+
const Button = /*#__PURE__*/_react.default.forwardRef(({
|
|
97
100
|
size = "medium",
|
|
98
101
|
subtext = "",
|
|
99
102
|
children,
|
|
@@ -114,13 +117,19 @@ const Button = ({
|
|
|
114
117
|
iconTooltipPosition,
|
|
115
118
|
fullWidth = false,
|
|
116
119
|
...rest
|
|
117
|
-
}) => {
|
|
120
|
+
}, ref) => {
|
|
118
121
|
(0, _invariant.default)(!!(children || iconType), "Either prop `iconType` must be defined or this node must have children.");
|
|
119
122
|
|
|
120
123
|
if (subtext) {
|
|
121
124
|
(0, _invariant.default)(size === "large", "subtext prop has no effect unless the button is large.");
|
|
122
125
|
}
|
|
123
126
|
|
|
127
|
+
if (!deprecatedForwardRefWarnTriggered && forwardRef) {
|
|
128
|
+
deprecatedForwardRefWarnTriggered = true;
|
|
129
|
+
|
|
130
|
+
_logger.default.deprecate("The `forwardRef` prop in `Button` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
131
|
+
}
|
|
132
|
+
|
|
124
133
|
const [internalRef, setInternalRef] = (0, _react.useState)();
|
|
125
134
|
const buttonType = buttonTypeProp;
|
|
126
135
|
let paddingX;
|
|
@@ -148,10 +157,11 @@ const Button = ({
|
|
|
148
157
|
|
|
149
158
|
const setRefs = (0, _react.useCallback)(reference => {
|
|
150
159
|
setInternalRef(reference);
|
|
151
|
-
|
|
152
|
-
if (
|
|
153
|
-
if (typeof
|
|
154
|
-
|
|
160
|
+
const activeRef = ref || forwardRef;
|
|
161
|
+
if (!activeRef) return;
|
|
162
|
+
if (typeof activeRef === "object") activeRef.current = reference;
|
|
163
|
+
if (typeof activeRef === "function") activeRef(reference);
|
|
164
|
+
}, [ref, forwardRef]);
|
|
155
165
|
return /*#__PURE__*/_react.default.createElement(_button.default, _extends({
|
|
156
166
|
"aria-label": !children && iconType ? ariaLabel || iconType : undefined,
|
|
157
167
|
as: !disabled && href ? "a" : "button",
|
|
@@ -188,7 +198,7 @@ const Button = ({
|
|
|
188
198
|
iconTooltipPosition,
|
|
189
199
|
tooltipTarget: internalRef
|
|
190
200
|
}));
|
|
191
|
-
};
|
|
201
|
+
});
|
|
192
202
|
|
|
193
203
|
Button.propTypes = {
|
|
194
204
|
"aria-label": _propTypes.default.string,
|
|
@@ -526,10 +536,19 @@ Button.propTypes = {
|
|
|
526
536
|
"target": _propTypes.default.string,
|
|
527
537
|
"type": _propTypes.default.string
|
|
528
538
|
};
|
|
539
|
+
let deprecatedButtonForwardRefWarnTriggered = false;
|
|
540
|
+
|
|
541
|
+
const ButtonWithForwardRef = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
542
|
+
if (!deprecatedButtonForwardRefWarnTriggered) {
|
|
543
|
+
deprecatedButtonForwardRefWarnTriggered = true;
|
|
529
544
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
545
|
+
_logger.default.deprecate("The `ButtonWithForwardRef` component is deprecated and will soon be removed. Please use a basic `Button` component with `ref` instead.");
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
return /*#__PURE__*/_react.default.createElement(Button, _extends({
|
|
549
|
+
ref: ref
|
|
550
|
+
}, props));
|
|
551
|
+
});
|
|
533
552
|
|
|
534
553
|
exports.ButtonWithForwardRef = ButtonWithForwardRef;
|
|
535
554
|
ButtonWithForwardRef.propTypes = {
|
|
@@ -7,10 +7,12 @@ exports.StyledGroupButton = exports.StyledPicklistGroup = exports.StyledPicklist
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _button = require("../../button");
|
|
10
|
+
var _button = _interopRequireDefault(require("../../button"));
|
|
11
11
|
|
|
12
12
|
var _picklistItem = require("../picklist-item/picklist-item.style");
|
|
13
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
14
16
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
15
17
|
|
|
16
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -42,7 +44,7 @@ const StyledPicklistGroup = _styledComponents.default.li`
|
|
|
42
44
|
margin-bottom: 4px;
|
|
43
45
|
`;
|
|
44
46
|
exports.StyledPicklistGroup = StyledPicklistGroup;
|
|
45
|
-
const StyledGroupButton = (0, _styledComponents.default)(_button.
|
|
47
|
+
const StyledGroupButton = (0, _styledComponents.default)(_button.default)`
|
|
46
48
|
${({
|
|
47
49
|
iconType
|
|
48
50
|
}) => (0, _styledComponents.css)`
|
|
@@ -7,7 +7,7 @@ exports.StyledLockIcon = exports.StyledButton = exports.StyledPicklistItem = voi
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _button = require("../../button");
|
|
10
|
+
var _button = _interopRequireDefault(require("../../button"));
|
|
11
11
|
|
|
12
12
|
var _icon = _interopRequireDefault(require("../../icon"));
|
|
13
13
|
|
|
@@ -48,7 +48,7 @@ const StyledPicklistItem = _styledComponents.default.li`
|
|
|
48
48
|
`}
|
|
49
49
|
`;
|
|
50
50
|
exports.StyledPicklistItem = StyledPicklistItem;
|
|
51
|
-
const StyledButton = (0, _styledComponents.default)(_button.
|
|
51
|
+
const StyledButton = (0, _styledComponents.default)(_button.default)`
|
|
52
52
|
${({
|
|
53
53
|
iconType
|
|
54
54
|
}) => (0, _styledComponents.css)`
|
|
@@ -242,6 +242,7 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
242
242
|
menuType: menuContext.menuType,
|
|
243
243
|
asPassiveItem: asPassiveItem
|
|
244
244
|
}, /*#__PURE__*/_react.default.createElement(_menuItem.default, _extends({}, rest, {
|
|
245
|
+
onClick: onClick,
|
|
245
246
|
className: className,
|
|
246
247
|
menuType: menuContext.menuType,
|
|
247
248
|
ref: ref,
|
|
@@ -13,7 +13,7 @@ var _useClickAwayListener = _interopRequireDefault(require("../../hooks/__intern
|
|
|
13
13
|
|
|
14
14
|
var _multiActionButton = require("./multi-action-button.style");
|
|
15
15
|
|
|
16
|
-
var _button =
|
|
16
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
17
17
|
|
|
18
18
|
var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
|
|
19
19
|
|
|
@@ -88,11 +88,6 @@ const MultiActionButton = ({
|
|
|
88
88
|
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
if (child.type === _button.default) {
|
|
93
|
-
return /*#__PURE__*/_react.default.createElement(_button.ButtonWithForwardRef, _extends({}, child.props, props));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
91
|
return /*#__PURE__*/_react.default.cloneElement(child, props);
|
|
97
92
|
});
|
|
98
93
|
};
|
|
@@ -119,20 +119,34 @@ const StyledSearch = _styledComponents.default.div`
|
|
|
119
119
|
z-index: ${theme.zIndex.smallOverlay};
|
|
120
120
|
}
|
|
121
121
|
${_icon.default} {
|
|
122
|
-
|
|
122
|
+
${darkVariant && (0, _styledComponents.css)`
|
|
123
|
+
${iconColor && (0, _styledComponents.css)`
|
|
124
|
+
color: var(--colorsUtilityMajor400);
|
|
125
|
+
|
|
126
|
+
:hover {
|
|
127
|
+
color: var(--colorsUtilityMajor500);
|
|
128
|
+
}
|
|
129
|
+
`}
|
|
130
|
+
${!iconColor && (0, _styledComponents.css)`
|
|
131
|
+
color: var(--colorsUtilityMajor200);
|
|
132
|
+
|
|
133
|
+
:hover {
|
|
134
|
+
color: var(--colorsUtilityMajor100);
|
|
135
|
+
}
|
|
136
|
+
`}
|
|
137
|
+
`}
|
|
138
|
+
|
|
123
139
|
${!darkVariant && (0, _styledComponents.css)`
|
|
124
|
-
color: var(--
|
|
140
|
+
color: var(--colorsActionMinor500);
|
|
141
|
+
|
|
142
|
+
:hover {
|
|
143
|
+
color: var(--colorsActionMinor600);
|
|
144
|
+
}
|
|
125
145
|
`}
|
|
126
146
|
|
|
127
147
|
width: 20px;
|
|
128
148
|
height: 20px;
|
|
129
149
|
cursor: pointer;
|
|
130
|
-
:hover {
|
|
131
|
-
color: ${iconColor ? "var(--colorsUtilityMajor500)" : "var(--colorsUtilityMajor100)"};
|
|
132
|
-
${!darkVariant && (0, _styledComponents.css)`
|
|
133
|
-
color: var(--colorsUtilityMajor500);
|
|
134
|
-
`}
|
|
135
|
-
}
|
|
136
150
|
}
|
|
137
151
|
|
|
138
152
|
${_inputIconToggle.default} {
|
|
@@ -17,7 +17,7 @@ var _useClickAwayListener = _interopRequireDefault(require("../../hooks/__intern
|
|
|
17
17
|
|
|
18
18
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
19
19
|
|
|
20
|
-
var _button =
|
|
20
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
21
21
|
|
|
22
22
|
var _splitButton = _interopRequireDefault(require("./split-button.style"));
|
|
23
23
|
|
|
@@ -249,11 +249,6 @@ const SplitButton = ({
|
|
|
249
249
|
(_toggleButton$current = toggleButton.current) === null || _toggleButton$current === void 0 ? void 0 : _toggleButton$current.focus();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
|
|
253
|
-
if (child.type === _button.default) {
|
|
254
|
-
return /*#__PURE__*/_react.default.createElement(_button.ButtonWithForwardRef, _extends({}, child.props, childProps));
|
|
255
|
-
}
|
|
256
|
-
|
|
257
252
|
return /*#__PURE__*/_react.default.cloneElement(child, childProps);
|
|
258
253
|
});
|
|
259
254
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "109.2.
|
|
3
|
+
"version": "109.2.3",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -117,9 +117,8 @@
|
|
|
117
117
|
"core-js": "^3.20.3",
|
|
118
118
|
"cross-env": "^5.2.0",
|
|
119
119
|
"css-loader": "4.0.0",
|
|
120
|
-
"cypress": "^10.
|
|
121
|
-
"cypress-axe": "^0.
|
|
122
|
-
"cypress-cucumber-preprocessor": "^4.3.1",
|
|
120
|
+
"cypress": "^10.3.0",
|
|
121
|
+
"cypress-axe": "^1.0.0",
|
|
123
122
|
"cypress-each": "^1.11.0",
|
|
124
123
|
"cypress-plugin-tab": "^1.0.5",
|
|
125
124
|
"cypress-real-events": "^1.7.0",
|
|
@@ -169,6 +168,8 @@
|
|
|
169
168
|
"webpack-dev-server": "^4.0.0"
|
|
170
169
|
},
|
|
171
170
|
"dependencies": {
|
|
171
|
+
"@badeball/cypress-cucumber-preprocessor": "^11.4.0",
|
|
172
|
+
"@bahmutov/cypress-esbuild-preprocessor": "^2.1.3",
|
|
172
173
|
"@octokit/rest": "^18.12.0",
|
|
173
174
|
"@popperjs/core": "^2.11.5",
|
|
174
175
|
"@styled-system/prop-types": "^5.1.5",
|
|
@@ -178,6 +179,7 @@
|
|
|
178
179
|
"crypto-js": "~3.3.0",
|
|
179
180
|
"date-fns": "^2.26.0",
|
|
180
181
|
"dotenv": "^10.0.0",
|
|
182
|
+
"esbuild": "^0.14.47",
|
|
181
183
|
"immutable": "~3.8.2",
|
|
182
184
|
"invariant": "^2.2.4",
|
|
183
185
|
"lodash": "^4.17.20",
|
|
@@ -193,13 +195,11 @@
|
|
|
193
195
|
"wait-on": "^5.2.1"
|
|
194
196
|
},
|
|
195
197
|
"cypress-cucumber-preprocessor": {
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
"fileSuffix": ".cucumber"
|
|
202
|
-
}
|
|
198
|
+
"nonGlobalStepDefinitions": true,
|
|
199
|
+
"stepDefinitions": [
|
|
200
|
+
"cypress/support/step-definitions/*.{js,ts}",
|
|
201
|
+
"cypress/support/helper.js"
|
|
202
|
+
]
|
|
203
203
|
},
|
|
204
204
|
"config": {
|
|
205
205
|
"commitizen": {
|