@zendeskgarden/react-modals 9.0.0-next.7 → 9.0.0-next.8

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/esm/elements/Body.js +42 -0
  2. package/dist/esm/elements/Close.js +53 -0
  3. package/dist/esm/elements/Drawer/Body.js +43 -0
  4. package/dist/esm/elements/Drawer/Close.js +54 -0
  5. package/dist/esm/elements/Drawer/Drawer.js +182 -0
  6. package/dist/esm/elements/Drawer/Footer.js +37 -0
  7. package/dist/esm/elements/Drawer/FooterItem.js +37 -0
  8. package/dist/esm/elements/Drawer/Header.js +69 -0
  9. package/dist/esm/elements/Footer.js +43 -0
  10. package/dist/esm/elements/FooterItem.js +36 -0
  11. package/dist/esm/elements/Header.js +70 -0
  12. package/dist/esm/elements/Modal.js +191 -0
  13. package/dist/esm/elements/TooltipModal/Body.js +43 -0
  14. package/dist/esm/elements/TooltipModal/Close.js +49 -0
  15. package/dist/esm/elements/TooltipModal/Footer.js +37 -0
  16. package/dist/esm/elements/TooltipModal/FooterItem.js +37 -0
  17. package/dist/esm/elements/TooltipModal/Title.js +68 -0
  18. package/dist/esm/elements/TooltipModal/TooltipModal.js +192 -0
  19. package/dist/esm/index.js +15 -0
  20. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
  21. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
  22. package/dist/esm/styled/StyledBackdrop.js +34 -0
  23. package/dist/esm/styled/StyledBody.js +22 -0
  24. package/dist/esm/styled/StyledClose.js +37 -0
  25. package/dist/esm/styled/StyledDangerIcon.js +19 -0
  26. package/dist/esm/styled/StyledDrawer.js +36 -0
  27. package/dist/esm/styled/StyledDrawerBody.js +23 -0
  28. package/dist/esm/styled/StyledDrawerClose.js +28 -0
  29. package/dist/esm/styled/StyledDrawerFooter.js +22 -0
  30. package/dist/esm/styled/StyledDrawerFooterItem.js +23 -0
  31. package/dist/esm/styled/StyledDrawerHeader.js +24 -0
  32. package/dist/esm/styled/StyledFooter.js +22 -0
  33. package/dist/esm/styled/StyledFooterItem.js +22 -0
  34. package/dist/esm/styled/StyledHeader.js +23 -0
  35. package/dist/esm/styled/StyledModal.js +50 -0
  36. package/dist/esm/styled/StyledTooltipModal.js +33 -0
  37. package/dist/esm/styled/StyledTooltipModalBackdrop.js +22 -0
  38. package/dist/esm/styled/StyledTooltipModalBody.js +22 -0
  39. package/dist/esm/styled/StyledTooltipModalClose.js +23 -0
  40. package/dist/esm/styled/StyledTooltipModalFooter.js +22 -0
  41. package/dist/esm/styled/StyledTooltipModalFooterItem.js +23 -0
  42. package/dist/esm/styled/StyledTooltipModalTitle.js +28 -0
  43. package/dist/esm/styled/StyledTooltipWrapper.js +25 -0
  44. package/dist/esm/types/index.js +11 -0
  45. package/dist/esm/utils/useModalContext.js +18 -0
  46. package/dist/esm/utils/useTooltipModalContext.js +18 -0
  47. package/dist/index.cjs.js +49 -63
  48. package/package.json +5 -5
  49. package/dist/index.esm.js +0 -1116
@@ -0,0 +1,26 @@
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 * as React from 'react';
8
+
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); }
11
+ var SvgXStroke = function SvgXStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ stroke: "currentColor",
21
+ strokeLinecap: "round",
22
+ d: "M3 13L13 3m0 10L3 3"
23
+ })));
24
+ };
25
+
26
+ export { SvgXStroke as default };
@@ -0,0 +1,34 @@
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 PropTypes from 'prop-types';
8
+ import styled, { keyframes, css } from 'styled-components';
9
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
10
+
11
+ const COMPONENT_ID = 'modals.backdrop';
12
+ const animationName = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
13
+ const animationStyles = props => {
14
+ if (props.isAnimated) {
15
+ return css(["animation:", " 0.15s ease-in;"], animationName);
16
+ }
17
+ return '';
18
+ };
19
+ const StyledBackdrop = styled.div.attrs({
20
+ 'data-garden-id': COMPONENT_ID,
21
+ 'data-garden-version': '9.0.0-next.8'
22
+ }).withConfig({
23
+ displayName: "StyledBackdrop",
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
+ };
29
+ StyledBackdrop.propTypes = {
30
+ isCentered: PropTypes.bool,
31
+ isAnimated: PropTypes.bool
32
+ };
33
+
34
+ export { StyledBackdrop };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.body';
11
+ const StyledBody = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledBody",
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
+ };
21
+
22
+ export { StyledBody };
@@ -0,0 +1,37 @@
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 styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
9
+
10
+ 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
+ const BASE_MULTIPLIERS = {
22
+ top: 2.5,
23
+ side: 6.5,
24
+ size: 10
25
+ };
26
+ const StyledClose = styled.button.attrs({
27
+ 'data-garden-id': COMPONENT_ID,
28
+ 'data-garden-version': '9.0.0-next.8'
29
+ }).withConfig({
30
+ displayName: "StyledClose",
31
+ 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
+ };
36
+
37
+ export { BASE_MULTIPLIERS, StyledClose };
@@ -0,0 +1,19 @@
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 styled from 'styled-components';
8
+ import { DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import SvgAlertErrorStroke from '../node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js';
10
+
11
+ const StyledDangerIcon = styled(SvgAlertErrorStroke).withConfig({
12
+ displayName: "StyledDangerIcon",
13
+ componentId: "sc-1kwbb39-0"
14
+ })(["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
+
19
+ export { StyledDangerIcon };
@@ -0,0 +1,36 @@
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 styled from 'styled-components';
8
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.drawer_modal';
11
+ const DRAWER_WIDTH = 380;
12
+ const boxShadow = props => {
13
+ const {
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);
24
+ };
25
+ const StyledDrawer = styled.div.attrs({
26
+ 'data-garden-id': COMPONENT_ID,
27
+ 'data-garden-version': '9.0.0-next.8'
28
+ }).withConfig({
29
+ displayName: "StyledDrawer",
30
+ 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
+ };
35
+
36
+ export { StyledDrawer };
@@ -0,0 +1,23 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledBody } from './StyledBody.js';
10
+
11
+ const COMPONENT_ID = 'modals.drawer_modal.body';
12
+ const StyledDrawerBody = styled(StyledBody).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.8'
15
+ }).withConfig({
16
+ displayName: "StyledDrawerBody",
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
+ };
22
+
23
+ export { StyledDrawerBody };
@@ -0,0 +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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledClose, BASE_MULTIPLIERS as BASE_MULTIPLIERS$1 } from './StyledClose.js';
10
+
11
+ const COMPONENT_ID = 'modals.drawer_modal.close';
12
+ const BASE_MULTIPLIERS = {
13
+ top: BASE_MULTIPLIERS$1.top,
14
+ side: 2,
15
+ size: BASE_MULTIPLIERS$1.size
16
+ };
17
+ const StyledDrawerClose = styled(StyledClose).attrs({
18
+ 'data-garden-id': COMPONENT_ID,
19
+ 'data-garden-version': '9.0.0-next.8'
20
+ }).withConfig({
21
+ displayName: "StyledDrawerClose",
22
+ componentId: "sc-1a0xt3x-0"
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
+
28
+ export { BASE_MULTIPLIERS, StyledDrawerClose };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.drawer_modal.footer';
11
+ const StyledDrawerFooter = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledDrawerFooter",
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
+ };
21
+
22
+ export { StyledDrawerFooter };
@@ -0,0 +1,23 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledFooterItem } from './StyledFooterItem.js';
10
+
11
+ const COMPONENT_ID = 'modals.drawer_modal.footer_item';
12
+ const StyledDrawerFooterItem = styled(StyledFooterItem).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.8'
15
+ }).withConfig({
16
+ displayName: "StyledDrawerFooterItem",
17
+ componentId: "sc-m2yul4-0"
18
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledDrawerFooterItem.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledDrawerFooterItem };
@@ -0,0 +1,24 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledHeader } from './StyledHeader.js';
10
+ import { BASE_MULTIPLIERS } from './StyledDrawerClose.js';
11
+
12
+ const COMPONENT_ID = 'modals.drawer_modal.header';
13
+ const StyledDrawerHeader = styled(StyledHeader).attrs({
14
+ 'data-garden-id': COMPONENT_ID,
15
+ 'data-garden-version': '9.0.0-next.8'
16
+ }).withConfig({
17
+ displayName: "StyledDrawerHeader",
18
+ componentId: "sc-y4mgkj-0"
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
+
24
+ export { StyledDrawerHeader };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.footer';
11
+ const StyledFooter = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledFooter",
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
+ };
21
+
22
+ export { StyledFooter };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.footer_item';
11
+ const StyledFooterItem = styled.span.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledFooterItem",
16
+ componentId: "sc-1mb76hl-0"
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
+
22
+ export { StyledFooterItem };
@@ -0,0 +1,23 @@
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 styled from 'styled-components';
8
+ import { getColorV8, getLineHeight, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { BASE_MULTIPLIERS } from './StyledClose.js';
10
+
11
+ const COMPONENT_ID = 'modals.header';
12
+ const StyledHeader = styled.div.attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.8'
15
+ }).withConfig({
16
+ displayName: "StyledHeader",
17
+ 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
+ };
22
+
23
+ export { StyledHeader };
@@ -0,0 +1,50 @@
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 PropTypes from 'prop-types';
8
+ import styled, { keyframes, css } from 'styled-components';
9
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, mediaQuery } from '@zendeskgarden/react-theming';
10
+
11
+ const COMPONENT_ID = 'modals.modal';
12
+ const animationName = keyframes(["0%{transform:scale(0);opacity:0;}50%{transform:scale(1.05);}100%{opacity:1;}"]);
13
+ const animationStyles = props => {
14
+ if (props.isAnimated) {
15
+ return css(["animation:", " 0.3s ease-in;"], animationName);
16
+ }
17
+ return '';
18
+ };
19
+ const boxShadow = props => {
20
+ const {
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);
31
+ };
32
+ const sizeStyles = props => {
33
+ return css(["", "{width:", ";}"], mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
34
+ };
35
+ const StyledModal = styled.div.attrs({
36
+ 'data-garden-id': COMPONENT_ID,
37
+ 'data-garden-version': '9.0.0-next.8'
38
+ }).withConfig({
39
+ displayName: "StyledModal",
40
+ 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));
42
+ StyledModal.propTypes = {
43
+ isLarge: PropTypes.bool,
44
+ isAnimated: PropTypes.bool
45
+ };
46
+ StyledModal.defaultProps = {
47
+ theme: DEFAULT_THEME
48
+ };
49
+
50
+ export { StyledModal };
@@ -0,0 +1,33 @@
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 styled from 'styled-components';
8
+ import { arrowStyles, getArrowPosition, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.tooltip_modal';
11
+ const StyledTooltipModal = styled.div.attrs(props => ({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8',
14
+ className: props.isAnimated && 'is-animated'
15
+ })).withConfig({
16
+ displayName: "StyledTooltipModal",
17
+ componentId: "sc-42ubfr-0"
18
+ })(["padding:", "px;width:400px;", ";", ";"], props => props.theme.space.base * 5, props => {
19
+ const computedArrowStyles = arrowStyles(getArrowPosition(props.theme, props.placement), {
20
+ size: `${props.theme.space.base * 2}px`,
21
+ inset: '1px',
22
+ animationModifier: '.is-animated'
23
+ });
24
+ if (props.isAnimated) {
25
+ return props.hasArrow && props.transitionState === 'entered' && computedArrowStyles;
26
+ }
27
+ return props.hasArrow && computedArrowStyles;
28
+ }, props => retrieveComponentStyles(COMPONENT_ID, props));
29
+ StyledTooltipModal.defaultProps = {
30
+ theme: DEFAULT_THEME
31
+ };
32
+
33
+ export { StyledTooltipModal };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.tooltip_modal.backdrop';
11
+ const StyledTooltipModalBackdrop = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledTooltipModalBackdrop",
16
+ componentId: "sc-1yaomgq-0"
17
+ })(["position:fixed;inset:0;z-index:400;overflow:hidden;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-tooltip-modal-transition-exit-active{pointer-events:none;}&.garden-tooltip-modal-transition-exit-active div{transition:opacity 200ms;opacity:0;}", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledTooltipModalBackdrop.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledTooltipModalBackdrop };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.tooltip_modal.body';
11
+ const StyledTooltipModalBody = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledTooltipModalBody",
16
+ componentId: "sc-195dkzj-0"
17
+ })(["display:block;margin:0;padding-top:", "px;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, 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
+ StyledTooltipModalBody.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledTooltipModalBody };
@@ -0,0 +1,23 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledClose } from './StyledClose.js';
10
+
11
+ const COMPONENT_ID = 'modals.tooltip_modal.close';
12
+ const StyledTooltipModalClose = styled(StyledClose).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.8'
15
+ }).withConfig({
16
+ displayName: "StyledTooltipModalClose",
17
+ componentId: "sc-1h2ke3q-0"
18
+ })(["top:", "px;", ":", ";width:", "px;height:", "px;", ";"], props => props.theme.space.base * 3.5, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * 3}px`, props => props.theme.space.base * 8, props => props.theme.space.base * 8, props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledTooltipModalClose.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledTooltipModalClose };
@@ -0,0 +1,22 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.tooltip_modal.footer';
11
+ const StyledTooltipModalFooter = styled.div.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.8'
14
+ }).withConfig({
15
+ displayName: "StyledTooltipModalFooter",
16
+ componentId: "sc-fm36a9-0"
17
+ })(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;padding-top:", "px;", ";"], p => p.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledTooltipModalFooter.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledTooltipModalFooter };
@@ -0,0 +1,23 @@
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 styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledFooterItem } from './StyledFooterItem.js';
10
+
11
+ const COMPONENT_ID = 'modals.tooltip_modal.footer_item';
12
+ const StyledTooltipModalFooterItem = styled(StyledFooterItem).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.8'
15
+ }).withConfig({
16
+ displayName: "StyledTooltipModalFooterItem",
17
+ componentId: "sc-1nahj6p-0"
18
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledTooltipModalFooterItem.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledTooltipModalFooterItem };
@@ -0,0 +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 styled from 'styled-components';
8
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, getLineHeight } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'modals.tooltip_modal.title';
11
+ const sizeStyles = props => `
12
+ /* stylelint-disable-next-line property-no-unknown */
13
+ padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
14
+ line-height: ${getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md)};
15
+ font-size: ${props.theme.fontSizes.md};
16
+ `;
17
+ const StyledTooltipModalTitle = styled.div.attrs({
18
+ 'data-garden-id': COMPONENT_ID,
19
+ 'data-garden-version': '9.0.0-next.8'
20
+ }).withConfig({
21
+ displayName: "StyledTooltipModalTitle",
22
+ componentId: "sc-11xjgjs-0"
23
+ })(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
24
+ StyledTooltipModalTitle.defaultProps = {
25
+ theme: DEFAULT_THEME
26
+ };
27
+
28
+ export { StyledTooltipModalTitle };
@@ -0,0 +1,25 @@
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 styled from 'styled-components';
8
+ import { menuStyles, getMenuPosition, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const StyledTooltipWrapper = styled.div.attrs(props => ({
11
+ className: props.isAnimated && 'is-animated'
12
+ })).withConfig({
13
+ displayName: "StyledTooltipWrapper",
14
+ componentId: "sc-1xk05kf-0"
15
+ })(["top:0;left:0;", ";"], props => menuStyles(getMenuPosition(props.placement), {
16
+ theme: props.theme,
17
+ hidden: false,
18
+ zIndex: props.zIndex,
19
+ animationModifier: '.is-animated'
20
+ }));
21
+ StyledTooltipWrapper.defaultProps = {
22
+ theme: DEFAULT_THEME
23
+ };
24
+
25
+ export { StyledTooltipWrapper };