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