carbon-react 111.19.0 → 111.21.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/multi-action-button/multi-action-button.component.d.ts +3 -2
- package/esm/components/multi-action-button/multi-action-button.component.js +105 -2
- package/esm/components/multi-action-button/multi-action-button.style.d.ts +3 -3
- package/esm/components/multi-action-button/multi-action-button.style.js +13 -0
- 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/multi-action-button/multi-action-button.component.d.ts +3 -2
- package/lib/components/multi-action-button/multi-action-button.component.js +105 -2
- package/lib/components/multi-action-button/multi-action-button.style.d.ts +3 -3
- package/lib/components/multi-action-button/multi-action-button.style.js +14 -0
- 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
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WidthProps } from "styled-system";
|
|
2
3
|
import { SplitButtonProps } from "../split-button";
|
|
3
|
-
export interface MultiActionButtonProps extends Omit<SplitButtonProps, "buttonType"> {
|
|
4
|
+
export interface MultiActionButtonProps extends WidthProps, Omit<SplitButtonProps, "buttonType"> {
|
|
4
5
|
/** Button type: "primary" | "secondary" | "tertiary" */
|
|
5
6
|
buttonType?: "primary" | "secondary" | "tertiary";
|
|
6
7
|
/** Second text child, renders under main text, only when size is "large" */
|
|
7
8
|
subtext?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const MultiActionButton: ({ align, disabled, buttonType, size, children, text, subtext, "data-element": dataElement, "data-role": dataRole, ...rest }: MultiActionButtonProps) => JSX.Element;
|
|
10
|
+
export declare const MultiActionButton: ({ align, disabled, buttonType, size, children, text, subtext, width, "data-element": dataElement, "data-role": dataRole, ...rest }: MultiActionButtonProps) => JSX.Element;
|
|
10
11
|
export default MultiActionButton;
|
|
@@ -18,6 +18,7 @@ const MultiActionButton = ({
|
|
|
18
18
|
children,
|
|
19
19
|
text,
|
|
20
20
|
subtext,
|
|
21
|
+
width,
|
|
21
22
|
"data-element": dataElement,
|
|
22
23
|
"data-role": dataRole,
|
|
23
24
|
...rest
|
|
@@ -124,7 +125,8 @@ const MultiActionButton = ({
|
|
|
124
125
|
"data-component": "multi-action-button",
|
|
125
126
|
"data-element": dataElement,
|
|
126
127
|
"data-role": dataRole,
|
|
127
|
-
displayed: showAdditionalButtons
|
|
128
|
+
displayed: showAdditionalButtons,
|
|
129
|
+
width: width
|
|
128
130
|
}, filterStyledSystemMarginProps(rest)), /*#__PURE__*/React.createElement(Button, _extends({
|
|
129
131
|
"aria-haspopup": "true",
|
|
130
132
|
"aria-expanded": showAdditionalButtons,
|
|
@@ -621,7 +623,108 @@ MultiActionButton.propTypes = {
|
|
|
621
623
|
"typeof": PropTypes.string,
|
|
622
624
|
"unselectable": PropTypes.oneOf(["off", "on"]),
|
|
623
625
|
"value": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string]),
|
|
624
|
-
"vocab": PropTypes.string
|
|
626
|
+
"vocab": PropTypes.string,
|
|
627
|
+
"width": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
628
|
+
"__@iterator": PropTypes.func.isRequired,
|
|
629
|
+
"anchor": PropTypes.func.isRequired,
|
|
630
|
+
"at": PropTypes.func.isRequired,
|
|
631
|
+
"big": PropTypes.func.isRequired,
|
|
632
|
+
"blink": PropTypes.func.isRequired,
|
|
633
|
+
"bold": PropTypes.func.isRequired,
|
|
634
|
+
"charAt": PropTypes.func.isRequired,
|
|
635
|
+
"charCodeAt": PropTypes.func.isRequired,
|
|
636
|
+
"codePointAt": PropTypes.func.isRequired,
|
|
637
|
+
"concat": PropTypes.func.isRequired,
|
|
638
|
+
"endsWith": PropTypes.func.isRequired,
|
|
639
|
+
"fixed": PropTypes.func.isRequired,
|
|
640
|
+
"fontcolor": PropTypes.func.isRequired,
|
|
641
|
+
"fontsize": PropTypes.func.isRequired,
|
|
642
|
+
"includes": PropTypes.func.isRequired,
|
|
643
|
+
"indexOf": PropTypes.func.isRequired,
|
|
644
|
+
"italics": PropTypes.func.isRequired,
|
|
645
|
+
"lastIndexOf": PropTypes.func.isRequired,
|
|
646
|
+
"length": PropTypes.number.isRequired,
|
|
647
|
+
"link": PropTypes.func.isRequired,
|
|
648
|
+
"localeCompare": PropTypes.func.isRequired,
|
|
649
|
+
"match": PropTypes.func.isRequired,
|
|
650
|
+
"matchAll": PropTypes.func.isRequired,
|
|
651
|
+
"normalize": PropTypes.func.isRequired,
|
|
652
|
+
"padEnd": PropTypes.func.isRequired,
|
|
653
|
+
"padStart": PropTypes.func.isRequired,
|
|
654
|
+
"repeat": PropTypes.func.isRequired,
|
|
655
|
+
"replace": PropTypes.func.isRequired,
|
|
656
|
+
"search": PropTypes.func.isRequired,
|
|
657
|
+
"slice": PropTypes.func.isRequired,
|
|
658
|
+
"small": PropTypes.func.isRequired,
|
|
659
|
+
"split": PropTypes.func.isRequired,
|
|
660
|
+
"startsWith": PropTypes.func.isRequired,
|
|
661
|
+
"strike": PropTypes.func.isRequired,
|
|
662
|
+
"sub": PropTypes.func.isRequired,
|
|
663
|
+
"substr": PropTypes.func.isRequired,
|
|
664
|
+
"substring": PropTypes.func.isRequired,
|
|
665
|
+
"sup": PropTypes.func.isRequired,
|
|
666
|
+
"toLocaleLowerCase": PropTypes.func.isRequired,
|
|
667
|
+
"toLocaleUpperCase": PropTypes.func.isRequired,
|
|
668
|
+
"toLowerCase": PropTypes.func.isRequired,
|
|
669
|
+
"toString": PropTypes.func.isRequired,
|
|
670
|
+
"toUpperCase": PropTypes.func.isRequired,
|
|
671
|
+
"trim": PropTypes.func.isRequired,
|
|
672
|
+
"trimEnd": PropTypes.func.isRequired,
|
|
673
|
+
"trimLeft": PropTypes.func.isRequired,
|
|
674
|
+
"trimRight": PropTypes.func.isRequired,
|
|
675
|
+
"trimStart": PropTypes.func.isRequired,
|
|
676
|
+
"valueOf": PropTypes.func.isRequired
|
|
677
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
678
|
+
"__@iterator": PropTypes.func.isRequired,
|
|
679
|
+
"anchor": PropTypes.func.isRequired,
|
|
680
|
+
"at": PropTypes.func.isRequired,
|
|
681
|
+
"big": PropTypes.func.isRequired,
|
|
682
|
+
"blink": PropTypes.func.isRequired,
|
|
683
|
+
"bold": PropTypes.func.isRequired,
|
|
684
|
+
"charAt": PropTypes.func.isRequired,
|
|
685
|
+
"charCodeAt": PropTypes.func.isRequired,
|
|
686
|
+
"codePointAt": PropTypes.func.isRequired,
|
|
687
|
+
"concat": PropTypes.func.isRequired,
|
|
688
|
+
"endsWith": PropTypes.func.isRequired,
|
|
689
|
+
"fixed": PropTypes.func.isRequired,
|
|
690
|
+
"fontcolor": PropTypes.func.isRequired,
|
|
691
|
+
"fontsize": PropTypes.func.isRequired,
|
|
692
|
+
"includes": PropTypes.func.isRequired,
|
|
693
|
+
"indexOf": PropTypes.func.isRequired,
|
|
694
|
+
"italics": PropTypes.func.isRequired,
|
|
695
|
+
"lastIndexOf": PropTypes.func.isRequired,
|
|
696
|
+
"length": PropTypes.number.isRequired,
|
|
697
|
+
"link": PropTypes.func.isRequired,
|
|
698
|
+
"localeCompare": PropTypes.func.isRequired,
|
|
699
|
+
"match": PropTypes.func.isRequired,
|
|
700
|
+
"matchAll": PropTypes.func.isRequired,
|
|
701
|
+
"normalize": PropTypes.func.isRequired,
|
|
702
|
+
"padEnd": PropTypes.func.isRequired,
|
|
703
|
+
"padStart": PropTypes.func.isRequired,
|
|
704
|
+
"repeat": PropTypes.func.isRequired,
|
|
705
|
+
"replace": PropTypes.func.isRequired,
|
|
706
|
+
"search": PropTypes.func.isRequired,
|
|
707
|
+
"slice": PropTypes.func.isRequired,
|
|
708
|
+
"small": PropTypes.func.isRequired,
|
|
709
|
+
"split": PropTypes.func.isRequired,
|
|
710
|
+
"startsWith": PropTypes.func.isRequired,
|
|
711
|
+
"strike": PropTypes.func.isRequired,
|
|
712
|
+
"sub": PropTypes.func.isRequired,
|
|
713
|
+
"substr": PropTypes.func.isRequired,
|
|
714
|
+
"substring": PropTypes.func.isRequired,
|
|
715
|
+
"sup": PropTypes.func.isRequired,
|
|
716
|
+
"toLocaleLowerCase": PropTypes.func.isRequired,
|
|
717
|
+
"toLocaleUpperCase": PropTypes.func.isRequired,
|
|
718
|
+
"toLowerCase": PropTypes.func.isRequired,
|
|
719
|
+
"toString": PropTypes.func.isRequired,
|
|
720
|
+
"toUpperCase": PropTypes.func.isRequired,
|
|
721
|
+
"trim": PropTypes.func.isRequired,
|
|
722
|
+
"trimEnd": PropTypes.func.isRequired,
|
|
723
|
+
"trimLeft": PropTypes.func.isRequired,
|
|
724
|
+
"trimRight": PropTypes.func.isRequired,
|
|
725
|
+
"trimStart": PropTypes.func.isRequired,
|
|
726
|
+
"valueOf": PropTypes.func.isRequired
|
|
727
|
+
}), PropTypes.string])
|
|
625
728
|
};
|
|
626
729
|
export { MultiActionButton };
|
|
627
730
|
export default MultiActionButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { MultiActionButtonProps } from "./multi-action-button.component";
|
|
2
|
+
declare const StyledMultiActionButton: import("styled-components").StyledComponent<"div", any, Pick<MultiActionButtonProps, "width"> & {
|
|
2
3
|
displayed: boolean;
|
|
3
|
-
}
|
|
4
|
-
declare const StyledMultiActionButton: import("styled-components").StyledComponent<"div", any, StyledMultiActionButtonProps, never>;
|
|
4
|
+
}, never>;
|
|
5
5
|
declare type StyledButtonChildrenContainerProps = {
|
|
6
6
|
align: "left" | "right";
|
|
7
7
|
minWidth: number;
|
|
@@ -3,12 +3,25 @@ import { margin } from "styled-system";
|
|
|
3
3
|
import StyledButton from "../button/button.style";
|
|
4
4
|
import baseTheme from "../../style/themes/base";
|
|
5
5
|
import StyledIcon from "../icon/icon.style";
|
|
6
|
+
import computeWidth from "../../style/utils/width";
|
|
6
7
|
const StyledMultiActionButton = styled.div`
|
|
7
8
|
${margin}
|
|
8
9
|
|
|
9
10
|
display: inline-block;
|
|
10
11
|
position: relative;
|
|
11
12
|
|
|
13
|
+
${({
|
|
14
|
+
width
|
|
15
|
+
}) => width && css`
|
|
16
|
+
${computeWidth({
|
|
17
|
+
width
|
|
18
|
+
})}
|
|
19
|
+
|
|
20
|
+
${StyledButton} {
|
|
21
|
+
width: 100%
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
}`}
|
|
24
|
+
|
|
12
25
|
& > ${StyledButton} {
|
|
13
26
|
margin: 0;
|
|
14
27
|
|
|
@@ -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
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WidthProps } from "styled-system";
|
|
2
3
|
import { SplitButtonProps } from "../split-button";
|
|
3
|
-
export interface MultiActionButtonProps extends Omit<SplitButtonProps, "buttonType"> {
|
|
4
|
+
export interface MultiActionButtonProps extends WidthProps, Omit<SplitButtonProps, "buttonType"> {
|
|
4
5
|
/** Button type: "primary" | "secondary" | "tertiary" */
|
|
5
6
|
buttonType?: "primary" | "secondary" | "tertiary";
|
|
6
7
|
/** Second text child, renders under main text, only when size is "large" */
|
|
7
8
|
subtext?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const MultiActionButton: ({ align, disabled, buttonType, size, children, text, subtext, "data-element": dataElement, "data-role": dataRole, ...rest }: MultiActionButtonProps) => JSX.Element;
|
|
10
|
+
export declare const MultiActionButton: ({ align, disabled, buttonType, size, children, text, subtext, width, "data-element": dataElement, "data-role": dataRole, ...rest }: MultiActionButtonProps) => JSX.Element;
|
|
10
11
|
export default MultiActionButton;
|
|
@@ -39,6 +39,7 @@ const MultiActionButton = ({
|
|
|
39
39
|
children,
|
|
40
40
|
text,
|
|
41
41
|
subtext,
|
|
42
|
+
width,
|
|
42
43
|
"data-element": dataElement,
|
|
43
44
|
"data-role": dataRole,
|
|
44
45
|
...rest
|
|
@@ -145,7 +146,8 @@ const MultiActionButton = ({
|
|
|
145
146
|
"data-component": "multi-action-button",
|
|
146
147
|
"data-element": dataElement,
|
|
147
148
|
"data-role": dataRole,
|
|
148
|
-
displayed: showAdditionalButtons
|
|
149
|
+
displayed: showAdditionalButtons,
|
|
150
|
+
width: width
|
|
149
151
|
}, (0, _utils.filterStyledSystemMarginProps)(rest)), /*#__PURE__*/_react.default.createElement(_button.default, _extends({
|
|
150
152
|
"aria-haspopup": "true",
|
|
151
153
|
"aria-expanded": showAdditionalButtons,
|
|
@@ -643,7 +645,108 @@ MultiActionButton.propTypes = {
|
|
|
643
645
|
"typeof": _propTypes.default.string,
|
|
644
646
|
"unselectable": _propTypes.default.oneOf(["off", "on"]),
|
|
645
647
|
"value": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.number, _propTypes.default.string]),
|
|
646
|
-
"vocab": _propTypes.default.string
|
|
648
|
+
"vocab": _propTypes.default.string,
|
|
649
|
+
"width": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
650
|
+
"__@iterator": _propTypes.default.func.isRequired,
|
|
651
|
+
"anchor": _propTypes.default.func.isRequired,
|
|
652
|
+
"at": _propTypes.default.func.isRequired,
|
|
653
|
+
"big": _propTypes.default.func.isRequired,
|
|
654
|
+
"blink": _propTypes.default.func.isRequired,
|
|
655
|
+
"bold": _propTypes.default.func.isRequired,
|
|
656
|
+
"charAt": _propTypes.default.func.isRequired,
|
|
657
|
+
"charCodeAt": _propTypes.default.func.isRequired,
|
|
658
|
+
"codePointAt": _propTypes.default.func.isRequired,
|
|
659
|
+
"concat": _propTypes.default.func.isRequired,
|
|
660
|
+
"endsWith": _propTypes.default.func.isRequired,
|
|
661
|
+
"fixed": _propTypes.default.func.isRequired,
|
|
662
|
+
"fontcolor": _propTypes.default.func.isRequired,
|
|
663
|
+
"fontsize": _propTypes.default.func.isRequired,
|
|
664
|
+
"includes": _propTypes.default.func.isRequired,
|
|
665
|
+
"indexOf": _propTypes.default.func.isRequired,
|
|
666
|
+
"italics": _propTypes.default.func.isRequired,
|
|
667
|
+
"lastIndexOf": _propTypes.default.func.isRequired,
|
|
668
|
+
"length": _propTypes.default.number.isRequired,
|
|
669
|
+
"link": _propTypes.default.func.isRequired,
|
|
670
|
+
"localeCompare": _propTypes.default.func.isRequired,
|
|
671
|
+
"match": _propTypes.default.func.isRequired,
|
|
672
|
+
"matchAll": _propTypes.default.func.isRequired,
|
|
673
|
+
"normalize": _propTypes.default.func.isRequired,
|
|
674
|
+
"padEnd": _propTypes.default.func.isRequired,
|
|
675
|
+
"padStart": _propTypes.default.func.isRequired,
|
|
676
|
+
"repeat": _propTypes.default.func.isRequired,
|
|
677
|
+
"replace": _propTypes.default.func.isRequired,
|
|
678
|
+
"search": _propTypes.default.func.isRequired,
|
|
679
|
+
"slice": _propTypes.default.func.isRequired,
|
|
680
|
+
"small": _propTypes.default.func.isRequired,
|
|
681
|
+
"split": _propTypes.default.func.isRequired,
|
|
682
|
+
"startsWith": _propTypes.default.func.isRequired,
|
|
683
|
+
"strike": _propTypes.default.func.isRequired,
|
|
684
|
+
"sub": _propTypes.default.func.isRequired,
|
|
685
|
+
"substr": _propTypes.default.func.isRequired,
|
|
686
|
+
"substring": _propTypes.default.func.isRequired,
|
|
687
|
+
"sup": _propTypes.default.func.isRequired,
|
|
688
|
+
"toLocaleLowerCase": _propTypes.default.func.isRequired,
|
|
689
|
+
"toLocaleUpperCase": _propTypes.default.func.isRequired,
|
|
690
|
+
"toLowerCase": _propTypes.default.func.isRequired,
|
|
691
|
+
"toString": _propTypes.default.func.isRequired,
|
|
692
|
+
"toUpperCase": _propTypes.default.func.isRequired,
|
|
693
|
+
"trim": _propTypes.default.func.isRequired,
|
|
694
|
+
"trimEnd": _propTypes.default.func.isRequired,
|
|
695
|
+
"trimLeft": _propTypes.default.func.isRequired,
|
|
696
|
+
"trimRight": _propTypes.default.func.isRequired,
|
|
697
|
+
"trimStart": _propTypes.default.func.isRequired,
|
|
698
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
699
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
700
|
+
"__@iterator": _propTypes.default.func.isRequired,
|
|
701
|
+
"anchor": _propTypes.default.func.isRequired,
|
|
702
|
+
"at": _propTypes.default.func.isRequired,
|
|
703
|
+
"big": _propTypes.default.func.isRequired,
|
|
704
|
+
"blink": _propTypes.default.func.isRequired,
|
|
705
|
+
"bold": _propTypes.default.func.isRequired,
|
|
706
|
+
"charAt": _propTypes.default.func.isRequired,
|
|
707
|
+
"charCodeAt": _propTypes.default.func.isRequired,
|
|
708
|
+
"codePointAt": _propTypes.default.func.isRequired,
|
|
709
|
+
"concat": _propTypes.default.func.isRequired,
|
|
710
|
+
"endsWith": _propTypes.default.func.isRequired,
|
|
711
|
+
"fixed": _propTypes.default.func.isRequired,
|
|
712
|
+
"fontcolor": _propTypes.default.func.isRequired,
|
|
713
|
+
"fontsize": _propTypes.default.func.isRequired,
|
|
714
|
+
"includes": _propTypes.default.func.isRequired,
|
|
715
|
+
"indexOf": _propTypes.default.func.isRequired,
|
|
716
|
+
"italics": _propTypes.default.func.isRequired,
|
|
717
|
+
"lastIndexOf": _propTypes.default.func.isRequired,
|
|
718
|
+
"length": _propTypes.default.number.isRequired,
|
|
719
|
+
"link": _propTypes.default.func.isRequired,
|
|
720
|
+
"localeCompare": _propTypes.default.func.isRequired,
|
|
721
|
+
"match": _propTypes.default.func.isRequired,
|
|
722
|
+
"matchAll": _propTypes.default.func.isRequired,
|
|
723
|
+
"normalize": _propTypes.default.func.isRequired,
|
|
724
|
+
"padEnd": _propTypes.default.func.isRequired,
|
|
725
|
+
"padStart": _propTypes.default.func.isRequired,
|
|
726
|
+
"repeat": _propTypes.default.func.isRequired,
|
|
727
|
+
"replace": _propTypes.default.func.isRequired,
|
|
728
|
+
"search": _propTypes.default.func.isRequired,
|
|
729
|
+
"slice": _propTypes.default.func.isRequired,
|
|
730
|
+
"small": _propTypes.default.func.isRequired,
|
|
731
|
+
"split": _propTypes.default.func.isRequired,
|
|
732
|
+
"startsWith": _propTypes.default.func.isRequired,
|
|
733
|
+
"strike": _propTypes.default.func.isRequired,
|
|
734
|
+
"sub": _propTypes.default.func.isRequired,
|
|
735
|
+
"substr": _propTypes.default.func.isRequired,
|
|
736
|
+
"substring": _propTypes.default.func.isRequired,
|
|
737
|
+
"sup": _propTypes.default.func.isRequired,
|
|
738
|
+
"toLocaleLowerCase": _propTypes.default.func.isRequired,
|
|
739
|
+
"toLocaleUpperCase": _propTypes.default.func.isRequired,
|
|
740
|
+
"toLowerCase": _propTypes.default.func.isRequired,
|
|
741
|
+
"toString": _propTypes.default.func.isRequired,
|
|
742
|
+
"toUpperCase": _propTypes.default.func.isRequired,
|
|
743
|
+
"trim": _propTypes.default.func.isRequired,
|
|
744
|
+
"trimEnd": _propTypes.default.func.isRequired,
|
|
745
|
+
"trimLeft": _propTypes.default.func.isRequired,
|
|
746
|
+
"trimRight": _propTypes.default.func.isRequired,
|
|
747
|
+
"trimStart": _propTypes.default.func.isRequired,
|
|
748
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
749
|
+
}), _propTypes.default.string])
|
|
647
750
|
};
|
|
648
751
|
var _default = MultiActionButton;
|
|
649
752
|
exports.default = _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { MultiActionButtonProps } from "./multi-action-button.component";
|
|
2
|
+
declare const StyledMultiActionButton: import("styled-components").StyledComponent<"div", any, Pick<MultiActionButtonProps, "width"> & {
|
|
2
3
|
displayed: boolean;
|
|
3
|
-
}
|
|
4
|
-
declare const StyledMultiActionButton: import("styled-components").StyledComponent<"div", any, StyledMultiActionButtonProps, never>;
|
|
4
|
+
}, never>;
|
|
5
5
|
declare type StyledButtonChildrenContainerProps = {
|
|
6
6
|
align: "left" | "right";
|
|
7
7
|
minWidth: number;
|
|
@@ -15,6 +15,8 @@ var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
|
15
15
|
|
|
16
16
|
var _icon = _interopRequireDefault(require("../icon/icon.style"));
|
|
17
17
|
|
|
18
|
+
var _width = _interopRequireDefault(require("../../style/utils/width"));
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -27,6 +29,18 @@ const StyledMultiActionButton = _styledComponents.default.div`
|
|
|
27
29
|
display: inline-block;
|
|
28
30
|
position: relative;
|
|
29
31
|
|
|
32
|
+
${({
|
|
33
|
+
width
|
|
34
|
+
}) => width && (0, _styledComponents.css)`
|
|
35
|
+
${(0, _width.default)({
|
|
36
|
+
width
|
|
37
|
+
})}
|
|
38
|
+
|
|
39
|
+
${_button.default} {
|
|
40
|
+
width: 100%
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
}`}
|
|
43
|
+
|
|
30
44
|
& > ${_button.default} {
|
|
31
45
|
margin: 0;
|
|
32
46
|
|
|
@@ -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,
|