@zendeskgarden/react-modals 9.0.0-next.2 → 9.0.0-next.21
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 +10 -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 +50 -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 +49 -0
- package/dist/esm/styled/StyledBody.js +30 -0
- package/dist/esm/styled/StyledClose.js +28 -0
- package/dist/esm/styled/StyledDangerIcon.js +19 -0
- package/dist/esm/styled/StyledDrawer.js +44 -0
- package/dist/esm/styled/StyledDrawerBody.js +23 -0
- package/dist/esm/styled/StyledDrawerClose.js +28 -0
- package/dist/esm/styled/StyledDrawerFooter.js +30 -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 +38 -0
- package/dist/esm/styled/StyledModal.js +58 -0
- package/dist/esm/styled/StyledTooltipModal.js +33 -0
- package/dist/esm/styled/StyledTooltipModalBackdrop.js +22 -0
- package/dist/esm/styled/StyledTooltipModalBody.js +30 -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 +36 -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 +272 -215
- package/dist/typings/elements/Body.d.ts +2 -0
- package/dist/typings/elements/Close.d.ts +2 -0
- 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 +1 -1
- package/dist/typings/styled/StyledClose.d.ts +2 -5
- package/dist/typings/styled/StyledDrawerClose.d.ts +2 -1
- package/dist/typings/styled/StyledHeader.d.ts +2 -1
- package/dist/typings/styled/StyledTooltipModalClose.d.ts +2 -1
- package/package.json +9 -9
- package/dist/index.esm.js +0 -1115
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,13 +12,13 @@ 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');
|
|
21
|
+
var reactButtons = require('@zendeskgarden/react-buttons');
|
|
23
22
|
var reactTransitionGroup = require('react-transition-group');
|
|
24
23
|
var reactDom = require('@floating-ui/react-dom');
|
|
25
24
|
var activeElement = require('dom-helpers/activeElement');
|
|
@@ -55,21 +54,6 @@ var css__default = /*#__PURE__*/_interopDefault(css);
|
|
|
55
54
|
var getScrollbarSize__default = /*#__PURE__*/_interopDefault(getScrollbarSize);
|
|
56
55
|
var activeElement__default = /*#__PURE__*/_interopDefault(activeElement);
|
|
57
56
|
|
|
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
57
|
const COMPONENT_ID$j = 'modals.backdrop';
|
|
74
58
|
const animationName$1 = styled.keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
75
59
|
const animationStyles$1 = props => {
|
|
@@ -80,11 +64,26 @@ const animationStyles$1 = props => {
|
|
|
80
64
|
};
|
|
81
65
|
const StyledBackdrop = styled__default.default.div.attrs({
|
|
82
66
|
'data-garden-id': COMPONENT_ID$j,
|
|
83
|
-
'data-garden-version': '9.0.0-next.
|
|
67
|
+
'data-garden-version': '9.0.0-next.21'
|
|
84
68
|
}).withConfig({
|
|
85
69
|
displayName: "StyledBackdrop",
|
|
86
70
|
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',
|
|
71
|
+
})(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.isCentered && 'center', props => props.isCentered && 'center', _ref => {
|
|
72
|
+
let {
|
|
73
|
+
theme
|
|
74
|
+
} = _ref;
|
|
75
|
+
return reactTheming.getColor({
|
|
76
|
+
theme,
|
|
77
|
+
hue: 'neutralHue',
|
|
78
|
+
transparency: theme.opacity[1000],
|
|
79
|
+
light: {
|
|
80
|
+
shade: 900
|
|
81
|
+
},
|
|
82
|
+
dark: {
|
|
83
|
+
shade: 1200
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
88
87
|
StyledBackdrop.defaultProps = {
|
|
89
88
|
theme: reactTheming.DEFAULT_THEME
|
|
90
89
|
};
|
|
@@ -96,36 +95,36 @@ StyledBackdrop.propTypes = {
|
|
|
96
95
|
const COMPONENT_ID$i = 'modals.body';
|
|
97
96
|
const StyledBody = styled__default.default.div.attrs({
|
|
98
97
|
'data-garden-id': COMPONENT_ID$i,
|
|
99
|
-
'data-garden-version': '9.0.0-next.
|
|
98
|
+
'data-garden-version': '9.0.0-next.21'
|
|
100
99
|
}).withConfig({
|
|
101
100
|
displayName: "StyledBody",
|
|
102
101
|
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),
|
|
102
|
+
})(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
|
|
103
|
+
let {
|
|
104
|
+
theme
|
|
105
|
+
} = _ref;
|
|
106
|
+
return reactTheming.getColor({
|
|
107
|
+
theme,
|
|
108
|
+
variable: 'foreground.default'
|
|
109
|
+
});
|
|
110
|
+
}, props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
104
111
|
StyledBody.defaultProps = {
|
|
105
112
|
theme: reactTheming.DEFAULT_THEME
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
const COMPONENT_ID$h = 'modals.close';
|
|
109
|
-
const colorStyles = props => {
|
|
110
|
-
const backgroundColor = 'primaryHue';
|
|
111
|
-
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.getColor(foregroundColor, 600, props.theme), reactTheming.getColor(backgroundColor, 600, props.theme, 0.08), reactTheming.getColor(foregroundColor, 700, props.theme), reactTheming.focusStyles({
|
|
113
|
-
theme: props.theme,
|
|
114
|
-
hue: backgroundColor
|
|
115
|
-
}), reactTheming.getColor(backgroundColor, 600, props.theme, 0.2), reactTheming.getColor(foregroundColor, 800, props.theme));
|
|
116
|
-
};
|
|
117
116
|
const BASE_MULTIPLIERS$1 = {
|
|
118
117
|
top: 2.5,
|
|
119
118
|
side: 6.5,
|
|
120
119
|
size: 10
|
|
121
120
|
};
|
|
122
|
-
const StyledClose = styled__default.default.
|
|
121
|
+
const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
123
122
|
'data-garden-id': COMPONENT_ID$h,
|
|
124
|
-
'data-garden-version': '9.0.0-next.
|
|
123
|
+
'data-garden-version': '9.0.0-next.21'
|
|
125
124
|
}).withConfig({
|
|
126
125
|
displayName: "StyledClose",
|
|
127
126
|
componentId: "sc-iseudj-0"
|
|
128
|
-
})(["
|
|
127
|
+
})(["position:absolute;top:", "px;", ":", ";", ";"], props => props.theme.space.base * BASE_MULTIPLIERS$1.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS$1.side}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
129
128
|
StyledClose.defaultProps = {
|
|
130
129
|
theme: reactTheming.DEFAULT_THEME
|
|
131
130
|
};
|
|
@@ -133,11 +132,11 @@ StyledClose.defaultProps = {
|
|
|
133
132
|
const COMPONENT_ID$g = 'modals.footer';
|
|
134
133
|
const StyledFooter = styled__default.default.div.attrs({
|
|
135
134
|
'data-garden-id': COMPONENT_ID$g,
|
|
136
|
-
'data-garden-version': '9.0.0-next.
|
|
135
|
+
'data-garden-version': '9.0.0-next.21'
|
|
137
136
|
}).withConfig({
|
|
138
137
|
displayName: "StyledFooter",
|
|
139
138
|
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.
|
|
139
|
+
})(["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
140
|
StyledFooter.defaultProps = {
|
|
142
141
|
theme: reactTheming.DEFAULT_THEME
|
|
143
142
|
};
|
|
@@ -145,7 +144,7 @@ StyledFooter.defaultProps = {
|
|
|
145
144
|
const COMPONENT_ID$f = 'modals.footer_item';
|
|
146
145
|
const StyledFooterItem = styled__default.default.span.attrs({
|
|
147
146
|
'data-garden-id': COMPONENT_ID$f,
|
|
148
|
-
'data-garden-version': '9.0.0-next.
|
|
147
|
+
'data-garden-version': '9.0.0-next.21'
|
|
149
148
|
}).withConfig({
|
|
150
149
|
displayName: "StyledFooterItem",
|
|
151
150
|
componentId: "sc-1mb76hl-0"
|
|
@@ -155,19 +154,34 @@ StyledFooterItem.defaultProps = {
|
|
|
155
154
|
};
|
|
156
155
|
|
|
157
156
|
const COMPONENT_ID$e = 'modals.header';
|
|
157
|
+
const colorStyles$2 = _ref => {
|
|
158
|
+
let {
|
|
159
|
+
isDanger,
|
|
160
|
+
theme
|
|
161
|
+
} = _ref;
|
|
162
|
+
const bottomBorderColor = reactTheming.getColor({
|
|
163
|
+
theme,
|
|
164
|
+
variable: 'border.subtle'
|
|
165
|
+
});
|
|
166
|
+
const color = reactTheming.getColor({
|
|
167
|
+
theme,
|
|
168
|
+
variable: isDanger ? 'foreground.danger' : 'foreground.default'
|
|
169
|
+
});
|
|
170
|
+
return styled.css(["border-bottom-color:", ";color:", ";"], bottomBorderColor, color);
|
|
171
|
+
};
|
|
158
172
|
const StyledHeader = styled__default.default.div.attrs({
|
|
159
173
|
'data-garden-id': COMPONENT_ID$e,
|
|
160
|
-
'data-garden-version': '9.0.0-next.
|
|
174
|
+
'data-garden-version': '9.0.0-next.21'
|
|
161
175
|
}).withConfig({
|
|
162
176
|
displayName: "StyledHeader",
|
|
163
177
|
componentId: "sc-1787r9v-0"
|
|
164
|
-
})(["display:block;position:", ";margin:0;border-bottom:", "
|
|
178
|
+
})(["display:block;position:", ";margin:0;border-bottom:", ";padding:", ";", " line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS$1.size + BASE_MULTIPLIERS$1.side + 2)}px;`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
165
179
|
StyledHeader.defaultProps = {
|
|
166
180
|
theme: reactTheming.DEFAULT_THEME
|
|
167
181
|
};
|
|
168
182
|
|
|
169
183
|
var _g, _circle;
|
|
170
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
184
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
171
185
|
var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
172
186
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
173
187
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -210,29 +224,37 @@ const animationStyles = props => {
|
|
|
210
224
|
}
|
|
211
225
|
return '';
|
|
212
226
|
};
|
|
213
|
-
const
|
|
214
|
-
|
|
227
|
+
const colorStyles$1 = _ref => {
|
|
228
|
+
let {
|
|
215
229
|
theme
|
|
216
|
-
} =
|
|
217
|
-
const {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
|
|
230
|
+
} = _ref;
|
|
231
|
+
const offsetY = `${theme.space.base * 5}px`;
|
|
232
|
+
const blurRadius = `${theme.space.base * 7}px`;
|
|
233
|
+
const shadowColor = reactTheming.getColor({
|
|
234
|
+
variable: 'shadow.large',
|
|
235
|
+
theme
|
|
236
|
+
});
|
|
237
|
+
const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
|
|
238
|
+
const borderColor = reactTheming.getColor({
|
|
239
|
+
theme,
|
|
240
|
+
variable: 'border.default'
|
|
241
|
+
});
|
|
242
|
+
const backgroundColor = reactTheming.getColor({
|
|
243
|
+
theme,
|
|
244
|
+
variable: 'background.raised'
|
|
245
|
+
});
|
|
246
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
|
|
225
247
|
};
|
|
226
248
|
const sizeStyles$1 = props => {
|
|
227
249
|
return styled.css(["", "{width:", ";}"], reactTheming.mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
|
|
228
250
|
};
|
|
229
251
|
const StyledModal = styled__default.default.div.attrs({
|
|
230
252
|
'data-garden-id': COMPONENT_ID$d,
|
|
231
|
-
'data-garden-version': '9.0.0-next.
|
|
253
|
+
'data-garden-version': '9.0.0-next.21'
|
|
232
254
|
}).withConfig({
|
|
233
255
|
displayName: "StyledModal",
|
|
234
256
|
componentId: "sc-1pe1axu-0"
|
|
235
|
-
})(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border
|
|
257
|
+
})(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border:", ";border-radius:", ";min-height:60px;max-height:calc(100vh - ", "px);overflow:auto;direction:", ";", ";", ";", ";&:focus{outline:none;}@media (max-height:399px){top:", "px;bottom:auto;margin-bottom:", "px;max-height:none;}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){right:", ";bottom:", ";transform:", ";}", ";"], props => props.isCentered ? '0' : `${props.theme.space.base * 12}px`, props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => props.theme.space.base * 24, props => props.theme.rtl && 'rtl', animationStyles, sizeStyles$1, colorStyles$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
258
|
StyledModal.propTypes = {
|
|
237
259
|
isLarge: PropTypes__default.default.bool,
|
|
238
260
|
isAnimated: PropTypes__default.default.bool
|
|
@@ -244,7 +266,7 @@ StyledModal.defaultProps = {
|
|
|
244
266
|
const COMPONENT_ID$c = 'modals.tooltip_modal.backdrop';
|
|
245
267
|
const StyledTooltipModalBackdrop = styled__default.default.div.attrs({
|
|
246
268
|
'data-garden-id': COMPONENT_ID$c,
|
|
247
|
-
'data-garden-version': '9.0.0-next.
|
|
269
|
+
'data-garden-version': '9.0.0-next.21'
|
|
248
270
|
}).withConfig({
|
|
249
271
|
displayName: "StyledTooltipModalBackdrop",
|
|
250
272
|
componentId: "sc-1yaomgq-0"
|
|
@@ -271,7 +293,7 @@ StyledTooltipWrapper.defaultProps = {
|
|
|
271
293
|
const COMPONENT_ID$b = 'modals.tooltip_modal';
|
|
272
294
|
const StyledTooltipModal = styled__default.default.div.attrs(props => ({
|
|
273
295
|
'data-garden-id': COMPONENT_ID$b,
|
|
274
|
-
'data-garden-version': '9.0.0-next.
|
|
296
|
+
'data-garden-version': '9.0.0-next.21',
|
|
275
297
|
className: props.isAnimated && 'is-animated'
|
|
276
298
|
})).withConfig({
|
|
277
299
|
displayName: "StyledTooltipModal",
|
|
@@ -300,11 +322,19 @@ const sizeStyles = props => `
|
|
|
300
322
|
`;
|
|
301
323
|
const StyledTooltipModalTitle = styled__default.default.div.attrs({
|
|
302
324
|
'data-garden-id': COMPONENT_ID$a,
|
|
303
|
-
'data-garden-version': '9.0.0-next.
|
|
325
|
+
'data-garden-version': '9.0.0-next.21'
|
|
304
326
|
}).withConfig({
|
|
305
327
|
displayName: "StyledTooltipModalTitle",
|
|
306
328
|
componentId: "sc-11xjgjs-0"
|
|
307
|
-
})(["margin:0;color:", ";font-weight:", ";", ";", ";"],
|
|
329
|
+
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], _ref => {
|
|
330
|
+
let {
|
|
331
|
+
theme
|
|
332
|
+
} = _ref;
|
|
333
|
+
return reactTheming.getColor({
|
|
334
|
+
variable: 'foreground.default',
|
|
335
|
+
theme
|
|
336
|
+
});
|
|
337
|
+
}, props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
308
338
|
StyledTooltipModalTitle.defaultProps = {
|
|
309
339
|
theme: reactTheming.DEFAULT_THEME
|
|
310
340
|
};
|
|
@@ -312,11 +342,19 @@ StyledTooltipModalTitle.defaultProps = {
|
|
|
312
342
|
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
313
343
|
const StyledTooltipModalBody = styled__default.default.div.attrs({
|
|
314
344
|
'data-garden-id': COMPONENT_ID$9,
|
|
315
|
-
'data-garden-version': '9.0.0-next.
|
|
345
|
+
'data-garden-version': '9.0.0-next.21'
|
|
316
346
|
}).withConfig({
|
|
317
347
|
displayName: "StyledTooltipModalBody",
|
|
318
348
|
componentId: "sc-195dkzj-0"
|
|
319
|
-
})(["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),
|
|
349
|
+
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
|
|
350
|
+
let {
|
|
351
|
+
theme
|
|
352
|
+
} = _ref;
|
|
353
|
+
return reactTheming.getColor({
|
|
354
|
+
variable: 'foreground.default',
|
|
355
|
+
theme
|
|
356
|
+
});
|
|
357
|
+
}, props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
320
358
|
StyledTooltipModalBody.defaultProps = {
|
|
321
359
|
theme: reactTheming.DEFAULT_THEME
|
|
322
360
|
};
|
|
@@ -324,7 +362,7 @@ StyledTooltipModalBody.defaultProps = {
|
|
|
324
362
|
const COMPONENT_ID$8 = 'modals.tooltip_modal.footer';
|
|
325
363
|
const StyledTooltipModalFooter = styled__default.default.div.attrs({
|
|
326
364
|
'data-garden-id': COMPONENT_ID$8,
|
|
327
|
-
'data-garden-version': '9.0.0-next.
|
|
365
|
+
'data-garden-version': '9.0.0-next.21'
|
|
328
366
|
}).withConfig({
|
|
329
367
|
displayName: "StyledTooltipModalFooter",
|
|
330
368
|
componentId: "sc-fm36a9-0"
|
|
@@ -336,7 +374,7 @@ StyledTooltipModalFooter.defaultProps = {
|
|
|
336
374
|
const COMPONENT_ID$7 = 'modals.tooltip_modal.footer_item';
|
|
337
375
|
const StyledTooltipModalFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
338
376
|
'data-garden-id': COMPONENT_ID$7,
|
|
339
|
-
'data-garden-version': '9.0.0-next.
|
|
377
|
+
'data-garden-version': '9.0.0-next.21'
|
|
340
378
|
}).withConfig({
|
|
341
379
|
displayName: "StyledTooltipModalFooterItem",
|
|
342
380
|
componentId: "sc-1nahj6p-0"
|
|
@@ -348,37 +386,45 @@ StyledTooltipModalFooterItem.defaultProps = {
|
|
|
348
386
|
const COMPONENT_ID$6 = 'modals.tooltip_modal.close';
|
|
349
387
|
const StyledTooltipModalClose = styled__default.default(StyledClose).attrs({
|
|
350
388
|
'data-garden-id': COMPONENT_ID$6,
|
|
351
|
-
'data-garden-version': '9.0.0-next.
|
|
389
|
+
'data-garden-version': '9.0.0-next.21'
|
|
352
390
|
}).withConfig({
|
|
353
391
|
displayName: "StyledTooltipModalClose",
|
|
354
392
|
componentId: "sc-1h2ke3q-0"
|
|
355
|
-
})(["top:", "px;", ":", ";
|
|
393
|
+
})(["top:", "px;", ":", ";", ";"], props => props.theme.space.base * 3.5, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * 3}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
356
394
|
StyledTooltipModalClose.defaultProps = {
|
|
357
395
|
theme: reactTheming.DEFAULT_THEME
|
|
358
396
|
};
|
|
359
397
|
|
|
360
398
|
const COMPONENT_ID$5 = 'modals.drawer_modal';
|
|
361
399
|
const DRAWER_WIDTH = 380;
|
|
362
|
-
const
|
|
363
|
-
|
|
400
|
+
const colorStyles = _ref => {
|
|
401
|
+
let {
|
|
364
402
|
theme
|
|
365
|
-
} =
|
|
366
|
-
const {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
|
|
403
|
+
} = _ref;
|
|
404
|
+
const offsetY = `${theme.space.base * 5}px`;
|
|
405
|
+
const blurRadius = `${theme.space.base * 7}px`;
|
|
406
|
+
const shadowColor = reactTheming.getColor({
|
|
407
|
+
variable: 'shadow.large',
|
|
408
|
+
theme
|
|
409
|
+
});
|
|
410
|
+
const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
|
|
411
|
+
const borderColor = reactTheming.getColor({
|
|
412
|
+
theme,
|
|
413
|
+
variable: 'border.default'
|
|
414
|
+
});
|
|
415
|
+
const backgroundColor = reactTheming.getColor({
|
|
416
|
+
theme,
|
|
417
|
+
variable: 'background.raised'
|
|
418
|
+
});
|
|
419
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
|
|
374
420
|
};
|
|
375
421
|
const StyledDrawer = styled__default.default.div.attrs({
|
|
376
422
|
'data-garden-id': COMPONENT_ID$5,
|
|
377
|
-
'data-garden-version': '9.0.0-next.
|
|
423
|
+
'data-garden-version': '9.0.0-next.21'
|
|
378
424
|
}).withConfig({
|
|
379
425
|
displayName: "StyledDrawer",
|
|
380
426
|
componentId: "sc-zp66t3-0"
|
|
381
|
-
})(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;
|
|
427
|
+
})(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;", ":", ";width:", "px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-drawer-transition-enter{transform:translateX(", "px);}&.garden-drawer-transition-enter-active{transform:translateX(0);transition:transform 0.25s ease-in-out;}&.garden-drawer-transition-exit-active{transform:translateX(", "px);transition:transform 0.25s ease-in-out;}&:focus{outline:none;}", " ", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.rtl ? 'border-right' : 'border-left', props => props.theme.borders.sm, DRAWER_WIDTH, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
382
428
|
StyledDrawer.defaultProps = {
|
|
383
429
|
theme: reactTheming.DEFAULT_THEME
|
|
384
430
|
};
|
|
@@ -391,7 +437,7 @@ const BASE_MULTIPLIERS = {
|
|
|
391
437
|
};
|
|
392
438
|
const StyledDrawerClose = styled__default.default(StyledClose).attrs({
|
|
393
439
|
'data-garden-id': COMPONENT_ID$4,
|
|
394
|
-
'data-garden-version': '9.0.0-next.
|
|
440
|
+
'data-garden-version': '9.0.0-next.21'
|
|
395
441
|
}).withConfig({
|
|
396
442
|
displayName: "StyledDrawerClose",
|
|
397
443
|
componentId: "sc-1a0xt3x-0"
|
|
@@ -403,7 +449,7 @@ StyledDrawerClose.defaultProps = {
|
|
|
403
449
|
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
404
450
|
const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
|
|
405
451
|
'data-garden-id': COMPONENT_ID$3,
|
|
406
|
-
'data-garden-version': '9.0.0-next.
|
|
452
|
+
'data-garden-version': '9.0.0-next.21'
|
|
407
453
|
}).withConfig({
|
|
408
454
|
displayName: "StyledDrawerHeader",
|
|
409
455
|
componentId: "sc-y4mgkj-0"
|
|
@@ -415,11 +461,11 @@ StyledDrawerHeader.defaultProps = {
|
|
|
415
461
|
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
416
462
|
const StyledDrawerBody = styled__default.default(StyledBody).attrs({
|
|
417
463
|
'data-garden-id': COMPONENT_ID$2,
|
|
418
|
-
'data-garden-version': '9.0.0-next.
|
|
464
|
+
'data-garden-version': '9.0.0-next.21'
|
|
419
465
|
}).withConfig({
|
|
420
466
|
displayName: "StyledDrawerBody",
|
|
421
467
|
componentId: "sc-13qufyn-0"
|
|
422
|
-
})(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
468
|
+
})(["padding:", "px;color-scheme:only ", ";", ";"], props => props.theme.space.base * 5, p => p.theme.colors.base, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
423
469
|
StyledDrawerBody.defaultProps = {
|
|
424
470
|
theme: reactTheming.DEFAULT_THEME
|
|
425
471
|
};
|
|
@@ -427,11 +473,19 @@ StyledDrawerBody.defaultProps = {
|
|
|
427
473
|
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
428
474
|
const StyledDrawerFooter = styled__default.default.div.attrs({
|
|
429
475
|
'data-garden-id': COMPONENT_ID$1,
|
|
430
|
-
'data-garden-version': '9.0.0-next.
|
|
476
|
+
'data-garden-version': '9.0.0-next.21'
|
|
431
477
|
}).withConfig({
|
|
432
478
|
displayName: "StyledDrawerFooter",
|
|
433
479
|
componentId: "sc-kc7e6p-0"
|
|
434
|
-
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"],
|
|
480
|
+
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], _ref => {
|
|
481
|
+
let {
|
|
482
|
+
theme
|
|
483
|
+
} = _ref;
|
|
484
|
+
return `${theme.borders.sm} ${reactTheming.getColor({
|
|
485
|
+
theme,
|
|
486
|
+
variable: 'border.subtle'
|
|
487
|
+
})}`;
|
|
488
|
+
}, props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
435
489
|
StyledDrawerFooter.defaultProps = {
|
|
436
490
|
theme: reactTheming.DEFAULT_THEME
|
|
437
491
|
};
|
|
@@ -439,7 +493,7 @@ StyledDrawerFooter.defaultProps = {
|
|
|
439
493
|
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
440
494
|
const StyledDrawerFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
441
495
|
'data-garden-id': COMPONENT_ID,
|
|
442
|
-
'data-garden-version': '9.0.0-next.
|
|
496
|
+
'data-garden-version': '9.0.0-next.21'
|
|
443
497
|
}).withConfig({
|
|
444
498
|
displayName: "StyledDrawerFooterItem",
|
|
445
499
|
componentId: "sc-m2yul4-0"
|
|
@@ -457,6 +511,105 @@ const useModalContext = () => {
|
|
|
457
511
|
return context;
|
|
458
512
|
};
|
|
459
513
|
|
|
514
|
+
const Body$2 = React.forwardRef((props, ref) => {
|
|
515
|
+
const {
|
|
516
|
+
getContentProps
|
|
517
|
+
} = useModalContext();
|
|
518
|
+
return React__namespace.default.createElement(StyledBody, Object.assign({}, getContentProps(props), {
|
|
519
|
+
ref: ref
|
|
520
|
+
}));
|
|
521
|
+
});
|
|
522
|
+
Body$2.displayName = 'Modal.Body';
|
|
523
|
+
|
|
524
|
+
var _path;
|
|
525
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
526
|
+
var SvgXStroke = function SvgXStroke(props) {
|
|
527
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
528
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
529
|
+
width: 16,
|
|
530
|
+
height: 16,
|
|
531
|
+
focusable: "false",
|
|
532
|
+
viewBox: "0 0 16 16",
|
|
533
|
+
"aria-hidden": "true"
|
|
534
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
535
|
+
stroke: "currentColor",
|
|
536
|
+
strokeLinecap: "round",
|
|
537
|
+
d: "M3 13L13 3m0 10L3 3"
|
|
538
|
+
})));
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
const Close$2 = React.forwardRef((props, ref) => {
|
|
542
|
+
const {
|
|
543
|
+
getCloseProps,
|
|
544
|
+
setIsCloseButtonPresent
|
|
545
|
+
} = useModalContext();
|
|
546
|
+
React.useEffect(() => {
|
|
547
|
+
setIsCloseButtonPresent(true);
|
|
548
|
+
return () => setIsCloseButtonPresent(false);
|
|
549
|
+
});
|
|
550
|
+
const ariaLabel = reactTheming.useText(Close$2, props, 'aria-label', 'Close modal');
|
|
551
|
+
return React__namespace.default.createElement(StyledClose, Object.assign({}, getCloseProps({
|
|
552
|
+
...props,
|
|
553
|
+
'aria-label': ariaLabel
|
|
554
|
+
}), {
|
|
555
|
+
ref: ref
|
|
556
|
+
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
557
|
+
});
|
|
558
|
+
Close$2.displayName = 'Modal.Close';
|
|
559
|
+
|
|
560
|
+
const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
561
|
+
const {
|
|
562
|
+
isLarge
|
|
563
|
+
} = useModalContext();
|
|
564
|
+
return React__namespace.default.createElement(StyledFooter, Object.assign({
|
|
565
|
+
ref: ref,
|
|
566
|
+
isLarge: isLarge
|
|
567
|
+
}, props));
|
|
568
|
+
});
|
|
569
|
+
Footer$2.displayName = 'Modal.Footer';
|
|
570
|
+
|
|
571
|
+
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, Object.assign({
|
|
572
|
+
ref: ref
|
|
573
|
+
}, props)));
|
|
574
|
+
FooterItem$2.displayName = 'Modal.FooterItem';
|
|
575
|
+
|
|
576
|
+
const Header$1 = React.forwardRef((_ref, ref) => {
|
|
577
|
+
let {
|
|
578
|
+
children,
|
|
579
|
+
tag,
|
|
580
|
+
...other
|
|
581
|
+
} = _ref;
|
|
582
|
+
const {
|
|
583
|
+
isCloseButtonPresent,
|
|
584
|
+
hasHeader,
|
|
585
|
+
setHasHeader,
|
|
586
|
+
getTitleProps
|
|
587
|
+
} = useModalContext();
|
|
588
|
+
React.useEffect(() => {
|
|
589
|
+
if (!hasHeader && setHasHeader) {
|
|
590
|
+
setHasHeader(true);
|
|
591
|
+
}
|
|
592
|
+
return () => {
|
|
593
|
+
if (hasHeader && setHasHeader) {
|
|
594
|
+
setHasHeader(false);
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
}, [hasHeader, setHasHeader]);
|
|
598
|
+
return React__namespace.default.createElement(StyledHeader, Object.assign({}, getTitleProps(other), {
|
|
599
|
+
as: tag,
|
|
600
|
+
isCloseButtonPresent: isCloseButtonPresent,
|
|
601
|
+
ref: ref
|
|
602
|
+
}), other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
603
|
+
});
|
|
604
|
+
Header$1.displayName = 'Modal.Header';
|
|
605
|
+
Header$1.propTypes = {
|
|
606
|
+
isDanger: PropTypes__default.default.bool,
|
|
607
|
+
tag: PropTypes__default.default.any
|
|
608
|
+
};
|
|
609
|
+
Header$1.defaultProps = {
|
|
610
|
+
tag: 'div'
|
|
611
|
+
};
|
|
612
|
+
|
|
460
613
|
const isOverflowing = element => {
|
|
461
614
|
const doc = ownerDocument__default.default(element);
|
|
462
615
|
const win = ownerWindow__default.default(doc);
|
|
@@ -469,7 +622,7 @@ const isOverflowing = element => {
|
|
|
469
622
|
const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
|
|
470
623
|
return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
|
|
471
624
|
};
|
|
472
|
-
const
|
|
625
|
+
const ModalComponent = React.forwardRef((_ref, ref) => {
|
|
473
626
|
let {
|
|
474
627
|
backdropProps,
|
|
475
628
|
children,
|
|
@@ -501,10 +654,6 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
501
654
|
focusOnMount,
|
|
502
655
|
restoreFocus
|
|
503
656
|
});
|
|
504
|
-
containerFocusvisible.useFocusVisible({
|
|
505
|
-
scope: modalRef,
|
|
506
|
-
relativeDocument: environment
|
|
507
|
-
});
|
|
508
657
|
React.useEffect(() => {
|
|
509
658
|
if (!environment) {
|
|
510
659
|
return undefined;
|
|
@@ -562,7 +711,7 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
562
711
|
const defaultValue = hasHeader ? modalContainerProps['aria-labelledby'] : 'Modal dialog';
|
|
563
712
|
const labelValue = hasHeader ? modalContainerProps['aria-labelledby'] : modalProps['aria-label'];
|
|
564
713
|
const ariaProps = {
|
|
565
|
-
[attribute]: reactTheming.useText(
|
|
714
|
+
[attribute]: reactTheming.useText(ModalComponent, {
|
|
566
715
|
[attribute]: labelValue
|
|
567
716
|
}, attribute, defaultValue)
|
|
568
717
|
};
|
|
@@ -571,10 +720,10 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
571
720
|
}
|
|
572
721
|
return ReactDOM.createPortal( React__namespace.default.createElement(ModalsContext.Provider, {
|
|
573
722
|
value: value
|
|
574
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
723
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
575
724
|
isCentered: isCentered,
|
|
576
725
|
isAnimated: isAnimated
|
|
577
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal,
|
|
726
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal, Object.assign({
|
|
578
727
|
isCentered: isCentered,
|
|
579
728
|
isAnimated: isAnimated,
|
|
580
729
|
isLarge: isLarge
|
|
@@ -582,8 +731,8 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
582
731
|
ref: reactMergeRefs.mergeRefs([ref, modalRef])
|
|
583
732
|
}), children))), rootNode);
|
|
584
733
|
});
|
|
585
|
-
|
|
586
|
-
|
|
734
|
+
ModalComponent.displayName = 'Modal';
|
|
735
|
+
ModalComponent.propTypes = {
|
|
587
736
|
backdropProps: PropTypes__default.default.object,
|
|
588
737
|
isLarge: PropTypes__default.default.bool,
|
|
589
738
|
isAnimated: PropTypes__default.default.bool,
|
|
@@ -593,109 +742,16 @@ Modal.propTypes = {
|
|
|
593
742
|
onClose: PropTypes__default.default.func,
|
|
594
743
|
appendToNode: PropTypes__default.default.any
|
|
595
744
|
};
|
|
596
|
-
|
|
745
|
+
ModalComponent.defaultProps = {
|
|
597
746
|
isAnimated: true,
|
|
598
747
|
isCentered: true
|
|
599
748
|
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
ref: ref
|
|
607
|
-
}));
|
|
608
|
-
});
|
|
609
|
-
Body$2.displayName = 'Body';
|
|
610
|
-
|
|
611
|
-
var _path;
|
|
612
|
-
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); }
|
|
613
|
-
var SvgXStroke = function SvgXStroke(props) {
|
|
614
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
615
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
616
|
-
width: 16,
|
|
617
|
-
height: 16,
|
|
618
|
-
focusable: "false",
|
|
619
|
-
viewBox: "0 0 16 16",
|
|
620
|
-
"aria-hidden": "true"
|
|
621
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
622
|
-
stroke: "currentColor",
|
|
623
|
-
strokeLinecap: "round",
|
|
624
|
-
d: "M3 13L13 3m0 10L3 3"
|
|
625
|
-
})));
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
const Close$2 = React.forwardRef((props, ref) => {
|
|
629
|
-
const {
|
|
630
|
-
getCloseProps,
|
|
631
|
-
setIsCloseButtonPresent
|
|
632
|
-
} = useModalContext();
|
|
633
|
-
React.useEffect(() => {
|
|
634
|
-
setIsCloseButtonPresent(true);
|
|
635
|
-
return () => setIsCloseButtonPresent(false);
|
|
636
|
-
});
|
|
637
|
-
const ariaLabel = reactTheming.useText(Close$2, props, 'aria-label', 'Close modal');
|
|
638
|
-
return React__namespace.default.createElement(StyledClose, _extends$2({}, getCloseProps({
|
|
639
|
-
...props,
|
|
640
|
-
'aria-label': ariaLabel
|
|
641
|
-
}), {
|
|
642
|
-
ref: ref
|
|
643
|
-
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
644
|
-
});
|
|
645
|
-
Close$2.displayName = 'Close';
|
|
646
|
-
|
|
647
|
-
const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
648
|
-
const {
|
|
649
|
-
isLarge
|
|
650
|
-
} = useModalContext();
|
|
651
|
-
return React__namespace.default.createElement(StyledFooter, _extends$2({
|
|
652
|
-
ref: ref,
|
|
653
|
-
isLarge: isLarge
|
|
654
|
-
}, props));
|
|
655
|
-
});
|
|
656
|
-
Footer$2.displayName = 'Footer';
|
|
657
|
-
|
|
658
|
-
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, _extends$2({
|
|
659
|
-
ref: ref
|
|
660
|
-
}, props)));
|
|
661
|
-
FooterItem$2.displayName = 'FooterItem';
|
|
662
|
-
|
|
663
|
-
const Header$1 = React.forwardRef((_ref, ref) => {
|
|
664
|
-
let {
|
|
665
|
-
children,
|
|
666
|
-
tag,
|
|
667
|
-
...other
|
|
668
|
-
} = _ref;
|
|
669
|
-
const {
|
|
670
|
-
isCloseButtonPresent,
|
|
671
|
-
hasHeader,
|
|
672
|
-
setHasHeader,
|
|
673
|
-
getTitleProps
|
|
674
|
-
} = useModalContext();
|
|
675
|
-
React.useEffect(() => {
|
|
676
|
-
if (!hasHeader && setHasHeader) {
|
|
677
|
-
setHasHeader(true);
|
|
678
|
-
}
|
|
679
|
-
return () => {
|
|
680
|
-
if (hasHeader && setHasHeader) {
|
|
681
|
-
setHasHeader(false);
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
}, [hasHeader, setHasHeader]);
|
|
685
|
-
return React__namespace.default.createElement(StyledHeader, _extends$2({}, getTitleProps(other), {
|
|
686
|
-
as: tag,
|
|
687
|
-
isCloseButtonPresent: isCloseButtonPresent,
|
|
688
|
-
ref: ref
|
|
689
|
-
}), other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
690
|
-
});
|
|
691
|
-
Header$1.displayName = 'Header';
|
|
692
|
-
Header$1.propTypes = {
|
|
693
|
-
isDanger: PropTypes__default.default.bool,
|
|
694
|
-
tag: PropTypes__default.default.any
|
|
695
|
-
};
|
|
696
|
-
Header$1.defaultProps = {
|
|
697
|
-
tag: 'div'
|
|
698
|
-
};
|
|
749
|
+
const Modal = ModalComponent;
|
|
750
|
+
Modal.Body = Body$2;
|
|
751
|
+
Modal.Close = Close$2;
|
|
752
|
+
Modal.Footer = Footer$2;
|
|
753
|
+
Modal.FooterItem = FooterItem$2;
|
|
754
|
+
Modal.Header = Header$1;
|
|
699
755
|
|
|
700
756
|
const TooltipModalContext = React.createContext(undefined);
|
|
701
757
|
const useTooltipModalContext = () => {
|
|
@@ -727,7 +783,7 @@ const TitleComponent = React.forwardRef((_ref, ref) => {
|
|
|
727
783
|
}
|
|
728
784
|
};
|
|
729
785
|
}, [hasTitle, setHasTitle]);
|
|
730
|
-
return React__namespace.default.createElement(StyledTooltipModalTitle,
|
|
786
|
+
return React__namespace.default.createElement(StyledTooltipModalTitle, Object.assign({}, getTitleProps(other), {
|
|
731
787
|
as: tag,
|
|
732
788
|
ref: ref
|
|
733
789
|
}), children);
|
|
@@ -745,7 +801,7 @@ const BodyComponent$1 = React.forwardRef((props, ref) => {
|
|
|
745
801
|
const {
|
|
746
802
|
getContentProps
|
|
747
803
|
} = useTooltipModalContext();
|
|
748
|
-
return React__namespace.default.createElement(StyledTooltipModalBody,
|
|
804
|
+
return React__namespace.default.createElement(StyledTooltipModalBody, Object.assign({}, getContentProps(props), {
|
|
749
805
|
ref: ref
|
|
750
806
|
}));
|
|
751
807
|
});
|
|
@@ -757,23 +813,24 @@ const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
|
757
813
|
getCloseProps
|
|
758
814
|
} = useTooltipModalContext();
|
|
759
815
|
const ariaLabel = reactTheming.useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
760
|
-
return React__namespace.default.createElement(StyledTooltipModalClose,
|
|
816
|
+
return React__namespace.default.createElement(StyledTooltipModalClose, Object.assign({}, getCloseProps({
|
|
761
817
|
...props,
|
|
762
818
|
'aria-label': ariaLabel
|
|
763
819
|
}), {
|
|
764
|
-
ref: ref
|
|
820
|
+
ref: ref,
|
|
821
|
+
size: "small"
|
|
765
822
|
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
766
823
|
});
|
|
767
824
|
CloseComponent$1.displayName = 'TooltipModal.Close';
|
|
768
825
|
const Close$1 = CloseComponent$1;
|
|
769
826
|
|
|
770
|
-
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter,
|
|
827
|
+
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter, Object.assign({
|
|
771
828
|
ref: ref
|
|
772
829
|
}, props)));
|
|
773
830
|
FooterComponent$1.displayName = 'TooltipModal.Footer';
|
|
774
831
|
const Footer$1 = FooterComponent$1;
|
|
775
832
|
|
|
776
|
-
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem,
|
|
833
|
+
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem, Object.assign({
|
|
777
834
|
ref: ref
|
|
778
835
|
}, props)));
|
|
779
836
|
FooterItemComponent$1.displayName = 'TooltipModal.FooterItem';
|
|
@@ -823,6 +880,10 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
823
880
|
transform
|
|
824
881
|
}
|
|
825
882
|
} = reactDom.useFloating({
|
|
883
|
+
platform: {
|
|
884
|
+
...reactDom.platform,
|
|
885
|
+
isRTL: () => theme.rtl
|
|
886
|
+
},
|
|
826
887
|
elements: {
|
|
827
888
|
reference: referenceElement,
|
|
828
889
|
floating: floatingElement
|
|
@@ -875,7 +936,7 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
875
936
|
}, transitionState => {
|
|
876
937
|
return React__namespace.default.createElement(TooltipModalContext.Provider, {
|
|
877
938
|
value: value
|
|
878
|
-
}, React__namespace.default.createElement(StyledTooltipModalBackdrop,
|
|
939
|
+
}, React__namespace.default.createElement(StyledTooltipModalBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
879
940
|
ref: transitionRef
|
|
880
941
|
}), React__namespace.default.createElement(StyledTooltipWrapper, {
|
|
881
942
|
ref: setFloatingElement,
|
|
@@ -885,7 +946,7 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
885
946
|
placement: placement,
|
|
886
947
|
zIndex: zIndex,
|
|
887
948
|
isAnimated: isAnimated
|
|
888
|
-
}, React__namespace.default.createElement(StyledTooltipModal,
|
|
949
|
+
}, React__namespace.default.createElement(StyledTooltipModal, Object.assign({
|
|
889
950
|
transitionState: transitionState,
|
|
890
951
|
placement: placement,
|
|
891
952
|
hasArrow: hasArrow,
|
|
@@ -943,7 +1004,7 @@ const HeaderComponent = React.forwardRef((_ref, ref) => {
|
|
|
943
1004
|
}
|
|
944
1005
|
};
|
|
945
1006
|
}, [hasHeader, setHasHeader]);
|
|
946
|
-
return React__namespace.default.createElement(StyledDrawerHeader,
|
|
1007
|
+
return React__namespace.default.createElement(StyledDrawerHeader, Object.assign({}, getTitleProps(other), {
|
|
947
1008
|
as: tag,
|
|
948
1009
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
949
1010
|
ref: ref
|
|
@@ -962,7 +1023,7 @@ const BodyComponent = React.forwardRef((props, ref) => {
|
|
|
962
1023
|
const {
|
|
963
1024
|
getContentProps
|
|
964
1025
|
} = useModalContext();
|
|
965
|
-
return React__namespace.default.createElement(StyledDrawerBody,
|
|
1026
|
+
return React__namespace.default.createElement(StyledDrawerBody, Object.assign({}, getContentProps(props), {
|
|
966
1027
|
ref: ref
|
|
967
1028
|
}), props.children);
|
|
968
1029
|
});
|
|
@@ -979,7 +1040,7 @@ const CloseComponent = React.forwardRef((props, ref) => {
|
|
|
979
1040
|
return () => setIsCloseButtonPresent(false);
|
|
980
1041
|
});
|
|
981
1042
|
const ariaLabel = reactTheming.useText(CloseComponent, props, 'aria-label', 'Close drawer');
|
|
982
|
-
return React__namespace.default.createElement(StyledDrawerClose,
|
|
1043
|
+
return React__namespace.default.createElement(StyledDrawerClose, Object.assign({}, getCloseProps({
|
|
983
1044
|
...props,
|
|
984
1045
|
'aria-label': ariaLabel
|
|
985
1046
|
}), {
|
|
@@ -989,13 +1050,13 @@ const CloseComponent = React.forwardRef((props, ref) => {
|
|
|
989
1050
|
CloseComponent.displayName = 'Drawer.Close';
|
|
990
1051
|
const Close = CloseComponent;
|
|
991
1052
|
|
|
992
|
-
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooter,
|
|
1053
|
+
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooter, Object.assign({
|
|
993
1054
|
ref: ref
|
|
994
1055
|
}, props)));
|
|
995
1056
|
FooterComponent.displayName = 'Drawer.Footer';
|
|
996
1057
|
const Footer = FooterComponent;
|
|
997
1058
|
|
|
998
|
-
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooterItem,
|
|
1059
|
+
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerFooterItem, Object.assign({
|
|
999
1060
|
ref: ref
|
|
1000
1061
|
}, props)));
|
|
1001
1062
|
FooterItemComponent.displayName = 'Drawer.FooterItem';
|
|
@@ -1019,10 +1080,6 @@ const DrawerComponent = React.forwardRef((_ref, ref) => {
|
|
|
1019
1080
|
const environment = reactTheming.useDocument(theme);
|
|
1020
1081
|
const [isCloseButtonPresent, setIsCloseButtonPresent] = React.useState(false);
|
|
1021
1082
|
const [hasHeader, setHasHeader] = React.useState(false);
|
|
1022
|
-
containerFocusvisible.useFocusVisible({
|
|
1023
|
-
scope: modalRef,
|
|
1024
|
-
relativeDocument: modalRef.current
|
|
1025
|
-
});
|
|
1026
1083
|
const {
|
|
1027
1084
|
getTitleProps,
|
|
1028
1085
|
getCloseProps,
|
|
@@ -1116,9 +1173,9 @@ const DrawerComponent = React.forwardRef((_ref, ref) => {
|
|
|
1116
1173
|
unmountOnExit: true,
|
|
1117
1174
|
classNames: "garden-drawer-transition",
|
|
1118
1175
|
nodeRef: transitionRef
|
|
1119
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
1176
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
1120
1177
|
isAnimated: true
|
|
1121
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledDrawer,
|
|
1178
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledDrawer, Object.assign({}, modalProps, ariaProps, props, {
|
|
1122
1179
|
ref: reactMergeRefs.mergeRefs([ref, modalRef, transitionRef])
|
|
1123
1180
|
}))))), rootNode);
|
|
1124
1181
|
});
|