@zendeskgarden/react-modals 9.0.0-next.1 → 9.0.0-next.11
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/README.md +68 -10
- 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 +252 -310
- package/dist/typings/elements/Body.d.ts +2 -0
- package/dist/typings/elements/Close.d.ts +2 -0
- package/dist/typings/elements/{DrawerModal/DrawerModal.d.ts → Drawer/Drawer.d.ts} +2 -2
- package/dist/typings/elements/{DrawerModal → Drawer}/Header.d.ts +2 -2
- package/dist/typings/elements/Footer.d.ts +2 -0
- package/dist/typings/elements/FooterItem.d.ts +2 -0
- package/dist/typings/elements/Header.d.ts +2 -0
- package/dist/typings/elements/Modal.d.ts +13 -1
- package/dist/typings/index.d.ts +2 -2
- package/dist/typings/styled/{StyledDrawerModal.d.ts → StyledDrawer.d.ts} +1 -1
- package/dist/typings/styled/{StyledDrawerModalBody.d.ts → StyledDrawerBody.d.ts} +1 -1
- package/dist/typings/styled/{StyledDrawerModalClose.d.ts → StyledDrawerClose.d.ts} +1 -1
- package/dist/typings/styled/{StyledDrawerModalFooterItem.d.ts → StyledDrawerFooter.d.ts} +1 -1
- package/dist/typings/styled/{StyledDrawerModalFooter.d.ts → StyledDrawerFooterItem.d.ts} +1 -1
- package/dist/typings/styled/{StyledDrawerModalHeader.d.ts → StyledDrawerHeader.d.ts} +1 -1
- package/dist/typings/styled/StyledTooltipModal.d.ts +1 -1
- package/dist/typings/styled/StyledTooltipWrapper.d.ts +2 -2
- package/dist/typings/styled/index.d.ts +6 -6
- package/dist/typings/types/index.d.ts +2 -7
- package/package.json +7 -9
- package/dist/index.esm.js +0 -1160
- package/dist/typings/utils/gardenPlacements.d.ts +0 -28
- /package/dist/typings/elements/{DrawerModal → Drawer}/Body.d.ts +0 -0
- /package/dist/typings/elements/{DrawerModal → Drawer}/Close.d.ts +0 -0
- /package/dist/typings/elements/{DrawerModal → Drawer}/Footer.d.ts +0 -0
- /package/dist/typings/elements/{DrawerModal → Drawer}/FooterItem.d.ts +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
*/
|
|
8
7
|
'use strict';
|
|
9
8
|
|
|
10
9
|
var React = require('react');
|
|
@@ -13,15 +12,14 @@ var styled = require('styled-components');
|
|
|
13
12
|
var PropTypes = require('prop-types');
|
|
14
13
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
15
14
|
var containerModal = require('@zendeskgarden/container-modal');
|
|
16
|
-
var containerFocusvisible = require('@zendeskgarden/container-focusvisible');
|
|
17
15
|
var reactMergeRefs = require('react-merge-refs');
|
|
18
16
|
var isWindow = require('dom-helpers/isWindow');
|
|
19
17
|
var ownerDocument = require('dom-helpers/ownerDocument');
|
|
20
18
|
var ownerWindow = require('dom-helpers/ownerWindow');
|
|
21
19
|
var css = require('dom-helpers/css');
|
|
22
20
|
var getScrollbarSize = require('dom-helpers/scrollbarSize');
|
|
23
|
-
var reactPopper = require('react-popper');
|
|
24
21
|
var reactTransitionGroup = require('react-transition-group');
|
|
22
|
+
var reactDom = require('@floating-ui/react-dom');
|
|
25
23
|
var activeElement = require('dom-helpers/activeElement');
|
|
26
24
|
|
|
27
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -55,21 +53,6 @@ var css__default = /*#__PURE__*/_interopDefault(css);
|
|
|
55
53
|
var getScrollbarSize__default = /*#__PURE__*/_interopDefault(getScrollbarSize);
|
|
56
54
|
var activeElement__default = /*#__PURE__*/_interopDefault(activeElement);
|
|
57
55
|
|
|
58
|
-
function _extends$2() {
|
|
59
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
60
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
61
|
-
var source = arguments[i];
|
|
62
|
-
for (var key in source) {
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
64
|
-
target[key] = source[key];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return target;
|
|
69
|
-
};
|
|
70
|
-
return _extends$2.apply(this, arguments);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
56
|
const COMPONENT_ID$j = 'modals.backdrop';
|
|
74
57
|
const animationName$1 = styled.keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
75
58
|
const animationStyles$1 = props => {
|
|
@@ -80,11 +63,11 @@ const animationStyles$1 = props => {
|
|
|
80
63
|
};
|
|
81
64
|
const StyledBackdrop = styled__default.default.div.attrs({
|
|
82
65
|
'data-garden-id': COMPONENT_ID$j,
|
|
83
|
-
'data-garden-version': '9.0.0-next.
|
|
66
|
+
'data-garden-version': '9.0.0-next.11'
|
|
84
67
|
}).withConfig({
|
|
85
68
|
displayName: "StyledBackdrop",
|
|
86
69
|
componentId: "sc-mzdjpo-0"
|
|
87
|
-
})(["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 => reactTheming.
|
|
70
|
+
})(["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 => reactTheming.getColorV8('neutralHue', 800, props.theme, 0.85), props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
88
71
|
StyledBackdrop.defaultProps = {
|
|
89
72
|
theme: reactTheming.DEFAULT_THEME
|
|
90
73
|
};
|
|
@@ -96,11 +79,11 @@ StyledBackdrop.propTypes = {
|
|
|
96
79
|
const COMPONENT_ID$i = 'modals.body';
|
|
97
80
|
const StyledBody = styled__default.default.div.attrs({
|
|
98
81
|
'data-garden-id': COMPONENT_ID$i,
|
|
99
|
-
'data-garden-version': '9.0.0-next.
|
|
82
|
+
'data-garden-version': '9.0.0-next.11'
|
|
100
83
|
}).withConfig({
|
|
101
84
|
displayName: "StyledBody",
|
|
102
85
|
componentId: "sc-14rzecg-0"
|
|
103
|
-
})(["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 => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme
|
|
86
|
+
})(["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 => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => reactTheming.getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
104
87
|
StyledBody.defaultProps = {
|
|
105
88
|
theme: reactTheming.DEFAULT_THEME
|
|
106
89
|
};
|
|
@@ -109,10 +92,12 @@ const COMPONENT_ID$h = 'modals.close';
|
|
|
109
92
|
const colorStyles = props => {
|
|
110
93
|
const backgroundColor = 'primaryHue';
|
|
111
94
|
const foregroundColor = 'neutralHue';
|
|
112
|
-
return styled.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:", ";}"], reactTheming.
|
|
95
|
+
return styled.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:", ";}"], reactTheming.getColorV8(foregroundColor, 600, props.theme), reactTheming.getColorV8(backgroundColor, 600, props.theme, 0.08), reactTheming.getColorV8(foregroundColor, 700, props.theme), reactTheming.focusStyles({
|
|
113
96
|
theme: props.theme,
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
color: {
|
|
98
|
+
hue: backgroundColor
|
|
99
|
+
}
|
|
100
|
+
}), reactTheming.getColorV8(backgroundColor, 600, props.theme, 0.2), reactTheming.getColorV8(foregroundColor, 800, props.theme));
|
|
116
101
|
};
|
|
117
102
|
const BASE_MULTIPLIERS$1 = {
|
|
118
103
|
top: 2.5,
|
|
@@ -121,7 +106,7 @@ const BASE_MULTIPLIERS$1 = {
|
|
|
121
106
|
};
|
|
122
107
|
const StyledClose = styled__default.default.button.attrs({
|
|
123
108
|
'data-garden-id': COMPONENT_ID$h,
|
|
124
|
-
'data-garden-version': '9.0.0-next.
|
|
109
|
+
'data-garden-version': '9.0.0-next.11'
|
|
125
110
|
}).withConfig({
|
|
126
111
|
displayName: "StyledClose",
|
|
127
112
|
componentId: "sc-iseudj-0"
|
|
@@ -133,11 +118,11 @@ StyledClose.defaultProps = {
|
|
|
133
118
|
const COMPONENT_ID$g = 'modals.footer';
|
|
134
119
|
const StyledFooter = styled__default.default.div.attrs({
|
|
135
120
|
'data-garden-id': COMPONENT_ID$g,
|
|
136
|
-
'data-garden-version': '9.0.0-next.
|
|
121
|
+
'data-garden-version': '9.0.0-next.11'
|
|
137
122
|
}).withConfig({
|
|
138
123
|
displayName: "StyledFooter",
|
|
139
124
|
componentId: "sc-d8pfdu-0"
|
|
140
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${reactTheming.
|
|
125
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${reactTheming.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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
141
126
|
StyledFooter.defaultProps = {
|
|
142
127
|
theme: reactTheming.DEFAULT_THEME
|
|
143
128
|
};
|
|
@@ -145,7 +130,7 @@ StyledFooter.defaultProps = {
|
|
|
145
130
|
const COMPONENT_ID$f = 'modals.footer_item';
|
|
146
131
|
const StyledFooterItem = styled__default.default.span.attrs({
|
|
147
132
|
'data-garden-id': COMPONENT_ID$f,
|
|
148
|
-
'data-garden-version': '9.0.0-next.
|
|
133
|
+
'data-garden-version': '9.0.0-next.11'
|
|
149
134
|
}).withConfig({
|
|
150
135
|
displayName: "StyledFooterItem",
|
|
151
136
|
componentId: "sc-1mb76hl-0"
|
|
@@ -157,11 +142,11 @@ StyledFooterItem.defaultProps = {
|
|
|
157
142
|
const COMPONENT_ID$e = 'modals.header';
|
|
158
143
|
const StyledHeader = styled__default.default.div.attrs({
|
|
159
144
|
'data-garden-id': COMPONENT_ID$e,
|
|
160
|
-
'data-garden-version': '9.0.0-next.
|
|
145
|
+
'data-garden-version': '9.0.0-next.11'
|
|
161
146
|
}).withConfig({
|
|
162
147
|
displayName: "StyledHeader",
|
|
163
148
|
componentId: "sc-1787r9v-0"
|
|
164
|
-
})(["display:block;position:", ";margin:0;border-bottom:", " ", ";padding:", ";", " line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, reactTheming.
|
|
149
|
+
})(["display:block;position:", ";margin:0;border-bottom:", " ", ";padding:", ";", " line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, reactTheming.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 => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.isDanger ? reactTheming.getColorV8('dangerHue', 600, props.theme) : reactTheming.getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
165
150
|
StyledHeader.defaultProps = {
|
|
166
151
|
theme: reactTheming.DEFAULT_THEME
|
|
167
152
|
};
|
|
@@ -220,7 +205,7 @@ const boxShadow$1 = props => {
|
|
|
220
205
|
} = theme;
|
|
221
206
|
const offsetY = `${space.base * 5}px`;
|
|
222
207
|
const blurRadius = `${space.base * 7}px`;
|
|
223
|
-
const color = reactTheming.
|
|
208
|
+
const color = reactTheming.getColorV8('neutralHue', 800, theme, 0.35);
|
|
224
209
|
return shadows.lg(offsetY, blurRadius, color);
|
|
225
210
|
};
|
|
226
211
|
const sizeStyles$1 = props => {
|
|
@@ -228,11 +213,11 @@ const sizeStyles$1 = props => {
|
|
|
228
213
|
};
|
|
229
214
|
const StyledModal = styled__default.default.div.attrs({
|
|
230
215
|
'data-garden-id': COMPONENT_ID$d,
|
|
231
|
-
'data-garden-version': '9.0.0-next.
|
|
216
|
+
'data-garden-version': '9.0.0-next.11'
|
|
232
217
|
}).withConfig({
|
|
233
218
|
displayName: "StyledModal",
|
|
234
219
|
componentId: "sc-1pe1axu-0"
|
|
235
|
-
})(["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 => props.theme
|
|
220
|
+
})(["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 => reactTheming.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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
|
|
236
221
|
StyledModal.propTypes = {
|
|
237
222
|
isLarge: PropTypes__default.default.bool,
|
|
238
223
|
isAnimated: PropTypes__default.default.bool
|
|
@@ -244,7 +229,7 @@ StyledModal.defaultProps = {
|
|
|
244
229
|
const COMPONENT_ID$c = 'modals.tooltip_modal.backdrop';
|
|
245
230
|
const StyledTooltipModalBackdrop = styled__default.default.div.attrs({
|
|
246
231
|
'data-garden-id': COMPONENT_ID$c,
|
|
247
|
-
'data-garden-version': '9.0.0-next.
|
|
232
|
+
'data-garden-version': '9.0.0-next.11'
|
|
248
233
|
}).withConfig({
|
|
249
234
|
displayName: "StyledTooltipModalBackdrop",
|
|
250
235
|
componentId: "sc-1yaomgq-0"
|
|
@@ -253,70 +238,14 @@ StyledTooltipModalBackdrop.defaultProps = {
|
|
|
253
238
|
theme: reactTheming.DEFAULT_THEME
|
|
254
239
|
};
|
|
255
240
|
|
|
256
|
-
function getPopperPlacement(gardenPlacement) {
|
|
257
|
-
const gardenToPopperMapping = {
|
|
258
|
-
auto: 'auto',
|
|
259
|
-
top: 'top',
|
|
260
|
-
'top-start': 'top-start',
|
|
261
|
-
'top-end': 'top-end',
|
|
262
|
-
bottom: 'bottom',
|
|
263
|
-
'bottom-start': 'bottom-start',
|
|
264
|
-
'bottom-end': 'bottom-end',
|
|
265
|
-
end: 'right',
|
|
266
|
-
'end-top': 'right-start',
|
|
267
|
-
'end-bottom': 'right-end',
|
|
268
|
-
start: 'left',
|
|
269
|
-
'start-top': 'left-start',
|
|
270
|
-
'start-bottom': 'left-end'
|
|
271
|
-
};
|
|
272
|
-
return gardenToPopperMapping[gardenPlacement];
|
|
273
|
-
}
|
|
274
|
-
function getRtlPopperPlacement(gardenPlacement) {
|
|
275
|
-
const rtlPlacementMappings = {
|
|
276
|
-
left: 'right',
|
|
277
|
-
'left-start': 'right-start',
|
|
278
|
-
'left-end': 'right-end',
|
|
279
|
-
'top-start': 'top-end',
|
|
280
|
-
'top-end': 'top-start',
|
|
281
|
-
right: 'left',
|
|
282
|
-
'right-start': 'left-start',
|
|
283
|
-
'right-end': 'left-end',
|
|
284
|
-
'bottom-start': 'bottom-end',
|
|
285
|
-
'bottom-end': 'bottom-start'
|
|
286
|
-
};
|
|
287
|
-
const popperPlacement = getPopperPlacement(gardenPlacement);
|
|
288
|
-
return rtlPlacementMappings[popperPlacement] || popperPlacement;
|
|
289
|
-
}
|
|
290
|
-
function getArrowPosition(popperPlacement) {
|
|
291
|
-
const arrowPositionMappings = {
|
|
292
|
-
top: 'bottom',
|
|
293
|
-
'top-start': 'bottom-left',
|
|
294
|
-
'top-end': 'bottom-right',
|
|
295
|
-
right: 'left',
|
|
296
|
-
'right-start': 'left-top',
|
|
297
|
-
'right-end': 'left-bottom',
|
|
298
|
-
bottom: 'top',
|
|
299
|
-
'bottom-start': 'top-left',
|
|
300
|
-
'bottom-end': 'top-right',
|
|
301
|
-
left: 'right',
|
|
302
|
-
'left-start': 'right-top',
|
|
303
|
-
'left-end': 'right-bottom'
|
|
304
|
-
};
|
|
305
|
-
return arrowPositionMappings[popperPlacement] || 'top';
|
|
306
|
-
}
|
|
307
|
-
function getMenuPosition(popperPlacement) {
|
|
308
|
-
return popperPlacement ? popperPlacement.split('-')[0] : 'bottom';
|
|
309
|
-
}
|
|
310
|
-
|
|
311
241
|
const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
|
|
312
242
|
className: props.isAnimated && 'is-animated'
|
|
313
243
|
})).withConfig({
|
|
314
244
|
displayName: "StyledTooltipWrapper",
|
|
315
245
|
componentId: "sc-1xk05kf-0"
|
|
316
|
-
})(["", ";"], props => reactTheming.menuStyles(getMenuPosition(props.placement), {
|
|
246
|
+
})(["top:0;left:0;", ";"], props => reactTheming.menuStyles(reactTheming.getMenuPosition(props.placement), {
|
|
317
247
|
theme: props.theme,
|
|
318
248
|
hidden: false,
|
|
319
|
-
margin: '0',
|
|
320
249
|
zIndex: props.zIndex,
|
|
321
250
|
animationModifier: '.is-animated'
|
|
322
251
|
}));
|
|
@@ -327,13 +256,13 @@ StyledTooltipWrapper.defaultProps = {
|
|
|
327
256
|
const COMPONENT_ID$b = 'modals.tooltip_modal';
|
|
328
257
|
const StyledTooltipModal = styled__default.default.div.attrs(props => ({
|
|
329
258
|
'data-garden-id': COMPONENT_ID$b,
|
|
330
|
-
'data-garden-version': '9.0.0-next.
|
|
259
|
+
'data-garden-version': '9.0.0-next.11',
|
|
331
260
|
className: props.isAnimated && 'is-animated'
|
|
332
261
|
})).withConfig({
|
|
333
262
|
displayName: "StyledTooltipModal",
|
|
334
263
|
componentId: "sc-42ubfr-0"
|
|
335
264
|
})(["padding:", "px;width:400px;", ";", ";"], props => props.theme.space.base * 5, props => {
|
|
336
|
-
const computedArrowStyles = reactTheming.arrowStyles(getArrowPosition(props.placement), {
|
|
265
|
+
const computedArrowStyles = reactTheming.arrowStyles(reactTheming.getArrowPosition(props.theme, props.placement), {
|
|
337
266
|
size: `${props.theme.space.base * 2}px`,
|
|
338
267
|
inset: '1px',
|
|
339
268
|
animationModifier: '.is-animated'
|
|
@@ -356,11 +285,11 @@ const sizeStyles = props => `
|
|
|
356
285
|
`;
|
|
357
286
|
const StyledTooltipModalTitle = styled__default.default.div.attrs({
|
|
358
287
|
'data-garden-id': COMPONENT_ID$a,
|
|
359
|
-
'data-garden-version': '9.0.0-next.
|
|
288
|
+
'data-garden-version': '9.0.0-next.11'
|
|
360
289
|
}).withConfig({
|
|
361
290
|
displayName: "StyledTooltipModalTitle",
|
|
362
291
|
componentId: "sc-11xjgjs-0"
|
|
363
|
-
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => props.theme
|
|
292
|
+
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => reactTheming.getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
364
293
|
StyledTooltipModalTitle.defaultProps = {
|
|
365
294
|
theme: reactTheming.DEFAULT_THEME
|
|
366
295
|
};
|
|
@@ -368,11 +297,11 @@ StyledTooltipModalTitle.defaultProps = {
|
|
|
368
297
|
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
369
298
|
const StyledTooltipModalBody = styled__default.default.div.attrs({
|
|
370
299
|
'data-garden-id': COMPONENT_ID$9,
|
|
371
|
-
'data-garden-version': '9.0.0-next.
|
|
300
|
+
'data-garden-version': '9.0.0-next.11'
|
|
372
301
|
}).withConfig({
|
|
373
302
|
displayName: "StyledTooltipModalBody",
|
|
374
303
|
componentId: "sc-195dkzj-0"
|
|
375
|
-
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme
|
|
304
|
+
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => reactTheming.getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
376
305
|
StyledTooltipModalBody.defaultProps = {
|
|
377
306
|
theme: reactTheming.DEFAULT_THEME
|
|
378
307
|
};
|
|
@@ -380,7 +309,7 @@ StyledTooltipModalBody.defaultProps = {
|
|
|
380
309
|
const COMPONENT_ID$8 = 'modals.tooltip_modal.footer';
|
|
381
310
|
const StyledTooltipModalFooter = styled__default.default.div.attrs({
|
|
382
311
|
'data-garden-id': COMPONENT_ID$8,
|
|
383
|
-
'data-garden-version': '9.0.0-next.
|
|
312
|
+
'data-garden-version': '9.0.0-next.11'
|
|
384
313
|
}).withConfig({
|
|
385
314
|
displayName: "StyledTooltipModalFooter",
|
|
386
315
|
componentId: "sc-fm36a9-0"
|
|
@@ -392,7 +321,7 @@ StyledTooltipModalFooter.defaultProps = {
|
|
|
392
321
|
const COMPONENT_ID$7 = 'modals.tooltip_modal.footer_item';
|
|
393
322
|
const StyledTooltipModalFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
394
323
|
'data-garden-id': COMPONENT_ID$7,
|
|
395
|
-
'data-garden-version': '9.0.0-next.
|
|
324
|
+
'data-garden-version': '9.0.0-next.11'
|
|
396
325
|
}).withConfig({
|
|
397
326
|
displayName: "StyledTooltipModalFooterItem",
|
|
398
327
|
componentId: "sc-1nahj6p-0"
|
|
@@ -404,7 +333,7 @@ StyledTooltipModalFooterItem.defaultProps = {
|
|
|
404
333
|
const COMPONENT_ID$6 = 'modals.tooltip_modal.close';
|
|
405
334
|
const StyledTooltipModalClose = styled__default.default(StyledClose).attrs({
|
|
406
335
|
'data-garden-id': COMPONENT_ID$6,
|
|
407
|
-
'data-garden-version': '9.0.0-next.
|
|
336
|
+
'data-garden-version': '9.0.0-next.11'
|
|
408
337
|
}).withConfig({
|
|
409
338
|
displayName: "StyledTooltipModalClose",
|
|
410
339
|
componentId: "sc-1h2ke3q-0"
|
|
@@ -425,17 +354,17 @@ const boxShadow = props => {
|
|
|
425
354
|
} = theme;
|
|
426
355
|
const offsetY = `${space.base * 5}px`;
|
|
427
356
|
const blurRadius = `${space.base * 7}px`;
|
|
428
|
-
const color = reactTheming.
|
|
357
|
+
const color = reactTheming.getColorV8('neutralHue', 800, theme, 0.35);
|
|
429
358
|
return shadows.lg(offsetY, blurRadius, color);
|
|
430
359
|
};
|
|
431
|
-
const
|
|
360
|
+
const StyledDrawer = styled__default.default.div.attrs({
|
|
432
361
|
'data-garden-id': COMPONENT_ID$5,
|
|
433
|
-
'data-garden-version': '9.0.0-next.
|
|
362
|
+
'data-garden-version': '9.0.0-next.11'
|
|
434
363
|
}).withConfig({
|
|
435
|
-
displayName: "
|
|
436
|
-
componentId: "sc-
|
|
437
|
-
})(["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 => props.theme
|
|
438
|
-
|
|
364
|
+
displayName: "StyledDrawer",
|
|
365
|
+
componentId: "sc-zp66t3-0"
|
|
366
|
+
})(["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 => reactTheming.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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
367
|
+
StyledDrawer.defaultProps = {
|
|
439
368
|
theme: reactTheming.DEFAULT_THEME
|
|
440
369
|
};
|
|
441
370
|
|
|
@@ -445,62 +374,62 @@ const BASE_MULTIPLIERS = {
|
|
|
445
374
|
side: 2,
|
|
446
375
|
size: BASE_MULTIPLIERS$1.size
|
|
447
376
|
};
|
|
448
|
-
const
|
|
377
|
+
const StyledDrawerClose = styled__default.default(StyledClose).attrs({
|
|
449
378
|
'data-garden-id': COMPONENT_ID$4,
|
|
450
|
-
'data-garden-version': '9.0.0-next.
|
|
379
|
+
'data-garden-version': '9.0.0-next.11'
|
|
451
380
|
}).withConfig({
|
|
452
|
-
displayName: "
|
|
453
|
-
componentId: "sc-
|
|
381
|
+
displayName: "StyledDrawerClose",
|
|
382
|
+
componentId: "sc-1a0xt3x-0"
|
|
454
383
|
})(["", ":", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
455
|
-
|
|
384
|
+
StyledDrawerClose.defaultProps = {
|
|
456
385
|
theme: reactTheming.DEFAULT_THEME
|
|
457
386
|
};
|
|
458
387
|
|
|
459
388
|
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
460
|
-
const
|
|
389
|
+
const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
|
|
461
390
|
'data-garden-id': COMPONENT_ID$3,
|
|
462
|
-
'data-garden-version': '9.0.0-next.
|
|
391
|
+
'data-garden-version': '9.0.0-next.11'
|
|
463
392
|
}).withConfig({
|
|
464
|
-
displayName: "
|
|
465
|
-
componentId: "sc-
|
|
393
|
+
displayName: "StyledDrawerHeader",
|
|
394
|
+
componentId: "sc-y4mgkj-0"
|
|
466
395
|
})(["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 => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
467
|
-
|
|
396
|
+
StyledDrawerHeader.defaultProps = {
|
|
468
397
|
theme: reactTheming.DEFAULT_THEME
|
|
469
398
|
};
|
|
470
399
|
|
|
471
400
|
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
472
|
-
const
|
|
401
|
+
const StyledDrawerBody = styled__default.default(StyledBody).attrs({
|
|
473
402
|
'data-garden-id': COMPONENT_ID$2,
|
|
474
|
-
'data-garden-version': '9.0.0-next.
|
|
403
|
+
'data-garden-version': '9.0.0-next.11'
|
|
475
404
|
}).withConfig({
|
|
476
|
-
displayName: "
|
|
477
|
-
componentId: "sc-
|
|
405
|
+
displayName: "StyledDrawerBody",
|
|
406
|
+
componentId: "sc-13qufyn-0"
|
|
478
407
|
})(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
479
|
-
|
|
408
|
+
StyledDrawerBody.defaultProps = {
|
|
480
409
|
theme: reactTheming.DEFAULT_THEME
|
|
481
410
|
};
|
|
482
411
|
|
|
483
412
|
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
484
|
-
const
|
|
413
|
+
const StyledDrawerFooter = styled__default.default.div.attrs({
|
|
485
414
|
'data-garden-id': COMPONENT_ID$1,
|
|
486
|
-
'data-garden-version': '9.0.0-next.
|
|
415
|
+
'data-garden-version': '9.0.0-next.11'
|
|
487
416
|
}).withConfig({
|
|
488
|
-
displayName: "
|
|
489
|
-
componentId: "sc-
|
|
490
|
-
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], props => `${props.theme.borders.sm} ${reactTheming.
|
|
491
|
-
|
|
417
|
+
displayName: "StyledDrawerFooter",
|
|
418
|
+
componentId: "sc-kc7e6p-0"
|
|
419
|
+
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], props => `${props.theme.borders.sm} ${reactTheming.getColorV8('neutralHue', 200, props.theme)}`, props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
420
|
+
StyledDrawerFooter.defaultProps = {
|
|
492
421
|
theme: reactTheming.DEFAULT_THEME
|
|
493
422
|
};
|
|
494
423
|
|
|
495
424
|
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
496
|
-
const
|
|
425
|
+
const StyledDrawerFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
497
426
|
'data-garden-id': COMPONENT_ID,
|
|
498
|
-
'data-garden-version': '9.0.0-next.
|
|
427
|
+
'data-garden-version': '9.0.0-next.11'
|
|
499
428
|
}).withConfig({
|
|
500
|
-
displayName: "
|
|
501
|
-
componentId: "sc-
|
|
429
|
+
displayName: "StyledDrawerFooterItem",
|
|
430
|
+
componentId: "sc-m2yul4-0"
|
|
502
431
|
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
503
|
-
|
|
432
|
+
StyledDrawerFooterItem.defaultProps = {
|
|
504
433
|
theme: reactTheming.DEFAULT_THEME
|
|
505
434
|
};
|
|
506
435
|
|
|
@@ -513,6 +442,105 @@ const useModalContext = () => {
|
|
|
513
442
|
return context;
|
|
514
443
|
};
|
|
515
444
|
|
|
445
|
+
const Body$2 = React.forwardRef((props, ref) => {
|
|
446
|
+
const {
|
|
447
|
+
getContentProps
|
|
448
|
+
} = useModalContext();
|
|
449
|
+
return React__namespace.default.createElement(StyledBody, Object.assign({}, getContentProps(props), {
|
|
450
|
+
ref: ref
|
|
451
|
+
}));
|
|
452
|
+
});
|
|
453
|
+
Body$2.displayName = 'Body';
|
|
454
|
+
|
|
455
|
+
var _path;
|
|
456
|
+
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); }
|
|
457
|
+
var SvgXStroke = function SvgXStroke(props) {
|
|
458
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
459
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
460
|
+
width: 16,
|
|
461
|
+
height: 16,
|
|
462
|
+
focusable: "false",
|
|
463
|
+
viewBox: "0 0 16 16",
|
|
464
|
+
"aria-hidden": "true"
|
|
465
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
466
|
+
stroke: "currentColor",
|
|
467
|
+
strokeLinecap: "round",
|
|
468
|
+
d: "M3 13L13 3m0 10L3 3"
|
|
469
|
+
})));
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const Close$2 = React.forwardRef((props, ref) => {
|
|
473
|
+
const {
|
|
474
|
+
getCloseProps,
|
|
475
|
+
setIsCloseButtonPresent
|
|
476
|
+
} = useModalContext();
|
|
477
|
+
React.useEffect(() => {
|
|
478
|
+
setIsCloseButtonPresent(true);
|
|
479
|
+
return () => setIsCloseButtonPresent(false);
|
|
480
|
+
});
|
|
481
|
+
const ariaLabel = reactTheming.useText(Close$2, props, 'aria-label', 'Close modal');
|
|
482
|
+
return React__namespace.default.createElement(StyledClose, Object.assign({}, getCloseProps({
|
|
483
|
+
...props,
|
|
484
|
+
'aria-label': ariaLabel
|
|
485
|
+
}), {
|
|
486
|
+
ref: ref
|
|
487
|
+
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
488
|
+
});
|
|
489
|
+
Close$2.displayName = 'Close';
|
|
490
|
+
|
|
491
|
+
const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
492
|
+
const {
|
|
493
|
+
isLarge
|
|
494
|
+
} = useModalContext();
|
|
495
|
+
return React__namespace.default.createElement(StyledFooter, Object.assign({
|
|
496
|
+
ref: ref,
|
|
497
|
+
isLarge: isLarge
|
|
498
|
+
}, props));
|
|
499
|
+
});
|
|
500
|
+
Footer$2.displayName = 'Footer';
|
|
501
|
+
|
|
502
|
+
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, Object.assign({
|
|
503
|
+
ref: ref
|
|
504
|
+
}, props)));
|
|
505
|
+
FooterItem$2.displayName = 'FooterItem';
|
|
506
|
+
|
|
507
|
+
const Header$1 = React.forwardRef((_ref, ref) => {
|
|
508
|
+
let {
|
|
509
|
+
children,
|
|
510
|
+
tag,
|
|
511
|
+
...other
|
|
512
|
+
} = _ref;
|
|
513
|
+
const {
|
|
514
|
+
isCloseButtonPresent,
|
|
515
|
+
hasHeader,
|
|
516
|
+
setHasHeader,
|
|
517
|
+
getTitleProps
|
|
518
|
+
} = useModalContext();
|
|
519
|
+
React.useEffect(() => {
|
|
520
|
+
if (!hasHeader && setHasHeader) {
|
|
521
|
+
setHasHeader(true);
|
|
522
|
+
}
|
|
523
|
+
return () => {
|
|
524
|
+
if (hasHeader && setHasHeader) {
|
|
525
|
+
setHasHeader(false);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
}, [hasHeader, setHasHeader]);
|
|
529
|
+
return React__namespace.default.createElement(StyledHeader, Object.assign({}, getTitleProps(other), {
|
|
530
|
+
as: tag,
|
|
531
|
+
isCloseButtonPresent: isCloseButtonPresent,
|
|
532
|
+
ref: ref
|
|
533
|
+
}), other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
534
|
+
});
|
|
535
|
+
Header$1.displayName = 'Header';
|
|
536
|
+
Header$1.propTypes = {
|
|
537
|
+
isDanger: PropTypes__default.default.bool,
|
|
538
|
+
tag: PropTypes__default.default.any
|
|
539
|
+
};
|
|
540
|
+
Header$1.defaultProps = {
|
|
541
|
+
tag: 'div'
|
|
542
|
+
};
|
|
543
|
+
|
|
516
544
|
const isOverflowing = element => {
|
|
517
545
|
const doc = ownerDocument__default.default(element);
|
|
518
546
|
const win = ownerWindow__default.default(doc);
|
|
@@ -525,7 +553,7 @@ const isOverflowing = element => {
|
|
|
525
553
|
const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
|
|
526
554
|
return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
|
|
527
555
|
};
|
|
528
|
-
const
|
|
556
|
+
const ModalComponent = React.forwardRef((_ref, ref) => {
|
|
529
557
|
let {
|
|
530
558
|
backdropProps,
|
|
531
559
|
children,
|
|
@@ -557,10 +585,6 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
557
585
|
focusOnMount,
|
|
558
586
|
restoreFocus
|
|
559
587
|
});
|
|
560
|
-
containerFocusvisible.useFocusVisible({
|
|
561
|
-
scope: modalRef,
|
|
562
|
-
relativeDocument: environment
|
|
563
|
-
});
|
|
564
588
|
React.useEffect(() => {
|
|
565
589
|
if (!environment) {
|
|
566
590
|
return undefined;
|
|
@@ -618,7 +642,7 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
618
642
|
const defaultValue = hasHeader ? modalContainerProps['aria-labelledby'] : 'Modal dialog';
|
|
619
643
|
const labelValue = hasHeader ? modalContainerProps['aria-labelledby'] : modalProps['aria-label'];
|
|
620
644
|
const ariaProps = {
|
|
621
|
-
[attribute]: reactTheming.useText(
|
|
645
|
+
[attribute]: reactTheming.useText(ModalComponent, {
|
|
622
646
|
[attribute]: labelValue
|
|
623
647
|
}, attribute, defaultValue)
|
|
624
648
|
};
|
|
@@ -627,10 +651,10 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
627
651
|
}
|
|
628
652
|
return ReactDOM.createPortal( React__namespace.default.createElement(ModalsContext.Provider, {
|
|
629
653
|
value: value
|
|
630
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
654
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
631
655
|
isCentered: isCentered,
|
|
632
656
|
isAnimated: isAnimated
|
|
633
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal,
|
|
657
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal, Object.assign({
|
|
634
658
|
isCentered: isCentered,
|
|
635
659
|
isAnimated: isAnimated,
|
|
636
660
|
isLarge: isLarge
|
|
@@ -638,8 +662,8 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
638
662
|
ref: reactMergeRefs.mergeRefs([ref, modalRef])
|
|
639
663
|
}), children))), rootNode);
|
|
640
664
|
});
|
|
641
|
-
|
|
642
|
-
|
|
665
|
+
ModalComponent.displayName = 'Modal';
|
|
666
|
+
ModalComponent.propTypes = {
|
|
643
667
|
backdropProps: PropTypes__default.default.object,
|
|
644
668
|
isLarge: PropTypes__default.default.bool,
|
|
645
669
|
isAnimated: PropTypes__default.default.bool,
|
|
@@ -649,109 +673,16 @@ Modal.propTypes = {
|
|
|
649
673
|
onClose: PropTypes__default.default.func,
|
|
650
674
|
appendToNode: PropTypes__default.default.any
|
|
651
675
|
};
|
|
652
|
-
|
|
676
|
+
ModalComponent.defaultProps = {
|
|
653
677
|
isAnimated: true,
|
|
654
678
|
isCentered: true
|
|
655
679
|
};
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
ref: ref
|
|
663
|
-
}));
|
|
664
|
-
});
|
|
665
|
-
Body$2.displayName = 'Body';
|
|
666
|
-
|
|
667
|
-
var _path;
|
|
668
|
-
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); }
|
|
669
|
-
var SvgXStroke = function SvgXStroke(props) {
|
|
670
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
671
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
672
|
-
width: 16,
|
|
673
|
-
height: 16,
|
|
674
|
-
focusable: "false",
|
|
675
|
-
viewBox: "0 0 16 16",
|
|
676
|
-
"aria-hidden": "true"
|
|
677
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
678
|
-
stroke: "currentColor",
|
|
679
|
-
strokeLinecap: "round",
|
|
680
|
-
d: "M3 13L13 3m0 10L3 3"
|
|
681
|
-
})));
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
const Close$2 = React.forwardRef((props, ref) => {
|
|
685
|
-
const {
|
|
686
|
-
getCloseProps,
|
|
687
|
-
setIsCloseButtonPresent
|
|
688
|
-
} = useModalContext();
|
|
689
|
-
React.useEffect(() => {
|
|
690
|
-
setIsCloseButtonPresent(true);
|
|
691
|
-
return () => setIsCloseButtonPresent(false);
|
|
692
|
-
});
|
|
693
|
-
const ariaLabel = reactTheming.useText(Close$2, props, 'aria-label', 'Close modal');
|
|
694
|
-
return React__namespace.default.createElement(StyledClose, _extends$2({}, getCloseProps({
|
|
695
|
-
...props,
|
|
696
|
-
'aria-label': ariaLabel
|
|
697
|
-
}), {
|
|
698
|
-
ref: ref
|
|
699
|
-
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
700
|
-
});
|
|
701
|
-
Close$2.displayName = 'Close';
|
|
702
|
-
|
|
703
|
-
const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
704
|
-
const {
|
|
705
|
-
isLarge
|
|
706
|
-
} = useModalContext();
|
|
707
|
-
return React__namespace.default.createElement(StyledFooter, _extends$2({
|
|
708
|
-
ref: ref,
|
|
709
|
-
isLarge: isLarge
|
|
710
|
-
}, props));
|
|
711
|
-
});
|
|
712
|
-
Footer$2.displayName = 'Footer';
|
|
713
|
-
|
|
714
|
-
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, _extends$2({
|
|
715
|
-
ref: ref
|
|
716
|
-
}, props)));
|
|
717
|
-
FooterItem$2.displayName = 'FooterItem';
|
|
718
|
-
|
|
719
|
-
const Header$1 = React.forwardRef((_ref, ref) => {
|
|
720
|
-
let {
|
|
721
|
-
children,
|
|
722
|
-
tag,
|
|
723
|
-
...other
|
|
724
|
-
} = _ref;
|
|
725
|
-
const {
|
|
726
|
-
isCloseButtonPresent,
|
|
727
|
-
hasHeader,
|
|
728
|
-
setHasHeader,
|
|
729
|
-
getTitleProps
|
|
730
|
-
} = useModalContext();
|
|
731
|
-
React.useEffect(() => {
|
|
732
|
-
if (!hasHeader && setHasHeader) {
|
|
733
|
-
setHasHeader(true);
|
|
734
|
-
}
|
|
735
|
-
return () => {
|
|
736
|
-
if (hasHeader && setHasHeader) {
|
|
737
|
-
setHasHeader(false);
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
|
-
}, [hasHeader, setHasHeader]);
|
|
741
|
-
return React__namespace.default.createElement(StyledHeader, _extends$2({}, getTitleProps(other), {
|
|
742
|
-
as: tag,
|
|
743
|
-
isCloseButtonPresent: isCloseButtonPresent,
|
|
744
|
-
ref: ref
|
|
745
|
-
}), other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
746
|
-
});
|
|
747
|
-
Header$1.displayName = 'Header';
|
|
748
|
-
Header$1.propTypes = {
|
|
749
|
-
isDanger: PropTypes__default.default.bool,
|
|
750
|
-
tag: PropTypes__default.default.any
|
|
751
|
-
};
|
|
752
|
-
Header$1.defaultProps = {
|
|
753
|
-
tag: 'div'
|
|
754
|
-
};
|
|
680
|
+
const Modal = ModalComponent;
|
|
681
|
+
Modal.Body = Body$2;
|
|
682
|
+
Modal.Close = Close$2;
|
|
683
|
+
Modal.Footer = Footer$2;
|
|
684
|
+
Modal.FooterItem = FooterItem$2;
|
|
685
|
+
Modal.Header = Header$1;
|
|
755
686
|
|
|
756
687
|
const TooltipModalContext = React.createContext(undefined);
|
|
757
688
|
const useTooltipModalContext = () => {
|
|
@@ -783,7 +714,7 @@ const TitleComponent = React.forwardRef((_ref, ref) => {
|
|
|
783
714
|
}
|
|
784
715
|
};
|
|
785
716
|
}, [hasTitle, setHasTitle]);
|
|
786
|
-
return React__namespace.default.createElement(StyledTooltipModalTitle,
|
|
717
|
+
return React__namespace.default.createElement(StyledTooltipModalTitle, Object.assign({}, getTitleProps(other), {
|
|
787
718
|
as: tag,
|
|
788
719
|
ref: ref
|
|
789
720
|
}), children);
|
|
@@ -801,7 +732,7 @@ const BodyComponent$1 = React.forwardRef((props, ref) => {
|
|
|
801
732
|
const {
|
|
802
733
|
getContentProps
|
|
803
734
|
} = useTooltipModalContext();
|
|
804
|
-
return React__namespace.default.createElement(StyledTooltipModalBody,
|
|
735
|
+
return React__namespace.default.createElement(StyledTooltipModalBody, Object.assign({}, getContentProps(props), {
|
|
805
736
|
ref: ref
|
|
806
737
|
}));
|
|
807
738
|
});
|
|
@@ -813,7 +744,7 @@ const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
|
813
744
|
getCloseProps
|
|
814
745
|
} = useTooltipModalContext();
|
|
815
746
|
const ariaLabel = reactTheming.useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
816
|
-
return React__namespace.default.createElement(StyledTooltipModalClose,
|
|
747
|
+
return React__namespace.default.createElement(StyledTooltipModalClose, Object.assign({}, getCloseProps({
|
|
817
748
|
...props,
|
|
818
749
|
'aria-label': ariaLabel
|
|
819
750
|
}), {
|
|
@@ -823,24 +754,24 @@ const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
|
823
754
|
CloseComponent$1.displayName = 'TooltipModal.Close';
|
|
824
755
|
const Close$1 = CloseComponent$1;
|
|
825
756
|
|
|
826
|
-
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter,
|
|
757
|
+
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter, Object.assign({
|
|
827
758
|
ref: ref
|
|
828
759
|
}, props)));
|
|
829
760
|
FooterComponent$1.displayName = 'TooltipModal.Footer';
|
|
830
761
|
const Footer$1 = FooterComponent$1;
|
|
831
762
|
|
|
832
|
-
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem,
|
|
763
|
+
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem, Object.assign({
|
|
833
764
|
ref: ref
|
|
834
765
|
}, props)));
|
|
835
766
|
FooterItemComponent$1.displayName = 'TooltipModal.FooterItem';
|
|
836
767
|
const FooterItem$1 = FooterItemComponent$1;
|
|
837
768
|
|
|
769
|
+
const PLACEMENT_DEFAULT = 'top';
|
|
838
770
|
const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
839
771
|
let {
|
|
840
772
|
appendToNode,
|
|
841
773
|
referenceElement,
|
|
842
|
-
|
|
843
|
-
placement,
|
|
774
|
+
placement: _placement,
|
|
844
775
|
onClose,
|
|
845
776
|
hasArrow,
|
|
846
777
|
isAnimated,
|
|
@@ -851,11 +782,11 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
851
782
|
id,
|
|
852
783
|
...props
|
|
853
784
|
} = _ref;
|
|
854
|
-
const theme = React.useContext(styled.ThemeContext);
|
|
785
|
+
const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME;
|
|
855
786
|
const previousReferenceElementRef = React.useRef();
|
|
856
787
|
const modalRef = React.useRef(null);
|
|
857
788
|
const transitionRef = React.useRef(null);
|
|
858
|
-
const [
|
|
789
|
+
const [floatingElement, setFloatingElement] = React.useState();
|
|
859
790
|
const [hasTitle, setHasTitle] = React.useState(false);
|
|
860
791
|
const {
|
|
861
792
|
getTitleProps,
|
|
@@ -870,27 +801,41 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
870
801
|
focusOnMount,
|
|
871
802
|
restoreFocus: false
|
|
872
803
|
});
|
|
804
|
+
const [floatingPlacement] = reactTheming.getFloatingPlacements(theme, _placement === 'auto' ? PLACEMENT_DEFAULT : _placement);
|
|
805
|
+
const {
|
|
806
|
+
refs,
|
|
807
|
+
placement,
|
|
808
|
+
update,
|
|
809
|
+
floatingStyles: {
|
|
810
|
+
transform
|
|
811
|
+
}
|
|
812
|
+
} = reactDom.useFloating({
|
|
813
|
+
platform: {
|
|
814
|
+
...reactDom.platform,
|
|
815
|
+
isRTL: () => theme.rtl
|
|
816
|
+
},
|
|
817
|
+
elements: {
|
|
818
|
+
reference: referenceElement,
|
|
819
|
+
floating: floatingElement
|
|
820
|
+
},
|
|
821
|
+
placement: floatingPlacement,
|
|
822
|
+
middleware: [reactDom.offset(theme.space.base * 3), _placement === 'auto' ? reactDom.autoPlacement() : undefined]
|
|
823
|
+
});
|
|
824
|
+
React.useEffect(() => {
|
|
825
|
+
let cleanup;
|
|
826
|
+
if (referenceElement && floatingElement && refs.reference.current && refs.floating.current) {
|
|
827
|
+
cleanup = reactDom.autoUpdate(refs.reference.current, refs.floating.current, update, {
|
|
828
|
+
elementResize: typeof ResizeObserver === 'function'
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
return () => cleanup && cleanup();
|
|
832
|
+
}, [referenceElement, floatingElement, refs.reference, refs.floating, update]);
|
|
873
833
|
React.useEffect(() => {
|
|
874
834
|
if (!referenceElement && previousReferenceElementRef.current && restoreFocus) {
|
|
875
835
|
previousReferenceElementRef.current.focus();
|
|
876
836
|
}
|
|
877
837
|
previousReferenceElementRef.current = referenceElement;
|
|
878
838
|
}, [referenceElement, restoreFocus]);
|
|
879
|
-
const popperPlacement = React.useMemo(() => theme.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement), [placement, theme.rtl]);
|
|
880
|
-
const {
|
|
881
|
-
styles,
|
|
882
|
-
attributes,
|
|
883
|
-
state
|
|
884
|
-
} = reactPopper.usePopper(referenceElement, popperElement, {
|
|
885
|
-
placement: popperPlacement,
|
|
886
|
-
modifiers: [{
|
|
887
|
-
name: 'offset',
|
|
888
|
-
options: {
|
|
889
|
-
offset: [0, theme.space.base * 3]
|
|
890
|
-
}
|
|
891
|
-
},
|
|
892
|
-
...(popperModifiers || [])]
|
|
893
|
-
});
|
|
894
839
|
const modalProps = getModalProps({
|
|
895
840
|
'aria-describedby': undefined,
|
|
896
841
|
...(hasTitle ? {} : {
|
|
@@ -921,17 +866,19 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
921
866
|
}, transitionState => {
|
|
922
867
|
return React__namespace.default.createElement(TooltipModalContext.Provider, {
|
|
923
868
|
value: value
|
|
924
|
-
}, React__namespace.default.createElement(StyledTooltipModalBackdrop,
|
|
869
|
+
}, React__namespace.default.createElement(StyledTooltipModalBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
925
870
|
ref: transitionRef
|
|
926
|
-
}), React__namespace.default.createElement(StyledTooltipWrapper,
|
|
927
|
-
ref:
|
|
928
|
-
style:
|
|
929
|
-
|
|
871
|
+
}), React__namespace.default.createElement(StyledTooltipWrapper, {
|
|
872
|
+
ref: setFloatingElement,
|
|
873
|
+
style: {
|
|
874
|
+
transform
|
|
875
|
+
},
|
|
876
|
+
placement: placement,
|
|
930
877
|
zIndex: zIndex,
|
|
931
878
|
isAnimated: isAnimated
|
|
932
|
-
},
|
|
879
|
+
}, React__namespace.default.createElement(StyledTooltipModal, Object.assign({
|
|
933
880
|
transitionState: transitionState,
|
|
934
|
-
placement:
|
|
881
|
+
placement: placement,
|
|
935
882
|
hasArrow: hasArrow,
|
|
936
883
|
isAnimated: isAnimated
|
|
937
884
|
}, modalProps, ariaProps, props, {
|
|
@@ -950,7 +897,6 @@ TooltipModalComponent.defaultProps = {
|
|
|
950
897
|
TooltipModalComponent.propTypes = {
|
|
951
898
|
appendToNode: PropTypes__default.default.any,
|
|
952
899
|
referenceElement: PropTypes__default.default.any,
|
|
953
|
-
popperModifiers: PropTypes__default.default.any,
|
|
954
900
|
placement: PropTypes__default.default.any,
|
|
955
901
|
isAnimated: PropTypes__default.default.bool,
|
|
956
902
|
hasArrow: PropTypes__default.default.bool,
|
|
@@ -988,13 +934,13 @@ const HeaderComponent = React.forwardRef((_ref, ref) => {
|
|
|
988
934
|
}
|
|
989
935
|
};
|
|
990
936
|
}, [hasHeader, setHasHeader]);
|
|
991
|
-
return React__namespace.default.createElement(
|
|
937
|
+
return React__namespace.default.createElement(StyledDrawerHeader, Object.assign({}, getTitleProps(other), {
|
|
992
938
|
as: tag,
|
|
993
939
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
994
940
|
ref: ref
|
|
995
941
|
}));
|
|
996
942
|
});
|
|
997
|
-
HeaderComponent.displayName = '
|
|
943
|
+
HeaderComponent.displayName = 'Drawer.Header';
|
|
998
944
|
HeaderComponent.propTypes = {
|
|
999
945
|
tag: PropTypes__default.default.any
|
|
1000
946
|
};
|
|
@@ -1007,11 +953,11 @@ const BodyComponent = React.forwardRef((props, ref) => {
|
|
|
1007
953
|
const {
|
|
1008
954
|
getContentProps
|
|
1009
955
|
} = useModalContext();
|
|
1010
|
-
return React__namespace.default.createElement(
|
|
956
|
+
return React__namespace.default.createElement(StyledDrawerBody, Object.assign({}, getContentProps(props), {
|
|
1011
957
|
ref: ref
|
|
1012
958
|
}), props.children);
|
|
1013
959
|
});
|
|
1014
|
-
BodyComponent.displayName = '
|
|
960
|
+
BodyComponent.displayName = 'Drawer.Body';
|
|
1015
961
|
const Body = BodyComponent;
|
|
1016
962
|
|
|
1017
963
|
const CloseComponent = React.forwardRef((props, ref) => {
|
|
@@ -1024,29 +970,29 @@ const CloseComponent = React.forwardRef((props, ref) => {
|
|
|
1024
970
|
return () => setIsCloseButtonPresent(false);
|
|
1025
971
|
});
|
|
1026
972
|
const ariaLabel = reactTheming.useText(CloseComponent, props, 'aria-label', 'Close drawer');
|
|
1027
|
-
return React__namespace.default.createElement(
|
|
973
|
+
return React__namespace.default.createElement(StyledDrawerClose, Object.assign({}, getCloseProps({
|
|
1028
974
|
...props,
|
|
1029
975
|
'aria-label': ariaLabel
|
|
1030
976
|
}), {
|
|
1031
977
|
ref: ref
|
|
1032
978
|
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
1033
979
|
});
|
|
1034
|
-
CloseComponent.displayName = '
|
|
980
|
+
CloseComponent.displayName = 'Drawer.Close';
|
|
1035
981
|
const Close = CloseComponent;
|
|
1036
982
|
|
|
1037
|
-
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(
|
|
983
|
+
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooter, Object.assign({
|
|
1038
984
|
ref: ref
|
|
1039
985
|
}, props)));
|
|
1040
|
-
FooterComponent.displayName = '
|
|
986
|
+
FooterComponent.displayName = 'Drawer.Footer';
|
|
1041
987
|
const Footer = FooterComponent;
|
|
1042
988
|
|
|
1043
|
-
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(
|
|
989
|
+
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooterItem, Object.assign({
|
|
1044
990
|
ref: ref
|
|
1045
991
|
}, props)));
|
|
1046
|
-
FooterItemComponent.displayName = '
|
|
992
|
+
FooterItemComponent.displayName = 'Drawer.FooterItem';
|
|
1047
993
|
const FooterItem = FooterItemComponent;
|
|
1048
994
|
|
|
1049
|
-
const
|
|
995
|
+
const DrawerComponent = React.forwardRef((_ref, ref) => {
|
|
1050
996
|
let {
|
|
1051
997
|
id,
|
|
1052
998
|
isOpen,
|
|
@@ -1064,10 +1010,6 @@ const DrawerModalComponent = React.forwardRef((_ref, ref) => {
|
|
|
1064
1010
|
const environment = reactTheming.useDocument(theme);
|
|
1065
1011
|
const [isCloseButtonPresent, setIsCloseButtonPresent] = React.useState(false);
|
|
1066
1012
|
const [hasHeader, setHasHeader] = React.useState(false);
|
|
1067
|
-
containerFocusvisible.useFocusVisible({
|
|
1068
|
-
scope: modalRef,
|
|
1069
|
-
relativeDocument: modalRef.current
|
|
1070
|
-
});
|
|
1071
1013
|
const {
|
|
1072
1014
|
getTitleProps,
|
|
1073
1015
|
getCloseProps,
|
|
@@ -1146,7 +1088,7 @@ const DrawerModalComponent = React.forwardRef((_ref, ref) => {
|
|
|
1146
1088
|
const defaultValue = hasHeader ? modalProps['aria-labelledby'] : 'Modal dialog';
|
|
1147
1089
|
const labelValue = hasHeader ? modalProps['aria-labelledby'] : props['aria-label'];
|
|
1148
1090
|
const ariaProps = {
|
|
1149
|
-
[attribute]: reactTheming.useText(
|
|
1091
|
+
[attribute]: reactTheming.useText(DrawerComponent, {
|
|
1150
1092
|
[attribute]: labelValue
|
|
1151
1093
|
}, attribute, defaultValue)
|
|
1152
1094
|
};
|
|
@@ -1161,14 +1103,14 @@ const DrawerModalComponent = React.forwardRef((_ref, ref) => {
|
|
|
1161
1103
|
unmountOnExit: true,
|
|
1162
1104
|
classNames: "garden-drawer-transition",
|
|
1163
1105
|
nodeRef: transitionRef
|
|
1164
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
1106
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
1165
1107
|
isAnimated: true
|
|
1166
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(
|
|
1108
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledDrawer, Object.assign({}, modalProps, ariaProps, props, {
|
|
1167
1109
|
ref: reactMergeRefs.mergeRefs([ref, modalRef, transitionRef])
|
|
1168
1110
|
}))))), rootNode);
|
|
1169
1111
|
});
|
|
1170
|
-
|
|
1171
|
-
|
|
1112
|
+
DrawerComponent.displayName = 'Drawer';
|
|
1113
|
+
DrawerComponent.propTypes = {
|
|
1172
1114
|
backdropProps: PropTypes__default.default.object,
|
|
1173
1115
|
focusOnMount: PropTypes__default.default.bool,
|
|
1174
1116
|
restoreFocus: PropTypes__default.default.bool,
|
|
@@ -1176,22 +1118,22 @@ DrawerModalComponent.propTypes = {
|
|
|
1176
1118
|
appendToNode: PropTypes__default.default.any,
|
|
1177
1119
|
isOpen: PropTypes__default.default.bool
|
|
1178
1120
|
};
|
|
1179
|
-
|
|
1121
|
+
DrawerComponent.defaultProps = {
|
|
1180
1122
|
focusOnMount: true ,
|
|
1181
1123
|
restoreFocus: true
|
|
1182
1124
|
};
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1125
|
+
const Drawer = DrawerComponent;
|
|
1126
|
+
Drawer.Body = Body;
|
|
1127
|
+
Drawer.Close = Close;
|
|
1128
|
+
Drawer.Footer = Footer;
|
|
1129
|
+
Drawer.FooterItem = FooterItem;
|
|
1130
|
+
Drawer.Header = Header;
|
|
1189
1131
|
|
|
1190
|
-
const PLACEMENT = ['auto',
|
|
1132
|
+
const PLACEMENT = ['auto', ...reactTheming.PLACEMENT];
|
|
1191
1133
|
|
|
1192
1134
|
exports.Body = Body$2;
|
|
1193
1135
|
exports.Close = Close$2;
|
|
1194
|
-
exports.
|
|
1136
|
+
exports.Drawer = Drawer;
|
|
1195
1137
|
exports.Footer = Footer$2;
|
|
1196
1138
|
exports.FooterItem = FooterItem$2;
|
|
1197
1139
|
exports.Header = Header$1;
|