@alfalab/core-components-modal 9.3.11 → 9.5.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/Component.js +3 -3
- package/components/content/Component.js +3 -3
- package/components/content/desktop.css +9 -8
- package/components/content/index.css +6 -5
- package/components/content/mobile.css +5 -4
- package/components/controls/Component.js +2 -2
- package/components/controls/index.css +2 -2
- package/components/footer/Component.js +4 -4
- package/components/footer/desktop.css +13 -11
- package/components/footer/index.css +4 -4
- package/components/footer/layout.css +17 -17
- package/components/footer/mobile.css +5 -4
- package/components/header/Component.js +3 -3
- package/components/header/desktop.css +20 -18
- package/components/header/index.css +4 -4
- package/components/header/mobile.css +6 -5
- package/cssm/components/content/desktop.module.css +2 -1
- package/cssm/components/content/index.module.css +2 -1
- package/cssm/components/content/mobile.module.css +2 -1
- package/cssm/components/footer/desktop.module.css +4 -2
- package/cssm/components/footer/mobile.module.css +2 -1
- package/cssm/components/header/desktop.module.css +5 -3
- package/cssm/components/header/mobile.module.css +2 -1
- package/cssm/desktop/desktop.module.css +5 -3
- package/desktop/desktop.css +14 -12
- package/esm/Component.js +3 -3
- package/esm/components/content/Component.js +3 -3
- package/esm/components/content/desktop.css +9 -8
- package/esm/components/content/index.css +6 -5
- package/esm/components/content/mobile.css +5 -4
- package/esm/components/controls/Component.js +2 -2
- package/esm/components/controls/index.css +2 -2
- package/esm/components/footer/Component.js +4 -4
- package/esm/components/footer/desktop.css +13 -11
- package/esm/components/footer/index.css +4 -4
- package/esm/components/footer/layout.css +17 -17
- package/esm/components/footer/mobile.css +5 -4
- package/esm/components/header/Component.js +3 -3
- package/esm/components/header/desktop.css +20 -18
- package/esm/components/header/index.css +4 -4
- package/esm/components/header/mobile.css +6 -5
- package/esm/desktop/desktop.css +14 -12
- package/esm/layout.module-a8fdbf01.js +4 -0
- package/esm/mobile/mobile.css +2 -2
- package/esm/transitions.css +8 -8
- package/layout.module-088fbff7.js +6 -0
- package/mobile/mobile.css +2 -2
- package/modern/Component.js +3 -3
- package/modern/components/content/Component.js +3 -3
- package/modern/components/content/desktop.css +9 -8
- package/modern/components/content/index.css +6 -5
- package/modern/components/content/mobile.css +5 -4
- package/modern/components/controls/Component.js +2 -2
- package/modern/components/controls/index.css +2 -2
- package/modern/components/footer/Component.js +4 -4
- package/modern/components/footer/desktop.css +13 -11
- package/modern/components/footer/index.css +4 -4
- package/modern/components/footer/layout.css +17 -17
- package/modern/components/footer/mobile.css +5 -4
- package/modern/components/header/Component.js +3 -3
- package/modern/components/header/desktop.css +20 -18
- package/modern/components/header/index.css +4 -4
- package/modern/components/header/mobile.css +6 -5
- package/modern/desktop/desktop.css +14 -12
- package/modern/layout.module-7b4eee11.js +4 -0
- package/modern/mobile/mobile.css +2 -2
- package/modern/transitions.css +8 -8
- package/moderncssm/Component.d.ts +13 -0
- package/moderncssm/Component.js +59 -0
- package/moderncssm/Component.responsive.d.ts +18 -0
- package/moderncssm/Component.responsive.js +21 -0
- package/moderncssm/Context.d.ts +4 -0
- package/moderncssm/Context.js +5 -0
- package/moderncssm/ResponsiveContext.d.ts +5 -0
- package/moderncssm/ResponsiveContext.js +8 -0
- package/moderncssm/components/content/Component.d.ts +4 -0
- package/moderncssm/components/content/Component.js +22 -0
- package/moderncssm/components/content/desktop.module.css +30 -0
- package/moderncssm/components/content/index.module.css +31 -0
- package/moderncssm/components/content/mobile.module.css +24 -0
- package/moderncssm/components/controls/Component.d.ts +29 -0
- package/moderncssm/components/controls/Component.js +19 -0
- package/moderncssm/components/controls/index.d.ts +1 -0
- package/moderncssm/components/controls/index.js +1 -0
- package/moderncssm/components/controls/index.module.css +3 -0
- package/moderncssm/components/footer/Component.d.ts +25 -0
- package/moderncssm/components/footer/Component.js +29 -0
- package/moderncssm/components/footer/desktop.module.css +40 -0
- package/moderncssm/components/footer/index.module.css +35 -0
- package/moderncssm/components/footer/layout.module.css +76 -0
- package/moderncssm/components/footer/mobile.module.css +24 -0
- package/moderncssm/components/header/Component.d.ts +5 -0
- package/moderncssm/components/header/Component.js +42 -0
- package/moderncssm/components/header/desktop.module.css +68 -0
- package/moderncssm/components/header/index.module.css +33 -0
- package/moderncssm/components/header/mobile.module.css +39 -0
- package/moderncssm/consts.d.ts +12 -0
- package/moderncssm/consts.js +13 -0
- package/moderncssm/desktop/Component.desktop.d.ts +17 -0
- package/moderncssm/desktop/Component.desktop.js +16 -0
- package/moderncssm/desktop/desktop.module.css +59 -0
- package/moderncssm/desktop/index.d.ts +2 -0
- package/moderncssm/desktop/index.js +1 -0
- package/moderncssm/index.d.ts +2 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/mobile/Component.mobile.d.ts +11 -0
- package/moderncssm/mobile/Component.mobile.js +16 -0
- package/moderncssm/mobile/index.d.ts +2 -0
- package/moderncssm/mobile/index.js +1 -0
- package/moderncssm/mobile/mobile.module.css +22 -0
- package/moderncssm/shared/index.d.ts +5 -0
- package/moderncssm/shared/index.js +2 -0
- package/moderncssm/transitions.module.css +24 -0
- package/moderncssm/typings.d.ts +62 -0
- package/moderncssm/typings.js +1 -0
- package/moderncssm/utils.d.ts +11 -0
- package/moderncssm/utils.js +16 -0
- package/moderncssm/vars.css +16 -0
- package/package.json +6 -6
- package/src/components/content/index.module.css +1 -1
- package/src/components/content/mobile.module.css +1 -1
- package/src/components/footer/desktop.module.css +1 -1
- package/src/components/footer/mobile.module.css +1 -1
- package/src/components/header/desktop.module.css +1 -1
- package/src/components/header/mobile.module.css +1 -1
- package/src/desktop/desktop.module.css +2 -2
- package/src/vars.css +4 -4
- package/transitions.css +8 -8
- package/esm/layout.module-3d1aefad.js +0 -4
- package/layout.module-f48c21d7.js +0 -6
- package/modern/layout.module-93d7102e.js +0 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
|
|
5
|
+
/* sizes */
|
|
6
|
+
|
|
7
|
+
/* paddings */
|
|
8
|
+
|
|
9
|
+
/* scroll */
|
|
10
|
+
|
|
11
|
+
/* desktop */
|
|
12
|
+
|
|
13
|
+
/* mobile */
|
|
14
|
+
|
|
15
|
+
/* paddings */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.content {
|
|
19
|
+
position: relative;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
width: 100%;
|
|
22
|
+
z-index: 0
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.content.withHeader {
|
|
26
|
+
padding-top: var(--gap-0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.flex {
|
|
30
|
+
flex: 1;
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
|
|
5
|
+
/* sizes */
|
|
6
|
+
|
|
7
|
+
/* paddings */
|
|
8
|
+
|
|
9
|
+
/* scroll */
|
|
10
|
+
|
|
11
|
+
/* desktop */
|
|
12
|
+
|
|
13
|
+
/* mobile */
|
|
14
|
+
|
|
15
|
+
/* paddings */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.content {
|
|
19
|
+
padding: var(--gap-16) var(--gap-16) var(--gap-0)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content:last-child {
|
|
23
|
+
padding-bottom: var(--gap-16);
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
interface ControlsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Основной слот
|
|
7
|
+
*/
|
|
8
|
+
primary?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Дополнительный слот
|
|
11
|
+
*/
|
|
12
|
+
secondary?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Выравнивание элементов футера
|
|
15
|
+
* @default start
|
|
16
|
+
*/
|
|
17
|
+
layout?: 'start' | 'center' | 'space-between' | 'column';
|
|
18
|
+
/**
|
|
19
|
+
* Выравнивание элементов футера (мобильный view)
|
|
20
|
+
* @default start
|
|
21
|
+
*/
|
|
22
|
+
mobileLayout?: 'start' | 'center' | 'space-between' | 'column';
|
|
23
|
+
/**
|
|
24
|
+
* Отступы между элементами футера
|
|
25
|
+
*/
|
|
26
|
+
gap?: 16 | 24 | 32;
|
|
27
|
+
}
|
|
28
|
+
declare const Controls: React.FC<ControlsProps>;
|
|
29
|
+
export { ControlsProps, Controls };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
5
|
+
import layoutStyles from '../footer/layout.module.css';
|
|
6
|
+
import styles from './index.module.css';
|
|
7
|
+
|
|
8
|
+
const Controls = ({ primary, secondary, gap, layout: layoutProp = 'start', mobileLayout = layoutProp, }) => {
|
|
9
|
+
const { view, dataTestId } = useContext(ResponsiveContext);
|
|
10
|
+
const layout = view === 'mobile' ? mobileLayout : layoutProp;
|
|
11
|
+
const shouldReverse = view === 'mobile' && layout !== 'column';
|
|
12
|
+
return (React.createElement("div", { "data-test-id": getDataTestId(dataTestId, 'controls'), className: cn(styles.component, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`]) }, shouldReverse ? (React.createElement(React.Fragment, null,
|
|
13
|
+
secondary,
|
|
14
|
+
primary)) : (React.createElement(React.Fragment, null,
|
|
15
|
+
primary,
|
|
16
|
+
secondary))));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Controls };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Controls } from './Component.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
type FooterProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Контент футера
|
|
5
|
+
*/
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Дополнительный класс
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Фиксирует футер
|
|
13
|
+
*/
|
|
14
|
+
sticky?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Выравнивание элементов футера
|
|
17
|
+
*/
|
|
18
|
+
layout?: 'start' | 'center' | 'space-between' | 'column';
|
|
19
|
+
/**
|
|
20
|
+
* Отступы между элементами футера
|
|
21
|
+
*/
|
|
22
|
+
gap?: 16 | 24 | 32;
|
|
23
|
+
};
|
|
24
|
+
declare const Footer: FC<FooterProps>;
|
|
25
|
+
export { FooterProps, Footer };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../consts.js';
|
|
5
|
+
import { ModalContext } from '../../Context.js';
|
|
6
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
7
|
+
import desktopStyles from './desktop.module.css';
|
|
8
|
+
import styles from './index.module.css';
|
|
9
|
+
import layoutStyles from './layout.module.css';
|
|
10
|
+
import mobileStyles from './mobile.module.css';
|
|
11
|
+
|
|
12
|
+
const Footer = ({ children, className, sticky, layout = 'start', gap }) => {
|
|
13
|
+
const { footerHighlighted, setHasFooter } = useContext(ModalContext);
|
|
14
|
+
const { size, view, dataTestId } = useContext(ResponsiveContext);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setHasFooter(true);
|
|
17
|
+
}, [setHasFooter]);
|
|
18
|
+
return (React.createElement("div", { "data-test-id": getDataTestId(dataTestId, 'footer'), className: cn(styles.footer, className, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`], {
|
|
19
|
+
[styles.highlighted]: sticky && footerHighlighted,
|
|
20
|
+
[styles.sticky]: sticky,
|
|
21
|
+
[desktopStyles.footer]: view === 'desktop',
|
|
22
|
+
[desktopStyles.sticky]: view === 'desktop' && sticky,
|
|
23
|
+
[desktopStyles[SIZE_TO_CLASSNAME_MAP[size]]]: view === 'desktop',
|
|
24
|
+
[mobileStyles.footer]: view === 'mobile',
|
|
25
|
+
[mobileStyles.sticky]: view === 'mobile' && sticky,
|
|
26
|
+
}) }, children));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Footer };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-border-radius: var(--border-radius-12);
|
|
5
|
+
--modal-vertical-padding: var(--gap-40);
|
|
6
|
+
|
|
7
|
+
/* sizes */
|
|
8
|
+
|
|
9
|
+
/* paddings */
|
|
10
|
+
--modal-s-footer-paddings: var(--gap-24) var(--gap-40) var(--gap-40);
|
|
11
|
+
|
|
12
|
+
/* scroll */
|
|
13
|
+
|
|
14
|
+
/* desktop */
|
|
15
|
+
|
|
16
|
+
/* mobile */
|
|
17
|
+
|
|
18
|
+
/* paddings */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.footer {
|
|
22
|
+
border-bottom-left-radius: var(--modal-border-radius);
|
|
23
|
+
border-bottom-right-radius: var(--modal-border-radius);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sticky {
|
|
27
|
+
bottom: calc(var(--modal-vertical-padding) * -1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sticky.fullscreen {
|
|
31
|
+
bottom: var(--gap-0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.size-500,
|
|
35
|
+
.size-600,
|
|
36
|
+
.size-800,
|
|
37
|
+
.size-1140,
|
|
38
|
+
.fullscreen {
|
|
39
|
+
padding: var(--modal-s-footer-paddings);
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-footer-background: var(--color-light-modal-bg-primary);
|
|
5
|
+
|
|
6
|
+
/* sizes */
|
|
7
|
+
|
|
8
|
+
/* paddings */
|
|
9
|
+
|
|
10
|
+
/* scroll */
|
|
11
|
+
--modal-footer-highlight-background: var(--color-light-modal-bg-primary);
|
|
12
|
+
--modal-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-neutral-300);
|
|
13
|
+
|
|
14
|
+
/* desktop */
|
|
15
|
+
|
|
16
|
+
/* mobile */
|
|
17
|
+
|
|
18
|
+
/* paddings */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.footer {
|
|
22
|
+
width: 100%;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
transition: box-shadow 0.2s ease, background 0.2s ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.sticky {
|
|
28
|
+
background: var(--modal-footer-background);
|
|
29
|
+
position: sticky;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.highlighted {
|
|
33
|
+
background: var(--modal-footer-highlight-background);
|
|
34
|
+
box-shadow: var(--modal-footer-highlight-box-shadow);
|
|
35
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-footer-default-gap: var(--gap-16);
|
|
5
|
+
|
|
6
|
+
/* sizes */
|
|
7
|
+
|
|
8
|
+
/* paddings */
|
|
9
|
+
|
|
10
|
+
/* scroll */
|
|
11
|
+
|
|
12
|
+
/* desktop */
|
|
13
|
+
|
|
14
|
+
/* mobile */
|
|
15
|
+
|
|
16
|
+
/* paddings */
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.column {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.column > *:not(:last-child):not(:only-child) {
|
|
25
|
+
margin-bottom: var(--modal-footer-default-gap);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.column.gap-16 > *:not(:last-child):not(:only-child) {
|
|
29
|
+
margin-bottom: var(--gap-16);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.column.gap-24 > *:not(:last-child):not(:only-child) {
|
|
33
|
+
margin-bottom: var(--gap-24);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.column.gap-32 > *:not(:last-child):not(:only-child) {
|
|
37
|
+
margin-bottom: var(--gap-32);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.start {
|
|
41
|
+
justify-content: flex-start;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.center {
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.space-between {
|
|
49
|
+
justify-content: space-between
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.space-between > * {
|
|
53
|
+
flex: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.start,
|
|
57
|
+
.center,
|
|
58
|
+
.space-between {
|
|
59
|
+
display: flex
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.start > *:not(:last-child):not(:only-child), .center > *:not(:last-child):not(:only-child), .space-between > *:not(:last-child):not(:only-child) {
|
|
63
|
+
margin-right: var(--modal-footer-default-gap);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.start.gap-16 > *:not(:last-child):not(:only-child), .center.gap-16 > *:not(:last-child):not(:only-child), .space-between.gap-16 > *:not(:last-child):not(:only-child) {
|
|
67
|
+
margin-right: var(--gap-16);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.start.gap-24 > *:not(:last-child):not(:only-child), .center.gap-24 > *:not(:last-child):not(:only-child), .space-between.gap-24 > *:not(:last-child):not(:only-child) {
|
|
71
|
+
margin-right: var(--gap-24);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.start.gap-32 > *:not(:last-child):not(:only-child), .center.gap-32 > *:not(:last-child):not(:only-child), .space-between.gap-32 > *:not(:last-child):not(:only-child) {
|
|
75
|
+
margin-right: var(--gap-32);
|
|
76
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NavigationBarPrivateProps } from "@alfalab/core-components-navigation-bar-private";
|
|
3
|
+
type HeaderProps = Omit<NavigationBarPrivateProps, 'size' | 'view' | 'parentRef'>;
|
|
4
|
+
declare const Header: FC<HeaderProps>;
|
|
5
|
+
export { HeaderProps, Header };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useContext, useCallback, useEffect } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { NavigationBarPrivate } from '@alfalab/core-components-navigation-bar-private/moderncssm';
|
|
4
|
+
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
5
|
+
import { SIZE_TO_CLASSNAME_MAP } from '../../consts.js';
|
|
6
|
+
import { ModalContext } from '../../Context.js';
|
|
7
|
+
import { ResponsiveContext } from '../../ResponsiveContext.js';
|
|
8
|
+
import desktopStyles from './desktop.module.css';
|
|
9
|
+
import styles from './index.module.css';
|
|
10
|
+
import mobileStyles from './mobile.module.css';
|
|
11
|
+
|
|
12
|
+
const Header = ({ className, sticky, title, children, contentClassName, hasCloser = true, onClose: onHeaderClose, ...restProps }) => {
|
|
13
|
+
const { setHasHeader, headerHighlighted, parentRef, onClose } = useContext(ModalContext);
|
|
14
|
+
const { view, size, dataTestId } = useContext(ResponsiveContext);
|
|
15
|
+
const handleClose = useCallback((...params) => {
|
|
16
|
+
if (onHeaderClose) {
|
|
17
|
+
onHeaderClose(...params);
|
|
18
|
+
}
|
|
19
|
+
if (onClose) {
|
|
20
|
+
onClose(...params);
|
|
21
|
+
}
|
|
22
|
+
}, [onHeaderClose, onClose]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setHasHeader(true);
|
|
25
|
+
}, [setHasHeader]);
|
|
26
|
+
const hasContent = Boolean(title || children);
|
|
27
|
+
return (React.createElement(NavigationBarPrivate, { dataTestId: getDataTestId(dataTestId, 'header'), ...restProps, scrollableParentRef: parentRef, hasCloser: hasCloser, sticky: sticky, view: view, title: title, onClose: handleClose, className: cn(className, {
|
|
28
|
+
[styles.highlighted]: hasContent && sticky && headerHighlighted,
|
|
29
|
+
[styles.sticky]: sticky,
|
|
30
|
+
[styles.hasContent]: hasContent,
|
|
31
|
+
[desktopStyles.header]: view === 'desktop',
|
|
32
|
+
[desktopStyles.sticky]: view === 'desktop' && sticky,
|
|
33
|
+
[desktopStyles[SIZE_TO_CLASSNAME_MAP[size]]]: view === 'desktop',
|
|
34
|
+
[mobileStyles.header]: view === 'mobile',
|
|
35
|
+
[mobileStyles.sticky]: view === 'mobile' && sticky,
|
|
36
|
+
}), contentClassName: cn(contentClassName, {
|
|
37
|
+
[desktopStyles.content]: view === 'desktop',
|
|
38
|
+
[mobileStyles.content]: view === 'mobile',
|
|
39
|
+
}) }, children));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { Header };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-border-radius: var(--border-radius-12);
|
|
5
|
+
--modal-vertical-padding: var(--gap-40);
|
|
6
|
+
|
|
7
|
+
/* sizes */
|
|
8
|
+
|
|
9
|
+
/* paddings */
|
|
10
|
+
--modal-s-header-paddings: 28px 28px var(--gap-0);
|
|
11
|
+
|
|
12
|
+
/* scroll */
|
|
13
|
+
|
|
14
|
+
/* desktop */
|
|
15
|
+
--modal-s-header-desktop-content-paddings: var(--gap-12);
|
|
16
|
+
--modal-s-header-desktop-font-size: 22px;
|
|
17
|
+
--modal-s-header-desktop-line-height: 26px;
|
|
18
|
+
--modal-l-header-desktop-content-paddings: 6px var(--gap-12) var(--gap-16);
|
|
19
|
+
--modal-l-header-desktop-font-size: 30px;
|
|
20
|
+
--modal-l-header-desktop-line-height: 36px;
|
|
21
|
+
--modal-header-desktop-font-weight: bold;
|
|
22
|
+
--modal-header-desktop-font-family: var(--font-family-system);
|
|
23
|
+
|
|
24
|
+
/* mobile */
|
|
25
|
+
|
|
26
|
+
/* paddings */
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
border-top-left-radius: var(--modal-border-radius);
|
|
31
|
+
border-top-right-radius: var(--modal-border-radius);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.content {
|
|
35
|
+
font-weight: var(--modal-header-desktop-font-weight);
|
|
36
|
+
font-family: var(--modal-header-desktop-font-family);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.size-500 .content,
|
|
40
|
+
.size-600 .content {
|
|
41
|
+
padding: var(--modal-s-header-desktop-content-paddings);
|
|
42
|
+
font-size: var(--modal-s-header-desktop-font-size);
|
|
43
|
+
line-height: var(--modal-s-header-desktop-line-height);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.size-800 .content,
|
|
47
|
+
.size-1140 .content,
|
|
48
|
+
.fullscreen .content {
|
|
49
|
+
padding: var(--modal-l-header-desktop-content-paddings);
|
|
50
|
+
font-size: var(--modal-l-header-desktop-font-size);
|
|
51
|
+
line-height: var(--modal-l-header-desktop-line-height);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.size-500,
|
|
55
|
+
.size-600,
|
|
56
|
+
.size-800,
|
|
57
|
+
.size-1140,
|
|
58
|
+
.fullscreen {
|
|
59
|
+
padding: var(--modal-s-header-paddings);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sticky {
|
|
63
|
+
top: calc(var(--modal-vertical-padding) * -1)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sticky.fullscreen {
|
|
67
|
+
top: var(--gap-0);
|
|
68
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-header-background: var(--color-light-modal-bg-primary);
|
|
5
|
+
|
|
6
|
+
/* sizes */
|
|
7
|
+
|
|
8
|
+
/* paddings */
|
|
9
|
+
|
|
10
|
+
/* scroll */
|
|
11
|
+
--modal-header-highlight-background: var(--color-light-modal-bg-primary);
|
|
12
|
+
--modal-header-highlight-box-shadow: 0 1px 0 0 var(--color-light-neutral-300);
|
|
13
|
+
|
|
14
|
+
/* desktop */
|
|
15
|
+
|
|
16
|
+
/* mobile */
|
|
17
|
+
|
|
18
|
+
/* paddings */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.highlighted {
|
|
22
|
+
background: var(--modal-header-highlight-background);
|
|
23
|
+
box-shadow: var(--modal-header-highlight-box-shadow);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sticky {
|
|
27
|
+
position: sticky;
|
|
28
|
+
z-index: 1
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sticky.hasContent {
|
|
32
|
+
background: var(--modal-header-background);
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
|
|
5
|
+
/* sizes */
|
|
6
|
+
|
|
7
|
+
/* paddings */
|
|
8
|
+
|
|
9
|
+
/* scroll */
|
|
10
|
+
|
|
11
|
+
/* desktop */
|
|
12
|
+
|
|
13
|
+
/* mobile */
|
|
14
|
+
--modal-header-mobile-content-paddings: 10px var(--gap-8);
|
|
15
|
+
--modal-header-mobile-font-size: 20px;
|
|
16
|
+
--modal-header-mobile-line-height: 28px;
|
|
17
|
+
--modal-header-mobile-font-family: var(--font-family-system);
|
|
18
|
+
--modal-header-mobile-font-weight: 600;
|
|
19
|
+
|
|
20
|
+
/* paddings */
|
|
21
|
+
--modal-header-mobile-paddings: var(--gap-4) var(--gap-8);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.header {
|
|
25
|
+
padding: var(--modal-header-mobile-paddings);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sticky {
|
|
29
|
+
top: var(--gap-0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content {
|
|
33
|
+
font-size: var(--modal-header-mobile-font-size);
|
|
34
|
+
line-height: var(--modal-header-mobile-line-height);
|
|
35
|
+
font-family: var(--modal-header-mobile-font-family);
|
|
36
|
+
font-weight: var(--modal-header-mobile-font-weight);
|
|
37
|
+
|
|
38
|
+
padding: var(--modal-header-mobile-content-paddings);
|
|
39
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ControlsProps } from "../components/controls/index";
|
|
4
|
+
import { HeaderProps } from "../components/header/Component";
|
|
5
|
+
declare const ModalDesktop: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
6
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | 500 | 600 | 800 | 1140 | undefined;
|
|
7
|
+
fullscreen?: boolean | undefined;
|
|
8
|
+
fixedPosition?: boolean | undefined;
|
|
9
|
+
hasCloser?: boolean | undefined;
|
|
10
|
+
iOSLock?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>> & {
|
|
12
|
+
Content: React.FC<import("../typings").ContentProps>;
|
|
13
|
+
Header: React.FC<Omit<HeaderProps, "titleSize" | "subtitle">>;
|
|
14
|
+
Footer: React.FC<import("../components/footer/Component").FooterProps>;
|
|
15
|
+
Controls: React.FC<Omit<ControlsProps, "mobileLayout">>;
|
|
16
|
+
};
|
|
17
|
+
export { ModalDesktop };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Modal } from '../Component.js';
|
|
3
|
+
import { Content } from '../components/content/Component.js';
|
|
4
|
+
import { Controls } from '../components/controls/Component.js';
|
|
5
|
+
import { Footer } from '../components/footer/Component.js';
|
|
6
|
+
import { Header } from '../components/header/Component.js';
|
|
7
|
+
|
|
8
|
+
const ModalDesktopComponent = forwardRef((props, ref) => (React.createElement(Modal, { ...props, ref: ref, view: 'desktop' })));
|
|
9
|
+
const ModalDesktop = Object.assign(ModalDesktopComponent, {
|
|
10
|
+
Content,
|
|
11
|
+
Header: Header,
|
|
12
|
+
Footer,
|
|
13
|
+
Controls: Controls,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { ModalDesktop };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--modal-border-radius: var(--border-radius-12);
|
|
5
|
+
--modal-vertical-padding: var(--gap-40);
|
|
6
|
+
|
|
7
|
+
/* sizes */
|
|
8
|
+
--modal-s-width: 500px;
|
|
9
|
+
--modal-m-width: 600px;
|
|
10
|
+
--modal-l-width: 800px;
|
|
11
|
+
--modal-xl-width: 1140px;
|
|
12
|
+
|
|
13
|
+
/* paddings */
|
|
14
|
+
|
|
15
|
+
/* scroll */
|
|
16
|
+
|
|
17
|
+
/* desktop */
|
|
18
|
+
|
|
19
|
+
/* mobile */
|
|
20
|
+
|
|
21
|
+
/* paddings */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.wrapper {
|
|
25
|
+
padding-top: var(--modal-vertical-padding);
|
|
26
|
+
padding-bottom: var(--modal-vertical-padding);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.component {
|
|
30
|
+
width: 100%;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
border-radius: var(--modal-border-radius);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.fullscreen {
|
|
36
|
+
padding-top: var(--gap-0);
|
|
37
|
+
padding-bottom: var(--gap-0)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.fullscreen .component {
|
|
41
|
+
flex: 1;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.size-500 {
|
|
46
|
+
width: var(--modal-s-width);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.size-600 {
|
|
50
|
+
width: var(--modal-m-width);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.size-800 {
|
|
54
|
+
width: var(--modal-l-width);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.size-1140 {
|
|
58
|
+
width: var(--modal-xl-width);
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalDesktop } from './Component.desktop.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalResponsive as Modal } from './Component.responsive.js';
|