@hh.ru/magritte-ui-modal 9.0.14 → 9.1.1

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.js CHANGED
@@ -12,9 +12,10 @@ import { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';
12
12
  import { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';
13
13
  import { Breakpoint, useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
14
14
  import { Layer } from '@hh.ru/magritte-ui-layer';
15
- import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-Br1tEslM.js';
15
+ import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-8j0k2tmL.js';
16
16
  import { useModalOrder } from './useModalOrder.js';
17
17
  import { isProgressBarComponent } from '@hh.ru/magritte-ui-progress-bar';
18
+ import { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';
18
19
  import { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';
19
20
  import '@hh.ru/magritte-common-func-utils';
20
21
  import '@hh.ru/magritte-ui-divider';
@@ -180,27 +181,27 @@ const Modal = forwardRef(({ visible, size = 'medium', title, titleAlignment = 'l
180
181
  isActionBarComponent(footer) &&
181
182
  Boolean(footer.props.showProgress) &&
182
183
  isProgressBarComponent(footer.props.showProgress);
183
- 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(Layer, { layer: "modal", children: jsx("div", { ...overlayEventHandlers, ref: overlayRef, className: classnames(styles.modalOverlay, {
184
- [styles.overlayLeft]: position === 'left',
185
- [styles.overlayRight]: position === 'right',
186
- }), "data-qa": "modal-overlay", children: jsxs("div", { ...rest, ...additionalProps, role: "dialog", className: classnames(styles.modal, {
187
- [styles.sizeSmall]: size === 'small',
188
- [styles.sizeMedium]: size === 'medium',
189
- [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,
190
- [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,
191
- [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,
192
- }), ref: modalRefCallback, tabIndex: 0, style: {
193
- height: typeof height === 'number' ? `${height}px` : undefined,
194
- minHeight: typeof minHeight === 'number'
195
- ? `min(calc(100vh - 12px * 2), ${minHeight}px)`
196
- : undefined,
197
- }, 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)
198
- ? cloneElement(footer, {
199
- type: footer.props.type || 'auto',
200
- padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,
201
- showDivider: false,
202
- })
203
- : footer }))] }) }) }) }), host || document.body);
184
+ 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", { ...overlayEventHandlers, ref: overlayRef, className: classnames(styles.modalOverlay, themeClass, {
185
+ [styles.overlayLeft]: position === 'left',
186
+ [styles.overlayRight]: position === 'right',
187
+ }), "data-qa": "modal-overlay", children: jsxs("div", { ...rest, ...additionalProps, role: "dialog", className: classnames(styles.modal, {
188
+ [styles.sizeSmall]: size === 'small',
189
+ [styles.sizeMedium]: size === 'medium',
190
+ [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,
191
+ [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,
192
+ [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,
193
+ }), ref: modalRefCallback, tabIndex: 0, style: {
194
+ height: typeof height === 'number' ? `${height}px` : undefined,
195
+ minHeight: typeof minHeight === 'number'
196
+ ? `min(calc(100vh - 12px * 2), ${minHeight}px)`
197
+ : undefined,
198
+ }, 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)
199
+ ? cloneElement(footer, {
200
+ type: footer.props.type || 'auto',
201
+ padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,
202
+ showDivider: false,
203
+ })
204
+ : footer }))] }) }) })) }) }), host || document.body);
204
205
  });
205
206
  Modal.displayName = 'Modal';
206
207
 
package/Modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../src/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useLayoutEffect,\n useRef,\n useState,\n useCallback,\n useId,\n useEffect,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint, Breakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContentWithHeader } from '@hh.ru/magritte-ui-modal/ModalContentWithHeader';\nimport { ModalHeaderProps, ModalProps } from '@hh.ru/magritte-ui-modal/types';\nimport { useModalOrder } from '@hh.ru/magritte-ui-modal/useModalOrder';\nimport { isProgressBarComponent } from '@hh.ru/magritte-ui-progress-bar';\nimport { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';\n\nimport styles from './modal.less';\n\nconst DEFAULT_ACTION_BAR_PADDING = 24;\n\nconst noop = () => undefined;\n\nconst toNumber = (value: string) => {\n const result = parseInt(value, 10);\n return Number.isInteger(result) ? result : 0;\n};\n\nconst CSS_CLASSES = {\n center: {\n appear: styles.animationEnterCenter,\n appearActive: styles.animationEnterCenterActive,\n enter: styles.animationEnterCenter,\n enterActive: styles.animationEnterCenterActive,\n exit: styles.animationExitCenter,\n exitActive: styles.animationExitCenterActive,\n },\n left: {\n appear: styles.animationEnterLeft,\n appearActive: styles.animationEnterLeftActive,\n enter: styles.animationEnterLeft,\n enterActive: styles.animationEnterLeftActive,\n exit: styles.animationExitLeft,\n exitActive: styles.animationExitLeftActive,\n },\n right: {\n appear: styles.animationEnterRight,\n appearActive: styles.animationEnterRightActive,\n enter: styles.animationEnterRight,\n enterActive: styles.animationEnterRightActive,\n exit: styles.animationExitRight,\n exitActive: styles.animationExitRightActive,\n },\n};\n\nconst INVISIBLE_FOR_BREAKPOINTS = [Breakpoint.XS, Breakpoint.S];\n\nexport const Modal = forwardRef<\n HTMLDivElement,\n ModalProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabindex' | 'className' | 'aria-labeledby'>\n>(\n (\n {\n visible,\n size = 'medium',\n title,\n titleAlignment = 'left',\n titleSize = 'large',\n titleMaxLines,\n titleElement = 'h2',\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n children,\n onClose = noop,\n headerImageUrl,\n headerImage,\n headerHeight,\n host,\n options,\n actions,\n actionLink,\n footer,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const enableScrollRef = useRef<TimeoutCallback>();\n const onAfterExitRef = useRef(onAfterExit);\n const onBeforeExitRef = useRef(onBeforeExit);\n onAfterExitRef.current = onAfterExit;\n onBeforeExitRef.current = onBeforeExit;\n const [animationTimeout, setAnimationTimeout] = useState<{ enter: number; exit: number }>({\n enter: 0,\n exit: 0,\n });\n const animationTimeoutExitRef = useRef(animationTimeout.exit);\n animationTimeoutExitRef.current = animationTimeout.exit;\n const labelId = useId();\n const additionalProps: { 'aria-labelledby'?: string } = {};\n if (title) {\n additionalProps['aria-labelledby'] = labelId;\n }\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const modalRefCallback = useMultipleRefs(ref, modalRef);\n\n const isPaddingsDisableAllowed =\n !title &&\n !headerImageUrl &&\n !headerImage &&\n !titleDescription &&\n !footer &&\n !options &&\n !actionLink &&\n !actions;\n const isVerticalPaddingsDisabled = disableVerticalPaddings && isPaddingsDisableAllowed;\n const isHorizontalPaddingsDisabled = disableHorizontalPaddings && isPaddingsDisableAllowed;\n\n const onEntering = useCallback(() => {\n if (!enableScrollRef.current) {\n enableScrollRef.current = disableScroll();\n }\n if (modalRef.current && !modalRef.current.contains(document.activeElement)) {\n modalRef.current.focus();\n }\n }, []);\n\n const onEntered = useCallback(() => {\n onAppear?.();\n }, [onAppear]);\n\n const onExit = useCallback(() => {\n onBeforeExitRef.current?.();\n }, []);\n const onExited = useCallback(() => {\n // оставляем обработку скрола еще и тут\n // чтобы обработать историю со сменой breakpoint\n enableScrollRef.current?.();\n enableScrollRef.current = undefined;\n onAfterExitRef.current?.();\n }, []);\n\n useModalOrder(!!visible && !isServerEnv, modalRef);\n\n const { breakpoint } = useBreakpoint();\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);\n if (!currentBreakpointVisible) {\n onExit();\n onExited();\n return;\n }\n\n onEntering();\n // visible не должно быть в зависимостях, т.к. этот эффект обрабатывает только изменение брейкпоинта\n // visible обрабатывается CSSTransition\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [breakpoint, onEntering, onExited, onExit]);\n\n useEffect(\n () => () => {\n enableScrollRef.current?.(animationTimeoutExitRef.current);\n enableScrollRef.current = undefined;\n },\n [visible]\n );\n\n useLayoutEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n setAnimationTimeout({\n enter: toNumber(style.getPropertyValue('--enter-animation-duration')),\n exit: toNumber(style.getPropertyValue('--exit-animation-duration')),\n });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (!closeByClickOutside || modalRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n onClose(event);\n },\n });\n\n if (INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint) || isServerEnv) {\n return null;\n }\n\n const modalHeaderProps = {\n title,\n titleElement,\n titleAlignment,\n titleSize,\n titleMaxLines,\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n headerImageUrl,\n headerImage,\n headerHeight,\n options,\n actions,\n actionLink,\n } as ModalHeaderProps;\n\n const isTreeSelectorChild = isValidTreeSelectorWrapper(children);\n // если есть progress bar, нужно скрыть divider (но showProgress - это слот под reactNode)\n const isActionBarHaveProgressBar =\n !!footer &&\n isActionBarComponent(footer) &&\n Boolean(footer.props.showProgress) &&\n isProgressBarComponent(footer.props.showProgress);\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <Layer layer=\"modal\">\n <div\n {...overlayEventHandlers}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, {\n [styles.overlayLeft]: position === 'left',\n [styles.overlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <div\n {...rest}\n {...additionalProps}\n role=\"dialog\"\n className={classnames(styles.modal, {\n [styles.sizeSmall]: size === 'small',\n [styles.sizeMedium]: size === 'medium',\n [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,\n [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,\n [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,\n })}\n ref={modalRefCallback}\n tabIndex={0}\n style={{\n height: typeof height === 'number' ? `${height}px` : undefined,\n minHeight:\n typeof minHeight === 'number'\n ? `min(calc(100vh - 12px * 2), ${minHeight}px)`\n : undefined,\n }}\n >\n <ModalContentWithHeader\n {...modalHeaderProps}\n labelId={labelId}\n isTreeSelectorChild={isTreeSelectorChild}\n height={height}\n showDivider={!isActionBarHaveProgressBar}\n >\n {children}\n </ModalContentWithHeader>\n {!!footer && (\n <div className={styles.modalFooter} data-qa=\"modal-footer\">\n {isActionBarComponent(footer)\n ? cloneElement(footer, {\n type: footer.props.type || 'auto',\n padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,\n showDivider: false,\n })\n : footer}\n </div>\n )}\n </div>\n </div>\n </Layer>\n </CSSTransition>,\n host || document.body\n );\n }\n);\n\nModal.displayName = 'Modal';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,IAAA,OAAO,MA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AQ,GAAG,CAAA,EAAG,MAAM,CAAA,EAAA,CAAI,GAAG,SAAS;AAC9D,wBAAA,SAAS,EACL,OAAO,SAAS,KAAK,QAAQ;8BACvB,CAA+B,4BAAA,EAAA,SAAS,CAAK,GAAA,CAAA;AAC/C,8BAAE,SAAS;AACtB,qBAAA,EAAA,QAAA,EAAA,CAEDD,IAAC,sBAAsB,EAAA,EAAA,GACf,gBAAgB,EACpB,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,CAAC,0BAA0B,EAEvC,QAAA,EAAA,QAAQ,GACY,EACxB,CAAC,CAAC,MAAM,KACLA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,WAAW,EAAU,SAAA,EAAA,cAAc,YACrD,oBAAoB,CAAC,MAAM,CAAC;AACzB,kCAAE,YAAY,CAAC,MAAM,EAAE;AACjB,oCAAA,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM;AACjC,oCAAA,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,0BAA0B;AAC3D,oCAAA,WAAW,EAAE,KAAK;iCACrB,CAAC;AACJ,kCAAE,MAAM,EACV,CAAA,CACT,IACC,EACJ,CAAA,EAAA,CACF,EACI,CAAA,EAChB,IAAI,IAAI,QAAQ,CAAC,IAAI,CACxB,CAAC;AACN,CAAC,EACH;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../src/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useLayoutEffect,\n useRef,\n useState,\n useCallback,\n useId,\n useEffect,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint, Breakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContentWithHeader } from '@hh.ru/magritte-ui-modal/ModalContentWithHeader';\nimport { ModalHeaderProps, ModalProps } from '@hh.ru/magritte-ui-modal/types';\nimport { useModalOrder } from '@hh.ru/magritte-ui-modal/useModalOrder';\nimport { isProgressBarComponent } from '@hh.ru/magritte-ui-progress-bar';\nimport { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';\nimport { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';\n\nimport styles from './modal.less';\n\nconst DEFAULT_ACTION_BAR_PADDING = 24;\n\nconst noop = () => undefined;\n\nconst toNumber = (value: string) => {\n const result = parseInt(value, 10);\n return Number.isInteger(result) ? result : 0;\n};\n\nconst CSS_CLASSES = {\n center: {\n appear: styles.animationEnterCenter,\n appearActive: styles.animationEnterCenterActive,\n enter: styles.animationEnterCenter,\n enterActive: styles.animationEnterCenterActive,\n exit: styles.animationExitCenter,\n exitActive: styles.animationExitCenterActive,\n },\n left: {\n appear: styles.animationEnterLeft,\n appearActive: styles.animationEnterLeftActive,\n enter: styles.animationEnterLeft,\n enterActive: styles.animationEnterLeftActive,\n exit: styles.animationExitLeft,\n exitActive: styles.animationExitLeftActive,\n },\n right: {\n appear: styles.animationEnterRight,\n appearActive: styles.animationEnterRightActive,\n enter: styles.animationEnterRight,\n enterActive: styles.animationEnterRightActive,\n exit: styles.animationExitRight,\n exitActive: styles.animationExitRightActive,\n },\n};\n\nconst INVISIBLE_FOR_BREAKPOINTS = [Breakpoint.XS, Breakpoint.S];\n\nexport const Modal = forwardRef<\n HTMLDivElement,\n ModalProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabindex' | 'className' | 'aria-labeledby'>\n>(\n (\n {\n visible,\n size = 'medium',\n title,\n titleAlignment = 'left',\n titleSize = 'large',\n titleMaxLines,\n titleElement = 'h2',\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n children,\n onClose = noop,\n headerImageUrl,\n headerImage,\n headerHeight,\n host,\n options,\n actions,\n actionLink,\n footer,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const enableScrollRef = useRef<TimeoutCallback>();\n const onAfterExitRef = useRef(onAfterExit);\n const onBeforeExitRef = useRef(onBeforeExit);\n onAfterExitRef.current = onAfterExit;\n onBeforeExitRef.current = onBeforeExit;\n const [animationTimeout, setAnimationTimeout] = useState<{ enter: number; exit: number }>({\n enter: 0,\n exit: 0,\n });\n const animationTimeoutExitRef = useRef(animationTimeout.exit);\n animationTimeoutExitRef.current = animationTimeout.exit;\n const labelId = useId();\n const additionalProps: { 'aria-labelledby'?: string } = {};\n if (title) {\n additionalProps['aria-labelledby'] = labelId;\n }\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const modalRefCallback = useMultipleRefs(ref, modalRef);\n\n const isPaddingsDisableAllowed =\n !title &&\n !headerImageUrl &&\n !headerImage &&\n !titleDescription &&\n !footer &&\n !options &&\n !actionLink &&\n !actions;\n const isVerticalPaddingsDisabled = disableVerticalPaddings && isPaddingsDisableAllowed;\n const isHorizontalPaddingsDisabled = disableHorizontalPaddings && isPaddingsDisableAllowed;\n const onEntering = useCallback(() => {\n if (!enableScrollRef.current) {\n enableScrollRef.current = disableScroll();\n }\n if (modalRef.current && !modalRef.current.contains(document.activeElement)) {\n modalRef.current.focus();\n }\n }, []);\n\n const onEntered = useCallback(() => {\n onAppear?.();\n }, [onAppear]);\n\n const onExit = useCallback(() => {\n onBeforeExitRef.current?.();\n }, []);\n const onExited = useCallback(() => {\n // оставляем обработку скрола еще и тут\n // чтобы обработать историю со сменой breakpoint\n enableScrollRef.current?.();\n enableScrollRef.current = undefined;\n onAfterExitRef.current?.();\n }, []);\n\n useModalOrder(!!visible && !isServerEnv, modalRef);\n\n const { breakpoint } = useBreakpoint();\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);\n if (!currentBreakpointVisible) {\n onExit();\n onExited();\n return;\n }\n\n onEntering();\n // visible не должно быть в зависимостях, т.к. этот эффект обрабатывает только изменение брейкпоинта\n // visible обрабатывается CSSTransition\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [breakpoint, onEntering, onExited, onExit]);\n\n useEffect(\n () => () => {\n enableScrollRef.current?.(animationTimeoutExitRef.current);\n enableScrollRef.current = undefined;\n },\n [visible]\n );\n\n useLayoutEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n setAnimationTimeout({\n enter: toNumber(style.getPropertyValue('--enter-animation-duration')),\n exit: toNumber(style.getPropertyValue('--exit-animation-duration')),\n });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (!closeByClickOutside || modalRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n onClose(event);\n },\n });\n\n if (INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint) || isServerEnv) {\n return null;\n }\n\n const modalHeaderProps = {\n title,\n titleElement,\n titleAlignment,\n titleSize,\n titleMaxLines,\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n headerImageUrl,\n headerImage,\n headerHeight,\n options,\n actions,\n actionLink,\n } as ModalHeaderProps;\n\n const isTreeSelectorChild = isValidTreeSelectorWrapper(children);\n // если есть progress bar, нужно скрыть divider (но showProgress - это слот под reactNode)\n const isActionBarHaveProgressBar =\n !!footer &&\n isActionBarComponent(footer) &&\n Boolean(footer.props.showProgress) &&\n isProgressBarComponent(footer.props.showProgress);\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"modal\">\n <div\n {...overlayEventHandlers}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, themeClass, {\n [styles.overlayLeft]: position === 'left',\n [styles.overlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <div\n {...rest}\n {...additionalProps}\n role=\"dialog\"\n className={classnames(styles.modal, {\n [styles.sizeSmall]: size === 'small',\n [styles.sizeMedium]: size === 'medium',\n [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,\n [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,\n [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,\n })}\n ref={modalRefCallback}\n tabIndex={0}\n style={{\n height: typeof height === 'number' ? `${height}px` : undefined,\n minHeight:\n typeof minHeight === 'number'\n ? `min(calc(100vh - 12px * 2), ${minHeight}px)`\n : undefined,\n }}\n >\n <ModalContentWithHeader\n {...modalHeaderProps}\n labelId={labelId}\n isTreeSelectorChild={isTreeSelectorChild}\n height={height}\n showDivider={!isActionBarHaveProgressBar}\n >\n {children}\n </ModalContentWithHeader>\n {!!footer && (\n <div className={styles.modalFooter} data-qa=\"modal-footer\">\n {isActionBarComponent(footer)\n ? cloneElement(footer, {\n type: footer.props.type || 'auto',\n padding: footer.props.padding || DEFAULT_ACTION_BAR_PADDING,\n showDivider: false,\n })\n : footer}\n </div>\n )}\n </div>\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n </CSSTransition>,\n host || document.body\n );\n }\n);\n\nModal.displayName = 'Modal';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;AAChB,IAAA,MAAM,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC,oBAAoB;QACnC,YAAY,EAAE,MAAM,CAAC,0BAA0B;QAC/C,KAAK,EAAE,MAAM,CAAC,oBAAoB;QAClC,WAAW,EAAE,MAAM,CAAC,0BAA0B;QAC9C,IAAI,EAAE,MAAM,CAAC,mBAAmB;QAChC,UAAU,EAAE,MAAM,CAAC,yBAAyB;AAC/C,KAAA;AACD,IAAA,IAAI,EAAE;QACF,MAAM,EAAE,MAAM,CAAC,kBAAkB;QACjC,YAAY,EAAE,MAAM,CAAC,wBAAwB;QAC7C,KAAK,EAAE,MAAM,CAAC,kBAAkB;QAChC,WAAW,EAAE,MAAM,CAAC,wBAAwB;QAC5C,IAAI,EAAE,MAAM,CAAC,iBAAiB;QAC9B,UAAU,EAAE,MAAM,CAAC,uBAAuB;AAC7C,KAAA;AACD,IAAA,KAAK,EAAE;QACH,MAAM,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,IAAI,IAAI,MAAM;AACjC,wCAAA,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,0BAA0B;AAC3D,wCAAA,WAAW,EAAE,KAAK;qCACrB,CAAC;AACJ,sCAAE,MAAM,EAAA,CACV,CACT,CAAA,EAAA,CACC,GACJ,EACF,CAAA,CACX,EACU,CAAA,EAAA,CACH,EAChB,IAAI,IAAI,QAAQ,CAAC,IAAI,CACxB,CAAC;AACN,CAAC,EACH;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
@@ -7,7 +7,7 @@ import { Divider } from '@hh.ru/magritte-ui-divider';
7
7
  import { ModalHeader } from './ModalHeader.js';
8
8
  import { TextAreaGrowLimiter } from '@hh.ru/magritte-ui-textarea';
9
9
 
10
- var styles = {"modal-overlay":"magritte-modal-overlay___lK22l_9-0-14","modalOverlay":"magritte-modal-overlay___lK22l_9-0-14","overlay-left":"magritte-overlay-left___JtHK4_9-0-14","overlayLeft":"magritte-overlay-left___JtHK4_9-0-14","overlay-right":"magritte-overlay-right___uKTDt_9-0-14","overlayRight":"magritte-overlay-right___uKTDt_9-0-14","modal":"magritte-modal___RAW6S_9-0-14","size-small":"magritte-size-small___2JTM2_9-0-14","sizeSmall":"magritte-size-small___2JTM2_9-0-14","size-medium":"magritte-size-medium___cWCe7_9-0-14","sizeMedium":"magritte-size-medium___cWCe7_9-0-14","no-vertical-paddings":"magritte-no-vertical-paddings___Z3-oM_9-0-14","noVerticalPaddings":"magritte-no-vertical-paddings___Z3-oM_9-0-14","no-horizontal-paddings":"magritte-no-horizontal-paddings___aT95Y_9-0-14","noHorizontalPaddings":"magritte-no-horizontal-paddings___aT95Y_9-0-14","modal-full-height":"magritte-modal-full-height___gIM4E_9-0-14","modalFullHeight":"magritte-modal-full-height___gIM4E_9-0-14","modal-content":"magritte-modal-content___46QFS_9-0-14","modalContent":"magritte-modal-content___46QFS_9-0-14","modal-content-wrapper":"magritte-modal-content-wrapper___23XFT_9-0-14","modalContentWrapper":"magritte-modal-content-wrapper___23XFT_9-0-14","modal-content-wrapper__one-line":"magritte-modal-content-wrapper__one-line___tYg8d_9-0-14","modalContentWrapperOneLine":"magritte-modal-content-wrapper__one-line___tYg8d_9-0-14","content-sticky-container":"magritte-content-sticky-container___nqEXj_9-0-14","contentStickyContainer":"magritte-content-sticky-container___nqEXj_9-0-14","divider-container":"magritte-divider-container___qP3VK_9-0-14","dividerContainer":"magritte-divider-container___qP3VK_9-0-14","divider-container-hidden":"magritte-divider-container-hidden___EIxB-_9-0-14","dividerContainerHidden":"magritte-divider-container-hidden___EIxB-_9-0-14","modal-footer":"magritte-modal-footer___8xPqQ_9-0-14","modalFooter":"magritte-modal-footer___8xPqQ_9-0-14","modal-buttons-container":"magritte-modal-buttons-container___1O1Nr_9-0-14","modalButtonsContainer":"magritte-modal-buttons-container___1O1Nr_9-0-14","animation-timeout":"magritte-animation-timeout___w-j7K_9-0-14","animationTimeout":"magritte-animation-timeout___w-j7K_9-0-14","animation-enter-center":"magritte-animation-enter-center___7jogC_9-0-14","animationEnterCenter":"magritte-animation-enter-center___7jogC_9-0-14","animation-enter-center-active":"magritte-animation-enter-center-active___fywwW_9-0-14","animationEnterCenterActive":"magritte-animation-enter-center-active___fywwW_9-0-14","animation-exit-center":"magritte-animation-exit-center___3Fa6x_9-0-14","animationExitCenter":"magritte-animation-exit-center___3Fa6x_9-0-14","animation-exit-center-active":"magritte-animation-exit-center-active___tY0UA_9-0-14","animationExitCenterActive":"magritte-animation-exit-center-active___tY0UA_9-0-14","animation-enter-left":"magritte-animation-enter-left___5YB8B_9-0-14","animationEnterLeft":"magritte-animation-enter-left___5YB8B_9-0-14","animation-enter-left-active":"magritte-animation-enter-left-active___5GK8s_9-0-14","animationEnterLeftActive":"magritte-animation-enter-left-active___5GK8s_9-0-14","animation-exit-left":"magritte-animation-exit-left___OnkQE_9-0-14","animationExitLeft":"magritte-animation-exit-left___OnkQE_9-0-14","animation-exit-left-active":"magritte-animation-exit-left-active___AEGxY_9-0-14","animationExitLeftActive":"magritte-animation-exit-left-active___AEGxY_9-0-14","animation-enter-right":"magritte-animation-enter-right___2aXOm_9-0-14","animationEnterRight":"magritte-animation-enter-right___2aXOm_9-0-14","animation-enter-right-active":"magritte-animation-enter-right-active___8wX4-_9-0-14","animationEnterRightActive":"magritte-animation-enter-right-active___8wX4-_9-0-14","animation-exit-right":"magritte-animation-exit-right___iczoc_9-0-14","animationExitRight":"magritte-animation-exit-right___iczoc_9-0-14","animation-exit-right-active":"magritte-animation-exit-right-active___eFS4O_9-0-14","animationExitRightActive":"magritte-animation-exit-right-active___eFS4O_9-0-14","content-scroll-preserver":"magritte-content-scroll-preserver___Tw5Px_9-0-14","contentScrollPreserver":"magritte-content-scroll-preserver___Tw5Px_9-0-14","content-container":"magritte-content-container___-ql3h_9-0-14","contentContainer":"magritte-content-container___-ql3h_9-0-14","content-sticky-container_full-height":"magritte-content-sticky-container_full-height___Gl9x8_9-0-14","contentStickyContainerFullHeight":"magritte-content-sticky-container_full-height___Gl9x8_9-0-14"};
10
+ var styles = {"modal-overlay":"magritte-modal-overlay___lK22l_9-1-1","modalOverlay":"magritte-modal-overlay___lK22l_9-1-1","overlay-left":"magritte-overlay-left___JtHK4_9-1-1","overlayLeft":"magritte-overlay-left___JtHK4_9-1-1","overlay-right":"magritte-overlay-right___uKTDt_9-1-1","overlayRight":"magritte-overlay-right___uKTDt_9-1-1","modal":"magritte-modal___RAW6S_9-1-1","size-small":"magritte-size-small___2JTM2_9-1-1","sizeSmall":"magritte-size-small___2JTM2_9-1-1","size-medium":"magritte-size-medium___cWCe7_9-1-1","sizeMedium":"magritte-size-medium___cWCe7_9-1-1","no-vertical-paddings":"magritte-no-vertical-paddings___Z3-oM_9-1-1","noVerticalPaddings":"magritte-no-vertical-paddings___Z3-oM_9-1-1","no-horizontal-paddings":"magritte-no-horizontal-paddings___aT95Y_9-1-1","noHorizontalPaddings":"magritte-no-horizontal-paddings___aT95Y_9-1-1","modal-full-height":"magritte-modal-full-height___gIM4E_9-1-1","modalFullHeight":"magritte-modal-full-height___gIM4E_9-1-1","modal-content":"magritte-modal-content___46QFS_9-1-1","modalContent":"magritte-modal-content___46QFS_9-1-1","modal-content-wrapper":"magritte-modal-content-wrapper___23XFT_9-1-1","modalContentWrapper":"magritte-modal-content-wrapper___23XFT_9-1-1","modal-content-wrapper__one-line":"magritte-modal-content-wrapper__one-line___tYg8d_9-1-1","modalContentWrapperOneLine":"magritte-modal-content-wrapper__one-line___tYg8d_9-1-1","content-sticky-container":"magritte-content-sticky-container___nqEXj_9-1-1","contentStickyContainer":"magritte-content-sticky-container___nqEXj_9-1-1","divider-container":"magritte-divider-container___qP3VK_9-1-1","dividerContainer":"magritte-divider-container___qP3VK_9-1-1","divider-container-hidden":"magritte-divider-container-hidden___EIxB-_9-1-1","dividerContainerHidden":"magritte-divider-container-hidden___EIxB-_9-1-1","modal-footer":"magritte-modal-footer___8xPqQ_9-1-1","modalFooter":"magritte-modal-footer___8xPqQ_9-1-1","modal-buttons-container":"magritte-modal-buttons-container___1O1Nr_9-1-1","modalButtonsContainer":"magritte-modal-buttons-container___1O1Nr_9-1-1","animation-timeout":"magritte-animation-timeout___w-j7K_9-1-1","animationTimeout":"magritte-animation-timeout___w-j7K_9-1-1","animation-enter-center":"magritte-animation-enter-center___7jogC_9-1-1","animationEnterCenter":"magritte-animation-enter-center___7jogC_9-1-1","animation-enter-center-active":"magritte-animation-enter-center-active___fywwW_9-1-1","animationEnterCenterActive":"magritte-animation-enter-center-active___fywwW_9-1-1","animation-exit-center":"magritte-animation-exit-center___3Fa6x_9-1-1","animationExitCenter":"magritte-animation-exit-center___3Fa6x_9-1-1","animation-exit-center-active":"magritte-animation-exit-center-active___tY0UA_9-1-1","animationExitCenterActive":"magritte-animation-exit-center-active___tY0UA_9-1-1","animation-enter-left":"magritte-animation-enter-left___5YB8B_9-1-1","animationEnterLeft":"magritte-animation-enter-left___5YB8B_9-1-1","animation-enter-left-active":"magritte-animation-enter-left-active___5GK8s_9-1-1","animationEnterLeftActive":"magritte-animation-enter-left-active___5GK8s_9-1-1","animation-exit-left":"magritte-animation-exit-left___OnkQE_9-1-1","animationExitLeft":"magritte-animation-exit-left___OnkQE_9-1-1","animation-exit-left-active":"magritte-animation-exit-left-active___AEGxY_9-1-1","animationExitLeftActive":"magritte-animation-exit-left-active___AEGxY_9-1-1","animation-enter-right":"magritte-animation-enter-right___2aXOm_9-1-1","animationEnterRight":"magritte-animation-enter-right___2aXOm_9-1-1","animation-enter-right-active":"magritte-animation-enter-right-active___8wX4-_9-1-1","animationEnterRightActive":"magritte-animation-enter-right-active___8wX4-_9-1-1","animation-exit-right":"magritte-animation-exit-right___iczoc_9-1-1","animationExitRight":"magritte-animation-exit-right___iczoc_9-1-1","animation-exit-right-active":"magritte-animation-exit-right-active___eFS4O_9-1-1","animationExitRightActive":"magritte-animation-exit-right-active___eFS4O_9-1-1","content-scroll-preserver":"magritte-content-scroll-preserver___Tw5Px_9-1-1","contentScrollPreserver":"magritte-content-scroll-preserver___Tw5Px_9-1-1","content-container":"magritte-content-container___-ql3h_9-1-1","contentContainer":"magritte-content-container___-ql3h_9-1-1","content-sticky-container_full-height":"magritte-content-sticky-container_full-height___Gl9x8_9-1-1","contentStickyContainerFullHeight":"magritte-content-sticky-container_full-height___Gl9x8_9-1-1"};
11
11
 
12
12
  const checkIsScrolledToBottom = (el) => {
13
13
  return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;
@@ -135,4 +135,4 @@ const ModalContentWithHeader = ({ labelId, children, headerHeight: _headerHeight
135
135
  };
136
136
 
137
137
  export { ModalContentWithHeader as M, styles as s };
138
- //# sourceMappingURL=ModalContentWithHeader-Br1tEslM.js.map
138
+ //# sourceMappingURL=ModalContentWithHeader-8j0k2tmL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalContentWithHeader-Br1tEslM.js","sources":["../src/ModalContentWithHeader.tsx"],"sourcesContent":["import { FC, PropsWithChildren, useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { requestAnimation } from '@hh.ru/magritte-common-func-utils';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport { ModalHeader } from '@hh.ru/magritte-ui-modal/ModalHeader';\nimport { ModalHeaderProps, ModalHeight } from '@hh.ru/magritte-ui-modal/types';\nimport { TextAreaGrowLimiter } from '@hh.ru/magritte-ui-textarea';\n\nimport styles from './modal.less';\n\nconst checkIsScrolledToBottom = (el: HTMLElement) => {\n return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n// Минимальная высота до которой может сжаться хедер\nconst HEADER_SHRINK_MIN_HEIGHT = 148;\n// Минимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MIN_HEIGHT = 12;\n// Максимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MAX_HEIGHT = 24;\nconst HEADER_MARGIN_HEIGHT_DELTA = HEADER_MARGIN_MAX_HEIGHT - HEADER_MARGIN_MIN_HEIGHT;\n\n// Вычисляет минимальную высоту до которой может сжаться хедер с учетом высоты контента, чтобы не спровоцировать\n// изменение размера модалки\nconst calcHeaderShrinkLimit = (\n headerHeight: number,\n headerMaxHeight: number,\n contentHeight: number,\n contentScrollHeight: number,\n marginHeight: number\n) => {\n // Высота контента скрытого под скроллом когда хедер и марджин под ним имеет максимальную допустимую высоту\n const contentScrollDelta =\n contentScrollHeight - // Высота контента скрытого под скроллом в текущем состоянии\n contentHeight + // Высота контейнера содержащего контент\n (HEADER_MARGIN_MAX_HEIGHT - marginHeight) + // Дельта между текущей высотой марджина и максимальной допустимой\n (headerMaxHeight - headerHeight); // Дельта между текущей высотой хедера и максимальной допустимой\n\n const headerShrinkMinHeight = headerMaxHeight - (contentScrollDelta - HEADER_MARGIN_HEIGHT_DELTA);\n\n return Math.max(headerShrinkMinHeight, HEADER_SHRINK_MIN_HEIGHT);\n};\n\nconst shrinkByDelta = (\n headerImageContainer: HTMLDivElement | null,\n headerWrapper: HTMLDivElement | null,\n headerMinHeight: number,\n headerMaxHeight: number,\n scrollDeltaY: number\n) => {\n if (!headerImageContainer || !headerWrapper) {\n return;\n }\n\n const marginHeight = clamp(\n HEADER_MARGIN_MAX_HEIGHT - scrollDeltaY,\n HEADER_MARGIN_MIN_HEIGHT,\n HEADER_MARGIN_MAX_HEIGHT\n );\n headerWrapper.style.marginBottom = `${marginHeight}px`;\n\n const headerHeight = clamp(\n // Тут прибаляем дельту марджина потому что сначала должен сжаться отступ\n Math.floor(headerMaxHeight - scrollDeltaY + HEADER_MARGIN_HEIGHT_DELTA),\n headerMinHeight,\n headerMaxHeight\n );\n headerImageContainer.style.height = `${headerHeight}px`;\n};\n\nexport const ModalContentWithHeader: FC<\n PropsWithChildren<\n ModalHeaderProps & { labelId: string; isTreeSelectorChild: boolean; height?: ModalHeight; showDivider: boolean }\n >\n> = ({\n labelId,\n children,\n headerHeight: _headerHeight = 0,\n isTreeSelectorChild,\n height,\n showDivider = true,\n ...modalHeaderProps\n}) => {\n const { title, headerImageUrl, headerImage, actions, actionLink, options } = modalHeaderProps;\n\n const bottomDividerVisibleRef = useRef(false);\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const headerImageContainerRef = useRef<HTMLDivElement>(null);\n const headerWrapperRef = useRef<HTMLDivElement>(null);\n const spacePreserverRef = useRef<HTMLDivElement>(null);\n const stickyContainerRef = useRef<HTMLDivElement>(null);\n const hasHeaderImageRef = useRef(!!headerImageUrl || !!headerImage);\n hasHeaderImageRef.current = !!headerImageUrl || !!headerImage;\n const headerHeightRef = useRef(0);\n headerHeightRef.current = hasHeaderImageRef.current ? Math.max(_headerHeight, 200) : 0;\n const minHeaderHeightRef = useRef(0);\n\n const bottomDividerContainerRef = useRef<HTMLDivElement>(null);\n const topDividerContainerRef = useRef<HTMLDivElement>(null);\n\n const withoutHeader = !title && !hasHeaderImageRef.current && !actions && !actionLink && !options;\n const onlyActions = !title && !hasHeaderImageRef.current && !options && (actions || actionLink);\n\n const [growLimiterContextValue, _] = useState(() => ({\n containerRef: contentContainerRef,\n }));\n\n const isTopDividerVisible = () => {\n if (!contentContainerRef.current) {\n return false;\n }\n\n const topDividerVisible = hasHeaderImageRef.current\n ? contentContainerRef.current.scrollTop >\n headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA\n : contentContainerRef.current.scrollTop !== 0;\n\n return topDividerVisible && (options || !hasHeaderImageRef.current) && !onlyActions && !withoutHeader;\n };\n\n const updateHeaderDimensions = useCallback(() => {\n if (\n !headerImageContainerRef.current ||\n !headerWrapperRef.current ||\n !stickyContainerRef.current ||\n !spacePreserverRef.current ||\n !contentContainerRef.current\n ) {\n return;\n }\n\n if (!hasHeaderImageRef.current) {\n spacePreserverRef.current.style.height = '0';\n return;\n }\n\n minHeaderHeightRef.current = calcHeaderShrinkLimit(\n headerImageContainerRef.current.clientHeight,\n headerHeightRef.current,\n contentContainerRef.current.clientHeight,\n stickyContainerRef.current.scrollHeight,\n parseInt(headerWrapperRef.current.style.marginBottom || '0', 10)\n );\n\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n const preserverSize = headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA;\n spacePreserverRef.current.style.height = `${preserverSize}px`;\n }, []);\n\n useLayoutEffect(() => {\n if (contentContainerRef.current) {\n const observer = new ResizeObserver(\n requestAnimation(() => {\n if (!contentContainerRef.current) {\n return;\n }\n const isScrollable =\n contentContainerRef.current.scrollHeight > contentContainerRef.current.clientHeight;\n const hasScroll = isScrollable && !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerVisibleRef.current = hasScroll;\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n updateHeaderDimensions();\n })\n );\n observer.observe(contentContainerRef.current);\n return () => observer.disconnect();\n }\n\n return undefined;\n }, [updateHeaderDimensions]);\n\n useLayoutEffect(() => {\n updateHeaderDimensions();\n if (!options && (headerImageUrl || headerImage)) {\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, true);\n }\n }, [headerImageUrl, headerImage, updateHeaderDimensions, options]);\n\n const handleScroll = () => {\n if (!contentContainerRef.current) {\n return;\n }\n\n bottomDividerVisibleRef.current = !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, !isTopDividerVisible());\n if (hasHeaderImageRef.current) {\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n }\n };\n\n return (\n <>\n <div\n className={classnames(styles.modalContentWrapper, {\n [styles.modalContentWrapperOneLine]: onlyActions,\n })}\n >\n <ModalHeader\n {...modalHeaderProps}\n headerHeight={headerHeightRef.current}\n labelId={labelId}\n wrapperRef={headerWrapperRef}\n ref={headerImageContainerRef}\n />\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !isTopDividerVisible(),\n })}\n ref={topDividerContainerRef}\n >\n <Divider />\n </div>\n <div\n className={classnames(styles.modalContent)}\n ref={contentContainerRef}\n onScroll={handleScroll}\n data-qa=\"modal-content-scroll-container\"\n >\n {isTreeSelectorChild ? (\n <div className={styles.contentContainer}>{children}</div>\n ) : (\n <>\n <div\n className={classnames(styles.contentStickyContainer, {\n [styles.contentStickyContainerFullHeight]: height === 'full-screen',\n })}\n ref={stickyContainerRef}\n >\n <TextAreaGrowLimiter {...growLimiterContextValue}>{children}</TextAreaGrowLimiter>\n </div>\n <div ref={spacePreserverRef} />\n </>\n )}\n </div>\n </div>\n {showDivider && (\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !bottomDividerVisibleRef.current,\n })}\n ref={bottomDividerContainerRef}\n >\n <Divider />\n </div>\n )}\n </>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;AAWA,MAAM,uBAAuB,GAAG,CAAC,EAAe,KAAI;AAChD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAE/F;AACA,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,0BAA0B,GAAG,wBAAwB,GAAG,wBAAwB,CAAC;AAEvF;AACA;AACA,MAAM,qBAAqB,GAAG,CAC1B,YAAoB,EACpB,eAAuB,EACvB,aAAqB,EACrB,mBAA2B,EAC3B,YAAoB,KACpB;;AAEA,IAAA,MAAM,kBAAkB,GACpB,mBAAmB;AACnB,QAAA,aAAa;AACb,SAAC,wBAAwB,GAAG,YAAY,CAAC;AACzC,SAAC,eAAe,GAAG,YAAY,CAAC,CAAC;IAErC,MAAM,qBAAqB,GAAG,eAAe,IAAI,kBAAkB,GAAG,0BAA0B,CAAC,CAAC;IAElG,OAAO,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,oBAA2C,EAC3C,aAAoC,EACpC,eAAuB,EACvB,eAAuB,EACvB,YAAoB,KACpB;AACA,IAAA,IAAI,CAAC,oBAA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AAA,EAAA,EACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,EAC1C,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,YAAY,EACd,SAAA,EAAA,gCAAgC,YAEvC,mBAAmB,IAChBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,KAEzDF,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,sBAAsB,EAAE;AACjD,wCAAA,CAAC,MAAM,CAAC,gCAAgC,GAAG,MAAM,KAAK,aAAa;AACtE,qCAAA,CAAC,EACF,GAAG,EAAE,kBAAkB,YAEvBA,GAAC,CAAA,mBAAmB,EAAK,EAAA,GAAA,uBAAuB,YAAG,QAAQ,EAAA,CAAuB,EAChF,CAAA,EACNA,aAAK,GAAG,EAAE,iBAAiB,EAAA,CAAI,IAChC,CACN,EAAA,CACC,CACJ,EAAA,CAAA,EACL,WAAW,KACRA,GACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,EAAE;oBAC3C,CAAC,MAAM,CAAC,sBAAsB,GAAG,CAAC,uBAAuB,CAAC,OAAO;AACpE,iBAAA,CAAC,EACF,GAAG,EAAE,yBAAyB,EAE9B,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAA,CAAG,EACT,CAAA,CACT,CACF,EAAA,CAAA,EACL;AACN;;;;"}
1
+ {"version":3,"file":"ModalContentWithHeader-8j0k2tmL.js","sources":["../src/ModalContentWithHeader.tsx"],"sourcesContent":["import { FC, PropsWithChildren, useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { requestAnimation } from '@hh.ru/magritte-common-func-utils';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport { ModalHeader } from '@hh.ru/magritte-ui-modal/ModalHeader';\nimport { ModalHeaderProps, ModalHeight } from '@hh.ru/magritte-ui-modal/types';\nimport { TextAreaGrowLimiter } from '@hh.ru/magritte-ui-textarea';\n\nimport styles from './modal.less';\n\nconst checkIsScrolledToBottom = (el: HTMLElement) => {\n return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n// Минимальная высота до которой может сжаться хедер\nconst HEADER_SHRINK_MIN_HEIGHT = 148;\n// Минимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MIN_HEIGHT = 12;\n// Максимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MAX_HEIGHT = 24;\nconst HEADER_MARGIN_HEIGHT_DELTA = HEADER_MARGIN_MAX_HEIGHT - HEADER_MARGIN_MIN_HEIGHT;\n\n// Вычисляет минимальную высоту до которой может сжаться хедер с учетом высоты контента, чтобы не спровоцировать\n// изменение размера модалки\nconst calcHeaderShrinkLimit = (\n headerHeight: number,\n headerMaxHeight: number,\n contentHeight: number,\n contentScrollHeight: number,\n marginHeight: number\n) => {\n // Высота контента скрытого под скроллом когда хедер и марджин под ним имеет максимальную допустимую высоту\n const contentScrollDelta =\n contentScrollHeight - // Высота контента скрытого под скроллом в текущем состоянии\n contentHeight + // Высота контейнера содержащего контент\n (HEADER_MARGIN_MAX_HEIGHT - marginHeight) + // Дельта между текущей высотой марджина и максимальной допустимой\n (headerMaxHeight - headerHeight); // Дельта между текущей высотой хедера и максимальной допустимой\n\n const headerShrinkMinHeight = headerMaxHeight - (contentScrollDelta - HEADER_MARGIN_HEIGHT_DELTA);\n\n return Math.max(headerShrinkMinHeight, HEADER_SHRINK_MIN_HEIGHT);\n};\n\nconst shrinkByDelta = (\n headerImageContainer: HTMLDivElement | null,\n headerWrapper: HTMLDivElement | null,\n headerMinHeight: number,\n headerMaxHeight: number,\n scrollDeltaY: number\n) => {\n if (!headerImageContainer || !headerWrapper) {\n return;\n }\n\n const marginHeight = clamp(\n HEADER_MARGIN_MAX_HEIGHT - scrollDeltaY,\n HEADER_MARGIN_MIN_HEIGHT,\n HEADER_MARGIN_MAX_HEIGHT\n );\n headerWrapper.style.marginBottom = `${marginHeight}px`;\n\n const headerHeight = clamp(\n // Тут прибаляем дельту марджина потому что сначала должен сжаться отступ\n Math.floor(headerMaxHeight - scrollDeltaY + HEADER_MARGIN_HEIGHT_DELTA),\n headerMinHeight,\n headerMaxHeight\n );\n headerImageContainer.style.height = `${headerHeight}px`;\n};\n\nexport const ModalContentWithHeader: FC<\n PropsWithChildren<\n ModalHeaderProps & { labelId: string; isTreeSelectorChild: boolean; height?: ModalHeight; showDivider: boolean }\n >\n> = ({\n labelId,\n children,\n headerHeight: _headerHeight = 0,\n isTreeSelectorChild,\n height,\n showDivider = true,\n ...modalHeaderProps\n}) => {\n const { title, headerImageUrl, headerImage, actions, actionLink, options } = modalHeaderProps;\n\n const bottomDividerVisibleRef = useRef(false);\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const headerImageContainerRef = useRef<HTMLDivElement>(null);\n const headerWrapperRef = useRef<HTMLDivElement>(null);\n const spacePreserverRef = useRef<HTMLDivElement>(null);\n const stickyContainerRef = useRef<HTMLDivElement>(null);\n const hasHeaderImageRef = useRef(!!headerImageUrl || !!headerImage);\n hasHeaderImageRef.current = !!headerImageUrl || !!headerImage;\n const headerHeightRef = useRef(0);\n headerHeightRef.current = hasHeaderImageRef.current ? Math.max(_headerHeight, 200) : 0;\n const minHeaderHeightRef = useRef(0);\n\n const bottomDividerContainerRef = useRef<HTMLDivElement>(null);\n const topDividerContainerRef = useRef<HTMLDivElement>(null);\n\n const withoutHeader = !title && !hasHeaderImageRef.current && !actions && !actionLink && !options;\n const onlyActions = !title && !hasHeaderImageRef.current && !options && (actions || actionLink);\n\n const [growLimiterContextValue, _] = useState(() => ({\n containerRef: contentContainerRef,\n }));\n\n const isTopDividerVisible = () => {\n if (!contentContainerRef.current) {\n return false;\n }\n\n const topDividerVisible = hasHeaderImageRef.current\n ? contentContainerRef.current.scrollTop >\n headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA\n : contentContainerRef.current.scrollTop !== 0;\n\n return topDividerVisible && (options || !hasHeaderImageRef.current) && !onlyActions && !withoutHeader;\n };\n\n const updateHeaderDimensions = useCallback(() => {\n if (\n !headerImageContainerRef.current ||\n !headerWrapperRef.current ||\n !stickyContainerRef.current ||\n !spacePreserverRef.current ||\n !contentContainerRef.current\n ) {\n return;\n }\n\n if (!hasHeaderImageRef.current) {\n spacePreserverRef.current.style.height = '0';\n return;\n }\n\n minHeaderHeightRef.current = calcHeaderShrinkLimit(\n headerImageContainerRef.current.clientHeight,\n headerHeightRef.current,\n contentContainerRef.current.clientHeight,\n stickyContainerRef.current.scrollHeight,\n parseInt(headerWrapperRef.current.style.marginBottom || '0', 10)\n );\n\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n const preserverSize = headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA;\n spacePreserverRef.current.style.height = `${preserverSize}px`;\n }, []);\n\n useLayoutEffect(() => {\n if (contentContainerRef.current) {\n const observer = new ResizeObserver(\n requestAnimation(() => {\n if (!contentContainerRef.current) {\n return;\n }\n const isScrollable =\n contentContainerRef.current.scrollHeight > contentContainerRef.current.clientHeight;\n const hasScroll = isScrollable && !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerVisibleRef.current = hasScroll;\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n updateHeaderDimensions();\n })\n );\n observer.observe(contentContainerRef.current);\n return () => observer.disconnect();\n }\n\n return undefined;\n }, [updateHeaderDimensions]);\n\n useLayoutEffect(() => {\n updateHeaderDimensions();\n if (!options && (headerImageUrl || headerImage)) {\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, true);\n }\n }, [headerImageUrl, headerImage, updateHeaderDimensions, options]);\n\n const handleScroll = () => {\n if (!contentContainerRef.current) {\n return;\n }\n\n bottomDividerVisibleRef.current = !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, !isTopDividerVisible());\n if (hasHeaderImageRef.current) {\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n }\n };\n\n return (\n <>\n <div\n className={classnames(styles.modalContentWrapper, {\n [styles.modalContentWrapperOneLine]: onlyActions,\n })}\n >\n <ModalHeader\n {...modalHeaderProps}\n headerHeight={headerHeightRef.current}\n labelId={labelId}\n wrapperRef={headerWrapperRef}\n ref={headerImageContainerRef}\n />\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !isTopDividerVisible(),\n })}\n ref={topDividerContainerRef}\n >\n <Divider />\n </div>\n <div\n className={classnames(styles.modalContent)}\n ref={contentContainerRef}\n onScroll={handleScroll}\n data-qa=\"modal-content-scroll-container\"\n >\n {isTreeSelectorChild ? (\n <div className={styles.contentContainer}>{children}</div>\n ) : (\n <>\n <div\n className={classnames(styles.contentStickyContainer, {\n [styles.contentStickyContainerFullHeight]: height === 'full-screen',\n })}\n ref={stickyContainerRef}\n >\n <TextAreaGrowLimiter {...growLimiterContextValue}>{children}</TextAreaGrowLimiter>\n </div>\n <div ref={spacePreserverRef} />\n </>\n )}\n </div>\n </div>\n {showDivider && (\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !bottomDividerVisibleRef.current,\n })}\n ref={bottomDividerContainerRef}\n >\n <Divider />\n </div>\n )}\n </>\n );\n};\n"],"names":["_jsxs","_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,EACd,SAAA,EAAA,gCAAgC,YAEvC,mBAAmB,IAChBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,KAEzDF,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,sBAAsB,EAAE;AACjD,wCAAA,CAAC,MAAM,CAAC,gCAAgC,GAAG,MAAM,KAAK,aAAa;AACtE,qCAAA,CAAC,EACF,GAAG,EAAE,kBAAkB,YAEvBA,GAAC,CAAA,mBAAmB,EAAK,EAAA,GAAA,uBAAuB,YAAG,QAAQ,EAAA,CAAuB,EAChF,CAAA,EACNA,aAAK,GAAG,EAAE,iBAAiB,EAAA,CAAI,IAChC,CACN,EAAA,CACC,CACJ,EAAA,CAAA,EACL,WAAW,KACRA,GACI,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,EAAE;oBAC3C,CAAC,MAAM,CAAC,sBAAsB,GAAG,CAAC,uBAAuB,CAAC,OAAO;AACpE,iBAAA,CAAC,EACF,GAAG,EAAE,yBAAyB,EAE9B,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAA,CAAG,EACT,CAAA,CACT,CACF,EAAA,CAAA,EACL;AACN;;;;"}
@@ -6,7 +6,7 @@ import '@hh.ru/magritte-common-func-utils';
6
6
  import '@hh.ru/magritte-ui-divider';
7
7
  import './ModalHeader.js';
8
8
  import '@hh.ru/magritte-ui-textarea';
9
- export { M as ModalContentWithHeader } from './ModalContentWithHeader-Br1tEslM.js';
9
+ export { M as ModalContentWithHeader } from './ModalContentWithHeader-8j0k2tmL.js';
10
10
  import '@hh.ru/magritte-ui-icon';
11
11
  import '@hh.ru/magritte-ui-title';
12
12
  //# sourceMappingURL=ModalContentWithHeader.js.map
package/ModalHeader.js CHANGED
@@ -5,7 +5,7 @@ import classnames from 'classnames';
5
5
  import { isIconElement } from '@hh.ru/magritte-ui-icon';
6
6
  import { Title } from '@hh.ru/magritte-ui-title';
7
7
 
8
- var styles = {"content":"magritte-content___o6ktq_9-0-14","options":"magritte-options___qfErQ_9-0-14","actions":"magritte-actions___nQILV_9-0-14","actions-with-link":"magritte-actions-with-link___hnDux_9-0-14","actionsWithLink":"magritte-actions-with-link___hnDux_9-0-14","content-with-image":"magritte-content-with-image___YarBO_9-0-14","contentWithImage":"magritte-content-with-image___YarBO_9-0-14","actions-single":"magritte-actions-single___usfKu_9-0-14","actionsSingle":"magritte-actions-single___usfKu_9-0-14","image-container":"magritte-image-container___ioL3y_9-0-14","imageContainer":"magritte-image-container___ioL3y_9-0-14","title-wrapper":"magritte-title-wrapper___O--QR_9-0-14","titleWrapper":"magritte-title-wrapper___O--QR_9-0-14","wrapper":"magritte-wrapper___zH8vB_9-0-14","only-actions":"magritte-only-actions___ZC4jx_9-0-14","onlyActions":"magritte-only-actions___ZC4jx_9-0-14"};
8
+ var styles = {"content":"magritte-content___o6ktq_9-1-1","options":"magritte-options___qfErQ_9-1-1","actions":"magritte-actions___nQILV_9-1-1","actions-with-link":"magritte-actions-with-link___hnDux_9-1-1","actionsWithLink":"magritte-actions-with-link___hnDux_9-1-1","content-with-image":"magritte-content-with-image___YarBO_9-1-1","contentWithImage":"magritte-content-with-image___YarBO_9-1-1","actions-single":"magritte-actions-single___usfKu_9-1-1","actionsSingle":"magritte-actions-single___usfKu_9-1-1","image-container":"magritte-image-container___ioL3y_9-1-1","imageContainer":"magritte-image-container___ioL3y_9-1-1","title-wrapper":"magritte-title-wrapper___O--QR_9-1-1","titleWrapper":"magritte-title-wrapper___O--QR_9-1-1","wrapper":"magritte-wrapper___zH8vB_9-1-1","only-actions":"magritte-only-actions___ZC4jx_9-1-1","onlyActions":"magritte-only-actions___ZC4jx_9-1-1"};
9
9
 
10
10
  const ModalHeader = forwardRef(({ title, headerImageUrl, headerImage, headerHeight, titleAlignment, titleElement, titleMaxLines, titleSize, titleDescription, titleDescriptionMaxLines, titleStyle, titleDescriptionStyle, options, actions: _actions, actionLink, labelId, wrapperRef, }, ref) => {
11
11
  const actions = Array.isArray(_actions) ? _actions.slice(0, 5) : _actions;
package/index.css CHANGED
@@ -1,30 +1,30 @@
1
1
  :root{
2
- --magritte-color-component-modal-background-action-v23-1-0:#20262b99;
3
- --magritte-gradient-component-modal-background-fade-v23-1-0:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
2
+ --magritte-color-component-modal-background-action-v23-2-1:#20262b99;
3
+ --magritte-gradient-component-modal-background-fade-v23-2-1:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
4
4
  }
5
5
 
6
6
  :root{
7
- --magritte-static-border-radius-300-v23-1-0:12px;
8
- --magritte-static-border-radius-400-v23-1-0:16px;
7
+ --magritte-static-border-radius-300-v23-2-1:12px;
8
+ --magritte-static-border-radius-400-v23-2-1:16px;
9
9
  }
10
10
 
11
11
  .magritte-night-theme{
12
- --magritte-color-component-modal-background-action-v23-1-0:#20262b99;
13
- --magritte-gradient-component-modal-background-fade-v23-1-0:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
12
+ --magritte-color-component-modal-background-action-v23-2-1:#20262b99;
13
+ --magritte-gradient-component-modal-background-fade-v23-2-1:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
14
14
  }
15
15
 
16
16
  .magritte-zp-day-theme{
17
- --magritte-color-component-modal-background-action-v23-1-0:#20262b99;
18
- --magritte-gradient-component-modal-background-fade-v23-1-0:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
17
+ --magritte-color-component-modal-background-action-v23-2-1:#20262b99;
18
+ --magritte-gradient-component-modal-background-fade-v23-2-1:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
19
19
  }
20
- .magritte-content___o6ktq_9-0-14{
20
+ .magritte-content___o6ktq_9-1-1{
21
21
  display:flex;
22
22
  align-items:flex-start;
23
23
  }
24
- .magritte-content___o6ktq_9-0-14 + .magritte-options___qfErQ_9-0-14{
24
+ .magritte-content___o6ktq_9-1-1 + .magritte-options___qfErQ_9-1-1{
25
25
  margin-top:24px;
26
26
  }
27
- .magritte-actions___nQILV_9-0-14{
27
+ .magritte-actions___nQILV_9-1-1{
28
28
  position:relative;
29
29
  z-index:1;
30
30
  display:flex;
@@ -33,79 +33,79 @@
33
33
  margin-left:auto;
34
34
  --magritte-ui-link-padding-override:9px;
35
35
  }
36
- .magritte-actions-with-link___hnDux_9-0-14{
36
+ .magritte-actions-with-link___hnDux_9-1-1{
37
37
  padding:0 8px 0 28px;
38
38
  }
39
- .magritte-content-with-image___YarBO_9-0-14{
39
+ .magritte-content-with-image___YarBO_9-1-1{
40
40
  position:relative;
41
41
  flex-direction:column;
42
42
  justify-content:flex-end;
43
43
  margin:-12px -12px 0;
44
- border-radius:var(--magritte-static-border-radius-400-v23-1-0);
44
+ border-radius:var(--magritte-static-border-radius-400-v23-2-1);
45
45
  overflow:hidden;
46
46
  padding:12px 24px 24px;
47
47
  box-sizing:border-box;
48
48
  }
49
- .magritte-content-with-image___YarBO_9-0-14 .magritte-actions___nQILV_9-0-14{
49
+ .magritte-content-with-image___YarBO_9-1-1 .magritte-actions___nQILV_9-1-1{
50
50
  order:-1;
51
51
  gap:0;
52
52
  margin-right:-16px;
53
53
  margin-top:-4px;
54
54
  margin-bottom:auto;
55
55
  }
56
- .magritte-content-with-image___YarBO_9-0-14 .magritte-actions___nQILV_9-0-14:not(.magritte-actions-with-link___hnDux_9-0-14){
56
+ .magritte-content-with-image___YarBO_9-1-1 .magritte-actions___nQILV_9-1-1:not(.magritte-actions-with-link___hnDux_9-1-1){
57
57
  padding:0 4px;
58
- background-color:var(--magritte-color-component-modal-background-action-v23-1-0);
59
- border-radius:var(--magritte-static-border-radius-300-v23-1-0);
58
+ background-color:var(--magritte-color-component-modal-background-action-v23-2-1);
59
+ border-radius:var(--magritte-static-border-radius-300-v23-2-1);
60
60
  }
61
- .magritte-content-with-image___YarBO_9-0-14 .magritte-actions___nQILV_9-0-14.magritte-actions-single___usfKu_9-0-14:not(.magritte-actions-with-link___hnDux_9-0-14){
61
+ .magritte-content-with-image___YarBO_9-1-1 .magritte-actions___nQILV_9-1-1.magritte-actions-single___usfKu_9-1-1:not(.magritte-actions-with-link___hnDux_9-1-1){
62
62
  padding:0;
63
63
  }
64
- .magritte-image-container___ioL3y_9-0-14{
64
+ .magritte-image-container___ioL3y_9-1-1{
65
65
  position:absolute;
66
66
  left:0;
67
67
  bottom:0;
68
68
  right:0;
69
69
  background-size:cover;
70
- --modal-header-gradient:var(--magritte-gradient-component-modal-background-fade-v23-1-0);
70
+ --modal-header-gradient:var(--magritte-gradient-component-modal-background-fade-v23-2-1);
71
71
  }
72
- .magritte-title-wrapper___O--QR_9-0-14{
72
+ .magritte-title-wrapper___O--QR_9-1-1{
73
73
  position:relative;
74
74
  width:100%;
75
75
  }
76
- .magritte-wrapper___zH8vB_9-0-14{
76
+ .magritte-wrapper___zH8vB_9-1-1{
77
77
  margin-bottom:24px;
78
78
  }
79
- .magritte-only-actions___ZC4jx_9-0-14 .magritte-actions___nQILV_9-0-14{
79
+ .magritte-only-actions___ZC4jx_9-1-1 .magritte-actions___nQILV_9-1-1{
80
80
  padding-left:0;
81
81
  }
82
- .magritte-only-actions___ZC4jx_9-0-14 .magritte-actions-with-link___hnDux_9-0-14{
82
+ .magritte-only-actions___ZC4jx_9-1-1 .magritte-actions-with-link___hnDux_9-1-1{
83
83
  padding-left:12px;
84
84
  }
85
85
 
86
86
  :root{
87
- --magritte-color-background-overlay-v23-1-0:#20262b99;
88
- --magritte-color-component-modal-background-content-v23-1-0:#ffffff;
87
+ --magritte-color-background-overlay-v23-2-1:#20262b99;
88
+ --magritte-color-component-modal-background-content-v23-2-1:#ffffff;
89
89
  }
90
90
 
91
91
  :root{
92
- --magritte-semantic-animation-ease-in-out-200-timing-function-v23-1-0:cubic-bezier(0.25, 0.1, 0.25, 1);
93
- --magritte-semantic-animation-ease-in-out-200-duration-v23-1-0:200ms;
94
- --magritte-semantic-animation-ease-in-out-300-timing-function-v23-1-0:cubic-bezier(0.25, 0.1, 0.25, 1);
95
- --magritte-semantic-animation-ease-in-out-300-duration-v23-1-0:300ms;
96
- --magritte-static-border-radius-600-v23-1-0:24px;
92
+ --magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-1:cubic-bezier(0.25, 0.1, 0.25, 1);
93
+ --magritte-semantic-animation-ease-in-out-200-duration-v23-2-1:200ms;
94
+ --magritte-semantic-animation-ease-in-out-300-timing-function-v23-2-1:cubic-bezier(0.25, 0.1, 0.25, 1);
95
+ --magritte-semantic-animation-ease-in-out-300-duration-v23-2-1:300ms;
96
+ --magritte-static-border-radius-600-v23-2-1:24px;
97
97
  }
98
98
 
99
99
  .magritte-night-theme{
100
- --magritte-color-background-overlay-v23-1-0:#20262b99;
101
- --magritte-color-component-modal-background-content-v23-1-0:#1B1B1B;
100
+ --magritte-color-background-overlay-v23-2-1:#20262b99;
101
+ --magritte-color-component-modal-background-content-v23-2-1:#1B1B1B;
102
102
  }
103
103
 
104
104
  .magritte-zp-day-theme{
105
- --magritte-color-background-overlay-v23-1-0:#20262b99;
106
- --magritte-color-component-modal-background-content-v23-1-0:#ffffff;
105
+ --magritte-color-background-overlay-v23-2-1:#20262b99;
106
+ --magritte-color-component-modal-background-content-v23-2-1:#ffffff;
107
107
  }
108
- .magritte-modal-overlay___lK22l_9-0-14{
108
+ .magritte-modal-overlay___lK22l_9-1-1{
109
109
  position:fixed;
110
110
  top:0;
111
111
  right:0;
@@ -114,18 +114,18 @@
114
114
  display:flex;
115
115
  align-items:center;
116
116
  justify-content:center;
117
- background-color:var(--magritte-color-background-overlay-v23-1-0);
117
+ background-color:var(--magritte-color-background-overlay-v23-2-1);
118
118
  z-index:1;
119
119
  user-select:text;
120
120
  transition-property:opacity, transform;
121
121
  }
122
- .magritte-overlay-left___JtHK4_9-0-14{
122
+ .magritte-overlay-left___JtHK4_9-1-1{
123
123
  justify-content:flex-start;
124
124
  }
125
- .magritte-overlay-right___uKTDt_9-0-14{
125
+ .magritte-overlay-right___uKTDt_9-1-1{
126
126
  justify-content:flex-end;
127
127
  }
128
- .magritte-modal___RAW6S_9-0-14{
128
+ .magritte-modal___RAW6S_9-1-1{
129
129
  display:flex;
130
130
  box-sizing:border-box;
131
131
  margin:0 12px;
@@ -134,31 +134,31 @@
134
134
  max-height:calc(100vh - 12px * 2);
135
135
  max-width:calc(100vw - 12px * 2);
136
136
  position:relative;
137
- background-color:var(--magritte-color-component-modal-background-content-v23-1-0);
138
- border-radius:var(--magritte-static-border-radius-600-v23-1-0);
137
+ background-color:var(--magritte-color-component-modal-background-content-v23-2-1);
138
+ border-radius:var(--magritte-static-border-radius-600-v23-2-1);
139
139
  overflow:hidden;
140
140
  width:800px;
141
141
  transition-property:opacity, transform;
142
142
  container-type:inline-size;
143
143
  }
144
- .magritte-modal___RAW6S_9-0-14.magritte-size-small___2JTM2_9-0-14{
144
+ .magritte-modal___RAW6S_9-1-1.magritte-size-small___2JTM2_9-1-1{
145
145
  width:480px;
146
146
  }
147
- .magritte-modal___RAW6S_9-0-14.magritte-size-medium___cWCe7_9-0-14{
147
+ .magritte-modal___RAW6S_9-1-1.magritte-size-medium___cWCe7_9-1-1{
148
148
  width:620px;
149
149
  }
150
- .magritte-no-vertical-paddings___Z3-oM_9-0-14{
150
+ .magritte-no-vertical-paddings___Z3-oM_9-1-1{
151
151
  padding-top:0;
152
152
  padding-bottom:0;
153
153
  }
154
- .magritte-no-horizontal-paddings___aT95Y_9-0-14{
154
+ .magritte-no-horizontal-paddings___aT95Y_9-1-1{
155
155
  padding-left:0;
156
156
  padding-right:0;
157
157
  }
158
- .magritte-modal-full-height___gIM4E_9-0-14{
158
+ .magritte-modal-full-height___gIM4E_9-1-1{
159
159
  height:100%;
160
160
  }
161
- .magritte-modal-content___46QFS_9-0-14{
161
+ .magritte-modal-content___46QFS_9-1-1{
162
162
  flex:1 1;
163
163
  overflow-y:auto;
164
164
  padding:0 0 0 24px;
@@ -167,226 +167,226 @@
167
167
  width:calc(100% + 24px);
168
168
  width:calc(100cqw + 24px);
169
169
  }
170
- .magritte-modal-content-wrapper___23XFT_9-0-14{
170
+ .magritte-modal-content-wrapper___23XFT_9-1-1{
171
171
  display:flex;
172
172
  flex-direction:column;
173
173
  min-height:0;
174
174
  flex:1 1;
175
175
  }
176
- .magritte-modal-content-wrapper__one-line___tYg8d_9-0-14{
176
+ .magritte-modal-content-wrapper__one-line___tYg8d_9-1-1{
177
177
  flex-direction:row-reverse;
178
178
  }
179
- .magritte-modal-content-wrapper__one-line___tYg8d_9-0-14 .magritte-modal-content___46QFS_9-0-14{
179
+ .magritte-modal-content-wrapper__one-line___tYg8d_9-1-1 .magritte-modal-content___46QFS_9-1-1{
180
180
  width:auto;
181
181
  container-type:inline-size;
182
182
  margin-right:0;
183
183
  }
184
- .magritte-modal-content-wrapper__one-line___tYg8d_9-0-14 .magritte-content-sticky-container___nqEXj_9-0-14{
184
+ .magritte-modal-content-wrapper__one-line___tYg8d_9-1-1 .magritte-content-sticky-container___nqEXj_9-1-1{
185
185
  max-width:calc(100% - 16px);
186
186
  max-width:calc(100cqw - 16px);
187
187
  }
188
- .magritte-divider-container___qP3VK_9-0-14{
188
+ .magritte-divider-container___qP3VK_9-1-1{
189
189
  margin:0 -24px;
190
190
  }
191
- .magritte-divider-container___qP3VK_9-0-14.magritte-divider-container-hidden___EIxB-_9-0-14{
191
+ .magritte-divider-container___qP3VK_9-1-1.magritte-divider-container-hidden___EIxB-_9-1-1{
192
192
  display:none;
193
193
  }
194
- .magritte-modal-footer___8xPqQ_9-0-14{
194
+ .magritte-modal-footer___8xPqQ_9-1-1{
195
195
  margin:0 -24px -24px;
196
- background-color:var(--magritte-color-component-modal-background-content-v23-1-0);
196
+ background-color:var(--magritte-color-component-modal-background-content-v23-2-1);
197
197
  z-index:1;
198
- --magritte-ui-action-bar-background-color-override:var(--magritte-color-component-modal-background-content-v23-1-0);
198
+ --magritte-ui-action-bar-background-color-override:var(--magritte-color-component-modal-background-content-v23-2-1);
199
199
  }
200
- .magritte-modal-buttons-container___1O1Nr_9-0-14{
200
+ .magritte-modal-buttons-container___1O1Nr_9-1-1{
201
201
  display:flex;
202
202
  gap:12px;
203
203
  }
204
- .magritte-animation-timeout___w-j7K_9-0-14{
204
+ .magritte-animation-timeout___w-j7K_9-1-1{
205
205
  --enter-animation-duration:0;
206
206
  --exit-animation-duration:0;
207
207
  }
208
208
  @media (prefers-reduced-motion: no-preference){
209
- .magritte-animation-timeout___w-j7K_9-0-14{
210
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
211
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
209
+ .magritte-animation-timeout___w-j7K_9-1-1{
210
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
211
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
212
212
  }
213
213
  }
214
- .magritte-animation-enter-center___7jogC_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
214
+ .magritte-animation-enter-center___7jogC_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
215
215
  opacity:0;
216
216
  }
217
- .magritte-animation-enter-center___7jogC_9-0-14 .magritte-modal___RAW6S_9-0-14{
217
+ .magritte-animation-enter-center___7jogC_9-1-1 .magritte-modal___RAW6S_9-1-1{
218
218
  opacity:0;
219
219
  transform:scale(0.96);
220
220
  }
221
- .magritte-animation-enter-center-active___fywwW_9-0-14{
221
+ .magritte-animation-enter-center-active___fywwW_9-1-1{
222
222
  --enter-animation-duration:0;
223
223
  --exit-animation-duration:0;
224
224
  }
225
225
  @media (prefers-reduced-motion: no-preference){
226
- .magritte-animation-enter-center-active___fywwW_9-0-14{
227
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
228
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
226
+ .magritte-animation-enter-center-active___fywwW_9-1-1{
227
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
228
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
229
229
  }
230
230
  }
231
- .magritte-animation-enter-center-active___fywwW_9-0-14 .magritte-modal___RAW6S_9-0-14,
232
- .magritte-animation-enter-center-active___fywwW_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
231
+ .magritte-animation-enter-center-active___fywwW_9-1-1 .magritte-modal___RAW6S_9-1-1,
232
+ .magritte-animation-enter-center-active___fywwW_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
233
233
  opacity:1;
234
234
  transition-duration:var(--enter-animation-duration);
235
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-1-0);
235
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-2-1);
236
236
  transform:scale(1);
237
237
  }
238
- .magritte-animation-exit-center___3Fa6x_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
238
+ .magritte-animation-exit-center___3Fa6x_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
239
239
  opacity:1;
240
240
  }
241
- .magritte-animation-exit-center___3Fa6x_9-0-14 .magritte-modal___RAW6S_9-0-14{
241
+ .magritte-animation-exit-center___3Fa6x_9-1-1 .magritte-modal___RAW6S_9-1-1{
242
242
  opacity:1;
243
243
  transform:scale(1);
244
244
  }
245
- .magritte-animation-exit-center-active___tY0UA_9-0-14{
245
+ .magritte-animation-exit-center-active___tY0UA_9-1-1{
246
246
  --enter-animation-duration:0;
247
247
  --exit-animation-duration:0;
248
248
  }
249
249
  @media (prefers-reduced-motion: no-preference){
250
- .magritte-animation-exit-center-active___tY0UA_9-0-14{
251
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
252
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
250
+ .magritte-animation-exit-center-active___tY0UA_9-1-1{
251
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
252
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
253
253
  }
254
254
  }
255
- .magritte-animation-exit-center-active___tY0UA_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
255
+ .magritte-animation-exit-center-active___tY0UA_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
256
256
  opacity:0;
257
257
  }
258
- .magritte-animation-exit-center-active___tY0UA_9-0-14 .magritte-modal___RAW6S_9-0-14{
258
+ .magritte-animation-exit-center-active___tY0UA_9-1-1 .magritte-modal___RAW6S_9-1-1{
259
259
  opacity:0;
260
260
  transform:scale(0.96);
261
261
  }
262
- .magritte-animation-exit-center-active___tY0UA_9-0-14 .magritte-modal___RAW6S_9-0-14,
263
- .magritte-animation-exit-center-active___tY0UA_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
262
+ .magritte-animation-exit-center-active___tY0UA_9-1-1 .magritte-modal___RAW6S_9-1-1,
263
+ .magritte-animation-exit-center-active___tY0UA_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
264
264
  transition-duration:var(--exit-animation-duration);
265
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-1-0);
265
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-1);
266
266
  }
267
- .magritte-animation-enter-left___5YB8B_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
267
+ .magritte-animation-enter-left___5YB8B_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
268
268
  opacity:0;
269
269
  }
270
- .magritte-animation-enter-left___5YB8B_9-0-14 .magritte-modal___RAW6S_9-0-14{
270
+ .magritte-animation-enter-left___5YB8B_9-1-1 .magritte-modal___RAW6S_9-1-1{
271
271
  opacity:0;
272
272
  transform:translateX(-100%);
273
273
  }
274
- .magritte-animation-enter-left-active___5GK8s_9-0-14{
274
+ .magritte-animation-enter-left-active___5GK8s_9-1-1{
275
275
  --enter-animation-duration:0;
276
276
  --exit-animation-duration:0;
277
277
  }
278
278
  @media (prefers-reduced-motion: no-preference){
279
- .magritte-animation-enter-left-active___5GK8s_9-0-14{
280
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
281
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
279
+ .magritte-animation-enter-left-active___5GK8s_9-1-1{
280
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
281
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
282
282
  }
283
283
  }
284
- .magritte-animation-enter-left-active___5GK8s_9-0-14 .magritte-modal___RAW6S_9-0-14,
285
- .magritte-animation-enter-left-active___5GK8s_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
284
+ .magritte-animation-enter-left-active___5GK8s_9-1-1 .magritte-modal___RAW6S_9-1-1,
285
+ .magritte-animation-enter-left-active___5GK8s_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
286
286
  opacity:1;
287
287
  transition-duration:var(--enter-animation-duration);
288
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-1-0);
288
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-2-1);
289
289
  transform:translateX(0);
290
290
  }
291
- .magritte-animation-exit-left___OnkQE_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
291
+ .magritte-animation-exit-left___OnkQE_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
292
292
  opacity:1;
293
293
  }
294
- .magritte-animation-exit-left___OnkQE_9-0-14 .magritte-modal___RAW6S_9-0-14{
294
+ .magritte-animation-exit-left___OnkQE_9-1-1 .magritte-modal___RAW6S_9-1-1{
295
295
  opacity:1;
296
296
  transform:translateX(0);
297
297
  }
298
- .magritte-animation-exit-left-active___AEGxY_9-0-14{
298
+ .magritte-animation-exit-left-active___AEGxY_9-1-1{
299
299
  --enter-animation-duration:0;
300
300
  --exit-animation-duration:0;
301
301
  }
302
302
  @media (prefers-reduced-motion: no-preference){
303
- .magritte-animation-exit-left-active___AEGxY_9-0-14{
304
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
305
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
303
+ .magritte-animation-exit-left-active___AEGxY_9-1-1{
304
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
305
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
306
306
  }
307
307
  }
308
- .magritte-animation-exit-left-active___AEGxY_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
308
+ .magritte-animation-exit-left-active___AEGxY_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
309
309
  opacity:0;
310
310
  }
311
- .magritte-animation-exit-left-active___AEGxY_9-0-14 .magritte-modal___RAW6S_9-0-14{
311
+ .magritte-animation-exit-left-active___AEGxY_9-1-1 .magritte-modal___RAW6S_9-1-1{
312
312
  opacity:0;
313
313
  transform:translateX(-100%);
314
314
  }
315
- .magritte-animation-exit-left-active___AEGxY_9-0-14 .magritte-modal___RAW6S_9-0-14,
316
- .magritte-animation-exit-left-active___AEGxY_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
315
+ .magritte-animation-exit-left-active___AEGxY_9-1-1 .magritte-modal___RAW6S_9-1-1,
316
+ .magritte-animation-exit-left-active___AEGxY_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
317
317
  transition-duration:var(--exit-animation-duration);
318
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-1-0);
318
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-1);
319
319
  }
320
- .magritte-animation-enter-right___2aXOm_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
320
+ .magritte-animation-enter-right___2aXOm_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
321
321
  opacity:0;
322
322
  }
323
- .magritte-animation-enter-right___2aXOm_9-0-14 .magritte-modal___RAW6S_9-0-14{
323
+ .magritte-animation-enter-right___2aXOm_9-1-1 .magritte-modal___RAW6S_9-1-1{
324
324
  opacity:0;
325
325
  transform:translateX(100%);
326
326
  }
327
- .magritte-animation-enter-right-active___8wX4-_9-0-14{
327
+ .magritte-animation-enter-right-active___8wX4-_9-1-1{
328
328
  --enter-animation-duration:0;
329
329
  --exit-animation-duration:0;
330
330
  }
331
331
  @media (prefers-reduced-motion: no-preference){
332
- .magritte-animation-enter-right-active___8wX4-_9-0-14{
333
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
334
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
332
+ .magritte-animation-enter-right-active___8wX4-_9-1-1{
333
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
334
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
335
335
  }
336
336
  }
337
- .magritte-animation-enter-right-active___8wX4-_9-0-14 .magritte-modal___RAW6S_9-0-14,
338
- .magritte-animation-enter-right-active___8wX4-_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
337
+ .magritte-animation-enter-right-active___8wX4-_9-1-1 .magritte-modal___RAW6S_9-1-1,
338
+ .magritte-animation-enter-right-active___8wX4-_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
339
339
  opacity:1;
340
340
  transition-duration:var(--enter-animation-duration);
341
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-1-0);
341
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v23-2-1);
342
342
  transform:translateX(0);
343
343
  }
344
- .magritte-animation-exit-right___iczoc_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
344
+ .magritte-animation-exit-right___iczoc_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
345
345
  opacity:1;
346
346
  }
347
- .magritte-animation-exit-right___iczoc_9-0-14 .magritte-modal___RAW6S_9-0-14{
347
+ .magritte-animation-exit-right___iczoc_9-1-1 .magritte-modal___RAW6S_9-1-1{
348
348
  opacity:1;
349
349
  transform:translateX(0);
350
350
  }
351
- .magritte-animation-exit-right-active___eFS4O_9-0-14{
351
+ .magritte-animation-exit-right-active___eFS4O_9-1-1{
352
352
  --enter-animation-duration:0;
353
353
  --exit-animation-duration:0;
354
354
  }
355
355
  @media (prefers-reduced-motion: no-preference){
356
- .magritte-animation-exit-right-active___eFS4O_9-0-14{
357
- --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-1-0);
358
- --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-1-0);
356
+ .magritte-animation-exit-right-active___eFS4O_9-1-1{
357
+ --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v23-2-1);
358
+ --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-1);
359
359
  }
360
360
  }
361
- .magritte-animation-exit-right-active___eFS4O_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
361
+ .magritte-animation-exit-right-active___eFS4O_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
362
362
  opacity:0;
363
363
  }
364
- .magritte-animation-exit-right-active___eFS4O_9-0-14 .magritte-modal___RAW6S_9-0-14{
364
+ .magritte-animation-exit-right-active___eFS4O_9-1-1 .magritte-modal___RAW6S_9-1-1{
365
365
  opacity:0;
366
366
  transform:translateX(100%);
367
367
  }
368
- .magritte-animation-exit-right-active___eFS4O_9-0-14 .magritte-modal___RAW6S_9-0-14,
369
- .magritte-animation-exit-right-active___eFS4O_9-0-14.magritte-modal-overlay___lK22l_9-0-14{
368
+ .magritte-animation-exit-right-active___eFS4O_9-1-1 .magritte-modal___RAW6S_9-1-1,
369
+ .magritte-animation-exit-right-active___eFS4O_9-1-1.magritte-modal-overlay___lK22l_9-1-1{
370
370
  transition-duration:var(--exit-animation-duration);
371
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-1-0);
371
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-1);
372
372
  }
373
- .magritte-content-scroll-preserver___Tw5Px_9-0-14{
373
+ .magritte-content-scroll-preserver___Tw5Px_9-1-1{
374
374
  width:100%;
375
375
  height:0;
376
376
  }
377
- .magritte-content-container___-ql3h_9-0-14{
377
+ .magritte-content-container___-ql3h_9-1-1{
378
378
  height:100%;
379
379
  max-width:calc(100% - 24px);
380
380
  max-width:100cqw;
381
381
  }
382
- .magritte-content-sticky-container___nqEXj_9-0-14{
382
+ .magritte-content-sticky-container___nqEXj_9-1-1{
383
383
  position:sticky;
384
384
  top:0;
385
385
  min-height:100%;
386
386
  max-width:calc(100% - 24px);
387
387
  max-width:100cqw;
388
388
  }
389
- .magritte-content-sticky-container_full-height___Gl9x8_9-0-14{
389
+ .magritte-content-sticky-container_full-height___Gl9x8_9-1-1{
390
390
  display:flex;
391
391
  flex-direction:column;
392
392
  }
package/index.js CHANGED
@@ -13,7 +13,7 @@ import '@hh.ru/magritte-common-use-no-bubbling';
13
13
  import '@hh.ru/magritte-ui-action-bar';
14
14
  import '@hh.ru/magritte-ui-breakpoint';
15
15
  import '@hh.ru/magritte-ui-layer';
16
- import './ModalContentWithHeader-Br1tEslM.js';
16
+ import './ModalContentWithHeader-8j0k2tmL.js';
17
17
  import '@hh.ru/magritte-common-func-utils';
18
18
  import '@hh.ru/magritte-ui-divider';
19
19
  import './ModalHeader.js';
@@ -23,5 +23,6 @@ import '@hh.ru/magritte-ui-textarea';
23
23
  import './useModalOrder.js';
24
24
  import '@hh.ru/magritte-common-dom-storage';
25
25
  import '@hh.ru/magritte-ui-progress-bar';
26
+ import '@hh.ru/magritte-ui-theme-wrapper';
26
27
  import '@hh.ru/magritte-ui-tree-selector';
27
28
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-modal",
3
- "version": "9.0.14",
3
+ "version": "9.1.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -20,24 +20,25 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@hh.ru/magritte-common-dom-storage": "1.0.8",
23
- "@hh.ru/magritte-common-func-utils": "1.3.12",
23
+ "@hh.ru/magritte-common-func-utils": "1.3.13",
24
24
  "@hh.ru/magritte-common-is-server-env": "1.0.7",
25
- "@hh.ru/magritte-common-keyboard": "4.1.2",
25
+ "@hh.ru/magritte-common-keyboard": "4.1.3",
26
26
  "@hh.ru/magritte-common-modal-helper": "1.2.10",
27
- "@hh.ru/magritte-common-use-multiple-refs": "1.1.8",
28
- "@hh.ru/magritte-common-use-no-bubbling": "1.0.5",
29
- "@hh.ru/magritte-design-tokens": "23.1.0",
27
+ "@hh.ru/magritte-common-use-multiple-refs": "1.1.9",
28
+ "@hh.ru/magritte-common-use-no-bubbling": "1.0.6",
29
+ "@hh.ru/magritte-design-tokens": "23.2.1",
30
30
  "@hh.ru/magritte-internal-layer-name": "3.0.2",
31
- "@hh.ru/magritte-ui-action-bar": "5.0.3",
32
- "@hh.ru/magritte-ui-breakpoint": "6.0.0",
33
- "@hh.ru/magritte-ui-divider": "3.0.3",
34
- "@hh.ru/magritte-ui-icon": "12.3.0",
35
- "@hh.ru/magritte-ui-layer": "3.0.2",
36
- "@hh.ru/magritte-ui-mock-component": "1.1.4",
37
- "@hh.ru/magritte-ui-progress-bar": "5.0.2",
38
- "@hh.ru/magritte-ui-textarea": "3.0.2",
39
- "@hh.ru/magritte-ui-title": "7.0.5",
40
- "@hh.ru/magritte-ui-tree-selector": "5.1.6"
31
+ "@hh.ru/magritte-ui-action-bar": "5.0.5",
32
+ "@hh.ru/magritte-ui-breakpoint": "6.0.1",
33
+ "@hh.ru/magritte-ui-divider": "3.0.5",
34
+ "@hh.ru/magritte-ui-icon": "12.3.2",
35
+ "@hh.ru/magritte-ui-layer": "3.0.3",
36
+ "@hh.ru/magritte-ui-mock-component": "1.1.5",
37
+ "@hh.ru/magritte-ui-progress-bar": "5.0.4",
38
+ "@hh.ru/magritte-ui-textarea": "3.0.4",
39
+ "@hh.ru/magritte-ui-theme-wrapper": "1.1.1",
40
+ "@hh.ru/magritte-ui-title": "7.0.7",
41
+ "@hh.ru/magritte-ui-tree-selector": "5.1.8"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "classnames": ">=2.3.2",
@@ -48,5 +49,5 @@
48
49
  "publishConfig": {
49
50
  "access": "public"
50
51
  },
51
- "gitHead": "0da6bd6d9f0cfa50c0c09ccd6f180c2f03167609"
52
+ "gitHead": "18a4c9f53b8572077ce0fba28266865c1b619cee"
52
53
  }