@zendeskgarden/react-modals 9.12.2 → 9.12.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.
Files changed (41) hide show
  1. package/dist/esm/elements/Body.js +3 -3
  2. package/dist/esm/elements/Close.js +4 -4
  3. package/dist/esm/elements/Drawer/Drawer.js +14 -12
  4. package/dist/esm/elements/Drawer/Header.js +4 -5
  5. package/dist/esm/elements/Footer.js +3 -3
  6. package/dist/esm/elements/FooterItem.js +3 -3
  7. package/dist/esm/elements/Header.js +9 -10
  8. package/dist/esm/elements/Modal.js +15 -15
  9. package/dist/esm/elements/TooltipDialog/Body.js +4 -4
  10. package/dist/esm/elements/TooltipDialog/Close.js +5 -5
  11. package/dist/esm/elements/TooltipDialog/Footer.js +4 -4
  12. package/dist/esm/elements/TooltipDialog/FooterItem.js +4 -4
  13. package/dist/esm/elements/TooltipDialog/Title.js +5 -6
  14. package/dist/esm/elements/TooltipDialog/TooltipDialog.js +26 -22
  15. package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +4 -4
  16. package/dist/esm/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +3 -3
  17. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +2 -2
  18. package/dist/esm/node_modules/polished/dist/polished.esm.js +3 -12
  19. package/dist/esm/styled/StyledBackdrop.js +19 -22
  20. package/dist/esm/styled/StyledBody.js +9 -12
  21. package/dist/esm/styled/StyledClose.js +6 -6
  22. package/dist/esm/styled/StyledDrawer.js +6 -7
  23. package/dist/esm/styled/StyledDrawerBody.js +3 -3
  24. package/dist/esm/styled/StyledDrawerClose.js +3 -4
  25. package/dist/esm/styled/StyledDrawerFooter.js +9 -12
  26. package/dist/esm/styled/StyledDrawerFooterItem.js +1 -1
  27. package/dist/esm/styled/StyledDrawerHeader.js +3 -3
  28. package/dist/esm/styled/StyledFooter.js +3 -3
  29. package/dist/esm/styled/StyledFooterItem.js +3 -3
  30. package/dist/esm/styled/StyledHeader.js +8 -9
  31. package/dist/esm/styled/StyledModal.js +9 -10
  32. package/dist/esm/styled/StyledTooltipDialog.js +5 -5
  33. package/dist/esm/styled/StyledTooltipDialogBackdrop.js +3 -3
  34. package/dist/esm/styled/StyledTooltipDialogBody.js +9 -12
  35. package/dist/esm/styled/StyledTooltipDialogClose.js +3 -3
  36. package/dist/esm/styled/StyledTooltipDialogFooter.js +3 -3
  37. package/dist/esm/styled/StyledTooltipDialogFooterItem.js +3 -3
  38. package/dist/esm/styled/StyledTooltipDialogTitle.js +10 -13
  39. package/dist/index.cjs.js +141 -166
  40. package/dist/typings/elements/TooltipDialog/TooltipDialog.d.ts +0 -6
  41. package/package.json +7 -7
@@ -29,7 +29,7 @@ import '../styled/StyledDrawerFooter.js';
29
29
  import '../styled/StyledDrawerFooterItem.js';
30
30
  import { useModalContext } from '../utils/useModalContext.js';
31
31
 
32
- const Body = forwardRef((props, ref) => {
32
+ const Body$2 = forwardRef((props, ref) => {
33
33
  const {
34
34
  getContentProps
35
35
  } = useModalContext();
@@ -37,6 +37,6 @@ const Body = forwardRef((props, ref) => {
37
37
  ref: ref
38
38
  }));
39
39
  });
40
- Body.displayName = 'Modal.Body';
40
+ Body$2.displayName = 'Modal.Body';
41
41
 
42
- export { Body };
42
+ export { Body$2 as Body };
@@ -31,7 +31,7 @@ import { useText } from '@zendeskgarden/react-theming';
31
31
  import { useModalContext } from '../utils/useModalContext.js';
32
32
  import SvgXStroke from '../node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js';
33
33
 
34
- const Close = forwardRef((props, ref) => {
34
+ const Close$2 = forwardRef((props, ref) => {
35
35
  const {
36
36
  getCloseProps,
37
37
  setIsCloseButtonPresent
@@ -40,7 +40,7 @@ const Close = forwardRef((props, ref) => {
40
40
  setIsCloseButtonPresent(true);
41
41
  return () => setIsCloseButtonPresent(false);
42
42
  });
43
- const ariaLabel = useText(Close, props, 'aria-label', 'Close modal', props['aria-describedby'] === undefined );
43
+ const ariaLabel = useText(Close$2, props, 'aria-label', 'Close modal', props['aria-describedby'] === undefined );
44
44
  return React__default.createElement(StyledClose, Object.assign({}, getCloseProps({
45
45
  ...props,
46
46
  'aria-label': ariaLabel
@@ -48,6 +48,6 @@ const Close = forwardRef((props, ref) => {
48
48
  ref: ref
49
49
  }), React__default.createElement(SvgXStroke, null));
50
50
  });
51
- Close.displayName = 'Modal.Close';
51
+ Close$2.displayName = 'Modal.Close';
52
52
 
53
- export { Close };
53
+ export { Close$2 as Close };
@@ -42,17 +42,16 @@ import { Close } from './Close.js';
42
42
  import { Footer } from './Footer.js';
43
43
  import { FooterItem } from './FooterItem.js';
44
44
 
45
- const DrawerComponent = forwardRef((_ref, ref) => {
46
- let {
47
- id,
48
- isOpen,
49
- onClose,
50
- backdropProps,
51
- appendToNode,
52
- focusOnMount = true,
53
- restoreFocus = true,
54
- ...props
55
- } = _ref;
45
+ const DrawerComponent = forwardRef(({
46
+ id,
47
+ isOpen,
48
+ onClose,
49
+ backdropProps,
50
+ appendToNode,
51
+ focusOnMount = true,
52
+ restoreFocus = true,
53
+ ...props
54
+ }, ref) => {
56
55
  const modalRef = useRef(null);
57
56
  const transitionRef = useRef(null);
58
57
  const triggerRef = useRef(null);
@@ -60,6 +59,9 @@ const DrawerComponent = forwardRef((_ref, ref) => {
60
59
  const environment = useDocument(theme);
61
60
  const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
62
61
  const [hasHeader, setHasHeader] = useState(false);
62
+ const handleClose = event => {
63
+ isOpen && onClose?.(event);
64
+ };
63
65
  const {
64
66
  getTitleProps,
65
67
  getCloseProps,
@@ -72,7 +74,7 @@ const DrawerComponent = forwardRef((_ref, ref) => {
72
74
  focusOnMount: false ,
73
75
  restoreFocus: false ,
74
76
  environment,
75
- onClose
77
+ onClose: handleClose
76
78
  });
77
79
  useEffect(() => {
78
80
  if (environment) {
@@ -30,11 +30,10 @@ import '../../styled/StyledDrawerBody.js';
30
30
  import '../../styled/StyledDrawerFooter.js';
31
31
  import '../../styled/StyledDrawerFooterItem.js';
32
32
 
33
- const HeaderComponent = forwardRef((_ref, ref) => {
34
- let {
35
- tag = 'div',
36
- ...other
37
- } = _ref;
33
+ const HeaderComponent = forwardRef(({
34
+ tag = 'div',
35
+ ...other
36
+ }, ref) => {
38
37
  const {
39
38
  isCloseButtonPresent,
40
39
  hasHeader,
@@ -29,7 +29,7 @@ import '../styled/StyledDrawerFooter.js';
29
29
  import '../styled/StyledDrawerFooterItem.js';
30
30
  import { useModalContext } from '../utils/useModalContext.js';
31
31
 
32
- const Footer = React__default.forwardRef((props, ref) => {
32
+ const Footer$2 = React__default.forwardRef((props, ref) => {
33
33
  const {
34
34
  isLarge
35
35
  } = useModalContext();
@@ -38,6 +38,6 @@ const Footer = React__default.forwardRef((props, ref) => {
38
38
  $isLarge: isLarge
39
39
  }, props));
40
40
  });
41
- Footer.displayName = 'Modal.Footer';
41
+ Footer$2.displayName = 'Modal.Footer';
42
42
 
43
- export { Footer };
43
+ export { Footer$2 as Footer };
@@ -28,9 +28,9 @@ import '../styled/StyledDrawerBody.js';
28
28
  import '../styled/StyledDrawerFooter.js';
29
29
  import '../styled/StyledDrawerFooterItem.js';
30
30
 
31
- const FooterItem = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, Object.assign({
31
+ const FooterItem$2 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, Object.assign({
32
32
  ref: ref
33
33
  }, props)));
34
- FooterItem.displayName = 'Modal.FooterItem';
34
+ FooterItem$2.displayName = 'Modal.FooterItem';
35
35
 
36
- export { FooterItem };
36
+ export { FooterItem$2 as FooterItem };
@@ -30,13 +30,12 @@ import '../styled/StyledDrawerBody.js';
30
30
  import '../styled/StyledDrawerFooter.js';
31
31
  import '../styled/StyledDrawerFooterItem.js';
32
32
 
33
- const Header = forwardRef((_ref, ref) => {
34
- let {
35
- children,
36
- isDanger,
37
- tag = 'div',
38
- ...other
39
- } = _ref;
33
+ const Header$1 = forwardRef(({
34
+ children,
35
+ isDanger,
36
+ tag = 'div',
37
+ ...other
38
+ }, ref) => {
40
39
  const {
41
40
  isCloseButtonPresent,
42
41
  hasHeader,
@@ -60,10 +59,10 @@ const Header = forwardRef((_ref, ref) => {
60
59
  ref: ref
61
60
  }), !!isDanger && React__default.createElement(StyledDangerIcon, null), children);
62
61
  });
63
- Header.displayName = 'Modal.Header';
64
- Header.propTypes = {
62
+ Header$1.displayName = 'Modal.Header';
63
+ Header$1.propTypes = {
65
64
  isDanger: PropTypes.bool,
66
65
  tag: PropTypes.any
67
66
  };
68
67
 
69
- export { Header };
68
+ export { Header$1 as Header };
@@ -57,20 +57,19 @@ const isOverflowing = element => {
57
57
  const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
58
58
  return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
59
59
  };
60
- const ModalComponent = forwardRef((_ref, ref) => {
61
- let {
62
- backdropProps,
63
- children,
64
- onClose,
65
- isLarge,
66
- isCentered = true,
67
- isAnimated = true,
68
- id,
69
- appendToNode,
70
- focusOnMount,
71
- restoreFocus,
72
- ...modalProps
73
- } = _ref;
60
+ const ModalComponent = forwardRef(({
61
+ backdropProps,
62
+ children,
63
+ onClose,
64
+ isLarge,
65
+ isCentered = true,
66
+ isAnimated = true,
67
+ id,
68
+ appendToNode,
69
+ focusOnMount,
70
+ restoreFocus,
71
+ ...modalProps
72
+ }, ref) => {
74
73
  const theme = useContext(ThemeContext);
75
74
  const modalRef = useRef(null);
76
75
  const environment = useDocument(theme);
@@ -87,7 +86,8 @@ const ModalComponent = forwardRef((_ref, ref) => {
87
86
  onClose,
88
87
  modalRef,
89
88
  focusOnMount,
90
- restoreFocus
89
+ restoreFocus,
90
+ environment
91
91
  });
92
92
  useEffect(() => {
93
93
  if (!environment) {
@@ -29,7 +29,7 @@ import '../../styled/StyledDrawerFooter.js';
29
29
  import '../../styled/StyledDrawerFooterItem.js';
30
30
  import { useTooltipDialogContext } from '../../utils/useTooltipDialogContext.js';
31
31
 
32
- const BodyComponent = forwardRef((props, ref) => {
32
+ const BodyComponent$1 = forwardRef((props, ref) => {
33
33
  const {
34
34
  getContentProps
35
35
  } = useTooltipDialogContext();
@@ -37,7 +37,7 @@ const BodyComponent = forwardRef((props, ref) => {
37
37
  ref: ref
38
38
  }));
39
39
  });
40
- BodyComponent.displayName = 'TooltipDialog.Body';
41
- const Body = BodyComponent;
40
+ BodyComponent$1.displayName = 'TooltipDialog.Body';
41
+ const Body$1 = BodyComponent$1;
42
42
 
43
- export { Body };
43
+ export { Body$1 as Body };
@@ -31,11 +31,11 @@ import { useText } from '@zendeskgarden/react-theming';
31
31
  import { useTooltipDialogContext } from '../../utils/useTooltipDialogContext.js';
32
32
  import SvgXStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js';
33
33
 
34
- const CloseComponent = forwardRef((props, ref) => {
34
+ const CloseComponent$1 = forwardRef((props, ref) => {
35
35
  const {
36
36
  getCloseProps
37
37
  } = useTooltipDialogContext();
38
- const ariaLabel = useText(CloseComponent, props, 'aria-label', 'Close tooltip', props['aria-describedby'] === undefined );
38
+ const ariaLabel = useText(CloseComponent$1, props, 'aria-label', 'Close tooltip', props['aria-describedby'] === undefined );
39
39
  return React__default.createElement(StyledTooltipDialogClose, Object.assign({}, getCloseProps({
40
40
  ...props,
41
41
  'aria-label': ariaLabel
@@ -44,7 +44,7 @@ const CloseComponent = forwardRef((props, ref) => {
44
44
  size: "small"
45
45
  }), React__default.createElement(SvgXStroke, null));
46
46
  });
47
- CloseComponent.displayName = 'TooltipDialog.Close';
48
- const Close = CloseComponent;
47
+ CloseComponent$1.displayName = 'TooltipDialog.Close';
48
+ const Close$1 = CloseComponent$1;
49
49
 
50
- export { Close };
50
+ export { Close$1 as Close };
@@ -28,10 +28,10 @@ import '../../styled/StyledDrawerBody.js';
28
28
  import '../../styled/StyledDrawerFooter.js';
29
29
  import '../../styled/StyledDrawerFooterItem.js';
30
30
 
31
- const FooterComponent = forwardRef((props, ref) => React__default.createElement(StyledTooltipDialogFooter, Object.assign({
31
+ const FooterComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipDialogFooter, Object.assign({
32
32
  ref: ref
33
33
  }, props)));
34
- FooterComponent.displayName = 'TooltipDialog.Footer';
35
- const Footer = FooterComponent;
34
+ FooterComponent$1.displayName = 'TooltipDialog.Footer';
35
+ const Footer$1 = FooterComponent$1;
36
36
 
37
- export { Footer };
37
+ export { Footer$1 as Footer };
@@ -28,10 +28,10 @@ import '../../styled/StyledDrawerBody.js';
28
28
  import '../../styled/StyledDrawerFooter.js';
29
29
  import '../../styled/StyledDrawerFooterItem.js';
30
30
 
31
- const FooterItemComponent = forwardRef((props, ref) => React__default.createElement(StyledTooltipDialogFooterItem, Object.assign({
31
+ const FooterItemComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipDialogFooterItem, Object.assign({
32
32
  ref: ref
33
33
  }, props)));
34
- FooterItemComponent.displayName = 'TooltipDialog.FooterItem';
35
- const FooterItem = FooterItemComponent;
34
+ FooterItemComponent$1.displayName = 'TooltipDialog.FooterItem';
35
+ const FooterItem$1 = FooterItemComponent$1;
36
36
 
37
- export { FooterItem };
37
+ export { FooterItem$1 as FooterItem };
@@ -30,12 +30,11 @@ import '../../styled/StyledDrawerBody.js';
30
30
  import '../../styled/StyledDrawerFooter.js';
31
31
  import '../../styled/StyledDrawerFooterItem.js';
32
32
 
33
- const TitleComponent = forwardRef((_ref, ref) => {
34
- let {
35
- children,
36
- tag = 'div',
37
- ...other
38
- } = _ref;
33
+ const TitleComponent = forwardRef(({
34
+ children,
35
+ tag = 'div',
36
+ ...other
37
+ }, ref) => {
39
38
  const {
40
39
  getTitleProps,
41
40
  hasTitle,
@@ -8,7 +8,7 @@ import React__default, { useContext, useRef, useState, useEffect } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { ThemeContext } from 'styled-components';
10
10
  import { CSSTransition } from 'react-transition-group';
11
- import { useFloating, platform, offset, autoPlacement, flip, autoUpdate } from '@floating-ui/react-dom';
11
+ import { useFloating, offset, autoPlacement, flip, platform, autoUpdate } from '@floating-ui/react-dom';
12
12
  import { useModal } from '@zendeskgarden/container-modal';
13
13
  import { mergeRefs } from 'react-merge-refs';
14
14
  import { TooltipDialogContext } from '../../utils/useTooltipDialogContext.js';
@@ -40,34 +40,37 @@ import { Body } from './Body.js';
40
40
  import { Close } from './Close.js';
41
41
  import { Footer } from './Footer.js';
42
42
  import { FooterItem } from './FooterItem.js';
43
- import { DEFAULT_THEME, getFloatingPlacements, useText } from '@zendeskgarden/react-theming';
43
+ import { DEFAULT_THEME, useDocument, getFloatingPlacements, useText } from '@zendeskgarden/react-theming';
44
44
  import { createPortal } from 'react-dom';
45
45
 
46
46
  const PLACEMENT_DEFAULT = 'top';
47
- const TooltipDialogComponent = React__default.forwardRef((_ref, ref) => {
48
- let {
49
- appendToNode,
50
- referenceElement,
51
- placement: _placement = 'auto',
52
- fallbackPlacements: _fallbackPlacements,
53
- offset: _offset,
54
- onClose,
55
- hasArrow = true,
56
- keepMounted,
57
- isAnimated,
58
- zIndex,
59
- backdropProps,
60
- focusOnMount = true,
61
- restoreFocus = true,
62
- id,
63
- ...props
64
- } = _ref;
47
+ const TooltipDialogComponent = React__default.forwardRef(({
48
+ appendToNode,
49
+ referenceElement,
50
+ placement: _placement = 'auto',
51
+ fallbackPlacements: _fallbackPlacements,
52
+ offset: _offset,
53
+ onClose,
54
+ hasArrow = true,
55
+ keepMounted,
56
+ isAnimated,
57
+ zIndex,
58
+ backdropProps,
59
+ focusOnMount = true,
60
+ restoreFocus = true,
61
+ id,
62
+ ...props
63
+ }, ref) => {
65
64
  const theme = useContext(ThemeContext) || DEFAULT_THEME;
65
+ const environment = useDocument(theme);
66
66
  const previousReferenceElementRef = useRef();
67
67
  const modalRef = useRef(null);
68
68
  const transitionRef = useRef(null);
69
69
  const [floatingElement, setFloatingElement] = useState();
70
70
  const [hasTitle, setHasTitle] = useState(false);
71
+ const handleClose = event => {
72
+ referenceElement && onClose?.(event);
73
+ };
71
74
  const {
72
75
  getTitleProps,
73
76
  getCloseProps,
@@ -76,10 +79,11 @@ const TooltipDialogComponent = React__default.forwardRef((_ref, ref) => {
76
79
  getModalProps
77
80
  } = useModal({
78
81
  idPrefix: id,
79
- onClose,
82
+ onClose: handleClose,
80
83
  modalRef,
81
84
  focusOnMount,
82
- restoreFocus: false
85
+ restoreFocus: false,
86
+ environment
83
87
  });
84
88
  const [floatingPlacement, fallbackPlacements] = getFloatingPlacements(theme, _placement === 'auto' ? PLACEMENT_DEFAULT : _placement, _fallbackPlacements);
85
89
  const {
@@ -4,14 +4,14 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- function _extends() {
8
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
7
+ function _extends$1() {
8
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
9
9
  for (var e = 1; e < arguments.length; e++) {
10
10
  var t = arguments[e];
11
11
  for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
12
12
  }
13
13
  return n;
14
- }, _extends.apply(null, arguments);
14
+ }, _extends$1.apply(null, arguments);
15
15
  }
16
16
 
17
- export { _extends as default };
17
+ export { _extends$1 as default };
@@ -24,9 +24,9 @@ function _wrapNativeSuper(t) {
24
24
  return Wrapper.prototype = Object.create(t.prototype, {
25
25
  constructor: {
26
26
  value: Wrapper,
27
- enumerable: !1,
28
- writable: !0,
29
- configurable: !0
27
+ enumerable: false,
28
+ writable: true,
29
+ configurable: true
30
30
  }
31
31
  }), _setPrototypeOf(Wrapper, t);
32
32
  }, _wrapNativeSuper(t);
@@ -7,9 +7,9 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _g, _circle;
10
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
10
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
11
11
  var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
12
- return /*#__PURE__*/React.createElement("svg", _extends({
12
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  width: 16,
15
15
  height: 16,
@@ -505,17 +505,13 @@ function hslToHex(hue, saturation, lightness) {
505
505
  return hslToRgb(hue, saturation, lightness, convertToHex);
506
506
  }
507
507
  function hsl(value, saturation, lightness) {
508
- if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
509
- return hslToHex(value, saturation, lightness);
510
- } else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
508
+ if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
511
509
  return hslToHex(value.hue, value.saturation, value.lightness);
512
510
  }
513
511
  throw new PolishedError(1);
514
512
  }
515
513
  function hsla(value, saturation, lightness, alpha) {
516
- if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
517
- return "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
518
- } else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
514
+ if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
519
515
  return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
520
516
  }
521
517
  throw new PolishedError(2);
@@ -529,12 +525,7 @@ function rgb(value, green, blue) {
529
525
  throw new PolishedError(6);
530
526
  }
531
527
  function rgba(firstValue, secondValue, thirdValue, fourthValue) {
532
- if (typeof firstValue === 'string' && typeof secondValue === 'number') {
533
- var rgbValue = parseToRgb(firstValue);
534
- return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
535
- } else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
536
- return "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
537
- } else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
528
+ if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
538
529
  return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
539
530
  }
540
531
  throw new PolishedError(7);
@@ -8,36 +8,33 @@ import PropTypes from 'prop-types';
8
8
  import styled, { keyframes, css } from 'styled-components';
9
9
  import { getColor, componentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
- const COMPONENT_ID = 'modals.backdrop';
12
- const animationName = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
13
- const animationStyles = props => {
11
+ const COMPONENT_ID$j = 'modals.backdrop';
12
+ const animationName$1 = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
13
+ const animationStyles$1 = props => {
14
14
  if (props.$isAnimated) {
15
- return css(["animation:", " 0.15s ease-in;"], animationName);
15
+ return css(["animation:", " 0.15s ease-in;"], animationName$1);
16
16
  }
17
17
  return '';
18
18
  };
19
19
  const StyledBackdrop = styled.div.attrs({
20
- 'data-garden-id': COMPONENT_ID,
21
- 'data-garden-version': '9.12.2'
20
+ 'data-garden-id': COMPONENT_ID$j,
21
+ 'data-garden-version': '9.12.4'
22
22
  }).withConfig({
23
23
  displayName: "StyledBackdrop",
24
24
  componentId: "sc-mzdjpo-0"
25
- })(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.$isCentered && 'center', props => props.$isCentered && 'center', _ref => {
26
- let {
27
- theme
28
- } = _ref;
29
- return getColor({
30
- theme,
31
- hue: 'neutralHue',
32
- transparency: theme.opacity[1000],
33
- light: {
34
- shade: 900
35
- },
36
- dark: {
37
- shade: 1200
38
- }
39
- });
40
- }, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles, componentStyles);
25
+ })(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.$isCentered && 'center', props => props.$isCentered && 'center', ({
26
+ theme
27
+ }) => getColor({
28
+ theme,
29
+ hue: 'neutralHue',
30
+ transparency: theme.opacity[1000],
31
+ light: {
32
+ shade: 900
33
+ },
34
+ dark: {
35
+ shade: 1200
36
+ }
37
+ }), props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, componentStyles);
41
38
  StyledBackdrop.propTypes = {
42
39
  $isCentered: PropTypes.bool,
43
40
  $isAnimated: PropTypes.bool
@@ -7,21 +7,18 @@
7
7
  import styled from 'styled-components';
8
8
  import { getLineHeight, getColor, componentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
- const COMPONENT_ID = 'modals.body';
10
+ const COMPONENT_ID$i = 'modals.body';
11
11
  const StyledBody = styled.div.attrs({
12
- 'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.12.2'
12
+ 'data-garden-id': COMPONENT_ID$i,
13
+ 'data-garden-version': '9.12.4'
14
14
  }).withConfig({
15
15
  displayName: "StyledBody",
16
16
  componentId: "sc-14rzecg-0"
17
- })(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
18
- let {
19
- theme
20
- } = _ref;
21
- return getColor({
22
- theme,
23
- variable: 'foreground.default'
24
- });
25
- }, props => props.theme.fontSizes.md, componentStyles);
17
+ })(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, ({
18
+ theme
19
+ }) => getColor({
20
+ theme,
21
+ variable: 'foreground.default'
22
+ }), props => props.theme.fontSizes.md, componentStyles);
26
23
 
27
24
  export { StyledBody };
@@ -8,18 +8,18 @@ import styled from 'styled-components';
8
8
  import { componentStyles } from '@zendeskgarden/react-theming';
9
9
  import { IconButton } from '@zendeskgarden/react-buttons';
10
10
 
11
- const COMPONENT_ID = 'modals.close';
12
- const BASE_MULTIPLIERS = {
11
+ const COMPONENT_ID$h = 'modals.close';
12
+ const BASE_MULTIPLIERS$1 = {
13
13
  top: 2.5,
14
14
  side: 6.5,
15
15
  size: 10
16
16
  };
17
17
  const StyledClose = styled(IconButton).attrs({
18
- 'data-garden-id': COMPONENT_ID,
19
- 'data-garden-version': '9.12.2'
18
+ 'data-garden-id': COMPONENT_ID$h,
19
+ 'data-garden-version': '9.12.4'
20
20
  }).withConfig({
21
21
  displayName: "StyledClose",
22
22
  componentId: "sc-iseudj-0"
23
- })(["position:absolute;top:", "px;", ":", ";", ";"], props => props.theme.space.base * BASE_MULTIPLIERS.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, componentStyles);
23
+ })(["position:absolute;top:", "px;", ":", ";", ";"], props => props.theme.space.base * BASE_MULTIPLIERS$1.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS$1.side}px`, componentStyles);
24
24
 
25
- export { BASE_MULTIPLIERS, StyledClose };
25
+ export { BASE_MULTIPLIERS$1 as BASE_MULTIPLIERS, StyledClose };
@@ -7,12 +7,11 @@
7
7
  import styled, { css } from 'styled-components';
8
8
  import { componentStyles, getColor } from '@zendeskgarden/react-theming';
9
9
 
10
- const COMPONENT_ID = 'modals.drawer_modal';
10
+ const COMPONENT_ID$5 = 'modals.drawer_modal';
11
11
  const DRAWER_WIDTH = 380;
12
- const colorStyles = _ref => {
13
- let {
14
- theme
15
- } = _ref;
12
+ const colorStyles = ({
13
+ theme
14
+ }) => {
16
15
  const offsetY = `${theme.space.base * 5}px`;
17
16
  const blurRadius = `${theme.space.base * 7}px`;
18
17
  const shadowColor = getColor({
@@ -31,8 +30,8 @@ const colorStyles = _ref => {
31
30
  return css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
32
31
  };
33
32
  const StyledDrawer = styled.div.attrs({
34
- 'data-garden-id': COMPONENT_ID,
35
- 'data-garden-version': '9.12.2'
33
+ 'data-garden-id': COMPONENT_ID$5,
34
+ 'data-garden-version': '9.12.4'
36
35
  }).withConfig({
37
36
  displayName: "StyledDrawer",
38
37
  componentId: "sc-zp66t3-0"
@@ -8,10 +8,10 @@ import styled from 'styled-components';
8
8
  import { componentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledBody } from './StyledBody.js';
10
10
 
11
- const COMPONENT_ID = 'modals.drawer_modal.body';
11
+ const COMPONENT_ID$2 = 'modals.drawer_modal.body';
12
12
  const StyledDrawerBody = styled(StyledBody).attrs({
13
- 'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.12.2'
13
+ 'data-garden-id': COMPONENT_ID$2,
14
+ 'data-garden-version': '9.12.4'
15
15
  }).withConfig({
16
16
  displayName: "StyledDrawerBody",
17
17
  componentId: "sc-13qufyn-0"