@zendeskgarden/react-modals 9.0.0-next.9 → 9.1.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.
Files changed (77) hide show
  1. package/README.md +11 -11
  2. package/dist/esm/elements/Body.js +8 -8
  3. package/dist/esm/elements/Close.js +8 -8
  4. package/dist/esm/elements/Drawer/Body.js +7 -7
  5. package/dist/esm/elements/Drawer/Close.js +7 -7
  6. package/dist/esm/elements/Drawer/Drawer.js +8 -8
  7. package/dist/esm/elements/Drawer/Footer.js +7 -7
  8. package/dist/esm/elements/Drawer/FooterItem.js +7 -7
  9. package/dist/esm/elements/Drawer/Header.js +7 -7
  10. package/dist/esm/elements/Footer.js +8 -8
  11. package/dist/esm/elements/FooterItem.js +8 -8
  12. package/dist/esm/elements/Header.js +9 -9
  13. package/dist/esm/elements/Modal.js +8 -8
  14. package/dist/esm/elements/{TooltipModal → TooltipDialog}/Body.js +11 -11
  15. package/dist/esm/elements/{TooltipModal → TooltipDialog}/Close.js +13 -12
  16. package/dist/esm/elements/{TooltipModal → TooltipDialog}/Footer.js +9 -9
  17. package/dist/esm/elements/{TooltipModal → TooltipDialog}/FooterItem.js +9 -9
  18. package/dist/esm/elements/{TooltipModal → TooltipDialog}/Title.js +11 -11
  19. package/dist/esm/elements/{TooltipModal/TooltipModal.js → TooltipDialog/TooltipDialog.js} +25 -24
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +1 -1
  22. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
  23. package/dist/esm/styled/StyledBackdrop.js +18 -6
  24. package/dist/esm/styled/StyledBody.js +11 -6
  25. package/dist/esm/styled/StyledClose.js +6 -18
  26. package/dist/esm/styled/StyledDangerIcon.js +0 -4
  27. package/dist/esm/styled/StyledDrawer.js +23 -18
  28. package/dist/esm/styled/StyledDrawerBody.js +3 -6
  29. package/dist/esm/styled/StyledDrawerClose.js +2 -5
  30. package/dist/esm/styled/StyledDrawerFooter.js +11 -6
  31. package/dist/esm/styled/StyledDrawerFooterItem.js +2 -5
  32. package/dist/esm/styled/StyledDrawerHeader.js +2 -5
  33. package/dist/esm/styled/StyledFooter.js +6 -6
  34. package/dist/esm/styled/StyledFooterItem.js +2 -5
  35. package/dist/esm/styled/StyledHeader.js +19 -7
  36. package/dist/esm/styled/StyledModal.js +22 -17
  37. package/dist/esm/styled/StyledTooltipDialog.js +39 -0
  38. package/dist/esm/styled/{StyledTooltipModalBackdrop.js → StyledTooltipDialogBackdrop.js} +7 -10
  39. package/dist/esm/styled/StyledTooltipDialogBody.js +27 -0
  40. package/dist/esm/styled/StyledTooltipDialogClose.js +20 -0
  41. package/dist/esm/styled/{StyledTooltipModalFooter.js → StyledTooltipDialogFooter.js} +7 -10
  42. package/dist/esm/styled/StyledTooltipDialogFooterItem.js +20 -0
  43. package/dist/esm/styled/StyledTooltipDialogTitle.js +32 -0
  44. package/dist/esm/styled/StyledTooltipWrapper.js +1 -4
  45. package/dist/esm/utils/useTooltipDialogContext.js +18 -0
  46. package/dist/index.cjs.js +227 -212
  47. package/dist/typings/elements/Drawer/Drawer.d.ts +10 -1
  48. package/dist/typings/elements/Modal.d.ts +1 -1
  49. package/dist/typings/elements/{TooltipModal → TooltipDialog}/Title.d.ts +2 -2
  50. package/dist/typings/elements/{TooltipModal/TooltipModal.d.ts → TooltipDialog/TooltipDialog.d.ts} +4 -2
  51. package/dist/typings/index.d.ts +2 -2
  52. package/dist/typings/styled/StyledClose.d.ts +1 -5
  53. package/dist/typings/styled/StyledDrawerClose.d.ts +1 -1
  54. package/dist/typings/styled/StyledHeader.d.ts +2 -1
  55. package/dist/typings/styled/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts} +4 -3
  56. package/dist/typings/styled/{StyledTooltipModalBackdrop.d.ts → StyledTooltipDialogBackdrop.d.ts} +1 -1
  57. package/dist/typings/styled/{StyledTooltipModalBody.d.ts → StyledTooltipDialogBody.d.ts} +1 -1
  58. package/dist/typings/styled/{StyledTooltipModalClose.d.ts → StyledTooltipDialogClose.d.ts} +1 -1
  59. package/dist/typings/styled/{StyledTooltipModalFooter.d.ts → StyledTooltipDialogFooter.d.ts} +1 -1
  60. package/dist/typings/styled/{StyledTooltipModalFooterItem.d.ts → StyledTooltipDialogFooterItem.d.ts} +1 -1
  61. package/dist/typings/styled/{StyledTooltipModalTitle.d.ts → StyledTooltipDialogTitle.d.ts} +1 -1
  62. package/dist/typings/styled/StyledTooltipWrapper.d.ts +2 -2
  63. package/dist/typings/styled/index.d.ts +7 -7
  64. package/dist/typings/types/index.d.ts +4 -2
  65. package/dist/typings/utils/useModalContext.d.ts +0 -1
  66. package/dist/typings/utils/{useTooltipModalContext.d.ts → useTooltipDialogContext.d.ts} +2 -3
  67. package/package.json +9 -8
  68. package/dist/esm/styled/StyledTooltipModal.js +0 -33
  69. package/dist/esm/styled/StyledTooltipModalBody.js +0 -22
  70. package/dist/esm/styled/StyledTooltipModalClose.js +0 -23
  71. package/dist/esm/styled/StyledTooltipModalFooterItem.js +0 -23
  72. package/dist/esm/styled/StyledTooltipModalTitle.js +0 -28
  73. package/dist/esm/utils/useTooltipModalContext.js +0 -18
  74. /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Body.d.ts +0 -0
  75. /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Close.d.ts +0 -0
  76. /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Footer.d.ts +0 -0
  77. /package/dist/typings/elements/{TooltipModal → TooltipDialog}/FooterItem.d.ts +0 -0
@@ -11,7 +11,7 @@ import { CSSTransition } from 'react-transition-group';
11
11
  import { useFloating, platform, offset, autoPlacement, autoUpdate } from '@floating-ui/react-dom';
12
12
  import { useModal } from '@zendeskgarden/container-modal';
13
13
  import { mergeRefs } from 'react-merge-refs';
14
- import { TooltipModalContext } from '../../utils/useTooltipModalContext.js';
14
+ import { TooltipDialogContext } from '../../utils/useTooltipDialogContext.js';
15
15
  import '../../styled/StyledBackdrop.js';
16
16
  import '../../styled/StyledBody.js';
17
17
  import '../../styled/StyledClose.js';
@@ -20,14 +20,14 @@ import '../../styled/StyledFooterItem.js';
20
20
  import '../../styled/StyledHeader.js';
21
21
  import '../../styled/StyledDangerIcon.js';
22
22
  import '../../styled/StyledModal.js';
23
- import { StyledTooltipModalBackdrop } from '../../styled/StyledTooltipModalBackdrop.js';
23
+ import { StyledTooltipDialogBackdrop } from '../../styled/StyledTooltipDialogBackdrop.js';
24
24
  import { StyledTooltipWrapper } from '../../styled/StyledTooltipWrapper.js';
25
- import { StyledTooltipModal } from '../../styled/StyledTooltipModal.js';
26
- import '../../styled/StyledTooltipModalTitle.js';
27
- import '../../styled/StyledTooltipModalBody.js';
28
- import '../../styled/StyledTooltipModalFooter.js';
29
- import '../../styled/StyledTooltipModalFooterItem.js';
30
- import '../../styled/StyledTooltipModalClose.js';
25
+ import { StyledTooltipDialog } from '../../styled/StyledTooltipDialog.js';
26
+ import '../../styled/StyledTooltipDialogTitle.js';
27
+ import '../../styled/StyledTooltipDialogBody.js';
28
+ import '../../styled/StyledTooltipDialogFooter.js';
29
+ import '../../styled/StyledTooltipDialogFooterItem.js';
30
+ import '../../styled/StyledTooltipDialogClose.js';
31
31
  import '../../styled/StyledDrawer.js';
32
32
  import '../../styled/StyledDrawerHeader.js';
33
33
  import '../../styled/StyledDrawerClose.js';
@@ -43,11 +43,12 @@ import { DEFAULT_THEME, getFloatingPlacements, useText } from '@zendeskgarden/re
43
43
  import { createPortal } from 'react-dom';
44
44
 
45
45
  const PLACEMENT_DEFAULT = 'top';
46
- const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
46
+ const TooltipDialogComponent = React__default.forwardRef((_ref, ref) => {
47
47
  let {
48
48
  appendToNode,
49
49
  referenceElement,
50
50
  placement: _placement,
51
+ offset: _offset,
51
52
  onClose,
52
53
  hasArrow,
53
54
  isAnimated,
@@ -95,7 +96,7 @@ const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
95
96
  floating: floatingElement
96
97
  },
97
98
  placement: floatingPlacement,
98
- middleware: [offset(theme.space.base * 3), _placement === 'auto' ? autoPlacement() : undefined]
99
+ middleware: [offset(_offset === undefined ? theme.space.base * 3 : _offset), _placement === 'auto' ? autoPlacement() : undefined]
99
100
  });
100
101
  useEffect(() => {
101
102
  let cleanup;
@@ -122,7 +123,7 @@ const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
122
123
  const defaultValue = hasTitle ? modalProps['aria-labelledby'] : 'Modal dialog';
123
124
  const labelValue = hasTitle ? modalProps['aria-labelledby'] : props['aria-label'];
124
125
  const ariaProps = {
125
- [attribute]: useText(TooltipModalComponent, {
126
+ [attribute]: useText(TooltipDialogComponent, {
126
127
  [attribute]: labelValue
127
128
  }, attribute, defaultValue)
128
129
  };
@@ -140,9 +141,9 @@ const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
140
141
  classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
141
142
  nodeRef: transitionRef
142
143
  }, transitionState => {
143
- return React__default.createElement(TooltipModalContext.Provider, {
144
+ return React__default.createElement(TooltipDialogContext.Provider, {
144
145
  value: value
145
- }, React__default.createElement(StyledTooltipModalBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
146
+ }, React__default.createElement(StyledTooltipDialogBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
146
147
  ref: transitionRef
147
148
  }), React__default.createElement(StyledTooltipWrapper, {
148
149
  ref: setFloatingElement,
@@ -152,7 +153,7 @@ const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
152
153
  placement: placement,
153
154
  zIndex: zIndex,
154
155
  isAnimated: isAnimated
155
- }, React__default.createElement(StyledTooltipModal, Object.assign({
156
+ }, React__default.createElement(StyledTooltipDialog, Object.assign({
156
157
  transitionState: transitionState,
157
158
  placement: placement,
158
159
  hasArrow: hasArrow,
@@ -163,14 +164,14 @@ const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
163
164
  });
164
165
  return appendToNode ? createPortal(Node, appendToNode) : Node;
165
166
  });
166
- TooltipModalComponent.displayName = 'TooltipModal';
167
- TooltipModalComponent.defaultProps = {
167
+ TooltipDialogComponent.displayName = 'TooltipDialog';
168
+ TooltipDialogComponent.defaultProps = {
168
169
  placement: 'auto',
169
170
  hasArrow: true,
170
171
  focusOnMount: true,
171
172
  restoreFocus: true
172
173
  };
173
- TooltipModalComponent.propTypes = {
174
+ TooltipDialogComponent.propTypes = {
174
175
  appendToNode: PropTypes.any,
175
176
  referenceElement: PropTypes.any,
176
177
  placement: PropTypes.any,
@@ -182,11 +183,11 @@ TooltipModalComponent.propTypes = {
182
183
  focusOnMount: PropTypes.bool,
183
184
  restoreFocus: PropTypes.bool
184
185
  };
185
- const TooltipModal = TooltipModalComponent;
186
- TooltipModal.Body = Body;
187
- TooltipModal.Close = Close;
188
- TooltipModal.Footer = Footer;
189
- TooltipModal.FooterItem = FooterItem;
190
- TooltipModal.Title = Title;
186
+ const TooltipDialog = TooltipDialogComponent;
187
+ TooltipDialog.Body = Body;
188
+ TooltipDialog.Close = Close;
189
+ TooltipDialog.Footer = Footer;
190
+ TooltipDialog.FooterItem = FooterItem;
191
+ TooltipDialog.Title = Title;
191
192
 
192
- export { TooltipModal };
193
+ export { TooltipDialog };
package/dist/esm/index.js CHANGED
@@ -10,6 +10,6 @@ export { Close } from './elements/Close.js';
10
10
  export { Footer } from './elements/Footer.js';
11
11
  export { FooterItem } from './elements/FooterItem.js';
12
12
  export { Header } from './elements/Header.js';
13
- export { TooltipModal } from './elements/TooltipModal/TooltipModal.js';
13
+ export { TooltipDialog } from './elements/TooltipDialog/TooltipDialog.js';
14
14
  export { Drawer } from './elements/Drawer/Drawer.js';
15
15
  export { PLACEMENT } from './types/index.js';
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _g, _circle;
10
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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); }
11
11
  var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _path;
10
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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); }
11
11
  var SvgXStroke = function SvgXStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import styled, { keyframes, css } from 'styled-components';
9
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
11
  const COMPONENT_ID = 'modals.backdrop';
12
12
  const animationName = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
@@ -18,14 +18,26 @@ const animationStyles = props => {
18
18
  };
19
19
  const StyledBackdrop = styled.div.attrs({
20
20
  'data-garden-id': COMPONENT_ID,
21
- 'data-garden-version': '9.0.0-next.9'
21
+ 'data-garden-version': '9.1.0'
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', props => getColorV8('neutralHue', 800, props.theme, 0.85), props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
26
- StyledBackdrop.defaultProps = {
27
- theme: DEFAULT_THEME
28
- };
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, props => retrieveComponentStyles(COMPONENT_ID, props));
29
41
  StyledBackdrop.propTypes = {
30
42
  isCentered: PropTypes.bool,
31
43
  isAnimated: PropTypes.bool
@@ -5,18 +5,23 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'modals.body';
11
11
  const StyledBody = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
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:", ";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), props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledBody.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
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, props => retrieveComponentStyles(COMPONENT_ID, props));
21
26
 
22
27
  export { StyledBody };
@@ -4,34 +4,22 @@
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
- import styled, { css } from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
+ import { IconButton } from '@zendeskgarden/react-buttons';
9
10
 
10
11
  const COMPONENT_ID = 'modals.close';
11
- const colorStyles = props => {
12
- const backgroundColor = 'primaryHue';
13
- const foregroundColor = 'neutralHue';
14
- return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], getColorV8(foregroundColor, 600, props.theme), getColorV8(backgroundColor, 600, props.theme, 0.08), getColorV8(foregroundColor, 700, props.theme), focusStyles({
15
- theme: props.theme,
16
- color: {
17
- hue: backgroundColor
18
- }
19
- }), getColorV8(backgroundColor, 600, props.theme, 0.2), getColorV8(foregroundColor, 800, props.theme));
20
- };
21
12
  const BASE_MULTIPLIERS = {
22
13
  top: 2.5,
23
14
  side: 6.5,
24
15
  size: 10
25
16
  };
26
- const StyledClose = styled.button.attrs({
17
+ const StyledClose = styled(IconButton).attrs({
27
18
  'data-garden-id': COMPONENT_ID,
28
- 'data-garden-version': '9.0.0-next.9'
19
+ 'data-garden-version': '9.1.0'
29
20
  }).withConfig({
30
21
  displayName: "StyledClose",
31
22
  componentId: "sc-iseudj-0"
32
- })(["display:block;position:absolute;top:", "px;", ":", ";transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;text-decoration:none;font-size:0;user-select:none;&::-moz-focus-inner{border:0;}", " & > svg{vertical-align:middle;}", ";"], props => props.theme.space.base * BASE_MULTIPLIERS.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
33
- StyledClose.defaultProps = {
34
- theme: DEFAULT_THEME
35
- };
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`, props => retrieveComponentStyles(COMPONENT_ID, props));
36
24
 
37
25
  export { BASE_MULTIPLIERS, StyledClose };
@@ -5,15 +5,11 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
8
  import SvgAlertErrorStroke from '../node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js';
10
9
 
11
10
  const StyledDangerIcon = styled(SvgAlertErrorStroke).withConfig({
12
11
  displayName: "StyledDangerIcon",
13
12
  componentId: "sc-1kwbb39-0"
14
13
  })(["position:absolute;top:", "px;", ":", ";"], props => props.theme.space.base * 5.5, props => props.theme.rtl ? 'right' : 'left', props => `${props.theme.space.base * 4}px`);
15
- StyledDangerIcon.defaultProps = {
16
- theme: DEFAULT_THEME
17
- };
18
14
 
19
15
  export { StyledDangerIcon };
@@ -4,33 +4,38 @@
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
- import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'modals.drawer_modal';
11
11
  const DRAWER_WIDTH = 380;
12
- const boxShadow = props => {
13
- const {
12
+ const colorStyles = _ref => {
13
+ let {
14
14
  theme
15
- } = props;
16
- const {
17
- space,
18
- shadows
19
- } = theme;
20
- const offsetY = `${space.base * 5}px`;
21
- const blurRadius = `${space.base * 7}px`;
22
- const color = getColorV8('neutralHue', 800, theme, 0.35);
23
- return shadows.lg(offsetY, blurRadius, color);
15
+ } = _ref;
16
+ const offsetY = `${theme.space.base * 5}px`;
17
+ const blurRadius = `${theme.space.base * 7}px`;
18
+ const shadowColor = getColor({
19
+ variable: 'shadow.large',
20
+ theme
21
+ });
22
+ const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
23
+ const borderColor = getColor({
24
+ theme,
25
+ variable: 'border.default'
26
+ });
27
+ const backgroundColor = getColor({
28
+ theme,
29
+ variable: 'background.raised'
30
+ });
31
+ return css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
24
32
  };
25
33
  const StyledDrawer = styled.div.attrs({
26
34
  'data-garden-id': COMPONENT_ID,
27
- 'data-garden-version': '9.0.0-next.9'
35
+ 'data-garden-version': '9.1.0'
28
36
  }).withConfig({
29
37
  displayName: "StyledDrawer",
30
38
  componentId: "sc-zp66t3-0"
31
- })(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;box-shadow:", ";background:", ";width:", "px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-drawer-transition-enter{transform:translateX(", "px);}&.garden-drawer-transition-enter-active{transform:translateX(0);transition:transform 0.25s ease-in-out;}&.garden-drawer-transition-exit-active{transform:translateX(", "px);transition:transform 0.25s ease-in-out;}&:focus{outline:none;}", ";"], props => props.theme.rtl ? 'left' : 'right', boxShadow, props => getColorV8('background', 600 , props.theme), DRAWER_WIDTH, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => retrieveComponentStyles(COMPONENT_ID, props));
32
- StyledDrawer.defaultProps = {
33
- theme: DEFAULT_THEME
34
- };
39
+ })(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;", ":", ";width:", "px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-drawer-transition-enter{transform:translateX(", "px);}&.garden-drawer-transition-enter-active{transform:translateX(0);transition:transform 0.25s ease-in-out;}&.garden-drawer-transition-exit-active{transform:translateX(", "px);transition:transform 0.25s ease-in-out;}&:focus{outline:none;}", " ", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.rtl ? 'border-right' : 'border-left', props => props.theme.borders.sm, DRAWER_WIDTH, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
35
40
 
36
41
  export { StyledDrawer };
@@ -5,19 +5,16 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledBody } from './StyledBody.js';
10
10
 
11
11
  const COMPONENT_ID = 'modals.drawer_modal.body';
12
12
  const StyledDrawerBody = styled(StyledBody).attrs({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
14
+ 'data-garden-version': '9.1.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledDrawerBody",
17
17
  componentId: "sc-13qufyn-0"
18
- })(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledDrawerBody.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
18
+ })(["padding:", "px;color-scheme:only ", ";", ";"], props => props.theme.space.base * 5, p => p.theme.colors.base, props => retrieveComponentStyles(COMPONENT_ID, props));
22
19
 
23
20
  export { StyledDrawerBody };
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledClose, BASE_MULTIPLIERS as BASE_MULTIPLIERS$1 } from './StyledClose.js';
10
10
 
11
11
  const COMPONENT_ID = 'modals.drawer_modal.close';
@@ -16,13 +16,10 @@ const BASE_MULTIPLIERS = {
16
16
  };
17
17
  const StyledDrawerClose = styled(StyledClose).attrs({
18
18
  'data-garden-id': COMPONENT_ID,
19
- 'data-garden-version': '9.0.0-next.9'
19
+ 'data-garden-version': '9.1.0'
20
20
  }).withConfig({
21
21
  displayName: "StyledDrawerClose",
22
22
  componentId: "sc-1a0xt3x-0"
23
23
  })(["", ":", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => retrieveComponentStyles(COMPONENT_ID, props));
24
- StyledDrawerClose.defaultProps = {
25
- theme: DEFAULT_THEME
26
- };
27
24
 
28
25
  export { BASE_MULTIPLIERS, StyledDrawerClose };
@@ -5,18 +5,23 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'modals.drawer_modal.footer';
11
11
  const StyledDrawerFooter = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledDrawerFooter",
16
16
  componentId: "sc-kc7e6p-0"
17
- })(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 200, props.theme)}`, props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledDrawerFooter.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], _ref => {
18
+ let {
19
+ theme
20
+ } = _ref;
21
+ return `${theme.borders.sm} ${getColor({
22
+ theme,
23
+ variable: 'border.subtle'
24
+ })}`;
25
+ }, props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
21
26
 
22
27
  export { StyledDrawerFooter };
@@ -5,19 +5,16 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledFooterItem } from './StyledFooterItem.js';
10
10
 
11
11
  const COMPONENT_ID = 'modals.drawer_modal.footer_item';
12
12
  const StyledDrawerFooterItem = styled(StyledFooterItem).attrs({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
14
+ 'data-garden-version': '9.1.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledDrawerFooterItem",
17
17
  componentId: "sc-m2yul4-0"
18
18
  })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledDrawerFooterItem.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
22
19
 
23
20
  export { StyledDrawerFooterItem };
@@ -5,20 +5,17 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
  import { StyledHeader } from './StyledHeader.js';
10
10
  import { BASE_MULTIPLIERS } from './StyledDrawerClose.js';
11
11
 
12
12
  const COMPONENT_ID = 'modals.drawer_modal.header';
13
13
  const StyledDrawerHeader = styled(StyledHeader).attrs({
14
14
  'data-garden-id': COMPONENT_ID,
15
- 'data-garden-version': '9.0.0-next.9'
15
+ 'data-garden-version': '9.1.0'
16
16
  }).withConfig({
17
17
  displayName: "StyledDrawerHeader",
18
18
  componentId: "sc-y4mgkj-0"
19
19
  })(["padding:", "px;", " ", ";"], props => props.theme.space.base * 5, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => retrieveComponentStyles(COMPONENT_ID, props));
20
- StyledDrawerHeader.defaultProps = {
21
- theme: DEFAULT_THEME
22
- };
23
20
 
24
21
  export { StyledDrawerHeader };
@@ -5,18 +5,18 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'modals.footer';
11
11
  const StyledFooter = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledFooter",
16
16
  componentId: "sc-d8pfdu-0"
17
- })(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${getColorV8('neutralHue', 200, props.theme)}`, props => props.isLarge ? `${props.theme.space.base * 8}px ${props.theme.space.base * 10}px` : `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px ${props.theme.space.base * 8}px`, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledFooter.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${getColor({
18
+ theme: props.theme,
19
+ variable: 'border.default'
20
+ })}`, props => props.isLarge ? `${props.theme.space.base * 8}px ${props.theme.space.base * 10}px` : `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px ${props.theme.space.base * 8}px`, props => retrieveComponentStyles(COMPONENT_ID, props));
21
21
 
22
22
  export { StyledFooter };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'modals.footer_item';
11
11
  const StyledFooterItem = styled.span.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledFooterItem",
16
16
  componentId: "sc-1mb76hl-0"
17
17
  })(["display:flex;margin-", ":", "px;min-width:0;&:first-child{margin-", ":0;}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 5, props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledFooterItem.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledFooterItem };
@@ -4,20 +4,32 @@
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
- import styled from 'styled-components';
8
- import { getColorV8, getLineHeight, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { getLineHeight, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9
9
  import { BASE_MULTIPLIERS } from './StyledClose.js';
10
10
 
11
11
  const COMPONENT_ID = 'modals.header';
12
+ const colorStyles = _ref => {
13
+ let {
14
+ isDanger,
15
+ theme
16
+ } = _ref;
17
+ const bottomBorderColor = getColor({
18
+ theme,
19
+ variable: 'border.subtle'
20
+ });
21
+ const color = getColor({
22
+ theme,
23
+ variable: isDanger ? 'foreground.danger' : 'foreground.default'
24
+ });
25
+ return css(["border-bottom-color:", ";color:", ";"], bottomBorderColor, color);
26
+ };
12
27
  const StyledHeader = styled.div.attrs({
13
28
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
29
+ 'data-garden-version': '9.1.0'
15
30
  }).withConfig({
16
31
  displayName: "StyledHeader",
17
32
  componentId: "sc-1787r9v-0"
18
- })(["display:block;position:", ";margin:0;border-bottom:", " ", ";padding:", ";", " line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, getColorV8('neutralHue', 200), props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.isDanger ? getColorV8('dangerHue', 600, props.theme) : getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledHeader.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
33
+ })(["display:block;position:", ";margin:0;border-bottom:", ";padding:", ";", " line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
22
34
 
23
35
  export { StyledHeader };
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import styled, { keyframes, css } from 'styled-components';
9
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, mediaQuery } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles, getColor, mediaQuery } from '@zendeskgarden/react-theming';
10
10
 
11
11
  const COMPONENT_ID = 'modals.modal';
12
12
  const animationName = keyframes(["0%{transform:scale(0);opacity:0;}50%{transform:scale(1.05);}100%{opacity:1;}"]);
@@ -16,35 +16,40 @@ const animationStyles = props => {
16
16
  }
17
17
  return '';
18
18
  };
19
- const boxShadow = props => {
20
- const {
19
+ const colorStyles = _ref => {
20
+ let {
21
21
  theme
22
- } = props;
23
- const {
24
- space,
25
- shadows
26
- } = theme;
27
- const offsetY = `${space.base * 5}px`;
28
- const blurRadius = `${space.base * 7}px`;
29
- const color = getColorV8('neutralHue', 800, theme, 0.35);
30
- return shadows.lg(offsetY, blurRadius, color);
22
+ } = _ref;
23
+ const offsetY = `${theme.space.base * 5}px`;
24
+ const blurRadius = `${theme.space.base * 7}px`;
25
+ const shadowColor = getColor({
26
+ variable: 'shadow.large',
27
+ theme
28
+ });
29
+ const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
30
+ const borderColor = getColor({
31
+ theme,
32
+ variable: 'border.default'
33
+ });
34
+ const backgroundColor = getColor({
35
+ theme,
36
+ variable: 'background.raised'
37
+ });
38
+ return css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
31
39
  };
32
40
  const sizeStyles = props => {
33
41
  return css(["", "{width:", ";}"], mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
34
42
  };
35
43
  const StyledModal = styled.div.attrs({
36
44
  'data-garden-id': COMPONENT_ID,
37
- 'data-garden-version': '9.0.0-next.9'
45
+ 'data-garden-version': '9.1.0'
38
46
  }).withConfig({
39
47
  displayName: "StyledModal",
40
48
  componentId: "sc-1pe1axu-0"
41
- })(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border-radius:", ";box-shadow:", ";background-color:", ";min-height:60px;max-height:calc(100vh - ", "px);overflow:auto;direction:", ";", ";", ";&:focus{outline:none;}@media (max-height:399px){top:", "px;bottom:auto;margin-bottom:", "px;max-height:none;}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){right:", ";bottom:", ";transform:", ";}", ";"], props => props.isCentered ? '0' : `${props.theme.space.base * 12}px`, props => props.theme.borderRadii.md, boxShadow, props => getColorV8('background', 600 , props.theme), props => props.theme.space.base * 24, props => props.theme.rtl && 'rtl', animationStyles, sizeStyles, props => props.theme.space.base * 6, props => props.theme.space.base * 6, props => props.isCentered && '50%', props => props.isCentered && '50%', props => props.isCentered && 'translate(50%, 50%)', props => retrieveComponentStyles(COMPONENT_ID, props));
49
+ })(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border:", ";border-radius:", ";min-height:60px;max-height:calc(100vh - ", "px);overflow:auto;direction:", ";", ";", ";", ";&:focus{outline:none;}@media (max-height:399px){top:", "px;bottom:auto;margin-bottom:", "px;max-height:none;}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){right:", ";bottom:", ";transform:", ";}", ";"], props => props.isCentered ? '0' : `${props.theme.space.base * 12}px`, props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => props.theme.space.base * 24, props => props.theme.rtl && 'rtl', animationStyles, sizeStyles, colorStyles, props => props.theme.space.base * 6, props => props.theme.space.base * 6, props => props.isCentered && '50%', props => props.isCentered && '50%', props => props.isCentered && 'translate(50%, 50%)', props => retrieveComponentStyles(COMPONENT_ID, props));
42
50
  StyledModal.propTypes = {
43
51
  isLarge: PropTypes.bool,
44
52
  isAnimated: PropTypes.bool
45
53
  };
46
- StyledModal.defaultProps = {
47
- theme: DEFAULT_THEME
48
- };
49
54
 
50
55
  export { StyledModal };