@alfalab/core-components-navigation-bar-private 0.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/Component.d.ts +5 -0
- package/Component.js +165 -0
- package/components/back-arrow-addon/Component.d.ts +26 -0
- package/components/back-arrow-addon/Component.js +35 -0
- package/components/back-arrow-addon/index.css +76 -0
- package/components/back-arrow-addon/index.d.ts +1 -0
- package/components/back-arrow-addon/index.js +9 -0
- package/components/closer/Component.d.ts +35 -0
- package/components/closer/Component.js +32 -0
- package/components/closer/index.css +48 -0
- package/components/closer/index.d.ts +1 -0
- package/components/closer/index.js +9 -0
- package/cssm/Component.d.ts +5 -0
- package/cssm/Component.js +164 -0
- package/cssm/components/back-arrow-addon/Component.d.ts +26 -0
- package/cssm/components/back-arrow-addon/Component.js +34 -0
- package/cssm/components/back-arrow-addon/index.d.ts +1 -0
- package/cssm/components/back-arrow-addon/index.js +9 -0
- package/cssm/components/back-arrow-addon/index.module.css +75 -0
- package/cssm/components/closer/Component.d.ts +35 -0
- package/cssm/components/closer/Component.js +31 -0
- package/cssm/components/closer/index.d.ts +1 -0
- package/cssm/components/closer/index.js +9 -0
- package/cssm/components/closer/index.module.css +47 -0
- package/cssm/index.d.ts +2 -0
- package/cssm/index.js +9 -0
- package/cssm/index.module.css +108 -0
- package/cssm/shared/index.d.ts +2 -0
- package/cssm/shared/index.js +11 -0
- package/cssm/types.d.ts +118 -0
- package/cssm/types.js +2 -0
- package/cssm/vars.css +20 -0
- package/esm/Component.d.ts +5 -0
- package/esm/Component.js +155 -0
- package/esm/components/back-arrow-addon/Component.d.ts +26 -0
- package/esm/components/back-arrow-addon/Component.js +26 -0
- package/esm/components/back-arrow-addon/index.css +76 -0
- package/esm/components/back-arrow-addon/index.d.ts +1 -0
- package/esm/components/back-arrow-addon/index.js +1 -0
- package/esm/components/closer/Component.d.ts +35 -0
- package/esm/components/closer/Component.js +23 -0
- package/esm/components/closer/index.css +48 -0
- package/esm/components/closer/index.d.ts +1 -0
- package/esm/components/closer/index.js +1 -0
- package/esm/index.css +108 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/esm/shared/index.d.ts +2 -0
- package/esm/shared/index.js +2 -0
- package/esm/types.d.ts +118 -0
- package/esm/types.js +1 -0
- package/index.css +108 -0
- package/index.d.ts +2 -0
- package/index.js +9 -0
- package/modern/Component.d.ts +5 -0
- package/modern/Component.js +160 -0
- package/modern/components/back-arrow-addon/Component.d.ts +26 -0
- package/modern/components/back-arrow-addon/Component.js +23 -0
- package/modern/components/back-arrow-addon/index.css +76 -0
- package/modern/components/back-arrow-addon/index.d.ts +1 -0
- package/modern/components/back-arrow-addon/index.js +1 -0
- package/modern/components/closer/Component.d.ts +35 -0
- package/modern/components/closer/Component.js +20 -0
- package/modern/components/closer/index.css +48 -0
- package/modern/components/closer/index.d.ts +1 -0
- package/modern/components/closer/index.js +1 -0
- package/modern/index.css +108 -0
- package/modern/index.d.ts +2 -0
- package/modern/index.js +1 -0
- package/modern/shared/index.d.ts +2 -0
- package/modern/shared/index.js +2 -0
- package/modern/types.d.ts +118 -0
- package/modern/types.js +1 -0
- package/package.json +27 -0
- package/shared/index.d.ts +2 -0
- package/shared/index.js +11 -0
- package/shared/package.json +3 -0
- package/src/Component.tsx +284 -0
- package/src/components/back-arrow-addon/Component.tsx +79 -0
- package/src/components/back-arrow-addon/index.module.css +69 -0
- package/src/components/back-arrow-addon/index.ts +1 -0
- package/src/components/closer/Component.tsx +80 -0
- package/src/components/closer/index.module.css +32 -0
- package/src/components/closer/index.ts +1 -0
- package/src/index.module.css +118 -0
- package/src/index.ts +2 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/package.json +3 -0
- package/src/types.ts +143 -0
- package/src/vars.css +9 -0
- package/types.d.ts +118 -0
- package/types.js +2 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { ButtonDesktop } from '@alfalab/core-components-button/desktop';
|
|
5
|
+
import { Typography } from '@alfalab/core-components-typography';
|
|
6
|
+
import { ArrowLeftMediumMIcon } from '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
|
|
7
|
+
import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
8
|
+
|
|
9
|
+
import styles from './index.module.css';
|
|
10
|
+
|
|
11
|
+
export interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
12
|
+
/**
|
|
13
|
+
* Текст после иконки
|
|
14
|
+
*/
|
|
15
|
+
text?: string | null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Дополнительный класс
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Вид компонента
|
|
24
|
+
*/
|
|
25
|
+
view: 'mobile' | 'desktop';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Прозрачность текста
|
|
29
|
+
*/
|
|
30
|
+
textOpacity?: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Обработчик клика
|
|
34
|
+
*/
|
|
35
|
+
onClick?: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const BackArrowAddon: React.FC<BackArrowAddonProps> = ({
|
|
39
|
+
text = 'Назад',
|
|
40
|
+
onClick,
|
|
41
|
+
className,
|
|
42
|
+
textOpacity = 1,
|
|
43
|
+
view,
|
|
44
|
+
...htmlAttributes
|
|
45
|
+
}) => {
|
|
46
|
+
const Icon = view === 'desktop' ? ArrowLeftMediumMIcon : ArrowLeftMIcon;
|
|
47
|
+
const isMobileView = view === 'mobile';
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<ButtonDesktop
|
|
51
|
+
view='text'
|
|
52
|
+
size={isMobileView ? 'xxs' : 's'}
|
|
53
|
+
onClick={onClick}
|
|
54
|
+
aria-label='назад'
|
|
55
|
+
className={cn(styles.component, { [styles.mobileComponent]: isMobileView }, className)}
|
|
56
|
+
{...htmlAttributes}
|
|
57
|
+
>
|
|
58
|
+
<div className={styles.flex}>
|
|
59
|
+
<div
|
|
60
|
+
className={cn(styles.iconWrapper, {
|
|
61
|
+
[styles.mobileWrapper]: isMobileView,
|
|
62
|
+
})}
|
|
63
|
+
>
|
|
64
|
+
<Icon />
|
|
65
|
+
</div>
|
|
66
|
+
{textOpacity > 0 && text && (
|
|
67
|
+
<Typography.Text
|
|
68
|
+
className={styles.text}
|
|
69
|
+
view={view === 'desktop' ? 'primary-large' : 'component'}
|
|
70
|
+
weight='medium'
|
|
71
|
+
style={{ opacity: textOpacity }}
|
|
72
|
+
>
|
|
73
|
+
{text}
|
|
74
|
+
</Typography.Text>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
</ButtonDesktop>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
|
+
@import '../../vars.css';
|
|
3
|
+
|
|
4
|
+
.component {
|
|
5
|
+
height: 100%;
|
|
6
|
+
background: var(--color-light-bg-primary-alpha-40);
|
|
7
|
+
backdrop-filter: blur(10px);
|
|
8
|
+
border-radius: var(--border-radius-pill);
|
|
9
|
+
min-width: 48px;
|
|
10
|
+
|
|
11
|
+
& svg > path {
|
|
12
|
+
transition: fill 0.2s ease;
|
|
13
|
+
fill: var(--color-light-neutral-1500);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
& svg > path {
|
|
18
|
+
fill: var(--color-light-neutral-1500-hover);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:active {
|
|
23
|
+
& svg > path {
|
|
24
|
+
fill: var(--color-light-neutral-1500-press);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mobileComponent {
|
|
30
|
+
height: 32px;
|
|
31
|
+
min-width: 32px;
|
|
32
|
+
margin: 0 var(--gap-xs);
|
|
33
|
+
backdrop-filter: none;
|
|
34
|
+
background: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.flex {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.iconWrapper {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
height: 48px;
|
|
47
|
+
margin: 0 var(--gap-xs) 0 var(--gap-s);
|
|
48
|
+
border-radius: var(--border-radius-circle);
|
|
49
|
+
|
|
50
|
+
& + .text {
|
|
51
|
+
margin-right: var(--gap-s);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.mobileWrapper {
|
|
56
|
+
width: 32px;
|
|
57
|
+
height: 32px;
|
|
58
|
+
background: var(--color-light-neutral-translucent-100);
|
|
59
|
+
backdrop-filter: blur(10px);
|
|
60
|
+
margin: 0;
|
|
61
|
+
|
|
62
|
+
& + .text {
|
|
63
|
+
margin: 0 var(--gap-s) 0 var(--gap-xs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& svg > path {
|
|
67
|
+
fill: var(--navigation-bar-back-arrow-mobile-fill);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes, ElementType, FC } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { IconButton } from '@alfalab/core-components-icon-button';
|
|
5
|
+
import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
6
|
+
import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
|
|
7
|
+
|
|
8
|
+
import styles from './index.module.css';
|
|
9
|
+
|
|
10
|
+
export interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
/**
|
|
12
|
+
* Вид компонента
|
|
13
|
+
*/
|
|
14
|
+
view: 'desktop' | 'mobile';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Дополнительный класс
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Позиция крестика
|
|
23
|
+
*/
|
|
24
|
+
align?: 'left' | 'right';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Фиксирует крестик
|
|
28
|
+
*/
|
|
29
|
+
sticky?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Иконка
|
|
33
|
+
*/
|
|
34
|
+
icon?: ElementType;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
38
|
+
*/
|
|
39
|
+
dataTestId?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Коллбэк закрытия.
|
|
43
|
+
*/
|
|
44
|
+
onClose?: (
|
|
45
|
+
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,
|
|
46
|
+
reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick',
|
|
47
|
+
) => void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Closer: FC<CloserProps> = ({
|
|
51
|
+
view,
|
|
52
|
+
className,
|
|
53
|
+
sticky,
|
|
54
|
+
icon = view === 'desktop' ? CrossHeavyMIcon : CrossMIcon,
|
|
55
|
+
dataTestId,
|
|
56
|
+
onClose,
|
|
57
|
+
...restProps
|
|
58
|
+
}) => {
|
|
59
|
+
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
60
|
+
onClose?.(event, 'closerClick');
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={cn(styles.closer, className, {
|
|
66
|
+
[styles.sticky]: sticky,
|
|
67
|
+
})}
|
|
68
|
+
>
|
|
69
|
+
<IconButton
|
|
70
|
+
size={view === 'desktop' ? 's' : 'xs'}
|
|
71
|
+
className={cn(styles.button, { [styles.mobile]: view === 'mobile' })}
|
|
72
|
+
aria-label='закрыть'
|
|
73
|
+
onClick={handleClick}
|
|
74
|
+
icon={icon}
|
|
75
|
+
dataTestId={dataTestId}
|
|
76
|
+
{...restProps}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
|
+
@import '../../vars.css';
|
|
3
|
+
|
|
4
|
+
.closer {
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
width: 48px;
|
|
7
|
+
height: 48px;
|
|
8
|
+
margin-left: auto;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button {
|
|
15
|
+
background: var(--color-light-bg-primary-alpha-40);
|
|
16
|
+
backdrop-filter: blur(10px);
|
|
17
|
+
color: var(--color-light-neutral-1500);
|
|
18
|
+
|
|
19
|
+
&.mobile {
|
|
20
|
+
background: var(--color-light-neutral-translucent-100);
|
|
21
|
+
color: var(--navigation-bar-closer-mobile-color);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button.button {
|
|
26
|
+
border-radius: var(--border-radius-circle);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sticky {
|
|
30
|
+
position: sticky;
|
|
31
|
+
top: 0;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
|
+
|
|
3
|
+
.header {
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
transition: box-shadow 0.2s ease, background 0.2s ease;
|
|
7
|
+
|
|
8
|
+
&.header.backgroundImage {
|
|
9
|
+
background-repeat: no-repeat;
|
|
10
|
+
background-position: center;
|
|
11
|
+
background-size: cover;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.mainLine {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
background-color: inherit;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.mainLineSticky {
|
|
24
|
+
position: sticky;
|
|
25
|
+
top: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.mainLineWithImageBg {
|
|
29
|
+
background-color: initial;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content {
|
|
33
|
+
color: var(--color-light-text-primary);
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-flow: column nowrap;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
flex-grow: 1;
|
|
38
|
+
align-self: baseline;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
min-height: 48px;
|
|
41
|
+
|
|
42
|
+
&.withBothAddons,
|
|
43
|
+
&.withCompactTitle {
|
|
44
|
+
@mixin action_component;
|
|
45
|
+
align-self: center;
|
|
46
|
+
padding-top: var(--gap-2xs);
|
|
47
|
+
padding-bottom: var(--gap-2xs);
|
|
48
|
+
|
|
49
|
+
& > .children,
|
|
50
|
+
& > .title {
|
|
51
|
+
-webkit-line-clamp: 1;
|
|
52
|
+
word-break: break-all;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.contentOnBotDesktop.contentOnBotDesktop {
|
|
57
|
+
padding-top: var(--gap-s);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.contentOnBotMobile.contentOnBotMobile {
|
|
61
|
+
padding-top: var(--gap-s);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.title {
|
|
66
|
+
word-break: break-word;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.subtitle {
|
|
70
|
+
@mixin paragraph_primary_small;
|
|
71
|
+
@mixin row_limit 1;
|
|
72
|
+
|
|
73
|
+
color: var(--color-light-text-secondary);
|
|
74
|
+
word-break: break-all;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.addonsWrapper {
|
|
78
|
+
display: flex;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.rightAddons {
|
|
82
|
+
margin-left: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.addon {
|
|
86
|
+
min-width: 48px;
|
|
87
|
+
height: 48px;
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
align-items: center;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
pointer-events: all;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.bottomAddons {
|
|
96
|
+
pointer-events: all;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.closer {
|
|
100
|
+
margin-left: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.left {
|
|
104
|
+
text-align: left;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.center {
|
|
108
|
+
text-align: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.trim {
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
|
|
114
|
+
& .title,
|
|
115
|
+
& .children {
|
|
116
|
+
@mixin row_limit 2;
|
|
117
|
+
}
|
|
118
|
+
}
|
package/src/index.ts
ADDED
package/src/types.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { BackArrowAddonProps } from './components/back-arrow-addon';
|
|
4
|
+
import type { CloserProps } from './components/closer';
|
|
5
|
+
|
|
6
|
+
export type NavigationBarPrivateProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Контент шапки
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Заголовок шапки
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
19
|
+
*/
|
|
20
|
+
subtitle?: ReactNode;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
24
|
+
*/
|
|
25
|
+
titleSize?: 'default' | 'compact';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Доп. класс для аддонов
|
|
29
|
+
*/
|
|
30
|
+
addonClassName?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Слот слева
|
|
34
|
+
*/
|
|
35
|
+
leftAddons?: ReactNode;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Слот справа
|
|
39
|
+
*/
|
|
40
|
+
rightAddons?: ReactNode;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Дополнительный класс для closer
|
|
44
|
+
*/
|
|
45
|
+
closerClassName?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Слот снизу
|
|
49
|
+
*/
|
|
50
|
+
bottomAddons?: ReactNode;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Наличие компонента крестика
|
|
54
|
+
*/
|
|
55
|
+
hasCloser?: boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Наличие кнопки "Назад"
|
|
59
|
+
*/
|
|
60
|
+
hasBackButton?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Дополнительный класс для правого аддона
|
|
64
|
+
*/
|
|
65
|
+
backButtonClassName?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Дополнительные пропсы для кнопки "Назад"
|
|
69
|
+
*/
|
|
70
|
+
backButtonProps?: Omit<BackArrowAddonProps, 'view' | 'textOpacity' | 'onClick'>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Дополнительный класс
|
|
74
|
+
*/
|
|
75
|
+
className?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Дополнительный класс для контента
|
|
79
|
+
*/
|
|
80
|
+
contentClassName?: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Дополнительный класс для нижнего аддона
|
|
84
|
+
*/
|
|
85
|
+
bottomAddonsClassName?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Выравнивание заголовка
|
|
89
|
+
*/
|
|
90
|
+
align?: 'left' | 'center';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Обрезать ли заголовок
|
|
94
|
+
*/
|
|
95
|
+
trim?: boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Фиксирует шапку
|
|
99
|
+
*/
|
|
100
|
+
sticky?: boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
104
|
+
*/
|
|
105
|
+
dataTestId?: string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Фоновое изображение
|
|
109
|
+
*/
|
|
110
|
+
imageUrl?: string;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Иконка closer.
|
|
114
|
+
*/
|
|
115
|
+
closerIcon?: React.ElementType;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Обработчик закрытия
|
|
119
|
+
*/
|
|
120
|
+
onClose?: CloserProps['onClose'];
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* обработчик клика по кнопке "назад"
|
|
124
|
+
*/
|
|
125
|
+
onBack?: () => void;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Вид шапки - мобильный или десктоп
|
|
129
|
+
*/
|
|
130
|
+
view: 'desktop' | 'mobile';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Ссылка на родительскую ноду overflow: auto
|
|
134
|
+
*/
|
|
135
|
+
scrollableParentRef?: React.RefObject<HTMLDivElement>;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type ContentParams = {
|
|
139
|
+
extraClassName?: string;
|
|
140
|
+
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
141
|
+
style?: React.CSSProperties;
|
|
142
|
+
hidden?: boolean;
|
|
143
|
+
};
|
package/src/vars.css
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
/* closer-mobile */
|
|
5
|
+
--navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
|
|
6
|
+
|
|
7
|
+
/* back-arrow */
|
|
8
|
+
--navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
|
|
9
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
|
|
5
|
+
import { CloserProps } from "./components/closer/index";
|
|
6
|
+
type NavigationBarPrivateProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Контент шапки
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Заголовок шапки
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
17
|
+
*/
|
|
18
|
+
subtitle?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
21
|
+
*/
|
|
22
|
+
titleSize?: 'default' | 'compact';
|
|
23
|
+
/**
|
|
24
|
+
* Доп. класс для аддонов
|
|
25
|
+
*/
|
|
26
|
+
addonClassName?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Слот слева
|
|
29
|
+
*/
|
|
30
|
+
leftAddons?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Слот справа
|
|
33
|
+
*/
|
|
34
|
+
rightAddons?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Дополнительный класс для closer
|
|
37
|
+
*/
|
|
38
|
+
closerClassName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Слот снизу
|
|
41
|
+
*/
|
|
42
|
+
bottomAddons?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Наличие компонента крестика
|
|
45
|
+
*/
|
|
46
|
+
hasCloser?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Наличие кнопки "Назад"
|
|
49
|
+
*/
|
|
50
|
+
hasBackButton?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Дополнительный класс для правого аддона
|
|
53
|
+
*/
|
|
54
|
+
backButtonClassName?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Дополнительные пропсы для кнопки "Назад"
|
|
57
|
+
*/
|
|
58
|
+
backButtonProps?: Omit<BackArrowAddonProps, 'view' | 'textOpacity' | 'onClick'>;
|
|
59
|
+
/**
|
|
60
|
+
* Дополнительный класс
|
|
61
|
+
*/
|
|
62
|
+
className?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Дополнительный класс для контента
|
|
65
|
+
*/
|
|
66
|
+
contentClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Дополнительный класс для нижнего аддона
|
|
69
|
+
*/
|
|
70
|
+
bottomAddonsClassName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Выравнивание заголовка
|
|
73
|
+
*/
|
|
74
|
+
align?: 'left' | 'center';
|
|
75
|
+
/**
|
|
76
|
+
* Обрезать ли заголовок
|
|
77
|
+
*/
|
|
78
|
+
trim?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Фиксирует шапку
|
|
81
|
+
*/
|
|
82
|
+
sticky?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
85
|
+
*/
|
|
86
|
+
dataTestId?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Фоновое изображение
|
|
89
|
+
*/
|
|
90
|
+
imageUrl?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Иконка closer.
|
|
93
|
+
*/
|
|
94
|
+
closerIcon?: React.ElementType;
|
|
95
|
+
/**
|
|
96
|
+
* Обработчик закрытия
|
|
97
|
+
*/
|
|
98
|
+
onClose?: CloserProps['onClose'];
|
|
99
|
+
/**
|
|
100
|
+
* обработчик клика по кнопке "назад"
|
|
101
|
+
*/
|
|
102
|
+
onBack?: () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Вид шапки - мобильный или десктоп
|
|
105
|
+
*/
|
|
106
|
+
view: 'desktop' | 'mobile';
|
|
107
|
+
/**
|
|
108
|
+
* Ссылка на родительскую ноду overflow: auto
|
|
109
|
+
*/
|
|
110
|
+
scrollableParentRef?: React.RefObject<HTMLDivElement>;
|
|
111
|
+
};
|
|
112
|
+
type ContentParams = {
|
|
113
|
+
extraClassName?: string;
|
|
114
|
+
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
115
|
+
style?: React.CSSProperties;
|
|
116
|
+
hidden?: boolean;
|
|
117
|
+
};
|
|
118
|
+
export { NavigationBarPrivateProps, ContentParams };
|
package/types.js
ADDED