carbon-react 107.2.1 → 109.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__/input/input-presentation.style.d.ts +1 -1
- package/esm/__internal__/input/input.component.js +52 -2
- package/esm/__internal__/input-icon-toggle/index.d.ts +2 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +20 -0
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.js +16 -17
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +12 -0
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +7 -17
- package/esm/__internal__/label/label.component.js +1 -1
- package/esm/__spec_helper__/index.js +1 -1
- package/esm/components/accordion/accordion.style.d.ts +2 -2
- package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
- package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
- package/esm/components/action-popover/action-popover.style.d.ts +4 -4
- package/esm/components/badge/badge.style.d.ts +1 -2
- package/esm/components/button/button.component.d.ts +2 -1
- package/esm/components/button/button.component.js +3 -3
- package/esm/components/confirm/confirm.d.ts +1 -1
- package/esm/components/flat-table/flat-table.style.js +1 -1
- package/esm/components/help/help.d.ts +1 -1
- package/esm/components/icon/icon-config.d.ts +14 -11
- package/esm/components/icon/icon-config.js +1 -1
- package/esm/components/icon/icon-type.d.ts +1 -0
- package/esm/components/icon/icon-type.js +1 -0
- package/esm/components/icon/icon.component.d.ts +46 -0
- package/esm/components/icon/icon.component.js +212 -125
- package/esm/components/icon/icon.style.d.ts +37 -1
- package/esm/components/icon/icon.style.js +10 -35
- package/esm/components/icon/index.d.ts +3 -2
- package/esm/components/icon-button/icon-button.d.ts +1 -1
- package/esm/components/link/link.component.d.ts +2 -2
- package/esm/components/link/link.component.js +1 -1
- package/esm/components/menu/menu-item/menu-item.d.ts +1 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +50 -1
- package/esm/components/popover-container/index.d.ts +2 -1
- package/esm/components/popover-container/popover-container.component.d.ts +56 -0
- package/esm/components/popover-container/popover-container.component.js +234 -106
- package/esm/components/popover-container/popover-container.style.d.ts +18 -0
- package/esm/hooks/__internal__/useModalManager/useModalManager.js +14 -11
- package/esm/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/esm/style/utils/filter-styled-system-padding-props.js +4 -2
- package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
- package/lib/__internal__/input/input.component.js +52 -2
- package/lib/__internal__/input-icon-toggle/index.d.ts +2 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +20 -0
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.js +16 -17
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +12 -0
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +7 -18
- package/lib/__internal__/label/label.component.js +1 -1
- package/lib/__spec_helper__/index.js +1 -1
- package/lib/components/accordion/accordion.style.d.ts +2 -2
- package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
- package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
- package/lib/components/action-popover/action-popover.style.d.ts +4 -4
- package/lib/components/badge/badge.style.d.ts +1 -2
- package/lib/components/button/button.component.d.ts +2 -1
- package/lib/components/button/button.component.js +3 -3
- package/lib/components/confirm/confirm.d.ts +1 -1
- package/lib/components/flat-table/flat-table.style.js +1 -1
- package/lib/components/help/help.d.ts +1 -1
- package/lib/components/icon/icon-config.d.ts +14 -11
- package/lib/components/icon/icon-config.js +1 -1
- package/lib/components/icon/icon-type.d.ts +1 -0
- package/lib/components/icon/icon-type.js +5 -0
- package/lib/components/icon/icon.component.d.ts +46 -0
- package/lib/components/icon/icon.component.js +215 -130
- package/lib/components/icon/icon.style.d.ts +37 -1
- package/lib/components/icon/icon.style.js +10 -36
- package/lib/components/icon/index.d.ts +3 -2
- package/lib/components/icon-button/icon-button.d.ts +1 -1
- package/lib/components/link/link.component.d.ts +2 -2
- package/lib/components/link/link.component.js +1 -1
- package/lib/components/menu/menu-item/menu-item.d.ts +1 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +50 -1
- package/lib/components/popover-container/index.d.ts +2 -1
- package/lib/components/popover-container/popover-container.component.d.ts +56 -0
- package/lib/components/popover-container/popover-container.component.js +234 -108
- package/lib/components/popover-container/popover-container.style.d.ts +18 -0
- package/lib/hooks/__internal__/useModalManager/useModalManager.js +14 -11
- package/lib/style/utils/filter-styled-system-padding-props.d.ts +1 -1
- package/lib/style/utils/filter-styled-system-padding-props.js +4 -2
- package/package.json +11 -10
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.d.ts +0 -24
- package/esm/components/icon/icon.d.ts +0 -252
- package/esm/components/popover-container/popover-container.d.ts +0 -35
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.d.ts +0 -24
- package/lib/components/icon/icon.d.ts +0 -252
- package/lib/components/popover-container/popover-container.d.ts +0 -35
|
@@ -636,7 +636,56 @@ MultiActionButton.propTypes = {
|
|
|
636
636
|
"radioGroup": PropTypes.string,
|
|
637
637
|
"resource": PropTypes.string,
|
|
638
638
|
"results": PropTypes.number,
|
|
639
|
-
"role": PropTypes.
|
|
639
|
+
"role": PropTypes.oneOfType([PropTypes.oneOf(["alert", "alertdialog", "application", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo", "definition", "dialog", "directory", "document", "feed", "figure", "form", "grid", "gridcell", "group", "heading", "img", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "navigation", "none", "note", "option", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem"]), PropTypes.shape({
|
|
640
|
+
"__@iterator": PropTypes.func.isRequired,
|
|
641
|
+
"anchor": PropTypes.func.isRequired,
|
|
642
|
+
"big": PropTypes.func.isRequired,
|
|
643
|
+
"blink": PropTypes.func.isRequired,
|
|
644
|
+
"bold": PropTypes.func.isRequired,
|
|
645
|
+
"charAt": PropTypes.func.isRequired,
|
|
646
|
+
"charCodeAt": PropTypes.func.isRequired,
|
|
647
|
+
"codePointAt": PropTypes.func.isRequired,
|
|
648
|
+
"concat": PropTypes.func.isRequired,
|
|
649
|
+
"endsWith": PropTypes.func.isRequired,
|
|
650
|
+
"fixed": PropTypes.func.isRequired,
|
|
651
|
+
"fontcolor": PropTypes.func.isRequired,
|
|
652
|
+
"fontsize": PropTypes.func.isRequired,
|
|
653
|
+
"includes": PropTypes.func.isRequired,
|
|
654
|
+
"indexOf": PropTypes.func.isRequired,
|
|
655
|
+
"italics": PropTypes.func.isRequired,
|
|
656
|
+
"lastIndexOf": PropTypes.func.isRequired,
|
|
657
|
+
"length": PropTypes.number.isRequired,
|
|
658
|
+
"link": PropTypes.func.isRequired,
|
|
659
|
+
"localeCompare": PropTypes.func.isRequired,
|
|
660
|
+
"match": PropTypes.func.isRequired,
|
|
661
|
+
"matchAll": PropTypes.func.isRequired,
|
|
662
|
+
"normalize": PropTypes.func.isRequired,
|
|
663
|
+
"padEnd": PropTypes.func.isRequired,
|
|
664
|
+
"padStart": PropTypes.func.isRequired,
|
|
665
|
+
"repeat": PropTypes.func.isRequired,
|
|
666
|
+
"replace": PropTypes.func.isRequired,
|
|
667
|
+
"search": PropTypes.func.isRequired,
|
|
668
|
+
"slice": PropTypes.func.isRequired,
|
|
669
|
+
"small": PropTypes.func.isRequired,
|
|
670
|
+
"split": PropTypes.func.isRequired,
|
|
671
|
+
"startsWith": PropTypes.func.isRequired,
|
|
672
|
+
"strike": PropTypes.func.isRequired,
|
|
673
|
+
"sub": PropTypes.func.isRequired,
|
|
674
|
+
"substr": PropTypes.func.isRequired,
|
|
675
|
+
"substring": PropTypes.func.isRequired,
|
|
676
|
+
"sup": PropTypes.func.isRequired,
|
|
677
|
+
"toLocaleLowerCase": PropTypes.func.isRequired,
|
|
678
|
+
"toLocaleUpperCase": PropTypes.func.isRequired,
|
|
679
|
+
"toLowerCase": PropTypes.func.isRequired,
|
|
680
|
+
"toString": PropTypes.func.isRequired,
|
|
681
|
+
"toUpperCase": PropTypes.func.isRequired,
|
|
682
|
+
"trim": PropTypes.func.isRequired,
|
|
683
|
+
"trimEnd": PropTypes.func.isRequired,
|
|
684
|
+
"trimLeft": PropTypes.func.isRequired,
|
|
685
|
+
"trimRight": PropTypes.func.isRequired,
|
|
686
|
+
"trimStart": PropTypes.func.isRequired,
|
|
687
|
+
"valueOf": PropTypes.func.isRequired
|
|
688
|
+
})]),
|
|
640
689
|
"security": PropTypes.string,
|
|
641
690
|
"size": PropTypes.oneOf(["large", "medium", "small"]),
|
|
642
691
|
"slot": PropTypes.string,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./popover-container";
|
|
1
|
+
export { default } from "./popover-container.component";
|
|
2
|
+
export type { PopoverContainerProps, RenderCloseProps, RenderOpenProps, } from "./popover-container.component";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PaddingProps } from "styled-system";
|
|
3
|
+
export interface RenderOpenProps {
|
|
4
|
+
tabIndex: number;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
"data-element": string;
|
|
7
|
+
onClick: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
ref: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RenderCloseProps {
|
|
13
|
+
"data-element": string;
|
|
14
|
+
tabIndex: number;
|
|
15
|
+
onClick: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
16
|
+
ref: React.RefObject<HTMLButtonElement>;
|
|
17
|
+
"aria-label": string;
|
|
18
|
+
}
|
|
19
|
+
export interface PopoverContainerProps extends PaddingProps {
|
|
20
|
+
/** A function that will render the open component
|
|
21
|
+
*
|
|
22
|
+
* `({tabIndex, isOpen, data-element, onClick, ref, aria-label}) => ()`
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
renderOpenComponent?: (args: RenderOpenProps) => JSX.Element;
|
|
26
|
+
/** A function that will render the close component
|
|
27
|
+
*
|
|
28
|
+
* `({data-element, tabIndex, onClick, ref, aria-label}) => ()`
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
renderCloseComponent?: (args: RenderCloseProps) => JSX.Element;
|
|
32
|
+
/** The content of the popover-container */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/** Sets rendering position of dialog */
|
|
35
|
+
position?: "left" | "right";
|
|
36
|
+
/** Sets the popover container dialog header name */
|
|
37
|
+
title?: string;
|
|
38
|
+
/** Callback fires when close icon clicked */
|
|
39
|
+
onClose?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
40
|
+
/** if `true` the popover-container is open */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** Callback fires when open component is clicked */
|
|
43
|
+
onOpen?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
44
|
+
/** if `true` the popover-container will cover open button */
|
|
45
|
+
shouldCoverButton?: boolean;
|
|
46
|
+
/** The id of the element that describe the dialog. */
|
|
47
|
+
ariaDescribedBy?: string;
|
|
48
|
+
/** Open button aria label */
|
|
49
|
+
openButtonAriaLabel?: string;
|
|
50
|
+
/** Close button aria label */
|
|
51
|
+
closeButtonAriaLabel?: string;
|
|
52
|
+
/** Container aria label */
|
|
53
|
+
containerAriaLabel?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const PopoverContainer: ({ children, title, position, open, onOpen, onClose, renderOpenComponent, renderCloseComponent, shouldCoverButton, ariaDescribedBy, openButtonAriaLabel, closeButtonAriaLabel, containerAriaLabel, ...rest }: PopoverContainerProps) => JSX.Element;
|
|
56
|
+
export default PopoverContainer;
|
|
@@ -2,25 +2,74 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import { Transition } from "react-transition-group";
|
|
7
6
|
import { PopoverContainerWrapperStyle, PopoverContainerHeaderStyle, PopoverContainerContentStyle, PopoverContainerCloseIcon, PopoverContainerTitleStyle, PopoverContainerOpenIcon } from "./popover-container.style";
|
|
8
7
|
import Icon from "../icon";
|
|
9
8
|
import createGuid from "../../__internal__/utils/helpers/guid";
|
|
10
9
|
import { filterStyledSystemPaddingProps } from "../../style/utils";
|
|
11
10
|
import ClickAwayWrapper from "../../__internal__/click-away-wrapper";
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
const renderOpen = ({
|
|
13
|
+
tabIndex,
|
|
14
|
+
onClick,
|
|
15
|
+
"data-element": dataElement,
|
|
16
|
+
ref,
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
id
|
|
19
|
+
}) => /*#__PURE__*/React.createElement(PopoverContainerOpenIcon, {
|
|
20
|
+
tabIndex: tabIndex,
|
|
21
|
+
onAction: onClick,
|
|
22
|
+
"data-element": dataElement,
|
|
23
|
+
ref: ref,
|
|
24
|
+
"aria-label": ariaLabel,
|
|
25
|
+
"aria-haspopup": true,
|
|
26
|
+
id: id
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
type: "settings"
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
renderOpen.propTypes = {
|
|
32
|
+
"aria-label": PropTypes.string,
|
|
33
|
+
"data-element": PropTypes.string.isRequired,
|
|
34
|
+
"id": PropTypes.string,
|
|
35
|
+
"isOpen": PropTypes.bool,
|
|
36
|
+
"onClick": PropTypes.func.isRequired,
|
|
37
|
+
"tabIndex": PropTypes.number.isRequired
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const renderClose = ({
|
|
41
|
+
"data-element": dataElement,
|
|
42
|
+
tabIndex,
|
|
43
|
+
onClick,
|
|
44
|
+
ref,
|
|
45
|
+
"aria-label": ariaLabel
|
|
46
|
+
}) => /*#__PURE__*/React.createElement(PopoverContainerCloseIcon, {
|
|
47
|
+
"data-element": dataElement,
|
|
48
|
+
tabIndex: tabIndex,
|
|
49
|
+
onAction: onClick,
|
|
50
|
+
ref: ref,
|
|
51
|
+
"aria-label": ariaLabel
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
type: "close"
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
renderClose.propTypes = {
|
|
57
|
+
"aria-label": PropTypes.string.isRequired,
|
|
58
|
+
"data-element": PropTypes.string.isRequired,
|
|
59
|
+
"onClick": PropTypes.func.isRequired,
|
|
60
|
+
"tabIndex": PropTypes.number.isRequired
|
|
61
|
+
};
|
|
13
62
|
|
|
14
63
|
const PopoverContainer = ({
|
|
15
64
|
children,
|
|
16
65
|
title,
|
|
17
|
-
position,
|
|
66
|
+
position = "right",
|
|
18
67
|
open,
|
|
19
68
|
onOpen,
|
|
20
69
|
onClose,
|
|
21
|
-
renderOpenComponent,
|
|
22
|
-
renderCloseComponent,
|
|
23
|
-
shouldCoverButton,
|
|
70
|
+
renderOpenComponent = renderOpen,
|
|
71
|
+
renderCloseComponent = renderClose,
|
|
72
|
+
shouldCoverButton = false,
|
|
24
73
|
ariaDescribedBy,
|
|
25
74
|
openButtonAriaLabel,
|
|
26
75
|
closeButtonAriaLabel = "close",
|
|
@@ -29,11 +78,11 @@ const PopoverContainer = ({
|
|
|
29
78
|
}) => {
|
|
30
79
|
const isControlled = open !== undefined;
|
|
31
80
|
const [isOpenInternal, setIsOpenInternal] = useState(false);
|
|
32
|
-
const ref = useRef();
|
|
33
|
-
const closeButtonRef = useRef();
|
|
34
|
-
const openButtonRef = useRef();
|
|
81
|
+
const ref = useRef(null);
|
|
82
|
+
const closeButtonRef = useRef(null);
|
|
83
|
+
const openButtonRef = useRef(null);
|
|
35
84
|
const guid = useRef(createGuid());
|
|
36
|
-
const popoverContentNodeRef = useRef();
|
|
85
|
+
const popoverContentNodeRef = useRef(null);
|
|
37
86
|
const popoverContainerId = title ? `PopoverContainer_${guid.current}` : undefined;
|
|
38
87
|
const isOpen = isControlled ? open : isOpenInternal;
|
|
39
88
|
useEffect(() => {
|
|
@@ -57,19 +106,20 @@ const PopoverContainer = ({
|
|
|
57
106
|
const renderOpenComponentProps = {
|
|
58
107
|
tabIndex: isOpen ? -1 : 0,
|
|
59
108
|
isOpen,
|
|
60
|
-
|
|
109
|
+
"data-element": "popover-container-open-component",
|
|
61
110
|
onClick: handleOpenButtonClick,
|
|
62
111
|
ref: openButtonRef,
|
|
63
|
-
|
|
112
|
+
"aria-label": openButtonAriaLabel || title,
|
|
64
113
|
id: isOpen ? undefined : popoverContainerId
|
|
65
114
|
};
|
|
66
115
|
const renderCloseComponentProps = {
|
|
67
|
-
|
|
116
|
+
"data-element": "popover-container-close-component",
|
|
68
117
|
tabIndex: 0,
|
|
69
118
|
onClick: handleCloseButtonClick,
|
|
70
119
|
ref: closeButtonRef,
|
|
71
|
-
|
|
72
|
-
};
|
|
120
|
+
"aria-label": closeButtonAriaLabel
|
|
121
|
+
}; // TODO: Assign proper type after ClickAwayWrapper has been refactored
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
123
|
|
|
74
124
|
const handleClickAway = e => {
|
|
75
125
|
if (!isControlled) setIsOpenInternal(false);
|
|
@@ -111,96 +161,174 @@ const PopoverContainer = ({
|
|
|
111
161
|
}, title), renderCloseComponent(renderCloseComponentProps)), children))));
|
|
112
162
|
};
|
|
113
163
|
|
|
114
|
-
PopoverContainer.propTypes = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
164
|
+
PopoverContainer.propTypes = {
|
|
165
|
+
"ariaDescribedBy": PropTypes.string,
|
|
166
|
+
"children": PropTypes.node,
|
|
167
|
+
"closeButtonAriaLabel": PropTypes.string,
|
|
168
|
+
"containerAriaLabel": PropTypes.string,
|
|
169
|
+
"onClose": PropTypes.func,
|
|
170
|
+
"onOpen": PropTypes.func,
|
|
171
|
+
"open": PropTypes.bool,
|
|
172
|
+
"openButtonAriaLabel": PropTypes.string,
|
|
173
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
174
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
175
|
+
"description": PropTypes.string,
|
|
176
|
+
"toString": PropTypes.func.isRequired,
|
|
177
|
+
"valueOf": PropTypes.func.isRequired
|
|
178
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
179
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
180
|
+
"description": PropTypes.string,
|
|
181
|
+
"toString": PropTypes.func.isRequired,
|
|
182
|
+
"valueOf": PropTypes.func.isRequired
|
|
183
|
+
}), PropTypes.string]),
|
|
184
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
185
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
186
|
+
"description": PropTypes.string,
|
|
187
|
+
"toString": PropTypes.func.isRequired,
|
|
188
|
+
"valueOf": PropTypes.func.isRequired
|
|
189
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
190
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
191
|
+
"description": PropTypes.string,
|
|
192
|
+
"toString": PropTypes.func.isRequired,
|
|
193
|
+
"valueOf": PropTypes.func.isRequired
|
|
194
|
+
}), PropTypes.string]),
|
|
195
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
196
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
197
|
+
"description": PropTypes.string,
|
|
198
|
+
"toString": PropTypes.func.isRequired,
|
|
199
|
+
"valueOf": PropTypes.func.isRequired
|
|
200
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
201
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
202
|
+
"description": PropTypes.string,
|
|
203
|
+
"toString": PropTypes.func.isRequired,
|
|
204
|
+
"valueOf": PropTypes.func.isRequired
|
|
205
|
+
}), PropTypes.string]),
|
|
206
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
207
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
208
|
+
"description": PropTypes.string,
|
|
209
|
+
"toString": PropTypes.func.isRequired,
|
|
210
|
+
"valueOf": PropTypes.func.isRequired
|
|
211
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
212
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
213
|
+
"description": PropTypes.string,
|
|
214
|
+
"toString": PropTypes.func.isRequired,
|
|
215
|
+
"valueOf": PropTypes.func.isRequired
|
|
216
|
+
}), PropTypes.string]),
|
|
217
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
218
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
219
|
+
"description": PropTypes.string,
|
|
220
|
+
"toString": PropTypes.func.isRequired,
|
|
221
|
+
"valueOf": PropTypes.func.isRequired
|
|
222
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
223
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
224
|
+
"description": PropTypes.string,
|
|
225
|
+
"toString": PropTypes.func.isRequired,
|
|
226
|
+
"valueOf": PropTypes.func.isRequired
|
|
227
|
+
}), PropTypes.string]),
|
|
228
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
229
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
230
|
+
"description": PropTypes.string,
|
|
231
|
+
"toString": PropTypes.func.isRequired,
|
|
232
|
+
"valueOf": PropTypes.func.isRequired
|
|
233
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
234
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
235
|
+
"description": PropTypes.string,
|
|
236
|
+
"toString": PropTypes.func.isRequired,
|
|
237
|
+
"valueOf": PropTypes.func.isRequired
|
|
238
|
+
}), PropTypes.string]),
|
|
239
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
240
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
241
|
+
"description": PropTypes.string,
|
|
242
|
+
"toString": PropTypes.func.isRequired,
|
|
243
|
+
"valueOf": PropTypes.func.isRequired
|
|
244
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
245
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
246
|
+
"description": PropTypes.string,
|
|
247
|
+
"toString": PropTypes.func.isRequired,
|
|
248
|
+
"valueOf": PropTypes.func.isRequired
|
|
249
|
+
}), PropTypes.string]),
|
|
250
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
251
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
252
|
+
"description": PropTypes.string,
|
|
253
|
+
"toString": PropTypes.func.isRequired,
|
|
254
|
+
"valueOf": PropTypes.func.isRequired
|
|
255
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
256
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
257
|
+
"description": PropTypes.string,
|
|
258
|
+
"toString": PropTypes.func.isRequired,
|
|
259
|
+
"valueOf": PropTypes.func.isRequired
|
|
260
|
+
}), PropTypes.string]),
|
|
261
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
262
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
263
|
+
"description": PropTypes.string,
|
|
264
|
+
"toString": PropTypes.func.isRequired,
|
|
265
|
+
"valueOf": PropTypes.func.isRequired
|
|
266
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
267
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
268
|
+
"description": PropTypes.string,
|
|
269
|
+
"toString": PropTypes.func.isRequired,
|
|
270
|
+
"valueOf": PropTypes.func.isRequired
|
|
271
|
+
}), PropTypes.string]),
|
|
272
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
273
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
274
|
+
"description": PropTypes.string,
|
|
275
|
+
"toString": PropTypes.func.isRequired,
|
|
276
|
+
"valueOf": PropTypes.func.isRequired
|
|
277
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
278
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
279
|
+
"description": PropTypes.string,
|
|
280
|
+
"toString": PropTypes.func.isRequired,
|
|
281
|
+
"valueOf": PropTypes.func.isRequired
|
|
282
|
+
}), PropTypes.string]),
|
|
283
|
+
"position": PropTypes.oneOf(["left", "right"]),
|
|
284
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
285
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
286
|
+
"description": PropTypes.string,
|
|
287
|
+
"toString": PropTypes.func.isRequired,
|
|
288
|
+
"valueOf": PropTypes.func.isRequired
|
|
289
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
290
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
291
|
+
"description": PropTypes.string,
|
|
292
|
+
"toString": PropTypes.func.isRequired,
|
|
293
|
+
"valueOf": PropTypes.func.isRequired
|
|
294
|
+
}), PropTypes.string]),
|
|
295
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
296
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
297
|
+
"description": PropTypes.string,
|
|
298
|
+
"toString": PropTypes.func.isRequired,
|
|
299
|
+
"valueOf": PropTypes.func.isRequired
|
|
300
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
301
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
302
|
+
"description": PropTypes.string,
|
|
303
|
+
"toString": PropTypes.func.isRequired,
|
|
304
|
+
"valueOf": PropTypes.func.isRequired
|
|
305
|
+
}), PropTypes.string]),
|
|
306
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
307
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
308
|
+
"description": PropTypes.string,
|
|
309
|
+
"toString": PropTypes.func.isRequired,
|
|
310
|
+
"valueOf": PropTypes.func.isRequired
|
|
311
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
312
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
313
|
+
"description": PropTypes.string,
|
|
314
|
+
"toString": PropTypes.func.isRequired,
|
|
315
|
+
"valueOf": PropTypes.func.isRequired
|
|
316
|
+
}), PropTypes.string]),
|
|
317
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
318
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
319
|
+
"description": PropTypes.string,
|
|
320
|
+
"toString": PropTypes.func.isRequired,
|
|
321
|
+
"valueOf": PropTypes.func.isRequired
|
|
322
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
323
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
324
|
+
"description": PropTypes.string,
|
|
325
|
+
"toString": PropTypes.func.isRequired,
|
|
326
|
+
"valueOf": PropTypes.func.isRequired
|
|
327
|
+
}), PropTypes.string]),
|
|
328
|
+
"renderCloseComponent": PropTypes.func,
|
|
329
|
+
"renderOpenComponent": PropTypes.func,
|
|
330
|
+
"shouldCoverButton": PropTypes.bool,
|
|
331
|
+
"title": PropTypes.string
|
|
205
332
|
};
|
|
333
|
+
export { PopoverContainer };
|
|
206
334
|
export default PopoverContainer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransitionStatus } from "react-transition-group";
|
|
2
|
+
import IconButton from "../icon-button";
|
|
3
|
+
declare const PopoverContainerWrapperStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
declare const PopoverContainerHeaderStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
declare type PopoverContainerContentStyleProps = {
|
|
6
|
+
shouldCoverButton?: boolean;
|
|
7
|
+
position?: "left" | "right";
|
|
8
|
+
animationState?: TransitionStatus;
|
|
9
|
+
};
|
|
10
|
+
declare const PopoverContainerContentStyle: import("styled-components").StyledComponent<"div", any, PopoverContainerContentStyleProps, never>;
|
|
11
|
+
declare type AdditionalIconButtonProps = {
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const PopoverContainerOpenIcon: import("styled-components").StyledComponent<typeof IconButton, any, AdditionalIconButtonProps, never>;
|
|
16
|
+
declare const PopoverContainerCloseIcon: import("styled-components").StyledComponent<typeof IconButton, any, AdditionalIconButtonProps, never>;
|
|
17
|
+
declare const PopoverContainerTitleStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export { PopoverContainerWrapperStyle, PopoverContainerHeaderStyle, PopoverContainerContentStyle, PopoverContainerCloseIcon, PopoverContainerTitleStyle, PopoverContainerOpenIcon, };
|
|
@@ -36,31 +36,34 @@ const useModalManager = (open, closeModal, modalRef, setTriggerRefocusFlag) => {
|
|
|
36
36
|
removeListener();
|
|
37
37
|
};
|
|
38
38
|
}, [removeListener]);
|
|
39
|
-
const registerModal = useCallback(
|
|
39
|
+
const registerModal = useCallback(ref => {
|
|
40
40
|
/* istanbul ignore else */
|
|
41
41
|
if (!modalRegistered.current) {
|
|
42
|
-
ModalManager.addModal(
|
|
42
|
+
ModalManager.addModal(ref, setTriggerRefocusFlag);
|
|
43
43
|
modalRegistered.current = true;
|
|
44
44
|
}
|
|
45
|
-
}, [
|
|
46
|
-
const unregisterModal = useCallback(
|
|
45
|
+
}, [setTriggerRefocusFlag]);
|
|
46
|
+
const unregisterModal = useCallback(ref => {
|
|
47
47
|
if (modalRegistered.current) {
|
|
48
|
-
ModalManager.removeModal(
|
|
48
|
+
ModalManager.removeModal(ref);
|
|
49
49
|
modalRegistered.current = false;
|
|
50
50
|
}
|
|
51
|
-
}, [
|
|
51
|
+
}, []);
|
|
52
52
|
useEffect(() => {
|
|
53
|
+
const ref = modalRef.current;
|
|
54
|
+
|
|
53
55
|
if (open) {
|
|
54
|
-
registerModal();
|
|
56
|
+
registerModal(ref);
|
|
55
57
|
} else {
|
|
56
|
-
unregisterModal();
|
|
58
|
+
unregisterModal(ref);
|
|
57
59
|
}
|
|
58
|
-
}, [open, registerModal, unregisterModal]);
|
|
60
|
+
}, [modalRef, open, registerModal, unregisterModal]);
|
|
59
61
|
useEffect(() => {
|
|
62
|
+
const ref = modalRef.current;
|
|
60
63
|
return () => {
|
|
61
|
-
unregisterModal();
|
|
64
|
+
unregisterModal(ref);
|
|
62
65
|
};
|
|
63
|
-
}, [unregisterModal]);
|
|
66
|
+
}, [modalRef, unregisterModal]);
|
|
64
67
|
};
|
|
65
68
|
|
|
66
69
|
export default useModalManager;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaddingProps } from "styled-system";
|
|
2
2
|
export declare const paddingPropertyNames: string[];
|
|
3
|
-
export default function filterStyledSystemPaddingProps(
|
|
3
|
+
export default function filterStyledSystemPaddingProps(props: Record<string, any>): PaddingProps;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import filterObjectProperties from "../../__internal__/filter-object-properties";
|
|
2
2
|
export const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
|
|
3
|
-
export default function filterStyledSystemPaddingProps(
|
|
4
|
-
|
|
3
|
+
export default function filterStyledSystemPaddingProps( // method should accept any react prop
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
props) {
|
|
6
|
+
return filterObjectProperties(props, paddingPropertyNames);
|
|
5
7
|
}
|
|
@@ -2,5 +2,5 @@ import { CommonInputPresentationProps } from "./input-presentation.component";
|
|
|
2
2
|
import { InputContextProps } from "../input-behaviour";
|
|
3
3
|
import { CarbonProviderProps } from "../../components/carbon-provider";
|
|
4
4
|
export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "inputWidth">, never>;
|
|
5
|
-
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "
|
|
5
|
+
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "size" | "readOnly" | "align"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
|
|
6
6
|
export default InputPresentationStyle;
|