@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.
- package/dist/esm/elements/Body.js +42 -0
- package/dist/esm/elements/Close.js +53 -0
- package/dist/esm/elements/Drawer/Body.js +43 -0
- package/dist/esm/elements/Drawer/Close.js +54 -0
- package/dist/esm/elements/Drawer/Drawer.js +182 -0
- package/dist/esm/elements/Drawer/Footer.js +37 -0
- package/dist/esm/elements/Drawer/FooterItem.js +37 -0
- package/dist/esm/elements/Drawer/Header.js +69 -0
- package/dist/esm/elements/Footer.js +43 -0
- package/dist/esm/elements/FooterItem.js +36 -0
- package/dist/esm/elements/Header.js +70 -0
- package/dist/esm/elements/Modal.js +191 -0
- package/dist/esm/elements/TooltipModal/Body.js +43 -0
- package/dist/esm/elements/TooltipModal/Close.js +49 -0
- package/dist/esm/elements/TooltipModal/Footer.js +37 -0
- package/dist/esm/elements/TooltipModal/FooterItem.js +37 -0
- package/dist/esm/elements/TooltipModal/Title.js +68 -0
- package/dist/esm/elements/TooltipModal/TooltipModal.js +192 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/StyledBackdrop.js +34 -0
- package/dist/esm/styled/StyledBody.js +22 -0
- package/dist/esm/styled/StyledClose.js +37 -0
- package/dist/esm/styled/StyledDangerIcon.js +19 -0
- package/dist/esm/styled/StyledDrawer.js +36 -0
- package/dist/esm/styled/StyledDrawerBody.js +23 -0
- package/dist/esm/styled/StyledDrawerClose.js +28 -0
- package/dist/esm/styled/StyledDrawerFooter.js +22 -0
- package/dist/esm/styled/StyledDrawerFooterItem.js +23 -0
- package/dist/esm/styled/StyledDrawerHeader.js +24 -0
- package/dist/esm/styled/StyledFooter.js +22 -0
- package/dist/esm/styled/StyledFooterItem.js +22 -0
- package/dist/esm/styled/StyledHeader.js +23 -0
- package/dist/esm/styled/StyledModal.js +50 -0
- package/dist/esm/styled/StyledTooltipModal.js +33 -0
- package/dist/esm/styled/StyledTooltipModalBackdrop.js +22 -0
- package/dist/esm/styled/StyledTooltipModalBody.js +22 -0
- package/dist/esm/styled/StyledTooltipModalClose.js +23 -0
- package/dist/esm/styled/StyledTooltipModalFooter.js +22 -0
- package/dist/esm/styled/StyledTooltipModalFooterItem.js +23 -0
- package/dist/esm/styled/StyledTooltipModalTitle.js +28 -0
- package/dist/esm/styled/StyledTooltipWrapper.js +25 -0
- package/dist/esm/types/index.js +11 -0
- package/dist/esm/utils/useModalContext.js +18 -0
- package/dist/esm/utils/useTooltipModalContext.js +18 -0
- package/dist/index.cjs.js +49 -63
- package/package.json +5 -5
- package/dist/index.esm.js +0 -1116
package/dist/index.esm.js
DELETED
|
@@ -1,1116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import React__default, { createContext, useContext, forwardRef, useEffect, useRef, useState, useMemo } from 'react';
|
|
10
|
-
import ReactDOM, { createPortal } from 'react-dom';
|
|
11
|
-
import styled, { keyframes, css, ThemeContext } from 'styled-components';
|
|
12
|
-
import PropTypes from 'prop-types';
|
|
13
|
-
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, getLineHeight, focusStyles, mediaQuery, menuStyles, getMenuPosition, arrowStyles, getArrowPosition, useText, useDocument, getFloatingPlacements, PLACEMENT as PLACEMENT$1 } from '@zendeskgarden/react-theming';
|
|
14
|
-
import { useModal } from '@zendeskgarden/container-modal';
|
|
15
|
-
import { mergeRefs } from 'react-merge-refs';
|
|
16
|
-
import isWindow from 'dom-helpers/isWindow';
|
|
17
|
-
import ownerDocument from 'dom-helpers/ownerDocument';
|
|
18
|
-
import ownerWindow from 'dom-helpers/ownerWindow';
|
|
19
|
-
import css$1 from 'dom-helpers/css';
|
|
20
|
-
import getScrollbarSize from 'dom-helpers/scrollbarSize';
|
|
21
|
-
import { CSSTransition } from 'react-transition-group';
|
|
22
|
-
import { useFloating, platform, offset, autoPlacement, autoUpdate } from '@floating-ui/react-dom';
|
|
23
|
-
import activeElement from 'dom-helpers/activeElement';
|
|
24
|
-
|
|
25
|
-
function _extends$2() {
|
|
26
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
27
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
28
|
-
var source = arguments[i];
|
|
29
|
-
for (var key in source) {
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
31
|
-
target[key] = source[key];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
|
-
return _extends$2.apply(this, arguments);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const COMPONENT_ID$j = 'modals.backdrop';
|
|
41
|
-
const animationName$1 = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
42
|
-
const animationStyles$1 = props => {
|
|
43
|
-
if (props.isAnimated) {
|
|
44
|
-
return css(["animation:", " 0.15s ease-in;"], animationName$1);
|
|
45
|
-
}
|
|
46
|
-
return '';
|
|
47
|
-
};
|
|
48
|
-
const StyledBackdrop = styled.div.attrs({
|
|
49
|
-
'data-garden-id': COMPONENT_ID$j,
|
|
50
|
-
'data-garden-version': '9.0.0-next.7'
|
|
51
|
-
}).withConfig({
|
|
52
|
-
displayName: "StyledBackdrop",
|
|
53
|
-
componentId: "sc-mzdjpo-0"
|
|
54
|
-
})(["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$1, props => retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
55
|
-
StyledBackdrop.defaultProps = {
|
|
56
|
-
theme: DEFAULT_THEME
|
|
57
|
-
};
|
|
58
|
-
StyledBackdrop.propTypes = {
|
|
59
|
-
isCentered: PropTypes.bool,
|
|
60
|
-
isAnimated: PropTypes.bool
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const COMPONENT_ID$i = 'modals.body';
|
|
64
|
-
const StyledBody = styled.div.attrs({
|
|
65
|
-
'data-garden-id': COMPONENT_ID$i,
|
|
66
|
-
'data-garden-version': '9.0.0-next.7'
|
|
67
|
-
}).withConfig({
|
|
68
|
-
displayName: "StyledBody",
|
|
69
|
-
componentId: "sc-14rzecg-0"
|
|
70
|
-
})(["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$i, props));
|
|
71
|
-
StyledBody.defaultProps = {
|
|
72
|
-
theme: DEFAULT_THEME
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const COMPONENT_ID$h = 'modals.close';
|
|
76
|
-
const colorStyles = props => {
|
|
77
|
-
const backgroundColor = 'primaryHue';
|
|
78
|
-
const foregroundColor = 'neutralHue';
|
|
79
|
-
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({
|
|
80
|
-
theme: props.theme,
|
|
81
|
-
hue: backgroundColor
|
|
82
|
-
}), getColorV8(backgroundColor, 600, props.theme, 0.2), getColorV8(foregroundColor, 800, props.theme));
|
|
83
|
-
};
|
|
84
|
-
const BASE_MULTIPLIERS$1 = {
|
|
85
|
-
top: 2.5,
|
|
86
|
-
side: 6.5,
|
|
87
|
-
size: 10
|
|
88
|
-
};
|
|
89
|
-
const StyledClose = styled.button.attrs({
|
|
90
|
-
'data-garden-id': COMPONENT_ID$h,
|
|
91
|
-
'data-garden-version': '9.0.0-next.7'
|
|
92
|
-
}).withConfig({
|
|
93
|
-
displayName: "StyledClose",
|
|
94
|
-
componentId: "sc-iseudj-0"
|
|
95
|
-
})(["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$1.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS$1.side}px`, props => props.theme.space.base * BASE_MULTIPLIERS$1.size, props => props.theme.space.base * BASE_MULTIPLIERS$1.size, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
96
|
-
StyledClose.defaultProps = {
|
|
97
|
-
theme: DEFAULT_THEME
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const COMPONENT_ID$g = 'modals.footer';
|
|
101
|
-
const StyledFooter = styled.div.attrs({
|
|
102
|
-
'data-garden-id': COMPONENT_ID$g,
|
|
103
|
-
'data-garden-version': '9.0.0-next.7'
|
|
104
|
-
}).withConfig({
|
|
105
|
-
displayName: "StyledFooter",
|
|
106
|
-
componentId: "sc-d8pfdu-0"
|
|
107
|
-
})(["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$g, props));
|
|
108
|
-
StyledFooter.defaultProps = {
|
|
109
|
-
theme: DEFAULT_THEME
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const COMPONENT_ID$f = 'modals.footer_item';
|
|
113
|
-
const StyledFooterItem = styled.span.attrs({
|
|
114
|
-
'data-garden-id': COMPONENT_ID$f,
|
|
115
|
-
'data-garden-version': '9.0.0-next.7'
|
|
116
|
-
}).withConfig({
|
|
117
|
-
displayName: "StyledFooterItem",
|
|
118
|
-
componentId: "sc-1mb76hl-0"
|
|
119
|
-
})(["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$f, props));
|
|
120
|
-
StyledFooterItem.defaultProps = {
|
|
121
|
-
theme: DEFAULT_THEME
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const COMPONENT_ID$e = 'modals.header';
|
|
125
|
-
const StyledHeader = styled.div.attrs({
|
|
126
|
-
'data-garden-id': COMPONENT_ID$e,
|
|
127
|
-
'data-garden-version': '9.0.0-next.7'
|
|
128
|
-
}).withConfig({
|
|
129
|
-
displayName: "StyledHeader",
|
|
130
|
-
componentId: "sc-1787r9v-0"
|
|
131
|
-
})(["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$1.size + BASE_MULTIPLIERS$1.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$e, props));
|
|
132
|
-
StyledHeader.defaultProps = {
|
|
133
|
-
theme: DEFAULT_THEME
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
var _g, _circle;
|
|
137
|
-
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
|
|
138
|
-
var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
139
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
140
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
141
|
-
width: 16,
|
|
142
|
-
height: 16,
|
|
143
|
-
focusable: "false",
|
|
144
|
-
viewBox: "0 0 16 16",
|
|
145
|
-
"aria-hidden": "true"
|
|
146
|
-
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
147
|
-
fill: "none",
|
|
148
|
-
stroke: "currentColor"
|
|
149
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
150
|
-
cx: 7.5,
|
|
151
|
-
cy: 8.5,
|
|
152
|
-
r: 7
|
|
153
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
154
|
-
strokeLinecap: "round",
|
|
155
|
-
d: "M7.5 4.5V9"
|
|
156
|
-
}))), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
|
|
157
|
-
cx: 7.5,
|
|
158
|
-
cy: 12,
|
|
159
|
-
r: 1,
|
|
160
|
-
fill: "currentColor"
|
|
161
|
-
})));
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const StyledDangerIcon = styled(SvgAlertErrorStroke).withConfig({
|
|
165
|
-
displayName: "StyledDangerIcon",
|
|
166
|
-
componentId: "sc-1kwbb39-0"
|
|
167
|
-
})(["position:absolute;top:", "px;", ":", ";"], props => props.theme.space.base * 5.5, props => props.theme.rtl ? 'right' : 'left', props => `${props.theme.space.base * 4}px`);
|
|
168
|
-
StyledDangerIcon.defaultProps = {
|
|
169
|
-
theme: DEFAULT_THEME
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const COMPONENT_ID$d = 'modals.modal';
|
|
173
|
-
const animationName = keyframes(["0%{transform:scale(0);opacity:0;}50%{transform:scale(1.05);}100%{opacity:1;}"]);
|
|
174
|
-
const animationStyles = props => {
|
|
175
|
-
if (props.isAnimated) {
|
|
176
|
-
return css(["animation:", " 0.3s ease-in;"], animationName);
|
|
177
|
-
}
|
|
178
|
-
return '';
|
|
179
|
-
};
|
|
180
|
-
const boxShadow$1 = props => {
|
|
181
|
-
const {
|
|
182
|
-
theme
|
|
183
|
-
} = props;
|
|
184
|
-
const {
|
|
185
|
-
space,
|
|
186
|
-
shadows
|
|
187
|
-
} = theme;
|
|
188
|
-
const offsetY = `${space.base * 5}px`;
|
|
189
|
-
const blurRadius = `${space.base * 7}px`;
|
|
190
|
-
const color = getColorV8('neutralHue', 800, theme, 0.35);
|
|
191
|
-
return shadows.lg(offsetY, blurRadius, color);
|
|
192
|
-
};
|
|
193
|
-
const sizeStyles$1 = props => {
|
|
194
|
-
return css(["", "{width:", ";}"], mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
|
|
195
|
-
};
|
|
196
|
-
const StyledModal = styled.div.attrs({
|
|
197
|
-
'data-garden-id': COMPONENT_ID$d,
|
|
198
|
-
'data-garden-version': '9.0.0-next.7'
|
|
199
|
-
}).withConfig({
|
|
200
|
-
displayName: "StyledModal",
|
|
201
|
-
componentId: "sc-1pe1axu-0"
|
|
202
|
-
})(["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$1, props => getColorV8('background', 600 , props.theme), props => props.theme.space.base * 24, props => props.theme.rtl && 'rtl', animationStyles, sizeStyles$1, 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$d, props));
|
|
203
|
-
StyledModal.propTypes = {
|
|
204
|
-
isLarge: PropTypes.bool,
|
|
205
|
-
isAnimated: PropTypes.bool
|
|
206
|
-
};
|
|
207
|
-
StyledModal.defaultProps = {
|
|
208
|
-
theme: DEFAULT_THEME
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const COMPONENT_ID$c = 'modals.tooltip_modal.backdrop';
|
|
212
|
-
const StyledTooltipModalBackdrop = styled.div.attrs({
|
|
213
|
-
'data-garden-id': COMPONENT_ID$c,
|
|
214
|
-
'data-garden-version': '9.0.0-next.7'
|
|
215
|
-
}).withConfig({
|
|
216
|
-
displayName: "StyledTooltipModalBackdrop",
|
|
217
|
-
componentId: "sc-1yaomgq-0"
|
|
218
|
-
})(["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$c, props));
|
|
219
|
-
StyledTooltipModalBackdrop.defaultProps = {
|
|
220
|
-
theme: DEFAULT_THEME
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const StyledTooltipWrapper = styled.div.attrs(props => ({
|
|
224
|
-
className: props.isAnimated && 'is-animated'
|
|
225
|
-
})).withConfig({
|
|
226
|
-
displayName: "StyledTooltipWrapper",
|
|
227
|
-
componentId: "sc-1xk05kf-0"
|
|
228
|
-
})(["top:0;left:0;", ";"], props => menuStyles(getMenuPosition(props.placement), {
|
|
229
|
-
theme: props.theme,
|
|
230
|
-
hidden: false,
|
|
231
|
-
zIndex: props.zIndex,
|
|
232
|
-
animationModifier: '.is-animated'
|
|
233
|
-
}));
|
|
234
|
-
StyledTooltipWrapper.defaultProps = {
|
|
235
|
-
theme: DEFAULT_THEME
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const COMPONENT_ID$b = 'modals.tooltip_modal';
|
|
239
|
-
const StyledTooltipModal = styled.div.attrs(props => ({
|
|
240
|
-
'data-garden-id': COMPONENT_ID$b,
|
|
241
|
-
'data-garden-version': '9.0.0-next.7',
|
|
242
|
-
className: props.isAnimated && 'is-animated'
|
|
243
|
-
})).withConfig({
|
|
244
|
-
displayName: "StyledTooltipModal",
|
|
245
|
-
componentId: "sc-42ubfr-0"
|
|
246
|
-
})(["padding:", "px;width:400px;", ";", ";"], props => props.theme.space.base * 5, props => {
|
|
247
|
-
const computedArrowStyles = arrowStyles(getArrowPosition(props.theme, props.placement), {
|
|
248
|
-
size: `${props.theme.space.base * 2}px`,
|
|
249
|
-
inset: '1px',
|
|
250
|
-
animationModifier: '.is-animated'
|
|
251
|
-
});
|
|
252
|
-
if (props.isAnimated) {
|
|
253
|
-
return props.hasArrow && props.transitionState === 'entered' && computedArrowStyles;
|
|
254
|
-
}
|
|
255
|
-
return props.hasArrow && computedArrowStyles;
|
|
256
|
-
}, props => retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
257
|
-
StyledTooltipModal.defaultProps = {
|
|
258
|
-
theme: DEFAULT_THEME
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
const COMPONENT_ID$a = 'modals.tooltip_modal.title';
|
|
262
|
-
const sizeStyles = props => `
|
|
263
|
-
/* stylelint-disable-next-line property-no-unknown */
|
|
264
|
-
padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
|
|
265
|
-
line-height: ${getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md)};
|
|
266
|
-
font-size: ${props.theme.fontSizes.md};
|
|
267
|
-
`;
|
|
268
|
-
const StyledTooltipModalTitle = styled.div.attrs({
|
|
269
|
-
'data-garden-id': COMPONENT_ID$a,
|
|
270
|
-
'data-garden-version': '9.0.0-next.7'
|
|
271
|
-
}).withConfig({
|
|
272
|
-
displayName: "StyledTooltipModalTitle",
|
|
273
|
-
componentId: "sc-11xjgjs-0"
|
|
274
|
-
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
275
|
-
StyledTooltipModalTitle.defaultProps = {
|
|
276
|
-
theme: DEFAULT_THEME
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
280
|
-
const StyledTooltipModalBody = styled.div.attrs({
|
|
281
|
-
'data-garden-id': COMPONENT_ID$9,
|
|
282
|
-
'data-garden-version': '9.0.0-next.7'
|
|
283
|
-
}).withConfig({
|
|
284
|
-
displayName: "StyledTooltipModalBody",
|
|
285
|
-
componentId: "sc-195dkzj-0"
|
|
286
|
-
})(["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$9, props));
|
|
287
|
-
StyledTooltipModalBody.defaultProps = {
|
|
288
|
-
theme: DEFAULT_THEME
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
const COMPONENT_ID$8 = 'modals.tooltip_modal.footer';
|
|
292
|
-
const StyledTooltipModalFooter = styled.div.attrs({
|
|
293
|
-
'data-garden-id': COMPONENT_ID$8,
|
|
294
|
-
'data-garden-version': '9.0.0-next.7'
|
|
295
|
-
}).withConfig({
|
|
296
|
-
displayName: "StyledTooltipModalFooter",
|
|
297
|
-
componentId: "sc-fm36a9-0"
|
|
298
|
-
})(["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$8, props));
|
|
299
|
-
StyledTooltipModalFooter.defaultProps = {
|
|
300
|
-
theme: DEFAULT_THEME
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
const COMPONENT_ID$7 = 'modals.tooltip_modal.footer_item';
|
|
304
|
-
const StyledTooltipModalFooterItem = styled(StyledFooterItem).attrs({
|
|
305
|
-
'data-garden-id': COMPONENT_ID$7,
|
|
306
|
-
'data-garden-version': '9.0.0-next.7'
|
|
307
|
-
}).withConfig({
|
|
308
|
-
displayName: "StyledTooltipModalFooterItem",
|
|
309
|
-
componentId: "sc-1nahj6p-0"
|
|
310
|
-
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
311
|
-
StyledTooltipModalFooterItem.defaultProps = {
|
|
312
|
-
theme: DEFAULT_THEME
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
const COMPONENT_ID$6 = 'modals.tooltip_modal.close';
|
|
316
|
-
const StyledTooltipModalClose = styled(StyledClose).attrs({
|
|
317
|
-
'data-garden-id': COMPONENT_ID$6,
|
|
318
|
-
'data-garden-version': '9.0.0-next.7'
|
|
319
|
-
}).withConfig({
|
|
320
|
-
displayName: "StyledTooltipModalClose",
|
|
321
|
-
componentId: "sc-1h2ke3q-0"
|
|
322
|
-
})(["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$6, props));
|
|
323
|
-
StyledTooltipModalClose.defaultProps = {
|
|
324
|
-
theme: DEFAULT_THEME
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
const COMPONENT_ID$5 = 'modals.drawer_modal';
|
|
328
|
-
const DRAWER_WIDTH = 380;
|
|
329
|
-
const boxShadow = props => {
|
|
330
|
-
const {
|
|
331
|
-
theme
|
|
332
|
-
} = props;
|
|
333
|
-
const {
|
|
334
|
-
space,
|
|
335
|
-
shadows
|
|
336
|
-
} = theme;
|
|
337
|
-
const offsetY = `${space.base * 5}px`;
|
|
338
|
-
const blurRadius = `${space.base * 7}px`;
|
|
339
|
-
const color = getColorV8('neutralHue', 800, theme, 0.35);
|
|
340
|
-
return shadows.lg(offsetY, blurRadius, color);
|
|
341
|
-
};
|
|
342
|
-
const StyledDrawer = styled.div.attrs({
|
|
343
|
-
'data-garden-id': COMPONENT_ID$5,
|
|
344
|
-
'data-garden-version': '9.0.0-next.7'
|
|
345
|
-
}).withConfig({
|
|
346
|
-
displayName: "StyledDrawer",
|
|
347
|
-
componentId: "sc-zp66t3-0"
|
|
348
|
-
})(["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$5, props));
|
|
349
|
-
StyledDrawer.defaultProps = {
|
|
350
|
-
theme: DEFAULT_THEME
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
const COMPONENT_ID$4 = 'modals.drawer_modal.close';
|
|
354
|
-
const BASE_MULTIPLIERS = {
|
|
355
|
-
top: BASE_MULTIPLIERS$1.top,
|
|
356
|
-
side: 2,
|
|
357
|
-
size: BASE_MULTIPLIERS$1.size
|
|
358
|
-
};
|
|
359
|
-
const StyledDrawerClose = styled(StyledClose).attrs({
|
|
360
|
-
'data-garden-id': COMPONENT_ID$4,
|
|
361
|
-
'data-garden-version': '9.0.0-next.7'
|
|
362
|
-
}).withConfig({
|
|
363
|
-
displayName: "StyledDrawerClose",
|
|
364
|
-
componentId: "sc-1a0xt3x-0"
|
|
365
|
-
})(["", ":", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
366
|
-
StyledDrawerClose.defaultProps = {
|
|
367
|
-
theme: DEFAULT_THEME
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
371
|
-
const StyledDrawerHeader = styled(StyledHeader).attrs({
|
|
372
|
-
'data-garden-id': COMPONENT_ID$3,
|
|
373
|
-
'data-garden-version': '9.0.0-next.7'
|
|
374
|
-
}).withConfig({
|
|
375
|
-
displayName: "StyledDrawerHeader",
|
|
376
|
-
componentId: "sc-y4mgkj-0"
|
|
377
|
-
})(["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$3, props));
|
|
378
|
-
StyledDrawerHeader.defaultProps = {
|
|
379
|
-
theme: DEFAULT_THEME
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
383
|
-
const StyledDrawerBody = styled(StyledBody).attrs({
|
|
384
|
-
'data-garden-id': COMPONENT_ID$2,
|
|
385
|
-
'data-garden-version': '9.0.0-next.7'
|
|
386
|
-
}).withConfig({
|
|
387
|
-
displayName: "StyledDrawerBody",
|
|
388
|
-
componentId: "sc-13qufyn-0"
|
|
389
|
-
})(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
390
|
-
StyledDrawerBody.defaultProps = {
|
|
391
|
-
theme: DEFAULT_THEME
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
395
|
-
const StyledDrawerFooter = styled.div.attrs({
|
|
396
|
-
'data-garden-id': COMPONENT_ID$1,
|
|
397
|
-
'data-garden-version': '9.0.0-next.7'
|
|
398
|
-
}).withConfig({
|
|
399
|
-
displayName: "StyledDrawerFooter",
|
|
400
|
-
componentId: "sc-kc7e6p-0"
|
|
401
|
-
})(["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$1, props));
|
|
402
|
-
StyledDrawerFooter.defaultProps = {
|
|
403
|
-
theme: DEFAULT_THEME
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
407
|
-
const StyledDrawerFooterItem = styled(StyledFooterItem).attrs({
|
|
408
|
-
'data-garden-id': COMPONENT_ID,
|
|
409
|
-
'data-garden-version': '9.0.0-next.7'
|
|
410
|
-
}).withConfig({
|
|
411
|
-
displayName: "StyledDrawerFooterItem",
|
|
412
|
-
componentId: "sc-m2yul4-0"
|
|
413
|
-
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
414
|
-
StyledDrawerFooterItem.defaultProps = {
|
|
415
|
-
theme: DEFAULT_THEME
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
const ModalsContext = createContext(undefined);
|
|
419
|
-
const useModalContext = () => {
|
|
420
|
-
const context = useContext(ModalsContext);
|
|
421
|
-
if (context === undefined) {
|
|
422
|
-
throw new Error('useModalContext must be used within a ModalsContext.Provider');
|
|
423
|
-
}
|
|
424
|
-
return context;
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
const Body$2 = forwardRef((props, ref) => {
|
|
428
|
-
const {
|
|
429
|
-
getContentProps
|
|
430
|
-
} = useModalContext();
|
|
431
|
-
return React__default.createElement(StyledBody, _extends$2({}, getContentProps(props), {
|
|
432
|
-
ref: ref
|
|
433
|
-
}));
|
|
434
|
-
});
|
|
435
|
-
Body$2.displayName = 'Body';
|
|
436
|
-
|
|
437
|
-
var _path;
|
|
438
|
-
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); }
|
|
439
|
-
var SvgXStroke = function SvgXStroke(props) {
|
|
440
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
441
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
442
|
-
width: 16,
|
|
443
|
-
height: 16,
|
|
444
|
-
focusable: "false",
|
|
445
|
-
viewBox: "0 0 16 16",
|
|
446
|
-
"aria-hidden": "true"
|
|
447
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
448
|
-
stroke: "currentColor",
|
|
449
|
-
strokeLinecap: "round",
|
|
450
|
-
d: "M3 13L13 3m0 10L3 3"
|
|
451
|
-
})));
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
const Close$2 = forwardRef((props, ref) => {
|
|
455
|
-
const {
|
|
456
|
-
getCloseProps,
|
|
457
|
-
setIsCloseButtonPresent
|
|
458
|
-
} = useModalContext();
|
|
459
|
-
useEffect(() => {
|
|
460
|
-
setIsCloseButtonPresent(true);
|
|
461
|
-
return () => setIsCloseButtonPresent(false);
|
|
462
|
-
});
|
|
463
|
-
const ariaLabel = useText(Close$2, props, 'aria-label', 'Close modal');
|
|
464
|
-
return React__default.createElement(StyledClose, _extends$2({}, getCloseProps({
|
|
465
|
-
...props,
|
|
466
|
-
'aria-label': ariaLabel
|
|
467
|
-
}), {
|
|
468
|
-
ref: ref
|
|
469
|
-
}), React__default.createElement(SvgXStroke, null));
|
|
470
|
-
});
|
|
471
|
-
Close$2.displayName = 'Close';
|
|
472
|
-
|
|
473
|
-
const Footer$2 = React__default.forwardRef((props, ref) => {
|
|
474
|
-
const {
|
|
475
|
-
isLarge
|
|
476
|
-
} = useModalContext();
|
|
477
|
-
return React__default.createElement(StyledFooter, _extends$2({
|
|
478
|
-
ref: ref,
|
|
479
|
-
isLarge: isLarge
|
|
480
|
-
}, props));
|
|
481
|
-
});
|
|
482
|
-
Footer$2.displayName = 'Footer';
|
|
483
|
-
|
|
484
|
-
const FooterItem$2 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, _extends$2({
|
|
485
|
-
ref: ref
|
|
486
|
-
}, props)));
|
|
487
|
-
FooterItem$2.displayName = 'FooterItem';
|
|
488
|
-
|
|
489
|
-
const Header$1 = forwardRef((_ref, ref) => {
|
|
490
|
-
let {
|
|
491
|
-
children,
|
|
492
|
-
tag,
|
|
493
|
-
...other
|
|
494
|
-
} = _ref;
|
|
495
|
-
const {
|
|
496
|
-
isCloseButtonPresent,
|
|
497
|
-
hasHeader,
|
|
498
|
-
setHasHeader,
|
|
499
|
-
getTitleProps
|
|
500
|
-
} = useModalContext();
|
|
501
|
-
useEffect(() => {
|
|
502
|
-
if (!hasHeader && setHasHeader) {
|
|
503
|
-
setHasHeader(true);
|
|
504
|
-
}
|
|
505
|
-
return () => {
|
|
506
|
-
if (hasHeader && setHasHeader) {
|
|
507
|
-
setHasHeader(false);
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
}, [hasHeader, setHasHeader]);
|
|
511
|
-
return React__default.createElement(StyledHeader, _extends$2({}, getTitleProps(other), {
|
|
512
|
-
as: tag,
|
|
513
|
-
isCloseButtonPresent: isCloseButtonPresent,
|
|
514
|
-
ref: ref
|
|
515
|
-
}), other.isDanger && React__default.createElement(StyledDangerIcon, null), children);
|
|
516
|
-
});
|
|
517
|
-
Header$1.displayName = 'Header';
|
|
518
|
-
Header$1.propTypes = {
|
|
519
|
-
isDanger: PropTypes.bool,
|
|
520
|
-
tag: PropTypes.any
|
|
521
|
-
};
|
|
522
|
-
Header$1.defaultProps = {
|
|
523
|
-
tag: 'div'
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
const isOverflowing = element => {
|
|
527
|
-
const doc = ownerDocument(element);
|
|
528
|
-
const win = ownerWindow(doc);
|
|
529
|
-
const isBody = element && element.tagName.toLowerCase() === 'body';
|
|
530
|
-
if (!isWindow(doc) && !isBody) {
|
|
531
|
-
return element.scrollHeight > element.clientHeight;
|
|
532
|
-
}
|
|
533
|
-
const style = win.getComputedStyle(doc.body);
|
|
534
|
-
const marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);
|
|
535
|
-
const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
|
|
536
|
-
return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
|
|
537
|
-
};
|
|
538
|
-
const ModalComponent = forwardRef((_ref, ref) => {
|
|
539
|
-
let {
|
|
540
|
-
backdropProps,
|
|
541
|
-
children,
|
|
542
|
-
onClose,
|
|
543
|
-
isLarge,
|
|
544
|
-
isCentered,
|
|
545
|
-
isAnimated,
|
|
546
|
-
id,
|
|
547
|
-
appendToNode,
|
|
548
|
-
focusOnMount,
|
|
549
|
-
restoreFocus,
|
|
550
|
-
...modalProps
|
|
551
|
-
} = _ref;
|
|
552
|
-
const theme = useContext(ThemeContext);
|
|
553
|
-
const modalRef = useRef(null);
|
|
554
|
-
const environment = useDocument(theme);
|
|
555
|
-
const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
|
|
556
|
-
const [hasHeader, setHasHeader] = useState(false);
|
|
557
|
-
const {
|
|
558
|
-
getBackdropProps,
|
|
559
|
-
getModalProps,
|
|
560
|
-
getTitleProps,
|
|
561
|
-
getContentProps,
|
|
562
|
-
getCloseProps
|
|
563
|
-
} = useModal({
|
|
564
|
-
idPrefix: id,
|
|
565
|
-
onClose,
|
|
566
|
-
modalRef,
|
|
567
|
-
focusOnMount,
|
|
568
|
-
restoreFocus
|
|
569
|
-
});
|
|
570
|
-
useEffect(() => {
|
|
571
|
-
if (!environment) {
|
|
572
|
-
return undefined;
|
|
573
|
-
}
|
|
574
|
-
const htmlElement = environment.querySelector('html');
|
|
575
|
-
const bodyElement = environment.querySelector('body');
|
|
576
|
-
let previousHtmlOverflow;
|
|
577
|
-
let previousBodyPaddingRight;
|
|
578
|
-
if (bodyElement) {
|
|
579
|
-
if (isOverflowing(bodyElement)) {
|
|
580
|
-
const scrollbarSize = getScrollbarSize();
|
|
581
|
-
const bodyPaddingRight = parseInt(css$1(bodyElement, 'paddingRight') || '0', 10);
|
|
582
|
-
previousBodyPaddingRight = bodyElement.style.paddingRight;
|
|
583
|
-
bodyElement.style.paddingRight = `${bodyPaddingRight + scrollbarSize}px`;
|
|
584
|
-
}
|
|
585
|
-
if (htmlElement) {
|
|
586
|
-
previousHtmlOverflow = htmlElement.style.overflow;
|
|
587
|
-
htmlElement.style.overflow = 'hidden';
|
|
588
|
-
}
|
|
589
|
-
return () => {
|
|
590
|
-
if (htmlElement) {
|
|
591
|
-
htmlElement.style.overflow = previousHtmlOverflow;
|
|
592
|
-
}
|
|
593
|
-
bodyElement.style.paddingRight = previousBodyPaddingRight;
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
return undefined;
|
|
597
|
-
}, [environment]);
|
|
598
|
-
const rootNode = useMemo(() => {
|
|
599
|
-
if (appendToNode) {
|
|
600
|
-
return appendToNode;
|
|
601
|
-
}
|
|
602
|
-
if (environment) {
|
|
603
|
-
return environment.body;
|
|
604
|
-
}
|
|
605
|
-
return undefined;
|
|
606
|
-
}, [appendToNode, environment]);
|
|
607
|
-
const value = useMemo(() => ({
|
|
608
|
-
isLarge,
|
|
609
|
-
isCloseButtonPresent,
|
|
610
|
-
hasHeader,
|
|
611
|
-
setHasHeader,
|
|
612
|
-
getTitleProps,
|
|
613
|
-
getContentProps,
|
|
614
|
-
getCloseProps,
|
|
615
|
-
setIsCloseButtonPresent
|
|
616
|
-
}), [isLarge, hasHeader, isCloseButtonPresent, getTitleProps, getContentProps, getCloseProps]);
|
|
617
|
-
const modalContainerProps = getModalProps({
|
|
618
|
-
'aria-describedby': undefined,
|
|
619
|
-
...(hasHeader ? {} : {
|
|
620
|
-
'aria-labelledby': undefined
|
|
621
|
-
})
|
|
622
|
-
});
|
|
623
|
-
const attribute = hasHeader ? 'aria-labelledby' : 'aria-label';
|
|
624
|
-
const defaultValue = hasHeader ? modalContainerProps['aria-labelledby'] : 'Modal dialog';
|
|
625
|
-
const labelValue = hasHeader ? modalContainerProps['aria-labelledby'] : modalProps['aria-label'];
|
|
626
|
-
const ariaProps = {
|
|
627
|
-
[attribute]: useText(ModalComponent, {
|
|
628
|
-
[attribute]: labelValue
|
|
629
|
-
}, attribute, defaultValue)
|
|
630
|
-
};
|
|
631
|
-
if (!rootNode) {
|
|
632
|
-
return null;
|
|
633
|
-
}
|
|
634
|
-
return createPortal( React__default.createElement(ModalsContext.Provider, {
|
|
635
|
-
value: value
|
|
636
|
-
}, React__default.createElement(StyledBackdrop, _extends$2({
|
|
637
|
-
isCentered: isCentered,
|
|
638
|
-
isAnimated: isAnimated
|
|
639
|
-
}, getBackdropProps(backdropProps)), React__default.createElement(StyledModal, _extends$2({
|
|
640
|
-
isCentered: isCentered,
|
|
641
|
-
isAnimated: isAnimated,
|
|
642
|
-
isLarge: isLarge
|
|
643
|
-
}, modalContainerProps, ariaProps, modalProps, {
|
|
644
|
-
ref: mergeRefs([ref, modalRef])
|
|
645
|
-
}), children))), rootNode);
|
|
646
|
-
});
|
|
647
|
-
ModalComponent.displayName = 'Modal';
|
|
648
|
-
ModalComponent.propTypes = {
|
|
649
|
-
backdropProps: PropTypes.object,
|
|
650
|
-
isLarge: PropTypes.bool,
|
|
651
|
-
isAnimated: PropTypes.bool,
|
|
652
|
-
isCentered: PropTypes.bool,
|
|
653
|
-
focusOnMount: PropTypes.bool,
|
|
654
|
-
restoreFocus: PropTypes.bool,
|
|
655
|
-
onClose: PropTypes.func,
|
|
656
|
-
appendToNode: PropTypes.any
|
|
657
|
-
};
|
|
658
|
-
ModalComponent.defaultProps = {
|
|
659
|
-
isAnimated: true,
|
|
660
|
-
isCentered: true
|
|
661
|
-
};
|
|
662
|
-
const Modal = ModalComponent;
|
|
663
|
-
Modal.Body = Body$2;
|
|
664
|
-
Modal.Close = Close$2;
|
|
665
|
-
Modal.Footer = Footer$2;
|
|
666
|
-
Modal.FooterItem = FooterItem$2;
|
|
667
|
-
Modal.Header = Header$1;
|
|
668
|
-
|
|
669
|
-
const TooltipModalContext = createContext(undefined);
|
|
670
|
-
const useTooltipModalContext = () => {
|
|
671
|
-
const context = useContext(TooltipModalContext);
|
|
672
|
-
if (context === undefined) {
|
|
673
|
-
throw new Error('Element must be used within a TooltipModal component.');
|
|
674
|
-
}
|
|
675
|
-
return context;
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
const TitleComponent = forwardRef((_ref, ref) => {
|
|
679
|
-
let {
|
|
680
|
-
children,
|
|
681
|
-
tag,
|
|
682
|
-
...other
|
|
683
|
-
} = _ref;
|
|
684
|
-
const {
|
|
685
|
-
getTitleProps,
|
|
686
|
-
hasTitle,
|
|
687
|
-
setHasTitle
|
|
688
|
-
} = useTooltipModalContext();
|
|
689
|
-
useEffect(() => {
|
|
690
|
-
if (!hasTitle && setHasTitle) {
|
|
691
|
-
setHasTitle(true);
|
|
692
|
-
}
|
|
693
|
-
return () => {
|
|
694
|
-
if (hasTitle && setHasTitle) {
|
|
695
|
-
setHasTitle(false);
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
}, [hasTitle, setHasTitle]);
|
|
699
|
-
return React__default.createElement(StyledTooltipModalTitle, _extends$2({}, getTitleProps(other), {
|
|
700
|
-
as: tag,
|
|
701
|
-
ref: ref
|
|
702
|
-
}), children);
|
|
703
|
-
});
|
|
704
|
-
TitleComponent.displayName = 'TooltipModal.Title';
|
|
705
|
-
TitleComponent.propTypes = {
|
|
706
|
-
tag: PropTypes.any
|
|
707
|
-
};
|
|
708
|
-
TitleComponent.defaultProps = {
|
|
709
|
-
tag: 'div'
|
|
710
|
-
};
|
|
711
|
-
const Title = TitleComponent;
|
|
712
|
-
|
|
713
|
-
const BodyComponent$1 = forwardRef((props, ref) => {
|
|
714
|
-
const {
|
|
715
|
-
getContentProps
|
|
716
|
-
} = useTooltipModalContext();
|
|
717
|
-
return React__default.createElement(StyledTooltipModalBody, _extends$2({}, getContentProps(props), {
|
|
718
|
-
ref: ref
|
|
719
|
-
}));
|
|
720
|
-
});
|
|
721
|
-
BodyComponent$1.displayName = 'TooltipModal.Body';
|
|
722
|
-
const Body$1 = BodyComponent$1;
|
|
723
|
-
|
|
724
|
-
const CloseComponent$1 = forwardRef((props, ref) => {
|
|
725
|
-
const {
|
|
726
|
-
getCloseProps
|
|
727
|
-
} = useTooltipModalContext();
|
|
728
|
-
const ariaLabel = useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
729
|
-
return React__default.createElement(StyledTooltipModalClose, _extends$2({}, getCloseProps({
|
|
730
|
-
...props,
|
|
731
|
-
'aria-label': ariaLabel
|
|
732
|
-
}), {
|
|
733
|
-
ref: ref
|
|
734
|
-
}), React__default.createElement(SvgXStroke, null));
|
|
735
|
-
});
|
|
736
|
-
CloseComponent$1.displayName = 'TooltipModal.Close';
|
|
737
|
-
const Close$1 = CloseComponent$1;
|
|
738
|
-
|
|
739
|
-
const FooterComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipModalFooter, _extends$2({
|
|
740
|
-
ref: ref
|
|
741
|
-
}, props)));
|
|
742
|
-
FooterComponent$1.displayName = 'TooltipModal.Footer';
|
|
743
|
-
const Footer$1 = FooterComponent$1;
|
|
744
|
-
|
|
745
|
-
const FooterItemComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipModalFooterItem, _extends$2({
|
|
746
|
-
ref: ref
|
|
747
|
-
}, props)));
|
|
748
|
-
FooterItemComponent$1.displayName = 'TooltipModal.FooterItem';
|
|
749
|
-
const FooterItem$1 = FooterItemComponent$1;
|
|
750
|
-
|
|
751
|
-
const PLACEMENT_DEFAULT = 'top';
|
|
752
|
-
const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
|
|
753
|
-
let {
|
|
754
|
-
appendToNode,
|
|
755
|
-
referenceElement,
|
|
756
|
-
placement: _placement,
|
|
757
|
-
onClose,
|
|
758
|
-
hasArrow,
|
|
759
|
-
isAnimated,
|
|
760
|
-
zIndex,
|
|
761
|
-
backdropProps,
|
|
762
|
-
focusOnMount,
|
|
763
|
-
restoreFocus,
|
|
764
|
-
id,
|
|
765
|
-
...props
|
|
766
|
-
} = _ref;
|
|
767
|
-
const theme = useContext(ThemeContext) || DEFAULT_THEME;
|
|
768
|
-
const previousReferenceElementRef = useRef();
|
|
769
|
-
const modalRef = useRef(null);
|
|
770
|
-
const transitionRef = useRef(null);
|
|
771
|
-
const [floatingElement, setFloatingElement] = useState();
|
|
772
|
-
const [hasTitle, setHasTitle] = useState(false);
|
|
773
|
-
const {
|
|
774
|
-
getTitleProps,
|
|
775
|
-
getCloseProps,
|
|
776
|
-
getContentProps,
|
|
777
|
-
getBackdropProps,
|
|
778
|
-
getModalProps
|
|
779
|
-
} = useModal({
|
|
780
|
-
idPrefix: id,
|
|
781
|
-
onClose,
|
|
782
|
-
modalRef,
|
|
783
|
-
focusOnMount,
|
|
784
|
-
restoreFocus: false
|
|
785
|
-
});
|
|
786
|
-
const [floatingPlacement] = getFloatingPlacements(theme, _placement === 'auto' ? PLACEMENT_DEFAULT : _placement);
|
|
787
|
-
const {
|
|
788
|
-
refs,
|
|
789
|
-
placement,
|
|
790
|
-
update,
|
|
791
|
-
floatingStyles: {
|
|
792
|
-
transform
|
|
793
|
-
}
|
|
794
|
-
} = useFloating({
|
|
795
|
-
platform: {
|
|
796
|
-
...platform,
|
|
797
|
-
isRTL: () => theme.rtl
|
|
798
|
-
},
|
|
799
|
-
elements: {
|
|
800
|
-
reference: referenceElement,
|
|
801
|
-
floating: floatingElement
|
|
802
|
-
},
|
|
803
|
-
placement: floatingPlacement,
|
|
804
|
-
middleware: [offset(theme.space.base * 3), _placement === 'auto' ? autoPlacement() : undefined]
|
|
805
|
-
});
|
|
806
|
-
useEffect(() => {
|
|
807
|
-
let cleanup;
|
|
808
|
-
if (referenceElement && floatingElement && refs.reference.current && refs.floating.current) {
|
|
809
|
-
cleanup = autoUpdate(refs.reference.current, refs.floating.current, update, {
|
|
810
|
-
elementResize: typeof ResizeObserver === 'function'
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
return () => cleanup && cleanup();
|
|
814
|
-
}, [referenceElement, floatingElement, refs.reference, refs.floating, update]);
|
|
815
|
-
useEffect(() => {
|
|
816
|
-
if (!referenceElement && previousReferenceElementRef.current && restoreFocus) {
|
|
817
|
-
previousReferenceElementRef.current.focus();
|
|
818
|
-
}
|
|
819
|
-
previousReferenceElementRef.current = referenceElement;
|
|
820
|
-
}, [referenceElement, restoreFocus]);
|
|
821
|
-
const modalProps = getModalProps({
|
|
822
|
-
'aria-describedby': undefined,
|
|
823
|
-
...(hasTitle ? {} : {
|
|
824
|
-
'aria-labelledby': undefined
|
|
825
|
-
})
|
|
826
|
-
});
|
|
827
|
-
const attribute = hasTitle ? 'aria-labelledby' : 'aria-label';
|
|
828
|
-
const defaultValue = hasTitle ? modalProps['aria-labelledby'] : 'Modal dialog';
|
|
829
|
-
const labelValue = hasTitle ? modalProps['aria-labelledby'] : props['aria-label'];
|
|
830
|
-
const ariaProps = {
|
|
831
|
-
[attribute]: useText(TooltipModalComponent, {
|
|
832
|
-
[attribute]: labelValue
|
|
833
|
-
}, attribute, defaultValue)
|
|
834
|
-
};
|
|
835
|
-
const value = {
|
|
836
|
-
hasTitle,
|
|
837
|
-
setHasTitle,
|
|
838
|
-
getTitleProps,
|
|
839
|
-
getContentProps,
|
|
840
|
-
getCloseProps
|
|
841
|
-
};
|
|
842
|
-
const Node = React__default.createElement(CSSTransition, {
|
|
843
|
-
unmountOnExit: true,
|
|
844
|
-
timeout: isAnimated ? 200 : 0,
|
|
845
|
-
in: Boolean(referenceElement),
|
|
846
|
-
classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
|
|
847
|
-
nodeRef: transitionRef
|
|
848
|
-
}, transitionState => {
|
|
849
|
-
return React__default.createElement(TooltipModalContext.Provider, {
|
|
850
|
-
value: value
|
|
851
|
-
}, React__default.createElement(StyledTooltipModalBackdrop, _extends$2({}, getBackdropProps(), backdropProps, {
|
|
852
|
-
ref: transitionRef
|
|
853
|
-
}), React__default.createElement(StyledTooltipWrapper, {
|
|
854
|
-
ref: setFloatingElement,
|
|
855
|
-
style: {
|
|
856
|
-
transform
|
|
857
|
-
},
|
|
858
|
-
placement: placement,
|
|
859
|
-
zIndex: zIndex,
|
|
860
|
-
isAnimated: isAnimated
|
|
861
|
-
}, React__default.createElement(StyledTooltipModal, _extends$2({
|
|
862
|
-
transitionState: transitionState,
|
|
863
|
-
placement: placement,
|
|
864
|
-
hasArrow: hasArrow,
|
|
865
|
-
isAnimated: isAnimated
|
|
866
|
-
}, modalProps, ariaProps, props, {
|
|
867
|
-
ref: mergeRefs([modalRef, ref])
|
|
868
|
-
})))));
|
|
869
|
-
});
|
|
870
|
-
return appendToNode ? createPortal(Node, appendToNode) : Node;
|
|
871
|
-
});
|
|
872
|
-
TooltipModalComponent.displayName = 'TooltipModal';
|
|
873
|
-
TooltipModalComponent.defaultProps = {
|
|
874
|
-
placement: 'auto',
|
|
875
|
-
hasArrow: true,
|
|
876
|
-
focusOnMount: true,
|
|
877
|
-
restoreFocus: true
|
|
878
|
-
};
|
|
879
|
-
TooltipModalComponent.propTypes = {
|
|
880
|
-
appendToNode: PropTypes.any,
|
|
881
|
-
referenceElement: PropTypes.any,
|
|
882
|
-
placement: PropTypes.any,
|
|
883
|
-
isAnimated: PropTypes.bool,
|
|
884
|
-
hasArrow: PropTypes.bool,
|
|
885
|
-
zIndex: PropTypes.number,
|
|
886
|
-
onClose: PropTypes.func,
|
|
887
|
-
backdropProps: PropTypes.any,
|
|
888
|
-
focusOnMount: PropTypes.bool,
|
|
889
|
-
restoreFocus: PropTypes.bool
|
|
890
|
-
};
|
|
891
|
-
const TooltipModal = TooltipModalComponent;
|
|
892
|
-
TooltipModal.Body = Body$1;
|
|
893
|
-
TooltipModal.Close = Close$1;
|
|
894
|
-
TooltipModal.Footer = Footer$1;
|
|
895
|
-
TooltipModal.FooterItem = FooterItem$1;
|
|
896
|
-
TooltipModal.Title = Title;
|
|
897
|
-
|
|
898
|
-
const HeaderComponent = forwardRef((_ref, ref) => {
|
|
899
|
-
let {
|
|
900
|
-
tag,
|
|
901
|
-
...other
|
|
902
|
-
} = _ref;
|
|
903
|
-
const {
|
|
904
|
-
isCloseButtonPresent,
|
|
905
|
-
hasHeader,
|
|
906
|
-
setHasHeader,
|
|
907
|
-
getTitleProps
|
|
908
|
-
} = useModalContext();
|
|
909
|
-
useEffect(() => {
|
|
910
|
-
if (!hasHeader && setHasHeader) {
|
|
911
|
-
setHasHeader(true);
|
|
912
|
-
}
|
|
913
|
-
return () => {
|
|
914
|
-
if (hasHeader && setHasHeader) {
|
|
915
|
-
setHasHeader(false);
|
|
916
|
-
}
|
|
917
|
-
};
|
|
918
|
-
}, [hasHeader, setHasHeader]);
|
|
919
|
-
return React__default.createElement(StyledDrawerHeader, _extends$2({}, getTitleProps(other), {
|
|
920
|
-
as: tag,
|
|
921
|
-
isCloseButtonPresent: isCloseButtonPresent,
|
|
922
|
-
ref: ref
|
|
923
|
-
}));
|
|
924
|
-
});
|
|
925
|
-
HeaderComponent.displayName = 'Drawer.Header';
|
|
926
|
-
HeaderComponent.propTypes = {
|
|
927
|
-
tag: PropTypes.any
|
|
928
|
-
};
|
|
929
|
-
HeaderComponent.defaultProps = {
|
|
930
|
-
tag: 'div'
|
|
931
|
-
};
|
|
932
|
-
const Header = HeaderComponent;
|
|
933
|
-
|
|
934
|
-
const BodyComponent = forwardRef((props, ref) => {
|
|
935
|
-
const {
|
|
936
|
-
getContentProps
|
|
937
|
-
} = useModalContext();
|
|
938
|
-
return React__default.createElement(StyledDrawerBody, _extends$2({}, getContentProps(props), {
|
|
939
|
-
ref: ref
|
|
940
|
-
}), props.children);
|
|
941
|
-
});
|
|
942
|
-
BodyComponent.displayName = 'Drawer.Body';
|
|
943
|
-
const Body = BodyComponent;
|
|
944
|
-
|
|
945
|
-
const CloseComponent = forwardRef((props, ref) => {
|
|
946
|
-
const {
|
|
947
|
-
getCloseProps,
|
|
948
|
-
setIsCloseButtonPresent
|
|
949
|
-
} = useModalContext();
|
|
950
|
-
useEffect(() => {
|
|
951
|
-
setIsCloseButtonPresent(true);
|
|
952
|
-
return () => setIsCloseButtonPresent(false);
|
|
953
|
-
});
|
|
954
|
-
const ariaLabel = useText(CloseComponent, props, 'aria-label', 'Close drawer');
|
|
955
|
-
return React__default.createElement(StyledDrawerClose, _extends$2({}, getCloseProps({
|
|
956
|
-
...props,
|
|
957
|
-
'aria-label': ariaLabel
|
|
958
|
-
}), {
|
|
959
|
-
ref: ref
|
|
960
|
-
}), React__default.createElement(SvgXStroke, null));
|
|
961
|
-
});
|
|
962
|
-
CloseComponent.displayName = 'Drawer.Close';
|
|
963
|
-
const Close = CloseComponent;
|
|
964
|
-
|
|
965
|
-
const FooterComponent = forwardRef((props, ref) => React__default.createElement(StyledDrawerFooter, _extends$2({
|
|
966
|
-
ref: ref
|
|
967
|
-
}, props)));
|
|
968
|
-
FooterComponent.displayName = 'Drawer.Footer';
|
|
969
|
-
const Footer = FooterComponent;
|
|
970
|
-
|
|
971
|
-
const FooterItemComponent = forwardRef((props, ref) => React__default.createElement(StyledDrawerFooterItem, _extends$2({
|
|
972
|
-
ref: ref
|
|
973
|
-
}, props)));
|
|
974
|
-
FooterItemComponent.displayName = 'Drawer.FooterItem';
|
|
975
|
-
const FooterItem = FooterItemComponent;
|
|
976
|
-
|
|
977
|
-
const DrawerComponent = forwardRef((_ref, ref) => {
|
|
978
|
-
let {
|
|
979
|
-
id,
|
|
980
|
-
isOpen,
|
|
981
|
-
onClose,
|
|
982
|
-
backdropProps,
|
|
983
|
-
appendToNode,
|
|
984
|
-
focusOnMount,
|
|
985
|
-
restoreFocus,
|
|
986
|
-
...props
|
|
987
|
-
} = _ref;
|
|
988
|
-
const modalRef = useRef(null);
|
|
989
|
-
const transitionRef = useRef(null);
|
|
990
|
-
const triggerRef = useRef(null);
|
|
991
|
-
const theme = useContext(ThemeContext);
|
|
992
|
-
const environment = useDocument(theme);
|
|
993
|
-
const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
|
|
994
|
-
const [hasHeader, setHasHeader] = useState(false);
|
|
995
|
-
const {
|
|
996
|
-
getTitleProps,
|
|
997
|
-
getCloseProps,
|
|
998
|
-
getContentProps,
|
|
999
|
-
getBackdropProps,
|
|
1000
|
-
getModalProps
|
|
1001
|
-
} = useModal({
|
|
1002
|
-
idPrefix: id,
|
|
1003
|
-
modalRef,
|
|
1004
|
-
focusOnMount: false ,
|
|
1005
|
-
restoreFocus: false ,
|
|
1006
|
-
environment,
|
|
1007
|
-
onClose
|
|
1008
|
-
});
|
|
1009
|
-
useEffect(() => {
|
|
1010
|
-
if (environment) {
|
|
1011
|
-
if (isOpen && modalRef.current) {
|
|
1012
|
-
if (restoreFocus) {
|
|
1013
|
-
triggerRef.current = activeElement(environment);
|
|
1014
|
-
}
|
|
1015
|
-
if (focusOnMount) {
|
|
1016
|
-
modalRef.current.focus();
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
if (!isOpen && triggerRef.current) {
|
|
1020
|
-
triggerRef.current.focus();
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
return () => {
|
|
1024
|
-
if (!(restoreFocus && isOpen)) {
|
|
1025
|
-
triggerRef.current = null;
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
}, [environment, restoreFocus, focusOnMount, isOpen]);
|
|
1029
|
-
useEffect(() => {
|
|
1030
|
-
if (!environment) {
|
|
1031
|
-
return undefined;
|
|
1032
|
-
}
|
|
1033
|
-
const htmlElement = environment.querySelector('html');
|
|
1034
|
-
let previousHtmlOverflow;
|
|
1035
|
-
if (htmlElement && isOpen) {
|
|
1036
|
-
previousHtmlOverflow = htmlElement.style.overflow;
|
|
1037
|
-
htmlElement.style.overflow = 'hidden';
|
|
1038
|
-
}
|
|
1039
|
-
return () => {
|
|
1040
|
-
if (htmlElement && isOpen) {
|
|
1041
|
-
htmlElement.style.overflow = previousHtmlOverflow;
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
}, [environment, isOpen]);
|
|
1045
|
-
const rootNode = useMemo(() => {
|
|
1046
|
-
if (appendToNode) {
|
|
1047
|
-
return appendToNode;
|
|
1048
|
-
}
|
|
1049
|
-
if (environment) {
|
|
1050
|
-
return environment.body;
|
|
1051
|
-
}
|
|
1052
|
-
return undefined;
|
|
1053
|
-
}, [appendToNode, environment]);
|
|
1054
|
-
const value = useMemo(() => ({
|
|
1055
|
-
isCloseButtonPresent,
|
|
1056
|
-
hasHeader,
|
|
1057
|
-
setHasHeader,
|
|
1058
|
-
getTitleProps,
|
|
1059
|
-
getContentProps,
|
|
1060
|
-
getCloseProps,
|
|
1061
|
-
setIsCloseButtonPresent
|
|
1062
|
-
}), [isCloseButtonPresent, hasHeader, getTitleProps, getContentProps, getCloseProps]);
|
|
1063
|
-
const modalProps = getModalProps({
|
|
1064
|
-
'aria-describedby': undefined,
|
|
1065
|
-
...(hasHeader ? {} : {
|
|
1066
|
-
'aria-labelledby': undefined
|
|
1067
|
-
})
|
|
1068
|
-
});
|
|
1069
|
-
const attribute = hasHeader ? 'aria-labelledby' : 'aria-label';
|
|
1070
|
-
const defaultValue = hasHeader ? modalProps['aria-labelledby'] : 'Modal dialog';
|
|
1071
|
-
const labelValue = hasHeader ? modalProps['aria-labelledby'] : props['aria-label'];
|
|
1072
|
-
const ariaProps = {
|
|
1073
|
-
[attribute]: useText(DrawerComponent, {
|
|
1074
|
-
[attribute]: labelValue
|
|
1075
|
-
}, attribute, defaultValue)
|
|
1076
|
-
};
|
|
1077
|
-
if (!rootNode) {
|
|
1078
|
-
return null;
|
|
1079
|
-
}
|
|
1080
|
-
return ReactDOM.createPortal( React__default.createElement(ModalsContext.Provider, {
|
|
1081
|
-
value: value
|
|
1082
|
-
}, React__default.createElement(CSSTransition, {
|
|
1083
|
-
in: isOpen,
|
|
1084
|
-
timeout: 250,
|
|
1085
|
-
unmountOnExit: true,
|
|
1086
|
-
classNames: "garden-drawer-transition",
|
|
1087
|
-
nodeRef: transitionRef
|
|
1088
|
-
}, React__default.createElement(StyledBackdrop, _extends$2({
|
|
1089
|
-
isAnimated: true
|
|
1090
|
-
}, getBackdropProps(backdropProps)), React__default.createElement(StyledDrawer, _extends$2({}, modalProps, ariaProps, props, {
|
|
1091
|
-
ref: mergeRefs([ref, modalRef, transitionRef])
|
|
1092
|
-
}))))), rootNode);
|
|
1093
|
-
});
|
|
1094
|
-
DrawerComponent.displayName = 'Drawer';
|
|
1095
|
-
DrawerComponent.propTypes = {
|
|
1096
|
-
backdropProps: PropTypes.object,
|
|
1097
|
-
focusOnMount: PropTypes.bool,
|
|
1098
|
-
restoreFocus: PropTypes.bool,
|
|
1099
|
-
onClose: PropTypes.func,
|
|
1100
|
-
appendToNode: PropTypes.any,
|
|
1101
|
-
isOpen: PropTypes.bool
|
|
1102
|
-
};
|
|
1103
|
-
DrawerComponent.defaultProps = {
|
|
1104
|
-
focusOnMount: true ,
|
|
1105
|
-
restoreFocus: true
|
|
1106
|
-
};
|
|
1107
|
-
const Drawer = DrawerComponent;
|
|
1108
|
-
Drawer.Body = Body;
|
|
1109
|
-
Drawer.Close = Close;
|
|
1110
|
-
Drawer.Footer = Footer;
|
|
1111
|
-
Drawer.FooterItem = FooterItem;
|
|
1112
|
-
Drawer.Header = Header;
|
|
1113
|
-
|
|
1114
|
-
const PLACEMENT = ['auto', ...PLACEMENT$1];
|
|
1115
|
-
|
|
1116
|
-
export { Body$2 as Body, Close$2 as Close, Drawer, Footer$2 as Footer, FooterItem$2 as FooterItem, Header$1 as Header, Modal, PLACEMENT, TooltipModal };
|