@alfalab/core-components-universal-modal 3.0.7 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/components/content/base-content/index.css +1 -1
  2. package/components/content/base-content/index.module.css.js +1 -1
  3. package/components/content/desktop/desktop.css +2 -2
  4. package/components/content/desktop/desktop.module.css.js +1 -1
  5. package/components/content/mobile/mobile.css +3 -3
  6. package/components/content/mobile/mobile.module.css.js +1 -1
  7. package/components/footer/base-footer/index.css +3 -3
  8. package/components/footer/base-footer/index.module.css.js +1 -1
  9. package/components/footer/desktop/desktop.css +1 -1
  10. package/components/footer/desktop/desktop.module.css.js +1 -1
  11. package/components/footer/desktop/layout.css +9 -9
  12. package/components/footer/desktop/layout.module.css.js +1 -1
  13. package/components/footer/mobile/layout.mobile.css +8 -8
  14. package/components/footer/mobile/layout.mobile.module.css.js +1 -1
  15. package/components/footer/mobile/mobile.css +2 -2
  16. package/components/footer/mobile/mobile.module.css.js +1 -1
  17. package/components/header/base-header/index.css +4 -4
  18. package/components/header/base-header/index.module.css.js +1 -1
  19. package/components/header/desktop/desktop.css +5 -5
  20. package/components/header/desktop/desktop.module.css.js +1 -1
  21. package/components/header/mobile/mobile.css +3 -3
  22. package/components/header/mobile/mobile.module.css.js +1 -1
  23. package/cssm/desktop/components/center-modal/center-modal.js +13 -8
  24. package/cssm/desktop/components/center-modal/center-modal.js.map +1 -1
  25. package/cssm/desktop/components/center-modal/index.module.css +7 -3
  26. package/cssm/desktop/components/modal-content/modal-content.d.ts +3 -3
  27. package/cssm/desktop/components/modal-content/modal-content.js +1 -3
  28. package/cssm/desktop/components/modal-content/modal-content.js.map +1 -1
  29. package/cssm/desktop/components/side-modal/index.module.css +6 -2
  30. package/cssm/desktop/components/side-modal/side-modal.js +14 -9
  31. package/cssm/desktop/components/side-modal/side-modal.js.map +1 -1
  32. package/cssm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
  33. package/cssm/desktop/hooks/use-scrollable-container-ref.js +27 -0
  34. package/cssm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
  35. package/desktop/components/center-modal/center-modal.js +13 -8
  36. package/desktop/components/center-modal/center-modal.js.map +1 -1
  37. package/desktop/components/center-modal/index.css +527 -523
  38. package/desktop/components/center-modal/index.module.css.js +1 -1
  39. package/desktop/components/center-modal/index.module.css.js.map +1 -1
  40. package/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  41. package/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  42. package/desktop/components/center-modal/transitions/transitions.css +7 -7
  43. package/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  44. package/desktop/components/modal-content/modal-content.css +4 -4
  45. package/desktop/components/modal-content/modal-content.d.ts +3 -3
  46. package/desktop/components/modal-content/modal-content.js +1 -3
  47. package/desktop/components/modal-content/modal-content.js.map +1 -1
  48. package/desktop/components/modal-content/modal-content.module.css.js +1 -1
  49. package/desktop/components/side-modal/index.css +529 -525
  50. package/desktop/components/side-modal/index.module.css.js +1 -1
  51. package/desktop/components/side-modal/index.module.css.js.map +1 -1
  52. package/desktop/components/side-modal/side-modal.js +14 -9
  53. package/desktop/components/side-modal/side-modal.js.map +1 -1
  54. package/desktop/components/side-modal/transitions/transitions.css +71 -71
  55. package/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  56. package/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
  57. package/desktop/hooks/use-scrollable-container-ref.js +27 -0
  58. package/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
  59. package/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  60. package/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  61. package/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  62. package/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  63. package/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  64. package/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  65. package/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  66. package/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  67. package/esm/components/content/base-content/index.css +1 -1
  68. package/esm/components/content/base-content/index.module.css.js +1 -1
  69. package/esm/components/content/desktop/desktop.css +2 -2
  70. package/esm/components/content/desktop/desktop.module.css.js +1 -1
  71. package/esm/components/content/mobile/mobile.css +3 -3
  72. package/esm/components/content/mobile/mobile.module.css.js +1 -1
  73. package/esm/components/footer/base-footer/index.css +3 -3
  74. package/esm/components/footer/base-footer/index.module.css.js +1 -1
  75. package/esm/components/footer/desktop/desktop.css +1 -1
  76. package/esm/components/footer/desktop/desktop.module.css.js +1 -1
  77. package/esm/components/footer/desktop/layout.css +9 -9
  78. package/esm/components/footer/desktop/layout.module.css.js +1 -1
  79. package/esm/components/footer/mobile/layout.mobile.css +8 -8
  80. package/esm/components/footer/mobile/layout.mobile.module.css.js +1 -1
  81. package/esm/components/footer/mobile/mobile.css +2 -2
  82. package/esm/components/footer/mobile/mobile.module.css.js +1 -1
  83. package/esm/components/header/base-header/index.css +4 -4
  84. package/esm/components/header/base-header/index.module.css.js +1 -1
  85. package/esm/components/header/desktop/desktop.css +5 -5
  86. package/esm/components/header/desktop/desktop.module.css.js +1 -1
  87. package/esm/components/header/mobile/mobile.css +3 -3
  88. package/esm/components/header/mobile/mobile.module.css.js +1 -1
  89. package/esm/desktop/components/center-modal/center-modal.js +13 -8
  90. package/esm/desktop/components/center-modal/center-modal.js.map +1 -1
  91. package/esm/desktop/components/center-modal/index.css +527 -523
  92. package/esm/desktop/components/center-modal/index.module.css.js +1 -1
  93. package/esm/desktop/components/center-modal/index.module.css.js.map +1 -1
  94. package/esm/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  95. package/esm/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  96. package/esm/desktop/components/center-modal/transitions/transitions.css +7 -7
  97. package/esm/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  98. package/esm/desktop/components/modal-content/modal-content.css +4 -4
  99. package/esm/desktop/components/modal-content/modal-content.d.ts +3 -3
  100. package/esm/desktop/components/modal-content/modal-content.js +1 -3
  101. package/esm/desktop/components/modal-content/modal-content.js.map +1 -1
  102. package/esm/desktop/components/modal-content/modal-content.module.css.js +1 -1
  103. package/esm/desktop/components/side-modal/index.css +529 -525
  104. package/esm/desktop/components/side-modal/index.module.css.js +1 -1
  105. package/esm/desktop/components/side-modal/index.module.css.js.map +1 -1
  106. package/esm/desktop/components/side-modal/side-modal.js +14 -9
  107. package/esm/desktop/components/side-modal/side-modal.js.map +1 -1
  108. package/esm/desktop/components/side-modal/transitions/transitions.css +71 -71
  109. package/esm/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  110. package/esm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
  111. package/esm/desktop/hooks/use-scrollable-container-ref.js +23 -0
  112. package/esm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
  113. package/esm/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  114. package/esm/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  115. package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  116. package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  117. package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  118. package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  119. package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  120. package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  121. package/esm/mobile/mobile.css +3 -3
  122. package/esm/mobile/mobile.module.css.js +1 -1
  123. package/esm/mobile/transitions/right-side-transitions.mobile.css +7 -7
  124. package/esm/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
  125. package/esm/mobile/transitions/transitions.mobile.css +7 -7
  126. package/esm/mobile/transitions/transitions.mobile.module.css.js +1 -1
  127. package/mobile/mobile.css +3 -3
  128. package/mobile/mobile.module.css.js +1 -1
  129. package/mobile/transitions/right-side-transitions.mobile.css +7 -7
  130. package/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
  131. package/mobile/transitions/transitions.mobile.css +7 -7
  132. package/mobile/transitions/transitions.mobile.module.css.js +1 -1
  133. package/modern/components/content/base-content/index.css +1 -1
  134. package/modern/components/content/base-content/index.module.css.js +1 -1
  135. package/modern/components/content/desktop/desktop.css +2 -2
  136. package/modern/components/content/desktop/desktop.module.css.js +1 -1
  137. package/modern/components/content/mobile/mobile.css +3 -3
  138. package/modern/components/content/mobile/mobile.module.css.js +1 -1
  139. package/modern/components/footer/base-footer/index.css +3 -3
  140. package/modern/components/footer/base-footer/index.module.css.js +1 -1
  141. package/modern/components/footer/desktop/desktop.css +1 -1
  142. package/modern/components/footer/desktop/desktop.module.css.js +1 -1
  143. package/modern/components/footer/desktop/layout.css +9 -9
  144. package/modern/components/footer/desktop/layout.module.css.js +1 -1
  145. package/modern/components/footer/mobile/layout.mobile.css +8 -8
  146. package/modern/components/footer/mobile/layout.mobile.module.css.js +1 -1
  147. package/modern/components/footer/mobile/mobile.css +2 -2
  148. package/modern/components/footer/mobile/mobile.module.css.js +1 -1
  149. package/modern/components/header/base-header/index.css +4 -4
  150. package/modern/components/header/base-header/index.module.css.js +1 -1
  151. package/modern/components/header/desktop/desktop.css +5 -5
  152. package/modern/components/header/desktop/desktop.module.css.js +1 -1
  153. package/modern/components/header/mobile/mobile.css +3 -3
  154. package/modern/components/header/mobile/mobile.module.css.js +1 -1
  155. package/modern/desktop/components/center-modal/center-modal.js +12 -8
  156. package/modern/desktop/components/center-modal/center-modal.js.map +1 -1
  157. package/modern/desktop/components/center-modal/index.css +527 -523
  158. package/modern/desktop/components/center-modal/index.module.css.js +1 -1
  159. package/modern/desktop/components/center-modal/index.module.css.js.map +1 -1
  160. package/modern/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  161. package/modern/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  162. package/modern/desktop/components/center-modal/transitions/transitions.css +7 -7
  163. package/modern/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  164. package/modern/desktop/components/modal-content/modal-content.css +4 -4
  165. package/modern/desktop/components/modal-content/modal-content.d.ts +3 -3
  166. package/modern/desktop/components/modal-content/modal-content.js +1 -3
  167. package/modern/desktop/components/modal-content/modal-content.js.map +1 -1
  168. package/modern/desktop/components/modal-content/modal-content.module.css.js +1 -1
  169. package/modern/desktop/components/side-modal/index.css +529 -525
  170. package/modern/desktop/components/side-modal/index.module.css.js +1 -1
  171. package/modern/desktop/components/side-modal/index.module.css.js.map +1 -1
  172. package/modern/desktop/components/side-modal/side-modal.js +12 -8
  173. package/modern/desktop/components/side-modal/side-modal.js.map +1 -1
  174. package/modern/desktop/components/side-modal/transitions/transitions.css +71 -71
  175. package/modern/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  176. package/modern/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
  177. package/modern/desktop/hooks/use-scrollable-container-ref.js +21 -0
  178. package/modern/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
  179. package/modern/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  180. package/modern/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  181. package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  182. package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  183. package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  184. package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  185. package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  186. package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  187. package/modern/mobile/mobile.css +3 -3
  188. package/modern/mobile/mobile.module.css.js +1 -1
  189. package/modern/mobile/transitions/right-side-transitions.mobile.css +7 -7
  190. package/modern/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
  191. package/modern/mobile/transitions/transitions.mobile.css +7 -7
  192. package/modern/mobile/transitions/transitions.mobile.module.css.js +1 -1
  193. package/moderncssm/desktop/components/center-modal/center-modal.js +12 -8
  194. package/moderncssm/desktop/components/center-modal/center-modal.js.map +1 -1
  195. package/moderncssm/desktop/components/center-modal/index.module.css +9 -4
  196. package/moderncssm/desktop/components/modal-content/modal-content.d.ts +3 -3
  197. package/moderncssm/desktop/components/modal-content/modal-content.js +1 -3
  198. package/moderncssm/desktop/components/modal-content/modal-content.js.map +1 -1
  199. package/moderncssm/desktop/components/side-modal/index.module.css +7 -2
  200. package/moderncssm/desktop/components/side-modal/side-modal.js +12 -8
  201. package/moderncssm/desktop/components/side-modal/side-modal.js.map +1 -1
  202. package/moderncssm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
  203. package/moderncssm/desktop/hooks/use-scrollable-container-ref.js +21 -0
  204. package/moderncssm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
  205. package/package.json +3 -3
  206. package/src/desktop/components/center-modal/center-modal.module.css +1 -5
  207. package/src/desktop/components/center-modal/center-modal.tsx +14 -14
  208. package/src/desktop/components/center-modal/index.module.css +2 -1
  209. package/src/desktop/components/modal-content/modal-content.tsx +8 -9
  210. package/src/desktop/components/side-modal/index.module.css +2 -1
  211. package/src/desktop/components/side-modal/side-modal.module.css +0 -4
  212. package/src/desktop/components/side-modal/side-modal.tsx +14 -14
  213. package/src/desktop/hooks/use-scrollable-container-ref.ts +29 -0
  214. package/src/desktop/styles/common.module.css +10 -0
  215. package/cssm/desktop/hooks/use-outside-scroll.d.ts +0 -8
  216. package/cssm/desktop/hooks/use-outside-scroll.js +0 -21
  217. package/cssm/desktop/hooks/use-outside-scroll.js.map +0 -1
  218. package/cssm/desktop/hooks/useModalWheel.d.ts +0 -5
  219. package/cssm/desktop/hooks/useModalWheel.js +0 -20
  220. package/cssm/desktop/hooks/useModalWheel.js.map +0 -1
  221. package/desktop/hooks/use-outside-scroll.d.ts +0 -8
  222. package/desktop/hooks/use-outside-scroll.js +0 -21
  223. package/desktop/hooks/use-outside-scroll.js.map +0 -1
  224. package/desktop/hooks/useModalWheel.d.ts +0 -5
  225. package/desktop/hooks/useModalWheel.js +0 -20
  226. package/desktop/hooks/useModalWheel.js.map +0 -1
  227. package/esm/desktop/hooks/use-outside-scroll.d.ts +0 -8
  228. package/esm/desktop/hooks/use-outside-scroll.js +0 -17
  229. package/esm/desktop/hooks/use-outside-scroll.js.map +0 -1
  230. package/esm/desktop/hooks/useModalWheel.d.ts +0 -5
  231. package/esm/desktop/hooks/useModalWheel.js +0 -16
  232. package/esm/desktop/hooks/useModalWheel.js.map +0 -1
  233. package/modern/desktop/hooks/use-outside-scroll.d.ts +0 -8
  234. package/modern/desktop/hooks/use-outside-scroll.js +0 -17
  235. package/modern/desktop/hooks/use-outside-scroll.js.map +0 -1
  236. package/modern/desktop/hooks/useModalWheel.d.ts +0 -5
  237. package/modern/desktop/hooks/useModalWheel.js +0 -16
  238. package/modern/desktop/hooks/useModalWheel.js.map +0 -1
  239. package/moderncssm/desktop/hooks/use-outside-scroll.d.ts +0 -8
  240. package/moderncssm/desktop/hooks/use-outside-scroll.js +0 -17
  241. package/moderncssm/desktop/hooks/use-outside-scroll.js.map +0 -1
  242. package/moderncssm/desktop/hooks/useModalWheel.d.ts +0 -5
  243. package/moderncssm/desktop/hooks/useModalWheel.js +0 -16
  244. package/moderncssm/desktop/hooks/useModalWheel.js.map +0 -1
  245. package/src/desktop/hooks/use-outside-scroll.ts +0 -20
  246. package/src/desktop/hooks/useModalWheel.ts +0 -16
@@ -2,7 +2,7 @@ import React, { forwardRef, useRef } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { BaseModal } from '@alfalab/core-components-base-modal/modern';
4
4
  import { isMacOS, isSafari } from '@alfalab/core-components-shared/modern';
5
- import { useModalWheel } from '../../hooks/useModalWheel.js';
5
+ import { useScrollableContainerRef } from '../../hooks/use-scrollable-container-ref.js';
6
6
  import { getFullSizeModalTransitions } from '../../utils/get-full-size-modal-transitions.js';
7
7
  import { getHeightStyle } from '../../utils/get-height-style.js';
8
8
  import { getMarginStyles } from '../../utils/get-margin-styles.js';
@@ -15,23 +15,27 @@ import transitions from './transitions/transitions.module.css.js';
15
15
  // в safari некорректно отрабатывает transform:scale (???), поэтому применяем немного другую анимацию
16
16
  const transitionProps = isMacOS() && isSafari() ? safariTransitions : transitions;
17
17
  const CenterModal = forwardRef((props, ref) => {
18
- const { dataTestId, className, open, children, width = 500, height = 'hugContent', verticalAlign = 'center', overlay = true, margin, scrollableContainerRef, onClose, ...restProps } = props;
18
+ const { dataTestId, className, open, children, width = 500, height = 'hugContent', verticalAlign = 'center', overlay = true, margin, scrollableContainerRef: scrollableContainerRefProp, onClose, ...restProps } = props;
19
19
  const componentRef = useRef(null);
20
- const { wheelDeltaY, handleWheel } = useModalWheel(overlay);
20
+ const { handleWheel, scrollableContainerRef } = useScrollableContainerRef({
21
+ overlay,
22
+ refObject: scrollableContainerRefProp,
23
+ });
21
24
  const { isFullSizeModal, componentTransitions: fullSizeModalContentTransitions, backdropTransitions: fullSizeModalBackdropTransitions, } = getFullSizeModalTransitions({ verticalAlign, width, height });
22
- return (React.createElement(BaseModal, { ...restProps, open: open, dataTestId: dataTestId, ref: ref, componentRef: componentRef, scrollHandler: 'content', disableBlockingScroll: !overlay, wrapperClassName: cn({
25
+ const withoutOverlay = !overlay;
26
+ return (React.createElement(BaseModal, { ...restProps, open: open, dataTestId: dataTestId, ref: ref, componentRef: componentRef, scrollHandler: 'content', disableBlockingScroll: withoutOverlay, wrapperClassName: cn(styles.baseModalContainer, {
23
27
  [styles.wrapperJustifyStart]: verticalAlign === 'top',
24
28
  [styles.wrapperJustifyCenter]: verticalAlign === 'center',
25
29
  [styles.wrapperJustifyEnd]: verticalAlign === 'bottom',
26
- }), className: cn(styles.component, className, {
27
- [styles.overlayHidden]: !overlay,
30
+ [styles.withoutOverlay]: withoutOverlay,
31
+ }), className: cn(styles.component, className, styles.baseModalComponent, {
28
32
  ...getMarginStyles({ styles, margin }),
29
33
  }), transitionProps: {
30
34
  classNames: transitionProps,
31
35
  ...(isFullSizeModal && fullSizeModalContentTransitions),
32
36
  ...restProps.transitionProps,
33
37
  }, backdropProps: {
34
- transparent: !overlay,
38
+ shouldRender: overlay,
35
39
  ...(isFullSizeModal && fullSizeModalBackdropTransitions),
36
40
  ...restProps.backdropProps,
37
41
  }, componentDivProps: {
@@ -40,7 +44,7 @@ const CenterModal = forwardRef((props, ref) => {
40
44
  ...getHeightStyle(height, margin),
41
45
  },
42
46
  }, onWheel: handleWheel, onClose: onClose },
43
- React.createElement(ModalContent, { height: height, wheelDeltaY: wheelDeltaY, scrollableContainerRef: scrollableContainerRef }, children)));
47
+ React.createElement(ModalContent, { height: height, scrollableContainerRef: scrollableContainerRef }, children)));
44
48
  });
45
49
 
46
50
  export { CenterModal };
@@ -1 +1 @@
1
- {"version":3,"file":"center-modal.js","sources":["../../../../src/desktop/components/center-modal/center-modal.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\nimport { isMacOS, isSafari } from '@alfalab/core-components-shared';\n\nimport { useModalWheel } from '../../hooks/useModalWheel';\nimport { type UniversalModalDesktopProps } from '../../types/props';\nimport { getFullSizeModalTransitions } from '../../utils/get-full-size-modal-transitions';\nimport { getHeightStyle } from '../../utils/get-height-style';\nimport { getMarginStyles } from '../../utils/get-margin-styles';\nimport { getWidthStyle } from '../../utils/get-width-style';\nimport { ModalContent } from '../modal-content/modal-content';\n\nimport styles from './index.module.css';\nimport safariTransitions from './transitions/safari-transitions.module.css';\nimport transitions from './transitions/transitions.module.css';\n\n// в safari некорректно отрабатывает transform:scale (???), поэтому применяем немного другую анимацию\nconst transitionProps = isMacOS() && isSafari() ? safariTransitions : transitions;\n\nexport const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps>((props, ref) => {\n const {\n dataTestId,\n className,\n open,\n children,\n width = 500,\n height = 'hugContent',\n verticalAlign = 'center',\n overlay = true,\n margin,\n scrollableContainerRef,\n onClose,\n ...restProps\n } = props;\n\n const componentRef = useRef<HTMLDivElement>(null);\n\n const { wheelDeltaY, handleWheel } = useModalWheel(overlay);\n\n const {\n isFullSizeModal,\n componentTransitions: fullSizeModalContentTransitions,\n backdropTransitions: fullSizeModalBackdropTransitions,\n } = getFullSizeModalTransitions({ verticalAlign, width, height });\n\n return (\n <BaseModal\n {...restProps}\n open={open}\n dataTestId={dataTestId}\n ref={ref}\n componentRef={componentRef}\n scrollHandler='content'\n disableBlockingScroll={!overlay}\n wrapperClassName={cn({\n [styles.wrapperJustifyStart]: verticalAlign === 'top',\n [styles.wrapperJustifyCenter]: verticalAlign === 'center',\n [styles.wrapperJustifyEnd]: verticalAlign === 'bottom',\n })}\n className={cn(styles.component, className, {\n [styles.overlayHidden]: !overlay,\n ...getMarginStyles({ styles, margin }),\n })}\n transitionProps={{\n classNames: transitionProps,\n ...(isFullSizeModal && fullSizeModalContentTransitions),\n ...restProps.transitionProps,\n }}\n backdropProps={{\n transparent: !overlay,\n ...(isFullSizeModal && fullSizeModalBackdropTransitions),\n ...restProps.backdropProps,\n }}\n componentDivProps={{\n style: {\n width: getWidthStyle(width, margin),\n ...getHeightStyle(height, margin),\n },\n }}\n onWheel={handleWheel}\n onClose={onClose}\n >\n <ModalContent\n height={height}\n wheelDeltaY={wheelDeltaY}\n scrollableContainerRef={scrollableContainerRef}\n >\n {children}\n </ModalContent>\n </BaseModal>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA;AACA,MAAM,eAAe,GAAG,OAAO,EAAE,IAAI,QAAQ,EAAE,GAAG,iBAAiB,GAAG,WAAW;AAEpE,MAAA,WAAW,GAAG,UAAU,CAA6C,CAAC,KAAK,EAAE,GAAG,KAAI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,eAAe,IAAI,+BAA+B,CAAC;YACvD,GAAG,SAAS,CAAC,eAAe;AAC/B,SAAA,EACD,aAAa,EAAE;YACX,WAAW,EAAE,CAAC,OAAO;AACrB,YAAA,IAAI,eAAe,IAAI,gCAAgC,CAAC;YACxD,GAAG,SAAS,CAAC,aAAa;AAC7B,SAAA,EACD,iBAAiB,EAAE;AACf,YAAA,KAAK,EAAE;AACH,gBAAA,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC;AACnC,gBAAA,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AACpC,aAAA;AACJ,SAAA,EACD,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAAA;AAEhB,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EACT,EAAA,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,sBAAsB,EAAE,sBAAsB,EAAA,EAE7C,QAAQ,CACE,CACP;AAEpB,CAAC;;;;"}
1
+ {"version":3,"file":"center-modal.js","sources":["../../../../src/desktop/components/center-modal/center-modal.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\nimport { isMacOS, isSafari } from '@alfalab/core-components-shared';\n\nimport { useScrollableContainerRef } from '../../hooks/use-scrollable-container-ref';\nimport { type UniversalModalDesktopProps } from '../../types/props';\nimport { getFullSizeModalTransitions } from '../../utils/get-full-size-modal-transitions';\nimport { getHeightStyle } from '../../utils/get-height-style';\nimport { getMarginStyles } from '../../utils/get-margin-styles';\nimport { getWidthStyle } from '../../utils/get-width-style';\nimport { ModalContent } from '../modal-content/modal-content';\n\nimport styles from './index.module.css';\nimport safariTransitions from './transitions/safari-transitions.module.css';\nimport transitions from './transitions/transitions.module.css';\n\n// в safari некорректно отрабатывает transform:scale (???), поэтому применяем немного другую анимацию\nconst transitionProps = isMacOS() && isSafari() ? safariTransitions : transitions;\n\nexport const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps>((props, ref) => {\n const {\n dataTestId,\n className,\n open,\n children,\n width = 500,\n height = 'hugContent',\n verticalAlign = 'center',\n overlay = true,\n margin,\n scrollableContainerRef: scrollableContainerRefProp,\n onClose,\n ...restProps\n } = props;\n\n const componentRef = useRef<HTMLDivElement>(null);\n const { handleWheel, scrollableContainerRef } = useScrollableContainerRef({\n overlay,\n refObject: scrollableContainerRefProp,\n });\n\n const {\n isFullSizeModal,\n componentTransitions: fullSizeModalContentTransitions,\n backdropTransitions: fullSizeModalBackdropTransitions,\n } = getFullSizeModalTransitions({ verticalAlign, width, height });\n\n const withoutOverlay = !overlay;\n\n return (\n <BaseModal\n {...restProps}\n open={open}\n dataTestId={dataTestId}\n ref={ref}\n componentRef={componentRef}\n scrollHandler='content'\n disableBlockingScroll={withoutOverlay}\n wrapperClassName={cn(styles.baseModalContainer, {\n [styles.wrapperJustifyStart]: verticalAlign === 'top',\n [styles.wrapperJustifyCenter]: verticalAlign === 'center',\n [styles.wrapperJustifyEnd]: verticalAlign === 'bottom',\n [styles.withoutOverlay]: withoutOverlay,\n })}\n className={cn(styles.component, className, styles.baseModalComponent, {\n ...getMarginStyles({ styles, margin }),\n })}\n transitionProps={{\n classNames: transitionProps,\n ...(isFullSizeModal && fullSizeModalContentTransitions),\n ...restProps.transitionProps,\n }}\n backdropProps={{\n shouldRender: overlay,\n ...(isFullSizeModal && fullSizeModalBackdropTransitions),\n ...restProps.backdropProps,\n }}\n componentDivProps={{\n style: {\n width: getWidthStyle(width, margin),\n ...getHeightStyle(height, margin),\n },\n }}\n onWheel={handleWheel}\n onClose={onClose}\n >\n <ModalContent height={height} scrollableContainerRef={scrollableContainerRef}>\n {children}\n </ModalContent>\n </BaseModal>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA;AACA,MAAM,eAAe,GAAG,OAAO,EAAE,IAAI,QAAQ,EAAE,GAAG,iBAAiB,GAAG,WAAW;AAEpE,MAAA,W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