carbon-react 111.19.0 → 111.20.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/components/box/box.component.js +11 -0
- package/esm/components/icon-button/icon-button.component.d.ts +2 -2
- package/esm/components/icon-button/icon-button.component.js +159 -5
- package/esm/components/icon-button/icon-button.style.js +4 -3
- package/esm/components/menu/menu-item/menu-item.component.js +3 -2
- package/esm/components/menu/menu-item/menu-item.style.js +28 -10
- package/esm/components/typography/typography.component.js +10 -0
- package/lib/components/box/box.component.js +13 -0
- package/lib/components/icon-button/icon-button.component.d.ts +2 -2
- package/lib/components/icon-button/icon-button.component.js +159 -6
- package/lib/components/icon-button/icon-button.style.js +3 -2
- package/lib/components/menu/menu-item/menu-item.component.js +3 -2
- package/lib/components/menu/menu-item/menu-item.style.js +27 -8
- package/lib/components/typography/typography.component.js +12 -0
- package/package.json +1 -1
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { space, layout, flexbox, position } from "styled-system";
|
|
3
|
+
import Logger from "../../__internal__/utils/logger";
|
|
3
4
|
import BaseTheme from "../../style/themes/base";
|
|
4
5
|
import styledColor from "../../style/utils/color";
|
|
5
6
|
import boxConfig from "./box.config";
|
|
6
7
|
const GAP_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
8
|
+
let isDeprecationWarningTriggered = false;
|
|
7
9
|
export const Box = styled.div`
|
|
10
|
+
${() => {
|
|
11
|
+
if (!isDeprecationWarningTriggered) {
|
|
12
|
+
isDeprecationWarningTriggered = true;
|
|
13
|
+
Logger.deprecate("Previous props that could be spread to the `Box` component are being removed. Only props documented in the intefaces will be supported.");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return css``;
|
|
17
|
+
}}
|
|
18
|
+
|
|
8
19
|
${space}
|
|
9
20
|
${layout}
|
|
10
21
|
${flexbox}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { IconProps } from "../icon";
|
|
4
|
-
export interface IconButtonProps extends
|
|
4
|
+
export interface IconButtonProps extends SpaceProps {
|
|
5
5
|
/** Prop to specify the aria-label of the icon-button component */
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Icon meant to be rendered, should be an Icon component */
|
|
@@ -4,7 +4,6 @@ import React, { useState, useCallback } from "react";
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import Events from "../../__internal__/utils/helpers/events";
|
|
6
6
|
import StyledIconButton from "./icon-button.style";
|
|
7
|
-
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
8
7
|
import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
9
8
|
const IconButton = /*#__PURE__*/React.forwardRef(({
|
|
10
9
|
"aria-label": ariaLabel,
|
|
@@ -14,7 +13,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
|
|
|
14
13
|
...rest
|
|
15
14
|
}, ref) => {
|
|
16
15
|
const [internalRef, setInternalRef] = useState();
|
|
17
|
-
const marginProps = filterStyledSystemMarginProps(rest);
|
|
18
16
|
|
|
19
17
|
const handleKeyDown = e => {
|
|
20
18
|
if (Events.isEnterKey(e) || Events.isSpaceKey(e)) {
|
|
@@ -35,13 +33,15 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
|
|
|
35
33
|
if (typeof ref === "object") ref.current = reference;
|
|
36
34
|
if (typeof ref === "function") ref(reference);
|
|
37
35
|
}, [ref]);
|
|
38
|
-
return /*#__PURE__*/React.createElement(StyledIconButton, _extends({
|
|
36
|
+
return /*#__PURE__*/React.createElement(StyledIconButton, _extends({
|
|
37
|
+
p: 0
|
|
38
|
+
}, rest, {
|
|
39
39
|
"aria-label": ariaLabel,
|
|
40
40
|
onKeyDown: handleKeyDown,
|
|
41
41
|
onClick: handleOnClick,
|
|
42
42
|
ref: setRefs,
|
|
43
43
|
disabled: disabled
|
|
44
|
-
}
|
|
44
|
+
}), /*#__PURE__*/React.createElement(TooltipProvider, {
|
|
45
45
|
disabled: disabled,
|
|
46
46
|
focusable: false,
|
|
47
47
|
target: internalRef
|
|
@@ -209,7 +209,161 @@ IconButton.propTypes = {
|
|
|
209
209
|
"onBlur": PropTypes.func,
|
|
210
210
|
"onFocus": PropTypes.func,
|
|
211
211
|
"onMouseEnter": PropTypes.func,
|
|
212
|
-
"onMouseLeave": PropTypes.func
|
|
212
|
+
"onMouseLeave": PropTypes.func,
|
|
213
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
214
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
215
|
+
"description": PropTypes.string,
|
|
216
|
+
"toString": PropTypes.func.isRequired,
|
|
217
|
+
"valueOf": PropTypes.func.isRequired
|
|
218
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
219
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
220
|
+
"description": PropTypes.string,
|
|
221
|
+
"toString": PropTypes.func.isRequired,
|
|
222
|
+
"valueOf": PropTypes.func.isRequired
|
|
223
|
+
}), PropTypes.string]),
|
|
224
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
225
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
226
|
+
"description": PropTypes.string,
|
|
227
|
+
"toString": PropTypes.func.isRequired,
|
|
228
|
+
"valueOf": PropTypes.func.isRequired
|
|
229
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
230
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
231
|
+
"description": PropTypes.string,
|
|
232
|
+
"toString": PropTypes.func.isRequired,
|
|
233
|
+
"valueOf": PropTypes.func.isRequired
|
|
234
|
+
}), PropTypes.string]),
|
|
235
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
236
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
237
|
+
"description": PropTypes.string,
|
|
238
|
+
"toString": PropTypes.func.isRequired,
|
|
239
|
+
"valueOf": PropTypes.func.isRequired
|
|
240
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
241
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
242
|
+
"description": PropTypes.string,
|
|
243
|
+
"toString": PropTypes.func.isRequired,
|
|
244
|
+
"valueOf": PropTypes.func.isRequired
|
|
245
|
+
}), PropTypes.string]),
|
|
246
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
247
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
248
|
+
"description": PropTypes.string,
|
|
249
|
+
"toString": PropTypes.func.isRequired,
|
|
250
|
+
"valueOf": PropTypes.func.isRequired
|
|
251
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
252
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
253
|
+
"description": PropTypes.string,
|
|
254
|
+
"toString": PropTypes.func.isRequired,
|
|
255
|
+
"valueOf": PropTypes.func.isRequired
|
|
256
|
+
}), PropTypes.string]),
|
|
257
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
258
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
259
|
+
"description": PropTypes.string,
|
|
260
|
+
"toString": PropTypes.func.isRequired,
|
|
261
|
+
"valueOf": PropTypes.func.isRequired
|
|
262
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
263
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
264
|
+
"description": PropTypes.string,
|
|
265
|
+
"toString": PropTypes.func.isRequired,
|
|
266
|
+
"valueOf": PropTypes.func.isRequired
|
|
267
|
+
}), PropTypes.string]),
|
|
268
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
269
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
270
|
+
"description": PropTypes.string,
|
|
271
|
+
"toString": PropTypes.func.isRequired,
|
|
272
|
+
"valueOf": PropTypes.func.isRequired
|
|
273
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
274
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
275
|
+
"description": PropTypes.string,
|
|
276
|
+
"toString": PropTypes.func.isRequired,
|
|
277
|
+
"valueOf": PropTypes.func.isRequired
|
|
278
|
+
}), PropTypes.string]),
|
|
279
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
280
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
281
|
+
"description": PropTypes.string,
|
|
282
|
+
"toString": PropTypes.func.isRequired,
|
|
283
|
+
"valueOf": PropTypes.func.isRequired
|
|
284
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
285
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
286
|
+
"description": PropTypes.string,
|
|
287
|
+
"toString": PropTypes.func.isRequired,
|
|
288
|
+
"valueOf": PropTypes.func.isRequired
|
|
289
|
+
}), PropTypes.string]),
|
|
290
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
291
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
292
|
+
"description": PropTypes.string,
|
|
293
|
+
"toString": PropTypes.func.isRequired,
|
|
294
|
+
"valueOf": PropTypes.func.isRequired
|
|
295
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
296
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
297
|
+
"description": PropTypes.string,
|
|
298
|
+
"toString": PropTypes.func.isRequired,
|
|
299
|
+
"valueOf": PropTypes.func.isRequired
|
|
300
|
+
}), PropTypes.string]),
|
|
301
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
302
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
303
|
+
"description": PropTypes.string,
|
|
304
|
+
"toString": PropTypes.func.isRequired,
|
|
305
|
+
"valueOf": PropTypes.func.isRequired
|
|
306
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
307
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
308
|
+
"description": PropTypes.string,
|
|
309
|
+
"toString": PropTypes.func.isRequired,
|
|
310
|
+
"valueOf": PropTypes.func.isRequired
|
|
311
|
+
}), PropTypes.string]),
|
|
312
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
313
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
314
|
+
"description": PropTypes.string,
|
|
315
|
+
"toString": PropTypes.func.isRequired,
|
|
316
|
+
"valueOf": PropTypes.func.isRequired
|
|
317
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
318
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
319
|
+
"description": PropTypes.string,
|
|
320
|
+
"toString": PropTypes.func.isRequired,
|
|
321
|
+
"valueOf": PropTypes.func.isRequired
|
|
322
|
+
}), PropTypes.string]),
|
|
323
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
324
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
325
|
+
"description": PropTypes.string,
|
|
326
|
+
"toString": PropTypes.func.isRequired,
|
|
327
|
+
"valueOf": PropTypes.func.isRequired
|
|
328
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
329
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
330
|
+
"description": PropTypes.string,
|
|
331
|
+
"toString": PropTypes.func.isRequired,
|
|
332
|
+
"valueOf": PropTypes.func.isRequired
|
|
333
|
+
}), PropTypes.string]),
|
|
334
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
335
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
336
|
+
"description": PropTypes.string,
|
|
337
|
+
"toString": PropTypes.func.isRequired,
|
|
338
|
+
"valueOf": PropTypes.func.isRequired
|
|
339
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
340
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
341
|
+
"description": PropTypes.string,
|
|
342
|
+
"toString": PropTypes.func.isRequired,
|
|
343
|
+
"valueOf": PropTypes.func.isRequired
|
|
344
|
+
}), PropTypes.string]),
|
|
345
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
346
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
347
|
+
"description": PropTypes.string,
|
|
348
|
+
"toString": PropTypes.func.isRequired,
|
|
349
|
+
"valueOf": PropTypes.func.isRequired
|
|
350
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
351
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
352
|
+
"description": PropTypes.string,
|
|
353
|
+
"toString": PropTypes.func.isRequired,
|
|
354
|
+
"valueOf": PropTypes.func.isRequired
|
|
355
|
+
}), PropTypes.string]),
|
|
356
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
357
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
358
|
+
"description": PropTypes.string,
|
|
359
|
+
"toString": PropTypes.func.isRequired,
|
|
360
|
+
"valueOf": PropTypes.func.isRequired
|
|
361
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
362
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
363
|
+
"description": PropTypes.string,
|
|
364
|
+
"toString": PropTypes.func.isRequired,
|
|
365
|
+
"valueOf": PropTypes.func.isRequired
|
|
366
|
+
}), PropTypes.string])
|
|
213
367
|
};
|
|
214
368
|
IconButton.displayName = "IconButton";
|
|
215
369
|
export default IconButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import {
|
|
2
|
+
import { space } from "styled-system";
|
|
3
3
|
import StyledIcon from "../icon/icon.style";
|
|
4
4
|
import { baseTheme } from "../../style/themes";
|
|
5
5
|
const StyledIconButton = styled.button.attrs({
|
|
@@ -8,10 +8,11 @@ const StyledIconButton = styled.button.attrs({
|
|
|
8
8
|
${({
|
|
9
9
|
disabled
|
|
10
10
|
}) => css`
|
|
11
|
-
|
|
11
|
+
&& {
|
|
12
|
+
${space}
|
|
13
|
+
}
|
|
12
14
|
background: transparent;
|
|
13
15
|
border: none;
|
|
14
|
-
padding: 0;
|
|
15
16
|
|
|
16
17
|
&:focus {
|
|
17
18
|
background-color: transparent;
|
|
@@ -109,9 +109,9 @@ const MenuItem = ({
|
|
|
109
109
|
const getTitle = title => maxWidth && typeof title === "string" ? title : "";
|
|
110
110
|
|
|
111
111
|
const itemMaxWidth = !inFullscreenView ? maxWidth : undefined;
|
|
112
|
+
const asPassiveItem = !(onClick || href);
|
|
112
113
|
|
|
113
114
|
if (submenu) {
|
|
114
|
-
const asPassiveItem = !(onClick || href);
|
|
115
115
|
return /*#__PURE__*/React.createElement(StyledMenuItem, _extends({
|
|
116
116
|
"data-component": "menu-item",
|
|
117
117
|
menuType: menuContext.menuType,
|
|
@@ -152,7 +152,8 @@ const MenuItem = ({
|
|
|
152
152
|
}, elementProps, {
|
|
153
153
|
ariaLabel: ariaLabel,
|
|
154
154
|
maxWidth: maxWidth,
|
|
155
|
-
inFullscreenView: inFullscreenView
|
|
155
|
+
inFullscreenView: inFullscreenView,
|
|
156
|
+
asPassiveItem: asPassiveItem
|
|
156
157
|
}), clonedChildren));
|
|
157
158
|
};
|
|
158
159
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { StyledLink } from "../../link/link.style";
|
|
3
|
-
import
|
|
3
|
+
import StyledIcon from "../../icon/icon.style";
|
|
4
|
+
import StyledIconButton from "../../icon-button/icon-button.style";
|
|
4
5
|
import menuConfigVariants from "../menu.config";
|
|
5
6
|
const StyledMenuItemWrapper = styled.a`
|
|
6
7
|
${({
|
|
@@ -16,7 +17,8 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
16
17
|
maxWidth,
|
|
17
18
|
inFullscreenView,
|
|
18
19
|
overrideColor,
|
|
19
|
-
as
|
|
20
|
+
as,
|
|
21
|
+
asPassiveItem
|
|
20
22
|
}) => css`
|
|
21
23
|
display: inline-block;
|
|
22
24
|
font-size: 14px;
|
|
@@ -72,12 +74,28 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
72
74
|
}
|
|
73
75
|
`}
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
${asPassiveItem ? `
|
|
78
|
+
${StyledIconButton} {
|
|
79
|
+
> span {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
margin-right: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:focus {
|
|
85
|
+
outline: none;
|
|
86
|
+
[data-component="icon"] {
|
|
87
|
+
color: ${menuConfigVariants[menuType].color};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
` : `
|
|
92
|
+
a,
|
|
93
|
+
${StyledLink} a,
|
|
94
|
+
button,
|
|
95
|
+
${StyledLink} button {
|
|
96
|
+
padding: 0 16px;
|
|
97
|
+
}
|
|
98
|
+
`}
|
|
81
99
|
|
|
82
100
|
button,
|
|
83
101
|
${StyledLink} button {
|
|
@@ -99,7 +117,7 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
99
117
|
color: ${menuConfigVariants[menuType].color};
|
|
100
118
|
}
|
|
101
119
|
|
|
102
|
-
${
|
|
120
|
+
${StyledIcon} {
|
|
103
121
|
bottom: 1px;
|
|
104
122
|
}
|
|
105
123
|
}
|
|
@@ -192,7 +210,7 @@ const StyledMenuItemWrapper = styled.a`
|
|
|
192
210
|
|
|
193
211
|
${showDropdownArrow && css`
|
|
194
212
|
> a,
|
|
195
|
-
> button {
|
|
213
|
+
> button:not(${StyledIconButton}) {
|
|
196
214
|
padding-right: 32px;
|
|
197
215
|
}
|
|
198
216
|
|
|
@@ -2,6 +2,7 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { space } from "styled-system";
|
|
3
3
|
import styledColor from "../../style/utils/color";
|
|
4
4
|
import baseTheme from "../../style/themes/base";
|
|
5
|
+
import Logger from "../../__internal__/utils/logger";
|
|
5
6
|
const VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
6
7
|
|
|
7
8
|
const getAs = variant => {
|
|
@@ -146,6 +147,7 @@ const getDecoration = variant => {
|
|
|
146
147
|
return "none";
|
|
147
148
|
};
|
|
148
149
|
|
|
150
|
+
let isDeprecationWarningTriggered = false;
|
|
149
151
|
const Typography = styled.span.attrs(({
|
|
150
152
|
variant,
|
|
151
153
|
as,
|
|
@@ -165,6 +167,14 @@ const Typography = styled.span.attrs(({
|
|
|
165
167
|
defaultMargin: variant === "p" ? "0 0 16px" : "0"
|
|
166
168
|
};
|
|
167
169
|
})`
|
|
170
|
+
${() => {
|
|
171
|
+
if (!isDeprecationWarningTriggered) {
|
|
172
|
+
isDeprecationWarningTriggered = true;
|
|
173
|
+
Logger.deprecate("Previous props that could be spread to the `Typography` component are being removed. Only props documented in the intefaces will be supported.");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return css``;
|
|
177
|
+
}}
|
|
168
178
|
${({
|
|
169
179
|
size,
|
|
170
180
|
weight,
|
|
@@ -9,6 +9,8 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _styledSystem = require("styled-system");
|
|
11
11
|
|
|
12
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
13
|
+
|
|
12
14
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
15
|
|
|
14
16
|
var _color = _interopRequireDefault(require("../../style/utils/color"));
|
|
@@ -22,7 +24,18 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
22
24
|
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; }
|
|
23
25
|
|
|
24
26
|
const GAP_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
27
|
+
let isDeprecationWarningTriggered = false;
|
|
25
28
|
const Box = _styledComponents.default.div`
|
|
29
|
+
${() => {
|
|
30
|
+
if (!isDeprecationWarningTriggered) {
|
|
31
|
+
isDeprecationWarningTriggered = true;
|
|
32
|
+
|
|
33
|
+
_logger.default.deprecate("Previous props that could be spread to the `Box` component are being removed. Only props documented in the intefaces will be supported.");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (0, _styledComponents.css)``;
|
|
37
|
+
}}
|
|
38
|
+
|
|
26
39
|
${_styledSystem.space}
|
|
27
40
|
${_styledSystem.layout}
|
|
28
41
|
${_styledSystem.flexbox}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { IconProps } from "../icon";
|
|
4
|
-
export interface IconButtonProps extends
|
|
4
|
+
export interface IconButtonProps extends SpaceProps {
|
|
5
5
|
/** Prop to specify the aria-label of the icon-button component */
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Icon meant to be rendered, should be an Icon component */
|
|
@@ -13,8 +13,6 @@ var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/e
|
|
|
13
13
|
|
|
14
14
|
var _iconButton = _interopRequireDefault(require("./icon-button.style"));
|
|
15
15
|
|
|
16
|
-
var _utils = require("../../style/utils");
|
|
17
|
-
|
|
18
16
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
19
17
|
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -33,7 +31,6 @@ const IconButton = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
33
31
|
...rest
|
|
34
32
|
}, ref) => {
|
|
35
33
|
const [internalRef, setInternalRef] = (0, _react.useState)();
|
|
36
|
-
const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
|
|
37
34
|
|
|
38
35
|
const handleKeyDown = e => {
|
|
39
36
|
if (_events.default.isEnterKey(e) || _events.default.isSpaceKey(e)) {
|
|
@@ -54,13 +51,15 @@ const IconButton = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
54
51
|
if (typeof ref === "object") ref.current = reference;
|
|
55
52
|
if (typeof ref === "function") ref(reference);
|
|
56
53
|
}, [ref]);
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(_iconButton.default, _extends({
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_iconButton.default, _extends({
|
|
55
|
+
p: 0
|
|
56
|
+
}, rest, {
|
|
58
57
|
"aria-label": ariaLabel,
|
|
59
58
|
onKeyDown: handleKeyDown,
|
|
60
59
|
onClick: handleOnClick,
|
|
61
60
|
ref: setRefs,
|
|
62
61
|
disabled: disabled
|
|
63
|
-
}
|
|
62
|
+
}), /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
64
63
|
disabled: disabled,
|
|
65
64
|
focusable: false,
|
|
66
65
|
target: internalRef
|
|
@@ -229,7 +228,161 @@ IconButton.propTypes = {
|
|
|
229
228
|
"onBlur": _propTypes.default.func,
|
|
230
229
|
"onFocus": _propTypes.default.func,
|
|
231
230
|
"onMouseEnter": _propTypes.default.func,
|
|
232
|
-
"onMouseLeave": _propTypes.default.func
|
|
231
|
+
"onMouseLeave": _propTypes.default.func,
|
|
232
|
+
"p": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
233
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
234
|
+
"description": _propTypes.default.string,
|
|
235
|
+
"toString": _propTypes.default.func.isRequired,
|
|
236
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
237
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
238
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
239
|
+
"description": _propTypes.default.string,
|
|
240
|
+
"toString": _propTypes.default.func.isRequired,
|
|
241
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
242
|
+
}), _propTypes.default.string]),
|
|
243
|
+
"padding": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
244
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
245
|
+
"description": _propTypes.default.string,
|
|
246
|
+
"toString": _propTypes.default.func.isRequired,
|
|
247
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
248
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
249
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
250
|
+
"description": _propTypes.default.string,
|
|
251
|
+
"toString": _propTypes.default.func.isRequired,
|
|
252
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
253
|
+
}), _propTypes.default.string]),
|
|
254
|
+
"paddingBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
255
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
256
|
+
"description": _propTypes.default.string,
|
|
257
|
+
"toString": _propTypes.default.func.isRequired,
|
|
258
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
259
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
260
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
261
|
+
"description": _propTypes.default.string,
|
|
262
|
+
"toString": _propTypes.default.func.isRequired,
|
|
263
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
264
|
+
}), _propTypes.default.string]),
|
|
265
|
+
"paddingLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
266
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
267
|
+
"description": _propTypes.default.string,
|
|
268
|
+
"toString": _propTypes.default.func.isRequired,
|
|
269
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
270
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
271
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
272
|
+
"description": _propTypes.default.string,
|
|
273
|
+
"toString": _propTypes.default.func.isRequired,
|
|
274
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
275
|
+
}), _propTypes.default.string]),
|
|
276
|
+
"paddingRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
277
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
278
|
+
"description": _propTypes.default.string,
|
|
279
|
+
"toString": _propTypes.default.func.isRequired,
|
|
280
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
281
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
282
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
283
|
+
"description": _propTypes.default.string,
|
|
284
|
+
"toString": _propTypes.default.func.isRequired,
|
|
285
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
286
|
+
}), _propTypes.default.string]),
|
|
287
|
+
"paddingTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
288
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
289
|
+
"description": _propTypes.default.string,
|
|
290
|
+
"toString": _propTypes.default.func.isRequired,
|
|
291
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
292
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
293
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
294
|
+
"description": _propTypes.default.string,
|
|
295
|
+
"toString": _propTypes.default.func.isRequired,
|
|
296
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
297
|
+
}), _propTypes.default.string]),
|
|
298
|
+
"paddingX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
299
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
300
|
+
"description": _propTypes.default.string,
|
|
301
|
+
"toString": _propTypes.default.func.isRequired,
|
|
302
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
303
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
304
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
305
|
+
"description": _propTypes.default.string,
|
|
306
|
+
"toString": _propTypes.default.func.isRequired,
|
|
307
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
308
|
+
}), _propTypes.default.string]),
|
|
309
|
+
"paddingY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
310
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
311
|
+
"description": _propTypes.default.string,
|
|
312
|
+
"toString": _propTypes.default.func.isRequired,
|
|
313
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
314
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
315
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
316
|
+
"description": _propTypes.default.string,
|
|
317
|
+
"toString": _propTypes.default.func.isRequired,
|
|
318
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
319
|
+
}), _propTypes.default.string]),
|
|
320
|
+
"pb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
321
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
322
|
+
"description": _propTypes.default.string,
|
|
323
|
+
"toString": _propTypes.default.func.isRequired,
|
|
324
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
325
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
326
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
327
|
+
"description": _propTypes.default.string,
|
|
328
|
+
"toString": _propTypes.default.func.isRequired,
|
|
329
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
330
|
+
}), _propTypes.default.string]),
|
|
331
|
+
"pl": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
332
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
333
|
+
"description": _propTypes.default.string,
|
|
334
|
+
"toString": _propTypes.default.func.isRequired,
|
|
335
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
336
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
337
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
338
|
+
"description": _propTypes.default.string,
|
|
339
|
+
"toString": _propTypes.default.func.isRequired,
|
|
340
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
341
|
+
}), _propTypes.default.string]),
|
|
342
|
+
"pr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
343
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
344
|
+
"description": _propTypes.default.string,
|
|
345
|
+
"toString": _propTypes.default.func.isRequired,
|
|
346
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
347
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
348
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
349
|
+
"description": _propTypes.default.string,
|
|
350
|
+
"toString": _propTypes.default.func.isRequired,
|
|
351
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
352
|
+
}), _propTypes.default.string]),
|
|
353
|
+
"pt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
354
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
355
|
+
"description": _propTypes.default.string,
|
|
356
|
+
"toString": _propTypes.default.func.isRequired,
|
|
357
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
358
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
359
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
360
|
+
"description": _propTypes.default.string,
|
|
361
|
+
"toString": _propTypes.default.func.isRequired,
|
|
362
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
363
|
+
}), _propTypes.default.string]),
|
|
364
|
+
"px": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
365
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
366
|
+
"description": _propTypes.default.string,
|
|
367
|
+
"toString": _propTypes.default.func.isRequired,
|
|
368
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
369
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
370
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
371
|
+
"description": _propTypes.default.string,
|
|
372
|
+
"toString": _propTypes.default.func.isRequired,
|
|
373
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
374
|
+
}), _propTypes.default.string]),
|
|
375
|
+
"py": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
376
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
377
|
+
"description": _propTypes.default.string,
|
|
378
|
+
"toString": _propTypes.default.func.isRequired,
|
|
379
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
380
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
381
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
382
|
+
"description": _propTypes.default.string,
|
|
383
|
+
"toString": _propTypes.default.func.isRequired,
|
|
384
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
385
|
+
}), _propTypes.default.string])
|
|
233
386
|
};
|
|
234
387
|
IconButton.displayName = "IconButton";
|
|
235
388
|
var _default = IconButton;
|
|
@@ -25,10 +25,11 @@ const StyledIconButton = _styledComponents.default.button.attrs({
|
|
|
25
25
|
${({
|
|
26
26
|
disabled
|
|
27
27
|
}) => (0, _styledComponents.css)`
|
|
28
|
-
|
|
28
|
+
&& {
|
|
29
|
+
${_styledSystem.space}
|
|
30
|
+
}
|
|
29
31
|
background: transparent;
|
|
30
32
|
border: none;
|
|
31
|
-
padding: 0;
|
|
32
33
|
|
|
33
34
|
&:focus {
|
|
34
35
|
background-color: transparent;
|
|
@@ -135,9 +135,9 @@ const MenuItem = ({
|
|
|
135
135
|
const getTitle = title => maxWidth && typeof title === "string" ? title : "";
|
|
136
136
|
|
|
137
137
|
const itemMaxWidth = !inFullscreenView ? maxWidth : undefined;
|
|
138
|
+
const asPassiveItem = !(onClick || href);
|
|
138
139
|
|
|
139
140
|
if (submenu) {
|
|
140
|
-
const asPassiveItem = !(onClick || href);
|
|
141
141
|
return /*#__PURE__*/_react.default.createElement(_menu2.StyledMenuItem, _extends({
|
|
142
142
|
"data-component": "menu-item",
|
|
143
143
|
menuType: menuContext.menuType,
|
|
@@ -178,7 +178,8 @@ const MenuItem = ({
|
|
|
178
178
|
}, elementProps, {
|
|
179
179
|
ariaLabel: ariaLabel,
|
|
180
180
|
maxWidth: maxWidth,
|
|
181
|
-
inFullscreenView: inFullscreenView
|
|
181
|
+
inFullscreenView: inFullscreenView,
|
|
182
|
+
asPassiveItem: asPassiveItem
|
|
182
183
|
}), clonedChildren));
|
|
183
184
|
};
|
|
184
185
|
|
|
@@ -11,6 +11,8 @@ var _link = require("../../link/link.style");
|
|
|
11
11
|
|
|
12
12
|
var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
13
13
|
|
|
14
|
+
var _iconButton = _interopRequireDefault(require("../../icon-button/icon-button.style"));
|
|
15
|
+
|
|
14
16
|
var _menu = _interopRequireDefault(require("../menu.config"));
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -33,7 +35,8 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
33
35
|
maxWidth,
|
|
34
36
|
inFullscreenView,
|
|
35
37
|
overrideColor,
|
|
36
|
-
as
|
|
38
|
+
as,
|
|
39
|
+
asPassiveItem
|
|
37
40
|
}) => (0, _styledComponents.css)`
|
|
38
41
|
display: inline-block;
|
|
39
42
|
font-size: 14px;
|
|
@@ -89,12 +92,28 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
89
92
|
}
|
|
90
93
|
`}
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
${asPassiveItem ? `
|
|
96
|
+
${_iconButton.default} {
|
|
97
|
+
> span {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
margin-right: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:focus {
|
|
103
|
+
outline: none;
|
|
104
|
+
[data-component="icon"] {
|
|
105
|
+
color: ${_menu.default[menuType].color};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
` : `
|
|
110
|
+
a,
|
|
111
|
+
${_link.StyledLink} a,
|
|
112
|
+
button,
|
|
113
|
+
${_link.StyledLink} button {
|
|
114
|
+
padding: 0 16px;
|
|
115
|
+
}
|
|
116
|
+
`}
|
|
98
117
|
|
|
99
118
|
button,
|
|
100
119
|
${_link.StyledLink} button {
|
|
@@ -209,7 +228,7 @@ const StyledMenuItemWrapper = _styledComponents.default.a`
|
|
|
209
228
|
|
|
210
229
|
${showDropdownArrow && (0, _styledComponents.css)`
|
|
211
230
|
> a,
|
|
212
|
-
> button {
|
|
231
|
+
> button:not(${_iconButton.default}) {
|
|
213
232
|
padding-right: 32px;
|
|
214
233
|
}
|
|
215
234
|
|
|
@@ -13,6 +13,8 @@ var _color = _interopRequireDefault(require("../../style/utils/color"));
|
|
|
13
13
|
|
|
14
14
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
15
15
|
|
|
16
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -163,6 +165,7 @@ const getDecoration = variant => {
|
|
|
163
165
|
return "none";
|
|
164
166
|
};
|
|
165
167
|
|
|
168
|
+
let isDeprecationWarningTriggered = false;
|
|
166
169
|
const Typography = _styledComponents.default.span.attrs(({
|
|
167
170
|
variant,
|
|
168
171
|
as,
|
|
@@ -182,6 +185,15 @@ const Typography = _styledComponents.default.span.attrs(({
|
|
|
182
185
|
defaultMargin: variant === "p" ? "0 0 16px" : "0"
|
|
183
186
|
};
|
|
184
187
|
})`
|
|
188
|
+
${() => {
|
|
189
|
+
if (!isDeprecationWarningTriggered) {
|
|
190
|
+
isDeprecationWarningTriggered = true;
|
|
191
|
+
|
|
192
|
+
_logger.default.deprecate("Previous props that could be spread to the `Typography` component are being removed. Only props documented in the intefaces will be supported.");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (0, _styledComponents.css)``;
|
|
196
|
+
}}
|
|
185
197
|
${({
|
|
186
198
|
size,
|
|
187
199
|
weight,
|