@zendeskgarden/react-modals 8.75.1 → 8.76.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/esm/elements/Body.js +42 -0
- package/dist/esm/elements/Close.js +53 -0
- package/dist/esm/elements/DrawerModal/Body.js +43 -0
- package/dist/esm/elements/DrawerModal/Close.js +54 -0
- package/dist/esm/elements/DrawerModal/DrawerModal.js +187 -0
- package/dist/esm/elements/DrawerModal/Footer.js +37 -0
- package/dist/esm/elements/DrawerModal/FooterItem.js +37 -0
- package/dist/esm/elements/DrawerModal/Header.js +69 -0
- package/dist/esm/elements/Footer.js +43 -0
- package/dist/esm/elements/FooterItem.js +36 -0
- package/dist/esm/elements/Header.js +70 -0
- package/dist/esm/elements/Modal.js +185 -0
- package/dist/esm/elements/TooltipModal/Body.js +43 -0
- package/dist/esm/elements/TooltipModal/Close.js +49 -0
- package/dist/esm/elements/TooltipModal/Footer.js +37 -0
- package/dist/esm/elements/TooltipModal/FooterItem.js +37 -0
- package/dist/esm/elements/TooltipModal/Title.js +68 -0
- package/dist/esm/elements/TooltipModal/TooltipModal.js +178 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/StyledBackdrop.js +34 -0
- package/dist/esm/styled/StyledBody.js +22 -0
- package/dist/esm/styled/StyledClose.js +35 -0
- package/dist/esm/styled/StyledDangerIcon.js +19 -0
- package/dist/esm/styled/StyledDrawerModal.js +36 -0
- package/dist/esm/styled/StyledDrawerModalBody.js +23 -0
- package/dist/esm/styled/StyledDrawerModalClose.js +28 -0
- package/dist/esm/styled/StyledDrawerModalFooter.js +22 -0
- package/dist/esm/styled/StyledDrawerModalFooterItem.js +23 -0
- package/dist/esm/styled/StyledDrawerModalHeader.js +24 -0
- package/dist/esm/styled/StyledFooter.js +22 -0
- package/dist/esm/styled/StyledFooterItem.js +22 -0
- package/dist/esm/styled/StyledHeader.js +23 -0
- package/dist/esm/styled/StyledModal.js +50 -0
- package/dist/esm/styled/StyledTooltipModal.js +34 -0
- package/dist/esm/styled/StyledTooltipModalBackdrop.js +22 -0
- package/dist/esm/styled/StyledTooltipModalBody.js +22 -0
- package/dist/esm/styled/StyledTooltipModalClose.js +23 -0
- package/dist/esm/styled/StyledTooltipModalFooter.js +22 -0
- package/dist/esm/styled/StyledTooltipModalFooterItem.js +23 -0
- package/dist/esm/styled/StyledTooltipModalTitle.js +28 -0
- package/dist/esm/styled/StyledTooltipWrapper.js +27 -0
- package/dist/esm/types/index.js +9 -0
- package/dist/esm/utils/gardenPlacements.js +62 -0
- package/dist/esm/utils/useModalContext.js +18 -0
- package/dist/esm/utils/useTooltipModalContext.js +18 -0
- package/dist/index.cjs.js +47 -63
- package/package.json +5 -5
- package/dist/index.esm.js +0 -1160
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'modals.tooltip_modal.title';
|
|
11
|
+
const sizeStyles = props => `
|
|
12
|
+
/* stylelint-disable-next-line property-no-unknown */
|
|
13
|
+
padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
|
|
14
|
+
line-height: ${getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md)};
|
|
15
|
+
font-size: ${props.theme.fontSizes.md};
|
|
16
|
+
`;
|
|
17
|
+
const StyledTooltipModalTitle = styled.div.attrs({
|
|
18
|
+
'data-garden-id': COMPONENT_ID,
|
|
19
|
+
'data-garden-version': '8.76.0'
|
|
20
|
+
}).withConfig({
|
|
21
|
+
displayName: "StyledTooltipModalTitle",
|
|
22
|
+
componentId: "sc-11xjgjs-0"
|
|
23
|
+
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
24
|
+
StyledTooltipModalTitle.defaultProps = {
|
|
25
|
+
theme: DEFAULT_THEME
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { StyledTooltipModalTitle };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { menuStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { getMenuPosition } from '../utils/gardenPlacements.js';
|
|
10
|
+
|
|
11
|
+
const StyledTooltipWrapper = styled.div.attrs(props => ({
|
|
12
|
+
className: props.isAnimated && 'is-animated'
|
|
13
|
+
})).withConfig({
|
|
14
|
+
displayName: "StyledTooltipWrapper",
|
|
15
|
+
componentId: "sc-1xk05kf-0"
|
|
16
|
+
})(["", ";"], props => menuStyles(getMenuPosition(props.placement), {
|
|
17
|
+
theme: props.theme,
|
|
18
|
+
hidden: false,
|
|
19
|
+
margin: '0',
|
|
20
|
+
zIndex: props.zIndex,
|
|
21
|
+
animationModifier: '.is-animated'
|
|
22
|
+
}));
|
|
23
|
+
StyledTooltipWrapper.defaultProps = {
|
|
24
|
+
theme: DEFAULT_THEME
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { StyledTooltipWrapper };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
const PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
8
|
+
|
|
9
|
+
export { PLACEMENT };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function getPopperPlacement(gardenPlacement) {
|
|
8
|
+
const gardenToPopperMapping = {
|
|
9
|
+
auto: 'auto',
|
|
10
|
+
top: 'top',
|
|
11
|
+
'top-start': 'top-start',
|
|
12
|
+
'top-end': 'top-end',
|
|
13
|
+
bottom: 'bottom',
|
|
14
|
+
'bottom-start': 'bottom-start',
|
|
15
|
+
'bottom-end': 'bottom-end',
|
|
16
|
+
end: 'right',
|
|
17
|
+
'end-top': 'right-start',
|
|
18
|
+
'end-bottom': 'right-end',
|
|
19
|
+
start: 'left',
|
|
20
|
+
'start-top': 'left-start',
|
|
21
|
+
'start-bottom': 'left-end'
|
|
22
|
+
};
|
|
23
|
+
return gardenToPopperMapping[gardenPlacement];
|
|
24
|
+
}
|
|
25
|
+
function getRtlPopperPlacement(gardenPlacement) {
|
|
26
|
+
const rtlPlacementMappings = {
|
|
27
|
+
left: 'right',
|
|
28
|
+
'left-start': 'right-start',
|
|
29
|
+
'left-end': 'right-end',
|
|
30
|
+
'top-start': 'top-end',
|
|
31
|
+
'top-end': 'top-start',
|
|
32
|
+
right: 'left',
|
|
33
|
+
'right-start': 'left-start',
|
|
34
|
+
'right-end': 'left-end',
|
|
35
|
+
'bottom-start': 'bottom-end',
|
|
36
|
+
'bottom-end': 'bottom-start'
|
|
37
|
+
};
|
|
38
|
+
const popperPlacement = getPopperPlacement(gardenPlacement);
|
|
39
|
+
return rtlPlacementMappings[popperPlacement] || popperPlacement;
|
|
40
|
+
}
|
|
41
|
+
function getArrowPosition(popperPlacement) {
|
|
42
|
+
const arrowPositionMappings = {
|
|
43
|
+
top: 'bottom',
|
|
44
|
+
'top-start': 'bottom-left',
|
|
45
|
+
'top-end': 'bottom-right',
|
|
46
|
+
right: 'left',
|
|
47
|
+
'right-start': 'left-top',
|
|
48
|
+
'right-end': 'left-bottom',
|
|
49
|
+
bottom: 'top',
|
|
50
|
+
'bottom-start': 'top-left',
|
|
51
|
+
'bottom-end': 'top-right',
|
|
52
|
+
left: 'right',
|
|
53
|
+
'left-start': 'right-top',
|
|
54
|
+
'left-end': 'right-bottom'
|
|
55
|
+
};
|
|
56
|
+
return arrowPositionMappings[popperPlacement] || 'top';
|
|
57
|
+
}
|
|
58
|
+
function getMenuPosition(popperPlacement) {
|
|
59
|
+
return popperPlacement ? popperPlacement.split('-')[0] : 'bottom';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { getArrowPosition, getMenuPosition, getPopperPlacement, getRtlPopperPlacement };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { createContext, useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const ModalsContext = createContext(undefined);
|
|
10
|
+
const useModalContext = () => {
|
|
11
|
+
const context = useContext(ModalsContext);
|
|
12
|
+
if (context === undefined) {
|
|
13
|
+
throw new Error('useModalContext must be used within a ModalsContext.Provider');
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { ModalsContext, useModalContext };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { createContext, useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const TooltipModalContext = createContext(undefined);
|
|
10
|
+
const useTooltipModalContext = () => {
|
|
11
|
+
const context = useContext(TooltipModalContext);
|
|
12
|
+
if (context === undefined) {
|
|
13
|
+
throw new Error('Element must be used within a TooltipModal component.');
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { TooltipModalContext, useTooltipModalContext };
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
8
7
|
'use strict';
|
|
9
8
|
|
|
10
9
|
var React = require('react');
|
|
@@ -56,21 +55,6 @@ var css__default = /*#__PURE__*/_interopDefault(css);
|
|
|
56
55
|
var getScrollbarSize__default = /*#__PURE__*/_interopDefault(getScrollbarSize);
|
|
57
56
|
var activeElement__default = /*#__PURE__*/_interopDefault(activeElement);
|
|
58
57
|
|
|
59
|
-
function _extends$2() {
|
|
60
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
61
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
62
|
-
var source = arguments[i];
|
|
63
|
-
for (var key in source) {
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
65
|
-
target[key] = source[key];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return target;
|
|
70
|
-
};
|
|
71
|
-
return _extends$2.apply(this, arguments);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
58
|
const COMPONENT_ID$j = 'modals.backdrop';
|
|
75
59
|
const animationName$1 = styled.keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
76
60
|
const animationStyles$1 = props => {
|
|
@@ -81,7 +65,7 @@ const animationStyles$1 = props => {
|
|
|
81
65
|
};
|
|
82
66
|
const StyledBackdrop = styled__default.default.div.attrs({
|
|
83
67
|
'data-garden-id': COMPONENT_ID$j,
|
|
84
|
-
'data-garden-version': '8.
|
|
68
|
+
'data-garden-version': '8.76.0'
|
|
85
69
|
}).withConfig({
|
|
86
70
|
displayName: "StyledBackdrop",
|
|
87
71
|
componentId: "sc-mzdjpo-0"
|
|
@@ -97,7 +81,7 @@ StyledBackdrop.propTypes = {
|
|
|
97
81
|
const COMPONENT_ID$i = 'modals.body';
|
|
98
82
|
const StyledBody = styled__default.default.div.attrs({
|
|
99
83
|
'data-garden-id': COMPONENT_ID$i,
|
|
100
|
-
'data-garden-version': '8.
|
|
84
|
+
'data-garden-version': '8.76.0'
|
|
101
85
|
}).withConfig({
|
|
102
86
|
displayName: "StyledBody",
|
|
103
87
|
componentId: "sc-14rzecg-0"
|
|
@@ -122,7 +106,7 @@ const BASE_MULTIPLIERS$1 = {
|
|
|
122
106
|
};
|
|
123
107
|
const StyledClose = styled__default.default.button.attrs({
|
|
124
108
|
'data-garden-id': COMPONENT_ID$h,
|
|
125
|
-
'data-garden-version': '8.
|
|
109
|
+
'data-garden-version': '8.76.0'
|
|
126
110
|
}).withConfig({
|
|
127
111
|
displayName: "StyledClose",
|
|
128
112
|
componentId: "sc-iseudj-0"
|
|
@@ -134,7 +118,7 @@ StyledClose.defaultProps = {
|
|
|
134
118
|
const COMPONENT_ID$g = 'modals.footer';
|
|
135
119
|
const StyledFooter = styled__default.default.div.attrs({
|
|
136
120
|
'data-garden-id': COMPONENT_ID$g,
|
|
137
|
-
'data-garden-version': '8.
|
|
121
|
+
'data-garden-version': '8.76.0'
|
|
138
122
|
}).withConfig({
|
|
139
123
|
displayName: "StyledFooter",
|
|
140
124
|
componentId: "sc-d8pfdu-0"
|
|
@@ -146,7 +130,7 @@ StyledFooter.defaultProps = {
|
|
|
146
130
|
const COMPONENT_ID$f = 'modals.footer_item';
|
|
147
131
|
const StyledFooterItem = styled__default.default.span.attrs({
|
|
148
132
|
'data-garden-id': COMPONENT_ID$f,
|
|
149
|
-
'data-garden-version': '8.
|
|
133
|
+
'data-garden-version': '8.76.0'
|
|
150
134
|
}).withConfig({
|
|
151
135
|
displayName: "StyledFooterItem",
|
|
152
136
|
componentId: "sc-1mb76hl-0"
|
|
@@ -158,7 +142,7 @@ StyledFooterItem.defaultProps = {
|
|
|
158
142
|
const COMPONENT_ID$e = 'modals.header';
|
|
159
143
|
const StyledHeader = styled__default.default.div.attrs({
|
|
160
144
|
'data-garden-id': COMPONENT_ID$e,
|
|
161
|
-
'data-garden-version': '8.
|
|
145
|
+
'data-garden-version': '8.76.0'
|
|
162
146
|
}).withConfig({
|
|
163
147
|
displayName: "StyledHeader",
|
|
164
148
|
componentId: "sc-1787r9v-0"
|
|
@@ -229,7 +213,7 @@ const sizeStyles$1 = props => {
|
|
|
229
213
|
};
|
|
230
214
|
const StyledModal = styled__default.default.div.attrs({
|
|
231
215
|
'data-garden-id': COMPONENT_ID$d,
|
|
232
|
-
'data-garden-version': '8.
|
|
216
|
+
'data-garden-version': '8.76.0'
|
|
233
217
|
}).withConfig({
|
|
234
218
|
displayName: "StyledModal",
|
|
235
219
|
componentId: "sc-1pe1axu-0"
|
|
@@ -245,7 +229,7 @@ StyledModal.defaultProps = {
|
|
|
245
229
|
const COMPONENT_ID$c = 'modals.tooltip_modal.backdrop';
|
|
246
230
|
const StyledTooltipModalBackdrop = styled__default.default.div.attrs({
|
|
247
231
|
'data-garden-id': COMPONENT_ID$c,
|
|
248
|
-
'data-garden-version': '8.
|
|
232
|
+
'data-garden-version': '8.76.0'
|
|
249
233
|
}).withConfig({
|
|
250
234
|
displayName: "StyledTooltipModalBackdrop",
|
|
251
235
|
componentId: "sc-1yaomgq-0"
|
|
@@ -328,7 +312,7 @@ StyledTooltipWrapper.defaultProps = {
|
|
|
328
312
|
const COMPONENT_ID$b = 'modals.tooltip_modal';
|
|
329
313
|
const StyledTooltipModal = styled__default.default.div.attrs(props => ({
|
|
330
314
|
'data-garden-id': COMPONENT_ID$b,
|
|
331
|
-
'data-garden-version': '8.
|
|
315
|
+
'data-garden-version': '8.76.0',
|
|
332
316
|
className: props.isAnimated && 'is-animated'
|
|
333
317
|
})).withConfig({
|
|
334
318
|
displayName: "StyledTooltipModal",
|
|
@@ -357,7 +341,7 @@ const sizeStyles = props => `
|
|
|
357
341
|
`;
|
|
358
342
|
const StyledTooltipModalTitle = styled__default.default.div.attrs({
|
|
359
343
|
'data-garden-id': COMPONENT_ID$a,
|
|
360
|
-
'data-garden-version': '8.
|
|
344
|
+
'data-garden-version': '8.76.0'
|
|
361
345
|
}).withConfig({
|
|
362
346
|
displayName: "StyledTooltipModalTitle",
|
|
363
347
|
componentId: "sc-11xjgjs-0"
|
|
@@ -369,7 +353,7 @@ StyledTooltipModalTitle.defaultProps = {
|
|
|
369
353
|
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
370
354
|
const StyledTooltipModalBody = styled__default.default.div.attrs({
|
|
371
355
|
'data-garden-id': COMPONENT_ID$9,
|
|
372
|
-
'data-garden-version': '8.
|
|
356
|
+
'data-garden-version': '8.76.0'
|
|
373
357
|
}).withConfig({
|
|
374
358
|
displayName: "StyledTooltipModalBody",
|
|
375
359
|
componentId: "sc-195dkzj-0"
|
|
@@ -381,7 +365,7 @@ StyledTooltipModalBody.defaultProps = {
|
|
|
381
365
|
const COMPONENT_ID$8 = 'modals.tooltip_modal.footer';
|
|
382
366
|
const StyledTooltipModalFooter = styled__default.default.div.attrs({
|
|
383
367
|
'data-garden-id': COMPONENT_ID$8,
|
|
384
|
-
'data-garden-version': '8.
|
|
368
|
+
'data-garden-version': '8.76.0'
|
|
385
369
|
}).withConfig({
|
|
386
370
|
displayName: "StyledTooltipModalFooter",
|
|
387
371
|
componentId: "sc-fm36a9-0"
|
|
@@ -393,7 +377,7 @@ StyledTooltipModalFooter.defaultProps = {
|
|
|
393
377
|
const COMPONENT_ID$7 = 'modals.tooltip_modal.footer_item';
|
|
394
378
|
const StyledTooltipModalFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
395
379
|
'data-garden-id': COMPONENT_ID$7,
|
|
396
|
-
'data-garden-version': '8.
|
|
380
|
+
'data-garden-version': '8.76.0'
|
|
397
381
|
}).withConfig({
|
|
398
382
|
displayName: "StyledTooltipModalFooterItem",
|
|
399
383
|
componentId: "sc-1nahj6p-0"
|
|
@@ -405,7 +389,7 @@ StyledTooltipModalFooterItem.defaultProps = {
|
|
|
405
389
|
const COMPONENT_ID$6 = 'modals.tooltip_modal.close';
|
|
406
390
|
const StyledTooltipModalClose = styled__default.default(StyledClose).attrs({
|
|
407
391
|
'data-garden-id': COMPONENT_ID$6,
|
|
408
|
-
'data-garden-version': '8.
|
|
392
|
+
'data-garden-version': '8.76.0'
|
|
409
393
|
}).withConfig({
|
|
410
394
|
displayName: "StyledTooltipModalClose",
|
|
411
395
|
componentId: "sc-1h2ke3q-0"
|
|
@@ -431,7 +415,7 @@ const boxShadow = props => {
|
|
|
431
415
|
};
|
|
432
416
|
const StyledDrawerModal = styled__default.default.div.attrs({
|
|
433
417
|
'data-garden-id': COMPONENT_ID$5,
|
|
434
|
-
'data-garden-version': '8.
|
|
418
|
+
'data-garden-version': '8.76.0'
|
|
435
419
|
}).withConfig({
|
|
436
420
|
displayName: "StyledDrawerModal",
|
|
437
421
|
componentId: "sc-i1sake-0"
|
|
@@ -448,7 +432,7 @@ const BASE_MULTIPLIERS = {
|
|
|
448
432
|
};
|
|
449
433
|
const StyledDrawerModalClose = styled__default.default(StyledClose).attrs({
|
|
450
434
|
'data-garden-id': COMPONENT_ID$4,
|
|
451
|
-
'data-garden-version': '8.
|
|
435
|
+
'data-garden-version': '8.76.0'
|
|
452
436
|
}).withConfig({
|
|
453
437
|
displayName: "StyledDrawerModalClose",
|
|
454
438
|
componentId: "sc-hrnaom-0"
|
|
@@ -460,7 +444,7 @@ StyledDrawerModalClose.defaultProps = {
|
|
|
460
444
|
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
461
445
|
const StyledDrawerModalHeader = styled__default.default(StyledHeader).attrs({
|
|
462
446
|
'data-garden-id': COMPONENT_ID$3,
|
|
463
|
-
'data-garden-version': '8.
|
|
447
|
+
'data-garden-version': '8.76.0'
|
|
464
448
|
}).withConfig({
|
|
465
449
|
displayName: "StyledDrawerModalHeader",
|
|
466
450
|
componentId: "sc-1u04rqw-0"
|
|
@@ -472,7 +456,7 @@ StyledDrawerModalHeader.defaultProps = {
|
|
|
472
456
|
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
473
457
|
const StyledDrawerModalBody = styled__default.default(StyledBody).attrs({
|
|
474
458
|
'data-garden-id': COMPONENT_ID$2,
|
|
475
|
-
'data-garden-version': '8.
|
|
459
|
+
'data-garden-version': '8.76.0'
|
|
476
460
|
}).withConfig({
|
|
477
461
|
displayName: "StyledDrawerModalBody",
|
|
478
462
|
componentId: "sc-yafe2y-0"
|
|
@@ -484,7 +468,7 @@ StyledDrawerModalBody.defaultProps = {
|
|
|
484
468
|
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
485
469
|
const StyledDrawerModalFooter = styled__default.default.div.attrs({
|
|
486
470
|
'data-garden-id': COMPONENT_ID$1,
|
|
487
|
-
'data-garden-version': '8.
|
|
471
|
+
'data-garden-version': '8.76.0'
|
|
488
472
|
}).withConfig({
|
|
489
473
|
displayName: "StyledDrawerModalFooter",
|
|
490
474
|
componentId: "sc-17if4ka-0"
|
|
@@ -496,7 +480,7 @@ StyledDrawerModalFooter.defaultProps = {
|
|
|
496
480
|
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
497
481
|
const StyledDrawerModalFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
498
482
|
'data-garden-id': COMPONENT_ID,
|
|
499
|
-
'data-garden-version': '8.
|
|
483
|
+
'data-garden-version': '8.76.0'
|
|
500
484
|
}).withConfig({
|
|
501
485
|
displayName: "StyledDrawerModalFooterItem",
|
|
502
486
|
componentId: "sc-1vbl885-0"
|
|
@@ -628,10 +612,10 @@ const Modal = React.forwardRef((_ref, ref) => {
|
|
|
628
612
|
}
|
|
629
613
|
return ReactDOM.createPortal( React__namespace.default.createElement(ModalsContext.Provider, {
|
|
630
614
|
value: value
|
|
631
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
615
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
632
616
|
isCentered: isCentered,
|
|
633
617
|
isAnimated: isAnimated
|
|
634
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal,
|
|
618
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledModal, Object.assign({
|
|
635
619
|
isCentered: isCentered,
|
|
636
620
|
isAnimated: isAnimated,
|
|
637
621
|
isLarge: isLarge
|
|
@@ -659,7 +643,7 @@ const Body$2 = React.forwardRef((props, ref) => {
|
|
|
659
643
|
const {
|
|
660
644
|
getContentProps
|
|
661
645
|
} = useModalContext();
|
|
662
|
-
return React__namespace.default.createElement(StyledBody,
|
|
646
|
+
return React__namespace.default.createElement(StyledBody, Object.assign({}, getContentProps(props), {
|
|
663
647
|
ref: ref
|
|
664
648
|
}));
|
|
665
649
|
});
|
|
@@ -692,7 +676,7 @@ const Close$2 = React.forwardRef((props, ref) => {
|
|
|
692
676
|
return () => setIsCloseButtonPresent(false);
|
|
693
677
|
});
|
|
694
678
|
const ariaLabel = reactTheming.useText(Close$2, props, 'aria-label', 'Close modal');
|
|
695
|
-
return React__namespace.default.createElement(StyledClose,
|
|
679
|
+
return React__namespace.default.createElement(StyledClose, Object.assign({}, getCloseProps({
|
|
696
680
|
...props,
|
|
697
681
|
'aria-label': ariaLabel
|
|
698
682
|
}), {
|
|
@@ -705,14 +689,14 @@ const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
|
705
689
|
const {
|
|
706
690
|
isLarge
|
|
707
691
|
} = useModalContext();
|
|
708
|
-
return React__namespace.default.createElement(StyledFooter,
|
|
692
|
+
return React__namespace.default.createElement(StyledFooter, Object.assign({
|
|
709
693
|
ref: ref,
|
|
710
694
|
isLarge: isLarge
|
|
711
695
|
}, props));
|
|
712
696
|
});
|
|
713
697
|
Footer$2.displayName = 'Footer';
|
|
714
698
|
|
|
715
|
-
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem,
|
|
699
|
+
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, Object.assign({
|
|
716
700
|
ref: ref
|
|
717
701
|
}, props)));
|
|
718
702
|
FooterItem$2.displayName = 'FooterItem';
|
|
@@ -739,7 +723,7 @@ const Header$1 = React.forwardRef((_ref, ref) => {
|
|
|
739
723
|
}
|
|
740
724
|
};
|
|
741
725
|
}, [hasHeader, setHasHeader]);
|
|
742
|
-
return React__namespace.default.createElement(StyledHeader,
|
|
726
|
+
return React__namespace.default.createElement(StyledHeader, Object.assign({}, getTitleProps(other), {
|
|
743
727
|
as: tag,
|
|
744
728
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
745
729
|
ref: ref
|
|
@@ -784,7 +768,7 @@ const TitleComponent = React.forwardRef((_ref, ref) => {
|
|
|
784
768
|
}
|
|
785
769
|
};
|
|
786
770
|
}, [hasTitle, setHasTitle]);
|
|
787
|
-
return React__namespace.default.createElement(StyledTooltipModalTitle,
|
|
771
|
+
return React__namespace.default.createElement(StyledTooltipModalTitle, Object.assign({}, getTitleProps(other), {
|
|
788
772
|
as: tag,
|
|
789
773
|
ref: ref
|
|
790
774
|
}), children);
|
|
@@ -802,7 +786,7 @@ const BodyComponent$1 = React.forwardRef((props, ref) => {
|
|
|
802
786
|
const {
|
|
803
787
|
getContentProps
|
|
804
788
|
} = useTooltipModalContext();
|
|
805
|
-
return React__namespace.default.createElement(StyledTooltipModalBody,
|
|
789
|
+
return React__namespace.default.createElement(StyledTooltipModalBody, Object.assign({}, getContentProps(props), {
|
|
806
790
|
ref: ref
|
|
807
791
|
}));
|
|
808
792
|
});
|
|
@@ -814,7 +798,7 @@ const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
|
814
798
|
getCloseProps
|
|
815
799
|
} = useTooltipModalContext();
|
|
816
800
|
const ariaLabel = reactTheming.useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
817
|
-
return React__namespace.default.createElement(StyledTooltipModalClose,
|
|
801
|
+
return React__namespace.default.createElement(StyledTooltipModalClose, Object.assign({}, getCloseProps({
|
|
818
802
|
...props,
|
|
819
803
|
'aria-label': ariaLabel
|
|
820
804
|
}), {
|
|
@@ -824,13 +808,13 @@ const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
|
824
808
|
CloseComponent$1.displayName = 'TooltipModal.Close';
|
|
825
809
|
const Close$1 = CloseComponent$1;
|
|
826
810
|
|
|
827
|
-
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter,
|
|
811
|
+
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooter, Object.assign({
|
|
828
812
|
ref: ref
|
|
829
813
|
}, props)));
|
|
830
814
|
FooterComponent$1.displayName = 'TooltipModal.Footer';
|
|
831
815
|
const Footer$1 = FooterComponent$1;
|
|
832
816
|
|
|
833
|
-
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem,
|
|
817
|
+
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipModalFooterItem, Object.assign({
|
|
834
818
|
ref: ref
|
|
835
819
|
}, props)));
|
|
836
820
|
FooterItemComponent$1.displayName = 'TooltipModal.FooterItem';
|
|
@@ -922,15 +906,15 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
922
906
|
}, transitionState => {
|
|
923
907
|
return React__namespace.default.createElement(TooltipModalContext.Provider, {
|
|
924
908
|
value: value
|
|
925
|
-
}, React__namespace.default.createElement(StyledTooltipModalBackdrop,
|
|
909
|
+
}, React__namespace.default.createElement(StyledTooltipModalBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
926
910
|
ref: transitionRef
|
|
927
|
-
}), React__namespace.default.createElement(StyledTooltipWrapper,
|
|
911
|
+
}), React__namespace.default.createElement(StyledTooltipWrapper, Object.assign({
|
|
928
912
|
ref: setPopperElement,
|
|
929
913
|
style: styles.popper,
|
|
930
914
|
placement: state ? state.placement : undefined,
|
|
931
915
|
zIndex: zIndex,
|
|
932
916
|
isAnimated: isAnimated
|
|
933
|
-
}, attributes.popper), React__namespace.default.createElement(StyledTooltipModal,
|
|
917
|
+
}, attributes.popper), React__namespace.default.createElement(StyledTooltipModal, Object.assign({
|
|
934
918
|
transitionState: transitionState,
|
|
935
919
|
placement: state ? state.placement : 'top',
|
|
936
920
|
hasArrow: hasArrow,
|
|
@@ -989,7 +973,7 @@ const HeaderComponent = React.forwardRef((_ref, ref) => {
|
|
|
989
973
|
}
|
|
990
974
|
};
|
|
991
975
|
}, [hasHeader, setHasHeader]);
|
|
992
|
-
return React__namespace.default.createElement(StyledDrawerModalHeader,
|
|
976
|
+
return React__namespace.default.createElement(StyledDrawerModalHeader, Object.assign({}, getTitleProps(other), {
|
|
993
977
|
as: tag,
|
|
994
978
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
995
979
|
ref: ref
|
|
@@ -1008,7 +992,7 @@ const BodyComponent = React.forwardRef((props, ref) => {
|
|
|
1008
992
|
const {
|
|
1009
993
|
getContentProps
|
|
1010
994
|
} = useModalContext();
|
|
1011
|
-
return React__namespace.default.createElement(StyledDrawerModalBody,
|
|
995
|
+
return React__namespace.default.createElement(StyledDrawerModalBody, Object.assign({}, getContentProps(props), {
|
|
1012
996
|
ref: ref
|
|
1013
997
|
}), props.children);
|
|
1014
998
|
});
|
|
@@ -1025,7 +1009,7 @@ const CloseComponent = React.forwardRef((props, ref) => {
|
|
|
1025
1009
|
return () => setIsCloseButtonPresent(false);
|
|
1026
1010
|
});
|
|
1027
1011
|
const ariaLabel = reactTheming.useText(CloseComponent, props, 'aria-label', 'Close drawer');
|
|
1028
|
-
return React__namespace.default.createElement(StyledDrawerModalClose,
|
|
1012
|
+
return React__namespace.default.createElement(StyledDrawerModalClose, Object.assign({}, getCloseProps({
|
|
1029
1013
|
...props,
|
|
1030
1014
|
'aria-label': ariaLabel
|
|
1031
1015
|
}), {
|
|
@@ -1035,13 +1019,13 @@ const CloseComponent = React.forwardRef((props, ref) => {
|
|
|
1035
1019
|
CloseComponent.displayName = 'DrawerModal.Close';
|
|
1036
1020
|
const Close = CloseComponent;
|
|
1037
1021
|
|
|
1038
|
-
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerModalFooter,
|
|
1022
|
+
const FooterComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerModalFooter, Object.assign({
|
|
1039
1023
|
ref: ref
|
|
1040
1024
|
}, props)));
|
|
1041
1025
|
FooterComponent.displayName = 'DrawerModal.Footer';
|
|
1042
1026
|
const Footer = FooterComponent;
|
|
1043
1027
|
|
|
1044
|
-
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerModalFooterItem,
|
|
1028
|
+
const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledDrawerModalFooterItem, Object.assign({
|
|
1045
1029
|
ref: ref
|
|
1046
1030
|
}, props)));
|
|
1047
1031
|
FooterItemComponent.displayName = 'DrawerModal.FooterItem';
|
|
@@ -1162,9 +1146,9 @@ const DrawerModalComponent = React.forwardRef((_ref, ref) => {
|
|
|
1162
1146
|
unmountOnExit: true,
|
|
1163
1147
|
classNames: "garden-drawer-transition",
|
|
1164
1148
|
nodeRef: transitionRef
|
|
1165
|
-
}, React__namespace.default.createElement(StyledBackdrop,
|
|
1149
|
+
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
1166
1150
|
isAnimated: true
|
|
1167
|
-
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledDrawerModal,
|
|
1151
|
+
}, getBackdropProps(backdropProps)), React__namespace.default.createElement(StyledDrawerModal, Object.assign({}, modalProps, ariaProps, props, {
|
|
1168
1152
|
ref: mergeRefs__default.default([ref, modalRef, transitionRef])
|
|
1169
1153
|
}))))), rootNode);
|
|
1170
1154
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-modals",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.76.0",
|
|
4
4
|
"description": "Components relating to modals in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/zendeskgarden/react-components/issues"
|
|
11
11
|
},
|
|
12
12
|
"main": "dist/index.cjs.js",
|
|
13
|
-
"module": "dist/index.
|
|
13
|
+
"module": "dist/esm/index.js",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"react-transition-group": "^4.4.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@zendeskgarden/react-theming": "^8.
|
|
35
|
+
"@zendeskgarden/react-theming": "^8.75.0",
|
|
36
36
|
"react": ">=16.8.0",
|
|
37
37
|
"react-dom": ">=16.8.0",
|
|
38
38
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/react-transition-group": "4.4.10",
|
|
42
|
-
"@zendeskgarden/react-theming": "^8.
|
|
42
|
+
"@zendeskgarden/react-theming": "^8.76.0",
|
|
43
43
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"zendeskgarden:src": "src/index.ts",
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "3e52650c39fd1085a2e97b40a43eed7bc1e21937"
|
|
56
56
|
}
|