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
|
@@ -11,7 +11,11 @@ export interface ContentPaddingInterface {
|
|
|
11
11
|
px?: PaddingValues;
|
|
12
12
|
}
|
|
13
13
|
export interface DialogProps extends ModalProps, TagProps {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
* @ignore
|
|
17
|
+
* @internal
|
|
18
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
15
19
|
className?: string;
|
|
16
20
|
/** Prop to specify the aria-describedby property of the Dialog component */
|
|
17
21
|
"aria-describedby"?: string;
|
|
@@ -5,7 +5,6 @@ import createGuid from "../../__internal__/utils/helpers/guid";
|
|
|
5
5
|
import Modal from "../modal";
|
|
6
6
|
import Heading from "../heading";
|
|
7
7
|
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
8
|
-
import Logger from "../../__internal__/utils/logger";
|
|
9
8
|
import { StyledDialog, StyledDialogTitle, StyledDialogContent, DialogPositioner } from "./dialog.style";
|
|
10
9
|
import FocusTrap from "../../__internal__/focus-trap";
|
|
11
10
|
import IconButton from "../icon-button";
|
|
@@ -13,7 +12,6 @@ import Icon from "../icon";
|
|
|
13
12
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
14
13
|
import useModalAria from "../../hooks/__internal__/useModalAria/useModalAria";
|
|
15
14
|
const PADDING_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
16
|
-
let deprecatedClassNameWarningShown = false;
|
|
17
15
|
const Dialog = /*#__PURE__*/forwardRef(({
|
|
18
16
|
className,
|
|
19
17
|
"data-component": dataComponent = "dialog",
|
|
@@ -41,12 +39,11 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
|
41
39
|
topModalOverride,
|
|
42
40
|
closeButtonDataProps,
|
|
43
41
|
restoreFocusOnClose = true,
|
|
42
|
+
"aria-labelledby": ariaLabelledBy,
|
|
43
|
+
"aria-describedby": ariaDescribedBy,
|
|
44
|
+
"aria-label": ariaLabel,
|
|
44
45
|
...rest
|
|
45
46
|
}, ref) => {
|
|
46
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
47
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Dialog' component.");
|
|
48
|
-
deprecatedClassNameWarningShown = true;
|
|
49
|
-
}
|
|
50
47
|
const locale = useLocale();
|
|
51
48
|
const containerRef = useRef(null);
|
|
52
49
|
const titleRef = useRef(null);
|
|
@@ -92,11 +89,11 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
|
92
89
|
const dialogProps = {
|
|
93
90
|
size,
|
|
94
91
|
dialogHeight,
|
|
95
|
-
"aria-labelledby": title && typeof title === "string" ? titleId :
|
|
96
|
-
"aria-describedby": subtitle && typeof subtitle === "string" ? subtitleId :
|
|
97
|
-
"aria-label":
|
|
92
|
+
"aria-labelledby": title && typeof title === "string" ? titleId : ariaLabelledBy,
|
|
93
|
+
"aria-describedby": subtitle && typeof subtitle === "string" ? subtitleId : ariaDescribedBy,
|
|
94
|
+
"aria-label": ariaLabel
|
|
98
95
|
};
|
|
99
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
96
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
100
97
|
open: open,
|
|
101
98
|
onCancel: onCancel,
|
|
102
99
|
disableEscKey: disableEscKey,
|
|
@@ -104,7 +101,7 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
|
104
101
|
className: className ? `${className} carbon-dialog` : "carbon-dialog",
|
|
105
102
|
topModalOverride: topModalOverride,
|
|
106
103
|
restoreFocusOnClose: restoreFocusOnClose
|
|
107
|
-
}, /*#__PURE__*/React.createElement(FocusTrap, {
|
|
104
|
+
}, rest), /*#__PURE__*/React.createElement(FocusTrap, {
|
|
108
105
|
autoFocus: !disableAutoFocus,
|
|
109
106
|
focusFirstElement: focusFirstElement,
|
|
110
107
|
bespokeTrap: bespokeFocusTrap,
|
|
@@ -12,7 +12,7 @@ declare type StyledHeadingTitleProps = {
|
|
|
12
12
|
withMargin?: boolean;
|
|
13
13
|
};
|
|
14
14
|
declare const StyledHeadingTitle: import("styled-components").StyledComponent<{
|
|
15
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children,
|
|
15
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, className, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
}, any, StyledHeadingTitleProps, never>;
|
|
18
18
|
declare const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -25,7 +25,7 @@ declare const StyledHeadingIcon: import("styled-components").StyledComponent<imp
|
|
|
25
25
|
declare const StyledSeparator: import("styled-components").StyledComponent<"hr", any, {}, never>;
|
|
26
26
|
declare const StyledDivider: import("styled-components").StyledComponent<({ adaptiveMxBreakpoint, ml, mr, "aria-hidden": ariaHidden, ...rest }: import("../hr").HrProps) => JSX.Element, any, {}, never>;
|
|
27
27
|
declare const StyledHeaderHelp: import("styled-components").StyledComponent<{
|
|
28
|
-
({ as, ariaLabel, children,
|
|
28
|
+
({ as, ariaLabel, children, href, helpId, isFocused, tabIndex, tooltipBgColor, tooltipFontColor, tooltipFlipOverrides, tooltipId, tooltipPosition, type, ...rest }: import("../help").HelpProps): JSX.Element;
|
|
29
29
|
displayName: string;
|
|
30
30
|
}, any, {}, never>;
|
|
31
31
|
export { StyledHeadingIcon, StyledHeading, StyledSubHeader, StyledHeader, StyledSeparator, StyledHeaderHelp, StyledHeadingTitle, StyledDivider, StyledHeaderContent, StyledHeadingBackButton, StyledHeadingPills, };
|
|
@@ -9,8 +9,6 @@ export interface HelpProps extends MarginProps {
|
|
|
9
9
|
ariaLabel?: string;
|
|
10
10
|
/** The message to be displayed within the tooltip */
|
|
11
11
|
children?: React.ReactNode;
|
|
12
|
-
/** [Legacy] A custom class name for the component. */
|
|
13
|
-
className?: string;
|
|
14
12
|
/** The unique id of the component (used with aria-describedby for accessibility) */
|
|
15
13
|
helpId?: string;
|
|
16
14
|
/** A path for the anchor */
|
|
@@ -37,7 +35,7 @@ export interface HelpProps extends MarginProps {
|
|
|
37
35
|
[key: string]: any;
|
|
38
36
|
}
|
|
39
37
|
export declare const Help: {
|
|
40
|
-
({ as, ariaLabel, children,
|
|
38
|
+
({ as, ariaLabel, children, href, helpId, isFocused, tabIndex, tooltipBgColor, tooltipFontColor, tooltipFlipOverrides, tooltipId, tooltipPosition, type, ...rest }: HelpProps): JSX.Element;
|
|
41
39
|
displayName: string;
|
|
42
40
|
};
|
|
43
41
|
export default Help;
|
|
@@ -8,13 +8,10 @@ import Events from "../../__internal__/utils/helpers/events";
|
|
|
8
8
|
import { TooltipContext } from "../../__internal__/tooltip-provider";
|
|
9
9
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
10
10
|
import guid from "../../__internal__/utils/helpers/guid";
|
|
11
|
-
import Logger from "../../__internal__/utils/logger";
|
|
12
|
-
let deprecatedClassNameWarningShown = false;
|
|
13
11
|
const Help = ({
|
|
14
12
|
as,
|
|
15
13
|
ariaLabel = "help",
|
|
16
14
|
children,
|
|
17
|
-
className,
|
|
18
15
|
href,
|
|
19
16
|
helpId,
|
|
20
17
|
isFocused,
|
|
@@ -27,10 +24,6 @@ const Help = ({
|
|
|
27
24
|
type = "help",
|
|
28
25
|
...rest
|
|
29
26
|
}) => {
|
|
30
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
31
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Help' component.");
|
|
32
|
-
deprecatedClassNameWarningShown = true;
|
|
33
|
-
}
|
|
34
27
|
const defaultTooltipId = useRef(guid());
|
|
35
28
|
const helpElement = useRef(null);
|
|
36
29
|
const [isTooltipVisible, updateTooltipVisible] = useState(false);
|
|
@@ -58,7 +51,6 @@ const Help = ({
|
|
|
58
51
|
return /*#__PURE__*/React.createElement(StyledHelp, _extends({
|
|
59
52
|
"aria-describedby": isFocused || isTooltipVisible ? tooltipId || defaultTooltipId.current : undefined,
|
|
60
53
|
"aria-label": helpAriaLabel || ariaLabel,
|
|
61
|
-
className: className,
|
|
62
54
|
as: tagType,
|
|
63
55
|
href: href,
|
|
64
56
|
id: helpId,
|
|
@@ -95,7 +87,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
95
87
|
"ariaLabel": PropTypes.string,
|
|
96
88
|
"as": PropTypes.oneOf(["a", "abbr", "address", "animate", "animateMotion", "animateTransform", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "circle", "cite", "clipPath", "code", "col", "colgroup", "data", "datalist", "dd", "defs", "del", "desc", "details", "dfn", "dialog", "div", "dl", "dt", "ellipse", "em", "embed", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "fieldset", "figcaption", "figure", "filter", "footer", "foreignObject", "form", "g", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "line", "linearGradient", "link", "main", "map", "mark", "marker", "mask", "menu", "menuitem", "meta", "metadata", "meter", "mpath", "nav", "noindex", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "path", "pattern", "picture", "polygon", "polyline", "pre", "progress", "q", "radialGradient", "rect", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "stop", "strong", "style", "sub", "summary", "sup", "svg", "switch", "symbol", "table", "tbody", "td", "template", "text", "textarea", "textPath", "tfoot", "th", "thead", "time", "title", "tr", "track", "tspan", "u", "ul", "use", "var", "video", "view", "wbr", "webview"]),
|
|
97
89
|
"children": PropTypes.node,
|
|
98
|
-
"className": PropTypes.string,
|
|
99
90
|
"helpId": PropTypes.string,
|
|
100
91
|
"href": PropTypes.string,
|
|
101
92
|
"isFocused": PropTypes.bool,
|
|
@@ -20,7 +20,7 @@ const dlsConfig = {
|
|
|
20
20
|
};
|
|
21
21
|
export const ICON_TOOLTIP_POSITIONS = ["bottom", "left", "right", "top"];
|
|
22
22
|
export const ICON_SHAPES = ["circle", "rounded-rect", "square"];
|
|
23
|
-
export const ICON_SIZES = ["
|
|
23
|
+
export const ICON_SIZES = ["small", "medium", "large", "extra-large"];
|
|
24
24
|
export const ICON_FONT_SIZES = ["small", "medium", "large", "extra-large"];
|
|
25
25
|
export const ICONS = ["accessibility_web", "add", "admin", "alert", "alert_on", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow", "arrow_bottom_right_circle", "arrow_down", "arrow_left", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_right", "arrow_right_small", "arrow_top_left_circle", "arrow_up", "arrows_left_right", "attach", "bank", "bank_with_card", "basket", "basket_with_squares", "bed", "bill_paid", "bill_unpaid", "bin", "biometric", "blocked", "blocked_square", "block_arrow_right", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list", "bullet_list_dotted", "bullet_list_numbers", "business", "calendar", "calendar_today", "call", "calendar_pay_date", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_left", "caret_right", "caret_up", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "cart", "cash", "chat", "chart_bar", "chart_line", "chart_pie", "chat_notes", "check_all", "check_none", "chevron_down", "chevron_left", "chevron_right", "chevron_up", "chevron_down_thick", "chevron_left_thick", "chevron_right_thick", "chevron_up_thick", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect", "connect_off", "construction", "contacts", "contact_card", "copy", "create", "credit_card", "credit_card_slash", "cross", "cross_circle", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "drag", "drag_vertical", "draft", "drill", "dropdown", "duplicate", "edit", "edited", "email", "email_switch", "entry", "ellipsis_horizontal", "ellipsis_vertical", "envelope_dollar", "envelope_euro", "error", "error_square", "euro", "expand", "export", "factory", "favourite", "favourite_lined", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter", "filter_new", "fit_height", "fit_width", "flag", "folder", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "heart_pulse", "help", "hide", "hand_cash_coins", "hand_cash_note", "home", "image", "import", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger", "ledger_arrow_left", "ledger_arrow_right", "lightbulb_off", "lightbulb_on", "like", "like_no", "link", "link_cloud", "link_on", "list_view", "locked", "location", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus", "minus_large", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause", "pause_circle", "petrol_pump", "pdf", "pin", "people", "people_switch", "percentage_boxed", "person", "person_info", "person_tick", "phone", "piggy_bank", "plane", "play", "play_circle", "plus", "plus_large", "pound", "print", "progress", "progressed", "protect", "question", "question_hollow", "question_mark", "recruiting", "refresh", "refresh_clock", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings", "settings_old", "share", "shield_with_tick", "shield_with_tick_outline", "shop", "sort_down", "sort_up", "spanner", "split", "split_container", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "stop", "stop_circle", "submitted", "support_online", "sync", "tag", "talk", "target", "target_man", "theatre_masks", "three_boxes", "tick", "tick_circle", "tick_thick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare", "worldwide_location"];
|
|
26
26
|
export default dlsConfig;
|
|
@@ -7,8 +7,6 @@ import { TooltipContext } from "../../__internal__/tooltip-provider";
|
|
|
7
7
|
import StyledIcon from "./icon.style";
|
|
8
8
|
import { ICON_TOOLTIP_POSITIONS } from "./icon-config";
|
|
9
9
|
import TabTitleContext from "../tabs/__internal__/tab-title/tab-title.context";
|
|
10
|
-
import Logger from "../../__internal__/utils/logger";
|
|
11
|
-
let deprecatedExtraSmallBgSizeTriggered = false;
|
|
12
10
|
const Icon = /*#__PURE__*/React.forwardRef(({
|
|
13
11
|
"aria-hidden": ariaHidden,
|
|
14
12
|
ariaLabel,
|
|
@@ -38,10 +36,6 @@ const Icon = /*#__PURE__*/React.forwardRef(({
|
|
|
38
36
|
...rest
|
|
39
37
|
}, ref) => {
|
|
40
38
|
const flipBehaviourCheck = Array.isArray(tooltipFlipOverrides) && tooltipFlipOverrides.every(override => ICON_TOOLTIP_POSITIONS.includes(override));
|
|
41
|
-
if (!deprecatedExtraSmallBgSizeTriggered && bgSize === "extra-small") {
|
|
42
|
-
deprecatedExtraSmallBgSizeTriggered = true;
|
|
43
|
-
Logger.deprecate("The `extra-small` variant of the `bgSize` prop for `Icon` component has been deprecated and will soon be removed.");
|
|
44
|
-
}
|
|
45
39
|
if (tooltipFlipOverrides) {
|
|
46
40
|
!flipBehaviourCheck ? process.env.NODE_ENV !== "production" ? invariant(false, `The tooltipFlipOverrides prop supplied to \`Icon\` must be an array containing some or all of ["top", "bottom", "left", "right"].`) : invariant(false) : void 0;
|
|
47
41
|
}
|
|
@@ -134,7 +128,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
134
128
|
"ariaLabel": PropTypes.string,
|
|
135
129
|
"bg": PropTypes.string,
|
|
136
130
|
"bgShape": PropTypes.oneOf(["circle", "rounded-rect", "square"]),
|
|
137
|
-
"bgSize": PropTypes.oneOf(["extra-large", "
|
|
131
|
+
"bgSize": PropTypes.oneOf(["extra-large", "large", "medium", "small"]),
|
|
138
132
|
"className": PropTypes.string,
|
|
139
133
|
"color": PropTypes.string,
|
|
140
134
|
"data-element": PropTypes.string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ThemeObject } from "../../style/themes/base";
|
|
2
2
|
import { IconType } from "./icon-type";
|
|
3
3
|
export declare type BackgroundShape = "circle" | "rounded-rect" | "square";
|
|
4
|
-
export declare type BgSize = "
|
|
4
|
+
export declare type BgSize = "small" | "medium" | "large" | "extra-large";
|
|
5
5
|
export declare type FontSize = "small" | "medium" | "large" | "extra-large";
|
|
6
6
|
export interface StyledIconProps {
|
|
7
7
|
/** Background colour, provide any color from palette or any valid css color value. */
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { shade } from "polished";
|
|
3
3
|
import { margin } from "styled-system";
|
|
4
|
-
import iconUnicodes from "./icon-unicodes";
|
|
5
4
|
import baseTheme from "../../style/themes/base";
|
|
6
|
-
import
|
|
7
|
-
import browserTypeCheck, { isSafari } from "../../__internal__/utils/helpers/browser-type-check";
|
|
5
|
+
import addFocusStyling from "../../style/utils/add-focus-styling";
|
|
8
6
|
import styledColor from "../../style/utils/color";
|
|
9
7
|
import getColorValue from "../../style/utils/get-color-value";
|
|
10
|
-
import
|
|
8
|
+
import browserTypeCheck, { isSafari } from "../../__internal__/utils/helpers/browser-type-check";
|
|
9
|
+
import iconConfig from "./icon-config";
|
|
10
|
+
import iconUnicodes from "./icon-unicodes";
|
|
11
11
|
function adjustIconBgSize(fontSize, bgSize) {
|
|
12
12
|
const sizeValues = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
large: 4
|
|
17
|
-
"extra-large": 5
|
|
13
|
+
small: 1,
|
|
14
|
+
medium: 2,
|
|
15
|
+
large: 3,
|
|
16
|
+
"extra-large": 4
|
|
18
17
|
};
|
|
19
18
|
if (fontSize && bgSize) {
|
|
20
19
|
const fontSizeValue = sizeValues[fontSize];
|
|
@@ -27,7 +26,7 @@ function adjustIconBgSize(fontSize, bgSize) {
|
|
|
27
26
|
return iconConfig.backgroundSize[bgSize];
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
/* The below is ignored as removing it may cause regressions as some components import StyledIcon directly from this file
|
|
29
|
+
/* The below is ignored as removing it may cause regressions as some components import StyledIcon directly from this file
|
|
31
30
|
however it cannot be tested in the Icon tests as these props always have a value. */
|
|
32
31
|
/* istanbul ignore next */
|
|
33
32
|
return bgSize ? iconConfig.backgroundSize[bgSize] : undefined;
|
|
@@ -125,7 +124,7 @@ const StyledIcon = styled.span`
|
|
|
125
124
|
${type === "services" && isSafari(navigator) && !browserTypeCheck(window) && css`
|
|
126
125
|
margin-top: -6px;
|
|
127
126
|
`}
|
|
128
|
-
|
|
127
|
+
|
|
129
128
|
display: block;
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -33,5 +33,5 @@ declare const StyledImage: import("styled-components").StyledComponent<"div", an
|
|
|
33
33
|
bottom: string | undefined;
|
|
34
34
|
left: string | undefined;
|
|
35
35
|
as?: string | undefined;
|
|
36
|
-
} & StyledImageProps, "hidden" | "children" | "as" | "left" | "right" | "
|
|
36
|
+
} & StyledImageProps, "hidden" | "children" | "as" | "left" | "right" | "top" | "bottom" | "src" | "position">;
|
|
37
37
|
export { StyledImage };
|
|
@@ -6,7 +6,11 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
|
|
|
6
6
|
adaptiveLabelBreakpoint?: number;
|
|
7
7
|
/** Children elements */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
* @internal
|
|
12
|
+
* @ignore
|
|
13
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
10
14
|
className?: string;
|
|
11
15
|
/** The id of the corresponding input control for the label */
|
|
12
16
|
htmlFor?: string;
|
|
@@ -25,7 +29,7 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
|
|
|
25
29
|
isOptional?: boolean;
|
|
26
30
|
}
|
|
27
31
|
declare const InlineInputs: {
|
|
28
|
-
({ adaptiveLabelBreakpoint, label, labelAlign, labelId, htmlFor, children,
|
|
32
|
+
({ adaptiveLabelBreakpoint, label, labelAlign, labelId, htmlFor, children, gutter, inputWidth, labelInline, labelWidth, required, isOptional, ...rest }: InlineInputsProps): React.JSX.Element;
|
|
29
33
|
displayName: string;
|
|
30
34
|
};
|
|
31
35
|
export default InlineInputs;
|
|
@@ -6,8 +6,6 @@ import StyledInlineInputs, { StyledContentContainer, StyledInlineInput } from ".
|
|
|
6
6
|
import FormSpacingProvider from "../../__internal__/form-spacing-provider";
|
|
7
7
|
import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint";
|
|
8
8
|
import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
|
|
9
|
-
import Logger from "../../__internal__/utils/logger";
|
|
10
|
-
let deprecatedClassNameWarningShown = false;
|
|
11
9
|
const columnWrapper = (children, gutter) => {
|
|
12
10
|
return React.Children.map(children, input => {
|
|
13
11
|
return /*#__PURE__*/React.createElement(StyledInlineInput, {
|
|
@@ -23,7 +21,6 @@ const InlineInputs = ({
|
|
|
23
21
|
labelId,
|
|
24
22
|
htmlFor,
|
|
25
23
|
children = null,
|
|
26
|
-
className = "",
|
|
27
24
|
gutter = "none",
|
|
28
25
|
inputWidth,
|
|
29
26
|
labelInline = true,
|
|
@@ -32,10 +29,6 @@ const InlineInputs = ({
|
|
|
32
29
|
isOptional,
|
|
33
30
|
...rest
|
|
34
31
|
}) => {
|
|
35
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
36
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'InlineInputs' component.");
|
|
37
|
-
deprecatedClassNameWarningShown = true;
|
|
38
|
-
}
|
|
39
32
|
const largeScreen = useIsAboveBreakpoint(adaptiveLabelBreakpoint);
|
|
40
33
|
const ref = useRef(null);
|
|
41
34
|
let inlineLabel = labelInline;
|
|
@@ -64,7 +57,6 @@ const InlineInputs = ({
|
|
|
64
57
|
gutter: gutter,
|
|
65
58
|
"data-component": "inline-inputs",
|
|
66
59
|
"data-role": "inline-inputs",
|
|
67
|
-
className: className,
|
|
68
60
|
labelWidth: labelWidth,
|
|
69
61
|
labelInline: inlineLabel,
|
|
70
62
|
ref: ref
|
|
@@ -18,8 +18,6 @@ export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
|
|
|
18
18
|
tooltipPosition?: "bottom" | "left" | "right" | "top";
|
|
19
19
|
/** Child content to render in the link. */
|
|
20
20
|
children?: React.ReactNode;
|
|
21
|
-
/** Classes to apply to the component. */
|
|
22
|
-
className?: string;
|
|
23
21
|
/** Target property in which link should open ie: _blank, _self, _parent, _top */
|
|
24
22
|
target?: string;
|
|
25
23
|
/** Aria label for accessibility purposes */
|
|
@@ -30,6 +28,12 @@ export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
|
|
|
30
28
|
placeholderTabIndex?: boolean;
|
|
31
29
|
/** @ignore @private internal prop to be set when no aria-label should be specified */
|
|
32
30
|
removeAriaLabelOnIcon?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @internal
|
|
34
|
+
* @ignore
|
|
35
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
36
|
+
className?: string;
|
|
33
37
|
}
|
|
34
38
|
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
|
|
35
39
|
export default Link;
|
|
@@ -7,11 +7,8 @@ import { StyledLink, StyledContent } from "./link.style";
|
|
|
7
7
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
8
8
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
9
9
|
import BatchSelectionContext from "../batch-selection/__internal__/batch-selection.context";
|
|
10
|
-
import Logger from "../../__internal__/utils/logger";
|
|
11
|
-
let deprecatedClassNameWarningShown = false;
|
|
12
10
|
const Link = /*#__PURE__*/React.forwardRef(({
|
|
13
11
|
children,
|
|
14
|
-
className,
|
|
15
12
|
onKeyDown,
|
|
16
13
|
href,
|
|
17
14
|
onClick,
|
|
@@ -29,12 +26,9 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
29
26
|
isDarkBackground,
|
|
30
27
|
placeholderTabIndex,
|
|
31
28
|
removeAriaLabelOnIcon,
|
|
29
|
+
className,
|
|
32
30
|
...rest
|
|
33
31
|
}, ref) => {
|
|
34
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
35
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Link' component.");
|
|
36
|
-
deprecatedClassNameWarningShown = true;
|
|
37
|
-
}
|
|
38
32
|
const [hasFocus, setHasFocus] = useState(false);
|
|
39
33
|
const l = useLocale();
|
|
40
34
|
const {
|
|
@@ -102,8 +96,8 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
102
96
|
return /*#__PURE__*/React.createElement(StyledLink, _extends({
|
|
103
97
|
isSkipLink: isSkipLink,
|
|
104
98
|
disabled: isDisabled,
|
|
105
|
-
className: className,
|
|
106
99
|
iconAlign: iconAlign,
|
|
100
|
+
className: className,
|
|
107
101
|
hasContent: Boolean(children),
|
|
108
102
|
variant: variant,
|
|
109
103
|
isDarkBackground: isDarkBackground,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { LoaderSpinnerProps } from "./loader-spinner.component";
|
|
3
3
|
export declare const StyledSpinnerWrapper: import("styled-components").StyledComponent<"div", any, Pick<LoaderSpinnerProps, "size">, never>;
|
|
4
4
|
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children,
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, className, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
}, any, Required<Pick<LoaderSpinnerProps, "size">>, never>;
|
|
8
8
|
interface StyledSpinnerCircleSvgProps extends Omit<LoaderSpinnerProps, "showSpinnerLabel"> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { LoaderStarProps } from "./loader-star.component";
|
|
3
3
|
export declare const StyledLoaderStarWrapper: import("styled-components").StyledComponent<"div", any, LoaderStarProps, never>;
|
|
4
4
|
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
-
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children,
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordBreak, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, className, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
}, any, {}, never>;
|
|
8
8
|
export declare const StyledStars: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -4,8 +4,6 @@ import { IconType } from "../../icon";
|
|
|
4
4
|
import { TagProps } from "../../../__internal__/utils/helpers/tags";
|
|
5
5
|
export declare type VariantType = "default" | "alternate";
|
|
6
6
|
interface MenuItemBaseProps extends Omit<TagProps, "data-component">, Pick<LayoutProps, "width" | "maxWidth" | "minWidth">, FlexboxProps, PaddingProps {
|
|
7
|
-
/** Custom className */
|
|
8
|
-
className?: string;
|
|
9
7
|
/** onClick handler */
|
|
10
8
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
9
|
/** Defines which direction the submenu will hang eg. left/right */
|
|
@@ -11,8 +11,6 @@ import SubmenuContext from "../__internal__/submenu/submenu.context";
|
|
|
11
11
|
import MenuSegmentContext from "../menu-segment-title/menu-segment-title.context";
|
|
12
12
|
import { StyledMenuItem } from "../menu.style";
|
|
13
13
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
14
|
-
import Logger from "../../../__internal__/utils/logger";
|
|
15
|
-
let deprecatedClassNameWarningShown = false;
|
|
16
14
|
export const MenuItem = ({
|
|
17
15
|
submenu,
|
|
18
16
|
submenuMaxWidth,
|
|
@@ -38,10 +36,6 @@ export const MenuItem = ({
|
|
|
38
36
|
"data-role": dataRole,
|
|
39
37
|
...rest
|
|
40
38
|
}) => {
|
|
41
|
-
if (!deprecatedClassNameWarningShown && rest.className) {
|
|
42
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'MenuItem' component.");
|
|
43
|
-
deprecatedClassNameWarningShown = true;
|
|
44
|
-
}
|
|
45
39
|
!(icon || children) ? process.env.NODE_ENV !== "production" ? invariant(false, "Either prop `icon` must be defined or this node must have `children`.") : invariant(false) : void 0;
|
|
46
40
|
!(children || ariaLabel || typeof submenu === "string") ? process.env.NODE_ENV !== "production" ? invariant(false, "If no text is provided an `ariaLabel` should be given to facilitate accessibility.") : invariant(false) : void 0;
|
|
47
41
|
!(typeof submenu === "boolean" || submenu === undefined || children && typeof submenu === "string" && submenu.length) ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not pass `children` when `submenu` is an empty string") : invariant(false) : void 0;
|
|
@@ -4,8 +4,6 @@ export declare type MessageVariant = "error" | "info" | "success" | "warning" |
|
|
|
4
4
|
export interface MessageProps extends MarginProps {
|
|
5
5
|
/** set content to component */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/** set custom class to component */
|
|
8
|
-
className?: string;
|
|
9
7
|
/** set custom aria label for message close button */
|
|
10
8
|
closeButtonAriaLabel?: string;
|
|
11
9
|
/** set custom id to component root */
|
|
@@ -10,8 +10,6 @@ import Icon from "../icon";
|
|
|
10
10
|
import IconButton from "../icon-button";
|
|
11
11
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
12
12
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
13
|
-
import Logger from "../../__internal__/utils/logger";
|
|
14
|
-
let deprecatedClassNameWarningShown = false;
|
|
15
13
|
const Message = /*#__PURE__*/React.forwardRef(({
|
|
16
14
|
open = true,
|
|
17
15
|
transparent = false,
|
|
@@ -20,15 +18,10 @@ const Message = /*#__PURE__*/React.forwardRef(({
|
|
|
20
18
|
children,
|
|
21
19
|
onDismiss,
|
|
22
20
|
id,
|
|
23
|
-
className,
|
|
24
21
|
closeButtonAriaLabel,
|
|
25
22
|
showCloseIcon = true,
|
|
26
23
|
...props
|
|
27
24
|
}, ref) => {
|
|
28
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
29
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Message' component.");
|
|
30
|
-
deprecatedClassNameWarningShown = true;
|
|
31
|
-
}
|
|
32
25
|
const messageRef = useRef(null);
|
|
33
26
|
const refToPass = ref || messageRef;
|
|
34
27
|
const marginProps = filterStyledSystemMarginProps(props);
|
|
@@ -44,7 +37,6 @@ const Message = /*#__PURE__*/React.forwardRef(({
|
|
|
44
37
|
}));
|
|
45
38
|
};
|
|
46
39
|
return open ? /*#__PURE__*/React.createElement(MessageStyle, _extends({}, tagComponent("Message", props), {
|
|
47
|
-
className: className,
|
|
48
40
|
transparent: transparent,
|
|
49
41
|
variant: variant,
|
|
50
42
|
id: id,
|
|
@@ -65,7 +57,6 @@ const Message = /*#__PURE__*/React.forwardRef(({
|
|
|
65
57
|
if (process.env.NODE_ENV !== "production") {
|
|
66
58
|
Message.propTypes = {
|
|
67
59
|
"children": PropTypes.node,
|
|
68
|
-
"className": PropTypes.string,
|
|
69
60
|
"closeButtonAriaLabel": PropTypes.string,
|
|
70
61
|
"id": PropTypes.string,
|
|
71
62
|
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
3
3
|
export interface ModalProps extends Omit<TagProps, "data-component"> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* @internal
|
|
7
|
+
* @ignore
|
|
8
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
5
9
|
className?: string;
|
|
6
10
|
/** Modal content */
|
|
7
11
|
children?: React.ReactNode;
|
|
@@ -8,8 +8,6 @@ import Events from "../../__internal__/utils/helpers/events";
|
|
|
8
8
|
import useModalManager from "../../hooks/__internal__/useModalManager";
|
|
9
9
|
import { StyledModal, StyledModalBackground } from "./modal.style";
|
|
10
10
|
import ModalContext from "./__internal__/modal.context";
|
|
11
|
-
import Logger from "../../__internal__/utils/logger";
|
|
12
|
-
let deprecatedClassNameWarningShown = false;
|
|
13
11
|
const Modal = ({
|
|
14
12
|
children,
|
|
15
13
|
"data-element": dataElement,
|
|
@@ -24,10 +22,6 @@ const Modal = ({
|
|
|
24
22
|
restoreFocusOnClose = true,
|
|
25
23
|
...rest
|
|
26
24
|
}) => {
|
|
27
|
-
if (!deprecatedClassNameWarningShown && rest.className) {
|
|
28
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Modal' component.");
|
|
29
|
-
deprecatedClassNameWarningShown = true;
|
|
30
|
-
}
|
|
31
25
|
const ref = useRef(null);
|
|
32
26
|
const backgroundNodeRef = useRef(null);
|
|
33
27
|
const contentNodeRef = useRef(null);
|
|
@@ -12,8 +12,6 @@ export interface PodProps extends MarginProps {
|
|
|
12
12
|
border?: boolean;
|
|
13
13
|
/** Children elements */
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
/** Custom className */
|
|
16
|
-
className?: string;
|
|
17
15
|
/** Determines the padding around the pod */
|
|
18
16
|
size?: PodSize;
|
|
19
17
|
/** Prop to apply a theme to the Pod */
|
|
@@ -2,18 +2,15 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { useState, useMemo } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
5
|
-
import Logger from "../../__internal__/utils/logger";
|
|
6
5
|
import { StyledBlock, StyledContent, StyledEditAction, StyledActionsContainer, StyledDeleteButton, StyledUndoButton, StyledFooter, StyledPod, StyledHeader, StyledSubtitle, StyledTitle } from "./pod.style";
|
|
7
6
|
import Icon from "../icon";
|
|
8
7
|
import Event from "../../__internal__/utils/helpers/events";
|
|
9
|
-
let deprecatedClassNameWarningShown = false;
|
|
10
8
|
const Pod = /*#__PURE__*/React.forwardRef(({
|
|
11
9
|
"data-element": dataElement,
|
|
12
10
|
"data-role": dataRole,
|
|
13
11
|
alignTitle = "left",
|
|
14
12
|
border = true,
|
|
15
13
|
children,
|
|
16
|
-
className,
|
|
17
14
|
displayEditButtonOnHover,
|
|
18
15
|
editContentFullWidth,
|
|
19
16
|
footer,
|
|
@@ -30,10 +27,6 @@ const Pod = /*#__PURE__*/React.forwardRef(({
|
|
|
30
27
|
variant = "primary",
|
|
31
28
|
...rest
|
|
32
29
|
}, ref) => {
|
|
33
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
34
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Pod' component.");
|
|
35
|
-
deprecatedClassNameWarningShown = true;
|
|
36
|
-
}
|
|
37
30
|
const [isEditFocused, setEditFocused] = useState(false);
|
|
38
31
|
const [isEditHovered, setEditHovered] = useState(false);
|
|
39
32
|
const [isDeleteFocused, setDeleteFocused] = useState(false);
|
|
@@ -58,7 +51,6 @@ const Pod = /*#__PURE__*/React.forwardRef(({
|
|
|
58
51
|
};
|
|
59
52
|
return /*#__PURE__*/React.createElement(StyledPod, _extends({
|
|
60
53
|
alignTitle: alignTitle,
|
|
61
|
-
className: className,
|
|
62
54
|
internalEditButton: internalEditButton,
|
|
63
55
|
height: typeof height === "number" ? `${height}px` : height,
|
|
64
56
|
ref: ref,
|
|
@@ -152,7 +144,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
152
144
|
"alignTitle": PropTypes.oneOf(["center", "left", "right"]),
|
|
153
145
|
"border": PropTypes.bool,
|
|
154
146
|
"children": PropTypes.node,
|
|
155
|
-
"className": PropTypes.string,
|
|
156
147
|
"data-element": PropTypes.string,
|
|
157
148
|
"data-role": PropTypes.string,
|
|
158
149
|
"displayEditButtonOnHover": PropTypes.bool,
|
|
@@ -2,7 +2,11 @@ import React from "react";
|
|
|
2
2
|
export interface PortalProps {
|
|
3
3
|
/** The content of the portal. */
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* @internal
|
|
8
|
+
* @ignore
|
|
9
|
+
* Sets className for component. INTERNAL USE ONLY. */
|
|
6
10
|
className?: string;
|
|
7
11
|
/** Id attribute attached to portal container. */
|
|
8
12
|
id?: string;
|
|
@@ -5,8 +5,6 @@ import guid from "../../__internal__/utils/helpers/guid";
|
|
|
5
5
|
import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
|
|
6
6
|
import StyledPortalEntrance from "./portal.style";
|
|
7
7
|
import PortalContext from "./__internal__/portal.context";
|
|
8
|
-
import Logger from "../../__internal__/utils/logger";
|
|
9
|
-
let deprecatedClassNameWarningShown = false;
|
|
10
8
|
const Container = styled.div`
|
|
11
9
|
${({
|
|
12
10
|
theme
|
|
@@ -24,10 +22,6 @@ export const Portal = ({
|
|
|
24
22
|
onReposition,
|
|
25
23
|
inertOptOut
|
|
26
24
|
}) => {
|
|
27
|
-
if (!deprecatedClassNameWarningShown && className) {
|
|
28
|
-
Logger.deprecate("The 'className' prop has been deprecated and will soon be removed from the 'Portal' component.");
|
|
29
|
-
deprecatedClassNameWarningShown = true;
|
|
30
|
-
}
|
|
31
25
|
const [portalNode, setPortalNode] = useState(null);
|
|
32
26
|
const uniqueId = useMemo(() => guid(), []);
|
|
33
27
|
const {
|