carbon-react 146.6.1 → 147.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__internal__/label/label.component.d.ts +4 -1
- package/esm/components/accordion/accordion.component.d.ts +0 -2
- package/esm/components/accordion/accordion.component.js +3 -28
- package/esm/components/accordion/accordion.style.d.ts +0 -7
- package/esm/components/accordion/accordion.style.js +22 -61
- package/esm/components/box/box.component.d.ts +6 -4
- package/esm/components/box/box.component.js +0 -9
- package/esm/components/button/button.component.d.ts +2 -1
- package/esm/components/button/button.component.js +0 -6
- package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.d.ts +1 -6
- package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.js +0 -8
- package/esm/components/button-toggle/button-toggle.component.d.ts +1 -3
- package/esm/components/button-toggle/button-toggle.component.js +1 -9
- package/esm/components/button-toggle/button-toggle.style.d.ts +1 -5
- package/esm/components/button-toggle/button-toggle.style.js +8 -41
- package/esm/components/decimal/decimal.component.d.ts +0 -2
- package/esm/components/decimal/decimal.component.js +3 -10
- package/esm/components/detail/detail.component.d.ts +5 -1
- package/esm/components/detail/detail.component.js +0 -6
- package/esm/components/dialog/dialog.component.d.ts +5 -1
- package/esm/components/dialog/dialog.component.js +8 -11
- package/esm/components/heading/heading.style.d.ts +2 -2
- package/esm/components/help/help.component.d.ts +1 -3
- package/esm/components/help/help.component.js +0 -9
- package/esm/components/icon/icon-config.js +1 -1
- package/esm/components/icon/icon.component.js +1 -7
- package/esm/components/icon/icon.style.d.ts +1 -1
- package/esm/components/icon/icon.style.js +10 -11
- package/esm/components/image/image.style.d.ts +1 -1
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +6 -2
- package/esm/components/inline-inputs/inline-inputs.component.js +0 -8
- package/esm/components/link/link.component.d.ts +6 -2
- package/esm/components/link/link.component.js +2 -8
- package/esm/components/loader-spinner/loader-spinner.style.d.ts +1 -1
- package/esm/components/loader-star/loader-star.style.d.ts +1 -1
- package/esm/components/menu/menu-item/menu-item.component.d.ts +0 -2
- package/esm/components/menu/menu-item/menu-item.component.js +0 -6
- package/esm/components/message/message.component.d.ts +0 -2
- package/esm/components/message/message.component.js +0 -9
- package/esm/components/modal/modal.component.d.ts +5 -1
- package/esm/components/modal/modal.component.js +0 -6
- package/esm/components/pod/pod.component.d.ts +0 -2
- package/esm/components/pod/pod.component.js +0 -9
- package/esm/components/portal/portal.d.ts +5 -1
- package/esm/components/portal/portal.js +0 -6
- package/esm/components/portrait/portrait.component.d.ts +1 -3
- package/esm/components/portrait/portrait.component.js +2 -32
- package/esm/components/portrait/portrait.style.d.ts +0 -1
- package/esm/components/portrait/portrait.style.js +0 -4
- package/esm/components/profile/profile.component.d.ts +6 -2
- package/esm/components/profile/profile.component.js +2 -10
- package/esm/components/profile/profile.style.d.ts +1 -1
- package/esm/components/settings-row/settings-row.component.d.ts +6 -2
- package/esm/components/settings-row/settings-row.component.js +0 -8
- package/esm/components/simple-color-picker/simple-color/simple-color.component.d.ts +5 -1
- package/esm/components/simple-color-picker/simple-color/simple-color.component.js +1 -7
- package/esm/components/simple-color-picker/simple-color-picker.component.d.ts +0 -2
- package/esm/components/simple-color-picker/simple-color-picker.component.js +2 -27
- package/esm/components/tabs/tab/tab.component.d.ts +1 -3
- package/esm/components/tabs/tab/tab.component.js +0 -8
- package/esm/components/tabs/tabs.component.d.ts +1 -3
- package/esm/components/tabs/tabs.component.js +0 -8
- package/esm/components/tile/flex-tile-cell/flex-tile-cell.component.js +0 -1
- package/esm/components/tile-select/tile-select.component.d.ts +0 -2
- package/esm/components/tile-select/tile-select.component.js +0 -9
- package/esm/components/toast/toast.component.d.ts +0 -2
- package/esm/components/toast/toast.component.js +1 -10
- package/esm/components/toast/toast.style.d.ts +1 -1
- package/esm/components/typography/list.component.d.ts +2 -4
- package/esm/components/typography/list.component.js +3 -8
- package/esm/components/typography/typography.component.d.ts +7 -3
- package/esm/components/typography/typography.component.js +3 -9
- package/lib/__internal__/label/label.component.d.ts +4 -1
- package/lib/components/accordion/accordion.component.d.ts +0 -2
- package/lib/components/accordion/accordion.component.js +3 -28
- package/lib/components/accordion/accordion.style.d.ts +0 -7
- package/lib/components/accordion/accordion.style.js +22 -61
- package/lib/components/box/box.component.d.ts +6 -4
- package/lib/components/box/box.component.js +0 -9
- package/lib/components/button/button.component.d.ts +2 -1
- package/lib/components/button/button.component.js +0 -6
- package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.d.ts +1 -6
- package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.js +0 -8
- package/lib/components/button-toggle/button-toggle.component.d.ts +1 -3
- package/lib/components/button-toggle/button-toggle.component.js +1 -9
- package/lib/components/button-toggle/button-toggle.style.d.ts +1 -5
- package/lib/components/button-toggle/button-toggle.style.js +8 -41
- package/lib/components/decimal/decimal.component.d.ts +0 -2
- package/lib/components/decimal/decimal.component.js +3 -10
- package/lib/components/detail/detail.component.d.ts +5 -1
- package/lib/components/detail/detail.component.js +0 -6
- package/lib/components/dialog/dialog.component.d.ts +5 -1
- package/lib/components/dialog/dialog.component.js +8 -11
- package/lib/components/heading/heading.style.d.ts +2 -2
- package/lib/components/help/help.component.d.ts +1 -3
- package/lib/components/help/help.component.js +0 -9
- package/lib/components/icon/icon-config.js +1 -1
- package/lib/components/icon/icon.component.js +1 -7
- package/lib/components/icon/icon.style.d.ts +1 -1
- package/lib/components/icon/icon.style.js +10 -11
- package/lib/components/image/image.style.d.ts +1 -1
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +6 -2
- package/lib/components/inline-inputs/inline-inputs.component.js +0 -8
- package/lib/components/link/link.component.d.ts +6 -2
- package/lib/components/link/link.component.js +2 -8
- package/lib/components/loader-spinner/loader-spinner.style.d.ts +1 -1
- package/lib/components/loader-star/loader-star.style.d.ts +1 -1
- package/lib/components/menu/menu-item/menu-item.component.d.ts +0 -2
- package/lib/components/menu/menu-item/menu-item.component.js +0 -6
- package/lib/components/message/message.component.d.ts +0 -2
- package/lib/components/message/message.component.js +0 -9
- package/lib/components/modal/modal.component.d.ts +5 -1
- package/lib/components/modal/modal.component.js +0 -6
- package/lib/components/pod/pod.component.d.ts +0 -2
- package/lib/components/pod/pod.component.js +0 -9
- package/lib/components/portal/portal.d.ts +5 -1
- package/lib/components/portal/portal.js +0 -6
- package/lib/components/portrait/portrait.component.d.ts +1 -3
- package/lib/components/portrait/portrait.component.js +7 -37
- package/lib/components/portrait/portrait.style.d.ts +0 -1
- package/lib/components/portrait/portrait.style.js +1 -5
- package/lib/components/profile/profile.component.d.ts +6 -2
- package/lib/components/profile/profile.component.js +2 -10
- package/lib/components/profile/profile.style.d.ts +1 -1
- package/lib/components/settings-row/settings-row.component.d.ts +6 -2
- package/lib/components/settings-row/settings-row.component.js +0 -8
- package/lib/components/simple-color-picker/simple-color/simple-color.component.d.ts +5 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.component.js +1 -7
- package/lib/components/simple-color-picker/simple-color-picker.component.d.ts +0 -2
- package/lib/components/simple-color-picker/simple-color-picker.component.js +1 -26
- package/lib/components/tabs/tab/tab.component.d.ts +1 -3
- package/lib/components/tabs/tab/tab.component.js +0 -8
- package/lib/components/tabs/tabs.component.d.ts +1 -3
- package/lib/components/tabs/tabs.component.js +0 -8
- package/lib/components/tile/flex-tile-cell/flex-tile-cell.component.js +0 -1
- package/lib/components/tile-select/tile-select.component.d.ts +0 -2
- package/lib/components/tile-select/tile-select.component.js +0 -9
- package/lib/components/toast/toast.component.d.ts +0 -2
- package/lib/components/toast/toast.component.js +1 -10
- package/lib/components/toast/toast.style.d.ts +1 -1
- package/lib/components/typography/list.component.d.ts +2 -4
- package/lib/components/typography/list.component.js +3 -8
- package/lib/components/typography/typography.component.d.ts +7 -3
- package/lib/components/typography/typography.component.js +3 -9
- package/package.json +1 -1
|
@@ -20,7 +20,10 @@ export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLab
|
|
|
20
20
|
useValidationIcon?: boolean;
|
|
21
21
|
/** Id of the validation icon */
|
|
22
22
|
validationIconId?: string;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
* @internal
|
|
26
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
24
27
|
className?: string;
|
|
25
28
|
/** Sets aria-label for label element */
|
|
26
29
|
"aria-label"?: string;
|
|
@@ -2,8 +2,6 @@ import React from "react";
|
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { StyledAccordionContainerProps } from "./accordion.style";
|
|
4
4
|
export interface AccordionProps extends StyledAccordionContainerProps, SpaceProps {
|
|
5
|
-
/** Width of the buttonHeading when it's set, defaults to 150px */
|
|
6
|
-
buttonWidth?: number | string;
|
|
7
5
|
/** Content of the Accordion component */
|
|
8
6
|
children?: React.ReactNode;
|
|
9
7
|
/** Set the default state of expansion of the Accordion if component is meant to be used as uncontrolled */
|
|
@@ -4,11 +4,8 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import useResizeObserver from "../../hooks/__internal__/useResizeObserver";
|
|
5
5
|
import createGuid from "../../__internal__/utils/helpers/guid";
|
|
6
6
|
import Events from "../../__internal__/utils/helpers/events";
|
|
7
|
-
import Logger from "../../__internal__/utils/logger";
|
|
8
7
|
import { StyledAccordionContainer, StyledAccordionHeadingsContainer, StyledAccordionTitleContainer, StyledAccordionTitle, StyledAccordionSubTitle, StyledAccordionIcon, StyledAccordionContentContainer, StyledAccordionContent } from "./accordion.style";
|
|
9
8
|
import ValidationIcon from "../../__internal__/validations";
|
|
10
|
-
let deprecatedSchemeWarnTriggered = false;
|
|
11
|
-
let deprecatedButtonHeadingWarnTriggered = false;
|
|
12
9
|
const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
13
10
|
borders = "default",
|
|
14
11
|
defaultExpanded,
|
|
@@ -20,7 +17,6 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
|
20
17
|
index,
|
|
21
18
|
iconType,
|
|
22
19
|
iconAlign,
|
|
23
|
-
scheme = "white",
|
|
24
20
|
size = "large",
|
|
25
21
|
subTitle,
|
|
26
22
|
title,
|
|
@@ -30,20 +26,10 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
|
30
26
|
error,
|
|
31
27
|
warning,
|
|
32
28
|
info,
|
|
33
|
-
buttonHeading,
|
|
34
|
-
buttonWidth = "150px",
|
|
35
29
|
openTitle,
|
|
36
30
|
variant = "standard",
|
|
37
31
|
...rest
|
|
38
32
|
}, ref) => {
|
|
39
|
-
if (!deprecatedSchemeWarnTriggered && scheme === "transparent") {
|
|
40
|
-
deprecatedSchemeWarnTriggered = true;
|
|
41
|
-
Logger.deprecate("The `scheme` prop for `Accordion` component is deprecated and will soon be removed.");
|
|
42
|
-
}
|
|
43
|
-
if (!deprecatedButtonHeadingWarnTriggered && buttonHeading) {
|
|
44
|
-
deprecatedButtonHeadingWarnTriggered = true;
|
|
45
|
-
Logger.deprecate("The `buttonHeading` prop for `Accordion` component is deprecated and will soon be removed. Please use `subtle` variant instead.");
|
|
46
|
-
}
|
|
47
33
|
const isControlled = expanded !== undefined;
|
|
48
34
|
const [isExpandedInternal, setIsExpandedInternal] = useState(defaultExpanded || false);
|
|
49
35
|
const [contentHeight, setContentHeight] = useState(isExpandedInternal ? "auto" : 0);
|
|
@@ -82,8 +68,6 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
|
82
68
|
"data-role": "accordion-container",
|
|
83
69
|
width: width,
|
|
84
70
|
borders: variant === "subtle" ? "none" : borders,
|
|
85
|
-
scheme: scheme,
|
|
86
|
-
buttonHeading: buttonHeading,
|
|
87
71
|
variant: variant
|
|
88
72
|
}, rest), /*#__PURE__*/React.createElement(StyledAccordionTitleContainer, _extends({
|
|
89
73
|
"data-element": "accordion-title-container",
|
|
@@ -96,23 +80,17 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
|
96
80
|
iconAlign: iconAlign || (variant === "standard" ? "right" : "left"),
|
|
97
81
|
ref: ref,
|
|
98
82
|
size: size,
|
|
99
|
-
buttonHeading: buttonHeading,
|
|
100
83
|
isExpanded: isExpanded,
|
|
101
84
|
variant: variant,
|
|
102
|
-
buttonWidth: buttonWidth,
|
|
103
|
-
hasButtonProps: buttonHeading && !(typeof headerSpacing === "undefined"),
|
|
104
85
|
role: "button"
|
|
105
|
-
}, buttonHeading && {
|
|
106
|
-
p: 0
|
|
107
86
|
}, headerSpacing), /*#__PURE__*/React.createElement(StyledAccordionHeadingsContainer, {
|
|
108
87
|
"data-element": "accordion-headings-container",
|
|
109
|
-
hasValidationIcon: showValidationIcon
|
|
110
|
-
|
|
111
|
-
}, !buttonHeading && typeof title === "string" ? /*#__PURE__*/React.createElement(StyledAccordionTitle, {
|
|
88
|
+
hasValidationIcon: showValidationIcon
|
|
89
|
+
}, /*#__PURE__*/React.createElement(StyledAccordionTitle, {
|
|
112
90
|
"data-element": "accordion-title",
|
|
113
91
|
size: size,
|
|
114
92
|
variant: variant
|
|
115
|
-
},
|
|
93
|
+
}, getTitle()), variant !== "subtle" && /*#__PURE__*/React.createElement(React.Fragment, null, showValidationIcon && /*#__PURE__*/React.createElement(ValidationIcon, {
|
|
116
94
|
error: error,
|
|
117
95
|
warning: warning,
|
|
118
96
|
info: info,
|
|
@@ -142,8 +120,6 @@ const Accordion = /*#__PURE__*/React.forwardRef(({
|
|
|
142
120
|
if (process.env.NODE_ENV !== "production") {
|
|
143
121
|
Accordion.propTypes = {
|
|
144
122
|
"borders": PropTypes.oneOf(["default", "full", "none"]),
|
|
145
|
-
"buttonHeading": PropTypes.bool,
|
|
146
|
-
"buttonWidth": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
147
123
|
"children": PropTypes.node,
|
|
148
124
|
"defaultExpanded": PropTypes.bool,
|
|
149
125
|
"disableContentPadding": PropTypes.bool,
|
|
@@ -775,7 +751,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
775
751
|
"toString": PropTypes.func.isRequired,
|
|
776
752
|
"valueOf": PropTypes.func.isRequired
|
|
777
753
|
}), PropTypes.string]),
|
|
778
|
-
"scheme": PropTypes.oneOf(["transparent", "white"]),
|
|
779
754
|
"size": PropTypes.oneOf(["large", "small"]),
|
|
780
755
|
"subTitle": PropTypes.string,
|
|
781
756
|
"title": PropTypes.node,
|
|
@@ -3,10 +3,6 @@ declare const StyledAccordionGroup: import("styled-components").StyledComponent<
|
|
|
3
3
|
export interface StyledAccordionContainerProps {
|
|
4
4
|
/** Toggles left and right borders, set to none when variant is subtle */
|
|
5
5
|
borders?: "default" | "full" | "none";
|
|
6
|
-
/** (Deprecated) Renders the accordion heading in the style of a tertiary button */
|
|
7
|
-
buttonHeading?: boolean;
|
|
8
|
-
/** (Deprecated) Sets background as white or transparent, set to transparent when variant is subtle */
|
|
9
|
-
scheme?: "white" | "transparent";
|
|
10
6
|
/** Sets accordion width */
|
|
11
7
|
width?: string;
|
|
12
8
|
/** Sets accordion variant */
|
|
@@ -25,13 +21,10 @@ interface StyledAccordionIconProps {
|
|
|
25
21
|
}
|
|
26
22
|
declare const StyledAccordionIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, StyledAccordionIconProps, never>;
|
|
27
23
|
interface StyledAccordionHeadingsContainerProps {
|
|
28
|
-
buttonHeading?: boolean;
|
|
29
24
|
hasValidationIcon?: boolean;
|
|
30
25
|
}
|
|
31
26
|
declare const StyledAccordionHeadingsContainer: import("styled-components").StyledComponent<"div", any, StyledAccordionHeadingsContainerProps, never>;
|
|
32
27
|
interface StyledAccordionTitleContainerProps {
|
|
33
|
-
buttonHeading?: boolean;
|
|
34
|
-
buttonWidth?: number | string;
|
|
35
28
|
hasButtonProps?: boolean;
|
|
36
29
|
iconAlign?: "left" | "right";
|
|
37
30
|
size?: "large" | "small";
|
|
@@ -10,10 +10,11 @@ const StyledAccordionGroup = styled.div`
|
|
|
10
10
|
const StyledAccordionContainer = styled.div`
|
|
11
11
|
${space}
|
|
12
12
|
display: flex;
|
|
13
|
-
|
|
14
|
-
buttonHeading,
|
|
13
|
+
${({
|
|
15
14
|
variant
|
|
16
|
-
}) =>
|
|
15
|
+
}) => variant && css`
|
|
16
|
+
align-items: stretch;
|
|
17
|
+
`};
|
|
17
18
|
justify-content: center;
|
|
18
19
|
flex-direction: column;
|
|
19
20
|
box-sizing: border-box;
|
|
@@ -22,9 +23,8 @@ const StyledAccordionContainer = styled.div`
|
|
|
22
23
|
}) => width || "100%"};
|
|
23
24
|
color: var(--colorsUtilityYin090);
|
|
24
25
|
background-color: ${({
|
|
25
|
-
scheme,
|
|
26
26
|
variant
|
|
27
|
-
}) =>
|
|
27
|
+
}) => variant !== "subtle" ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityMajorTransparent)"};
|
|
28
28
|
border: 1px solid var(--colorsUtilityMajor100);
|
|
29
29
|
${({
|
|
30
30
|
borders
|
|
@@ -79,36 +79,32 @@ const StyledAccordionIcon = styled(Icon)`
|
|
|
79
79
|
`;
|
|
80
80
|
const StyledAccordionHeadingsContainer = styled.div`
|
|
81
81
|
${({
|
|
82
|
-
buttonHeading,
|
|
83
82
|
hasValidationIcon
|
|
84
|
-
}) =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
}) => css`
|
|
84
|
+
display: grid;
|
|
85
|
+
${hasValidationIcon && css`
|
|
86
|
+
grid-template-columns: min-content auto;
|
|
88
87
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
${StyledAccordionSubTitle} {
|
|
89
|
+
grid-column: span 3;
|
|
90
|
+
}
|
|
91
|
+
`}
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
${!hasValidationIcon && css`
|
|
94
|
+
grid-template-rows: auto auto;
|
|
95
|
+
`}
|
|
97
96
|
|
|
98
97
|
${ValidationIconStyle} {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
height: 20px;
|
|
99
|
+
position: relative;
|
|
100
|
+
top: 2px;
|
|
101
|
+
}
|
|
102
|
+
`}
|
|
104
103
|
`;
|
|
105
104
|
const StyledAccordionTitleContainer = styled.div`
|
|
106
105
|
${({
|
|
107
|
-
buttonHeading,
|
|
108
|
-
buttonWidth,
|
|
109
106
|
iconAlign,
|
|
110
107
|
size,
|
|
111
|
-
hasButtonProps,
|
|
112
108
|
isExpanded,
|
|
113
109
|
variant
|
|
114
110
|
}) => css`
|
|
@@ -149,46 +145,11 @@ const StyledAccordionTitleContainer = styled.div`
|
|
|
149
145
|
}
|
|
150
146
|
`}
|
|
151
147
|
|
|
152
|
-
${
|
|
148
|
+
${variant !== "subtle" && css`
|
|
153
149
|
&:hover {
|
|
154
150
|
background-color: var(--colorsUtilityMajor050);
|
|
155
151
|
}
|
|
156
152
|
`}
|
|
157
|
-
|
|
158
|
-
${buttonHeading && css`
|
|
159
|
-
box-sizing: border-box;
|
|
160
|
-
font-weight: 500;
|
|
161
|
-
text-decoration: none;
|
|
162
|
-
font-size: var(--fontSizes100);
|
|
163
|
-
min-height: var(--spacing500);
|
|
164
|
-
|
|
165
|
-
color: var(--colorsActionMajor500);
|
|
166
|
-
|
|
167
|
-
${!hasButtonProps && css`
|
|
168
|
-
${StyledAccordionHeadingsContainer} {
|
|
169
|
-
margin-left: ${iconAlign === "right" ? "var(--spacing300)" : "var(--spacing100)"};
|
|
170
|
-
}
|
|
171
|
-
`}
|
|
172
|
-
|
|
173
|
-
${StyledAccordionIcon} {
|
|
174
|
-
color: var(--colorsActionMajor500);
|
|
175
|
-
${!hasButtonProps && css`
|
|
176
|
-
position: relative;
|
|
177
|
-
${iconAlign}: 16px;
|
|
178
|
-
`}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&:hover {
|
|
182
|
-
color: var(--colorsActionMajor600);
|
|
183
|
-
${StyledAccordionIcon} {
|
|
184
|
-
color: var(--colorsActionMajor600);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
${buttonWidth && css`
|
|
189
|
-
width: ${typeof buttonWidth === "number" ? `${buttonWidth}px` : buttonWidth};
|
|
190
|
-
`}
|
|
191
|
-
`}
|
|
192
153
|
`}
|
|
193
154
|
`;
|
|
194
155
|
const StyledAccordionContentContainer = styled.div`
|
|
@@ -23,8 +23,6 @@ export interface BoxProps extends FlexboxProps, Omit<GridProps, "gridGap" | "gri
|
|
|
23
23
|
scrollVariant?: ScrollVariant;
|
|
24
24
|
/** Set the box-sizing attribute of the Box component */
|
|
25
25
|
boxSizing?: BoxSizing;
|
|
26
|
-
/** (Deprecated) Allows a tabindex to be specified */
|
|
27
|
-
tabIndex?: number;
|
|
28
26
|
/** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
29
27
|
gap?: Gap;
|
|
30
28
|
/** Column gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
@@ -33,9 +31,13 @@ export interface BoxProps extends FlexboxProps, Omit<GridProps, "gridGap" | "gri
|
|
|
33
31
|
rowGap?: Gap;
|
|
34
32
|
/** Design Token for Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Box component. */
|
|
35
33
|
boxShadow?: BoxShadowsType;
|
|
36
|
-
/** Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component.
|
|
34
|
+
/** Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component. */
|
|
37
35
|
borderRadius?: BorderRadiusType;
|
|
38
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @private
|
|
38
|
+
* @ignore
|
|
39
|
+
* @internal
|
|
40
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
39
41
|
className?: string;
|
|
40
42
|
/** Set the color attribute of the Box component */
|
|
41
43
|
color?: string;
|
|
@@ -4,8 +4,6 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { filterStyledSystemMarginProps, filterStyledSystemPaddingProps, filterStyledSystemLayoutProps, filterStyledSystemFlexboxProps, filterStyledSystemGridProps } from "../../style/utils";
|
|
5
5
|
import StyledBox from "./box.style";
|
|
6
6
|
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
7
|
-
import Logger from "../../__internal__/utils/logger";
|
|
8
|
-
let deprecatedTabIndex = false;
|
|
9
7
|
const Box = /*#__PURE__*/React.forwardRef(({
|
|
10
8
|
"data-component": dataComponent,
|
|
11
9
|
as,
|
|
@@ -14,7 +12,6 @@ const Box = /*#__PURE__*/React.forwardRef(({
|
|
|
14
12
|
overflowWrap,
|
|
15
13
|
scrollVariant,
|
|
16
14
|
boxSizing,
|
|
17
|
-
tabIndex,
|
|
18
15
|
gap,
|
|
19
16
|
columnGap,
|
|
20
17
|
rowGap,
|
|
@@ -31,10 +28,6 @@ const Box = /*#__PURE__*/React.forwardRef(({
|
|
|
31
28
|
"aria-hidden": ariaHidden,
|
|
32
29
|
...rest
|
|
33
30
|
}, ref) => {
|
|
34
|
-
if (!deprecatedTabIndex && tabIndex !== undefined) {
|
|
35
|
-
deprecatedTabIndex = true;
|
|
36
|
-
Logger.deprecate("The `tabIndex` prop for `Box` component has been deprecated and will soon be removed.");
|
|
37
|
-
}
|
|
38
31
|
let actualWidth = "";
|
|
39
32
|
if (typeof width === "number") {
|
|
40
33
|
actualWidth = width <= 1 ? `${(width * 100).toFixed(0)}%` : `${width}px`;
|
|
@@ -63,7 +56,6 @@ const Box = /*#__PURE__*/React.forwardRef(({
|
|
|
63
56
|
gap: gap,
|
|
64
57
|
columnGap: columnGap,
|
|
65
58
|
rowGap: rowGap,
|
|
66
|
-
tabIndex: tabIndex,
|
|
67
59
|
className: className,
|
|
68
60
|
ref: ref,
|
|
69
61
|
bg: bg,
|
|
@@ -3555,7 +3547,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
3555
3547
|
"trimStart": PropTypes.func.isRequired,
|
|
3556
3548
|
"valueOf": PropTypes.func.isRequired
|
|
3557
3549
|
}), PropTypes.string]),
|
|
3558
|
-
"tabIndex": PropTypes.number,
|
|
3559
3550
|
"top": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
3560
3551
|
"__@iterator": PropTypes.func.isRequired,
|
|
3561
3552
|
"anchor": PropTypes.func.isRequired,
|
|
@@ -9,8 +9,6 @@ import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
|
9
9
|
import ButtonBarContext from "../button-bar/__internal__/button-bar.context";
|
|
10
10
|
import SplitButtonContext from "../split-button/__internal__/split-button.context";
|
|
11
11
|
import BatchSelectionContext from "../batch-selection/__internal__/batch-selection.context";
|
|
12
|
-
import Logger from "../../__internal__/utils/logger";
|
|
13
|
-
let deprecatedClassNameWarningShown = false;
|
|
14
12
|
function renderChildren({
|
|
15
13
|
/* eslint-disable react/prop-types */
|
|
16
14
|
iconType,
|
|
@@ -84,10 +82,6 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
84
82
|
target,
|
|
85
83
|
...rest
|
|
86
84
|
}, ref) => {
|
|
87
|
-
if (!deprecatedClassNameWarningShown && rest.className) {
|
|
88
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Button' component.");
|
|
89
|
-
deprecatedClassNameWarningShown = true;
|
|
90
|
-
}
|
|
91
85
|
const {
|
|
92
86
|
buttonType: buttonTypeContext,
|
|
93
87
|
size: sizeContext,
|
|
@@ -38,14 +38,9 @@ export interface ButtonToggleGroupProps extends MarginProps, TagProps {
|
|
|
38
38
|
allowDeselect?: boolean;
|
|
39
39
|
/** Disable all user interaction. */
|
|
40
40
|
disabled?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* @private @ignore
|
|
43
|
-
* Set a class on the component
|
|
44
|
-
*/
|
|
45
|
-
className?: string;
|
|
46
41
|
}
|
|
47
42
|
declare const ButtonToggleGroup: {
|
|
48
|
-
({ children, fieldHelp, fieldHelpInline, "aria-label": ariaLabel, label, labelHelp, labelSpacing, inputHint, inputWidth, fullWidth, labelInline, labelWidth, onChange, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, id, allowDeselect, disabled,
|
|
43
|
+
({ children, fieldHelp, fieldHelpInline, "aria-label": ariaLabel, label, labelHelp, labelSpacing, inputHint, inputWidth, fullWidth, labelInline, labelWidth, onChange, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, id, allowDeselect, disabled, ...props }: ButtonToggleGroupProps): React.JSX.Element;
|
|
49
44
|
displayName: string;
|
|
50
45
|
};
|
|
51
46
|
export default ButtonToggleGroup;
|
|
@@ -12,9 +12,7 @@ import { InputGroupBehaviour } from "../../../__internal__/input-behaviour";
|
|
|
12
12
|
import Events from "../../../__internal__/utils/helpers/events";
|
|
13
13
|
import NewValidationContext from "../../carbon-provider/__internal__/new-validation.context";
|
|
14
14
|
import ButtonToggleGroupContext from "./__internal__/button-toggle-group.context";
|
|
15
|
-
import Logger from "../../../__internal__/utils/logger";
|
|
16
15
|
const BUTTON_TOGGLE_SELECTOR = '[data-element="button-toggle-button"]';
|
|
17
|
-
let deprecatedClassNameWarningShown = false;
|
|
18
16
|
const ButtonToggleGroup = ({
|
|
19
17
|
children,
|
|
20
18
|
fieldHelp,
|
|
@@ -37,13 +35,8 @@ const ButtonToggleGroup = ({
|
|
|
37
35
|
id,
|
|
38
36
|
allowDeselect,
|
|
39
37
|
disabled,
|
|
40
|
-
className,
|
|
41
38
|
...props
|
|
42
39
|
}) => {
|
|
43
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
44
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'ButtonToggleGroup' component.");
|
|
45
|
-
deprecatedClassNameWarningShown = true;
|
|
46
|
-
}
|
|
47
40
|
const hasCorrectItemStructure = useMemo(() => {
|
|
48
41
|
const incorrectChild = React.Children.toArray(children).find(child => {
|
|
49
42
|
return ! /*#__PURE__*/React.isValidElement(child) || child.type.displayName !== ButtonToggle.displayName;
|
|
@@ -156,7 +149,6 @@ const ButtonToggleGroup = ({
|
|
|
156
149
|
"data-role": dataRole,
|
|
157
150
|
"data-element": dataElement,
|
|
158
151
|
id: id,
|
|
159
|
-
className: className,
|
|
160
152
|
disabled: disabled
|
|
161
153
|
}), children)))));
|
|
162
154
|
};
|
|
@@ -13,8 +13,6 @@ export interface ButtonToggleProps extends Partial<StyledButtonToggleProps> {
|
|
|
13
13
|
"data-element"?: string;
|
|
14
14
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
15
15
|
"data-role"?: string;
|
|
16
|
-
/** DEPRECATED: Remove spacing from between buttons. */
|
|
17
|
-
grouped?: boolean;
|
|
18
16
|
/** Callback triggered by blur event on the button. */
|
|
19
17
|
onBlur?: (ev: React.FocusEvent<HTMLButtonElement>) => void;
|
|
20
18
|
/** Callback triggered by focus event on the button. */
|
|
@@ -27,7 +25,7 @@ export interface ButtonToggleProps extends Partial<StyledButtonToggleProps> {
|
|
|
27
25
|
value?: string;
|
|
28
26
|
}
|
|
29
27
|
export declare const ButtonToggle: {
|
|
30
|
-
({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, buttonIcon, buttonIconSize, children, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, disabled,
|
|
28
|
+
({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, buttonIcon, buttonIconSize, children, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, disabled, onBlur, onFocus, onClick, pressed, size, value, }: ButtonToggleProps): React.JSX.Element;
|
|
31
29
|
displayName: string;
|
|
32
30
|
};
|
|
33
31
|
export default ButtonToggle;
|
|
@@ -9,7 +9,6 @@ import ButtonToggleIcon from "./button-toggle-icon.component";
|
|
|
9
9
|
import Logger from "../../__internal__/utils/logger";
|
|
10
10
|
import { InputGroupContext } from "../../__internal__/input-behaviour";
|
|
11
11
|
let deprecateUncontrolledWarnTriggered = false;
|
|
12
|
-
let deprecateGroupedWarnTriggered = false;
|
|
13
12
|
export const ButtonToggle = ({
|
|
14
13
|
"aria-label": ariaLabel,
|
|
15
14
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -20,7 +19,6 @@ export const ButtonToggle = ({
|
|
|
20
19
|
"data-element": dataElement,
|
|
21
20
|
"data-role": dataRole,
|
|
22
21
|
disabled,
|
|
23
|
-
grouped,
|
|
24
22
|
onBlur,
|
|
25
23
|
onFocus,
|
|
26
24
|
onClick,
|
|
@@ -29,10 +27,6 @@ export const ButtonToggle = ({
|
|
|
29
27
|
value
|
|
30
28
|
}) => {
|
|
31
29
|
!!!(children || buttonIcon) ? process.env.NODE_ENV !== "production" ? invariant(false, "Either prop `buttonIcon` must be defined, or this node must have children") : invariant(false) : void 0;
|
|
32
|
-
if (grouped && !deprecateGroupedWarnTriggered) {
|
|
33
|
-
deprecateGroupedWarnTriggered = true;
|
|
34
|
-
Logger.deprecate("The `grouped` prop in `ButtonToggle` component is deprecated and will soon be removed. Spacing between buttons is no longer no removed.");
|
|
35
|
-
}
|
|
36
30
|
const buttonRef = useRef(null);
|
|
37
31
|
const {
|
|
38
32
|
onMouseEnter,
|
|
@@ -103,8 +97,7 @@ export const ButtonToggle = ({
|
|
|
103
97
|
return /*#__PURE__*/React.createElement(StyledButtonToggleWrapper, {
|
|
104
98
|
"data-component": dataComponent || "button-toggle",
|
|
105
99
|
"data-element": dataElement,
|
|
106
|
-
"data-role": dataRole
|
|
107
|
-
grouped: grouped
|
|
100
|
+
"data-role": dataRole
|
|
108
101
|
}, /*#__PURE__*/React.createElement(StyledButtonToggle, _extends({
|
|
109
102
|
"aria-label": ariaLabel,
|
|
110
103
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -118,7 +111,6 @@ export const ButtonToggle = ({
|
|
|
118
111
|
onMouseEnter: onMouseEnter,
|
|
119
112
|
onMouseLeave: onMouseLeave,
|
|
120
113
|
size: size,
|
|
121
|
-
grouped: grouped,
|
|
122
114
|
value: value,
|
|
123
115
|
onFocus: handleFocus,
|
|
124
116
|
onBlur: handleBlur,
|
|
@@ -25,7 +25,6 @@ export interface StyledButtonToggleProps {
|
|
|
25
25
|
disabled?: boolean;
|
|
26
26
|
/** ButtonToggle size */
|
|
27
27
|
size: "small" | "medium" | "large";
|
|
28
|
-
grouped?: boolean;
|
|
29
28
|
/** Allow button to be deselected when already selected */
|
|
30
29
|
allowDeselect?: boolean;
|
|
31
30
|
}
|
|
@@ -36,8 +35,5 @@ export interface StyledButtonToggleIconProps {
|
|
|
36
35
|
hasContent?: boolean;
|
|
37
36
|
}
|
|
38
37
|
declare const StyledButtonToggleIcon: import("styled-components").StyledComponent<"div", any, StyledButtonToggleIconProps, never>;
|
|
39
|
-
|
|
40
|
-
grouped?: boolean;
|
|
41
|
-
}
|
|
42
|
-
declare const StyledButtonToggleWrapper: import("styled-components").StyledComponent<"div", any, StyledButtonToggleWrapperProps, never>;
|
|
38
|
+
declare const StyledButtonToggleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
43
39
|
export { StyledButtonToggle, StyledButtonToggleWrapper, StyledButtonToggleIcon, StyledButtonToggleContentWrapper, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import StyledIcon from "../icon/icon.style";
|
|
3
|
-
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
4
3
|
import baseTheme from "../../style/themes/base";
|
|
4
|
+
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
5
5
|
export const heightConfig = {
|
|
6
6
|
small: 24,
|
|
7
7
|
medium: 32,
|
|
@@ -72,8 +72,8 @@ const StyledButtonToggle = styled.button`
|
|
|
72
72
|
min-height: ${heightLargeIconConfig[size]}px;
|
|
73
73
|
padding: ${paddingLargeIconConfig[size]};
|
|
74
74
|
flex-direction: column;
|
|
75
|
-
`}
|
|
76
|
-
|
|
75
|
+
`}
|
|
76
|
+
|
|
77
77
|
&:focus {
|
|
78
78
|
${addFocusStyling()}
|
|
79
79
|
z-index: 100;
|
|
@@ -153,43 +153,10 @@ StyledButtonToggle.defaultProps = {
|
|
|
153
153
|
const StyledButtonToggleWrapper = styled.div`
|
|
154
154
|
display: inline-block;
|
|
155
155
|
vertical-align: middle;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&&&& {
|
|
162
|
-
${StyledButtonToggle} {
|
|
163
|
-
border-radius: var(--borderRadius050);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
`}
|
|
167
|
-
|
|
168
|
-
${grouped && css`
|
|
169
|
-
&&&& {
|
|
170
|
-
:first-of-type {
|
|
171
|
-
${StyledButtonToggle} {
|
|
172
|
-
border-top-left-radius: var(--borderRadius050);
|
|
173
|
-
border-bottom-left-radius: var(--borderRadius050);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
:last-of-type {
|
|
178
|
-
${StyledButtonToggle} {
|
|
179
|
-
border-top-right-radius: var(--borderRadius050);
|
|
180
|
-
border-bottom-right-radius: var(--borderRadius050);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`}
|
|
185
|
-
`}
|
|
186
|
-
|
|
187
|
-
${({
|
|
188
|
-
grouped
|
|
189
|
-
}) => grouped && css`
|
|
190
|
-
&:not(:first-of-type) {
|
|
191
|
-
margin-left: -1px;
|
|
192
|
-
}
|
|
193
|
-
`};
|
|
156
|
+
&&&& {
|
|
157
|
+
${StyledButtonToggle} {
|
|
158
|
+
border-radius: var(--borderRadius050);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
194
161
|
`;
|
|
195
162
|
export { StyledButtonToggle, StyledButtonToggleWrapper, StyledButtonToggleIcon, StyledButtonToggleContentWrapper };
|
|
@@ -25,8 +25,6 @@ export interface DecimalProps extends Omit<CommonTextboxProps, "onChange" | "onB
|
|
|
25
25
|
onChange?: (ev: CustomEvent) => void;
|
|
26
26
|
/** Handler for blur event */
|
|
27
27
|
onBlur?: (ev: CustomEvent) => void;
|
|
28
|
-
/** [Deprecated] Handler for key press event */
|
|
29
|
-
onKeyPress?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
30
28
|
/** The input name */
|
|
31
29
|
name?: string;
|
|
32
30
|
/** The decimal precision of the value in the input */
|
|
@@ -7,7 +7,6 @@ import LocaleContext from "../../__internal__/i18n-context";
|
|
|
7
7
|
import usePrevious from "../../hooks/__internal__/usePrevious";
|
|
8
8
|
import Logger from "../../__internal__/utils/logger";
|
|
9
9
|
let deprecateUncontrolledWarnTriggered = false;
|
|
10
|
-
let deprecateOnKeyPressWarnTriggered = false;
|
|
11
10
|
const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
12
11
|
align = "right",
|
|
13
12
|
defaultValue,
|
|
@@ -16,7 +15,6 @@ const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
|
16
15
|
readOnly,
|
|
17
16
|
onChange,
|
|
18
17
|
onBlur,
|
|
19
|
-
onKeyPress,
|
|
20
18
|
id,
|
|
21
19
|
name,
|
|
22
20
|
allowEmptyValue = false,
|
|
@@ -41,7 +39,7 @@ const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
|
41
39
|
return valueToFormat;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
/* Guards against any white-space only strings like " " being
|
|
42
|
+
/* Guards against any white-space only strings like " " being
|
|
45
43
|
mishandled and returned as `NaN` for the value displayed in the textbox */
|
|
46
44
|
if (valueToFormat === "" || valueToFormat.match(/\s+/g)) {
|
|
47
45
|
return valueToFormat;
|
|
@@ -93,8 +91,8 @@ const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
|
93
91
|
const valueWithoutNBS = getSeparator("group")?.match(/\s+/) && !i18nValue.match(/\s{2,}/) ? i18nValue.replace(/\s+/g, "") : i18nValue;
|
|
94
92
|
/* If a value is passed in that is a number but has too many delimiters in succession, we want to handle this
|
|
95
93
|
value without formatting it or removing delimiters. We also want to consider that,
|
|
96
|
-
if a value consists of only delimiters, we want to treat that
|
|
97
|
-
value in the same way as if the value was NaN. We want to pass this value to the
|
|
94
|
+
if a value consists of only delimiters, we want to treat that
|
|
95
|
+
value in the same way as if the value was NaN. We want to pass this value to the
|
|
98
96
|
formatValue function, before the delimiters can be removed. */
|
|
99
97
|
const errorsWithDelimiter = new RegExp(`([^A-Za-z0-9]{2,})|(^[^A-Za-z0-9-]+)|([^0-9a-z-,.])|([^0-9-,.]+)|([W,.])$`, "g");
|
|
100
98
|
const separator = getSeparator("decimal");
|
|
@@ -167,12 +165,7 @@ const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
|
167
165
|
deprecateUncontrolledWarnTriggered = true;
|
|
168
166
|
Logger.deprecate("Uncontrolled behaviour in `Decimal` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
169
167
|
}
|
|
170
|
-
if (!deprecateOnKeyPressWarnTriggered && onKeyPress) {
|
|
171
|
-
deprecateOnKeyPressWarnTriggered = true;
|
|
172
|
-
Logger.deprecate("`onKeyPress` prop in `Decimal` is deprecated and will soon be removed, please use `onKeyDown` instead.");
|
|
173
|
-
}
|
|
174
168
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Textbox, _extends({
|
|
175
|
-
onKeyPress: onKeyPress,
|
|
176
169
|
align: align,
|
|
177
170
|
readOnly: readOnly,
|
|
178
171
|
inputWidth: inputWidth,
|
|
@@ -3,7 +3,11 @@ import { MarginProps } from "styled-system";
|
|
|
3
3
|
import { IconType } from "../icon";
|
|
4
4
|
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
export interface DetailProps extends MarginProps, TagProps {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @internal
|
|
9
|
+
* @ignore
|
|
10
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
7
11
|
className?: string;
|
|
8
12
|
/** The type of icon to use. */
|
|
9
13
|
icon?: IconType;
|
|
@@ -4,8 +4,6 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
5
5
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
6
6
|
import { StyledDetail, StyledDetailContent, StyledDetailIcon, StyledDetailFootnote } from "./detail.style";
|
|
7
|
-
import Logger from "../../__internal__/utils/logger";
|
|
8
|
-
let deprecatedClassNameWarningShown = false;
|
|
9
7
|
export const Detail = ({
|
|
10
8
|
className,
|
|
11
9
|
icon,
|
|
@@ -13,10 +11,6 @@ export const Detail = ({
|
|
|
13
11
|
children,
|
|
14
12
|
...rest
|
|
15
13
|
}) => {
|
|
16
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
17
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Detail' component.");
|
|
18
|
-
deprecatedClassNameWarningShown = true;
|
|
19
|
-
}
|
|
20
14
|
return /*#__PURE__*/React.createElement(StyledDetail, _extends({
|
|
21
15
|
className: `carbon-detail ${className}`
|
|
22
16
|
}, tagComponent("detail", rest), filterStyledSystemMarginProps(rest)), icon && /*#__PURE__*/React.createElement(StyledDetailIcon, {
|