@zendeskgarden/react-modals 9.0.0-next.9 → 9.1.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/README.md +11 -11
- package/dist/esm/elements/Body.js +8 -8
- package/dist/esm/elements/Close.js +8 -8
- package/dist/esm/elements/Drawer/Body.js +7 -7
- package/dist/esm/elements/Drawer/Close.js +7 -7
- package/dist/esm/elements/Drawer/Drawer.js +8 -8
- package/dist/esm/elements/Drawer/Footer.js +7 -7
- package/dist/esm/elements/Drawer/FooterItem.js +7 -7
- package/dist/esm/elements/Drawer/Header.js +7 -7
- package/dist/esm/elements/Footer.js +8 -8
- package/dist/esm/elements/FooterItem.js +8 -8
- package/dist/esm/elements/Header.js +9 -9
- package/dist/esm/elements/Modal.js +8 -8
- package/dist/esm/elements/{TooltipModal → TooltipDialog}/Body.js +11 -11
- package/dist/esm/elements/{TooltipModal → TooltipDialog}/Close.js +13 -12
- package/dist/esm/elements/{TooltipModal → TooltipDialog}/Footer.js +9 -9
- package/dist/esm/elements/{TooltipModal → TooltipDialog}/FooterItem.js +9 -9
- package/dist/esm/elements/{TooltipModal → TooltipDialog}/Title.js +11 -11
- package/dist/esm/elements/{TooltipModal/TooltipModal.js → TooltipDialog/TooltipDialog.js} +25 -24
- package/dist/esm/index.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
- package/dist/esm/styled/StyledBackdrop.js +18 -6
- package/dist/esm/styled/StyledBody.js +11 -6
- package/dist/esm/styled/StyledClose.js +6 -18
- package/dist/esm/styled/StyledDangerIcon.js +0 -4
- package/dist/esm/styled/StyledDrawer.js +23 -18
- package/dist/esm/styled/StyledDrawerBody.js +3 -6
- package/dist/esm/styled/StyledDrawerClose.js +2 -5
- package/dist/esm/styled/StyledDrawerFooter.js +11 -6
- package/dist/esm/styled/StyledDrawerFooterItem.js +2 -5
- package/dist/esm/styled/StyledDrawerHeader.js +2 -5
- package/dist/esm/styled/StyledFooter.js +6 -6
- package/dist/esm/styled/StyledFooterItem.js +2 -5
- package/dist/esm/styled/StyledHeader.js +19 -7
- package/dist/esm/styled/StyledModal.js +22 -17
- package/dist/esm/styled/StyledTooltipDialog.js +39 -0
- package/dist/esm/styled/{StyledTooltipModalBackdrop.js → StyledTooltipDialogBackdrop.js} +7 -10
- package/dist/esm/styled/StyledTooltipDialogBody.js +27 -0
- package/dist/esm/styled/StyledTooltipDialogClose.js +20 -0
- package/dist/esm/styled/{StyledTooltipModalFooter.js → StyledTooltipDialogFooter.js} +7 -10
- package/dist/esm/styled/StyledTooltipDialogFooterItem.js +20 -0
- package/dist/esm/styled/StyledTooltipDialogTitle.js +32 -0
- package/dist/esm/styled/StyledTooltipWrapper.js +1 -4
- package/dist/esm/utils/useTooltipDialogContext.js +18 -0
- package/dist/index.cjs.js +227 -212
- package/dist/typings/elements/Drawer/Drawer.d.ts +10 -1
- package/dist/typings/elements/Modal.d.ts +1 -1
- package/dist/typings/elements/{TooltipModal → TooltipDialog}/Title.d.ts +2 -2
- package/dist/typings/elements/{TooltipModal/TooltipModal.d.ts → TooltipDialog/TooltipDialog.d.ts} +4 -2
- package/dist/typings/index.d.ts +2 -2
- package/dist/typings/styled/StyledClose.d.ts +1 -5
- package/dist/typings/styled/StyledDrawerClose.d.ts +1 -1
- package/dist/typings/styled/StyledHeader.d.ts +2 -1
- package/dist/typings/styled/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts} +4 -3
- package/dist/typings/styled/{StyledTooltipModalBackdrop.d.ts → StyledTooltipDialogBackdrop.d.ts} +1 -1
- package/dist/typings/styled/{StyledTooltipModalBody.d.ts → StyledTooltipDialogBody.d.ts} +1 -1
- package/dist/typings/styled/{StyledTooltipModalClose.d.ts → StyledTooltipDialogClose.d.ts} +1 -1
- package/dist/typings/styled/{StyledTooltipModalFooter.d.ts → StyledTooltipDialogFooter.d.ts} +1 -1
- package/dist/typings/styled/{StyledTooltipModalFooterItem.d.ts → StyledTooltipDialogFooterItem.d.ts} +1 -1
- package/dist/typings/styled/{StyledTooltipModalTitle.d.ts → StyledTooltipDialogTitle.d.ts} +1 -1
- package/dist/typings/styled/StyledTooltipWrapper.d.ts +2 -2
- package/dist/typings/styled/index.d.ts +7 -7
- package/dist/typings/types/index.d.ts +4 -2
- package/dist/typings/utils/useModalContext.d.ts +0 -1
- package/dist/typings/utils/{useTooltipModalContext.d.ts → useTooltipDialogContext.d.ts} +2 -3
- package/package.json +9 -8
- package/dist/esm/styled/StyledTooltipModal.js +0 -33
- package/dist/esm/styled/StyledTooltipModalBody.js +0 -22
- package/dist/esm/styled/StyledTooltipModalClose.js +0 -23
- package/dist/esm/styled/StyledTooltipModalFooterItem.js +0 -23
- package/dist/esm/styled/StyledTooltipModalTitle.js +0 -28
- package/dist/esm/utils/useTooltipModalContext.js +0 -18
- /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Body.d.ts +0 -0
- /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Close.d.ts +0 -0
- /package/dist/typings/elements/{TooltipModal → TooltipDialog}/Footer.d.ts +0 -0
- /package/dist/typings/elements/{TooltipModal → TooltipDialog}/FooterItem.d.ts +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -18,6 +18,7 @@ var ownerDocument = require('dom-helpers/ownerDocument');
|
|
|
18
18
|
var ownerWindow = require('dom-helpers/ownerWindow');
|
|
19
19
|
var css = require('dom-helpers/css');
|
|
20
20
|
var getScrollbarSize = require('dom-helpers/scrollbarSize');
|
|
21
|
+
var reactButtons = require('@zendeskgarden/react-buttons');
|
|
21
22
|
var reactTransitionGroup = require('react-transition-group');
|
|
22
23
|
var reactDom = require('@floating-ui/react-dom');
|
|
23
24
|
var activeElement = require('dom-helpers/activeElement');
|
|
@@ -63,14 +64,26 @@ const animationStyles$1 = props => {
|
|
|
63
64
|
};
|
|
64
65
|
const StyledBackdrop = styled__default.default.div.attrs({
|
|
65
66
|
'data-garden-id': COMPONENT_ID$j,
|
|
66
|
-
'data-garden-version': '9.
|
|
67
|
+
'data-garden-version': '9.1.0'
|
|
67
68
|
}).withConfig({
|
|
68
69
|
displayName: "StyledBackdrop",
|
|
69
70
|
componentId: "sc-mzdjpo-0"
|
|
70
|
-
})(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.isCentered && 'center', props => props.isCentered && 'center',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
71
|
+
})(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.isCentered && 'center', props => props.isCentered && 'center', _ref => {
|
|
72
|
+
let {
|
|
73
|
+
theme
|
|
74
|
+
} = _ref;
|
|
75
|
+
return reactTheming.getColor({
|
|
76
|
+
theme,
|
|
77
|
+
hue: 'neutralHue',
|
|
78
|
+
transparency: theme.opacity[1000],
|
|
79
|
+
light: {
|
|
80
|
+
shade: 900
|
|
81
|
+
},
|
|
82
|
+
dark: {
|
|
83
|
+
shade: 1200
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
74
87
|
StyledBackdrop.propTypes = {
|
|
75
88
|
isCentered: PropTypes__default.default.bool,
|
|
76
89
|
isAnimated: PropTypes__default.default.bool
|
|
@@ -79,80 +92,81 @@ StyledBackdrop.propTypes = {
|
|
|
79
92
|
const COMPONENT_ID$i = 'modals.body';
|
|
80
93
|
const StyledBody = styled__default.default.div.attrs({
|
|
81
94
|
'data-garden-id': COMPONENT_ID$i,
|
|
82
|
-
'data-garden-version': '9.
|
|
95
|
+
'data-garden-version': '9.1.0'
|
|
83
96
|
}).withConfig({
|
|
84
97
|
displayName: "StyledBody",
|
|
85
98
|
componentId: "sc-14rzecg-0"
|
|
86
|
-
})(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
99
|
+
})(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
|
|
100
|
+
let {
|
|
101
|
+
theme
|
|
102
|
+
} = _ref;
|
|
103
|
+
return reactTheming.getColor({
|
|
104
|
+
theme,
|
|
105
|
+
variable: 'foreground.default'
|
|
106
|
+
});
|
|
107
|
+
}, props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
90
108
|
|
|
91
109
|
const COMPONENT_ID$h = 'modals.close';
|
|
92
|
-
const colorStyles = props => {
|
|
93
|
-
const backgroundColor = 'primaryHue';
|
|
94
|
-
const foregroundColor = 'neutralHue';
|
|
95
|
-
return styled.css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], reactTheming.getColorV8(foregroundColor, 600, props.theme), reactTheming.getColorV8(backgroundColor, 600, props.theme, 0.08), reactTheming.getColorV8(foregroundColor, 700, props.theme), reactTheming.focusStyles({
|
|
96
|
-
theme: props.theme,
|
|
97
|
-
color: {
|
|
98
|
-
hue: backgroundColor
|
|
99
|
-
}
|
|
100
|
-
}), reactTheming.getColorV8(backgroundColor, 600, props.theme, 0.2), reactTheming.getColorV8(foregroundColor, 800, props.theme));
|
|
101
|
-
};
|
|
102
110
|
const BASE_MULTIPLIERS$1 = {
|
|
103
111
|
top: 2.5,
|
|
104
112
|
side: 6.5,
|
|
105
113
|
size: 10
|
|
106
114
|
};
|
|
107
|
-
const StyledClose = styled__default.default.
|
|
115
|
+
const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
108
116
|
'data-garden-id': COMPONENT_ID$h,
|
|
109
|
-
'data-garden-version': '9.
|
|
117
|
+
'data-garden-version': '9.1.0'
|
|
110
118
|
}).withConfig({
|
|
111
119
|
displayName: "StyledClose",
|
|
112
120
|
componentId: "sc-iseudj-0"
|
|
113
|
-
})(["
|
|
114
|
-
StyledClose.defaultProps = {
|
|
115
|
-
theme: reactTheming.DEFAULT_THEME
|
|
116
|
-
};
|
|
121
|
+
})(["position:absolute;top:", "px;", ":", ";", ";"], props => props.theme.space.base * BASE_MULTIPLIERS$1.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS$1.side}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
117
122
|
|
|
118
123
|
const COMPONENT_ID$g = 'modals.footer';
|
|
119
124
|
const StyledFooter = styled__default.default.div.attrs({
|
|
120
125
|
'data-garden-id': COMPONENT_ID$g,
|
|
121
|
-
'data-garden-version': '9.
|
|
126
|
+
'data-garden-version': '9.1.0'
|
|
122
127
|
}).withConfig({
|
|
123
128
|
displayName: "StyledFooter",
|
|
124
129
|
componentId: "sc-d8pfdu-0"
|
|
125
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${reactTheming.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
130
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:", ";padding:", ";", ";"], props => props.isLarge && `${props.theme.borders.sm} ${reactTheming.getColor({
|
|
131
|
+
theme: props.theme,
|
|
132
|
+
variable: 'border.default'
|
|
133
|
+
})}`, 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));
|
|
129
134
|
|
|
130
135
|
const COMPONENT_ID$f = 'modals.footer_item';
|
|
131
136
|
const StyledFooterItem = styled__default.default.span.attrs({
|
|
132
137
|
'data-garden-id': COMPONENT_ID$f,
|
|
133
|
-
'data-garden-version': '9.
|
|
138
|
+
'data-garden-version': '9.1.0'
|
|
134
139
|
}).withConfig({
|
|
135
140
|
displayName: "StyledFooterItem",
|
|
136
141
|
componentId: "sc-1mb76hl-0"
|
|
137
142
|
})(["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));
|
|
138
|
-
StyledFooterItem.defaultProps = {
|
|
139
|
-
theme: reactTheming.DEFAULT_THEME
|
|
140
|
-
};
|
|
141
143
|
|
|
142
144
|
const COMPONENT_ID$e = 'modals.header';
|
|
145
|
+
const colorStyles$2 = _ref => {
|
|
146
|
+
let {
|
|
147
|
+
isDanger,
|
|
148
|
+
theme
|
|
149
|
+
} = _ref;
|
|
150
|
+
const bottomBorderColor = reactTheming.getColor({
|
|
151
|
+
theme,
|
|
152
|
+
variable: 'border.subtle'
|
|
153
|
+
});
|
|
154
|
+
const color = reactTheming.getColor({
|
|
155
|
+
theme,
|
|
156
|
+
variable: isDanger ? 'foreground.danger' : 'foreground.default'
|
|
157
|
+
});
|
|
158
|
+
return styled.css(["border-bottom-color:", ";color:", ";"], bottomBorderColor, color);
|
|
159
|
+
};
|
|
143
160
|
const StyledHeader = styled__default.default.div.attrs({
|
|
144
161
|
'data-garden-id': COMPONENT_ID$e,
|
|
145
|
-
'data-garden-version': '9.
|
|
162
|
+
'data-garden-version': '9.1.0'
|
|
146
163
|
}).withConfig({
|
|
147
164
|
displayName: "StyledHeader",
|
|
148
165
|
componentId: "sc-1787r9v-0"
|
|
149
|
-
})(["display:block;position:", ";margin:0;border-bottom:", "
|
|
150
|
-
StyledHeader.defaultProps = {
|
|
151
|
-
theme: reactTheming.DEFAULT_THEME
|
|
152
|
-
};
|
|
166
|
+
})(["display:block;position:", ";margin:0;border-bottom:", ";padding:", ";", " line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.isDanger && 'relative', props => props.theme.borders.sm, props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS$1.size + BASE_MULTIPLIERS$1.side + 2)}px;`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
153
167
|
|
|
154
168
|
var _g, _circle;
|
|
155
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
169
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
156
170
|
var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
157
171
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
158
172
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -183,9 +197,6 @@ const StyledDangerIcon = styled__default.default(SvgAlertErrorStroke).withConfig
|
|
|
183
197
|
displayName: "StyledDangerIcon",
|
|
184
198
|
componentId: "sc-1kwbb39-0"
|
|
185
199
|
})(["position:absolute;top:", "px;", ":", ";"], props => props.theme.space.base * 5.5, props => props.theme.rtl ? 'right' : 'left', props => `${props.theme.space.base * 4}px`);
|
|
186
|
-
StyledDangerIcon.defaultProps = {
|
|
187
|
-
theme: reactTheming.DEFAULT_THEME
|
|
188
|
-
};
|
|
189
200
|
|
|
190
201
|
const COMPONENT_ID$d = 'modals.modal';
|
|
191
202
|
const animationName = styled.keyframes(["0%{transform:scale(0);opacity:0;}50%{transform:scale(1.05);}100%{opacity:1;}"]);
|
|
@@ -195,48 +206,50 @@ const animationStyles = props => {
|
|
|
195
206
|
}
|
|
196
207
|
return '';
|
|
197
208
|
};
|
|
198
|
-
const
|
|
199
|
-
|
|
209
|
+
const colorStyles$1 = _ref => {
|
|
210
|
+
let {
|
|
200
211
|
theme
|
|
201
|
-
} =
|
|
202
|
-
const {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
212
|
+
} = _ref;
|
|
213
|
+
const offsetY = `${theme.space.base * 5}px`;
|
|
214
|
+
const blurRadius = `${theme.space.base * 7}px`;
|
|
215
|
+
const shadowColor = reactTheming.getColor({
|
|
216
|
+
variable: 'shadow.large',
|
|
217
|
+
theme
|
|
218
|
+
});
|
|
219
|
+
const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
|
|
220
|
+
const borderColor = reactTheming.getColor({
|
|
221
|
+
theme,
|
|
222
|
+
variable: 'border.default'
|
|
223
|
+
});
|
|
224
|
+
const backgroundColor = reactTheming.getColor({
|
|
225
|
+
theme,
|
|
226
|
+
variable: 'background.raised'
|
|
227
|
+
});
|
|
228
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
|
|
210
229
|
};
|
|
211
|
-
const sizeStyles$
|
|
230
|
+
const sizeStyles$2 = props => {
|
|
212
231
|
return styled.css(["", "{width:", ";}"], reactTheming.mediaQuery('up', props.isLarge ? 'md' : 'sm', props.theme), props.isLarge ? props.theme.breakpoints.md : props.theme.breakpoints.sm);
|
|
213
232
|
};
|
|
214
233
|
const StyledModal = styled__default.default.div.attrs({
|
|
215
234
|
'data-garden-id': COMPONENT_ID$d,
|
|
216
|
-
'data-garden-version': '9.
|
|
235
|
+
'data-garden-version': '9.1.0'
|
|
217
236
|
}).withConfig({
|
|
218
237
|
displayName: "StyledModal",
|
|
219
238
|
componentId: "sc-1pe1axu-0"
|
|
220
|
-
})(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border
|
|
239
|
+
})(["display:flex;position:fixed;flex-direction:column;animation-delay:0.01s;margin:", ";border:", ";border-radius:", ";min-height:60px;max-height:calc(100vh - ", "px);overflow:auto;direction:", ";", ";", ";", ";&:focus{outline:none;}@media (max-height:399px){top:", "px;bottom:auto;margin-bottom:", "px;max-height:none;}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){right:", ";bottom:", ";transform:", ";}", ";"], props => props.isCentered ? '0' : `${props.theme.space.base * 12}px`, props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => props.theme.space.base * 24, props => props.theme.rtl && 'rtl', animationStyles, sizeStyles$2, colorStyles$1, props => props.theme.space.base * 6, props => props.theme.space.base * 6, props => props.isCentered && '50%', props => props.isCentered && '50%', props => props.isCentered && 'translate(50%, 50%)', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
|
|
221
240
|
StyledModal.propTypes = {
|
|
222
241
|
isLarge: PropTypes__default.default.bool,
|
|
223
242
|
isAnimated: PropTypes__default.default.bool
|
|
224
243
|
};
|
|
225
|
-
StyledModal.defaultProps = {
|
|
226
|
-
theme: reactTheming.DEFAULT_THEME
|
|
227
|
-
};
|
|
228
244
|
|
|
229
|
-
const COMPONENT_ID$c = 'modals.
|
|
230
|
-
const
|
|
245
|
+
const COMPONENT_ID$c = 'modals.tooltip_dialog.backdrop';
|
|
246
|
+
const StyledTooltipDialogBackdrop = styled__default.default.div.attrs({
|
|
231
247
|
'data-garden-id': COMPONENT_ID$c,
|
|
232
|
-
'data-garden-version': '9.
|
|
248
|
+
'data-garden-version': '9.1.0'
|
|
233
249
|
}).withConfig({
|
|
234
|
-
displayName: "
|
|
235
|
-
componentId: "sc-
|
|
250
|
+
displayName: "StyledTooltipDialogBackdrop",
|
|
251
|
+
componentId: "sc-zrk625-0"
|
|
236
252
|
})(["position:fixed;inset: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));
|
|
237
|
-
StyledTooltipModalBackdrop.defaultProps = {
|
|
238
|
-
theme: reactTheming.DEFAULT_THEME
|
|
239
|
-
};
|
|
240
253
|
|
|
241
254
|
const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
|
|
242
255
|
className: props.isAnimated && 'is-animated'
|
|
@@ -249,19 +262,33 @@ const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
|
|
|
249
262
|
zIndex: props.zIndex,
|
|
250
263
|
animationModifier: '.is-animated'
|
|
251
264
|
}));
|
|
252
|
-
StyledTooltipWrapper.defaultProps = {
|
|
253
|
-
theme: reactTheming.DEFAULT_THEME
|
|
254
|
-
};
|
|
255
265
|
|
|
256
|
-
const COMPONENT_ID$b = 'modals.
|
|
257
|
-
const
|
|
266
|
+
const COMPONENT_ID$b = 'modals.tooltip_dialog.close';
|
|
267
|
+
const StyledTooltipDialogClose = styled__default.default(StyledClose).attrs({
|
|
258
268
|
'data-garden-id': COMPONENT_ID$b,
|
|
259
|
-
'data-garden-version': '9.
|
|
269
|
+
'data-garden-version': '9.1.0'
|
|
270
|
+
}).withConfig({
|
|
271
|
+
displayName: "StyledTooltipDialogClose",
|
|
272
|
+
componentId: "sc-18xlgfi-0"
|
|
273
|
+
})(["top:", "px;", ":", ";", ";"], props => props.theme.space.base * 3.5, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * 3}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
274
|
+
|
|
275
|
+
const COMPONENT_ID$a = 'modals.tooltip_dialog';
|
|
276
|
+
const sizeStyles$1 = props => `
|
|
277
|
+
padding: ${props.theme.space.base * 5}px;
|
|
278
|
+
width: 400px;
|
|
279
|
+
|
|
280
|
+
&:has(${StyledTooltipDialogClose}) > :first-child {
|
|
281
|
+
padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
|
|
282
|
+
}
|
|
283
|
+
`;
|
|
284
|
+
const StyledTooltipDialog = styled__default.default.div.attrs(props => ({
|
|
285
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
286
|
+
'data-garden-version': '9.1.0',
|
|
260
287
|
className: props.isAnimated && 'is-animated'
|
|
261
288
|
})).withConfig({
|
|
262
|
-
displayName: "
|
|
263
|
-
componentId: "sc-
|
|
264
|
-
})(["
|
|
289
|
+
displayName: "StyledTooltipDialog",
|
|
290
|
+
componentId: "sc-iv3db-0"
|
|
291
|
+
})(["", ";", " ", ";"], props => {
|
|
265
292
|
const computedArrowStyles = reactTheming.arrowStyles(reactTheming.getArrowPosition(props.theme, props.placement), {
|
|
266
293
|
size: `${props.theme.space.base * 2}px`,
|
|
267
294
|
inset: '1px',
|
|
@@ -271,102 +298,95 @@ const StyledTooltipModal = styled__default.default.div.attrs(props => ({
|
|
|
271
298
|
return props.hasArrow && props.transitionState === 'entered' && computedArrowStyles;
|
|
272
299
|
}
|
|
273
300
|
return props.hasArrow && computedArrowStyles;
|
|
274
|
-
}, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
275
|
-
StyledTooltipModal.defaultProps = {
|
|
276
|
-
theme: reactTheming.DEFAULT_THEME
|
|
277
|
-
};
|
|
301
|
+
}, sizeStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
278
302
|
|
|
279
|
-
const COMPONENT_ID$
|
|
303
|
+
const COMPONENT_ID$9 = 'modals.tooltip_dialog.title';
|
|
280
304
|
const sizeStyles = props => `
|
|
281
305
|
/* stylelint-disable-next-line property-no-unknown */
|
|
282
|
-
padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
|
|
283
306
|
line-height: ${reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md)};
|
|
284
307
|
font-size: ${props.theme.fontSizes.md};
|
|
285
308
|
`;
|
|
286
|
-
const
|
|
287
|
-
'data-garden-id': COMPONENT_ID$a,
|
|
288
|
-
'data-garden-version': '9.0.0-next.9'
|
|
289
|
-
}).withConfig({
|
|
290
|
-
displayName: "StyledTooltipModalTitle",
|
|
291
|
-
componentId: "sc-11xjgjs-0"
|
|
292
|
-
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], props => reactTheming.getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
293
|
-
StyledTooltipModalTitle.defaultProps = {
|
|
294
|
-
theme: reactTheming.DEFAULT_THEME
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
const COMPONENT_ID$9 = 'modals.tooltip_modal.body';
|
|
298
|
-
const StyledTooltipModalBody = styled__default.default.div.attrs({
|
|
309
|
+
const StyledTooltipDialogTitle = styled__default.default.div.attrs({
|
|
299
310
|
'data-garden-id': COMPONENT_ID$9,
|
|
300
|
-
'data-garden-version': '9.
|
|
311
|
+
'data-garden-version': '9.1.0'
|
|
301
312
|
}).withConfig({
|
|
302
|
-
displayName: "
|
|
303
|
-
componentId: "sc-
|
|
304
|
-
})(["
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
313
|
+
displayName: "StyledTooltipDialogTitle",
|
|
314
|
+
componentId: "sc-1rceixg-0"
|
|
315
|
+
})(["margin:0;color:", ";font-weight:", ";", ";", ";"], _ref => {
|
|
316
|
+
let {
|
|
317
|
+
theme
|
|
318
|
+
} = _ref;
|
|
319
|
+
return reactTheming.getColor({
|
|
320
|
+
variable: 'foreground.default',
|
|
321
|
+
theme
|
|
322
|
+
});
|
|
323
|
+
}, props => props.theme.fontWeights.semibold, props => sizeStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
308
324
|
|
|
309
|
-
const COMPONENT_ID$8 = 'modals.
|
|
310
|
-
const
|
|
325
|
+
const COMPONENT_ID$8 = 'modals.tooltip_dialog.body';
|
|
326
|
+
const StyledTooltipDialogBody = styled__default.default.div.attrs({
|
|
311
327
|
'data-garden-id': COMPONENT_ID$8,
|
|
312
|
-
'data-garden-version': '9.
|
|
328
|
+
'data-garden-version': '9.1.0'
|
|
313
329
|
}).withConfig({
|
|
314
|
-
displayName: "
|
|
315
|
-
componentId: "sc-
|
|
316
|
-
})(["display:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
};
|
|
330
|
+
displayName: "StyledTooltipDialogBody",
|
|
331
|
+
componentId: "sc-132lcoq-0"
|
|
332
|
+
})(["display:block;margin:0;padding-top:", "px;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
|
|
333
|
+
let {
|
|
334
|
+
theme
|
|
335
|
+
} = _ref;
|
|
336
|
+
return reactTheming.getColor({
|
|
337
|
+
variable: 'foreground.default',
|
|
338
|
+
theme
|
|
339
|
+
});
|
|
340
|
+
}, props => props.theme.fontSizes.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
320
341
|
|
|
321
|
-
const COMPONENT_ID$7 = 'modals.
|
|
322
|
-
const
|
|
342
|
+
const COMPONENT_ID$7 = 'modals.tooltip_dialog.footer';
|
|
343
|
+
const StyledTooltipDialogFooter = styled__default.default.div.attrs({
|
|
323
344
|
'data-garden-id': COMPONENT_ID$7,
|
|
324
|
-
'data-garden-version': '9.
|
|
345
|
+
'data-garden-version': '9.1.0'
|
|
325
346
|
}).withConfig({
|
|
326
|
-
displayName: "
|
|
327
|
-
componentId: "sc-
|
|
328
|
-
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
329
|
-
StyledTooltipModalFooterItem.defaultProps = {
|
|
330
|
-
theme: reactTheming.DEFAULT_THEME
|
|
331
|
-
};
|
|
347
|
+
displayName: "StyledTooltipDialogFooter",
|
|
348
|
+
componentId: "sc-kjomsm-0"
|
|
349
|
+
})(["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$7, props));
|
|
332
350
|
|
|
333
|
-
const COMPONENT_ID$6 = 'modals.
|
|
334
|
-
const
|
|
351
|
+
const COMPONENT_ID$6 = 'modals.tooltip_dialog.footer_item';
|
|
352
|
+
const StyledTooltipDialogFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
335
353
|
'data-garden-id': COMPONENT_ID$6,
|
|
336
|
-
'data-garden-version': '9.
|
|
354
|
+
'data-garden-version': '9.1.0'
|
|
337
355
|
}).withConfig({
|
|
338
|
-
displayName: "
|
|
339
|
-
componentId: "sc-
|
|
340
|
-
})(["
|
|
341
|
-
StyledTooltipModalClose.defaultProps = {
|
|
342
|
-
theme: reactTheming.DEFAULT_THEME
|
|
343
|
-
};
|
|
356
|
+
displayName: "StyledTooltipDialogFooterItem",
|
|
357
|
+
componentId: "sc-u2rmo8-0"
|
|
358
|
+
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
344
359
|
|
|
345
360
|
const COMPONENT_ID$5 = 'modals.drawer_modal';
|
|
346
361
|
const DRAWER_WIDTH = 380;
|
|
347
|
-
const
|
|
348
|
-
|
|
362
|
+
const colorStyles = _ref => {
|
|
363
|
+
let {
|
|
349
364
|
theme
|
|
350
|
-
} =
|
|
351
|
-
const {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
365
|
+
} = _ref;
|
|
366
|
+
const offsetY = `${theme.space.base * 5}px`;
|
|
367
|
+
const blurRadius = `${theme.space.base * 7}px`;
|
|
368
|
+
const shadowColor = reactTheming.getColor({
|
|
369
|
+
variable: 'shadow.large',
|
|
370
|
+
theme
|
|
371
|
+
});
|
|
372
|
+
const shadow = theme.shadows.lg(offsetY, blurRadius, shadowColor);
|
|
373
|
+
const borderColor = reactTheming.getColor({
|
|
374
|
+
theme,
|
|
375
|
+
variable: 'border.default'
|
|
376
|
+
});
|
|
377
|
+
const backgroundColor = reactTheming.getColor({
|
|
378
|
+
theme,
|
|
379
|
+
variable: 'background.raised'
|
|
380
|
+
});
|
|
381
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";"], borderColor, shadow, backgroundColor);
|
|
359
382
|
};
|
|
360
383
|
const StyledDrawer = styled__default.default.div.attrs({
|
|
361
384
|
'data-garden-id': COMPONENT_ID$5,
|
|
362
|
-
'data-garden-version': '9.
|
|
385
|
+
'data-garden-version': '9.1.0'
|
|
363
386
|
}).withConfig({
|
|
364
387
|
displayName: "StyledDrawer",
|
|
365
388
|
componentId: "sc-zp66t3-0"
|
|
366
|
-
})(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;
|
|
367
|
-
StyledDrawer.defaultProps = {
|
|
368
|
-
theme: reactTheming.DEFAULT_THEME
|
|
369
|
-
};
|
|
389
|
+
})(["display:flex;position:fixed;top:0;", ":0;flex-direction:column;z-index:500;", ":", ";width:", "px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-drawer-transition-enter{transform:translateX(", "px);}&.garden-drawer-transition-enter-active{transform:translateX(0);transition:transform 0.25s ease-in-out;}&.garden-drawer-transition-exit-active{transform:translateX(", "px);transition:transform 0.25s ease-in-out;}&:focus{outline:none;}", " ", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.rtl ? 'border-right' : 'border-left', props => props.theme.borders.sm, DRAWER_WIDTH, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, props => props.theme.rtl ? -DRAWER_WIDTH : DRAWER_WIDTH, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
370
390
|
|
|
371
391
|
const COMPONENT_ID$4 = 'modals.drawer_modal.close';
|
|
372
392
|
const BASE_MULTIPLIERS = {
|
|
@@ -376,62 +396,55 @@ const BASE_MULTIPLIERS = {
|
|
|
376
396
|
};
|
|
377
397
|
const StyledDrawerClose = styled__default.default(StyledClose).attrs({
|
|
378
398
|
'data-garden-id': COMPONENT_ID$4,
|
|
379
|
-
'data-garden-version': '9.
|
|
399
|
+
'data-garden-version': '9.1.0'
|
|
380
400
|
}).withConfig({
|
|
381
401
|
displayName: "StyledDrawerClose",
|
|
382
402
|
componentId: "sc-1a0xt3x-0"
|
|
383
403
|
})(["", ":", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
384
|
-
StyledDrawerClose.defaultProps = {
|
|
385
|
-
theme: reactTheming.DEFAULT_THEME
|
|
386
|
-
};
|
|
387
404
|
|
|
388
405
|
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
389
406
|
const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
|
|
390
407
|
'data-garden-id': COMPONENT_ID$3,
|
|
391
|
-
'data-garden-version': '9.
|
|
408
|
+
'data-garden-version': '9.1.0'
|
|
392
409
|
}).withConfig({
|
|
393
410
|
displayName: "StyledDrawerHeader",
|
|
394
411
|
componentId: "sc-y4mgkj-0"
|
|
395
412
|
})(["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));
|
|
396
|
-
StyledDrawerHeader.defaultProps = {
|
|
397
|
-
theme: reactTheming.DEFAULT_THEME
|
|
398
|
-
};
|
|
399
413
|
|
|
400
414
|
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
401
415
|
const StyledDrawerBody = styled__default.default(StyledBody).attrs({
|
|
402
416
|
'data-garden-id': COMPONENT_ID$2,
|
|
403
|
-
'data-garden-version': '9.
|
|
417
|
+
'data-garden-version': '9.1.0'
|
|
404
418
|
}).withConfig({
|
|
405
419
|
displayName: "StyledDrawerBody",
|
|
406
420
|
componentId: "sc-13qufyn-0"
|
|
407
|
-
})(["padding:", "px;", ";"], props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
408
|
-
StyledDrawerBody.defaultProps = {
|
|
409
|
-
theme: reactTheming.DEFAULT_THEME
|
|
410
|
-
};
|
|
421
|
+
})(["padding:", "px;color-scheme:only ", ";", ";"], props => props.theme.space.base * 5, p => p.theme.colors.base, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
411
422
|
|
|
412
423
|
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
413
424
|
const StyledDrawerFooter = styled__default.default.div.attrs({
|
|
414
425
|
'data-garden-id': COMPONENT_ID$1,
|
|
415
|
-
'data-garden-version': '9.
|
|
426
|
+
'data-garden-version': '9.1.0'
|
|
416
427
|
}).withConfig({
|
|
417
428
|
displayName: "StyledDrawerFooter",
|
|
418
429
|
componentId: "sc-kc7e6p-0"
|
|
419
|
-
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"],
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
};
|
|
430
|
+
})(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], _ref => {
|
|
431
|
+
let {
|
|
432
|
+
theme
|
|
433
|
+
} = _ref;
|
|
434
|
+
return `${theme.borders.sm} ${reactTheming.getColor({
|
|
435
|
+
theme,
|
|
436
|
+
variable: 'border.subtle'
|
|
437
|
+
})}`;
|
|
438
|
+
}, props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
423
439
|
|
|
424
440
|
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
425
441
|
const StyledDrawerFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
426
442
|
'data-garden-id': COMPONENT_ID,
|
|
427
|
-
'data-garden-version': '9.
|
|
443
|
+
'data-garden-version': '9.1.0'
|
|
428
444
|
}).withConfig({
|
|
429
445
|
displayName: "StyledDrawerFooterItem",
|
|
430
446
|
componentId: "sc-m2yul4-0"
|
|
431
447
|
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
432
|
-
StyledDrawerFooterItem.defaultProps = {
|
|
433
|
-
theme: reactTheming.DEFAULT_THEME
|
|
434
|
-
};
|
|
435
448
|
|
|
436
449
|
const ModalsContext = React.createContext(undefined);
|
|
437
450
|
const useModalContext = () => {
|
|
@@ -450,10 +463,10 @@ const Body$2 = React.forwardRef((props, ref) => {
|
|
|
450
463
|
ref: ref
|
|
451
464
|
}));
|
|
452
465
|
});
|
|
453
|
-
Body$2.displayName = 'Body';
|
|
466
|
+
Body$2.displayName = 'Modal.Body';
|
|
454
467
|
|
|
455
468
|
var _path;
|
|
456
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
469
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
457
470
|
var SvgXStroke = function SvgXStroke(props) {
|
|
458
471
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
459
472
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -486,7 +499,7 @@ const Close$2 = React.forwardRef((props, ref) => {
|
|
|
486
499
|
ref: ref
|
|
487
500
|
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
488
501
|
});
|
|
489
|
-
Close$2.displayName = 'Close';
|
|
502
|
+
Close$2.displayName = 'Modal.Close';
|
|
490
503
|
|
|
491
504
|
const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
492
505
|
const {
|
|
@@ -497,12 +510,12 @@ const Footer$2 = React__namespace.default.forwardRef((props, ref) => {
|
|
|
497
510
|
isLarge: isLarge
|
|
498
511
|
}, props));
|
|
499
512
|
});
|
|
500
|
-
Footer$2.displayName = 'Footer';
|
|
513
|
+
Footer$2.displayName = 'Modal.Footer';
|
|
501
514
|
|
|
502
515
|
const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, Object.assign({
|
|
503
516
|
ref: ref
|
|
504
517
|
}, props)));
|
|
505
|
-
FooterItem$2.displayName = 'FooterItem';
|
|
518
|
+
FooterItem$2.displayName = 'Modal.FooterItem';
|
|
506
519
|
|
|
507
520
|
const Header$1 = React.forwardRef((_ref, ref) => {
|
|
508
521
|
let {
|
|
@@ -530,9 +543,9 @@ const Header$1 = React.forwardRef((_ref, ref) => {
|
|
|
530
543
|
as: tag,
|
|
531
544
|
isCloseButtonPresent: isCloseButtonPresent,
|
|
532
545
|
ref: ref
|
|
533
|
-
}), other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
546
|
+
}), !!other.isDanger && React__namespace.default.createElement(StyledDangerIcon, null), children);
|
|
534
547
|
});
|
|
535
|
-
Header$1.displayName = 'Header';
|
|
548
|
+
Header$1.displayName = 'Modal.Header';
|
|
536
549
|
Header$1.propTypes = {
|
|
537
550
|
isDanger: PropTypes__default.default.bool,
|
|
538
551
|
tag: PropTypes__default.default.any
|
|
@@ -649,7 +662,7 @@ const ModalComponent = React.forwardRef((_ref, ref) => {
|
|
|
649
662
|
if (!rootNode) {
|
|
650
663
|
return null;
|
|
651
664
|
}
|
|
652
|
-
return ReactDOM.createPortal(
|
|
665
|
+
return ReactDOM.createPortal(React__namespace.default.createElement(ModalsContext.Provider, {
|
|
653
666
|
value: value
|
|
654
667
|
}, React__namespace.default.createElement(StyledBackdrop, Object.assign({
|
|
655
668
|
isCentered: isCentered,
|
|
@@ -684,11 +697,11 @@ Modal.Footer = Footer$2;
|
|
|
684
697
|
Modal.FooterItem = FooterItem$2;
|
|
685
698
|
Modal.Header = Header$1;
|
|
686
699
|
|
|
687
|
-
const
|
|
688
|
-
const
|
|
689
|
-
const context = React.useContext(
|
|
700
|
+
const TooltipDialogContext = React.createContext(undefined);
|
|
701
|
+
const useTooltipDialogContext = () => {
|
|
702
|
+
const context = React.useContext(TooltipDialogContext);
|
|
690
703
|
if (context === undefined) {
|
|
691
|
-
throw new Error('Element must be used within a
|
|
704
|
+
throw new Error('Element must be used within a TooltipDialog component.');
|
|
692
705
|
}
|
|
693
706
|
return context;
|
|
694
707
|
};
|
|
@@ -703,7 +716,7 @@ const TitleComponent = React.forwardRef((_ref, ref) => {
|
|
|
703
716
|
getTitleProps,
|
|
704
717
|
hasTitle,
|
|
705
718
|
setHasTitle
|
|
706
|
-
} =
|
|
719
|
+
} = useTooltipDialogContext();
|
|
707
720
|
React.useEffect(() => {
|
|
708
721
|
if (!hasTitle && setHasTitle) {
|
|
709
722
|
setHasTitle(true);
|
|
@@ -714,12 +727,12 @@ const TitleComponent = React.forwardRef((_ref, ref) => {
|
|
|
714
727
|
}
|
|
715
728
|
};
|
|
716
729
|
}, [hasTitle, setHasTitle]);
|
|
717
|
-
return React__namespace.default.createElement(
|
|
730
|
+
return React__namespace.default.createElement(StyledTooltipDialogTitle, Object.assign({}, getTitleProps(other), {
|
|
718
731
|
as: tag,
|
|
719
732
|
ref: ref
|
|
720
733
|
}), children);
|
|
721
734
|
});
|
|
722
|
-
TitleComponent.displayName = '
|
|
735
|
+
TitleComponent.displayName = 'TooltipDialog.Title';
|
|
723
736
|
TitleComponent.propTypes = {
|
|
724
737
|
tag: PropTypes__default.default.any
|
|
725
738
|
};
|
|
@@ -731,47 +744,49 @@ const Title = TitleComponent;
|
|
|
731
744
|
const BodyComponent$1 = React.forwardRef((props, ref) => {
|
|
732
745
|
const {
|
|
733
746
|
getContentProps
|
|
734
|
-
} =
|
|
735
|
-
return React__namespace.default.createElement(
|
|
747
|
+
} = useTooltipDialogContext();
|
|
748
|
+
return React__namespace.default.createElement(StyledTooltipDialogBody, Object.assign({}, getContentProps(props), {
|
|
736
749
|
ref: ref
|
|
737
750
|
}));
|
|
738
751
|
});
|
|
739
|
-
BodyComponent$1.displayName = '
|
|
752
|
+
BodyComponent$1.displayName = 'TooltipDialog.Body';
|
|
740
753
|
const Body$1 = BodyComponent$1;
|
|
741
754
|
|
|
742
755
|
const CloseComponent$1 = React.forwardRef((props, ref) => {
|
|
743
756
|
const {
|
|
744
757
|
getCloseProps
|
|
745
|
-
} =
|
|
758
|
+
} = useTooltipDialogContext();
|
|
746
759
|
const ariaLabel = reactTheming.useText(CloseComponent$1, props, 'aria-label', 'Close tooltip');
|
|
747
|
-
return React__namespace.default.createElement(
|
|
760
|
+
return React__namespace.default.createElement(StyledTooltipDialogClose, Object.assign({}, getCloseProps({
|
|
748
761
|
...props,
|
|
749
762
|
'aria-label': ariaLabel
|
|
750
763
|
}), {
|
|
751
|
-
ref: ref
|
|
764
|
+
ref: ref,
|
|
765
|
+
size: "small"
|
|
752
766
|
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
753
767
|
});
|
|
754
|
-
CloseComponent$1.displayName = '
|
|
768
|
+
CloseComponent$1.displayName = 'TooltipDialog.Close';
|
|
755
769
|
const Close$1 = CloseComponent$1;
|
|
756
770
|
|
|
757
|
-
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(
|
|
771
|
+
const FooterComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipDialogFooter, Object.assign({
|
|
758
772
|
ref: ref
|
|
759
773
|
}, props)));
|
|
760
|
-
FooterComponent$1.displayName = '
|
|
774
|
+
FooterComponent$1.displayName = 'TooltipDialog.Footer';
|
|
761
775
|
const Footer$1 = FooterComponent$1;
|
|
762
776
|
|
|
763
|
-
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(
|
|
777
|
+
const FooterItemComponent$1 = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledTooltipDialogFooterItem, Object.assign({
|
|
764
778
|
ref: ref
|
|
765
779
|
}, props)));
|
|
766
|
-
FooterItemComponent$1.displayName = '
|
|
780
|
+
FooterItemComponent$1.displayName = 'TooltipDialog.FooterItem';
|
|
767
781
|
const FooterItem$1 = FooterItemComponent$1;
|
|
768
782
|
|
|
769
783
|
const PLACEMENT_DEFAULT = 'top';
|
|
770
|
-
const
|
|
784
|
+
const TooltipDialogComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
771
785
|
let {
|
|
772
786
|
appendToNode,
|
|
773
787
|
referenceElement,
|
|
774
788
|
placement: _placement,
|
|
789
|
+
offset: _offset,
|
|
775
790
|
onClose,
|
|
776
791
|
hasArrow,
|
|
777
792
|
isAnimated,
|
|
@@ -819,7 +834,7 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
819
834
|
floating: floatingElement
|
|
820
835
|
},
|
|
821
836
|
placement: floatingPlacement,
|
|
822
|
-
middleware: [reactDom.offset(theme.space.base * 3), _placement === 'auto' ? reactDom.autoPlacement() : undefined]
|
|
837
|
+
middleware: [reactDom.offset(_offset === undefined ? theme.space.base * 3 : _offset), _placement === 'auto' ? reactDom.autoPlacement() : undefined]
|
|
823
838
|
});
|
|
824
839
|
React.useEffect(() => {
|
|
825
840
|
let cleanup;
|
|
@@ -846,7 +861,7 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
846
861
|
const defaultValue = hasTitle ? modalProps['aria-labelledby'] : 'Modal dialog';
|
|
847
862
|
const labelValue = hasTitle ? modalProps['aria-labelledby'] : props['aria-label'];
|
|
848
863
|
const ariaProps = {
|
|
849
|
-
[attribute]: reactTheming.useText(
|
|
864
|
+
[attribute]: reactTheming.useText(TooltipDialogComponent, {
|
|
850
865
|
[attribute]: labelValue
|
|
851
866
|
}, attribute, defaultValue)
|
|
852
867
|
};
|
|
@@ -864,9 +879,9 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
864
879
|
classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
|
|
865
880
|
nodeRef: transitionRef
|
|
866
881
|
}, transitionState => {
|
|
867
|
-
return React__namespace.default.createElement(
|
|
882
|
+
return React__namespace.default.createElement(TooltipDialogContext.Provider, {
|
|
868
883
|
value: value
|
|
869
|
-
}, React__namespace.default.createElement(
|
|
884
|
+
}, React__namespace.default.createElement(StyledTooltipDialogBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
870
885
|
ref: transitionRef
|
|
871
886
|
}), React__namespace.default.createElement(StyledTooltipWrapper, {
|
|
872
887
|
ref: setFloatingElement,
|
|
@@ -876,7 +891,7 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
876
891
|
placement: placement,
|
|
877
892
|
zIndex: zIndex,
|
|
878
893
|
isAnimated: isAnimated
|
|
879
|
-
}, React__namespace.default.createElement(
|
|
894
|
+
}, React__namespace.default.createElement(StyledTooltipDialog, Object.assign({
|
|
880
895
|
transitionState: transitionState,
|
|
881
896
|
placement: placement,
|
|
882
897
|
hasArrow: hasArrow,
|
|
@@ -887,14 +902,14 @@ const TooltipModalComponent = React__namespace.default.forwardRef((_ref, ref) =>
|
|
|
887
902
|
});
|
|
888
903
|
return appendToNode ? ReactDOM.createPortal(Node, appendToNode) : Node;
|
|
889
904
|
});
|
|
890
|
-
|
|
891
|
-
|
|
905
|
+
TooltipDialogComponent.displayName = 'TooltipDialog';
|
|
906
|
+
TooltipDialogComponent.defaultProps = {
|
|
892
907
|
placement: 'auto',
|
|
893
908
|
hasArrow: true,
|
|
894
909
|
focusOnMount: true,
|
|
895
910
|
restoreFocus: true
|
|
896
911
|
};
|
|
897
|
-
|
|
912
|
+
TooltipDialogComponent.propTypes = {
|
|
898
913
|
appendToNode: PropTypes__default.default.any,
|
|
899
914
|
referenceElement: PropTypes__default.default.any,
|
|
900
915
|
placement: PropTypes__default.default.any,
|
|
@@ -906,12 +921,12 @@ TooltipModalComponent.propTypes = {
|
|
|
906
921
|
focusOnMount: PropTypes__default.default.bool,
|
|
907
922
|
restoreFocus: PropTypes__default.default.bool
|
|
908
923
|
};
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
924
|
+
const TooltipDialog = TooltipDialogComponent;
|
|
925
|
+
TooltipDialog.Body = Body$1;
|
|
926
|
+
TooltipDialog.Close = Close$1;
|
|
927
|
+
TooltipDialog.Footer = Footer$1;
|
|
928
|
+
TooltipDialog.FooterItem = FooterItem$1;
|
|
929
|
+
TooltipDialog.Title = Title;
|
|
915
930
|
|
|
916
931
|
const HeaderComponent = React.forwardRef((_ref, ref) => {
|
|
917
932
|
let {
|
|
@@ -1095,7 +1110,7 @@ const DrawerComponent = React.forwardRef((_ref, ref) => {
|
|
|
1095
1110
|
if (!rootNode) {
|
|
1096
1111
|
return null;
|
|
1097
1112
|
}
|
|
1098
|
-
return ReactDOM__default.default.createPortal(
|
|
1113
|
+
return ReactDOM__default.default.createPortal(React__namespace.default.createElement(ModalsContext.Provider, {
|
|
1099
1114
|
value: value
|
|
1100
1115
|
}, React__namespace.default.createElement(reactTransitionGroup.CSSTransition, {
|
|
1101
1116
|
in: isOpen,
|
|
@@ -1139,4 +1154,4 @@ exports.FooterItem = FooterItem$2;
|
|
|
1139
1154
|
exports.Header = Header$1;
|
|
1140
1155
|
exports.Modal = Modal;
|
|
1141
1156
|
exports.PLACEMENT = PLACEMENT;
|
|
1142
|
-
exports.
|
|
1157
|
+
exports.TooltipDialog = TooltipDialog;
|