@zendeskgarden/react-modals 8.57.1 → 8.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -17,175 +17,21 @@ import mergeRefs from 'react-merge-refs';
|
|
|
17
17
|
import { usePopper } from 'react-popper';
|
|
18
18
|
import { CSSTransition } from 'react-transition-group';
|
|
19
19
|
|
|
20
|
-
function ownKeys(object, enumerableOnly) {
|
|
21
|
-
var keys = Object.keys(object);
|
|
22
|
-
|
|
23
|
-
if (Object.getOwnPropertySymbols) {
|
|
24
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
25
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
26
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
27
|
-
})), keys.push.apply(keys, symbols);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return keys;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _objectSpread2(target) {
|
|
34
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
35
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
36
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
37
|
-
_defineProperty(target, key, source[key]);
|
|
38
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
39
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function _defineProperty(obj, key, value) {
|
|
47
|
-
if (key in obj) {
|
|
48
|
-
Object.defineProperty(obj, key, {
|
|
49
|
-
value: value,
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
obj[key] = value;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return obj;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
20
|
function _extends$2() {
|
|
62
21
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
63
22
|
for (var i = 1; i < arguments.length; i++) {
|
|
64
23
|
var source = arguments[i];
|
|
65
|
-
|
|
66
24
|
for (var key in source) {
|
|
67
25
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
68
26
|
target[key] = source[key];
|
|
69
27
|
}
|
|
70
28
|
}
|
|
71
29
|
}
|
|
72
|
-
|
|
73
30
|
return target;
|
|
74
31
|
};
|
|
75
32
|
return _extends$2.apply(this, arguments);
|
|
76
33
|
}
|
|
77
34
|
|
|
78
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
79
|
-
if (source == null) return {};
|
|
80
|
-
var target = {};
|
|
81
|
-
var sourceKeys = Object.keys(source);
|
|
82
|
-
var key, i;
|
|
83
|
-
|
|
84
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
85
|
-
key = sourceKeys[i];
|
|
86
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
87
|
-
target[key] = source[key];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return target;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _objectWithoutProperties(source, excluded) {
|
|
94
|
-
if (source == null) return {};
|
|
95
|
-
|
|
96
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
97
|
-
|
|
98
|
-
var key, i;
|
|
99
|
-
|
|
100
|
-
if (Object.getOwnPropertySymbols) {
|
|
101
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
102
|
-
|
|
103
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
104
|
-
key = sourceSymbolKeys[i];
|
|
105
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
106
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
107
|
-
target[key] = source[key];
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return target;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function _slicedToArray(arr, i) {
|
|
115
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _toConsumableArray(arr) {
|
|
119
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _arrayWithoutHoles(arr) {
|
|
123
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function _arrayWithHoles(arr) {
|
|
127
|
-
if (Array.isArray(arr)) return arr;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function _iterableToArray(iter) {
|
|
131
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function _iterableToArrayLimit(arr, i) {
|
|
135
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
136
|
-
|
|
137
|
-
if (_i == null) return;
|
|
138
|
-
var _arr = [];
|
|
139
|
-
var _n = true;
|
|
140
|
-
var _d = false;
|
|
141
|
-
|
|
142
|
-
var _s, _e;
|
|
143
|
-
|
|
144
|
-
try {
|
|
145
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
146
|
-
_arr.push(_s.value);
|
|
147
|
-
|
|
148
|
-
if (i && _arr.length === i) break;
|
|
149
|
-
}
|
|
150
|
-
} catch (err) {
|
|
151
|
-
_d = true;
|
|
152
|
-
_e = err;
|
|
153
|
-
} finally {
|
|
154
|
-
try {
|
|
155
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
156
|
-
} finally {
|
|
157
|
-
if (_d) throw _e;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return _arr;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
165
|
-
if (!o) return;
|
|
166
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
167
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
168
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
169
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
170
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function _arrayLikeToArray(arr, len) {
|
|
174
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
175
|
-
|
|
176
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
177
|
-
|
|
178
|
-
return arr2;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function _nonIterableSpread() {
|
|
182
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function _nonIterableRest() {
|
|
186
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
187
|
-
}
|
|
188
|
-
|
|
189
35
|
function isDocument(element) {
|
|
190
36
|
return 'nodeType' in element && element.nodeType === document.DOCUMENT_NODE;
|
|
191
37
|
}
|
|
@@ -266,29 +112,15 @@ function scrollbarSize(recalc) {
|
|
|
266
112
|
return size;
|
|
267
113
|
}
|
|
268
114
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
115
|
+
const COMPONENT_ID$j = 'modals.backdrop';
|
|
116
|
+
const animationName$1 = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
117
|
+
const StyledBackdrop = styled.div.attrs({
|
|
272
118
|
'data-garden-id': COMPONENT_ID$j,
|
|
273
|
-
'data-garden-version': '8.
|
|
119
|
+
'data-garden-version': '8.59.0'
|
|
274
120
|
}).withConfig({
|
|
275
121
|
displayName: "StyledBackdrop",
|
|
276
122
|
componentId: "sc-mzdjpo-0"
|
|
277
|
-
})(["display:flex;position:fixed;top:0;right:0;bottom:0;left:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";animation:", ";", ";"],
|
|
278
|
-
return props.isCentered && 'center';
|
|
279
|
-
}, function (props) {
|
|
280
|
-
return props.isCentered && 'center';
|
|
281
|
-
}, function (props) {
|
|
282
|
-
return getColor('neutralHue', 800, props.theme, 0.85);
|
|
283
|
-
}, function (props) {
|
|
284
|
-
return props.theme.fonts.system;
|
|
285
|
-
}, function (props) {
|
|
286
|
-
return props.theme.rtl && 'rtl';
|
|
287
|
-
}, function (props) {
|
|
288
|
-
return props.isAnimated && css(["", " 0.15s ease-in"], animationName$1);
|
|
289
|
-
}, function (props) {
|
|
290
|
-
return retrieveComponentStyles(COMPONENT_ID$j, props);
|
|
291
|
-
});
|
|
123
|
+
})(["display:flex;position:fixed;top:0;right:0;bottom:0;left:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";animation:", ";", ";"], props => props.isCentered && 'center', props => props.isCentered && 'center', props => getColor('neutralHue', 800, props.theme, 0.85), props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.isAnimated && css(["", " 0.15s ease-in"], animationName$1), props => retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
292
124
|
StyledBackdrop.defaultProps = {
|
|
293
125
|
theme: DEFAULT_THEME
|
|
294
126
|
};
|
|
@@ -297,128 +129,72 @@ StyledBackdrop.propTypes = {
|
|
|
297
129
|
isAnimated: PropTypes.bool
|
|
298
130
|
};
|
|
299
131
|
|
|
300
|
-
|
|
301
|
-
|
|
132
|
+
const COMPONENT_ID$i = 'modals.body';
|
|
133
|
+
const StyledBody = styled.div.attrs({
|
|
302
134
|
'data-garden-id': COMPONENT_ID$i,
|
|
303
|
-
'data-garden-version': '8.
|
|
135
|
+
'data-garden-version': '8.59.0'
|
|
304
136
|
}).withConfig({
|
|
305
137
|
displayName: "StyledBody",
|
|
306
138
|
componentId: "sc-14rzecg-0"
|
|
307
|
-
})(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color:", ";font-size:", ";", ";"],
|
|
308
|
-
return "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base * 10, "px");
|
|
309
|
-
}, function (props) {
|
|
310
|
-
return getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md);
|
|
311
|
-
}, function (props) {
|
|
312
|
-
return props.theme.colors.foreground;
|
|
313
|
-
}, function (props) {
|
|
314
|
-
return props.theme.fontSizes.md;
|
|
315
|
-
}, function (props) {
|
|
316
|
-
return retrieveComponentStyles(COMPONENT_ID$i, props);
|
|
317
|
-
});
|
|
139
|
+
})(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
318
140
|
StyledBody.defaultProps = {
|
|
319
141
|
theme: DEFAULT_THEME
|
|
320
142
|
};
|
|
321
143
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
144
|
+
const COMPONENT_ID$h = 'modals.close';
|
|
145
|
+
const colorStyles = props => {
|
|
146
|
+
const backgroundColor = 'primaryHue';
|
|
147
|
+
const foregroundColor = 'neutralHue';
|
|
326
148
|
return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}&[data-garden-focus-visible]{box-shadow:", ";}&:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], getColor(foregroundColor, 600, props.theme), getColor(backgroundColor, 600, props.theme, 0.08), getColor(foregroundColor, 700, props.theme), props.theme.shadows.md(getColor(backgroundColor, 600, props.theme, 0.35)), getColor(backgroundColor, 600, props.theme, 0.2), getColor(foregroundColor, 800, props.theme));
|
|
327
149
|
};
|
|
328
|
-
|
|
150
|
+
const BASE_MULTIPLIERS$1 = {
|
|
329
151
|
top: 2.5,
|
|
330
152
|
side: 6.5,
|
|
331
153
|
size: 10
|
|
332
154
|
};
|
|
333
|
-
|
|
155
|
+
const StyledClose = styled.button.attrs({
|
|
334
156
|
'data-garden-id': COMPONENT_ID$h,
|
|
335
|
-
'data-garden-version': '8.
|
|
157
|
+
'data-garden-version': '8.59.0'
|
|
336
158
|
}).withConfig({
|
|
337
159
|
displayName: "StyledClose",
|
|
338
160
|
componentId: "sc-iseudj-0"
|
|
339
|
-
})(["display:block;position:absolute;top:", "px;", ":", ";transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;text-decoration:none;font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:focus{outline:none;}", " & > svg{vertical-align:middle;}", ";"],
|
|
340
|
-
return props.theme.space.base * BASE_MULTIPLIERS$1.top;
|
|
341
|
-
}, function (props) {
|
|
342
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
343
|
-
}, function (props) {
|
|
344
|
-
return "".concat(props.theme.space.base * BASE_MULTIPLIERS$1.side, "px");
|
|
345
|
-
}, function (props) {
|
|
346
|
-
return props.theme.space.base * BASE_MULTIPLIERS$1.size;
|
|
347
|
-
}, function (props) {
|
|
348
|
-
return props.theme.space.base * BASE_MULTIPLIERS$1.size;
|
|
349
|
-
}, function (props) {
|
|
350
|
-
return colorStyles(props);
|
|
351
|
-
}, function (props) {
|
|
352
|
-
return retrieveComponentStyles(COMPONENT_ID$h, props);
|
|
353
|
-
});
|
|
161
|
+
})(["display:block;position:absolute;top:", "px;", ":", ";transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;text-decoration:none;font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:focus{outline:none;}", " & > svg{vertical-align:middle;}", ";"], props => props.theme.space.base * BASE_MULTIPLIERS$1.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS$1.side}px`, props => props.theme.space.base * BASE_MULTIPLIERS$1.size, props => props.theme.space.base * BASE_MULTIPLIERS$1.size, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
354
162
|
StyledClose.defaultProps = {
|
|
355
163
|
theme: DEFAULT_THEME
|
|
356
164
|
};
|
|
357
165
|
|
|
358
|
-
|
|
359
|
-
|
|
166
|
+
const COMPONENT_ID$g = 'modals.footer';
|
|
167
|
+
const StyledFooter = styled.div.attrs({
|
|
360
168
|
'data-garden-id': COMPONENT_ID$g,
|
|
361
|
-
'data-garden-version': '8.
|
|
169
|
+
'data-garden-version': '8.59.0'
|
|
362
170
|
}).withConfig({
|
|
363
171
|
displayName: "StyledFooter",
|
|
364
172
|
componentId: "sc-d8pfdu-0"
|
|
365
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"],
|
|
366
|
-
return props.isLarge && "".concat(props.theme.borders.sm, " ").concat(getColor('neutralHue', 200, props.theme));
|
|
367
|
-
}, function (props) {
|
|
368
|
-
return props.isLarge ? "".concat(props.theme.space.base * 8, "px ").concat(props.theme.space.base * 10, "px") : "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base * 10, "px ").concat(props.theme.space.base * 8, "px");
|
|
369
|
-
}, function (props) {
|
|
370
|
-
return retrieveComponentStyles(COMPONENT_ID$g, props);
|
|
371
|
-
});
|
|
173
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${getColor('neutralHue', 200, props.theme)}`, props => props.isLarge ? `${props.theme.space.base * 8}px ${props.theme.space.base * 10}px` : `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px ${props.theme.space.base * 8}px`, props => retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
372
174
|
StyledFooter.defaultProps = {
|
|
373
175
|
theme: DEFAULT_THEME
|
|
374
176
|
};
|
|
375
177
|
|
|
376
|
-
|
|
377
|
-
|
|
178
|
+
const COMPONENT_ID$f = 'modals.footer_item';
|
|
179
|
+
const StyledFooterItem = styled.span.attrs({
|
|
378
180
|
'data-garden-id': COMPONENT_ID$f,
|
|
379
|
-
'data-garden-version': '8.
|
|
181
|
+
'data-garden-version': '8.59.0'
|
|
380
182
|
}).withConfig({
|
|
381
183
|
displayName: "StyledFooterItem",
|
|
382
184
|
componentId: "sc-1mb76hl-0"
|
|
383
|
-
})(["display:flex;margin-", ":", "px;min-width:0;&:first-child{margin-", ":0;}", ";"],
|
|
384
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
385
|
-
}, function (props) {
|
|
386
|
-
return props.theme.space.base * 5;
|
|
387
|
-
}, function (props) {
|
|
388
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
389
|
-
}, function (props) {
|
|
390
|
-
return retrieveComponentStyles(COMPONENT_ID$f, props);
|
|
391
|
-
});
|
|
185
|
+
})(["display:flex;margin-", ":", "px;min-width:0;&:first-child{margin-", ":0;}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 5, props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID$f, props));
|
|
392
186
|
StyledFooterItem.defaultProps = {
|
|
393
187
|
theme: DEFAULT_THEME
|
|
394
188
|
};
|
|
395
189
|
|
|
396
|
-
|
|
397
|
-
|
|
190
|
+
const COMPONENT_ID$e = 'modals.header';
|
|
191
|
+
const StyledHeader = styled.div.attrs({
|
|
398
192
|
'data-garden-id': COMPONENT_ID$e,
|
|
399
|
-
'data-garden-version': '8.
|
|
193
|
+
'data-garden-version': '8.59.0'
|
|
400
194
|
}).withConfig({
|
|
401
195
|
displayName: "StyledHeader",
|
|
402
196
|
componentId: "sc-1787r9v-0"
|
|
403
|
-
})(["display:block;position:", ";margin:0;border-bottom:", " ", ";padding:", ";", " line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"],
|
|
404
|
-
return props.isDanger && 'relative';
|
|
405
|
-
}, function (props) {
|
|
406
|
-
return props.theme.borders.sm;
|
|
407
|
-
}, getColor('neutralHue', 200), function (props) {
|
|
408
|
-
return "".concat(props.theme.space.base * 5, "px ").concat(props.theme.space.base * 10, "px");
|
|
409
|
-
}, function (props) {
|
|
410
|
-
return props.isCloseButtonPresent && "padding-".concat(props.theme.rtl ? 'left' : 'right', ": ").concat(props.theme.space.base * (BASE_MULTIPLIERS$1.size + BASE_MULTIPLIERS$1.side + 2), "px;");
|
|
411
|
-
}, function (props) {
|
|
412
|
-
return getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md);
|
|
413
|
-
}, function (props) {
|
|
414
|
-
return props.isDanger ? getColor('dangerHue', 600, props.theme) : props.theme.colors.foreground;
|
|
415
|
-
}, function (props) {
|
|
416
|
-
return props.theme.fontSizes.md;
|
|
417
|
-
}, function (props) {
|
|
418
|
-
return props.theme.fontWeights.semibold;
|
|
419
|
-
}, function (props) {
|
|
420
|
-
return retrieveComponentStyles(COMPONENT_ID$e, props);
|
|
421
|
-
});
|
|
197
|
+
})(["display:block;position:", ";margin:0;border-bottom:", " ", ";padding:", ";", " line-height:", ";color:", ";font-size:", ";font-weight:", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, getColor('neutralHue', 200), props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS$1.size + BASE_MULTIPLIERS$1.side + 2)}px;`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.isDanger ? getColor('dangerHue', 600, props.theme) : props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
422
198
|
StyledHeader.defaultProps = {
|
|
423
199
|
theme: DEFAULT_THEME
|
|
424
200
|
};
|
|
@@ -434,7 +210,8 @@ var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
|
434
210
|
height: 16,
|
|
435
211
|
focusable: "false",
|
|
436
212
|
viewBox: "0 0 16 16",
|
|
437
|
-
"aria-hidden": "true"
|
|
213
|
+
"aria-hidden": "true",
|
|
214
|
+
role: "img"
|
|
438
215
|
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
439
216
|
fill: "none",
|
|
440
217
|
stroke: "currentColor"
|
|
@@ -453,65 +230,39 @@ var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
|
453
230
|
})));
|
|
454
231
|
};
|
|
455
232
|
|
|
456
|
-
|
|
233
|
+
const StyledDangerIcon = styled(SvgAlertErrorStroke).withConfig({
|
|
457
234
|
displayName: "StyledDangerIcon",
|
|
458
235
|
componentId: "sc-1kwbb39-0"
|
|
459
|
-
})(["position:absolute;top:", "px;", ":", ";"],
|
|
460
|
-
return props.theme.space.base * 5.5;
|
|
461
|
-
}, function (props) {
|
|
462
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
463
|
-
}, function (props) {
|
|
464
|
-
return "".concat(props.theme.space.base * 4, "px");
|
|
465
|
-
});
|
|
236
|
+
})(["position:absolute;top:", "px;", ":", ";"], props => props.theme.space.base * 5.5, props => props.theme.rtl ? 'right' : 'left', props => `${props.theme.space.base * 4}px`);
|
|
466
237
|
StyledDangerIcon.defaultProps = {
|
|
467
238
|
theme: DEFAULT_THEME
|
|
468
239
|
};
|
|
469
240
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
241
|
+
const COMPONENT_ID$d = 'modals.modal';
|
|
242
|
+
const animationName = keyframes(["0%{transform:scale(0);opacity:0;}50%{transform:scale(1.05);}100%{opacity:1;}"]);
|
|
243
|
+
const boxShadow$1 = props => {
|
|
244
|
+
const {
|
|
245
|
+
theme
|
|
246
|
+
} = props;
|
|
247
|
+
const {
|
|
248
|
+
space,
|
|
249
|
+
shadows
|
|
250
|
+
} = theme;
|
|
251
|
+
const offsetY = `${space.base * 5}px`;
|
|
252
|
+
const blurRadius = `${space.base * 7}px`;
|
|
253
|
+
const color = getColor('neutralHue', 800, theme, 0.35);
|
|
479
254
|
return shadows.lg(offsetY, blurRadius, color);
|
|
480
255
|
};
|
|
481
|
-
|
|
256
|
+
const sizeStyles$1 = props => {
|
|
482
257
|
return css(["", "{width:", ";}"], mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
|
|
483
258
|
};
|
|
484
|
-
|
|
259
|
+
const StyledModal = styled.div.attrs({
|
|
485
260
|
'data-garden-id': COMPONENT_ID$d,
|
|
486
|
-
'data-garden-version': '8.
|
|
261
|
+
'data-garden-version': '8.59.0'
|
|
487
262
|
}).withConfig({
|
|
488
263
|
displayName: "StyledModal",
|
|
489
264
|
componentId: "sc-1pe1axu-0"
|
|
490
|
-
})(["display:flex;position:fixed;flex-direction:column;margin:", ";border-radius:", ";box-shadow:", ";background-color:", ";min-height:60px;max-height:calc(100vh - ", "px);animation:", ";animation-delay:0.01s;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:", ";}", ";"],
|
|
491
|
-
return props.isCentered ? '0' : "".concat(props.theme.space.base * 12, "px");
|
|
492
|
-
}, function (props) {
|
|
493
|
-
return props.theme.borderRadii.md;
|
|
494
|
-
}, boxShadow$1, function (props) {
|
|
495
|
-
return props.theme.colors.background;
|
|
496
|
-
}, function (props) {
|
|
497
|
-
return props.theme.space.base * 24;
|
|
498
|
-
}, function (props) {
|
|
499
|
-
return props.isAnimated && css(["", " 0.3s ease-in-out"], animationName);
|
|
500
|
-
}, function (props) {
|
|
501
|
-
return props.theme.rtl && 'rtl';
|
|
502
|
-
}, sizeStyles$1, function (props) {
|
|
503
|
-
return props.theme.space.base * 6;
|
|
504
|
-
}, function (props) {
|
|
505
|
-
return props.theme.space.base * 6;
|
|
506
|
-
}, function (props) {
|
|
507
|
-
return props.isCentered && '50%';
|
|
508
|
-
}, function (props) {
|
|
509
|
-
return props.isCentered && '50%';
|
|
510
|
-
}, function (props) {
|
|
511
|
-
return props.isCentered && 'translate(50%, 50%)';
|
|
512
|
-
}, function (props) {
|
|
513
|
-
return retrieveComponentStyles(COMPONENT_ID$d, props);
|
|
514
|
-
});
|
|
265
|
+
})(["display:flex;position:fixed;flex-direction:column;margin:", ";border-radius:", ";box-shadow:", ";background-color:", ";min-height:60px;max-height:calc(100vh - ", "px);animation:", ";animation-delay:0.01s;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.colors.background, props => props.theme.space.base * 24, props => props.isAnimated && css(["", " 0.3s ease-in-out"], animationName), props => props.theme.rtl && 'rtl', sizeStyles$1, props => props.theme.space.base * 6, props => props.theme.space.base * 6, props => props.isCentered && '50%', props => props.isCentered && '50%', props => props.isCentered && 'translate(50%, 50%)', props => retrieveComponentStyles(COMPONENT_ID$d, props));
|
|
515
266
|
StyledModal.propTypes = {
|
|
516
267
|
isLarge: PropTypes.bool,
|
|
517
268
|
isAnimated: PropTypes.bool
|
|
@@ -520,26 +271,20 @@ StyledModal.defaultProps = {
|
|
|
520
271
|
theme: DEFAULT_THEME
|
|
521
272
|
};
|
|
522
273
|
|
|
523
|
-
|
|
524
|
-
|
|
274
|
+
const COMPONENT_ID$c = 'modals.tooltip_modal.backdrop';
|
|
275
|
+
const StyledTooltipModalBackdrop = styled.div.attrs({
|
|
525
276
|
'data-garden-id': COMPONENT_ID$c,
|
|
526
|
-
'data-garden-version': '8.
|
|
277
|
+
'data-garden-version': '8.59.0'
|
|
527
278
|
}).withConfig({
|
|
528
279
|
displayName: "StyledTooltipModalBackdrop",
|
|
529
280
|
componentId: "sc-1yaomgq-0"
|
|
530
|
-
})(["position:fixed;top:0;right:0;bottom:0;left:0;z-index:400;overflow:hidden;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-tooltip-modal-transition-exit-active{pointer-events:none;}&.garden-tooltip-modal-transition-exit-active div{transition:opacity 200ms;opacity:0;}", ";"],
|
|
531
|
-
return props.theme.fonts.system;
|
|
532
|
-
}, function (props) {
|
|
533
|
-
return props.theme.rtl && 'rtl';
|
|
534
|
-
}, function (props) {
|
|
535
|
-
return retrieveComponentStyles(COMPONENT_ID$c, props);
|
|
536
|
-
});
|
|
281
|
+
})(["position:fixed;top:0;right:0;bottom:0;left:0;z-index:400;overflow:hidden;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-tooltip-modal-transition-exit-active{pointer-events:none;}&.garden-tooltip-modal-transition-exit-active div{transition:opacity 200ms;opacity:0;}", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID$c, props));
|
|
537
282
|
StyledTooltipModalBackdrop.defaultProps = {
|
|
538
283
|
theme: DEFAULT_THEME
|
|
539
284
|
};
|
|
540
285
|
|
|
541
286
|
function getPopperPlacement(gardenPlacement) {
|
|
542
|
-
|
|
287
|
+
const gardenToPopperMapping = {
|
|
543
288
|
auto: 'auto',
|
|
544
289
|
top: 'top',
|
|
545
290
|
'top-start': 'top-start',
|
|
@@ -557,7 +302,7 @@ function getPopperPlacement(gardenPlacement) {
|
|
|
557
302
|
return gardenToPopperMapping[gardenPlacement];
|
|
558
303
|
}
|
|
559
304
|
function getRtlPopperPlacement(gardenPlacement) {
|
|
560
|
-
|
|
305
|
+
const rtlPlacementMappings = {
|
|
561
306
|
left: 'right',
|
|
562
307
|
'left-start': 'right-start',
|
|
563
308
|
'left-end': 'right-end',
|
|
@@ -569,11 +314,11 @@ function getRtlPopperPlacement(gardenPlacement) {
|
|
|
569
314
|
'bottom-start': 'bottom-end',
|
|
570
315
|
'bottom-end': 'bottom-start'
|
|
571
316
|
};
|
|
572
|
-
|
|
317
|
+
const popperPlacement = getPopperPlacement(gardenPlacement);
|
|
573
318
|
return rtlPlacementMappings[popperPlacement] || popperPlacement;
|
|
574
319
|
}
|
|
575
320
|
function getArrowPosition(popperPlacement) {
|
|
576
|
-
|
|
321
|
+
const arrowPositionMappings = {
|
|
577
322
|
top: 'bottom',
|
|
578
323
|
'top-start': 'bottom-left',
|
|
579
324
|
'top-end': 'bottom-right',
|
|
@@ -593,41 +338,33 @@ function getMenuPosition(popperPlacement) {
|
|
|
593
338
|
return popperPlacement ? popperPlacement.split('-')[0] : 'bottom';
|
|
594
339
|
}
|
|
595
340
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
};
|
|
600
|
-
}).withConfig({
|
|
341
|
+
const StyledTooltipWrapper = styled.div.attrs(props => ({
|
|
342
|
+
className: props.isAnimated && 'is-animated'
|
|
343
|
+
})).withConfig({
|
|
601
344
|
displayName: "StyledTooltipWrapper",
|
|
602
345
|
componentId: "sc-1xk05kf-0"
|
|
603
|
-
})(["", ";"],
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
});
|
|
611
|
-
});
|
|
346
|
+
})(["", ";"], props => menuStyles(getMenuPosition(props.placement), {
|
|
347
|
+
theme: props.theme,
|
|
348
|
+
hidden: false,
|
|
349
|
+
margin: '0',
|
|
350
|
+
zIndex: props.zIndex,
|
|
351
|
+
animationModifier: '.is-animated'
|
|
352
|
+
}));
|
|
612
353
|
StyledTooltipWrapper.defaultProps = {
|
|
613
354
|
theme: DEFAULT_THEME
|
|
614
355
|
};
|
|
615
356
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
};
|
|
623
|
-
}).withConfig({
|
|
357
|
+
const COMPONENT_ID$b = 'modals.tooltip_modal';
|
|
358
|
+
const StyledTooltipModal = styled.div.attrs(props => ({
|
|
359
|
+
'data-garden-id': COMPONENT_ID$b,
|
|
360
|
+
'data-garden-version': '8.59.0',
|
|
361
|
+
className: props.isAnimated && 'is-animated'
|
|
362
|
+
})).withConfig({
|
|
624
363
|
displayName: "StyledTooltipModal",
|
|
625
364
|
componentId: "sc-42ubfr-0"
|
|
626
|
-
})(["padding:", "px;width:400px;", ";", ";"],
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
var computedArrowStyles = arrowStyles(getArrowPosition(props.placement), {
|
|
630
|
-
size: "".concat(props.theme.space.base * 2, "px"),
|
|
365
|
+
})(["padding:", "px;width:400px;", ";", ";"], props => props.theme.space.base * 5, props => {
|
|
366
|
+
const computedArrowStyles = arrowStyles(getArrowPosition(props.placement), {
|
|
367
|
+
size: `${props.theme.space.base * 2}px`,
|
|
631
368
|
inset: '1px',
|
|
632
369
|
animationModifier: '.is-animated'
|
|
633
370
|
});
|
|
@@ -635,314 +372,244 @@ var StyledTooltipModal = styled.div.attrs(function (props) {
|
|
|
635
372
|
return props.hasArrow && props.transitionState === 'entered' && computedArrowStyles;
|
|
636
373
|
}
|
|
637
374
|
return props.hasArrow && computedArrowStyles;
|
|
638
|
-
},
|
|
639
|
-
return retrieveComponentStyles(COMPONENT_ID$b, props);
|
|
640
|
-
});
|
|
375
|
+
}, props => retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
641
376
|
StyledTooltipModal.defaultProps = {
|
|
642
377
|
theme: DEFAULT_THEME
|
|
643
378
|
};
|
|
644
379
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
};
|
|
649
|
-
|
|
380
|
+
const COMPONENT_ID$a = 'modals.tooltip_modal.title';
|
|
381
|
+
const sizeStyles = props => `
|
|
382
|
+
/* stylelint-disable-next-line property-no-unknown */
|
|
383
|
+
padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
|
|
384
|
+
line-height: ${getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md)};
|
|
385
|
+
font-size: ${props.theme.fontSizes.md};
|
|
386
|
+
`;
|
|
387
|
+
const StyledTooltipModalTitle = styled.div.attrs({
|
|
650
388
|
'data-garden-id': COMPONENT_ID$a,
|
|
651
|
-
'data-garden-version': '8.
|
|
389
|
+
'data-garden-version': '8.59.0'
|
|
652
390
|
}).withConfig({
|
|
653
391
|
displayName: "StyledTooltipModalTitle",
|
|
654
392
|
componentId: "sc-11xjgjs-0"
|
|
655
|
-
})(["margin:0;color:", ";font-weight:", ";", ";", ";"],
|
|
656
|
-
return props.theme.colors.foreground;
|
|
657
|
-
}, function (props) {
|
|
658
|
-
return props.theme.fontWeights.semibold;
|
|
659
|
-
}, function (props) {
|
|
660
|
-
return sizeStyles(props);
|
|
661
|
-
}, function (props) {
|
|
662
|
-
return retrieveComponentStyles(COMPONENT_ID$a, props);
|
|
663
|
-
});
|
|
393
|
+
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => props.theme.colors.foreground, props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
664
394
|
StyledTooltipModalTitle.defaultProps = {
|
|
665
395
|
theme: DEFAULT_THEME
|
|
666
396
|
};
|
|
667
397
|
|
|
668
|
-
|
|
669
|
-
|
|
398
|
+
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
399
|
+
const StyledTooltipModalBody = styled.div.attrs({
|
|
670
400
|
'data-garden-id': COMPONENT_ID$9,
|
|
671
|
-
'data-garden-version': '8.
|
|
401
|
+
'data-garden-version': '8.59.0'
|
|
672
402
|
}).withConfig({
|
|
673
403
|
displayName: "StyledTooltipModalBody",
|
|
674
404
|
componentId: "sc-195dkzj-0"
|
|
675
|
-
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color:", ";font-size:", ";", ";"],
|
|
676
|
-
return props.theme.space.base * 1.5;
|
|
677
|
-
}, function (props) {
|
|
678
|
-
return getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md);
|
|
679
|
-
}, function (props) {
|
|
680
|
-
return props.theme.colors.foreground;
|
|
681
|
-
}, function (props) {
|
|
682
|
-
return props.theme.fontSizes.md;
|
|
683
|
-
}, function (props) {
|
|
684
|
-
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
685
|
-
});
|
|
405
|
+
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
686
406
|
StyledTooltipModalBody.defaultProps = {
|
|
687
407
|
theme: DEFAULT_THEME
|
|
688
408
|
};
|
|
689
409
|
|
|
690
|
-
|
|
691
|
-
|
|
410
|
+
const COMPONENT_ID$8 = 'modals.tooltip_modal.footer';
|
|
411
|
+
const StyledTooltipModalFooter = styled.div.attrs({
|
|
692
412
|
'data-garden-id': COMPONENT_ID$8,
|
|
693
|
-
'data-garden-version': '8.
|
|
413
|
+
'data-garden-version': '8.59.0'
|
|
694
414
|
}).withConfig({
|
|
695
415
|
displayName: "StyledTooltipModalFooter",
|
|
696
416
|
componentId: "sc-fm36a9-0"
|
|
697
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;padding-top:", "px;", ";"],
|
|
698
|
-
return p.theme.space.base * 5;
|
|
699
|
-
}, function (props) {
|
|
700
|
-
return retrieveComponentStyles(COMPONENT_ID$8, props);
|
|
701
|
-
});
|
|
417
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;padding-top:", "px;", ";"], p => p.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
702
418
|
StyledTooltipModalFooter.defaultProps = {
|
|
703
419
|
theme: DEFAULT_THEME
|
|
704
420
|
};
|
|
705
421
|
|
|
706
|
-
|
|
707
|
-
|
|
422
|
+
const COMPONENT_ID$7 = 'modals.tooltip_modal.footer_item';
|
|
423
|
+
const StyledTooltipModalFooterItem = styled(StyledFooterItem).attrs({
|
|
708
424
|
'data-garden-id': COMPONENT_ID$7,
|
|
709
|
-
'data-garden-version': '8.
|
|
425
|
+
'data-garden-version': '8.59.0'
|
|
710
426
|
}).withConfig({
|
|
711
427
|
displayName: "StyledTooltipModalFooterItem",
|
|
712
428
|
componentId: "sc-1nahj6p-0"
|
|
713
|
-
})(["", ";"],
|
|
714
|
-
return retrieveComponentStyles(COMPONENT_ID$7, props);
|
|
715
|
-
});
|
|
429
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
716
430
|
StyledTooltipModalFooterItem.defaultProps = {
|
|
717
431
|
theme: DEFAULT_THEME
|
|
718
432
|
};
|
|
719
433
|
|
|
720
|
-
|
|
721
|
-
|
|
434
|
+
const COMPONENT_ID$6 = 'modals.tooltip_modal.close';
|
|
435
|
+
const StyledTooltipModalClose = styled(StyledClose).attrs({
|
|
722
436
|
'data-garden-id': COMPONENT_ID$6,
|
|
723
|
-
'data-garden-version': '8.
|
|
437
|
+
'data-garden-version': '8.59.0'
|
|
724
438
|
}).withConfig({
|
|
725
439
|
displayName: "StyledTooltipModalClose",
|
|
726
440
|
componentId: "sc-1h2ke3q-0"
|
|
727
|
-
})(["top:", "px;", ":", ";width:", "px;height:", "px;", ";"],
|
|
728
|
-
return props.theme.space.base * 3.5;
|
|
729
|
-
}, function (props) {
|
|
730
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
731
|
-
}, function (props) {
|
|
732
|
-
return "".concat(props.theme.space.base * 3, "px");
|
|
733
|
-
}, function (props) {
|
|
734
|
-
return props.theme.space.base * 8;
|
|
735
|
-
}, function (props) {
|
|
736
|
-
return props.theme.space.base * 8;
|
|
737
|
-
}, function (props) {
|
|
738
|
-
return retrieveComponentStyles(COMPONENT_ID$6, props);
|
|
739
|
-
});
|
|
441
|
+
})(["top:", "px;", ":", ";width:", "px;height:", "px;", ";"], props => props.theme.space.base * 3.5, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * 3}px`, props => props.theme.space.base * 8, props => props.theme.space.base * 8, props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
740
442
|
StyledTooltipModalClose.defaultProps = {
|
|
741
443
|
theme: DEFAULT_THEME
|
|
742
444
|
};
|
|
743
445
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
446
|
+
const COMPONENT_ID$5 = 'modals.drawer_modal';
|
|
447
|
+
const DRAWER_WIDTH = 380;
|
|
448
|
+
const boxShadow = props => {
|
|
449
|
+
const {
|
|
450
|
+
theme
|
|
451
|
+
} = props;
|
|
452
|
+
const {
|
|
453
|
+
space,
|
|
454
|
+
shadows
|
|
455
|
+
} = theme;
|
|
456
|
+
const offsetY = `${space.base * 5}px`;
|
|
457
|
+
const blurRadius = `${space.base * 7}px`;
|
|
458
|
+
const color = getColor('neutralHue', 800, theme, 0.35);
|
|
753
459
|
return shadows.lg(offsetY, blurRadius, color);
|
|
754
460
|
};
|
|
755
|
-
|
|
461
|
+
const StyledDrawerModal = styled.div.attrs({
|
|
756
462
|
'data-garden-id': COMPONENT_ID$5,
|
|
757
|
-
'data-garden-version': '8.
|
|
463
|
+
'data-garden-version': '8.59.0'
|
|
758
464
|
}).withConfig({
|
|
759
465
|
displayName: "StyledDrawerModal",
|
|
760
466
|
componentId: "sc-i1sake-0"
|
|
761
|
-
})(["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;}", ";"],
|
|
762
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
763
|
-
}, boxShadow, function (props) {
|
|
764
|
-
return props.theme.colors.background;
|
|
765
|
-
}, DRAWER_WIDTH, function (props) {
|
|
766
|
-
return props.theme.fonts.system;
|
|
767
|
-
}, function (props) {
|
|
768
|
-
return props.theme.rtl && 'rtl';
|
|
769
|
-
}, function (props) {
|
|
770
|
-
return props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH;
|
|
771
|
-
}, function (props) {
|
|
772
|
-
return props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH;
|
|
773
|
-
}, function (props) {
|
|
774
|
-
return retrieveComponentStyles(COMPONENT_ID$5, props);
|
|
775
|
-
});
|
|
467
|
+
})(["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.colors.background, DRAWER_WIDTH, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
776
468
|
StyledDrawerModal.defaultProps = {
|
|
777
469
|
theme: DEFAULT_THEME
|
|
778
470
|
};
|
|
779
471
|
|
|
780
|
-
|
|
781
|
-
|
|
472
|
+
const COMPONENT_ID$4 = 'modals.drawer_modal.close';
|
|
473
|
+
const BASE_MULTIPLIERS = {
|
|
782
474
|
top: BASE_MULTIPLIERS$1.top,
|
|
783
475
|
side: 2,
|
|
784
476
|
size: BASE_MULTIPLIERS$1.size
|
|
785
477
|
};
|
|
786
|
-
|
|
478
|
+
const StyledDrawerModalClose = styled(StyledClose).attrs({
|
|
787
479
|
'data-garden-id': COMPONENT_ID$4,
|
|
788
|
-
'data-garden-version': '8.
|
|
480
|
+
'data-garden-version': '8.59.0'
|
|
789
481
|
}).withConfig({
|
|
790
482
|
displayName: "StyledDrawerModalClose",
|
|
791
483
|
componentId: "sc-hrnaom-0"
|
|
792
|
-
})(["", ":", ";", ";"],
|
|
793
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
794
|
-
}, function (props) {
|
|
795
|
-
return "".concat(props.theme.space.base * BASE_MULTIPLIERS.side, "px");
|
|
796
|
-
}, function (props) {
|
|
797
|
-
return retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
798
|
-
});
|
|
484
|
+
})(["", ":", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
799
485
|
StyledDrawerModalClose.defaultProps = {
|
|
800
486
|
theme: DEFAULT_THEME
|
|
801
487
|
};
|
|
802
488
|
|
|
803
|
-
|
|
804
|
-
|
|
489
|
+
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
490
|
+
const StyledDrawerModalHeader = styled(StyledHeader).attrs({
|
|
805
491
|
'data-garden-id': COMPONENT_ID$3,
|
|
806
|
-
'data-garden-version': '8.
|
|
492
|
+
'data-garden-version': '8.59.0'
|
|
807
493
|
}).withConfig({
|
|
808
494
|
displayName: "StyledDrawerModalHeader",
|
|
809
495
|
componentId: "sc-1u04rqw-0"
|
|
810
|
-
})(["padding:", "px;", " ", ";"],
|
|
811
|
-
return props.theme.space.base * 5;
|
|
812
|
-
}, function (props) {
|
|
813
|
-
return props.isCloseButtonPresent && "padding-".concat(props.theme.rtl ? 'left' : 'right', ": ").concat(props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2), "px;");
|
|
814
|
-
}, function (props) {
|
|
815
|
-
return retrieveComponentStyles(COMPONENT_ID$3, props);
|
|
816
|
-
});
|
|
496
|
+
})(["padding:", "px;", " ", ";"], props => props.theme.space.base * 5, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
817
497
|
StyledDrawerModalHeader.defaultProps = {
|
|
818
498
|
theme: DEFAULT_THEME
|
|
819
499
|
};
|
|
820
500
|
|
|
821
|
-
|
|
822
|
-
|
|
501
|
+
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
502
|
+
const StyledDrawerModalBody = styled(StyledBody).attrs({
|
|
823
503
|
'data-garden-id': COMPONENT_ID$2,
|
|
824
|
-
'data-garden-version': '8.
|
|
504
|
+
'data-garden-version': '8.59.0'
|
|
825
505
|
}).withConfig({
|
|
826
506
|
displayName: "StyledDrawerModalBody",
|
|
827
507
|
componentId: "sc-yafe2y-0"
|
|
828
|
-
})(["padding:", "px;", ";"],
|
|
829
|
-
return props.theme.space.base * 5;
|
|
830
|
-
}, function (props) {
|
|
831
|
-
return retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
832
|
-
});
|
|
508
|
+
})(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
833
509
|
StyledDrawerModalBody.defaultProps = {
|
|
834
510
|
theme: DEFAULT_THEME
|
|
835
511
|
};
|
|
836
512
|
|
|
837
|
-
|
|
838
|
-
|
|
513
|
+
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
514
|
+
const StyledDrawerModalFooter = styled.div.attrs({
|
|
839
515
|
'data-garden-id': COMPONENT_ID$1,
|
|
840
|
-
'data-garden-version': '8.
|
|
516
|
+
'data-garden-version': '8.59.0'
|
|
841
517
|
}).withConfig({
|
|
842
518
|
displayName: "StyledDrawerModalFooter",
|
|
843
519
|
componentId: "sc-17if4ka-0"
|
|
844
|
-
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"],
|
|
845
|
-
return "".concat(props.theme.borders.sm, " ").concat(getColor('neutralHue', 200, props.theme));
|
|
846
|
-
}, function (props) {
|
|
847
|
-
return props.theme.space.base * 5;
|
|
848
|
-
}, function (props) {
|
|
849
|
-
return retrieveComponentStyles(COMPONENT_ID$1, props);
|
|
850
|
-
});
|
|
520
|
+
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], props => `${props.theme.borders.sm} ${getColor('neutralHue', 200, props.theme)}`, props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
851
521
|
StyledDrawerModalFooter.defaultProps = {
|
|
852
522
|
theme: DEFAULT_THEME
|
|
853
523
|
};
|
|
854
524
|
|
|
855
|
-
|
|
856
|
-
|
|
525
|
+
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
526
|
+
const StyledDrawerModalFooterItem = styled(StyledFooterItem).attrs({
|
|
857
527
|
'data-garden-id': COMPONENT_ID,
|
|
858
|
-
'data-garden-version': '8.
|
|
528
|
+
'data-garden-version': '8.59.0'
|
|
859
529
|
}).withConfig({
|
|
860
530
|
displayName: "StyledDrawerModalFooterItem",
|
|
861
531
|
componentId: "sc-1vbl885-0"
|
|
862
|
-
})(["", ";"],
|
|
863
|
-
return retrieveComponentStyles(COMPONENT_ID, props);
|
|
864
|
-
});
|
|
532
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
865
533
|
StyledDrawerModalFooterItem.defaultProps = {
|
|
866
534
|
theme: DEFAULT_THEME
|
|
867
535
|
};
|
|
868
536
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
537
|
+
const ModalsContext = createContext(undefined);
|
|
538
|
+
const useModalContext = () => {
|
|
539
|
+
const context = useContext(ModalsContext);
|
|
872
540
|
if (context === undefined) {
|
|
873
541
|
throw new Error('useModalContext must be used within a ModalsContext.Provider');
|
|
874
542
|
}
|
|
875
543
|
return context;
|
|
876
544
|
};
|
|
877
545
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
var isBody = element && element.tagName.toLowerCase() === 'body';
|
|
546
|
+
const isOverflowing = element => {
|
|
547
|
+
const doc = ownerDocument(element);
|
|
548
|
+
const win = ownerWindow(doc);
|
|
549
|
+
const isBody = element && element.tagName.toLowerCase() === 'body';
|
|
883
550
|
if (!isWindow(doc) && !isBody) {
|
|
884
551
|
return element.scrollHeight > element.clientHeight;
|
|
885
552
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
553
|
+
const style = win.getComputedStyle(doc.body);
|
|
554
|
+
const marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);
|
|
555
|
+
const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
|
|
889
556
|
return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
|
|
890
557
|
};
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
558
|
+
const Modal = forwardRef((_ref, ref) => {
|
|
559
|
+
let {
|
|
560
|
+
backdropProps,
|
|
561
|
+
children,
|
|
562
|
+
onClose,
|
|
563
|
+
isLarge,
|
|
564
|
+
isCentered,
|
|
565
|
+
isAnimated,
|
|
566
|
+
id,
|
|
567
|
+
appendToNode,
|
|
568
|
+
focusOnMount,
|
|
569
|
+
restoreFocus,
|
|
570
|
+
...modalProps
|
|
571
|
+
} = _ref;
|
|
572
|
+
const theme = useContext(ThemeContext);
|
|
573
|
+
const modalRef = useRef(null);
|
|
574
|
+
const environment = useDocument(theme);
|
|
575
|
+
const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
|
|
576
|
+
const {
|
|
577
|
+
getBackdropProps,
|
|
578
|
+
getModalProps,
|
|
579
|
+
getTitleProps,
|
|
580
|
+
getContentProps,
|
|
581
|
+
getCloseProps
|
|
582
|
+
} = useModal({
|
|
911
583
|
idPrefix: id,
|
|
912
|
-
onClose
|
|
913
|
-
modalRef
|
|
914
|
-
focusOnMount
|
|
915
|
-
restoreFocus
|
|
916
|
-
})
|
|
917
|
-
getBackdropProps = _useModal.getBackdropProps,
|
|
918
|
-
getModalProps = _useModal.getModalProps,
|
|
919
|
-
getTitleProps = _useModal.getTitleProps,
|
|
920
|
-
getContentProps = _useModal.getContentProps,
|
|
921
|
-
getCloseProps = _useModal.getCloseProps;
|
|
584
|
+
onClose,
|
|
585
|
+
modalRef,
|
|
586
|
+
focusOnMount,
|
|
587
|
+
restoreFocus
|
|
588
|
+
});
|
|
922
589
|
useFocusVisible({
|
|
923
590
|
scope: modalRef,
|
|
924
591
|
relativeDocument: environment
|
|
925
592
|
});
|
|
926
|
-
useEffect(
|
|
593
|
+
useEffect(() => {
|
|
927
594
|
if (!environment) {
|
|
928
595
|
return undefined;
|
|
929
596
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
597
|
+
const htmlElement = environment.querySelector('html');
|
|
598
|
+
const bodyElement = environment.querySelector('body');
|
|
599
|
+
let previousHtmlOverflow;
|
|
600
|
+
let previousBodyPaddingRight;
|
|
934
601
|
if (bodyElement) {
|
|
935
602
|
if (isOverflowing(bodyElement)) {
|
|
936
|
-
|
|
937
|
-
|
|
603
|
+
const scrollbarSize$1 = scrollbarSize();
|
|
604
|
+
const bodyPaddingRight = parseInt(style(bodyElement, 'paddingRight') || '0', 10);
|
|
938
605
|
previousBodyPaddingRight = bodyElement.style.paddingRight;
|
|
939
|
-
bodyElement.style.paddingRight =
|
|
606
|
+
bodyElement.style.paddingRight = `${bodyPaddingRight + scrollbarSize$1}px`;
|
|
940
607
|
}
|
|
941
608
|
if (htmlElement) {
|
|
942
609
|
previousHtmlOverflow = htmlElement.style.overflow;
|
|
943
610
|
htmlElement.style.overflow = 'hidden';
|
|
944
611
|
}
|
|
945
|
-
return
|
|
612
|
+
return () => {
|
|
946
613
|
if (htmlElement) {
|
|
947
614
|
htmlElement.style.overflow = previousHtmlOverflow;
|
|
948
615
|
}
|
|
@@ -951,7 +618,7 @@ var Modal = forwardRef(function (_ref, ref) {
|
|
|
951
618
|
}
|
|
952
619
|
return undefined;
|
|
953
620
|
}, [environment]);
|
|
954
|
-
|
|
621
|
+
const rootNode = useMemo(() => {
|
|
955
622
|
if (appendToNode) {
|
|
956
623
|
return appendToNode;
|
|
957
624
|
}
|
|
@@ -960,16 +627,14 @@ var Modal = forwardRef(function (_ref, ref) {
|
|
|
960
627
|
}
|
|
961
628
|
return undefined;
|
|
962
629
|
}, [appendToNode, environment]);
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
};
|
|
972
|
-
}, [isLarge, isCloseButtonPresent, getTitleProps, getContentProps, getCloseProps]);
|
|
630
|
+
const value = useMemo(() => ({
|
|
631
|
+
isLarge,
|
|
632
|
+
isCloseButtonPresent,
|
|
633
|
+
getTitleProps,
|
|
634
|
+
getContentProps,
|
|
635
|
+
getCloseProps,
|
|
636
|
+
setIsCloseButtonPresent
|
|
637
|
+
}), [isLarge, isCloseButtonPresent, getTitleProps, getContentProps, getCloseProps]);
|
|
973
638
|
if (!rootNode) {
|
|
974
639
|
return null;
|
|
975
640
|
}
|
|
@@ -1002,9 +667,10 @@ Modal.defaultProps = {
|
|
|
1002
667
|
isCentered: true
|
|
1003
668
|
};
|
|
1004
669
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
670
|
+
const Body$2 = forwardRef((props, ref) => {
|
|
671
|
+
const {
|
|
672
|
+
getContentProps
|
|
673
|
+
} = useModalContext();
|
|
1008
674
|
return React__default.createElement(StyledBody, _extends$2({}, getContentProps(props), {
|
|
1009
675
|
ref: ref
|
|
1010
676
|
}));
|
|
@@ -1022,7 +688,8 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
1022
688
|
height: 16,
|
|
1023
689
|
focusable: "false",
|
|
1024
690
|
viewBox: "0 0 16 16",
|
|
1025
|
-
"aria-hidden": "true"
|
|
691
|
+
"aria-hidden": "true",
|
|
692
|
+
role: "img"
|
|
1026
693
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
1027
694
|
stroke: "currentColor",
|
|
1028
695
|
strokeLinecap: "round",
|
|
@@ -1030,28 +697,29 @@ var SvgXStroke = function SvgXStroke(props) {
|
|
|
1030
697
|
})));
|
|
1031
698
|
};
|
|
1032
699
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
700
|
+
const Close$2 = forwardRef((props, ref) => {
|
|
701
|
+
const {
|
|
702
|
+
getCloseProps,
|
|
703
|
+
setIsCloseButtonPresent
|
|
704
|
+
} = useModalContext();
|
|
705
|
+
useEffect(() => {
|
|
1038
706
|
setIsCloseButtonPresent(true);
|
|
1039
|
-
return
|
|
1040
|
-
return setIsCloseButtonPresent(false);
|
|
1041
|
-
};
|
|
707
|
+
return () => setIsCloseButtonPresent(false);
|
|
1042
708
|
});
|
|
1043
|
-
|
|
1044
|
-
return React__default.createElement(StyledClose, _extends$2({}, getCloseProps(
|
|
709
|
+
const ariaLabel = useText(Close$2, props, 'aria-label', 'Close modal');
|
|
710
|
+
return React__default.createElement(StyledClose, _extends$2({}, getCloseProps({
|
|
711
|
+
...props,
|
|
1045
712
|
'aria-label': ariaLabel
|
|
1046
|
-
})
|
|
713
|
+
}), {
|
|
1047
714
|
ref: ref
|
|
1048
715
|
}), React__default.createElement(SvgXStroke, null));
|
|
1049
716
|
});
|
|
1050
717
|
Close$2.displayName = 'Close';
|
|
1051
718
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
719
|
+
const Footer$2 = React__default.forwardRef((props, ref) => {
|
|
720
|
+
const {
|
|
721
|
+
isLarge
|
|
722
|
+
} = useModalContext();
|
|
1055
723
|
return React__default.createElement(StyledFooter, _extends$2({
|
|
1056
724
|
ref: ref,
|
|
1057
725
|
isLarge: isLarge
|
|
@@ -1059,141 +727,164 @@ var Footer$2 = React__default.forwardRef(function (props, ref) {
|
|
|
1059
727
|
});
|
|
1060
728
|
Footer$2.displayName = 'Footer';
|
|
1061
729
|
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
}, props));
|
|
1066
|
-
});
|
|
730
|
+
const FooterItem$2 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, _extends$2({
|
|
731
|
+
ref: ref
|
|
732
|
+
}, props)));
|
|
1067
733
|
FooterItem$2.displayName = 'FooterItem';
|
|
1068
734
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
735
|
+
const Header$1 = forwardRef((_ref, ref) => {
|
|
736
|
+
let {
|
|
737
|
+
children,
|
|
738
|
+
isDanger,
|
|
739
|
+
tag,
|
|
740
|
+
...other
|
|
741
|
+
} = _ref;
|
|
742
|
+
const {
|
|
743
|
+
isCloseButtonPresent,
|
|
744
|
+
getTitleProps
|
|
745
|
+
} = useModalContext();
|
|
746
|
+
return React__default.createElement(StyledHeader, _extends$2({}, getTitleProps(other), {
|
|
747
|
+
as: tag,
|
|
1074
748
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
1075
749
|
ref: ref
|
|
1076
|
-
}),
|
|
750
|
+
}), isDanger && React__default.createElement(StyledDangerIcon, null), children);
|
|
1077
751
|
});
|
|
1078
752
|
Header$1.displayName = 'Header';
|
|
753
|
+
Header$1.propTypes = {
|
|
754
|
+
isDanger: PropTypes.bool,
|
|
755
|
+
tag: PropTypes.any
|
|
756
|
+
};
|
|
757
|
+
Header$1.defaultProps = {
|
|
758
|
+
tag: 'div'
|
|
759
|
+
};
|
|
1079
760
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
761
|
+
const TooltipModalContext = createContext(undefined);
|
|
762
|
+
const useTooltipModalContext = () => {
|
|
763
|
+
const context = useContext(TooltipModalContext);
|
|
1083
764
|
if (context === undefined) {
|
|
1084
765
|
throw new Error('Element must be used within a TooltipModal component.');
|
|
1085
766
|
}
|
|
1086
767
|
return context;
|
|
1087
768
|
};
|
|
1088
769
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
770
|
+
const TitleComponent = forwardRef((_ref, ref) => {
|
|
771
|
+
let {
|
|
772
|
+
children,
|
|
773
|
+
tag,
|
|
774
|
+
...other
|
|
775
|
+
} = _ref;
|
|
776
|
+
const {
|
|
777
|
+
getTitleProps
|
|
778
|
+
} = useTooltipModalContext();
|
|
779
|
+
return React__default.createElement(StyledTooltipModalTitle, _extends$2({}, getTitleProps(other), {
|
|
780
|
+
as: tag,
|
|
1093
781
|
ref: ref
|
|
1094
|
-
}),
|
|
782
|
+
}), children);
|
|
1095
783
|
});
|
|
1096
784
|
TitleComponent.displayName = 'TooltipModal.Title';
|
|
1097
|
-
|
|
785
|
+
TitleComponent.propTypes = {
|
|
786
|
+
tag: PropTypes.any
|
|
787
|
+
};
|
|
788
|
+
TitleComponent.defaultProps = {
|
|
789
|
+
tag: 'div'
|
|
790
|
+
};
|
|
791
|
+
const Title = TitleComponent;
|
|
1098
792
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
793
|
+
const BodyComponent$1 = forwardRef((props, ref) => {
|
|
794
|
+
const {
|
|
795
|
+
getContentProps
|
|
796
|
+
} = useTooltipModalContext();
|
|
1102
797
|
return React__default.createElement(StyledTooltipModalBody, _extends$2({}, getContentProps(props), {
|
|
1103
798
|
ref: ref
|
|
1104
799
|
}));
|
|
1105
800
|
});
|
|
1106
801
|
BodyComponent$1.displayName = 'TooltipModal.Body';
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
802
|
+
const Body$1 = BodyComponent$1;
|
|
803
|
+
|
|
804
|
+
const CloseComponent$1 = forwardRef((props, ref) => {
|
|
805
|
+
const {
|
|
806
|
+
getCloseProps
|
|
807
|
+
} = useTooltipModalContext();
|
|
808
|
+
const ariaLabel = useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
809
|
+
return React__default.createElement(StyledTooltipModalClose, _extends$2({}, getCloseProps({
|
|
810
|
+
...props,
|
|
1114
811
|
'aria-label': ariaLabel
|
|
1115
|
-
})
|
|
812
|
+
}), {
|
|
1116
813
|
ref: ref
|
|
1117
814
|
}), React__default.createElement(SvgXStroke, null));
|
|
1118
815
|
});
|
|
1119
816
|
CloseComponent$1.displayName = 'TooltipModal.Close';
|
|
1120
|
-
|
|
817
|
+
const Close$1 = CloseComponent$1;
|
|
1121
818
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}, props));
|
|
1126
|
-
});
|
|
819
|
+
const FooterComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipModalFooter, _extends$2({
|
|
820
|
+
ref: ref
|
|
821
|
+
}, props)));
|
|
1127
822
|
FooterComponent$1.displayName = 'TooltipModal.Footer';
|
|
1128
|
-
|
|
823
|
+
const Footer$1 = FooterComponent$1;
|
|
1129
824
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
}, props));
|
|
1134
|
-
});
|
|
825
|
+
const FooterItemComponent$1 = forwardRef((props, ref) => React__default.createElement(StyledTooltipModalFooterItem, _extends$2({
|
|
826
|
+
ref: ref
|
|
827
|
+
}, props)));
|
|
1135
828
|
FooterItemComponent$1.displayName = 'TooltipModal.FooterItem';
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
829
|
+
const FooterItem$1 = FooterItemComponent$1;
|
|
830
|
+
|
|
831
|
+
const TooltipModalComponent = React__default.forwardRef((_ref, ref) => {
|
|
832
|
+
let {
|
|
833
|
+
referenceElement,
|
|
834
|
+
popperModifiers,
|
|
835
|
+
placement,
|
|
836
|
+
onClose,
|
|
837
|
+
hasArrow,
|
|
838
|
+
isAnimated,
|
|
839
|
+
zIndex,
|
|
840
|
+
backdropProps,
|
|
841
|
+
focusOnMount,
|
|
842
|
+
restoreFocus,
|
|
843
|
+
id,
|
|
844
|
+
...props
|
|
845
|
+
} = _ref;
|
|
846
|
+
const theme = useContext(ThemeContext);
|
|
847
|
+
const previousReferenceElementRef = useRef();
|
|
848
|
+
const modalRef = useRef(null);
|
|
849
|
+
const transitionRef = useRef(null);
|
|
850
|
+
const [popperElement, setPopperElement] = useState();
|
|
851
|
+
const {
|
|
852
|
+
getTitleProps,
|
|
853
|
+
getCloseProps,
|
|
854
|
+
getContentProps,
|
|
855
|
+
getBackdropProps,
|
|
856
|
+
getModalProps
|
|
857
|
+
} = useModal({
|
|
1161
858
|
idPrefix: id,
|
|
1162
|
-
onClose
|
|
1163
|
-
modalRef
|
|
1164
|
-
focusOnMount
|
|
859
|
+
onClose,
|
|
860
|
+
modalRef,
|
|
861
|
+
focusOnMount,
|
|
1165
862
|
restoreFocus: false
|
|
1166
|
-
})
|
|
1167
|
-
|
|
1168
|
-
getCloseProps = _useModal.getCloseProps,
|
|
1169
|
-
getContentProps = _useModal.getContentProps,
|
|
1170
|
-
getBackdropProps = _useModal.getBackdropProps,
|
|
1171
|
-
getModalProps = _useModal.getModalProps;
|
|
1172
|
-
useEffect(function () {
|
|
863
|
+
});
|
|
864
|
+
useEffect(() => {
|
|
1173
865
|
if (!referenceElement && previousReferenceElementRef.current && restoreFocus) {
|
|
1174
866
|
previousReferenceElementRef.current.focus();
|
|
1175
867
|
}
|
|
1176
868
|
previousReferenceElementRef.current = referenceElement;
|
|
1177
869
|
}, [referenceElement, restoreFocus]);
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
870
|
+
const popperPlacement = useMemo(() => theme.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement), [placement, theme.rtl]);
|
|
871
|
+
const {
|
|
872
|
+
styles,
|
|
873
|
+
attributes,
|
|
874
|
+
state
|
|
875
|
+
} = usePopper(referenceElement, popperElement, {
|
|
1182
876
|
placement: popperPlacement,
|
|
1183
877
|
modifiers: [{
|
|
1184
878
|
name: 'offset',
|
|
1185
879
|
options: {
|
|
1186
880
|
offset: [0, theme.space.base * 3]
|
|
1187
881
|
}
|
|
1188
|
-
}
|
|
1189
|
-
})
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
getTitleProps: getTitleProps,
|
|
1195
|
-
getContentProps: getContentProps,
|
|
1196
|
-
getCloseProps: getCloseProps
|
|
882
|
+
}, ...(popperModifiers || [])]
|
|
883
|
+
});
|
|
884
|
+
const value = {
|
|
885
|
+
getTitleProps,
|
|
886
|
+
getContentProps,
|
|
887
|
+
getCloseProps
|
|
1197
888
|
};
|
|
1198
889
|
return React__default.createElement(CSSTransition, {
|
|
1199
890
|
unmountOnExit: true,
|
|
@@ -1201,7 +892,7 @@ var TooltipModalComponent = React__default.forwardRef(function (_ref, ref) {
|
|
|
1201
892
|
in: Boolean(referenceElement),
|
|
1202
893
|
classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
|
|
1203
894
|
nodeRef: transitionRef
|
|
1204
|
-
},
|
|
895
|
+
}, transitionState => {
|
|
1205
896
|
return React__default.createElement(TooltipModalContext.Provider, {
|
|
1206
897
|
value: value
|
|
1207
898
|
}, React__default.createElement(StyledTooltipModalBackdrop, _extends$2({}, getBackdropProps(), backdropProps, {
|
|
@@ -1242,123 +933,131 @@ TooltipModalComponent.propTypes = {
|
|
|
1242
933
|
focusOnMount: PropTypes.bool,
|
|
1243
934
|
restoreFocus: PropTypes.bool
|
|
1244
935
|
};
|
|
1245
|
-
|
|
936
|
+
const TooltipModal = TooltipModalComponent;
|
|
1246
937
|
TooltipModal.Body = Body$1;
|
|
1247
938
|
TooltipModal.Close = Close$1;
|
|
1248
939
|
TooltipModal.Footer = Footer$1;
|
|
1249
940
|
TooltipModal.FooterItem = FooterItem$1;
|
|
1250
941
|
TooltipModal.Title = Title;
|
|
1251
942
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
943
|
+
const HeaderComponent = forwardRef((_ref, ref) => {
|
|
944
|
+
let {
|
|
945
|
+
tag,
|
|
946
|
+
...other
|
|
947
|
+
} = _ref;
|
|
948
|
+
const {
|
|
949
|
+
isCloseButtonPresent,
|
|
950
|
+
getTitleProps
|
|
951
|
+
} = useModalContext();
|
|
952
|
+
return React__default.createElement(StyledDrawerModalHeader, _extends$2({}, getTitleProps(other), {
|
|
953
|
+
as: tag,
|
|
1257
954
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
1258
955
|
ref: ref
|
|
1259
956
|
}));
|
|
1260
957
|
});
|
|
1261
958
|
HeaderComponent.displayName = 'DrawerModal.Header';
|
|
1262
|
-
|
|
959
|
+
HeaderComponent.propTypes = {
|
|
960
|
+
tag: PropTypes.any
|
|
961
|
+
};
|
|
962
|
+
HeaderComponent.defaultProps = {
|
|
963
|
+
tag: 'div'
|
|
964
|
+
};
|
|
965
|
+
const Header = HeaderComponent;
|
|
1263
966
|
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
967
|
+
const BodyComponent = forwardRef((props, ref) => {
|
|
968
|
+
const {
|
|
969
|
+
getContentProps
|
|
970
|
+
} = useModalContext();
|
|
1267
971
|
return React__default.createElement(StyledDrawerModalBody, _extends$2({}, getContentProps(props), {
|
|
1268
972
|
ref: ref
|
|
1269
973
|
}), props.children);
|
|
1270
974
|
});
|
|
1271
975
|
BodyComponent.displayName = 'DrawerModal.Body';
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
976
|
+
const Body = BodyComponent;
|
|
977
|
+
|
|
978
|
+
const CloseComponent = forwardRef((props, ref) => {
|
|
979
|
+
const {
|
|
980
|
+
getCloseProps,
|
|
981
|
+
setIsCloseButtonPresent
|
|
982
|
+
} = useModalContext();
|
|
983
|
+
useEffect(() => {
|
|
1279
984
|
setIsCloseButtonPresent(true);
|
|
1280
|
-
return
|
|
1281
|
-
return setIsCloseButtonPresent(false);
|
|
1282
|
-
};
|
|
985
|
+
return () => setIsCloseButtonPresent(false);
|
|
1283
986
|
});
|
|
1284
|
-
|
|
1285
|
-
return React__default.createElement(StyledDrawerModalClose, _extends$2({}, getCloseProps(
|
|
987
|
+
const ariaLabel = useText(CloseComponent, props, 'aria-label', 'Close drawer');
|
|
988
|
+
return React__default.createElement(StyledDrawerModalClose, _extends$2({}, getCloseProps({
|
|
989
|
+
...props,
|
|
1286
990
|
'aria-label': ariaLabel
|
|
1287
|
-
})
|
|
991
|
+
}), {
|
|
1288
992
|
ref: ref
|
|
1289
993
|
}), React__default.createElement(SvgXStroke, null));
|
|
1290
994
|
});
|
|
1291
995
|
CloseComponent.displayName = 'DrawerModal.Close';
|
|
1292
|
-
|
|
996
|
+
const Close = CloseComponent;
|
|
1293
997
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
}, props));
|
|
1298
|
-
});
|
|
998
|
+
const FooterComponent = forwardRef((props, ref) => React__default.createElement(StyledDrawerModalFooter, _extends$2({
|
|
999
|
+
ref: ref
|
|
1000
|
+
}, props)));
|
|
1299
1001
|
FooterComponent.displayName = 'DrawerModal.Footer';
|
|
1300
|
-
|
|
1002
|
+
const Footer = FooterComponent;
|
|
1301
1003
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
}, props));
|
|
1306
|
-
});
|
|
1004
|
+
const FooterItemComponent = forwardRef((props, ref) => React__default.createElement(StyledDrawerModalFooterItem, _extends$2({
|
|
1005
|
+
ref: ref
|
|
1006
|
+
}, props)));
|
|
1307
1007
|
FooterItemComponent.displayName = 'DrawerModal.FooterItem';
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
isCloseButtonPresent = _useState2[0],
|
|
1327
|
-
setIsCloseButtonPresent = _useState2[1];
|
|
1008
|
+
const FooterItem = FooterItemComponent;
|
|
1009
|
+
|
|
1010
|
+
const DrawerModalComponent = forwardRef((_ref, ref) => {
|
|
1011
|
+
let {
|
|
1012
|
+
id,
|
|
1013
|
+
isOpen,
|
|
1014
|
+
onClose,
|
|
1015
|
+
backdropProps,
|
|
1016
|
+
appendToNode,
|
|
1017
|
+
focusOnMount,
|
|
1018
|
+
restoreFocus,
|
|
1019
|
+
...props
|
|
1020
|
+
} = _ref;
|
|
1021
|
+
const modalRef = useRef(null);
|
|
1022
|
+
const transitionRef = useRef(null);
|
|
1023
|
+
const theme = useContext(ThemeContext);
|
|
1024
|
+
const environment = useDocument(theme);
|
|
1025
|
+
const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
|
|
1328
1026
|
useFocusVisible({
|
|
1329
1027
|
scope: modalRef,
|
|
1330
1028
|
relativeDocument: modalRef.current
|
|
1331
1029
|
});
|
|
1332
|
-
|
|
1030
|
+
const {
|
|
1031
|
+
getTitleProps,
|
|
1032
|
+
getCloseProps,
|
|
1033
|
+
getContentProps,
|
|
1034
|
+
getBackdropProps,
|
|
1035
|
+
getModalProps
|
|
1036
|
+
} = useModal({
|
|
1333
1037
|
idPrefix: id,
|
|
1334
|
-
modalRef
|
|
1335
|
-
focusOnMount
|
|
1336
|
-
restoreFocus
|
|
1337
|
-
environment
|
|
1338
|
-
onClose
|
|
1339
|
-
})
|
|
1340
|
-
|
|
1341
|
-
getCloseProps = _useModal.getCloseProps,
|
|
1342
|
-
getContentProps = _useModal.getContentProps,
|
|
1343
|
-
getBackdropProps = _useModal.getBackdropProps,
|
|
1344
|
-
getModalProps = _useModal.getModalProps;
|
|
1345
|
-
useEffect(function () {
|
|
1038
|
+
modalRef,
|
|
1039
|
+
focusOnMount,
|
|
1040
|
+
restoreFocus,
|
|
1041
|
+
environment,
|
|
1042
|
+
onClose
|
|
1043
|
+
});
|
|
1044
|
+
useEffect(() => {
|
|
1346
1045
|
if (!environment) {
|
|
1347
1046
|
return undefined;
|
|
1348
1047
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1048
|
+
const htmlElement = environment.querySelector('html');
|
|
1049
|
+
let previousHtmlOverflow;
|
|
1351
1050
|
if (htmlElement && isOpen) {
|
|
1352
1051
|
previousHtmlOverflow = htmlElement.style.overflow;
|
|
1353
1052
|
htmlElement.style.overflow = 'hidden';
|
|
1354
1053
|
}
|
|
1355
|
-
return
|
|
1054
|
+
return () => {
|
|
1356
1055
|
if (htmlElement && isOpen) {
|
|
1357
1056
|
htmlElement.style.overflow = previousHtmlOverflow;
|
|
1358
1057
|
}
|
|
1359
1058
|
};
|
|
1360
1059
|
}, [environment, isOpen]);
|
|
1361
|
-
|
|
1060
|
+
const rootNode = useMemo(() => {
|
|
1362
1061
|
if (appendToNode) {
|
|
1363
1062
|
return appendToNode;
|
|
1364
1063
|
}
|
|
@@ -1367,15 +1066,13 @@ var DrawerModalComponent = forwardRef(function (_ref, ref) {
|
|
|
1367
1066
|
}
|
|
1368
1067
|
return undefined;
|
|
1369
1068
|
}, [appendToNode, environment]);
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
};
|
|
1378
|
-
}, [isCloseButtonPresent, getTitleProps, getContentProps, getCloseProps]);
|
|
1069
|
+
const value = useMemo(() => ({
|
|
1070
|
+
isCloseButtonPresent,
|
|
1071
|
+
getTitleProps,
|
|
1072
|
+
getContentProps,
|
|
1073
|
+
getCloseProps,
|
|
1074
|
+
setIsCloseButtonPresent
|
|
1075
|
+
}), [isCloseButtonPresent, getTitleProps, getContentProps, getCloseProps]);
|
|
1379
1076
|
if (!rootNode) {
|
|
1380
1077
|
return null;
|
|
1381
1078
|
}
|
|
@@ -1402,13 +1099,13 @@ DrawerModalComponent.propTypes = {
|
|
|
1402
1099
|
appendToNode: PropTypes.any,
|
|
1403
1100
|
isOpen: PropTypes.bool
|
|
1404
1101
|
};
|
|
1405
|
-
|
|
1102
|
+
const DrawerModal = DrawerModalComponent;
|
|
1406
1103
|
DrawerModal.Body = Body;
|
|
1407
1104
|
DrawerModal.Close = Close;
|
|
1408
1105
|
DrawerModal.Footer = Footer;
|
|
1409
1106
|
DrawerModal.FooterItem = FooterItem;
|
|
1410
1107
|
DrawerModal.Header = Header;
|
|
1411
1108
|
|
|
1412
|
-
|
|
1109
|
+
const PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
1413
1110
|
|
|
1414
1111
|
export { Body$2 as Body, Close$2 as Close, DrawerModal, Footer$2 as Footer, FooterItem$2 as FooterItem, Header$1 as Header, Modal, PLACEMENT, TooltipModal };
|