@zendeskgarden/react-modals 8.69.2 → 8.69.4
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/dist/index.cjs.js +54 -123
- package/dist/index.esm.js +44 -119
- package/dist/typings/elements/Body.d.ts +11 -11
- package/dist/typings/elements/Close.d.ts +11 -11
- package/dist/typings/elements/DrawerModal/Body.d.ts +11 -11
- package/dist/typings/elements/DrawerModal/Close.d.ts +11 -11
- package/dist/typings/elements/DrawerModal/DrawerModal.d.ts +23 -23
- package/dist/typings/elements/DrawerModal/Footer.d.ts +11 -11
- package/dist/typings/elements/DrawerModal/FooterItem.d.ts +11 -11
- package/dist/typings/elements/DrawerModal/Header.d.ts +12 -12
- package/dist/typings/elements/Footer.d.ts +11 -11
- package/dist/typings/elements/FooterItem.d.ts +11 -11
- package/dist/typings/elements/Header.d.ts +12 -12
- package/dist/typings/elements/Modal.d.ts +12 -12
- package/dist/typings/elements/TooltipModal/Body.d.ts +11 -11
- package/dist/typings/elements/TooltipModal/Close.d.ts +11 -11
- package/dist/typings/elements/TooltipModal/Footer.d.ts +11 -11
- package/dist/typings/elements/TooltipModal/FooterItem.d.ts +11 -11
- package/dist/typings/elements/TooltipModal/Title.d.ts +12 -12
- package/dist/typings/elements/TooltipModal/TooltipModal.d.ts +23 -23
- package/dist/typings/index.d.ts +15 -16
- package/dist/typings/styled/StyledBackdrop.d.ts +14 -14
- package/dist/typings/styled/StyledBody.d.ts +10 -10
- package/dist/typings/styled/StyledClose.d.ts +19 -19
- package/dist/typings/styled/StyledDangerIcon.d.ts +7 -7
- package/dist/typings/styled/StyledDrawerModal.d.ts +14 -14
- package/dist/typings/styled/StyledDrawerModalBody.d.ts +13 -13
- package/dist/typings/styled/StyledDrawerModalClose.d.ts +18 -18
- package/dist/typings/styled/StyledDrawerModalFooter.d.ts +10 -10
- package/dist/typings/styled/StyledDrawerModalFooterItem.d.ts +10 -10
- package/dist/typings/styled/StyledDrawerModalHeader.d.ts +14 -14
- package/dist/typings/styled/StyledFooter.d.ts +11 -11
- package/dist/typings/styled/StyledFooterItem.d.ts +10 -10
- package/dist/typings/styled/StyledHeader.d.ts +15 -15
- package/dist/typings/styled/StyledModal.d.ts +16 -16
- package/dist/typings/styled/StyledTooltipModal.d.ts +14 -14
- package/dist/typings/styled/StyledTooltipModalBackdrop.d.ts +13 -13
- package/dist/typings/styled/StyledTooltipModalBody.d.ts +10 -10
- package/dist/typings/styled/StyledTooltipModalClose.d.ts +13 -13
- package/dist/typings/styled/StyledTooltipModalFooter.d.ts +10 -10
- package/dist/typings/styled/StyledTooltipModalFooterItem.d.ts +13 -13
- package/dist/typings/styled/StyledTooltipModalTitle.d.ts +11 -11
- package/dist/typings/styled/StyledTooltipWrapper.d.ts +13 -13
- package/dist/typings/styled/index.d.ts +28 -28
- package/dist/typings/types/index.d.ts +96 -96
- package/dist/typings/utils/gardenPlacements.d.ts +28 -28
- package/dist/typings/utils/useModalContext.d.ts +20 -20
- package/dist/typings/utils/useTooltipModalContext.d.ts +17 -17
- package/package.json +4 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* 1. Smooth iOS scrolling.
|
|
9
|
-
*/
|
|
10
|
-
export declare const StyledTooltipModalBackdrop: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
11
|
-
'data-garden-id': string;
|
|
12
|
-
'data-garden-version': string;
|
|
13
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 1. Smooth iOS scrolling.
|
|
9
|
+
*/
|
|
10
|
+
export declare const StyledTooltipModalBackdrop: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
11
|
+
'data-garden-id': string;
|
|
12
|
+
'data-garden-version': string;
|
|
13
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export declare const StyledTooltipModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
|
-
'data-garden-id': string;
|
|
9
|
-
'data-garden-version': string;
|
|
10
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export declare const StyledTooltipModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
|
+
'data-garden-id': string;
|
|
9
|
+
'data-garden-version': string;
|
|
10
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export declare const StyledTooltipModalClose: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
8
|
-
'data-garden-id': string;
|
|
9
|
-
'data-garden-version': string;
|
|
10
|
-
} & {
|
|
11
|
-
'data-garden-id': string;
|
|
12
|
-
'data-garden-version': string;
|
|
13
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export declare const StyledTooltipModalClose: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
8
|
+
'data-garden-id': string;
|
|
9
|
+
'data-garden-version': string;
|
|
10
|
+
} & {
|
|
11
|
+
'data-garden-id': string;
|
|
12
|
+
'data-garden-version': string;
|
|
13
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export declare const StyledTooltipModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
|
-
'data-garden-id': string;
|
|
9
|
-
'data-garden-version': string;
|
|
10
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export declare const StyledTooltipModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
|
+
'data-garden-id': string;
|
|
9
|
+
'data-garden-version': string;
|
|
10
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export declare const StyledTooltipModalFooterItem: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
8
|
-
'data-garden-id': string;
|
|
9
|
-
'data-garden-version': string;
|
|
10
|
-
} & {
|
|
11
|
-
'data-garden-id': string;
|
|
12
|
-
'data-garden-version': string;
|
|
13
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export declare const StyledTooltipModalFooterItem: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
8
|
+
'data-garden-id': string;
|
|
9
|
+
'data-garden-version': string;
|
|
10
|
+
} & {
|
|
11
|
+
'data-garden-id': string;
|
|
12
|
+
'data-garden-version': string;
|
|
13
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
export declare const StyledTooltipModalTitle: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
9
|
-
'data-garden-id': string;
|
|
10
|
-
'data-garden-version': string;
|
|
11
|
-
}, "data-garden-id" | "data-garden-version">;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { DefaultTheme } from 'styled-components';
|
|
8
|
+
export declare const StyledTooltipModalTitle: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
9
|
+
'data-garden-id': string;
|
|
10
|
+
'data-garden-version': string;
|
|
11
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
import { Placement } from '@popperjs/core';
|
|
8
|
-
import { ITooltipModalProps } from '../types';
|
|
9
|
-
interface IStyledTooltipWrapperProps extends Pick<ITooltipModalProps, 'isAnimated' | 'zIndex'> {
|
|
10
|
-
placement?: Placement;
|
|
11
|
-
}
|
|
12
|
-
export declare const StyledTooltipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, IStyledTooltipWrapperProps, never>;
|
|
13
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { Placement } from '@popperjs/core';
|
|
8
|
+
import { ITooltipModalProps } from '../types';
|
|
9
|
+
interface IStyledTooltipWrapperProps extends Pick<ITooltipModalProps, 'isAnimated' | 'zIndex'> {
|
|
10
|
+
placement?: Placement;
|
|
11
|
+
}
|
|
12
|
+
export declare const StyledTooltipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, IStyledTooltipWrapperProps, never>;
|
|
13
|
+
export {};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export { StyledBackdrop } from './StyledBackdrop';
|
|
8
|
-
export { StyledBody } from './StyledBody';
|
|
9
|
-
export { StyledClose } from './StyledClose';
|
|
10
|
-
export { StyledFooter } from './StyledFooter';
|
|
11
|
-
export { StyledFooterItem } from './StyledFooterItem';
|
|
12
|
-
export { StyledHeader } from './StyledHeader';
|
|
13
|
-
export { StyledDangerIcon } from './StyledDangerIcon';
|
|
14
|
-
export { StyledModal } from './StyledModal';
|
|
15
|
-
export { StyledTooltipModalBackdrop } from './StyledTooltipModalBackdrop';
|
|
16
|
-
export { StyledTooltipWrapper } from './StyledTooltipWrapper';
|
|
17
|
-
export { StyledTooltipModal } from './StyledTooltipModal';
|
|
18
|
-
export { StyledTooltipModalTitle } from './StyledTooltipModalTitle';
|
|
19
|
-
export { StyledTooltipModalBody } from './StyledTooltipModalBody';
|
|
20
|
-
export { StyledTooltipModalFooter } from './StyledTooltipModalFooter';
|
|
21
|
-
export { StyledTooltipModalFooterItem } from './StyledTooltipModalFooterItem';
|
|
22
|
-
export { StyledTooltipModalClose } from './StyledTooltipModalClose';
|
|
23
|
-
export { StyledDrawerModal } from './StyledDrawerModal';
|
|
24
|
-
export { StyledDrawerModalHeader } from './StyledDrawerModalHeader';
|
|
25
|
-
export { StyledDrawerModalClose } from './StyledDrawerModalClose';
|
|
26
|
-
export { StyledDrawerModalBody } from './StyledDrawerModalBody';
|
|
27
|
-
export { StyledDrawerModalFooter } from './StyledDrawerModalFooter';
|
|
28
|
-
export { StyledDrawerModalFooterItem } from './StyledDrawerModalFooterItem';
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
export { StyledBackdrop } from './StyledBackdrop';
|
|
8
|
+
export { StyledBody } from './StyledBody';
|
|
9
|
+
export { StyledClose } from './StyledClose';
|
|
10
|
+
export { StyledFooter } from './StyledFooter';
|
|
11
|
+
export { StyledFooterItem } from './StyledFooterItem';
|
|
12
|
+
export { StyledHeader } from './StyledHeader';
|
|
13
|
+
export { StyledDangerIcon } from './StyledDangerIcon';
|
|
14
|
+
export { StyledModal } from './StyledModal';
|
|
15
|
+
export { StyledTooltipModalBackdrop } from './StyledTooltipModalBackdrop';
|
|
16
|
+
export { StyledTooltipWrapper } from './StyledTooltipWrapper';
|
|
17
|
+
export { StyledTooltipModal } from './StyledTooltipModal';
|
|
18
|
+
export { StyledTooltipModalTitle } from './StyledTooltipModalTitle';
|
|
19
|
+
export { StyledTooltipModalBody } from './StyledTooltipModalBody';
|
|
20
|
+
export { StyledTooltipModalFooter } from './StyledTooltipModalFooter';
|
|
21
|
+
export { StyledTooltipModalFooterItem } from './StyledTooltipModalFooterItem';
|
|
22
|
+
export { StyledTooltipModalClose } from './StyledTooltipModalClose';
|
|
23
|
+
export { StyledDrawerModal } from './StyledDrawerModal';
|
|
24
|
+
export { StyledDrawerModalHeader } from './StyledDrawerModalHeader';
|
|
25
|
+
export { StyledDrawerModalClose } from './StyledDrawerModalClose';
|
|
26
|
+
export { StyledDrawerModalBody } from './StyledDrawerModalBody';
|
|
27
|
+
export { StyledDrawerModalFooter } from './StyledDrawerModalFooter';
|
|
28
|
+
export { StyledDrawerModalFooterItem } from './StyledDrawerModalFooterItem';
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
import { HTMLAttributes, KeyboardEvent, MouseEvent } from 'react';
|
|
8
|
-
import { Modifier } from 'react-popper';
|
|
9
|
-
export declare const PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
|
|
10
|
-
export type Placement = (typeof PLACEMENT)[number];
|
|
11
|
-
export interface IModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/**
|
|
13
|
-
* Passes HTML attributes to the backdrop element
|
|
14
|
-
*/
|
|
15
|
-
backdropProps?: HTMLAttributes<HTMLDivElement>;
|
|
16
|
-
/**
|
|
17
|
-
* Handles close actions. Can be triggered from the backdrop and from the close icon.
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} event The DOM event that triggered the close action
|
|
20
|
-
*/
|
|
21
|
-
onClose?: (event: KeyboardEvent | MouseEvent) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Centers the modal on the backdrop
|
|
24
|
-
*/
|
|
25
|
-
isCentered?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Animates the modal
|
|
28
|
-
*/
|
|
29
|
-
isAnimated?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Defines the DOM element that the modal will attatch to
|
|
32
|
-
*/
|
|
33
|
-
appendToNode?: Element;
|
|
34
|
-
/**
|
|
35
|
-
* Applies large styling
|
|
36
|
-
*/
|
|
37
|
-
isLarge?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Directs keyboard focus to the modal on mount
|
|
40
|
-
*/
|
|
41
|
-
focusOnMount?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Returns keyboard focus to the element that triggered the modal
|
|
44
|
-
*/
|
|
45
|
-
restoreFocus?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface IHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
-
/**
|
|
49
|
-
* Applies danger styling
|
|
50
|
-
*/
|
|
51
|
-
isDanger?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Updates the element's HTML tag
|
|
54
|
-
*/
|
|
55
|
-
tag?: any;
|
|
56
|
-
}
|
|
57
|
-
export interface IDrawerModalProps extends Omit<IModalProps, 'isAnimated' | 'isCentered' | 'isLarge'> {
|
|
58
|
-
/**
|
|
59
|
-
* Opens the modal
|
|
60
|
-
*/
|
|
61
|
-
isOpen?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface IDrawerModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
64
|
-
/**
|
|
65
|
-
* Updates the element's HTML tag
|
|
66
|
-
*/
|
|
67
|
-
tag?: any;
|
|
68
|
-
}
|
|
69
|
-
export interface ITooltipModalProps extends Omit<IModalProps, 'appendToNode' | 'isCentered' | 'isLarge'> {
|
|
70
|
-
/**
|
|
71
|
-
* Positions the modal relative to the provided `HTMLElement`
|
|
72
|
-
*/
|
|
73
|
-
referenceElement?: HTMLElement | null;
|
|
74
|
-
/**
|
|
75
|
-
* Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic
|
|
76
|
-
*/
|
|
77
|
-
popperModifiers?: Partial<Modifier<any, any>>[];
|
|
78
|
-
/**
|
|
79
|
-
* Adjusts the placement of the tooltip
|
|
80
|
-
**/
|
|
81
|
-
placement?: Placement;
|
|
82
|
-
/**
|
|
83
|
-
* Adds an arrow to the tooltop
|
|
84
|
-
*/
|
|
85
|
-
hasArrow?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Sets the `z-index` of the tooltip
|
|
88
|
-
*/
|
|
89
|
-
zIndex?: number;
|
|
90
|
-
}
|
|
91
|
-
export interface ITooltipModalTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
92
|
-
/**
|
|
93
|
-
* Updates the element's HTML tag
|
|
94
|
-
*/
|
|
95
|
-
tag?: any;
|
|
96
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLAttributes, KeyboardEvent, MouseEvent } from 'react';
|
|
8
|
+
import { Modifier } from 'react-popper';
|
|
9
|
+
export declare const PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
|
|
10
|
+
export type Placement = (typeof PLACEMENT)[number];
|
|
11
|
+
export interface IModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
/**
|
|
13
|
+
* Passes HTML attributes to the backdrop element
|
|
14
|
+
*/
|
|
15
|
+
backdropProps?: HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
/**
|
|
17
|
+
* Handles close actions. Can be triggered from the backdrop and from the close icon.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} event The DOM event that triggered the close action
|
|
20
|
+
*/
|
|
21
|
+
onClose?: (event: KeyboardEvent | MouseEvent) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Centers the modal on the backdrop
|
|
24
|
+
*/
|
|
25
|
+
isCentered?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Animates the modal
|
|
28
|
+
*/
|
|
29
|
+
isAnimated?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Defines the DOM element that the modal will attatch to
|
|
32
|
+
*/
|
|
33
|
+
appendToNode?: Element;
|
|
34
|
+
/**
|
|
35
|
+
* Applies large styling
|
|
36
|
+
*/
|
|
37
|
+
isLarge?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Directs keyboard focus to the modal on mount
|
|
40
|
+
*/
|
|
41
|
+
focusOnMount?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns keyboard focus to the element that triggered the modal
|
|
44
|
+
*/
|
|
45
|
+
restoreFocus?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface IHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
/**
|
|
49
|
+
* Applies danger styling
|
|
50
|
+
*/
|
|
51
|
+
isDanger?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Updates the element's HTML tag
|
|
54
|
+
*/
|
|
55
|
+
tag?: any;
|
|
56
|
+
}
|
|
57
|
+
export interface IDrawerModalProps extends Omit<IModalProps, 'isAnimated' | 'isCentered' | 'isLarge'> {
|
|
58
|
+
/**
|
|
59
|
+
* Opens the modal
|
|
60
|
+
*/
|
|
61
|
+
isOpen?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface IDrawerModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
/**
|
|
65
|
+
* Updates the element's HTML tag
|
|
66
|
+
*/
|
|
67
|
+
tag?: any;
|
|
68
|
+
}
|
|
69
|
+
export interface ITooltipModalProps extends Omit<IModalProps, 'appendToNode' | 'isCentered' | 'isLarge'> {
|
|
70
|
+
/**
|
|
71
|
+
* Positions the modal relative to the provided `HTMLElement`
|
|
72
|
+
*/
|
|
73
|
+
referenceElement?: HTMLElement | null;
|
|
74
|
+
/**
|
|
75
|
+
* Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic
|
|
76
|
+
*/
|
|
77
|
+
popperModifiers?: Partial<Modifier<any, any>>[];
|
|
78
|
+
/**
|
|
79
|
+
* Adjusts the placement of the tooltip
|
|
80
|
+
**/
|
|
81
|
+
placement?: Placement;
|
|
82
|
+
/**
|
|
83
|
+
* Adds an arrow to the tooltop
|
|
84
|
+
*/
|
|
85
|
+
hasArrow?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the `z-index` of the tooltip
|
|
88
|
+
*/
|
|
89
|
+
zIndex?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ITooltipModalTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
92
|
+
/**
|
|
93
|
+
* Updates the element's HTML tag
|
|
94
|
+
*/
|
|
95
|
+
tag?: any;
|
|
96
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
import { Placement } from '@popperjs/core';
|
|
8
|
-
import { Placement as GardenPlacement } from '../types';
|
|
9
|
-
/**
|
|
10
|
-
* Convert Garden RTL aware placement to Popper.JS valid placement
|
|
11
|
-
* @param {String} gardenPlacement
|
|
12
|
-
*/
|
|
13
|
-
export declare function getPopperPlacement(gardenPlacement: GardenPlacement): Placement;
|
|
14
|
-
/**
|
|
15
|
-
* Convert Garden RTL aware placement to RTL equivalent Popper.JS placement
|
|
16
|
-
* @param {String} gardenPlacement
|
|
17
|
-
*/
|
|
18
|
-
export declare function getRtlPopperPlacement(gardenPlacement: GardenPlacement): Placement;
|
|
19
|
-
/**
|
|
20
|
-
* Convert Popper.JS placement to corresponding arrow position
|
|
21
|
-
* @param {String} popperPlacement
|
|
22
|
-
*/
|
|
23
|
-
export declare function getArrowPosition(popperPlacement: Placement): "top" | "top-left" | "top-right" | "right" | "right-top" | "right-bottom" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-top" | "left-bottom";
|
|
24
|
-
/**
|
|
25
|
-
* Convert Popper.JS placement to corresponding menu position
|
|
26
|
-
* @param {String} popperPlacement
|
|
27
|
-
*/
|
|
28
|
-
export declare function getMenuPosition(popperPlacement?: Placement): "top" | "right" | "bottom" | "left";
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { Placement } from '@popperjs/core';
|
|
8
|
+
import { Placement as GardenPlacement } from '../types';
|
|
9
|
+
/**
|
|
10
|
+
* Convert Garden RTL aware placement to Popper.JS valid placement
|
|
11
|
+
* @param {String} gardenPlacement
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPopperPlacement(gardenPlacement: GardenPlacement): Placement;
|
|
14
|
+
/**
|
|
15
|
+
* Convert Garden RTL aware placement to RTL equivalent Popper.JS placement
|
|
16
|
+
* @param {String} gardenPlacement
|
|
17
|
+
*/
|
|
18
|
+
export declare function getRtlPopperPlacement(gardenPlacement: GardenPlacement): Placement;
|
|
19
|
+
/**
|
|
20
|
+
* Convert Popper.JS placement to corresponding arrow position
|
|
21
|
+
* @param {String} popperPlacement
|
|
22
|
+
*/
|
|
23
|
+
export declare function getArrowPosition(popperPlacement: Placement): "top" | "top-left" | "top-right" | "right" | "right-top" | "right-bottom" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-top" | "left-bottom";
|
|
24
|
+
/**
|
|
25
|
+
* Convert Popper.JS placement to corresponding menu position
|
|
26
|
+
* @param {String} popperPlacement
|
|
27
|
+
*/
|
|
28
|
+
export declare function getMenuPosition(popperPlacement?: Placement): "top" | "right" | "bottom" | "left";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
import { IUseModalReturnValue } from '@zendeskgarden/container-modal';
|
|
9
|
-
export interface IModalContext {
|
|
10
|
-
isLarge?: boolean;
|
|
11
|
-
isCloseButtonPresent?: boolean;
|
|
12
|
-
hasHeader: boolean;
|
|
13
|
-
setHasHeader: (hasHeader: boolean) => void;
|
|
14
|
-
getTitleProps: IUseModalReturnValue['getTitleProps'];
|
|
15
|
-
getContentProps: IUseModalReturnValue['getContentProps'];
|
|
16
|
-
getCloseProps: IUseModalReturnValue['getCloseProps'];
|
|
17
|
-
setIsCloseButtonPresent: (isPresent: boolean) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const ModalsContext: import("react").Context<IModalContext | undefined>;
|
|
20
|
-
export declare const useModalContext: () => IModalContext;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
import { IUseModalReturnValue } from '@zendeskgarden/container-modal';
|
|
9
|
+
export interface IModalContext {
|
|
10
|
+
isLarge?: boolean;
|
|
11
|
+
isCloseButtonPresent?: boolean;
|
|
12
|
+
hasHeader: boolean;
|
|
13
|
+
setHasHeader: (hasHeader: boolean) => void;
|
|
14
|
+
getTitleProps: IUseModalReturnValue['getTitleProps'];
|
|
15
|
+
getContentProps: IUseModalReturnValue['getContentProps'];
|
|
16
|
+
getCloseProps: IUseModalReturnValue['getCloseProps'];
|
|
17
|
+
setIsCloseButtonPresent: (isPresent: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ModalsContext: import("react").Context<IModalContext | undefined>;
|
|
20
|
+
export declare const useModalContext: () => IModalContext;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
import { IUseModalReturnValue } from '@zendeskgarden/container-modal';
|
|
9
|
-
export interface IModalContext {
|
|
10
|
-
hasTitle: boolean;
|
|
11
|
-
setHasTitle: (isPresent: boolean) => void;
|
|
12
|
-
getTitleProps: IUseModalReturnValue['getTitleProps'];
|
|
13
|
-
getContentProps: IUseModalReturnValue['getContentProps'];
|
|
14
|
-
getCloseProps: IUseModalReturnValue['getCloseProps'];
|
|
15
|
-
}
|
|
16
|
-
export declare const TooltipModalContext: import("react").Context<IModalContext | undefined>;
|
|
17
|
-
export declare const useTooltipModalContext: () => IModalContext;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
import { IUseModalReturnValue } from '@zendeskgarden/container-modal';
|
|
9
|
+
export interface IModalContext {
|
|
10
|
+
hasTitle: boolean;
|
|
11
|
+
setHasTitle: (isPresent: boolean) => void;
|
|
12
|
+
getTitleProps: IUseModalReturnValue['getTitleProps'];
|
|
13
|
+
getContentProps: IUseModalReturnValue['getContentProps'];
|
|
14
|
+
getCloseProps: IUseModalReturnValue['getCloseProps'];
|
|
15
|
+
}
|
|
16
|
+
export declare const TooltipModalContext: import("react").Context<IModalContext | undefined>;
|
|
17
|
+
export declare const useTooltipModalContext: () => IModalContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-modals",
|
|
3
|
-
"version": "8.69.
|
|
3
|
+
"version": "8.69.4",
|
|
4
4
|
"description": "Components relating to modals in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/react-transition-group": "4.4.
|
|
42
|
-
"@zendeskgarden/react-theming": "^8.69.
|
|
41
|
+
"@types/react-transition-group": "4.4.6",
|
|
42
|
+
"@zendeskgarden/react-theming": "^8.69.4",
|
|
43
43
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"zendeskgarden:src": "src/index.ts",
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4911fa867a3c7e72f0c78dcea8748893c3070c17"
|
|
56
56
|
}
|