@alfalab/core-components-universal-modal 3.2.1 → 3.2.2

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 (203) hide show
  1. package/components/base-content/index.css +2 -3
  2. package/components/base-content/index.module.css.js +1 -1
  3. package/components/base-footer/index.css +5 -7
  4. package/components/base-footer/index.module.css.js +1 -1
  5. package/components/base-header/index.css +4 -4
  6. package/components/base-header/index.module.css.js +1 -1
  7. package/cssm/components/base-content/index.module.css +1 -2
  8. package/cssm/components/base-footer/index.module.css +2 -4
  9. package/cssm/desktop/components/center-modal/center-modal.js +2 -1
  10. package/cssm/desktop/components/center-modal/center-modal.js.map +1 -1
  11. package/cssm/desktop/components/center-modal/index.module.css +1 -2
  12. package/cssm/desktop/components/footer/layout.module.css +3 -6
  13. package/cssm/desktop/components/header/desktop.module.css +3 -6
  14. package/cssm/desktop/components/side-modal/index.module.css +1 -2
  15. package/cssm/desktop/components/side-modal/side-modal.js +2 -1
  16. package/cssm/desktop/components/side-modal/side-modal.js.map +1 -1
  17. package/cssm/desktop/utils/get-hug-content-styles.d.ts +8 -0
  18. package/cssm/desktop/utils/get-hug-content-styles.js +19 -0
  19. package/cssm/desktop/utils/get-hug-content-styles.js.map +1 -0
  20. package/cssm/desktop/utils/get-margin-styles.d.ts +0 -1
  21. package/cssm/desktop/utils/get-margin-styles.js +8 -14
  22. package/cssm/desktop/utils/get-margin-styles.js.map +1 -1
  23. package/cssm/mobile/components/content/index.module.css +1 -2
  24. package/cssm/mobile/components/footer/index.module.css +1 -2
  25. package/cssm/mobile/components/footer/layout.mobile.module.css +1 -2
  26. package/cssm/mobile/components/header/index.module.css +4 -8
  27. package/desktop/components/center-modal/center-modal.js +2 -1
  28. package/desktop/components/center-modal/center-modal.js.map +1 -1
  29. package/desktop/components/center-modal/index.css +784 -785
  30. package/desktop/components/center-modal/index.module.css.js +1 -1
  31. package/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  32. package/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  33. package/desktop/components/center-modal/transitions/transitions.css +7 -7
  34. package/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  35. package/desktop/components/footer/desktop.css +1 -1
  36. package/desktop/components/footer/desktop.module.css.js +1 -1
  37. package/desktop/components/footer/layout.css +12 -15
  38. package/desktop/components/footer/layout.module.css.js +1 -1
  39. package/desktop/components/header/desktop.css +8 -11
  40. package/desktop/components/header/desktop.module.css.js +1 -1
  41. package/desktop/components/modal-content/modal-content.css +4 -4
  42. package/desktop/components/modal-content/modal-content.module.css.js +1 -1
  43. package/desktop/components/side-modal/index.css +786 -787
  44. package/desktop/components/side-modal/index.module.css.js +1 -1
  45. package/desktop/components/side-modal/side-modal.js +2 -1
  46. package/desktop/components/side-modal/side-modal.js.map +1 -1
  47. package/desktop/components/side-modal/transitions/transitions.css +71 -71
  48. package/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  49. package/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  50. package/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  51. package/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  52. package/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  53. package/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  54. package/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  55. package/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  56. package/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  57. package/desktop/utils/get-hug-content-styles.d.ts +8 -0
  58. package/desktop/utils/get-hug-content-styles.js +19 -0
  59. package/desktop/utils/get-hug-content-styles.js.map +1 -0
  60. package/desktop/utils/get-margin-styles.d.ts +0 -1
  61. package/desktop/utils/get-margin-styles.js +8 -14
  62. package/desktop/utils/get-margin-styles.js.map +1 -1
  63. package/esm/components/base-content/index.css +2 -3
  64. package/esm/components/base-content/index.module.css.js +1 -1
  65. package/esm/components/base-footer/index.css +5 -7
  66. package/esm/components/base-footer/index.module.css.js +1 -1
  67. package/esm/components/base-header/index.css +4 -4
  68. package/esm/components/base-header/index.module.css.js +1 -1
  69. package/esm/desktop/components/center-modal/center-modal.js +2 -1
  70. package/esm/desktop/components/center-modal/center-modal.js.map +1 -1
  71. package/esm/desktop/components/center-modal/index.css +784 -785
  72. package/esm/desktop/components/center-modal/index.module.css.js +1 -1
  73. package/esm/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  74. package/esm/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  75. package/esm/desktop/components/center-modal/transitions/transitions.css +7 -7
  76. package/esm/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  77. package/esm/desktop/components/footer/desktop.css +1 -1
  78. package/esm/desktop/components/footer/desktop.module.css.js +1 -1
  79. package/esm/desktop/components/footer/layout.css +12 -15
  80. package/esm/desktop/components/footer/layout.module.css.js +1 -1
  81. package/esm/desktop/components/header/desktop.css +8 -11
  82. package/esm/desktop/components/header/desktop.module.css.js +1 -1
  83. package/esm/desktop/components/modal-content/modal-content.css +4 -4
  84. package/esm/desktop/components/modal-content/modal-content.module.css.js +1 -1
  85. package/esm/desktop/components/side-modal/index.css +786 -787
  86. package/esm/desktop/components/side-modal/index.module.css.js +1 -1
  87. package/esm/desktop/components/side-modal/side-modal.js +2 -1
  88. package/esm/desktop/components/side-modal/side-modal.js.map +1 -1
  89. package/esm/desktop/components/side-modal/transitions/transitions.css +71 -71
  90. package/esm/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  91. package/esm/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  92. package/esm/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  93. package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  94. package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  95. package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  96. package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  97. package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  98. package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  99. package/esm/desktop/utils/get-hug-content-styles.d.ts +8 -0
  100. package/esm/desktop/utils/get-hug-content-styles.js +15 -0
  101. package/esm/desktop/utils/get-hug-content-styles.js.map +1 -0
  102. package/esm/desktop/utils/get-margin-styles.d.ts +0 -1
  103. package/esm/desktop/utils/get-margin-styles.js +8 -14
  104. package/esm/desktop/utils/get-margin-styles.js.map +1 -1
  105. package/esm/mobile/components/content/index.css +4 -5
  106. package/esm/mobile/components/content/index.module.css.js +1 -1
  107. package/esm/mobile/components/footer/index.css +3 -4
  108. package/esm/mobile/components/footer/index.module.css.js +1 -1
  109. package/esm/mobile/components/footer/layout.mobile.css +10 -11
  110. package/esm/mobile/components/footer/layout.mobile.module.css.js +1 -1
  111. package/esm/mobile/components/header/index.css +7 -11
  112. package/esm/mobile/components/header/index.module.css.js +1 -1
  113. package/esm/mobile/mobile.css +3 -3
  114. package/esm/mobile/mobile.module.css.js +1 -1
  115. package/esm/mobile/transitions/right-side-transitions.mobile.css +7 -7
  116. package/esm/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
  117. package/esm/mobile/transitions/transitions.mobile.css +7 -7
  118. package/esm/mobile/transitions/transitions.mobile.module.css.js +1 -1
  119. package/mobile/components/content/index.css +4 -5
  120. package/mobile/components/content/index.module.css.js +1 -1
  121. package/mobile/components/footer/index.css +3 -4
  122. package/mobile/components/footer/index.module.css.js +1 -1
  123. package/mobile/components/footer/layout.mobile.css +10 -11
  124. package/mobile/components/footer/layout.mobile.module.css.js +1 -1
  125. package/mobile/components/header/index.css +7 -11
  126. package/mobile/components/header/index.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/base-content/index.css +2 -3
  134. package/modern/components/base-content/index.module.css.js +1 -1
  135. package/modern/components/base-footer/index.css +5 -7
  136. package/modern/components/base-footer/index.module.css.js +1 -1
  137. package/modern/components/base-header/index.css +4 -4
  138. package/modern/components/base-header/index.module.css.js +1 -1
  139. package/modern/desktop/components/center-modal/center-modal.js +3 -1
  140. package/modern/desktop/components/center-modal/center-modal.js.map +1 -1
  141. package/modern/desktop/components/center-modal/index.css +784 -785
  142. package/modern/desktop/components/center-modal/index.module.css.js +1 -1
  143. package/modern/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
  144. package/modern/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
  145. package/modern/desktop/components/center-modal/transitions/transitions.css +7 -7
  146. package/modern/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
  147. package/modern/desktop/components/footer/desktop.css +1 -1
  148. package/modern/desktop/components/footer/desktop.module.css.js +1 -1
  149. package/modern/desktop/components/footer/layout.css +12 -15
  150. package/modern/desktop/components/footer/layout.module.css.js +1 -1
  151. package/modern/desktop/components/header/desktop.css +8 -11
  152. package/modern/desktop/components/header/desktop.module.css.js +1 -1
  153. package/modern/desktop/components/modal-content/modal-content.css +4 -4
  154. package/modern/desktop/components/modal-content/modal-content.module.css.js +1 -1
  155. package/modern/desktop/components/side-modal/index.css +786 -787
  156. package/modern/desktop/components/side-modal/index.module.css.js +1 -1
  157. package/modern/desktop/components/side-modal/side-modal.js +3 -1
  158. package/modern/desktop/components/side-modal/side-modal.js.map +1 -1
  159. package/modern/desktop/components/side-modal/transitions/transitions.css +71 -71
  160. package/modern/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
  161. package/modern/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
  162. package/modern/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
  163. package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
  164. package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
  165. package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
  166. package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
  167. package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
  168. package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
  169. package/modern/desktop/utils/get-hug-content-styles.d.ts +8 -0
  170. package/modern/desktop/utils/get-hug-content-styles.js +17 -0
  171. package/modern/desktop/utils/get-hug-content-styles.js.map +1 -0
  172. package/modern/desktop/utils/get-margin-styles.d.ts +0 -1
  173. package/modern/desktop/utils/get-margin-styles.js +11 -13
  174. package/modern/desktop/utils/get-margin-styles.js.map +1 -1
  175. package/modern/mobile/components/content/index.css +4 -5
  176. package/modern/mobile/components/content/index.module.css.js +1 -1
  177. package/modern/mobile/components/footer/index.css +3 -4
  178. package/modern/mobile/components/footer/index.module.css.js +1 -1
  179. package/modern/mobile/components/footer/layout.mobile.css +10 -11
  180. package/modern/mobile/components/footer/layout.mobile.module.css.js +1 -1
  181. package/modern/mobile/components/header/index.css +7 -11
  182. package/modern/mobile/components/header/index.module.css.js +1 -1
  183. package/modern/mobile/mobile.css +3 -3
  184. package/modern/mobile/mobile.module.css.js +1 -1
  185. package/modern/mobile/transitions/right-side-transitions.mobile.css +7 -7
  186. package/modern/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
  187. package/modern/mobile/transitions/transitions.mobile.css +7 -7
  188. package/modern/mobile/transitions/transitions.mobile.module.css.js +1 -1
  189. package/moderncssm/desktop/components/center-modal/center-modal.js +3 -1
  190. package/moderncssm/desktop/components/center-modal/center-modal.js.map +1 -1
  191. package/moderncssm/desktop/components/side-modal/side-modal.js +3 -1
  192. package/moderncssm/desktop/components/side-modal/side-modal.js.map +1 -1
  193. package/moderncssm/desktop/utils/get-hug-content-styles.d.ts +8 -0
  194. package/moderncssm/desktop/utils/get-hug-content-styles.js +17 -0
  195. package/moderncssm/desktop/utils/get-hug-content-styles.js.map +1 -0
  196. package/moderncssm/desktop/utils/get-margin-styles.d.ts +0 -1
  197. package/moderncssm/desktop/utils/get-margin-styles.js +11 -13
  198. package/moderncssm/desktop/utils/get-margin-styles.js.map +1 -1
  199. package/package.json +8 -8
  200. package/src/desktop/components/center-modal/center-modal.tsx +3 -1
  201. package/src/desktop/components/side-modal/side-modal.tsx +3 -1
  202. package/src/desktop/utils/get-hug-content-styles.ts +24 -0
  203. package/src/desktop/utils/get-margin-styles.ts +11 -16
@@ -3,17 +3,15 @@
3
3
  --color-light-neutral-300: #e7e8eb;
4
4
  }
5
5
  :root {
6
- --gap-m: 16px;
7
- --gap-2xl: 32px;
8
- --gap-16: var(--gap-m);
9
- --gap-32: var(--gap-2xl);
6
+ --gap-16: 16px;
7
+ --gap-32: 32px;
10
8
  }
11
9
  :root {
12
10
  --universal-modal-footer-background: var(--color-light-modal-bg-primary);
13
11
  --universal-modal-footer-highlight-background: var(--color-light-modal-bg-primary);
14
12
  --universal-modal-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-neutral-300);
15
13
  }
16
- .universal-modal__footer_1fluc {
14
+ .universal-modal__footer_1w10h {
17
15
  width: 100%;
18
16
  box-sizing: border-box;
19
17
  transition:
@@ -21,12 +19,12 @@
21
19
  background 0.2s ease;
22
20
  padding: var(--gap-16) var(--gap-32) var(--gap-32);
23
21
  }
24
- .universal-modal__sticky_1fluc {
22
+ .universal-modal__sticky_1w10h {
25
23
  background: var(--universal-modal-footer-background);
26
24
  position: sticky;
27
25
  z-index: 1;
28
26
  }
29
- .universal-modal__highlighted_1fluc {
27
+ .universal-modal__highlighted_1w10h {
30
28
  background: var(--universal-modal-footer-highlight-background);
31
29
  box-shadow: var(--universal-modal-footer-highlight-box-shadow);
32
30
  }
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"footer":"universal-modal__footer_1fluc","sticky":"universal-modal__sticky_1fluc","highlighted":"universal-modal__highlighted_1fluc"};
3
+ const styles = {"footer":"universal-modal__footer_1w10h","sticky":"universal-modal__sticky_1w10h","highlighted":"universal-modal__highlighted_1w10h"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -10,22 +10,22 @@
10
10
  --universal-modal-header-highlight-background: var(--color-light-modal-bg-primary);
11
11
  --universal-modal-header-highlight-box-shadow: 0 1px 0 0 var(--color-light-neutral-300);
12
12
  }
13
- .universal-modal__header_20jy7 {
13
+ .universal-modal__header_16lgw {
14
14
  width: 100%;
15
15
  box-sizing: border-box;
16
16
  transition:
17
17
  box-shadow 0.2s ease,
18
18
  background 0.2s ease;
19
19
  }
20
- .universal-modal__header_20jy7.universal-modal__highlighted_20jy7 {
20
+ .universal-modal__header_16lgw.universal-modal__highlighted_16lgw {
21
21
  background: var(--universal-modal-header-highlight-background);
22
22
  box-shadow: var(--universal-modal-header-highlight-box-shadow);
23
23
  }
24
- .universal-modal__header_20jy7.universal-modal__sticky_20jy7 {
24
+ .universal-modal__header_16lgw.universal-modal__sticky_16lgw {
25
25
  position: sticky;
26
26
  top: var(--gap-0);
27
27
  z-index: 1;
28
28
  }
29
- .universal-modal__header_20jy7.universal-modal__sticky_20jy7.universal-modal__hasContent_20jy7 {
29
+ .universal-modal__header_16lgw.universal-modal__sticky_16lgw.universal-modal__hasContent_16lgw {
30
30
  background: var(--universal-modal-header-background);
31
31
  }
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"header":"universal-modal__header_20jy7","highlighted":"universal-modal__highlighted_20jy7","sticky":"universal-modal__sticky_20jy7","hasContent":"universal-modal__hasContent_20jy7"};
3
+ const styles = {"header":"universal-modal__header_16lgw","highlighted":"universal-modal__highlighted_16lgw","sticky":"universal-modal__sticky_16lgw","hasContent":"universal-modal__hasContent_16lgw"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -5,6 +5,7 @@ import { isMacOS, isSafari } from '@alfalab/core-components-shared/modern';
5
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
+ import { getHugContentStyles } from '../../utils/get-hug-content-styles.js';
8
9
  import { getMarginStyles } from '../../utils/get-margin-styles.js';
9
10
  import { getWidthStyle } from '../../utils/get-width-style.js';
10
11
  import { ModalContent } from '../modal-content/modal-content.js';
@@ -29,7 +30,8 @@ const CenterModal = forwardRef((props, ref) => {
29
30
  [styles.wrapperJustifyEnd]: verticalAlign === 'bottom',
30
31
  [styles.withoutOverlay]: withoutOverlay,
31
32
  }), className: cn(styles.component, className, styles.baseModalComponent, {
32
- ...getMarginStyles({ styles, margin, height }),
33
+ ...getMarginStyles({ styles, margin }),
34
+ ...getHugContentStyles({ styles, margin, height }),
33
35
  }), transitionProps: {
34
36
  classNames: transitionProps,
35
37
  ...(isFullSizeModal && fullSizeModalContentTransitions),
@@ -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 { 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 scrollLock={overlay}\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, height }),\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>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AAA,CAAC,MAAM,CAAC,iBAAiB,GAAG,aAAa,KAAK,QAAQ;AACtD,YAAA,CAAC,MAAM,CAAC,cAAc,GAAG,cAAc;AAC1C,SAAA,CAAC,EACF,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,kBAAkB,EAAE;YAClE,GAAG,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SACjD,CAAC,EACF,eAAe,EAAE;AACb,YAAA,UAAU,EAAE,eAAe;AAC3B,YAAA,IAAI,eAAe,IAAI,+BAA+B,CAAC;YACvD,GAAG,SAAS,CAAC,eAAe;AAC/B,SAAA,EACD,aAAa,EAAE;AACX,YAAA,YAAY,EAAE,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,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,sBAAsB,EACvE,EAAA,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 { getHugContentStyles } from '../../utils/get-hug-content-styles';\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 scrollLock={overlay}\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 ...getHugContentStyles({ styles, margin, height }),\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":";;;;;;;;;;;;;;;AAmBA;AACA,MAAM,eAAe,GAAG,OAAO,EAAE,IAAI,QAAQ,EAAE,GAAG,iBAAiB,GAAG,WAAW;AAEpE,MAAA,WAAW,GAAG,UAAU,CAA6C,CAAC,KAAK,EAAE,GAAG,KAAI;AAC7F,IAAA,MAAM,EACF,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,KAAK,GAAG,GAAG,EACX,MAAM,GAAG,YAAY,EACrB,aAAa,GAAG,QAAQ,EACxB,OAAO,GAAG,IAAI,EACd,MAAM,EACN,sBAAsB,EAAE,0BAA0B,EAClD,OAAO,EACP,GAAG,SAAS,EACf,GAAG,KAAK;AAET,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC;AACjD,IAAA,MAAM,EAAE,WAAW,EAAE,sBAAsB,EAAE,GAAG,yBAAyB,CAAC;QACtE,OAAO;AACP,QAAA,SAAS,EAAE,0BAA0B;AACxC,KAAA,CAAC;IAEF,MAAM,EACF,eAAe,EACf,oBAAoB,EAAE,+BAA+B,EACrD,mBAAmB,EAAE,gCAAgC,GACxD,GAAG,2BAA2B,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAEjE,IAAA,MAAM,cAAc,GAAG,CAAC,OAAO;AAE/B,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,SAAS,EACF,EAAA,GAAA,SAAS,EACb,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,EACR,YAAY,E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