carbon-react 126.5.0 → 126.5.2
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/button/button.component.js +1 -2
- package/esm/components/button-toggle/button-toggle-icon.component.js +0 -1
- package/esm/components/button-toggle/button-toggle.style.js +3 -0
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.js +0 -1
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +6 -0
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +0 -1
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +6 -0
- package/esm/components/icon/icon.component.js +8 -2
- package/esm/components/icon/icon.style.js +19 -4
- package/esm/components/link/link.component.js +0 -1
- package/esm/components/link/link.style.js +1 -1
- package/esm/components/menu/__internal__/submenu/submenu.style.js +0 -25
- package/esm/components/menu/menu-item/menu-item.style.js +0 -1
- package/esm/components/select/filterable-select/filterable-select.component.js +1 -1
- package/esm/components/split-button/split-button.component.js +0 -1
- package/lib/components/button/button.component.js +1 -2
- package/lib/components/button-toggle/button-toggle-icon.component.js +0 -1
- package/lib/components/button-toggle/button-toggle.style.js +3 -0
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.js +0 -1
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +6 -0
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +0 -1
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +6 -0
- package/lib/components/icon/icon.component.js +8 -2
- package/lib/components/icon/icon.style.js +19 -4
- package/lib/components/link/link.component.js +0 -1
- package/lib/components/link/link.style.js +1 -1
- package/lib/components/menu/__internal__/submenu/submenu.style.js +0 -25
- package/lib/components/menu/menu-item/menu-item.style.js +0 -1
- package/lib/components/select/filterable-select/filterable-select.component.js +1 -1
- package/lib/components/split-button/split-button.component.js +0 -1
- package/package.json +1 -1
|
@@ -35,8 +35,7 @@ function renderChildren({
|
|
|
35
35
|
"aria-hidden": true,
|
|
36
36
|
disabled,
|
|
37
37
|
color: iconColor(),
|
|
38
|
-
bg: "transparent"
|
|
39
|
-
bgSize: "extra-small"
|
|
38
|
+
bg: "transparent"
|
|
40
39
|
};
|
|
41
40
|
const isValidChildren = children !== undefined && children !== false;
|
|
42
41
|
return /*#__PURE__*/React.createElement(React.Fragment, null, iconType && iconPosition === "before" && isValidChildren && /*#__PURE__*/React.createElement(Icon, _extends({
|
|
@@ -79,6 +79,8 @@ const StyledButtonToggle = styled.button`
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
${StyledIcon} {
|
|
82
|
+
width: 16px;
|
|
83
|
+
height: 16px;
|
|
82
84
|
color: var(--colorsActionMinor500);
|
|
83
85
|
}
|
|
84
86
|
|
|
@@ -153,6 +155,7 @@ const StyledButtonToggleIcon = styled.div`
|
|
|
153
155
|
}) => buttonIconSize === "large" && css`
|
|
154
156
|
margin-right: 0;
|
|
155
157
|
${StyledIcon} {
|
|
158
|
+
margin-left: 0;
|
|
156
159
|
margin-right: 0;
|
|
157
160
|
margin-bottom: 8px;
|
|
158
161
|
height: ${`${iconFontSizes.largeIcon}px`};
|
|
@@ -2,6 +2,7 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { padding } from "styled-system";
|
|
3
3
|
import baseTheme from "../../../style/themes/base";
|
|
4
4
|
import { toColor } from "../../../style/utils/color";
|
|
5
|
+
import StyledIcon from "../../icon/icon.style";
|
|
5
6
|
const verticalBorderSizes = {
|
|
6
7
|
small: "1px",
|
|
7
8
|
medium: "2px",
|
|
@@ -91,6 +92,11 @@ const StyledCellContent = styled.div`
|
|
|
91
92
|
display: flex;
|
|
92
93
|
align-items: center;
|
|
93
94
|
line-height: 1em;
|
|
95
|
+
|
|
96
|
+
${StyledIcon} {
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
}
|
|
94
100
|
`}
|
|
95
101
|
`;
|
|
96
102
|
StyledFlatTableCell.defaultProps = {
|
|
@@ -2,6 +2,7 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { padding } from "styled-system";
|
|
3
3
|
import baseTheme from "../../../style/themes/base";
|
|
4
4
|
import { toColor } from "../../../style/utils/color";
|
|
5
|
+
import StyledIcon from "../../icon/icon.style";
|
|
5
6
|
const verticalBorderSizes = {
|
|
6
7
|
small: "1px",
|
|
7
8
|
medium: "2px",
|
|
@@ -89,6 +90,11 @@ const StyledFlatTableRowHeaderContent = styled.div`
|
|
|
89
90
|
display: flex;
|
|
90
91
|
align-items: center;
|
|
91
92
|
line-height: 1em;
|
|
93
|
+
|
|
94
|
+
${StyledIcon} {
|
|
95
|
+
width: 16px;
|
|
96
|
+
height: 16px;
|
|
97
|
+
}
|
|
92
98
|
`}
|
|
93
99
|
`;
|
|
94
100
|
export { StyledFlatTableRowHeader, StyledFlatTableRowHeaderContent };
|
|
@@ -8,12 +8,14 @@ import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
|
8
8
|
import StyledIcon from "./icon.style";
|
|
9
9
|
import { ICON_TOOLTIP_POSITIONS } from "./icon-config";
|
|
10
10
|
import { TabTitleContext } from "../tabs/__internal__/tab-title";
|
|
11
|
+
import Logger from "../../__internal__/utils/logger";
|
|
12
|
+
let deprecatedExtraSmallBgSizeTriggered = false;
|
|
11
13
|
const Icon = /*#__PURE__*/React.forwardRef(({
|
|
12
14
|
"aria-hidden": ariaHidden,
|
|
13
15
|
ariaLabel,
|
|
14
16
|
bg,
|
|
15
17
|
bgShape,
|
|
16
|
-
bgSize
|
|
18
|
+
bgSize,
|
|
17
19
|
className,
|
|
18
20
|
color,
|
|
19
21
|
disabled,
|
|
@@ -35,6 +37,10 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
35
37
|
...rest
|
|
36
38
|
}, ref) => {
|
|
37
39
|
const flipBehaviourCheck = Array.isArray(tooltipFlipOverrides) && tooltipFlipOverrides.every(override => ICON_TOOLTIP_POSITIONS.includes(override));
|
|
40
|
+
if (!deprecatedExtraSmallBgSizeTriggered && bgSize === "extra-small") {
|
|
41
|
+
deprecatedExtraSmallBgSizeTriggered = true;
|
|
42
|
+
Logger.deprecate("The `extra-small` variant of the `bgSize` prop for `Icon` component has been deprecated and will soon be removed.");
|
|
43
|
+
}
|
|
38
44
|
if (tooltipFlipOverrides) {
|
|
39
45
|
!flipBehaviourCheck ? process.env.NODE_ENV !== "production" ? invariant(false, `The tooltipFlipOverrides prop supplied to \`Icon\` must be an array containing some or all of ["top", "bottom", "left", "right"].`) : invariant(false) : void 0;
|
|
40
46
|
}
|
|
@@ -81,7 +87,7 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
81
87
|
"aria-hidden": ariaHidden,
|
|
82
88
|
"aria-label": ariaLabel,
|
|
83
89
|
bg,
|
|
84
|
-
bgSize,
|
|
90
|
+
bgSize: bgSize || fontSize,
|
|
85
91
|
bgShape,
|
|
86
92
|
className: className || undefined,
|
|
87
93
|
color,
|
|
@@ -9,8 +9,22 @@ import styledColor from "../../style/utils/color";
|
|
|
9
9
|
import getColorValue from "../../style/utils/get-color-value";
|
|
10
10
|
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
11
11
|
function adjustIconBgSize(fontSize, bgSize) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const sizeValues = {
|
|
13
|
+
"extra-small": 1,
|
|
14
|
+
small: 2,
|
|
15
|
+
medium: 3,
|
|
16
|
+
large: 4,
|
|
17
|
+
"extra-large": 5
|
|
18
|
+
};
|
|
19
|
+
if (fontSize && bgSize) {
|
|
20
|
+
const fontSizeValue = sizeValues[fontSize];
|
|
21
|
+
const bgSizeValue = sizeValues[bgSize];
|
|
22
|
+
if (bgSizeValue < fontSizeValue) {
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.warn(`[WARNING - Icon] The "${bgSize}" \`bgSize\` is smaller than "${fontSize}" \`fontSize\`, the \`bgSize\` has been auto adjusted to a larger size.`);
|
|
25
|
+
return iconConfig.backgroundSize[fontSize];
|
|
26
|
+
}
|
|
27
|
+
return iconConfig.backgroundSize[bgSize];
|
|
14
28
|
}
|
|
15
29
|
return bgSize ? iconConfig.backgroundSize[bgSize] : undefined;
|
|
16
30
|
}
|
|
@@ -32,6 +46,7 @@ const StyledIcon = styled.span`
|
|
|
32
46
|
let finalHoverColor;
|
|
33
47
|
let bgColor;
|
|
34
48
|
let bgHoverColor;
|
|
49
|
+
const adjustedBgSize = adjustIconBgSize(fontSize, bgSize);
|
|
35
50
|
try {
|
|
36
51
|
if (disabled) {
|
|
37
52
|
finalColor = "var(--colorsYin030)";
|
|
@@ -74,8 +89,8 @@ const StyledIcon = styled.span`
|
|
|
74
89
|
align-items: center;
|
|
75
90
|
display: inline-flex;
|
|
76
91
|
justify-content: center;
|
|
77
|
-
height: ${
|
|
78
|
-
width: ${
|
|
92
|
+
height: ${adjustedBgSize};
|
|
93
|
+
width: ${adjustedBgSize};
|
|
79
94
|
${bgShape ? `border-radius: ${iconConfig.backgroundShape[bgShape]}` : ""};
|
|
80
95
|
|
|
81
96
|
${isInteractive && css`
|
|
@@ -52,7 +52,6 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
52
52
|
const hasProperAlignment = icon && iconAlign === currentAlignment;
|
|
53
53
|
return hasProperAlignment ? /*#__PURE__*/React.createElement(Icon, {
|
|
54
54
|
type: icon,
|
|
55
|
-
bgSize: "extra-small",
|
|
56
55
|
disabled: disabled,
|
|
57
56
|
ariaLabel: removeAriaLabelOnIcon ? undefined : ariaLabel,
|
|
58
57
|
tooltipMessage: tooltipMessage,
|
|
@@ -130,7 +130,7 @@ const StyledLink = styled.span`
|
|
|
130
130
|
position: relative;
|
|
131
131
|
vertical-align: middle;
|
|
132
132
|
${iconAlign === "left" && css`
|
|
133
|
-
margin-right: ${hasContent ? "var(--
|
|
133
|
+
margin-right: ${hasContent ? "var(--spacing050)" : 0};
|
|
134
134
|
`}
|
|
135
135
|
${iconAlign === "right" && css`
|
|
136
136
|
margin-right: 0;
|
|
@@ -3,7 +3,6 @@ import { baseTheme } from "../../../../style/themes";
|
|
|
3
3
|
import { StyledLink } from "../../../link/link.style";
|
|
4
4
|
import { StyledMenuItem } from "../../menu.style";
|
|
5
5
|
import StyledMenuItemWrapper from "../../menu-item/menu-item.style";
|
|
6
|
-
import StyledIcon from "../../../icon/icon.style";
|
|
7
6
|
import StyledSearch from "../../../search/search.style";
|
|
8
7
|
import menuConfigVariants from "../../menu.config";
|
|
9
8
|
const StyledSubmenuWrapper = styled.div`
|
|
@@ -115,12 +114,6 @@ const StyledSubmenu = styled.ul`
|
|
|
115
114
|
text-decoration: none;
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
> ${StyledIcon} {
|
|
119
|
-
width: 16px;
|
|
120
|
-
height: 16px;
|
|
121
|
-
margin-right: 5px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
117
|
${StyledSearch} span > [data-component="icon"] {
|
|
125
118
|
color: var(--colorsUtilityMajor200);
|
|
126
119
|
|
|
@@ -136,24 +129,6 @@ const StyledSubmenu = styled.ul`
|
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
|
|
139
|
-
[data-component="icon"] {
|
|
140
|
-
line-height: 16px;
|
|
141
|
-
top: -1px;
|
|
142
|
-
|
|
143
|
-
&:before {
|
|
144
|
-
line-height: unset;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
span {
|
|
148
|
-
vertical-align: middle;
|
|
149
|
-
|
|
150
|
-
svg {
|
|
151
|
-
height: 16px;
|
|
152
|
-
width: 16px;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
132
|
&:before {
|
|
158
133
|
background-color: transparent;
|
|
159
134
|
border-radius: 0 0 4px 4px;
|
|
@@ -126,11 +126,11 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
126
126
|
triggerChange("", false);
|
|
127
127
|
return "";
|
|
128
128
|
}
|
|
129
|
+
triggerChange(match.props.value, false);
|
|
129
130
|
if (isDeleteEvent) {
|
|
130
131
|
setTextValue(newFilterText);
|
|
131
132
|
return match.props.value;
|
|
132
133
|
}
|
|
133
|
-
triggerChange(match.props.value, false);
|
|
134
134
|
if (match.props.text?.toLowerCase().startsWith(newFilterText.toLowerCase())) {
|
|
135
135
|
setTextValue(match.props.text);
|
|
136
136
|
} else {
|
|
@@ -44,8 +44,7 @@ function renderChildren({
|
|
|
44
44
|
"aria-hidden": true,
|
|
45
45
|
disabled,
|
|
46
46
|
color: iconColor(),
|
|
47
|
-
bg: "transparent"
|
|
48
|
-
bgSize: "extra-small"
|
|
47
|
+
bg: "transparent"
|
|
49
48
|
};
|
|
50
49
|
const isValidChildren = children !== undefined && children !== false;
|
|
51
50
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconType && iconPosition === "before" && isValidChildren && /*#__PURE__*/_react.default.createElement(_icon.default, _extends({
|
|
@@ -88,6 +88,8 @@ const StyledButtonToggle = exports.StyledButtonToggle = _styledComponents.defaul
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
${_icon.default} {
|
|
91
|
+
width: 16px;
|
|
92
|
+
height: 16px;
|
|
91
93
|
color: var(--colorsActionMinor500);
|
|
92
94
|
}
|
|
93
95
|
|
|
@@ -162,6 +164,7 @@ const StyledButtonToggleIcon = exports.StyledButtonToggleIcon = _styledComponent
|
|
|
162
164
|
}) => buttonIconSize === "large" && (0, _styledComponents.css)`
|
|
163
165
|
margin-right: 0;
|
|
164
166
|
${_icon.default} {
|
|
167
|
+
margin-left: 0;
|
|
165
168
|
margin-right: 0;
|
|
166
169
|
margin-bottom: 8px;
|
|
167
170
|
height: ${`${iconFontSizes.largeIcon}px`};
|
|
@@ -8,6 +8,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
8
8
|
var _styledSystem = require("styled-system");
|
|
9
9
|
var _base = _interopRequireDefault(require("../../../style/themes/base"));
|
|
10
10
|
var _color = require("../../../style/utils/color");
|
|
11
|
+
var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -100,6 +101,11 @@ const StyledCellContent = exports.StyledCellContent = _styledComponents.default.
|
|
|
100
101
|
display: flex;
|
|
101
102
|
align-items: center;
|
|
102
103
|
line-height: 1em;
|
|
104
|
+
|
|
105
|
+
${_icon.default} {
|
|
106
|
+
width: 16px;
|
|
107
|
+
height: 16px;
|
|
108
|
+
}
|
|
103
109
|
`}
|
|
104
110
|
`;
|
|
105
111
|
StyledFlatTableCell.defaultProps = {
|
|
@@ -8,6 +8,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
8
8
|
var _styledSystem = require("styled-system");
|
|
9
9
|
var _base = _interopRequireDefault(require("../../../style/themes/base"));
|
|
10
10
|
var _color = require("../../../style/utils/color");
|
|
11
|
+
var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -98,5 +99,10 @@ const StyledFlatTableRowHeaderContent = exports.StyledFlatTableRowHeaderContent
|
|
|
98
99
|
display: flex;
|
|
99
100
|
align-items: center;
|
|
100
101
|
line-height: 1em;
|
|
102
|
+
|
|
103
|
+
${_icon.default} {
|
|
104
|
+
width: 16px;
|
|
105
|
+
height: 16px;
|
|
106
|
+
}
|
|
101
107
|
`}
|
|
102
108
|
`;
|
|
@@ -14,15 +14,17 @@ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tag
|
|
|
14
14
|
var _icon = _interopRequireDefault(require("./icon.style"));
|
|
15
15
|
var _iconConfig = require("./icon-config");
|
|
16
16
|
var _tabTitle = require("../tabs/__internal__/tab-title");
|
|
17
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
let deprecatedExtraSmallBgSizeTriggered = false;
|
|
20
22
|
const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
21
23
|
"aria-hidden": ariaHidden,
|
|
22
24
|
ariaLabel,
|
|
23
25
|
bg,
|
|
24
26
|
bgShape,
|
|
25
|
-
bgSize
|
|
27
|
+
bgSize,
|
|
26
28
|
className,
|
|
27
29
|
color,
|
|
28
30
|
disabled,
|
|
@@ -44,6 +46,10 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
44
46
|
...rest
|
|
45
47
|
}, ref) => {
|
|
46
48
|
const flipBehaviourCheck = Array.isArray(tooltipFlipOverrides) && tooltipFlipOverrides.every(override => _iconConfig.ICON_TOOLTIP_POSITIONS.includes(override));
|
|
49
|
+
if (!deprecatedExtraSmallBgSizeTriggered && bgSize === "extra-small") {
|
|
50
|
+
deprecatedExtraSmallBgSizeTriggered = true;
|
|
51
|
+
_logger.default.deprecate("The `extra-small` variant of the `bgSize` prop for `Icon` component has been deprecated and will soon be removed.");
|
|
52
|
+
}
|
|
47
53
|
if (tooltipFlipOverrides) {
|
|
48
54
|
!flipBehaviourCheck ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, `The tooltipFlipOverrides prop supplied to \`Icon\` must be an array containing some or all of ["top", "bottom", "left", "right"].`) : (0, _invariant.default)(false) : void 0;
|
|
49
55
|
}
|
|
@@ -90,7 +96,7 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
90
96
|
"aria-hidden": ariaHidden,
|
|
91
97
|
"aria-label": ariaLabel,
|
|
92
98
|
bg,
|
|
93
|
-
bgSize,
|
|
99
|
+
bgSize: bgSize || fontSize,
|
|
94
100
|
bgShape,
|
|
95
101
|
className: className || undefined,
|
|
96
102
|
color,
|
|
@@ -18,8 +18,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
function adjustIconBgSize(fontSize, bgSize) {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const sizeValues = {
|
|
22
|
+
"extra-small": 1,
|
|
23
|
+
small: 2,
|
|
24
|
+
medium: 3,
|
|
25
|
+
large: 4,
|
|
26
|
+
"extra-large": 5
|
|
27
|
+
};
|
|
28
|
+
if (fontSize && bgSize) {
|
|
29
|
+
const fontSizeValue = sizeValues[fontSize];
|
|
30
|
+
const bgSizeValue = sizeValues[bgSize];
|
|
31
|
+
if (bgSizeValue < fontSizeValue) {
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
console.warn(`[WARNING - Icon] The "${bgSize}" \`bgSize\` is smaller than "${fontSize}" \`fontSize\`, the \`bgSize\` has been auto adjusted to a larger size.`);
|
|
34
|
+
return _iconConfig.default.backgroundSize[fontSize];
|
|
35
|
+
}
|
|
36
|
+
return _iconConfig.default.backgroundSize[bgSize];
|
|
23
37
|
}
|
|
24
38
|
return bgSize ? _iconConfig.default.backgroundSize[bgSize] : undefined;
|
|
25
39
|
}
|
|
@@ -41,6 +55,7 @@ const StyledIcon = _styledComponents.default.span`
|
|
|
41
55
|
let finalHoverColor;
|
|
42
56
|
let bgColor;
|
|
43
57
|
let bgHoverColor;
|
|
58
|
+
const adjustedBgSize = adjustIconBgSize(fontSize, bgSize);
|
|
44
59
|
try {
|
|
45
60
|
if (disabled) {
|
|
46
61
|
finalColor = "var(--colorsYin030)";
|
|
@@ -83,8 +98,8 @@ const StyledIcon = _styledComponents.default.span`
|
|
|
83
98
|
align-items: center;
|
|
84
99
|
display: inline-flex;
|
|
85
100
|
justify-content: center;
|
|
86
|
-
height: ${
|
|
87
|
-
width: ${
|
|
101
|
+
height: ${adjustedBgSize};
|
|
102
|
+
width: ${adjustedBgSize};
|
|
88
103
|
${bgShape ? `border-radius: ${_iconConfig.default.backgroundShape[bgShape]}` : ""};
|
|
89
104
|
|
|
90
105
|
${isInteractive && (0, _styledComponents.css)`
|
|
@@ -61,7 +61,6 @@ const Link = exports.Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
61
61
|
const hasProperAlignment = icon && iconAlign === currentAlignment;
|
|
62
62
|
return hasProperAlignment ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
63
63
|
type: icon,
|
|
64
|
-
bgSize: "extra-small",
|
|
65
64
|
disabled: disabled,
|
|
66
65
|
ariaLabel: removeAriaLabelOnIcon ? undefined : ariaLabel,
|
|
67
66
|
tooltipMessage: tooltipMessage,
|
|
@@ -139,7 +139,7 @@ const StyledLink = exports.StyledLink = _styledComponents.default.span`
|
|
|
139
139
|
position: relative;
|
|
140
140
|
vertical-align: middle;
|
|
141
141
|
${iconAlign === "left" && (0, _styledComponents.css)`
|
|
142
|
-
margin-right: ${hasContent ? "var(--
|
|
142
|
+
margin-right: ${hasContent ? "var(--spacing050)" : 0};
|
|
143
143
|
`}
|
|
144
144
|
${iconAlign === "right" && (0, _styledComponents.css)`
|
|
145
145
|
margin-right: 0;
|
|
@@ -9,7 +9,6 @@ var _themes = require("../../../../style/themes");
|
|
|
9
9
|
var _link = require("../../../link/link.style");
|
|
10
10
|
var _menu = require("../../menu.style");
|
|
11
11
|
var _menuItem = _interopRequireDefault(require("../../menu-item/menu-item.style"));
|
|
12
|
-
var _icon = _interopRequireDefault(require("../../../icon/icon.style"));
|
|
13
12
|
var _search = _interopRequireDefault(require("../../../search/search.style"));
|
|
14
13
|
var _menu2 = _interopRequireDefault(require("../../menu.config"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -124,12 +123,6 @@ const StyledSubmenu = exports.StyledSubmenu = _styledComponents.default.ul`
|
|
|
124
123
|
text-decoration: none;
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
> ${_icon.default} {
|
|
128
|
-
width: 16px;
|
|
129
|
-
height: 16px;
|
|
130
|
-
margin-right: 5px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
126
|
${_search.default} span > [data-component="icon"] {
|
|
134
127
|
color: var(--colorsUtilityMajor200);
|
|
135
128
|
|
|
@@ -145,24 +138,6 @@ const StyledSubmenu = exports.StyledSubmenu = _styledComponents.default.ul`
|
|
|
145
138
|
}
|
|
146
139
|
}
|
|
147
140
|
|
|
148
|
-
[data-component="icon"] {
|
|
149
|
-
line-height: 16px;
|
|
150
|
-
top: -1px;
|
|
151
|
-
|
|
152
|
-
&:before {
|
|
153
|
-
line-height: unset;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
span {
|
|
157
|
-
vertical-align: middle;
|
|
158
|
-
|
|
159
|
-
svg {
|
|
160
|
-
height: 16px;
|
|
161
|
-
width: 16px;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
141
|
&:before {
|
|
167
142
|
background-color: transparent;
|
|
168
143
|
border-radius: 0 0 4px 4px;
|
|
@@ -135,11 +135,11 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
|
|
|
135
135
|
triggerChange("", false);
|
|
136
136
|
return "";
|
|
137
137
|
}
|
|
138
|
+
triggerChange(match.props.value, false);
|
|
138
139
|
if (isDeleteEvent) {
|
|
139
140
|
setTextValue(newFilterText);
|
|
140
141
|
return match.props.value;
|
|
141
142
|
}
|
|
142
|
-
triggerChange(match.props.value, false);
|
|
143
143
|
if (match.props.text?.toLowerCase().startsWith(newFilterText.toLowerCase())) {
|
|
144
144
|
setTextValue(match.props.text);
|
|
145
145
|
} else {
|