@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.
- package/components/content/base-content/index.css +1 -1
- package/components/content/base-content/index.module.css.js +1 -1
- package/components/content/desktop/desktop.css +2 -2
- package/components/content/desktop/desktop.module.css.js +1 -1
- package/components/content/mobile/mobile.css +3 -3
- package/components/content/mobile/mobile.module.css.js +1 -1
- package/components/footer/base-footer/index.css +3 -3
- package/components/footer/base-footer/index.module.css.js +1 -1
- package/components/footer/desktop/desktop.css +1 -1
- package/components/footer/desktop/desktop.module.css.js +1 -1
- package/components/footer/desktop/layout.css +9 -9
- package/components/footer/desktop/layout.module.css.js +1 -1
- package/components/footer/mobile/layout.mobile.css +8 -8
- package/components/footer/mobile/layout.mobile.module.css.js +1 -1
- package/components/footer/mobile/mobile.css +2 -2
- package/components/footer/mobile/mobile.module.css.js +1 -1
- package/components/header/base-header/index.css +4 -4
- package/components/header/base-header/index.module.css.js +1 -1
- package/components/header/desktop/desktop.css +5 -5
- package/components/header/desktop/desktop.module.css.js +1 -1
- package/components/header/mobile/mobile.css +3 -3
- package/components/header/mobile/mobile.module.css.js +1 -1
- package/cssm/desktop/components/center-modal/center-modal.js +13 -8
- package/cssm/desktop/components/center-modal/center-modal.js.map +1 -1
- package/cssm/desktop/components/center-modal/index.module.css +7 -3
- package/cssm/desktop/components/modal-content/modal-content.d.ts +3 -3
- package/cssm/desktop/components/modal-content/modal-content.js +1 -3
- package/cssm/desktop/components/modal-content/modal-content.js.map +1 -1
- package/cssm/desktop/components/side-modal/index.module.css +6 -2
- package/cssm/desktop/components/side-modal/side-modal.js +14 -9
- package/cssm/desktop/components/side-modal/side-modal.js.map +1 -1
- package/cssm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
- package/cssm/desktop/hooks/use-scrollable-container-ref.js +27 -0
- package/cssm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
- package/desktop/components/center-modal/center-modal.js +13 -8
- package/desktop/components/center-modal/center-modal.js.map +1 -1
- package/desktop/components/center-modal/index.css +527 -523
- package/desktop/components/center-modal/index.module.css.js +1 -1
- package/desktop/components/center-modal/index.module.css.js.map +1 -1
- package/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
- package/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
- package/desktop/components/center-modal/transitions/transitions.css +7 -7
- package/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
- package/desktop/components/modal-content/modal-content.css +4 -4
- package/desktop/components/modal-content/modal-content.d.ts +3 -3
- package/desktop/components/modal-content/modal-content.js +1 -3
- package/desktop/components/modal-content/modal-content.js.map +1 -1
- package/desktop/components/modal-content/modal-content.module.css.js +1 -1
- package/desktop/components/side-modal/index.css +529 -525
- package/desktop/components/side-modal/index.module.css.js +1 -1
- package/desktop/components/side-modal/index.module.css.js.map +1 -1
- package/desktop/components/side-modal/side-modal.js +14 -9
- package/desktop/components/side-modal/side-modal.js.map +1 -1
- package/desktop/components/side-modal/transitions/transitions.css +71 -71
- package/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
- package/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
- package/desktop/hooks/use-scrollable-container-ref.js +27 -0
- package/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
- package/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
- package/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
- package/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
- package/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
- package/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
- package/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
- package/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
- package/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
- package/esm/components/content/base-content/index.css +1 -1
- package/esm/components/content/base-content/index.module.css.js +1 -1
- package/esm/components/content/desktop/desktop.css +2 -2
- package/esm/components/content/desktop/desktop.module.css.js +1 -1
- package/esm/components/content/mobile/mobile.css +3 -3
- package/esm/components/content/mobile/mobile.module.css.js +1 -1
- package/esm/components/footer/base-footer/index.css +3 -3
- package/esm/components/footer/base-footer/index.module.css.js +1 -1
- package/esm/components/footer/desktop/desktop.css +1 -1
- package/esm/components/footer/desktop/desktop.module.css.js +1 -1
- package/esm/components/footer/desktop/layout.css +9 -9
- package/esm/components/footer/desktop/layout.module.css.js +1 -1
- package/esm/components/footer/mobile/layout.mobile.css +8 -8
- package/esm/components/footer/mobile/layout.mobile.module.css.js +1 -1
- package/esm/components/footer/mobile/mobile.css +2 -2
- package/esm/components/footer/mobile/mobile.module.css.js +1 -1
- package/esm/components/header/base-header/index.css +4 -4
- package/esm/components/header/base-header/index.module.css.js +1 -1
- package/esm/components/header/desktop/desktop.css +5 -5
- package/esm/components/header/desktop/desktop.module.css.js +1 -1
- package/esm/components/header/mobile/mobile.css +3 -3
- package/esm/components/header/mobile/mobile.module.css.js +1 -1
- package/esm/desktop/components/center-modal/center-modal.js +13 -8
- package/esm/desktop/components/center-modal/center-modal.js.map +1 -1
- package/esm/desktop/components/center-modal/index.css +527 -523
- package/esm/desktop/components/center-modal/index.module.css.js +1 -1
- package/esm/desktop/components/center-modal/index.module.css.js.map +1 -1
- package/esm/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
- package/esm/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
- package/esm/desktop/components/center-modal/transitions/transitions.css +7 -7
- package/esm/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
- package/esm/desktop/components/modal-content/modal-content.css +4 -4
- package/esm/desktop/components/modal-content/modal-content.d.ts +3 -3
- package/esm/desktop/components/modal-content/modal-content.js +1 -3
- package/esm/desktop/components/modal-content/modal-content.js.map +1 -1
- package/esm/desktop/components/modal-content/modal-content.module.css.js +1 -1
- package/esm/desktop/components/side-modal/index.css +529 -525
- package/esm/desktop/components/side-modal/index.module.css.js +1 -1
- package/esm/desktop/components/side-modal/index.module.css.js.map +1 -1
- package/esm/desktop/components/side-modal/side-modal.js +14 -9
- package/esm/desktop/components/side-modal/side-modal.js.map +1 -1
- package/esm/desktop/components/side-modal/transitions/transitions.css +71 -71
- package/esm/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
- package/esm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
- package/esm/desktop/hooks/use-scrollable-container-ref.js +23 -0
- package/esm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
- package/esm/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
- package/esm/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
- package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
- package/esm/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
- package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
- package/esm/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
- package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
- package/esm/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
- package/esm/mobile/mobile.css +3 -3
- package/esm/mobile/mobile.module.css.js +1 -1
- package/esm/mobile/transitions/right-side-transitions.mobile.css +7 -7
- package/esm/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
- package/esm/mobile/transitions/transitions.mobile.css +7 -7
- package/esm/mobile/transitions/transitions.mobile.module.css.js +1 -1
- package/mobile/mobile.css +3 -3
- package/mobile/mobile.module.css.js +1 -1
- package/mobile/transitions/right-side-transitions.mobile.css +7 -7
- package/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
- package/mobile/transitions/transitions.mobile.css +7 -7
- package/mobile/transitions/transitions.mobile.module.css.js +1 -1
- package/modern/components/content/base-content/index.css +1 -1
- package/modern/components/content/base-content/index.module.css.js +1 -1
- package/modern/components/content/desktop/desktop.css +2 -2
- package/modern/components/content/desktop/desktop.module.css.js +1 -1
- package/modern/components/content/mobile/mobile.css +3 -3
- package/modern/components/content/mobile/mobile.module.css.js +1 -1
- package/modern/components/footer/base-footer/index.css +3 -3
- package/modern/components/footer/base-footer/index.module.css.js +1 -1
- package/modern/components/footer/desktop/desktop.css +1 -1
- package/modern/components/footer/desktop/desktop.module.css.js +1 -1
- package/modern/components/footer/desktop/layout.css +9 -9
- package/modern/components/footer/desktop/layout.module.css.js +1 -1
- package/modern/components/footer/mobile/layout.mobile.css +8 -8
- package/modern/components/footer/mobile/layout.mobile.module.css.js +1 -1
- package/modern/components/footer/mobile/mobile.css +2 -2
- package/modern/components/footer/mobile/mobile.module.css.js +1 -1
- package/modern/components/header/base-header/index.css +4 -4
- package/modern/components/header/base-header/index.module.css.js +1 -1
- package/modern/components/header/desktop/desktop.css +5 -5
- package/modern/components/header/desktop/desktop.module.css.js +1 -1
- package/modern/components/header/mobile/mobile.css +3 -3
- package/modern/components/header/mobile/mobile.module.css.js +1 -1
- package/modern/desktop/components/center-modal/center-modal.js +12 -8
- package/modern/desktop/components/center-modal/center-modal.js.map +1 -1
- package/modern/desktop/components/center-modal/index.css +527 -523
- package/modern/desktop/components/center-modal/index.module.css.js +1 -1
- package/modern/desktop/components/center-modal/index.module.css.js.map +1 -1
- package/modern/desktop/components/center-modal/transitions/safari-transitions.css +7 -7
- package/modern/desktop/components/center-modal/transitions/safari-transitions.module.css.js +1 -1
- package/modern/desktop/components/center-modal/transitions/transitions.css +7 -7
- package/modern/desktop/components/center-modal/transitions/transitions.module.css.js +1 -1
- package/modern/desktop/components/modal-content/modal-content.css +4 -4
- package/modern/desktop/components/modal-content/modal-content.d.ts +3 -3
- package/modern/desktop/components/modal-content/modal-content.js +1 -3
- package/modern/desktop/components/modal-content/modal-content.js.map +1 -1
- package/modern/desktop/components/modal-content/modal-content.module.css.js +1 -1
- package/modern/desktop/components/side-modal/index.css +529 -525
- package/modern/desktop/components/side-modal/index.module.css.js +1 -1
- package/modern/desktop/components/side-modal/index.module.css.js.map +1 -1
- package/modern/desktop/components/side-modal/side-modal.js +12 -8
- package/modern/desktop/components/side-modal/side-modal.js.map +1 -1
- package/modern/desktop/components/side-modal/transitions/transitions.css +71 -71
- package/modern/desktop/components/side-modal/transitions/transitions.module.css.js +1 -1
- package/modern/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
- package/modern/desktop/hooks/use-scrollable-container-ref.js +21 -0
- package/modern/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
- package/modern/desktop/styles/transitions/full-size-backdrop-transitions.css +13 -13
- package/modern/desktop/styles/transitions/full-size-backdrop-transitions.module.css.js +1 -1
- package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.css +7 -7
- package/modern/desktop/styles/transitions/full-size-vertical-bottom-transitions.module.css.js +1 -1
- package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.css +7 -7
- package/modern/desktop/styles/transitions/full-size-vertical-center-transitions.module.css.js +1 -1
- package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.css +7 -7
- package/modern/desktop/styles/transitions/full-size-vertical-top-transitions.module.css.js +1 -1
- package/modern/mobile/mobile.css +3 -3
- package/modern/mobile/mobile.module.css.js +1 -1
- package/modern/mobile/transitions/right-side-transitions.mobile.css +7 -7
- package/modern/mobile/transitions/right-side-transitions.mobile.module.css.js +1 -1
- package/modern/mobile/transitions/transitions.mobile.css +7 -7
- package/modern/mobile/transitions/transitions.mobile.module.css.js +1 -1
- package/moderncssm/desktop/components/center-modal/center-modal.js +12 -8
- package/moderncssm/desktop/components/center-modal/center-modal.js.map +1 -1
- package/moderncssm/desktop/components/center-modal/index.module.css +9 -4
- package/moderncssm/desktop/components/modal-content/modal-content.d.ts +3 -3
- package/moderncssm/desktop/components/modal-content/modal-content.js +1 -3
- package/moderncssm/desktop/components/modal-content/modal-content.js.map +1 -1
- package/moderncssm/desktop/components/side-modal/index.module.css +7 -2
- package/moderncssm/desktop/components/side-modal/side-modal.js +12 -8
- package/moderncssm/desktop/components/side-modal/side-modal.js.map +1 -1
- package/moderncssm/desktop/hooks/use-scrollable-container-ref.d.ts +10 -0
- package/moderncssm/desktop/hooks/use-scrollable-container-ref.js +21 -0
- package/moderncssm/desktop/hooks/use-scrollable-container-ref.js.map +1 -0
- package/package.json +3 -3
- package/src/desktop/components/center-modal/center-modal.module.css +1 -5
- package/src/desktop/components/center-modal/center-modal.tsx +14 -14
- package/src/desktop/components/center-modal/index.module.css +2 -1
- package/src/desktop/components/modal-content/modal-content.tsx +8 -9
- package/src/desktop/components/side-modal/index.module.css +2 -1
- package/src/desktop/components/side-modal/side-modal.module.css +0 -4
- package/src/desktop/components/side-modal/side-modal.tsx +14 -14
- package/src/desktop/hooks/use-scrollable-container-ref.ts +29 -0
- package/src/desktop/styles/common.module.css +10 -0
- package/cssm/desktop/hooks/use-outside-scroll.d.ts +0 -8
- package/cssm/desktop/hooks/use-outside-scroll.js +0 -21
- package/cssm/desktop/hooks/use-outside-scroll.js.map +0 -1
- package/cssm/desktop/hooks/useModalWheel.d.ts +0 -5
- package/cssm/desktop/hooks/useModalWheel.js +0 -20
- package/cssm/desktop/hooks/useModalWheel.js.map +0 -1
- package/desktop/hooks/use-outside-scroll.d.ts +0 -8
- package/desktop/hooks/use-outside-scroll.js +0 -21
- package/desktop/hooks/use-outside-scroll.js.map +0 -1
- package/desktop/hooks/useModalWheel.d.ts +0 -5
- package/desktop/hooks/useModalWheel.js +0 -20
- package/desktop/hooks/useModalWheel.js.map +0 -1
- package/esm/desktop/hooks/use-outside-scroll.d.ts +0 -8
- package/esm/desktop/hooks/use-outside-scroll.js +0 -17
- package/esm/desktop/hooks/use-outside-scroll.js.map +0 -1
- package/esm/desktop/hooks/useModalWheel.d.ts +0 -5
- package/esm/desktop/hooks/useModalWheel.js +0 -16
- package/esm/desktop/hooks/useModalWheel.js.map +0 -1
- package/modern/desktop/hooks/use-outside-scroll.d.ts +0 -8
- package/modern/desktop/hooks/use-outside-scroll.js +0 -17
- package/modern/desktop/hooks/use-outside-scroll.js.map +0 -1
- package/modern/desktop/hooks/useModalWheel.d.ts +0 -5
- package/modern/desktop/hooks/useModalWheel.js +0 -16
- package/modern/desktop/hooks/useModalWheel.js.map +0 -1
- package/moderncssm/desktop/hooks/use-outside-scroll.d.ts +0 -8
- package/moderncssm/desktop/hooks/use-outside-scroll.js +0 -17
- package/moderncssm/desktop/hooks/use-outside-scroll.js.map +0 -1
- package/moderncssm/desktop/hooks/useModalWheel.d.ts +0 -5
- package/moderncssm/desktop/hooks/useModalWheel.js +0 -16
- package/moderncssm/desktop/hooks/useModalWheel.js.map +0 -1
- package/src/desktop/hooks/use-outside-scroll.ts +0 -20
- package/src/desktop/hooks/useModalWheel.ts +0 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './full-size-vertical-top-transitions.css';
|
|
2
2
|
|
|
3
|
-
const fullSizeVerticalTopTransitions = {"appear":"universal-
|
|
3
|
+
const fullSizeVerticalTopTransitions = {"appear":"universal-modal__appear_qhje1","enter":"universal-modal__enter_qhje1","appearActive":"universal-modal__appearActive_qhje1","enterActive":"universal-modal__enterActive_qhje1","exit":"universal-modal__exit_qhje1","exitActive":"universal-modal__exitActive_qhje1","exitDone":"universal-modal__exitDone_qhje1"};
|
|
4
4
|
|
|
5
5
|
export { fullSizeVerticalTopTransitions as default };
|
|
6
6
|
//# sourceMappingURL=full-size-vertical-top-transitions.module.css.js.map
|
package/modern/mobile/mobile.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-0: 0px;
|
|
3
3
|
}
|
|
4
|
-
.universal-
|
|
4
|
+
.universal-modal__component_1sesv {
|
|
5
5
|
top: var(--gap-0);
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
}
|
|
14
|
-
.universal-
|
|
14
|
+
.universal-modal__component_1sesv .universal-modal__content_1sesv {
|
|
15
15
|
height: auto;
|
|
16
16
|
}
|
|
17
|
-
.universal-
|
|
17
|
+
.universal-modal__component_1sesv.universal-modal__component_1sesv {
|
|
18
18
|
position: fixed;
|
|
19
19
|
flex: 1;
|
|
20
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './mobile.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"universal-
|
|
3
|
+
const styles = {"component":"universal-modal__component_1sesv","content":"universal-modal__content_1sesv"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=mobile.module.css.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.universal-
|
|
2
|
-
.universal-
|
|
1
|
+
.universal-modal__appear_lb0xx,
|
|
2
|
+
.universal-modal__enter_lb0xx {
|
|
3
3
|
transform: translateX(100%);
|
|
4
4
|
}
|
|
5
|
-
.universal-
|
|
6
|
-
.universal-
|
|
5
|
+
.universal-modal__appearActive_lb0xx,
|
|
6
|
+
.universal-modal__enterActive_lb0xx {
|
|
7
7
|
transform: translateX(0);
|
|
8
8
|
transition: transform 280ms ease-in-out;
|
|
9
9
|
transition-delay: 80ms;
|
|
10
10
|
}
|
|
11
|
-
.universal-
|
|
11
|
+
.universal-modal__exit_lb0xx {
|
|
12
12
|
transform: translateX(0);
|
|
13
13
|
}
|
|
14
|
-
.universal-
|
|
15
|
-
.universal-
|
|
14
|
+
.universal-modal__exitActive_lb0xx,
|
|
15
|
+
.universal-modal__exitDone_lb0xx {
|
|
16
16
|
transform: translateX(100%);
|
|
17
17
|
transition: transform 280ms ease-in-out;
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './right-side-transitions.mobile.css';
|
|
2
2
|
|
|
3
|
-
const rightSideTransitions = {"appear":"universal-
|
|
3
|
+
const rightSideTransitions = {"appear":"universal-modal__appear_lb0xx","enter":"universal-modal__enter_lb0xx","appearActive":"universal-modal__appearActive_lb0xx","enterActive":"universal-modal__enterActive_lb0xx","exit":"universal-modal__exit_lb0xx","exitActive":"universal-modal__exitActive_lb0xx","exitDone":"universal-modal__exitDone_lb0xx"};
|
|
4
4
|
|
|
5
5
|
export { rightSideTransitions as default };
|
|
6
6
|
//# sourceMappingURL=right-side-transitions.mobile.module.css.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.universal-
|
|
2
|
-
.universal-
|
|
1
|
+
.universal-modal__appear_e8qz6,
|
|
2
|
+
.universal-modal__enter_e8qz6 {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transform: translateY(15px);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.universal-
|
|
8
|
-
.universal-
|
|
7
|
+
.universal-modal__appearActive_e8qz6,
|
|
8
|
+
.universal-modal__enterActive_e8qz6 {
|
|
9
9
|
opacity: 1;
|
|
10
10
|
transform: translateY(0);
|
|
11
11
|
transition:
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
transform 200ms ease-in;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.universal-
|
|
16
|
+
.universal-modal__exit_e8qz6 {
|
|
17
17
|
opacity: 1;
|
|
18
18
|
transform: translateY(0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.universal-
|
|
22
|
-
.universal-
|
|
21
|
+
.universal-modal__exitActive_e8qz6,
|
|
22
|
+
.universal-modal__exitDone_e8qz6 {
|
|
23
23
|
opacity: 0;
|
|
24
24
|
transform: translateY(15px);
|
|
25
25
|
transition:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './transitions.mobile.css';
|
|
2
2
|
|
|
3
|
-
const transitions = {"appear":"universal-
|
|
3
|
+
const transitions = {"appear":"universal-modal__appear_e8qz6","enter":"universal-modal__enter_e8qz6","appearActive":"universal-modal__appearActive_e8qz6","enterActive":"universal-modal__enterActive_e8qz6","exit":"universal-modal__exit_e8qz6","exitActive":"universal-modal__exitActive_e8qz6","exitDone":"universal-modal__exitDone_e8qz6"};
|
|
4
4
|
|
|
5
5
|
export { transitions as default };
|
|
6
6
|
//# sourceMappingURL=transitions.mobile.module.css.js.map
|
|
@@ -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/moderncssm';
|
|
4
4
|
import { isMacOS, isSafari } from '@alfalab/core-components-shared/moderncssm';
|
|
5
|
-
import {
|
|
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';
|
|
|
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 {
|
|
20
|
+
const { handleWheel, scrollableContainerRef } = useScrollableContainerRef({
|
|
21
|
+
overlay,
|
|
22
|
+
refObject: scrollableContainerRefProp,
|
|
23
|
+
});
|
|
21
24
|
const { isFullSizeModal, componentTransitions: fullSizeModalContentTransitions, backdropTransitions: fullSizeModalBackdropTransitions, } = getFullSizeModalTransitions({ verticalAlign, width, height });
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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,
|
|
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 {
|
|
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,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;AAEj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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;;;;"}
|
|
@@ -10,10 +10,6 @@
|
|
|
10
10
|
backface-visibility: hidden;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.component.overlayHidden {
|
|
14
|
-
box-shadow: var(--shadow-m);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
.wrapperJustifyStart {
|
|
18
14
|
justify-content: flex-start;
|
|
19
15
|
}
|
|
@@ -26,6 +22,15 @@
|
|
|
26
22
|
justify-content: flex-end;
|
|
27
23
|
}
|
|
28
24
|
|
|
25
|
+
.baseModalContainer.withoutOverlay {
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.baseModalContainer.withoutOverlay .baseModalComponent {
|
|
30
|
+
pointer-events: auto;
|
|
31
|
+
box-shadow: var(--shadow-m);
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
.marginTop-0 {
|
|
30
35
|
margin-top: 0px;
|
|
31
36
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type BaseModalProps } from '@alfalab/core-components-base-modal/moderncssm';
|
|
3
3
|
import { type UniversalModalDesktopProps } from '../../types/props';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type PickedBaseModalProps = Pick<BaseModalProps, 'children'>;
|
|
5
|
+
type PickedUniversalModalDesktopProps = Pick<UniversalModalDesktopProps, 'height' | 'scrollableContainerRef'>;
|
|
6
|
+
type Props = PickedBaseModalProps & PickedUniversalModalDesktopProps;
|
|
7
7
|
export declare const ModalContent: FC<Props>;
|
|
8
8
|
export {};
|
|
@@ -3,13 +3,12 @@ import mergeRefs from 'react-merge-refs';
|
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { Scrollbar } from '@alfalab/core-components-scrollbar/moderncssm';
|
|
5
5
|
import { useModalHighlighted } from '../../hooks/use-modal-highlighted.js';
|
|
6
|
-
import { useOutsideScroll } from '../../hooks/use-outside-scroll.js';
|
|
7
6
|
import { useSetScrollbarHeight } from '../../hooks/use-set-scrollbar-height.js';
|
|
8
7
|
import { setFooterAndHeaderRefs } from '../../utils/set-footer-and-header-refs.js';
|
|
9
8
|
import styles from './modal-content.module.css';
|
|
10
9
|
|
|
11
10
|
const ModalContent = (props) => {
|
|
12
|
-
const { children,
|
|
11
|
+
const { children, height, scrollableContainerRef = null } = props;
|
|
13
12
|
const scrollableNodeRef = useRef(null);
|
|
14
13
|
const scrollbarContentNodeRef = useRef(null);
|
|
15
14
|
const scrollbarRef = useRef(null);
|
|
@@ -17,7 +16,6 @@ const ModalContent = (props) => {
|
|
|
17
16
|
const headerElementRef = useRef(null);
|
|
18
17
|
const footerElementRef = useRef(null);
|
|
19
18
|
const { handleScroll } = useModalHighlighted({ scrollbarContentNodeRef, scrollableNodeRef });
|
|
20
|
-
useOutsideScroll({ scrollableNodeRef, wheelDeltaY });
|
|
21
19
|
const { enhancedChildren } = setFooterAndHeaderRefs({
|
|
22
20
|
children,
|
|
23
21
|
headerElementRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.js","sources":["../../../../src/desktop/components/modal-content/modal-content.tsx"],"sourcesContent":["import React, { type FC, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type BaseModalProps } from '@alfalab/core-components-base-modal';\nimport { Scrollbar } from '@alfalab/core-components-scrollbar';\n\nimport { useModalHighlighted } from '../../hooks/use-modal-highlighted';\nimport {
|
|
1
|
+
{"version":3,"file":"modal-content.js","sources":["../../../../src/desktop/components/modal-content/modal-content.tsx"],"sourcesContent":["import React, { type FC, useRef } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type BaseModalProps } from '@alfalab/core-components-base-modal';\nimport { Scrollbar } from '@alfalab/core-components-scrollbar';\n\nimport { useModalHighlighted } from '../../hooks/use-modal-highlighted';\nimport { useSetScrollbarHeight } from '../../hooks/use-set-scrollbar-height';\nimport { type UniversalModalDesktopProps } from '../../types/props';\nimport { setFooterAndHeaderRefs } from '../../utils/set-footer-and-header-refs';\n\nimport styles from './modal-content.module.css';\n\ntype PickedBaseModalProps = Pick<BaseModalProps, 'children'>;\ntype PickedUniversalModalDesktopProps = Pick<\n UniversalModalDesktopProps,\n 'height' | 'scrollableContainerRef'\n>;\n\ntype Props = PickedBaseModalProps & PickedUniversalModalDesktopProps;\n\nexport const ModalContent: FC<Props> = (props) => {\n const { children, height, scrollableContainerRef = null } = props;\n\n const scrollableNodeRef = useRef<HTMLDivElement>(null);\n const scrollbarContentNodeRef = useRef<HTMLDivElement>(null);\n const scrollbarRef = useRef<HTMLDivElement | null>(null);\n const verticalBarRef = useRef<HTMLDivElement>(null);\n const headerElementRef = useRef<HTMLDivElement>(null);\n const footerElementRef = useRef<HTMLDivElement | null>(null);\n\n const { handleScroll } = useModalHighlighted({ scrollbarContentNodeRef, scrollableNodeRef });\n\n const { enhancedChildren } = setFooterAndHeaderRefs({\n children,\n headerElementRef,\n footerElementRef,\n });\n\n useSetScrollbarHeight({ scrollbarRef, verticalBarRef, headerElementRef, footerElementRef });\n\n return (\n <Scrollbar\n className={styles.scrollable}\n ref={scrollbarRef}\n verticalBarRef={verticalBarRef}\n scrollableNodeProps={{\n ref: mergeRefs([scrollableNodeRef, scrollableContainerRef]),\n className: styles.scrollableNode,\n }}\n contentNodeProps={{\n ref: scrollbarContentNodeRef,\n className: cn(styles.contentNode, {\n [styles.hugContent]: height === 'hugContent',\n }),\n }}\n onContentScroll={handleScroll}\n >\n {enhancedChildren}\n </Scrollbar>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAsBa,MAAA,YAAY,GAAc,CAAC,KAAK,KAAI;IAC7C,MAAM,EAAE,Q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;;;;"}
|
|
@@ -30,10 +30,15 @@
|
|
|
30
30
|
backface-visibility: hidden;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.
|
|
34
|
-
|
|
33
|
+
.baseModalContainer.withoutOverlay {
|
|
34
|
+
pointer-events: none;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
.baseModalContainer.withoutOverlay .baseModalComponent {
|
|
38
|
+
pointer-events: auto;
|
|
39
|
+
box-shadow: var(--shadow-m);
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
.marginTop-0 {
|
|
38
43
|
margin-top: 0px;
|
|
39
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useRef } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { BaseModal } from '@alfalab/core-components-base-modal/moderncssm';
|
|
4
|
-
import {
|
|
4
|
+
import { useScrollableContainerRef } from '../../hooks/use-scrollable-container-ref.js';
|
|
5
5
|
import { getFullSizeModalTransitions } from '../../utils/get-full-size-modal-transitions.js';
|
|
6
6
|
import { getHeightStyle } from '../../utils/get-height-style.js';
|
|
7
7
|
import { getMarginStyles } from '../../utils/get-margin-styles.js';
|
|
@@ -11,18 +11,22 @@ import { getDefaultTransitionProps } from './get-default-transition-props.js';
|
|
|
11
11
|
import styles from './index.module.css';
|
|
12
12
|
|
|
13
13
|
const SideModal = forwardRef((props, ref) => {
|
|
14
|
-
const { width = 500, height = 'fullHeight', horizontalAlign = 'center', verticalAlign = 'center', overlay = true, open, dataTestId, className, children, margin, scrollableContainerRef, onClose, ...restProps } = props;
|
|
14
|
+
const { width = 500, height = 'fullHeight', horizontalAlign = 'center', verticalAlign = 'center', overlay = true, open, dataTestId, className, children, margin, scrollableContainerRef: scrollableContainerRefProp, onClose, ...restProps } = props;
|
|
15
15
|
const componentRef = useRef(null);
|
|
16
16
|
const contentRef = useRef(null);
|
|
17
|
-
const {
|
|
17
|
+
const { handleWheel, scrollableContainerRef } = useScrollableContainerRef({
|
|
18
|
+
overlay,
|
|
19
|
+
refObject: scrollableContainerRefProp,
|
|
20
|
+
});
|
|
18
21
|
const { isFullSizeModal, componentTransitions: fullSizeModalContentTransitions, backdropTransitions: fullSizeModalBackdropTransitions, } = getFullSizeModalTransitions({ verticalAlign, width, height });
|
|
19
|
-
|
|
22
|
+
const withoutOverlay = !overlay;
|
|
23
|
+
return (React.createElement(BaseModal, { ...restProps, open: open, dataTestId: dataTestId, ref: ref, componentRef: componentRef, contentElementRef: contentRef, scrollHandler: 'content', disableBlockingScroll: withoutOverlay, wrapperClassName: cn(styles.wrapper, styles.baseModalContainer, {
|
|
20
24
|
[styles.wrapperAlignStart]: horizontalAlign === 'start',
|
|
21
25
|
[styles.wrapperAlignEnd]: horizontalAlign === 'end',
|
|
22
26
|
[styles.wrapperJustifyCenter]: verticalAlign === 'center',
|
|
23
27
|
[styles.wrapperJustifyEnd]: verticalAlign === 'bottom',
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
[styles.withoutOverlay]: withoutOverlay,
|
|
29
|
+
}), className: cn(styles.component, className, styles.baseModalComponent, {
|
|
26
30
|
...getMarginStyles({ styles, margin }),
|
|
27
31
|
}), contentClassName: styles.content, transitionProps: {
|
|
28
32
|
...getDefaultTransitionProps({
|
|
@@ -32,7 +36,7 @@ const SideModal = forwardRef((props, ref) => {
|
|
|
32
36
|
...(isFullSizeModal && fullSizeModalContentTransitions),
|
|
33
37
|
...restProps.transitionProps,
|
|
34
38
|
}, backdropProps: {
|
|
35
|
-
|
|
39
|
+
shouldRender: overlay,
|
|
36
40
|
...(isFullSizeModal && fullSizeModalBackdropTransitions),
|
|
37
41
|
...restProps.backdropProps,
|
|
38
42
|
}, componentDivProps: {
|
|
@@ -41,7 +45,7 @@ const SideModal = forwardRef((props, ref) => {
|
|
|
41
45
|
...getHeightStyle(height, margin),
|
|
42
46
|
},
|
|
43
47
|
}, onWheel: handleWheel, onClose: onClose },
|
|
44
|
-
React.createElement(ModalContent, { height: height,
|
|
48
|
+
React.createElement(ModalContent, { height: height, scrollableContainerRef: scrollableContainerRef }, children)));
|
|
45
49
|
});
|
|
46
50
|
|
|
47
51
|
export { SideModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-modal.js","sources":["../../../../src/desktop/components/side-modal/side-modal.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\n\nimport {
|
|
1
|
+
{"version":3,"file":"side-modal.js","sources":["../../../../src/desktop/components/side-modal/side-modal.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { BaseModal } from '@alfalab/core-components-base-modal';\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 { getDefaultTransitionProps } from './get-default-transition-props';\n\nimport styles from './index.module.css';\n\nexport const SideModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps>((props, ref) => {\n const {\n width = 500,\n height = 'fullHeight',\n horizontalAlign = 'center',\n verticalAlign = 'center',\n overlay = true,\n open,\n dataTestId,\n className,\n children,\n margin,\n scrollableContainerRef: scrollableContainerRefProp,\n onClose,\n ...restProps\n } = props;\n const componentRef = useRef<HTMLDivElement>(null);\n const contentRef = 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 contentElementRef={contentRef}\n scrollHandler='content'\n disableBlockingScroll={withoutOverlay}\n wrapperClassName={cn(styles.wrapper, styles.baseModalContainer, {\n [styles.wrapperAlignStart]: horizontalAlign === 'start',\n [styles.wrapperAlignEnd]: horizontalAlign === 'end',\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 contentClassName={styles.content}\n transitionProps={{\n ...getDefaultTransitionProps({\n horizontalAlign,\n margin,\n }),\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":";;;;;;;;;;;;AAiBa,MAAA,SAAS,GAAG,UAAU,CAA6C,CAAC,KAAK,EAAE,GAAG,KAAI;AAC3F,IAAA,MAAM,EACF,KAAK,GAAG,GAAG,EACX,MAAM,GAAG,YAAY,EACrB,eAAe,GAAG,QAAQ,EAC1B,aAAa,GAAG,QAAQ,EACxB,OAAO,GAAG,IAAI,EACd,IAAI,EACJ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,MAAM,EACN,sBAAsB,EAAE,0BAA0B,EAClD,OAAO,EACP,GAAG,SAAS,EACf,GAAG,KAAK;AACT,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC;AACjD,IAAA,MAAM,UA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AAyB,CAAC;gBACzB,eAAe;gBACf,MAAM;aACT,CAAC;AACF,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;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject, type WheelEvent } from 'react';
|
|
2
|
+
interface Params {
|
|
3
|
+
overlay: boolean;
|
|
4
|
+
refObject?: RefObject<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const useScrollableContainerRef: ({ overlay, refObject }: Params) => {
|
|
7
|
+
handleWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
8
|
+
scrollableContainerRef: RefObject<HTMLDivElement>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const useScrollableContainerRef = ({ overlay, refObject }) => {
|
|
4
|
+
const innerScrollableContainerRef = useRef(null);
|
|
5
|
+
const scrollableContainerRef = refObject || innerScrollableContainerRef;
|
|
6
|
+
const handleWheel = useCallback((e) => {
|
|
7
|
+
if (!overlay || e.target !== e.currentTarget) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
scrollableContainerRef.current?.scrollBy({
|
|
11
|
+
top: e.deltaY,
|
|
12
|
+
});
|
|
13
|
+
}, [overlay, scrollableContainerRef]);
|
|
14
|
+
return {
|
|
15
|
+
handleWheel,
|
|
16
|
+
scrollableContainerRef,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { useScrollableContainerRef };
|
|
21
|
+
//# sourceMappingURL=use-scrollable-container-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scrollable-container-ref.js","sources":["../../../src/desktop/hooks/use-scrollable-container-ref.ts"],"sourcesContent":["import { type RefObject, useCallback, useRef, type WheelEvent } from 'react';\n\ninterface Params {\n overlay: boolean;\n refObject?: RefObject<HTMLDivElement>;\n}\n\nexport const useScrollableContainerRef = ({ overlay, refObject }: Params) => {\n const innerScrollableContainerRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = refObject || innerScrollableContainerRef;\n\n const handleWheel = useCallback(\n (e: WheelEvent<HTMLElement>) => {\n if (!overlay || e.target !== e.currentTarget) {\n return;\n }\n\n scrollableContainerRef.current?.scrollBy({\n top: e.deltaY,\n });\n },\n [overlay, scrollableContainerRef],\n );\n\n return {\n handleWheel,\n scrollableContainerRef,\n };\n};\n"],"names":[],"mappings":";;AAOa,MAAA,yBAAyB,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAU,KAAI;AACxE,IAAA,MAAM,2BAA2B,GAAG,MAAM,CAAiB,IAAI,CAAC;AAChE,IAAA,MAAM,sBAAsB,GAAG,SAAS,IAAI,2BAA2B;AAEvE,IAAA,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,CAA0B,KAAI;QAC3B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa,EAAE;YAC1C;;AAGJ,QAAA,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC;YACrC,GAAG,EAAE,CAAC,CAAC,MAAM;AAChB,SAAA,CAAC;AACN,KAAC,EACD,CAAC,OAAO,EAAE,sBAAsB,CAAC,CACpC;IAED,OAAO;QACH,WAAW;QACX,sBAAsB;KACzB;AACL;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-universal-modal",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "UniversalModal component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"module": "./esm/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@alfalab/core-components-backdrop": "^5.0.2",
|
|
14
|
-
"@alfalab/core-components-base-modal": "^7.1.
|
|
14
|
+
"@alfalab/core-components-base-modal": "^7.1.3",
|
|
15
15
|
"@alfalab/core-components-mq": "^6.0.3",
|
|
16
16
|
"@alfalab/core-components-navigation-bar-private": "^2.0.6",
|
|
17
17
|
"@alfalab/core-components-scrollbar": "^5.0.2",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"access": "public",
|
|
31
31
|
"directory": "dist"
|
|
32
32
|
},
|
|
33
|
-
"themesVersion": "15.0.
|
|
33
|
+
"themesVersion": "15.0.3",
|
|
34
34
|
"varsVersion": "11.0.2"
|
|
35
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '@alfalab/core-components-vars/src/index.css';
|
|
2
2
|
|
|
3
3
|
.component {
|
|
4
4
|
border-radius: var(--border-radius-24);
|
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
will-change: transform, opacity;
|
|
13
13
|
backface-visibility: hidden;
|
|
14
|
-
|
|
15
|
-
&.overlayHidden {
|
|
16
|
-
box-shadow: var(--shadow-m);
|
|
17
|
-
}
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
.wrapperJustifyStart {
|
|
@@ -4,7 +4,7 @@ import cn from 'classnames';
|
|
|
4
4
|
import { BaseModal } from '@alfalab/core-components-base-modal';
|
|
5
5
|
import { isMacOS, isSafari } from '@alfalab/core-components-shared';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useScrollableContainerRef } from '../../hooks/use-scrollable-container-ref';
|
|
8
8
|
import { type UniversalModalDesktopProps } from '../../types/props';
|
|
9
9
|
import { getFullSizeModalTransitions } from '../../utils/get-full-size-modal-transitions';
|
|
10
10
|
import { getHeightStyle } from '../../utils/get-height-style';
|
|
@@ -30,14 +30,16 @@ export const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps
|
|
|
30
30
|
verticalAlign = 'center',
|
|
31
31
|
overlay = true,
|
|
32
32
|
margin,
|
|
33
|
-
scrollableContainerRef,
|
|
33
|
+
scrollableContainerRef: scrollableContainerRefProp,
|
|
34
34
|
onClose,
|
|
35
35
|
...restProps
|
|
36
36
|
} = props;
|
|
37
37
|
|
|
38
38
|
const componentRef = useRef<HTMLDivElement>(null);
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const { handleWheel, scrollableContainerRef } = useScrollableContainerRef({
|
|
40
|
+
overlay,
|
|
41
|
+
refObject: scrollableContainerRefProp,
|
|
42
|
+
});
|
|
41
43
|
|
|
42
44
|
const {
|
|
43
45
|
isFullSizeModal,
|
|
@@ -45,6 +47,8 @@ export const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps
|
|
|
45
47
|
backdropTransitions: fullSizeModalBackdropTransitions,
|
|
46
48
|
} = getFullSizeModalTransitions({ verticalAlign, width, height });
|
|
47
49
|
|
|
50
|
+
const withoutOverlay = !overlay;
|
|
51
|
+
|
|
48
52
|
return (
|
|
49
53
|
<BaseModal
|
|
50
54
|
{...restProps}
|
|
@@ -53,14 +57,14 @@ export const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps
|
|
|
53
57
|
ref={ref}
|
|
54
58
|
componentRef={componentRef}
|
|
55
59
|
scrollHandler='content'
|
|
56
|
-
disableBlockingScroll={
|
|
57
|
-
wrapperClassName={cn({
|
|
60
|
+
disableBlockingScroll={withoutOverlay}
|
|
61
|
+
wrapperClassName={cn(styles.baseModalContainer, {
|
|
58
62
|
[styles.wrapperJustifyStart]: verticalAlign === 'top',
|
|
59
63
|
[styles.wrapperJustifyCenter]: verticalAlign === 'center',
|
|
60
64
|
[styles.wrapperJustifyEnd]: verticalAlign === 'bottom',
|
|
65
|
+
[styles.withoutOverlay]: withoutOverlay,
|
|
61
66
|
})}
|
|
62
|
-
className={cn(styles.component, className, {
|
|
63
|
-
[styles.overlayHidden]: !overlay,
|
|
67
|
+
className={cn(styles.component, className, styles.baseModalComponent, {
|
|
64
68
|
...getMarginStyles({ styles, margin }),
|
|
65
69
|
})}
|
|
66
70
|
transitionProps={{
|
|
@@ -69,7 +73,7 @@ export const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps
|
|
|
69
73
|
...restProps.transitionProps,
|
|
70
74
|
}}
|
|
71
75
|
backdropProps={{
|
|
72
|
-
|
|
76
|
+
shouldRender: overlay,
|
|
73
77
|
...(isFullSizeModal && fullSizeModalBackdropTransitions),
|
|
74
78
|
...restProps.backdropProps,
|
|
75
79
|
}}
|
|
@@ -82,11 +86,7 @@ export const CenterModal = forwardRef<HTMLDivElement, UniversalModalDesktopProps
|
|
|
82
86
|
onWheel={handleWheel}
|
|
83
87
|
onClose={onClose}
|
|
84
88
|
>
|
|
85
|
-
<ModalContent
|
|
86
|
-
height={height}
|
|
87
|
-
wheelDeltaY={wheelDeltaY}
|
|
88
|
-
scrollableContainerRef={scrollableContainerRef}
|
|
89
|
-
>
|
|
89
|
+
<ModalContent height={height} scrollableContainerRef={scrollableContainerRef}>
|
|
90
90
|
{children}
|
|
91
91
|
</ModalContent>
|
|
92
92
|
</BaseModal>
|
|
@@ -6,21 +6,22 @@ import { type BaseModalProps } from '@alfalab/core-components-base-modal';
|
|
|
6
6
|
import { Scrollbar } from '@alfalab/core-components-scrollbar';
|
|
7
7
|
|
|
8
8
|
import { useModalHighlighted } from '../../hooks/use-modal-highlighted';
|
|
9
|
-
import { useOutsideScroll } from '../../hooks/use-outside-scroll';
|
|
10
9
|
import { useSetScrollbarHeight } from '../../hooks/use-set-scrollbar-height';
|
|
11
10
|
import { type UniversalModalDesktopProps } from '../../types/props';
|
|
12
11
|
import { setFooterAndHeaderRefs } from '../../utils/set-footer-and-header-refs';
|
|
13
12
|
|
|
14
13
|
import styles from './modal-content.module.css';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
type PickedBaseModalProps = Pick<BaseModalProps, 'children'>;
|
|
16
|
+
type PickedUniversalModalDesktopProps = Pick<
|
|
17
|
+
UniversalModalDesktopProps,
|
|
18
|
+
'height' | 'scrollableContainerRef'
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
type Props = PickedBaseModalProps & PickedUniversalModalDesktopProps;
|
|
21
22
|
|
|
22
23
|
export const ModalContent: FC<Props> = (props) => {
|
|
23
|
-
const { children,
|
|
24
|
+
const { children, height, scrollableContainerRef = null } = props;
|
|
24
25
|
|
|
25
26
|
const scrollableNodeRef = useRef<HTMLDivElement>(null);
|
|
26
27
|
const scrollbarContentNodeRef = useRef<HTMLDivElement>(null);
|
|
@@ -31,8 +32,6 @@ export const ModalContent: FC<Props> = (props) => {
|
|
|
31
32
|
|
|
32
33
|
const { handleScroll } = useModalHighlighted({ scrollbarContentNodeRef, scrollableNodeRef });
|
|
33
34
|
|
|
34
|
-
useOutsideScroll({ scrollableNodeRef, wheelDeltaY });
|
|
35
|
-
|
|
36
35
|
const { enhancedChildren } = setFooterAndHeaderRefs({
|
|
37
36
|
children,
|
|
38
37
|
headerElementRef,
|