@hh.ru/magritte-ui-modal-deprecated 1.0.39 → 1.0.41

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/Modal.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { ModalHeaderProps } from '@hh.ru/magritte-ui-modal-deprecated/types';
2
+ import { ModalHeaderProps } from './types';
3
3
  /** @deprecated Компонент устарел. Используйте `Modal` из `@hh.ru/magritte-ui-modal` */
4
- export declare const Modal: import("react").ForwardRefExoticComponent<import("@hh.ru/magritte-ui-modal-deprecated/types").ModalBaseProps & ModalHeaderProps & Omit<HTMLAttributes<HTMLDivElement>, keyof ModalHeaderProps | "className" | "role" | keyof import("@hh.ru/magritte-ui-modal-deprecated/types").ModalBaseProps | "tabindex" | "aria-labeledby"> & import("react").RefAttributes<HTMLDivElement>>;
4
+ export declare const Modal: import("react").ForwardRefExoticComponent<import("./types").ModalBaseProps & ModalHeaderProps & Omit<HTMLAttributes<HTMLDivElement>, "aria-labeledby" | "className" | "role" | "tabindex" | keyof import("./types").ModalBaseProps | keyof ModalHeaderProps> & import("react").RefAttributes<HTMLDivElement>>;
package/Modal.js CHANGED
@@ -13,7 +13,7 @@ import { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';
13
13
  import { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';
14
14
  import { Breakpoint, useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
15
15
  import { Layer } from '@hh.ru/magritte-ui-layer';
16
- import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-B7tpHFBW.js';
16
+ import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-CxF78N1S.js';
17
17
  import { useModalOrder } from './useModalOrder.js';
18
18
  import { isProgressBarComponent } from '@hh.ru/magritte-ui-progress-bar';
19
19
  import { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';
@@ -30,40 +30,75 @@ import '@hh.ru/magritte-common-dom-storage';
30
30
 
31
31
  const DEFAULT_ACTION_BAR_PADDING = 24;
32
32
  const DEFAULT_PAGE_HEADER_PADDING = 72;
33
- const noop = () => undefined;
33
+ const noop = () => void 0;
34
34
  const toNumber = (value) => {
35
- const result = parseInt(value, 10);
36
- return Number.isInteger(result) ? result : 0;
35
+ const result = parseInt(value, 10);
36
+ return Number.isInteger(result) ? result : 0;
37
37
  };
38
38
  const CSS_CLASSES = {
39
- center: {
40
- appear: styles.animationEnterCenter,
41
- appearActive: styles.animationEnterCenterActive,
42
- enter: styles.animationEnterCenter,
43
- enterActive: styles.animationEnterCenterActive,
44
- exit: styles.animationExitCenter,
45
- exitActive: styles.animationExitCenterActive,
46
- },
47
- left: {
48
- appear: styles.animationEnterLeft,
49
- appearActive: styles.animationEnterLeftActive,
50
- enter: styles.animationEnterLeft,
51
- enterActive: styles.animationEnterLeftActive,
52
- exit: styles.animationExitLeft,
53
- exitActive: styles.animationExitLeftActive,
54
- },
55
- right: {
56
- appear: styles.animationEnterRight,
57
- appearActive: styles.animationEnterRightActive,
58
- enter: styles.animationEnterRight,
59
- enterActive: styles.animationEnterRightActive,
60
- exit: styles.animationExitRight,
61
- exitActive: styles.animationExitRightActive,
62
- },
39
+ center: {
40
+ appear: styles.animationEnterCenter,
41
+ appearActive: styles.animationEnterCenterActive,
42
+ enter: styles.animationEnterCenter,
43
+ enterActive: styles.animationEnterCenterActive,
44
+ exit: styles.animationExitCenter,
45
+ exitActive: styles.animationExitCenterActive
46
+ },
47
+ left: {
48
+ appear: styles.animationEnterLeft,
49
+ appearActive: styles.animationEnterLeftActive,
50
+ enter: styles.animationEnterLeft,
51
+ enterActive: styles.animationEnterLeftActive,
52
+ exit: styles.animationExitLeft,
53
+ exitActive: styles.animationExitLeftActive
54
+ },
55
+ right: {
56
+ appear: styles.animationEnterRight,
57
+ appearActive: styles.animationEnterRightActive,
58
+ enter: styles.animationEnterRight,
59
+ enterActive: styles.animationEnterRightActive,
60
+ exit: styles.animationExitRight,
61
+ exitActive: styles.animationExitRightActive
62
+ }
63
63
  };
64
64
  const INVISIBLE_FOR_BREAKPOINTS = [Breakpoint.XS, Breakpoint.S];
65
- /** @deprecated Компонент устарел. Используйте `Modal` из `@hh.ru/magritte-ui-modal` */
66
- const Modal = forwardRef(({ visible, size = 'medium', title, titleAlignment = 'left', titleSize = 'large', titleMaxLines, titleElement = 'h2', titleDescription, titleDescriptionMaxLines, titleStyle, titleDescriptionStyle, children, onClose = noop, headerImageUrl, headerImage, headerHeight, host, options, actions, actionLink, footer, disableVerticalPaddings = false, disableHorizontalPaddings = false, closeByClickOutside = true, onAppear, onBeforeExit, onAfterExit, position = 'center', height = position === 'center' ? 'content' : 'full-screen', minHeight, showOverlay: _showOverlay = true, pageHeaderPadding = DEFAULT_PAGE_HEADER_PADDING, returnFocusOnClose, ...rest }, ref) => {
65
+ const Modal = forwardRef(
66
+ ({
67
+ visible,
68
+ size = "medium",
69
+ title,
70
+ titleAlignment = "left",
71
+ titleSize = "large",
72
+ titleMaxLines,
73
+ titleElement = "h2",
74
+ titleDescription,
75
+ titleDescriptionMaxLines,
76
+ titleStyle,
77
+ titleDescriptionStyle,
78
+ children,
79
+ onClose = noop,
80
+ headerImageUrl,
81
+ headerImage,
82
+ headerHeight,
83
+ host,
84
+ options,
85
+ actions,
86
+ actionLink,
87
+ footer,
88
+ disableVerticalPaddings = false,
89
+ disableHorizontalPaddings = false,
90
+ closeByClickOutside = true,
91
+ onAppear,
92
+ onBeforeExit,
93
+ onAfterExit,
94
+ position = "center",
95
+ height = position === "center" ? "content" : "full-screen",
96
+ minHeight,
97
+ showOverlay: _showOverlay = true,
98
+ pageHeaderPadding = DEFAULT_PAGE_HEADER_PADDING,
99
+ returnFocusOnClose,
100
+ ...rest
101
+ }, ref) => {
67
102
  const isServerEnv = useServerEnv();
68
103
  const enableScrollRef = useRef();
69
104
  const onAfterExitRef = useRef(onAfterExit);
@@ -71,203 +106,234 @@ const Modal = forwardRef(({ visible, size = 'medium', title, titleAlignment = 'l
71
106
  onAfterExitRef.current = onAfterExit;
72
107
  onBeforeExitRef.current = onBeforeExit;
73
108
  const [animationTimeout, setAnimationTimeout] = useState({
74
- enter: 0,
75
- exit: 0,
109
+ enter: 0,
110
+ exit: 0
76
111
  });
77
112
  const animationTimeoutExitRef = useRef(animationTimeout.exit);
78
113
  animationTimeoutExitRef.current = animationTimeout.exit;
79
114
  const labelId = useId();
80
115
  const additionalProps = {};
81
116
  if (title) {
82
- additionalProps['aria-labelledby'] = labelId;
117
+ additionalProps["aria-labelledby"] = labelId;
83
118
  }
84
119
  const modalRef = useRef(null);
85
120
  const overlayRef = useRef(null);
86
- const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: 'loop' });
121
+ const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: "loop" });
87
122
  const modalRefCallback = useMultipleRefs(ref, modalRef, keyboardNavigationRef);
88
- const isPaddingsDisableAllowed = !title &&
89
- !headerImageUrl &&
90
- !headerImage &&
91
- !titleDescription &&
92
- !footer &&
93
- !options &&
94
- !actionLink &&
95
- !actions;
123
+ const isPaddingsDisableAllowed = !title && !headerImageUrl && !headerImage && !titleDescription && !footer && !options && !actionLink && !actions;
96
124
  const isVerticalPaddingsDisabled = disableVerticalPaddings && isPaddingsDisableAllowed;
97
125
  const isHorizontalPaddingsDisabled = disableHorizontalPaddings && isPaddingsDisableAllowed;
98
- const showOverlay = position === 'center' || _showOverlay;
126
+ const showOverlay = position === "center" || _showOverlay;
99
127
  const activatorRef = useRef(null);
100
128
  const onEntering = useCallback(() => {
101
- if (returnFocusOnClose && document.activeElement instanceof HTMLElement) {
102
- activatorRef.current = document.activeElement;
103
- }
104
- if (!enableScrollRef.current && showOverlay) {
105
- enableScrollRef.current = disableScroll();
106
- }
107
- if (modalRef.current && !modalRef.current.contains(document.activeElement)) {
108
- modalRef.current.focus();
109
- }
129
+ if (returnFocusOnClose && document.activeElement instanceof HTMLElement) {
130
+ activatorRef.current = document.activeElement;
131
+ }
132
+ if (!enableScrollRef.current && showOverlay) {
133
+ enableScrollRef.current = disableScroll();
134
+ }
135
+ if (modalRef.current && !modalRef.current.contains(document.activeElement)) {
136
+ modalRef.current.focus();
137
+ }
110
138
  }, [returnFocusOnClose, showOverlay]);
111
139
  const onEntered = useCallback(() => {
112
- onAppear?.();
140
+ onAppear?.();
113
141
  }, [onAppear]);
114
142
  const onExit = useCallback(() => {
115
- onBeforeExitRef.current?.();
143
+ onBeforeExitRef.current?.();
116
144
  }, []);
117
145
  const onExited = useCallback(() => {
118
- // оставляем обработку скрола еще и тут
119
- // чтобы обработать историю со сменой breakpoint
120
- enableScrollRef.current?.();
121
- enableScrollRef.current = undefined;
122
- onAfterExitRef.current?.();
123
- if (activatorRef.current !== null && document.contains(activatorRef.current)) {
124
- activatorRef.current?.focus();
125
- activatorRef.current = null;
126
- }
146
+ enableScrollRef.current?.();
147
+ enableScrollRef.current = void 0;
148
+ onAfterExitRef.current?.();
149
+ if (activatorRef.current !== null && document.contains(activatorRef.current)) {
150
+ activatorRef.current?.focus();
151
+ activatorRef.current = null;
152
+ }
127
153
  }, []);
128
154
  useModalOrder(!!visible && !isServerEnv, modalRef);
129
155
  const { breakpoint } = useBreakpoint();
130
156
  useEffect(() => {
131
- if (!visible) {
132
- return;
133
- }
134
- const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);
135
- if (!currentBreakpointVisible) {
136
- onExit();
137
- onExited();
138
- return;
139
- }
140
- onEntering();
141
- // visible не должно быть в зависимостях, т.к. этот эффект обрабатывает только изменение брейкпоинта
142
- // visible обрабатывается CSSTransition
143
- // eslint-disable-next-line react-hooks/exhaustive-deps
157
+ if (!visible) {
158
+ return;
159
+ }
160
+ const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);
161
+ if (!currentBreakpointVisible) {
162
+ onExit();
163
+ onExited();
164
+ return;
165
+ }
166
+ onEntering();
144
167
  }, [breakpoint, onEntering, onExited, onExit]);
145
168
  useEffect(() => {
146
- return () => {
147
- enableScrollRef.current?.(animationTimeoutExitRef.current);
148
- enableScrollRef.current = undefined;
149
- };
169
+ return () => {
170
+ enableScrollRef.current?.(animationTimeoutExitRef.current);
171
+ enableScrollRef.current = void 0;
172
+ };
150
173
  }, [visible]);
151
174
  useLayoutEffect(() => {
152
- const animationTimeoutElement = document.createElement('div');
153
- animationTimeoutElement.classList.add(styles.animationTimeout);
154
- document.body.appendChild(animationTimeoutElement);
155
- const style = window.getComputedStyle(animationTimeoutElement);
156
- setAnimationTimeout({
157
- enter: toNumber(style.getPropertyValue('--enter-animation-duration')),
158
- exit: toNumber(style.getPropertyValue('--exit-animation-duration')),
159
- });
160
- document.body.removeChild(animationTimeoutElement);
175
+ const animationTimeoutElement = document.createElement("div");
176
+ animationTimeoutElement.classList.add(styles.animationTimeout);
177
+ document.body.appendChild(animationTimeoutElement);
178
+ const style = window.getComputedStyle(animationTimeoutElement);
179
+ setAnimationTimeout({
180
+ enter: toNumber(style.getPropertyValue("--enter-animation-duration")),
181
+ exit: toNumber(style.getPropertyValue("--exit-animation-duration"))
182
+ });
183
+ document.body.removeChild(animationTimeoutElement);
161
184
  }, [setAnimationTimeout]);
162
185
  useEffect(() => {
163
- if (showOverlay || !pageHeaderPadding || !visible) {
164
- return void 0;
165
- }
166
- const hasScrollTimeline = 'ScrollTimeline' in window;
167
- const overlay = overlayRef.current;
168
- if (!overlay) {
169
- return void 0;
170
- }
171
- let animation;
172
- const abortController = new AbortController();
173
- const keyframes = { top: [`${pageHeaderPadding}px`, '0px'] };
174
- if (hasScrollTimeline) {
175
- const timeline = new ScrollTimeline({ source: document.documentElement, axis: 'y' });
176
- // TS 7 (type-aware правила oxlint) уже знает rangeStart/rangeEnd, а TS 5 без каста не пропускает
177
- // oxlint-disable-next-line typescript/no-unnecessary-type-assertion
178
- animation = overlay.animate(keyframes, {
179
- timeline,
180
- rangeStart: '0px',
181
- // calc нужен для устранения бага https://issues.chromium.org/issues/40929569
182
- rangeEnd: `calc(0% + ${pageHeaderPadding}px)`,
183
- });
184
- }
185
- else {
186
- animation = overlay.animate(keyframes, { duration: 1000, fill: 'forwards' });
187
- animation.pause();
188
- window.addEventListener('scroll', () => {
189
- animation.currentTime =
190
- (Math.min(document.documentElement.scrollTop, pageHeaderPadding) / pageHeaderPadding) *
191
- 1000;
192
- }, { signal: abortController.signal });
193
- }
194
- return () => {
195
- abortController.abort();
196
- };
186
+ if (showOverlay || !pageHeaderPadding || !visible) {
187
+ return void 0;
188
+ }
189
+ const hasScrollTimeline = "ScrollTimeline" in window;
190
+ const overlay = overlayRef.current;
191
+ if (!overlay) {
192
+ return void 0;
193
+ }
194
+ let animation;
195
+ const abortController = new AbortController();
196
+ const keyframes = { top: [`${pageHeaderPadding}px`, "0px"] };
197
+ if (hasScrollTimeline) {
198
+ const timeline = new ScrollTimeline({ source: document.documentElement, axis: "y" });
199
+ animation = overlay.animate(keyframes, {
200
+ timeline,
201
+ rangeStart: "0px",
202
+ // calc нужен для устранения бага https://issues.chromium.org/issues/40929569
203
+ rangeEnd: `calc(0% + ${pageHeaderPadding}px)`
204
+ });
205
+ } else {
206
+ animation = overlay.animate(keyframes, { duration: 1e3, fill: "forwards" });
207
+ animation.pause();
208
+ window.addEventListener(
209
+ "scroll",
210
+ () => {
211
+ animation.currentTime = Math.min(document.documentElement.scrollTop, pageHeaderPadding) / pageHeaderPadding * 1e3;
212
+ },
213
+ { signal: abortController.signal }
214
+ );
215
+ }
216
+ return () => {
217
+ abortController.abort();
218
+ };
197
219
  }, [showOverlay, pageHeaderPadding, visible]);
198
220
  const overlayEventHandlers = useNoBubbling({
199
- onKeyDown: (event) => {
200
- if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {
201
- onClose(event);
202
- }
203
- },
204
- onMouseDown: (event) => {
205
- if (!closeByClickOutside || modalRef.current?.contains(event.target)) {
206
- return;
207
- }
208
- onClose(event);
209
- },
221
+ onKeyDown: (event) => {
222
+ if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {
223
+ onClose(event);
224
+ }
225
+ },
226
+ onMouseDown: (event) => {
227
+ if (!closeByClickOutside || modalRef.current?.contains(event.target)) {
228
+ return;
229
+ }
230
+ onClose(event);
231
+ }
210
232
  });
211
- const overlayProps = showOverlay
212
- ? overlayEventHandlers
213
- : {
214
- onKeyDown: (event) => {
215
- if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {
216
- onClose(event);
217
- }
218
- },
219
- };
233
+ const overlayProps = showOverlay ? overlayEventHandlers : {
234
+ onKeyDown: (event) => {
235
+ if (keyboardMatch(event.nativeEvent, keyboardKeys.Escape)) {
236
+ onClose(event);
237
+ }
238
+ }
239
+ };
220
240
  if (INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint) || isServerEnv) {
221
- return null;
241
+ return null;
222
242
  }
223
243
  const modalHeaderProps = {
224
- title,
225
- titleElement,
226
- titleAlignment,
227
- titleSize,
228
- titleMaxLines,
229
- titleDescription,
230
- titleDescriptionMaxLines,
231
- titleStyle,
232
- titleDescriptionStyle,
233
- headerImageUrl,
234
- headerImage,
235
- headerHeight,
236
- options,
237
- actions,
238
- actionLink,
244
+ title,
245
+ titleElement,
246
+ titleAlignment,
247
+ titleSize,
248
+ titleMaxLines,
249
+ titleDescription,
250
+ titleDescriptionMaxLines,
251
+ titleStyle,
252
+ titleDescriptionStyle,
253
+ headerImageUrl,
254
+ headerImage,
255
+ headerHeight,
256
+ options,
257
+ actions,
258
+ actionLink
239
259
  };
240
260
  const isTreeSelectorChild = Children.toArray(children).some(isValidTreeSelectorWrapper);
241
- // если есть progress bar, нужно скрыть divider (но showProgress - это слот под reactNode)
242
- const isActionBarHaveProgressBar = !!footer &&
243
- isActionBarComponent(footer) &&
244
- Boolean(footer.props.showProgress) &&
245
- isProgressBarComponent(footer.props.showProgress);
246
- return createPortal(jsx(CSSTransition, { appear: true, in: visible && !isServerEnv, nodeRef: overlayRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExited: onExited, classNames: CSS_CLASSES[position], timeout: animationTimeout, unmountOnExit: true, children: jsx(ThemeWrapper, { children: (themeClass) => (jsx(Layer, { layer: "modal", children: jsx("div", { ...overlayProps, ref: overlayRef, className: classnames(styles.modalOverlay, themeClass, {
247
- [styles.modalOverlayWithBackground]: showOverlay,
248
- [styles.modalOverlayLeft]: position === 'left',
249
- [styles.modalOverlayRight]: position === 'right',
250
- }), "data-qa": "modal-overlay", children: jsx(CloseByClickOutsideContext.Provider, { value: overlayRef, children: jsxs("div", { ...rest, ...additionalProps, "aria-modal": visible && showOverlay && !isServerEnv, role: "dialog", className: classnames(styles.modal, {
251
- [styles.sizeSmall]: size === 'small',
252
- [styles.sizeMedium]: size === 'medium',
253
- [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,
254
- [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,
255
- [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,
256
- [styles.modalWithBorder]: !showOverlay,
257
- }), ref: modalRefCallback, tabIndex: -1, style: {
258
- height: typeof height === 'number' ? `${height}px` : undefined,
259
- minHeight: typeof minHeight === 'number'
260
- ? `min(calc(100vh - 12px * 2), ${minHeight}px)`
261
- : undefined,
262
- }, children: [jsx(ModalContentWithHeader, { ...modalHeaderProps, labelId: labelId, isTreeSelectorChild: isTreeSelectorChild, height: height, showDivider: !isActionBarHaveProgressBar, children: children }), !!footer && (jsx("div", { className: styles.modalFooter, "data-qa": "modal-footer", children: isActionBarComponent(footer)
263
- ? cloneElement(footer, {
264
- type: footer.props.type || 'auto',
265
- padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,
266
- showDivider: false,
267
- })
268
- : footer }))] }) }) }) })) }) }), host || document.body);
269
- });
270
- Modal.displayName = 'Modal';
261
+ const isActionBarHaveProgressBar = !!footer && isActionBarComponent(footer) && Boolean(footer.props.showProgress) && isProgressBarComponent(footer.props.showProgress);
262
+ return createPortal(
263
+ /* @__PURE__ */ jsx(
264
+ CSSTransition,
265
+ {
266
+ appear: true,
267
+ in: visible && !isServerEnv,
268
+ nodeRef: overlayRef,
269
+ onEntering,
270
+ onEntered,
271
+ onExit,
272
+ onExited,
273
+ classNames: CSS_CLASSES[position],
274
+ timeout: animationTimeout,
275
+ unmountOnExit: true,
276
+ children: /* @__PURE__ */ jsx(ThemeWrapper, { children: (themeClass) => /* @__PURE__ */ jsx(Layer, { layer: "modal", children: /* @__PURE__ */ jsx(
277
+ "div",
278
+ {
279
+ ...overlayProps,
280
+ ref: overlayRef,
281
+ className: classnames(styles.modalOverlay, themeClass, {
282
+ [styles.modalOverlayWithBackground]: showOverlay,
283
+ [styles.modalOverlayLeft]: position === "left",
284
+ [styles.modalOverlayRight]: position === "right"
285
+ }),
286
+ "data-qa": "modal-overlay",
287
+ children: /* @__PURE__ */ jsx(CloseByClickOutsideContext.Provider, { value: overlayRef, children: /* @__PURE__ */ jsxs(
288
+ "div",
289
+ {
290
+ ...rest,
291
+ ...additionalProps,
292
+ "aria-modal": visible && showOverlay && !isServerEnv,
293
+ role: "dialog",
294
+ className: classnames(styles.modal, {
295
+ [styles.sizeSmall]: size === "small",
296
+ [styles.sizeMedium]: size === "medium",
297
+ [styles.modalFullHeight]: height === "full-screen" || isTreeSelectorChild,
298
+ [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,
299
+ [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,
300
+ [styles.modalWithBorder]: !showOverlay
301
+ }),
302
+ ref: modalRefCallback,
303
+ tabIndex: -1,
304
+ style: {
305
+ height: typeof height === "number" ? `${height}px` : void 0,
306
+ minHeight: typeof minHeight === "number" ? `min(calc(100vh - 12px * 2), ${minHeight}px)` : void 0
307
+ },
308
+ children: [
309
+ /* @__PURE__ */ jsx(
310
+ ModalContentWithHeader,
311
+ {
312
+ ...modalHeaderProps,
313
+ labelId,
314
+ isTreeSelectorChild,
315
+ height,
316
+ showDivider: !isActionBarHaveProgressBar,
317
+ children
318
+ }
319
+ ),
320
+ !!footer && /* @__PURE__ */ jsx("div", { className: styles.modalFooter, "data-qa": "modal-footer", children: isActionBarComponent(footer) ? cloneElement(footer, {
321
+ type: footer.props.type || "auto",
322
+ padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,
323
+ showDivider: false
324
+ }) : footer })
325
+ ]
326
+ }
327
+ ) })
328
+ }
329
+ ) }) })
330
+ }
331
+ ),
332
+ host || document.body
333
+ );
334
+ }
335
+ );
336
+ Modal.displayName = "Modal";
271
337
 
272
338
  export { Modal };
273
339
  //# sourceMappingURL=Modal.js.map