@alfalab/core-components-modal 6.0.11 → 6.0.12
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/Component.d.ts +12 -0
- package/Component.desktop.d.ts +5 -44
- package/Component.desktop.js +14 -43
- package/Component.js +65 -0
- package/Component.mobile.d.ts +5 -18
- package/Component.mobile.js +13 -21
- package/Component.responsive.d.ts +5 -21
- package/Component.responsive.js +12 -34
- package/ResponsiveContext.d.ts +5 -0
- package/ResponsiveContext.js +16 -0
- package/components/closer/Component.js +3 -3
- package/components/closer/index.css +4 -4
- package/components/content/Component.d.ts +3 -16
- package/components/content/Component.js +11 -1
- package/components/content/desktop.css +8 -8
- package/components/content/index.css +3 -3
- package/components/content/mobile.css +3 -3
- package/components/footer/Component.js +15 -2
- package/components/footer/desktop.css +9 -9
- package/components/footer/index.css +4 -4
- package/components/footer/layout.css +25 -25
- package/components/footer/mobile.css +3 -3
- package/components/header/Component.d.ts +49 -0
- package/components/header/Component.js +57 -5
- package/components/header/desktop.css +17 -17
- package/components/header/index.css +15 -15
- package/components/header/mobile.css +3 -3
- package/cssm/Component.d.ts +12 -0
- package/cssm/Component.desktop.d.ts +5 -44
- package/cssm/Component.desktop.js +22 -45
- package/cssm/Component.js +62 -0
- package/cssm/Component.mobile.d.ts +5 -18
- package/cssm/Component.mobile.js +20 -22
- package/cssm/Component.responsive.d.ts +5 -21
- package/cssm/Component.responsive.js +18 -39
- package/cssm/ResponsiveContext.d.ts +5 -0
- package/cssm/ResponsiveContext.js +16 -0
- package/cssm/components/closer/Component.js +1 -1
- package/cssm/components/content/Component.d.ts +3 -16
- package/cssm/components/content/Component.js +8 -0
- package/cssm/components/footer/Component.js +11 -0
- package/cssm/components/header/Component.d.ts +49 -0
- package/cssm/components/header/Component.js +55 -6
- package/cssm/desktop.js +13 -9
- package/cssm/index.d.ts +1 -0
- package/cssm/index.js +13 -19
- package/cssm/mobile.js +13 -9
- package/cssm/responsive.js +13 -19
- package/cssm/typings.d.ts +52 -0
- package/cssm/typings.js +2 -0
- package/desktop.css +9 -9
- package/desktop.js +7 -8
- package/esm/Component.d.ts +12 -0
- package/esm/Component.desktop.d.ts +5 -44
- package/esm/Component.desktop.js +15 -42
- package/esm/Component.js +55 -0
- package/esm/Component.mobile.d.ts +5 -18
- package/esm/Component.mobile.js +13 -20
- package/esm/Component.responsive.d.ts +5 -21
- package/esm/Component.responsive.js +13 -35
- package/esm/ResponsiveContext.d.ts +5 -0
- package/esm/ResponsiveContext.js +8 -0
- package/esm/components/closer/Component.js +3 -3
- package/esm/components/closer/index.css +4 -4
- package/esm/components/content/Component.d.ts +3 -16
- package/esm/components/content/Component.js +11 -1
- package/esm/components/content/desktop.css +8 -8
- package/esm/components/content/index.css +3 -3
- package/esm/components/content/mobile.css +3 -3
- package/esm/components/footer/Component.js +15 -2
- package/esm/components/footer/desktop.css +9 -9
- package/esm/components/footer/index.css +4 -4
- package/esm/components/footer/layout.css +25 -25
- package/esm/components/footer/mobile.css +3 -3
- package/esm/components/header/Component.d.ts +49 -0
- package/esm/components/header/Component.js +55 -4
- package/esm/components/header/desktop.css +17 -17
- package/esm/components/header/index.css +15 -15
- package/esm/components/header/mobile.css +3 -3
- package/esm/desktop.css +9 -9
- package/esm/desktop.js +7 -8
- package/esm/index.d.ts +1 -0
- package/esm/index.js +6 -13
- package/esm/mobile.css +2 -2
- package/esm/mobile.js +6 -7
- package/esm/responsive.js +6 -13
- package/esm/transitions.css +8 -8
- package/esm/{tslib.es6-028db3ce.d.ts → tslib.es6-056b72d0.d.ts} +0 -0
- package/esm/{tslib.es6-028db3ce.js → tslib.es6-056b72d0.js} +1 -1
- package/esm/typings.d.ts +52 -0
- package/esm/typings.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +6 -13
- package/mobile.css +2 -2
- package/mobile.js +6 -7
- package/modern/Component.d.ts +12 -0
- package/modern/Component.desktop.d.ts +5 -44
- package/modern/Component.desktop.js +14 -44
- package/modern/Component.js +62 -0
- package/modern/Component.mobile.d.ts +5 -18
- package/modern/Component.mobile.js +12 -19
- package/modern/Component.responsive.d.ts +5 -21
- package/modern/Component.responsive.js +12 -34
- package/modern/ResponsiveContext.d.ts +5 -0
- package/modern/ResponsiveContext.js +8 -0
- package/modern/components/closer/Component.js +2 -2
- package/modern/components/closer/index.css +4 -4
- package/modern/components/content/Component.d.ts +3 -16
- package/modern/components/content/Component.js +11 -1
- package/modern/components/content/desktop.css +8 -8
- package/modern/components/content/index.css +3 -3
- package/modern/components/content/mobile.css +3 -3
- package/modern/components/footer/Component.js +15 -2
- package/modern/components/footer/desktop.css +9 -9
- package/modern/components/footer/index.css +4 -4
- package/modern/components/footer/layout.css +25 -25
- package/modern/components/footer/mobile.css +3 -3
- package/modern/components/header/Component.d.ts +49 -0
- package/modern/components/header/Component.js +52 -4
- package/modern/components/header/desktop.css +17 -17
- package/modern/components/header/index.css +15 -15
- package/modern/components/header/mobile.css +3 -3
- package/modern/desktop.css +9 -9
- package/modern/desktop.js +6 -7
- package/modern/index.d.ts +1 -0
- package/modern/index.js +5 -12
- package/modern/mobile.css +2 -2
- package/modern/mobile.js +5 -6
- package/modern/responsive.js +5 -12
- package/modern/transitions.css +8 -8
- package/modern/typings.d.ts +52 -0
- package/modern/typings.js +1 -0
- package/package.json +3 -3
- package/responsive.js +6 -13
- package/send-stats.js +1 -1
- package/transitions.css +8 -8
- package/{tslib.es6-5a073d46.d.ts → tslib.es6-0c9325d7.d.ts} +0 -0
- package/{tslib.es6-5a073d46.js → tslib.es6-0c9325d7.js} +0 -0
- package/typings.d.ts +52 -0
- package/typings.js +2 -0
- package/Component-4316068c.d.ts +0 -50
- package/Component-4316068c.js +0 -43
- package/components/content/Component.desktop.d.ts +0 -11
- package/components/content/Component.desktop.js +0 -25
- package/components/content/Component.mobile.d.ts +0 -5
- package/components/content/Component.mobile.js +0 -25
- package/components/footer/Component.desktop.d.ts +0 -11
- package/components/footer/Component.desktop.js +0 -28
- package/components/footer/Component.mobile.d.ts +0 -5
- package/components/footer/Component.mobile.js +0 -28
- package/components/header/Component.desktop.d.ts +0 -15
- package/components/header/Component.desktop.js +0 -33
- package/components/header/Component.mobile.d.ts +0 -10
- package/components/header/Component.mobile.js +0 -33
- package/cssm/Component-5fe52731.d.ts +0 -50
- package/cssm/Component-5fe52731.js +0 -42
- package/cssm/components/content/Component.desktop.d.ts +0 -11
- package/cssm/components/content/Component.desktop.js +0 -25
- package/cssm/components/content/Component.mobile.d.ts +0 -5
- package/cssm/components/content/Component.mobile.js +0 -25
- package/cssm/components/footer/Component.desktop.d.ts +0 -11
- package/cssm/components/footer/Component.desktop.js +0 -29
- package/cssm/components/footer/Component.mobile.d.ts +0 -5
- package/cssm/components/footer/Component.mobile.js +0 -29
- package/cssm/components/header/Component.desktop.d.ts +0 -15
- package/cssm/components/header/Component.desktop.js +0 -34
- package/cssm/components/header/Component.mobile.d.ts +0 -10
- package/cssm/components/header/Component.mobile.js +0 -34
- package/cssm/getDataTestId-3fe0d3e6.d.ts +0 -2
- package/esm/Component-5bc49f26.d.ts +0 -50
- package/esm/Component-5bc49f26.js +0 -35
- package/esm/components/content/Component.desktop.d.ts +0 -11
- package/esm/components/content/Component.desktop.js +0 -16
- package/esm/components/content/Component.mobile.d.ts +0 -5
- package/esm/components/content/Component.mobile.js +0 -16
- package/esm/components/footer/Component.desktop.d.ts +0 -11
- package/esm/components/footer/Component.desktop.js +0 -19
- package/esm/components/footer/Component.mobile.d.ts +0 -5
- package/esm/components/footer/Component.mobile.js +0 -19
- package/esm/components/header/Component.desktop.d.ts +0 -15
- package/esm/components/header/Component.desktop.js +0 -24
- package/esm/components/header/Component.mobile.d.ts +0 -10
- package/esm/components/header/Component.mobile.js +0 -23
- package/esm/getDataTestId-3fe0d3e6.d.ts +0 -2
- package/esm/transitions.module-053bd5b2.js +0 -4
- package/getDataTestId-3fe0d3e6.d.ts +0 -2
- package/modern/Component-4974412a.d.ts +0 -50
- package/modern/Component-4974412a.js +0 -33
- package/modern/components/content/Component.desktop.d.ts +0 -11
- package/modern/components/content/Component.desktop.js +0 -12
- package/modern/components/content/Component.mobile.d.ts +0 -5
- package/modern/components/content/Component.mobile.js +0 -12
- package/modern/components/footer/Component.desktop.d.ts +0 -11
- package/modern/components/footer/Component.desktop.js +0 -14
- package/modern/components/footer/Component.mobile.d.ts +0 -5
- package/modern/components/footer/Component.mobile.js +0 -14
- package/modern/components/header/Component.desktop.d.ts +0 -15
- package/modern/components/header/Component.desktop.js +0 -21
- package/modern/components/header/Component.mobile.d.ts +0 -10
- package/modern/components/header/Component.mobile.js +0 -18
- package/modern/getDataTestId-3fe0d3e6.d.ts +0 -2
- package/modern/transitions.module-053bd5b2.js +0 -4
- package/transitions.module-b8ebf246.js +0 -6
|
@@ -1,53 +1,23 @@
|
|
|
1
|
-
import React, { forwardRef
|
|
2
|
-
import
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import { BaseModal } from '@alfalab/core-components-base-modal/modern';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import 'classnames';
|
|
5
3
|
import '@alfalab/core-components-icon-button/modern';
|
|
6
4
|
import '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
5
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
7
6
|
import './Context.js';
|
|
8
7
|
import { Closer } from './components/closer/Component.js';
|
|
9
|
-
import './
|
|
10
|
-
import {
|
|
11
|
-
import './components/footer/Component.js';
|
|
12
|
-
import
|
|
13
|
-
import './Component
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
8
|
+
import './ResponsiveContext.js';
|
|
9
|
+
import { Content } from './components/content/Component.js';
|
|
10
|
+
import { Footer } from './components/footer/Component.js';
|
|
11
|
+
import '@alfalab/icons-glyph/CrossMIcon';
|
|
12
|
+
import { Header } from './components/header/Component.js';
|
|
13
|
+
import 'react-merge-refs';
|
|
14
|
+
import { Modal } from './Component.js';
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
require('./desktop.css')
|
|
19
|
-
|
|
20
|
-
const ModalDesktopComponent = forwardRef(({ size = 's', fixedPosition, fullscreen, children, className, wrapperClassName, transitionProps = {}, ...restProps }, ref) => {
|
|
21
|
-
// TODO: удалить, после удаления пропсы fullscreen
|
|
22
|
-
const componentSize = fullscreen ? 'fullscreen' : size;
|
|
23
|
-
const modalRef = useRef(null);
|
|
24
|
-
const handleEntered = useCallback((node, isAppearing) => {
|
|
25
|
-
if (fixedPosition && modalRef.current) {
|
|
26
|
-
const content = modalRef.current.querySelector(`.${styles.component}`);
|
|
27
|
-
if (content) {
|
|
28
|
-
const { marginTop } = window.getComputedStyle(content);
|
|
29
|
-
content.style.marginTop = marginTop;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (transitionProps.onEntered) {
|
|
33
|
-
transitionProps.onEntered(node, isAppearing);
|
|
34
|
-
}
|
|
35
|
-
}, [fixedPosition, transitionProps]);
|
|
36
|
-
return (React.createElement(BaseModal, { ...restProps, ref: mergeRefs([ref, modalRef]), wrapperClassName: cn(styles.wrapper, wrapperClassName, {
|
|
37
|
-
[styles.fullscreen]: componentSize === 'fullscreen',
|
|
38
|
-
}), className: cn(styles.component, className, styles[componentSize]), backdropProps: {
|
|
39
|
-
invisible: componentSize === 'fullscreen',
|
|
40
|
-
...restProps.backdropProps,
|
|
41
|
-
}, transitionProps: {
|
|
42
|
-
classNames: transitions,
|
|
43
|
-
...transitionProps,
|
|
44
|
-
onEntered: handleEntered,
|
|
45
|
-
} }, React.Children.map(children, child => isValidElement(child) ? cloneElement(child, { size: componentSize }) : child)));
|
|
46
|
-
});
|
|
16
|
+
const ModalDesktopComponent = forwardRef((props, ref) => (React.createElement(Modal, { ...props, ref: ref, view: 'desktop' })));
|
|
47
17
|
const ModalDesktop = Object.assign(ModalDesktopComponent, {
|
|
48
|
-
Content
|
|
49
|
-
Header
|
|
50
|
-
Footer
|
|
18
|
+
Content,
|
|
19
|
+
Header,
|
|
20
|
+
Footer,
|
|
51
21
|
Closer,
|
|
52
22
|
});
|
|
53
23
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useMemo } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { BaseModal } from '@alfalab/core-components-base-modal/modern';
|
|
4
|
+
import { ResponsiveContext } from './ResponsiveContext.js';
|
|
5
|
+
import mergeRefs from 'react-merge-refs';
|
|
6
|
+
|
|
7
|
+
var desktopStyles = {"wrapper":"modal__wrapper_1kgjw","component":"modal__component_1kgjw","fullscreen":"modal__fullscreen_1kgjw","s":"modal__s_1kgjw","m":"modal__m_1kgjw","l":"modal__l_1kgjw","xl":"modal__xl_1kgjw"};
|
|
8
|
+
require('./desktop.css')
|
|
9
|
+
|
|
10
|
+
var mobileStyles = {"component":"modal__component_1po45"};
|
|
11
|
+
require('./mobile.css')
|
|
12
|
+
|
|
13
|
+
var transitions = {"appear":"modal__appear_5a8sg","enter":"modal__enter_5a8sg","appearActive":"modal__appearActive_5a8sg","enterActive":"modal__enterActive_5a8sg","exit":"modal__exit_5a8sg","exitActive":"modal__exitActive_5a8sg","exitDone":"modal__exitDone_5a8sg"};
|
|
14
|
+
require('./transitions.css')
|
|
15
|
+
|
|
16
|
+
const Modal = forwardRef(({ size = 's', fixedPosition, fullscreen, children, className, wrapperClassName, transitionProps = {}, view, ...restProps }, ref) => {
|
|
17
|
+
// TODO: удалить, после удаления пропсы fullscreen
|
|
18
|
+
const componentSize = fullscreen ? 'fullscreen' : size;
|
|
19
|
+
const modalRef = useRef(null);
|
|
20
|
+
const handleEntered = (node, isAppearing) => {
|
|
21
|
+
if (fixedPosition && modalRef.current) {
|
|
22
|
+
const content = modalRef.current.querySelector(`.${desktopStyles.component}`);
|
|
23
|
+
if (content) {
|
|
24
|
+
const { marginTop } = window.getComputedStyle(content);
|
|
25
|
+
content.style.marginTop = marginTop;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (transitionProps.onEntered) {
|
|
29
|
+
transitionProps.onEntered(node, isAppearing);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const baseModalProps = view === 'desktop'
|
|
33
|
+
? {
|
|
34
|
+
ref: mergeRefs([ref, modalRef]),
|
|
35
|
+
wrapperClassName: cn(desktopStyles.wrapper, wrapperClassName, {
|
|
36
|
+
[desktopStyles.fullscreen]: componentSize === 'fullscreen',
|
|
37
|
+
}),
|
|
38
|
+
className: cn(desktopStyles.component, className, desktopStyles[componentSize]),
|
|
39
|
+
backdropProps: {
|
|
40
|
+
invisible: componentSize === 'fullscreen',
|
|
41
|
+
...restProps.backdropProps,
|
|
42
|
+
},
|
|
43
|
+
transitionProps: {
|
|
44
|
+
classNames: transitions,
|
|
45
|
+
...transitionProps,
|
|
46
|
+
onEntered: handleEntered,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
: {
|
|
50
|
+
ref,
|
|
51
|
+
transitionProps: {
|
|
52
|
+
classNames: transitions,
|
|
53
|
+
...transitionProps,
|
|
54
|
+
},
|
|
55
|
+
className: cn(className, mobileStyles.component),
|
|
56
|
+
};
|
|
57
|
+
const contextValue = useMemo(() => ({ size: componentSize, view }), [componentSize, view]);
|
|
58
|
+
return (React.createElement(ResponsiveContext.Provider, { value: contextValue },
|
|
59
|
+
React.createElement(BaseModal, { ...restProps, ...baseModalProps }, children)));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { Modal };
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
hasCloser?: boolean;
|
|
10
|
-
};
|
|
11
|
-
declare const ModalMobile: React.ForwardRefExoticComponent<BaseModalProps & {
|
|
12
|
-
/**
|
|
13
|
-
* Управление наличием закрывающего крестика
|
|
14
|
-
* @default false
|
|
15
|
-
*/
|
|
16
|
-
hasCloser?: boolean | undefined;
|
|
17
|
-
} & React.RefAttributes<HTMLDivElement>> & {
|
|
18
|
-
Content: React.FC<import("./components/content/Component").ContentProps>;
|
|
19
|
-
Header: React.FC<import("./components/header/Component.mobile").HeaderMobileProps>;
|
|
3
|
+
import { ModalMobileProps } from "./typings";
|
|
4
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
5
|
+
Content: React.FC<import("./typings").ContentProps>;
|
|
6
|
+
Header: React.FC<import("./components/header/Component").HeaderProps>;
|
|
20
7
|
Footer: React.FC<import("./components/footer/Component").FooterProps>;
|
|
21
8
|
Closer: React.FC<import("./components/closer/Component").CloserProps>;
|
|
22
9
|
};
|
|
23
|
-
export {
|
|
10
|
+
export { ModalMobile };
|
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { BaseModal } from '@alfalab/core-components-base-modal/modern';
|
|
2
|
+
import 'classnames';
|
|
4
3
|
import '@alfalab/core-components-icon-button/modern';
|
|
5
4
|
import '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
5
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
6
6
|
import './Context.js';
|
|
7
7
|
import { Closer } from './components/closer/Component.js';
|
|
8
|
-
import './
|
|
9
|
-
import './components/
|
|
10
|
-
import './Component
|
|
11
|
-
import { t as transitions } from './transitions.module-053bd5b2.js';
|
|
12
|
-
import { ContentMobile } from './components/content/Component.mobile.js';
|
|
13
|
-
import { FooterMobile } from './components/footer/Component.mobile.js';
|
|
8
|
+
import './ResponsiveContext.js';
|
|
9
|
+
import { Content } from './components/content/Component.js';
|
|
10
|
+
import { Footer } from './components/footer/Component.js';
|
|
14
11
|
import '@alfalab/icons-glyph/CrossMIcon';
|
|
15
|
-
import {
|
|
12
|
+
import { Header } from './components/header/Component.js';
|
|
13
|
+
import 'react-merge-refs';
|
|
14
|
+
import { Modal } from './Component.js';
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
require('./mobile.css')
|
|
19
|
-
|
|
20
|
-
const ModalMobileComponent = forwardRef(({ children, className, ...restProps }, ref) => (React.createElement(BaseModal, { ...restProps, ref: ref, transitionProps: {
|
|
21
|
-
classNames: transitions,
|
|
22
|
-
...restProps.transitionProps,
|
|
23
|
-
}, className: cn(className, styles.component) }, children)));
|
|
16
|
+
const ModalMobileComponent = forwardRef((props, ref) => (React.createElement(Modal, { ...props, ref: ref, view: 'mobile' })));
|
|
24
17
|
const ModalMobile = Object.assign(ModalMobileComponent, {
|
|
25
|
-
Content
|
|
26
|
-
Header
|
|
27
|
-
Footer
|
|
18
|
+
Content,
|
|
19
|
+
Header,
|
|
20
|
+
Footer,
|
|
28
21
|
Closer,
|
|
29
22
|
});
|
|
30
23
|
|
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { ModalDesktopProps } from "./Component.desktop";
|
|
5
|
-
import { ModalMobileProps } from "./Component.mobile";
|
|
6
|
-
type ModalResponsiveProps = ModalMobileProps & ModalDesktopProps & {
|
|
7
|
-
/**
|
|
8
|
-
* Контрольная точка, с нее начинается desktop версия
|
|
9
|
-
* @default 1024
|
|
10
|
-
*/
|
|
11
|
-
breakpoint?: number;
|
|
12
|
-
};
|
|
13
|
-
declare const ModalResponsive: React.ForwardRefExoticComponent<BaseModalProps & {
|
|
14
|
-
hasCloser?: boolean | undefined;
|
|
15
|
-
} & {
|
|
3
|
+
declare const ModalResponsive: React.ForwardRefExoticComponent<import("packages/base-modal/src").BaseModalProps & {
|
|
16
4
|
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
17
5
|
fullscreen?: boolean | undefined;
|
|
18
6
|
fixedPosition?: boolean | undefined;
|
|
19
7
|
hasCloser?: boolean | undefined;
|
|
20
8
|
} & {
|
|
21
|
-
/**
|
|
22
|
-
* Контрольная точка, с нее начинается desktop версия
|
|
23
|
-
* @default 1024
|
|
24
|
-
*/
|
|
25
9
|
breakpoint?: number | undefined;
|
|
26
10
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
27
|
-
Header: React.FC<import("./components/header/Component
|
|
28
|
-
Content: React.FC<import("./
|
|
29
|
-
Footer: React.FC<import("./components/footer/Component").FooterProps
|
|
11
|
+
Header: React.FC<import("./components/header/Component").HeaderProps>;
|
|
12
|
+
Content: React.FC<import("./typings").ContentProps>;
|
|
13
|
+
Footer: React.FC<import("./components/footer/Component").FooterProps>;
|
|
30
14
|
Closer: React.FC<import("./components/closer/Component").CloserProps>;
|
|
31
15
|
};
|
|
32
|
-
export {
|
|
16
|
+
export { ModalResponsive };
|
|
@@ -1,52 +1,30 @@
|
|
|
1
|
-
import React, { forwardRef
|
|
2
|
-
import 'react-merge-refs';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
3
2
|
import 'classnames';
|
|
4
|
-
import '@alfalab/core-components-base-modal/modern';
|
|
5
3
|
import '@alfalab/core-components-icon-button/modern';
|
|
6
4
|
import '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
5
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
7
6
|
import './Context.js';
|
|
8
7
|
import { Closer } from './components/closer/Component.js';
|
|
9
|
-
import './
|
|
10
|
-
import './components/content/Component.
|
|
11
|
-
import './components/footer/Component.js';
|
|
12
|
-
import './components/footer/Component.desktop.js';
|
|
13
|
-
import './Component-4974412a.js';
|
|
14
|
-
import './components/header/Component.desktop.js';
|
|
15
|
-
import { ModalDesktop } from './Component.desktop.js';
|
|
16
|
-
import './transitions.module-053bd5b2.js';
|
|
17
|
-
import './components/content/Component.mobile.js';
|
|
18
|
-
import './components/footer/Component.mobile.js';
|
|
8
|
+
import './ResponsiveContext.js';
|
|
9
|
+
import { Content } from './components/content/Component.js';
|
|
10
|
+
import { Footer } from './components/footer/Component.js';
|
|
19
11
|
import '@alfalab/icons-glyph/CrossMIcon';
|
|
20
|
-
import './components/header/Component.
|
|
21
|
-
import
|
|
12
|
+
import { Header } from './components/header/Component.js';
|
|
13
|
+
import 'react-merge-refs';
|
|
14
|
+
import { Modal } from './Component.js';
|
|
22
15
|
import { useMedia } from '@alfalab/hooks';
|
|
23
16
|
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
25
|
-
const ResponsiveContext = React.createContext({
|
|
26
|
-
view: 'desktop',
|
|
27
|
-
});
|
|
28
|
-
function createResponsive(desktop, mobile) {
|
|
29
|
-
function ResponsiveChild(props) {
|
|
30
|
-
const { view } = useContext(ResponsiveContext);
|
|
31
|
-
const Child = view === 'desktop' ? desktop : mobile;
|
|
32
|
-
return React.createElement(Child, { ...props });
|
|
33
|
-
}
|
|
34
|
-
return ResponsiveChild;
|
|
35
|
-
}
|
|
36
17
|
const ModalResponsiveComponent = forwardRef(({ children, breakpoint = 1024, ...restProps }, ref) => {
|
|
37
18
|
const [view] = useMedia([
|
|
38
19
|
['mobile', `(max-width: ${breakpoint - 1}px)`],
|
|
39
20
|
['desktop', `(min-width: ${breakpoint}px)`],
|
|
40
21
|
], 'desktop');
|
|
41
|
-
|
|
42
|
-
const Component = view === 'desktop' ? ModalDesktop : ModalMobile;
|
|
43
|
-
return (React.createElement(ResponsiveContext.Provider, { value: contextValue },
|
|
44
|
-
React.createElement(Component, { ref: ref, ...restProps }, children)));
|
|
22
|
+
return (React.createElement(Modal, { ref: ref, ...restProps, view: view }, children));
|
|
45
23
|
});
|
|
46
24
|
const ModalResponsive = Object.assign(ModalResponsiveComponent, {
|
|
47
|
-
Header
|
|
48
|
-
Content
|
|
49
|
-
Footer
|
|
25
|
+
Header,
|
|
26
|
+
Content,
|
|
27
|
+
Footer,
|
|
50
28
|
Closer,
|
|
51
29
|
});
|
|
52
30
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useContext, useCallback } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import '@alfalab/core-components-base-modal/modern';
|
|
4
3
|
import { IconButton } from '@alfalab/core-components-icon-button/modern';
|
|
5
4
|
import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
5
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
6
6
|
import { ModalContext } from '../../Context.js';
|
|
7
7
|
|
|
8
|
-
var styles = {"closer":"
|
|
8
|
+
var styles = {"closer":"modal__closer_14cqc","button":"modal__button_14cqc","sticky":"modal__sticky_14cqc"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 19egz */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
|
|
4
4
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
:root {
|
|
30
30
|
--modal-closer-bg-color: var(--color-light-bg-primary-alpha-40);
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.modal__closer_14cqc {
|
|
33
33
|
flex-shrink: 0;
|
|
34
34
|
width: 48px;
|
|
35
35
|
height: 48px;
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
align-items: center;
|
|
39
39
|
justify-content: center;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.modal__button_14cqc {
|
|
42
42
|
background: var(--modal-closer-bg-color);
|
|
43
43
|
-webkit-backdrop-filter: blur(10px);
|
|
44
44
|
backdrop-filter: blur(10px);
|
|
45
45
|
border-radius: 50px;
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.modal__sticky_14cqc {
|
|
48
48
|
position: sticky;
|
|
49
49
|
top: calc(var(--modal-vertical-padding) * -1);
|
|
50
50
|
}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Контент
|
|
5
|
-
*/
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Дополнительный класс
|
|
9
|
-
*/
|
|
10
|
-
className?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Растягивает контент на всю высоту
|
|
13
|
-
*/
|
|
14
|
-
flex?: boolean;
|
|
15
|
-
};
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ContentProps } from "../../typings";
|
|
16
3
|
declare const Content: FC<ContentProps>;
|
|
17
|
-
export {
|
|
4
|
+
export { Content };
|
|
@@ -2,14 +2,24 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import '@alfalab/core-components-base-modal/modern';
|
|
4
4
|
import { ModalContext } from '../../Context.js';
|
|
5
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
5
6
|
|
|
6
|
-
var
|
|
7
|
+
var desktopStyles = {"s":"modal__s_2wa82","m":"modal__m_2wa82","l":"modal__l_2wa82","xl":"modal__xl_2wa82","fullscreen":"modal__fullscreen_2wa82"};
|
|
8
|
+
require('./desktop.css')
|
|
9
|
+
|
|
10
|
+
var styles = {"content":"modal__content_xuwdw","flex":"modal__flex_xuwdw"};
|
|
7
11
|
require('./index.css')
|
|
8
12
|
|
|
13
|
+
var mobileStyles = {"content":"modal__content_6o7ja"};
|
|
14
|
+
require('./mobile.css')
|
|
15
|
+
|
|
9
16
|
const Content = ({ children, flex, className }) => {
|
|
10
17
|
const { contentRef } = useContext(ModalContext);
|
|
18
|
+
const { size, view } = useContext(ResponsiveContext);
|
|
11
19
|
return (React.createElement("div", { className: cn(styles.content, className, {
|
|
12
20
|
[styles.flex]: flex,
|
|
21
|
+
[desktopStyles[size]]: view === 'desktop' && size,
|
|
22
|
+
[mobileStyles.content]: view === 'mobile',
|
|
13
23
|
}), ref: contentRef }, children));
|
|
14
24
|
};
|
|
15
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 526p9 */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
|
|
25
25
|
/* mobile */
|
|
26
26
|
}
|
|
27
|
-
.
|
|
28
|
-
.
|
|
27
|
+
.modal__s_2wa82,
|
|
28
|
+
.modal__m_2wa82 {
|
|
29
29
|
padding: var(--modal-s-content-paddings)
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.modal__s_2wa82:last-child, .modal__m_2wa82:last-child {
|
|
32
32
|
padding-bottom: var(--modal-s-content-only-bottom-padding);
|
|
33
33
|
}
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
34
|
+
.modal__l_2wa82,
|
|
35
|
+
.modal__xl_2wa82,
|
|
36
|
+
.modal__fullscreen_2wa82 {
|
|
37
37
|
padding: 0 var(--gap-6xl)
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
.modal__l_2wa82:last-child, .modal__xl_2wa82:last-child, .modal__fullscreen_2wa82:last-child {
|
|
40
40
|
padding-bottom: var(--gap-6xl);
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: a07ty */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
|
|
20
20
|
/* mobile */
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
.modal__content_xuwdw {
|
|
23
23
|
box-sizing: border-box;
|
|
24
24
|
width: 100%;
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.modal__flex_xuwdw {
|
|
27
27
|
flex: 1;
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 192cy */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
/* mobile */
|
|
24
24
|
}
|
|
25
|
-
.
|
|
25
|
+
.modal__content_6o7ja {
|
|
26
26
|
padding: 0 var(--gap-m)
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.modal__content_6o7ja:last-child {
|
|
29
29
|
padding-bottom: var(--gap-m);
|
|
30
30
|
}
|
|
@@ -2,21 +2,34 @@ import React, { useContext, useEffect } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import '@alfalab/core-components-base-modal/modern';
|
|
4
4
|
import { ModalContext } from '../../Context.js';
|
|
5
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
5
6
|
|
|
6
|
-
var
|
|
7
|
+
var desktopStyles = {"footer":"modal__footer_mf0hw","sticky":"modal__sticky_mf0hw","fullscreen":"modal__fullscreen_mf0hw","s":"modal__s_mf0hw","m":"modal__m_mf0hw","l":"modal__l_mf0hw","xl":"modal__xl_mf0hw"};
|
|
8
|
+
require('./desktop.css')
|
|
9
|
+
|
|
10
|
+
var styles = {"footer":"modal__footer_1nmkm","sticky":"modal__sticky_1nmkm","highlighted":"modal__highlighted_1nmkm"};
|
|
7
11
|
require('./index.css')
|
|
8
12
|
|
|
9
|
-
var layoutStyles = {"column":"
|
|
13
|
+
var layoutStyles = {"column":"modal__column_1ij0s","gap-16":"modal__gap-16_1ij0s","gap-24":"modal__gap-24_1ij0s","gap-32":"modal__gap-32_1ij0s","start":"modal__start_1ij0s","center":"modal__center_1ij0s","space-between":"modal__space-between_1ij0s"};
|
|
10
14
|
require('./layout.css')
|
|
11
15
|
|
|
16
|
+
var mobileStyles = {"footer":"modal__footer_q351w","sticky":"modal__sticky_q351w"};
|
|
17
|
+
require('./mobile.css')
|
|
18
|
+
|
|
12
19
|
const Footer = ({ children, className, sticky, layout = 'start', gap }) => {
|
|
13
20
|
const { footerHighlighted, setHasFooter } = useContext(ModalContext);
|
|
21
|
+
const { size, view } = useContext(ResponsiveContext);
|
|
14
22
|
useEffect(() => {
|
|
15
23
|
setHasFooter(true);
|
|
16
24
|
}, [setHasFooter]);
|
|
17
25
|
return (React.createElement("div", { className: cn(styles.footer, className, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`], {
|
|
18
26
|
[styles.highlighted]: sticky && footerHighlighted,
|
|
19
27
|
[styles.sticky]: sticky,
|
|
28
|
+
[desktopStyles.footer]: view === 'desktop',
|
|
29
|
+
[desktopStyles.sticky]: view === 'desktop' && sticky,
|
|
30
|
+
[desktopStyles[size]]: view === 'desktop',
|
|
31
|
+
[mobileStyles.footer]: view === 'mobile',
|
|
32
|
+
[mobileStyles.sticky]: view === 'mobile' && sticky,
|
|
20
33
|
}) }, children));
|
|
21
34
|
};
|
|
22
35
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1l1qv */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
|
|
32
32
|
/* mobile */
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
.modal__footer_mf0hw {
|
|
35
35
|
border-bottom-left-radius: var(--modal-border-radius);
|
|
36
36
|
border-bottom-right-radius: var(--modal-border-radius);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.modal__sticky_mf0hw {
|
|
39
39
|
bottom: calc(var(--modal-vertical-padding) * -1)
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.modal__sticky_mf0hw.modal__fullscreen_mf0hw {
|
|
42
42
|
bottom: 0;
|
|
43
43
|
}
|
|
44
|
-
.
|
|
45
|
-
.
|
|
44
|
+
.modal__s_mf0hw,
|
|
45
|
+
.modal__m_mf0hw {
|
|
46
46
|
padding: var(--modal-s-footer-paddings);
|
|
47
47
|
}
|
|
48
|
-
.
|
|
49
|
-
.
|
|
50
|
-
.
|
|
48
|
+
.modal__l_mf0hw,
|
|
49
|
+
.modal__xl_mf0hw,
|
|
50
|
+
.modal__fullscreen_mf0hw {
|
|
51
51
|
padding: var(--gap-2xl) var(--gap-6xl) var(--gap-6xl);
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1d8ry */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-primary: #dbdee1;
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
|
|
27
27
|
/* mobile */
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.modal__footer_1nmkm {
|
|
30
30
|
width: 100%;
|
|
31
31
|
box-sizing: border-box;
|
|
32
32
|
transition: box-shadow 0.2s ease, background 0.2s ease;
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
.modal__sticky_1nmkm {
|
|
35
35
|
background: var(--modal-footer-background);
|
|
36
36
|
position: sticky;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.modal__highlighted_1nmkm {
|
|
39
39
|
background: var(--modal-footer-highlight-background);
|
|
40
40
|
box-shadow: var(--modal-footer-highlight-box-shadow);
|
|
41
41
|
}
|