@zendeskgarden/react-modals 8.69.2 → 8.69.3

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.
Files changed (49) hide show
  1. package/dist/index.cjs.js +39 -120
  2. package/dist/index.esm.js +29 -116
  3. package/dist/typings/elements/Body.d.ts +11 -11
  4. package/dist/typings/elements/Close.d.ts +11 -11
  5. package/dist/typings/elements/DrawerModal/Body.d.ts +11 -11
  6. package/dist/typings/elements/DrawerModal/Close.d.ts +11 -11
  7. package/dist/typings/elements/DrawerModal/DrawerModal.d.ts +23 -23
  8. package/dist/typings/elements/DrawerModal/Footer.d.ts +11 -11
  9. package/dist/typings/elements/DrawerModal/FooterItem.d.ts +11 -11
  10. package/dist/typings/elements/DrawerModal/Header.d.ts +12 -12
  11. package/dist/typings/elements/Footer.d.ts +11 -11
  12. package/dist/typings/elements/FooterItem.d.ts +11 -11
  13. package/dist/typings/elements/Header.d.ts +12 -12
  14. package/dist/typings/elements/Modal.d.ts +12 -12
  15. package/dist/typings/elements/TooltipModal/Body.d.ts +11 -11
  16. package/dist/typings/elements/TooltipModal/Close.d.ts +11 -11
  17. package/dist/typings/elements/TooltipModal/Footer.d.ts +11 -11
  18. package/dist/typings/elements/TooltipModal/FooterItem.d.ts +11 -11
  19. package/dist/typings/elements/TooltipModal/Title.d.ts +12 -12
  20. package/dist/typings/elements/TooltipModal/TooltipModal.d.ts +23 -23
  21. package/dist/typings/index.d.ts +16 -16
  22. package/dist/typings/styled/StyledBackdrop.d.ts +14 -14
  23. package/dist/typings/styled/StyledBody.d.ts +10 -10
  24. package/dist/typings/styled/StyledClose.d.ts +19 -19
  25. package/dist/typings/styled/StyledDangerIcon.d.ts +7 -7
  26. package/dist/typings/styled/StyledDrawerModal.d.ts +14 -14
  27. package/dist/typings/styled/StyledDrawerModalBody.d.ts +13 -13
  28. package/dist/typings/styled/StyledDrawerModalClose.d.ts +18 -18
  29. package/dist/typings/styled/StyledDrawerModalFooter.d.ts +10 -10
  30. package/dist/typings/styled/StyledDrawerModalFooterItem.d.ts +10 -10
  31. package/dist/typings/styled/StyledDrawerModalHeader.d.ts +14 -14
  32. package/dist/typings/styled/StyledFooter.d.ts +11 -11
  33. package/dist/typings/styled/StyledFooterItem.d.ts +10 -10
  34. package/dist/typings/styled/StyledHeader.d.ts +15 -15
  35. package/dist/typings/styled/StyledModal.d.ts +16 -16
  36. package/dist/typings/styled/StyledTooltipModal.d.ts +14 -14
  37. package/dist/typings/styled/StyledTooltipModalBackdrop.d.ts +13 -13
  38. package/dist/typings/styled/StyledTooltipModalBody.d.ts +10 -10
  39. package/dist/typings/styled/StyledTooltipModalClose.d.ts +13 -13
  40. package/dist/typings/styled/StyledTooltipModalFooter.d.ts +10 -10
  41. package/dist/typings/styled/StyledTooltipModalFooterItem.d.ts +13 -13
  42. package/dist/typings/styled/StyledTooltipModalTitle.d.ts +11 -11
  43. package/dist/typings/styled/StyledTooltipWrapper.d.ts +13 -13
  44. package/dist/typings/styled/index.d.ts +28 -28
  45. package/dist/typings/types/index.d.ts +96 -96
  46. package/dist/typings/utils/gardenPlacements.d.ts +28 -28
  47. package/dist/typings/utils/useModalContext.d.ts +20 -20
  48. package/dist/typings/utils/useTooltipModalContext.d.ts +17 -17
  49. package/package.json +4 -4
@@ -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.2",
3
+ "version": "8.69.3",
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.5",
42
- "@zendeskgarden/react-theming": "^8.69.2",
41
+ "@types/react-transition-group": "4.4.6",
42
+ "@zendeskgarden/react-theming": "^8.69.3",
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": "a39f2b421375013a50990d206610e3813abc0bd7"
55
+ "gitHead": "c861fbeb70120b66b05d2ce3a26ccf3047659aa0"
56
56
  }