carbon-react 107.1.8 → 108.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/form/form.component.js +7 -2
- package/esm/components/form/form.style.js +3 -2
- package/esm/components/heading/heading.component.js +6 -2
- package/esm/components/help/help.component.js +2 -2
- package/esm/components/modal/index.d.ts +1 -1
- package/esm/components/modal/index.js +1 -1
- package/esm/components/modal/modal.component.d.ts +35 -0
- package/esm/components/modal/modal.d.ts +11 -0
- package/esm/components/modal/modal.style.d.ts +2 -0
- 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/locales/en-gb.js +3 -0
- package/esm/locales/locale.d.ts +3 -0
- package/esm/locales/pl-pl.js +3 -0
- 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/components/form/form.component.js +9 -3
- package/lib/components/form/form.style.js +3 -2
- package/lib/components/heading/heading.component.js +7 -2
- package/lib/components/help/help.component.js +2 -2
- package/lib/components/modal/index.d.ts +1 -1
- package/lib/components/modal/index.js +10 -2
- package/lib/components/modal/modal.component.d.ts +35 -0
- package/lib/components/modal/modal.d.ts +11 -0
- package/lib/components/modal/modal.style.d.ts +2 -0
- 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/locales/en-gb.js +3 -0
- package/lib/locales/locale.d.ts +3 -0
- package/lib/locales/pl-pl.js +3 -0
- 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 +2 -1
- package/esm/components/popover-container/popover-container.d.ts +0 -35
- package/lib/components/popover-container/popover-container.d.ts +0 -35
|
@@ -3,9 +3,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React, { useRef, useContext } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
|
+
import { ModalContext } from "../modal/modal.component";
|
|
7
|
+
import { SidebarContext } from "../sidebar/sidebar.component";
|
|
6
8
|
import FormSummary from "./__internal__/form-summary.component";
|
|
7
9
|
import { StyledForm, StyledFormContent, StyledFormFooter, StyledLeftButtons, StyledRightButtons } from "./form.style";
|
|
8
|
-
import { SidebarContext } from "../sidebar/sidebar.component";
|
|
9
10
|
|
|
10
11
|
const Form = ({
|
|
11
12
|
children,
|
|
@@ -25,6 +26,9 @@ const Form = ({
|
|
|
25
26
|
const {
|
|
26
27
|
isInSidebar
|
|
27
28
|
} = useContext(SidebarContext);
|
|
29
|
+
const {
|
|
30
|
+
isInModal
|
|
31
|
+
} = useContext(ModalContext);
|
|
28
32
|
const formRef = useRef();
|
|
29
33
|
const formFooterRef = useRef();
|
|
30
34
|
const renderFooter = !!(saveButton || leftSideButtons || rightSideButtons || errorCount || warningCount);
|
|
@@ -39,8 +43,9 @@ const Form = ({
|
|
|
39
43
|
height: height
|
|
40
44
|
}, rest), /*#__PURE__*/React.createElement(StyledFormContent, {
|
|
41
45
|
"data-element": "form-content",
|
|
46
|
+
className: stickyFooter ? "sticky" : "",
|
|
42
47
|
stickyFooter: stickyFooter,
|
|
43
|
-
|
|
48
|
+
isInModal: isInModal
|
|
44
49
|
}, children), renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, {
|
|
45
50
|
"data-element": "form-footer",
|
|
46
51
|
className: stickyFooter ? "sticky" : "",
|
|
@@ -12,10 +12,11 @@ import StyledSearch from "../search/search.style";
|
|
|
12
12
|
import StyledTextarea from "../textarea/textarea.style";
|
|
13
13
|
export const StyledFormContent = styled.div`
|
|
14
14
|
${({
|
|
15
|
-
stickyFooter
|
|
15
|
+
stickyFooter,
|
|
16
|
+
isInModal
|
|
16
17
|
}) => css`
|
|
17
18
|
${stickyFooter && css`
|
|
18
|
-
overflow-y: auto;
|
|
19
|
+
overflow-y: ${isInModal ? "visible" : "auto"};
|
|
19
20
|
flex: 1;
|
|
20
21
|
`}
|
|
21
22
|
`}
|
|
@@ -6,6 +6,7 @@ import styledSystemPropTypes from "@styled-system/prop-types";
|
|
|
6
6
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
7
7
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
8
8
|
import { StyledHeading, StyledHeadingIcon, StyledSubHeader, StyledHeader, StyledSeparator, StyledHeaderHelp, StyledHeadingTitle, StyledDivider, StyledHeaderContent, StyledHeadingBackButton, StyledHeadingPills } from "./heading.style";
|
|
9
|
+
import useLocale from "../../hooks/__internal__/useLocale";
|
|
9
10
|
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
10
11
|
|
|
11
12
|
const Heading = ({
|
|
@@ -32,6 +33,8 @@ const Heading = ({
|
|
|
32
33
|
}, help);
|
|
33
34
|
};
|
|
34
35
|
|
|
36
|
+
const l = useLocale();
|
|
37
|
+
|
|
35
38
|
const getBackButton = () => {
|
|
36
39
|
const backButtonProps = typeof backLink === "string" ? {
|
|
37
40
|
href: backLink
|
|
@@ -40,8 +43,9 @@ const Heading = ({
|
|
|
40
43
|
};
|
|
41
44
|
return /*#__PURE__*/React.createElement(StyledHeadingBackButton // this event allows an element to be focusable on click event on IE
|
|
42
45
|
, _extends({
|
|
43
|
-
|
|
44
|
-
"data-element": "back"
|
|
46
|
+
"aria-label": l.heading.backLinkAriaLabel(),
|
|
47
|
+
"data-element": "back",
|
|
48
|
+
onMouseDown: e => e.currentTarget.focus()
|
|
45
49
|
}, backButtonProps), /*#__PURE__*/React.createElement(StyledHeadingIcon, {
|
|
46
50
|
type: "chevron_left",
|
|
47
51
|
divider: divider
|
|
@@ -59,6 +59,7 @@ const Help = ({
|
|
|
59
59
|
|
|
60
60
|
return /*#__PURE__*/React.createElement(StyledHelp, _extends({
|
|
61
61
|
"aria-describedby": isFocused || isTooltipVisible ? tooltipId || defaultTooltipId.current : undefined,
|
|
62
|
+
"aria-label": helpAriaLabel || ariaLabel,
|
|
62
63
|
className: className,
|
|
63
64
|
as: tagType,
|
|
64
65
|
href: href,
|
|
@@ -77,8 +78,7 @@ const Help = ({
|
|
|
77
78
|
target: "_blank",
|
|
78
79
|
rel: "noopener noreferrer"
|
|
79
80
|
} : {
|
|
80
|
-
role: "button"
|
|
81
|
-
"aria-label": helpAriaLabel || ariaLabel
|
|
81
|
+
role: "button"
|
|
82
82
|
}, filterStyledSystemMarginProps(rest), rest), /*#__PURE__*/React.createElement(Icon, {
|
|
83
83
|
"aria-hidden": true,
|
|
84
84
|
type: type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./modal";
|
|
1
|
+
export { default, ModalContext } from "./modal.component";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./modal.component";
|
|
1
|
+
export { default, ModalContext } from "./modal.component";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const ModalContext: React.Context<{}>;
|
|
2
|
+
export default Modal;
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare function Modal({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
children: any;
|
|
7
|
+
open: any;
|
|
8
|
+
onCancel: any;
|
|
9
|
+
disableEscKey: any;
|
|
10
|
+
disableClose: any;
|
|
11
|
+
enableBackgroundUI: any;
|
|
12
|
+
timeout: any;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
declare namespace Modal {
|
|
15
|
+
namespace propTypes {
|
|
16
|
+
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
+
const onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
const open: PropTypes.Validator<boolean>;
|
|
19
|
+
const enableBackgroundUI: PropTypes.Requireable<boolean>;
|
|
20
|
+
const disableEscKey: PropTypes.Requireable<boolean>;
|
|
21
|
+
const disableClose: PropTypes.Requireable<boolean>;
|
|
22
|
+
const timeout: PropTypes.Requireable<number>;
|
|
23
|
+
}
|
|
24
|
+
namespace defaultProps {
|
|
25
|
+
const onCancel_1: null;
|
|
26
|
+
export { onCancel_1 as onCancel };
|
|
27
|
+
const enableBackgroundUI_1: boolean;
|
|
28
|
+
export { enableBackgroundUI_1 as enableBackgroundUI };
|
|
29
|
+
const disableEscKey_1: boolean;
|
|
30
|
+
export { disableEscKey_1 as disableEscKey };
|
|
31
|
+
const timeout_1: number;
|
|
32
|
+
export { timeout_1 as timeout };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
import PropTypes from "prop-types";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
+
export interface ModalContextProps {
|
|
4
|
+
value?: {
|
|
5
|
+
isInModal?: boolean;
|
|
6
|
+
isAnimationComplete?: boolean;
|
|
7
|
+
triggerRefocusFlag?: boolean;
|
|
8
|
+
};
|
|
9
|
+
ref?: React.MutableRefObject<React.ReactNode>;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
export interface ModalProps {
|
|
4
13
|
/** Modal content */
|
|
5
14
|
children?: React.ReactNode;
|
|
@@ -19,6 +28,8 @@ export interface ModalProps {
|
|
|
19
28
|
timeout?: number;
|
|
20
29
|
}
|
|
21
30
|
|
|
31
|
+
declare const ModelContext: React.Context<ModalContextProps>;
|
|
22
32
|
declare function Modal(props: ModalProps): JSX.Element;
|
|
23
33
|
|
|
34
|
+
export { ModalContext };
|
|
24
35
|
export default Modal;
|
|
@@ -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, };
|