@alfalab/core-components-navigation-bar 0.3.7 → 0.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 +7 -11
- package/components/back-arrow-addon/Component.js +3 -3
- package/components/back-arrow-addon/index.css +12 -12
- package/components/back-arrow-addon/index.js +1 -1
- package/components/closer/Component.js +1 -1
- package/components/closer/index.css +5 -5
- package/cssm/Component.js +6 -10
- package/cssm/components/back-arrow-addon/Component.js +2 -2
- package/cssm/components/back-arrow-addon/index.js +1 -1
- package/cssm/index.d.ts +0 -1
- package/cssm/index.js +4 -4
- package/cssm/shared.d.ts +2 -0
- package/cssm/shared.js +23 -0
- package/esm/Component.js +3 -7
- package/esm/components/back-arrow-addon/Component.js +3 -3
- package/esm/components/back-arrow-addon/index.css +12 -12
- package/esm/components/back-arrow-addon/index.js +1 -1
- package/esm/components/closer/Component.js +1 -1
- package/esm/components/closer/index.css +5 -5
- package/esm/index.css +27 -27
- package/esm/index.d.ts +0 -1
- package/esm/index.js +3 -2
- package/esm/shared.d.ts +2 -0
- package/esm/shared.js +12 -0
- package/index.css +27 -27
- package/index.d.ts +0 -1
- package/index.js +3 -3
- package/modern/Component.js +3 -7
- package/modern/components/back-arrow-addon/Component.js +3 -3
- package/modern/components/back-arrow-addon/index.css +12 -12
- package/modern/components/back-arrow-addon/index.js +1 -1
- package/modern/components/closer/Component.js +1 -1
- package/modern/components/closer/index.css +5 -5
- package/modern/index.css +27 -27
- package/modern/index.d.ts +0 -1
- package/modern/index.js +3 -2
- package/modern/shared.d.ts +2 -0
- package/modern/shared.js +11 -0
- package/package.json +6 -4
- package/shared.d.ts +2 -0
- package/shared.js +21 -0
- package/src/Component.tsx +282 -0
- package/src/components/back-arrow-addon/Component.tsx +82 -0
- package/src/components/back-arrow-addon/index.module.css +66 -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 +29 -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.ts +2 -0
- package/src/types.ts +137 -0
- package/src/vars.css +6 -0
package/Component.js
CHANGED
|
@@ -6,10 +6,11 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
8
|
var cn = require('classnames');
|
|
9
|
+
var coreComponentsShared = require('@alfalab/core-components-shared');
|
|
9
10
|
var hooks = require('@alfalab/hooks');
|
|
10
11
|
var components_backArrowAddon_Component = require('./components/back-arrow-addon/Component.js');
|
|
11
12
|
var components_closer_Component = require('./components/closer/Component.js');
|
|
12
|
-
require('@alfalab/core-components-button');
|
|
13
|
+
require('@alfalab/core-components-button/desktop');
|
|
13
14
|
require('@alfalab/core-components-typography');
|
|
14
15
|
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
15
16
|
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
@@ -23,12 +24,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
23
24
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
24
25
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
25
26
|
|
|
26
|
-
var
|
|
27
|
-
var elementPart = element ? "-".concat(element.toLowerCase()) : '';
|
|
28
|
-
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var styles = {"header":"navigation-bar__header_1bkig","backgroundImage":"navigation-bar__backgroundImage_1bkig","mainLine":"navigation-bar__mainLine_1bkig","mainLineSticky":"navigation-bar__mainLineSticky_1bkig","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1bkig","content":"navigation-bar__content_1bkig","withBothAddons":"navigation-bar__withBothAddons_1bkig","withCompactTitle":"navigation-bar__withCompactTitle_1bkig","children":"navigation-bar__children_1bkig","title":"navigation-bar__title_1bkig","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1bkig","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1bkig","subtitle":"navigation-bar__subtitle_1bkig","addonsWrapper":"navigation-bar__addonsWrapper_1bkig","rightAddons":"navigation-bar__rightAddons_1bkig","addon":"navigation-bar__addon_1bkig","bottomAddons":"navigation-bar__bottomAddons_1bkig","closer":"navigation-bar__closer_1bkig","left":"navigation-bar__left_1bkig","center":"navigation-bar__center_1bkig","trim":"navigation-bar__trim_1bkig"};
|
|
27
|
+
var styles = {"header":"navigation-bar__header_8a3yz","backgroundImage":"navigation-bar__backgroundImage_8a3yz","mainLine":"navigation-bar__mainLine_8a3yz","mainLineSticky":"navigation-bar__mainLineSticky_8a3yz","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_8a3yz","content":"navigation-bar__content_8a3yz","withBothAddons":"navigation-bar__withBothAddons_8a3yz","withCompactTitle":"navigation-bar__withCompactTitle_8a3yz","children":"navigation-bar__children_8a3yz","title":"navigation-bar__title_8a3yz","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_8a3yz","contentOnBotMobile":"navigation-bar__contentOnBotMobile_8a3yz","subtitle":"navigation-bar__subtitle_8a3yz","addonsWrapper":"navigation-bar__addonsWrapper_8a3yz","rightAddons":"navigation-bar__rightAddons_8a3yz","addon":"navigation-bar__addon_8a3yz","bottomAddons":"navigation-bar__bottomAddons_8a3yz","closer":"navigation-bar__closer_8a3yz","left":"navigation-bar__left_8a3yz","center":"navigation-bar__center_8a3yz","trim":"navigation-bar__trim_8a3yz"};
|
|
32
28
|
require('./index.css')
|
|
33
29
|
|
|
34
30
|
var ADDONS_HEIGHT = 48;
|
|
@@ -102,7 +98,7 @@ var NavigationBar = React.forwardRef(function (_a, ref) {
|
|
|
102
98
|
textOpacity = 0;
|
|
103
99
|
}
|
|
104
100
|
return (React__default.default.createElement("div", { className: cn__default.default(styles.addon, backButtonClassName) },
|
|
105
|
-
React__default.default.createElement(components_backArrowAddon_Component.BackArrowAddon, { textOpacity: textOpacity, view: view, onClick: onBack, "data-test-id": getDataTestId(dataTestId, 'back-button') })));
|
|
101
|
+
React__default.default.createElement(components_backArrowAddon_Component.BackArrowAddon, { textOpacity: textOpacity, view: view, onClick: onBack, "data-test-id": coreComponentsShared.getDataTestId(dataTestId, 'back-button') })));
|
|
106
102
|
};
|
|
107
103
|
var renderContent = function (args) {
|
|
108
104
|
var _a;
|
|
@@ -113,12 +109,12 @@ var NavigationBar = React.forwardRef(function (_a, ref) {
|
|
|
113
109
|
_a[styles.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
|
|
114
110
|
_a)), "aria-hidden": hidden },
|
|
115
111
|
children && React__default.default.createElement("div", { className: styles.children }, children),
|
|
116
|
-
title && (React__default.default.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
|
|
112
|
+
title && (React__default.default.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title') }, title)),
|
|
117
113
|
compactTitle && subtitle && React__default.default.createElement("div", { className: styles.subtitle }, subtitle)));
|
|
118
114
|
};
|
|
119
115
|
var renderCloser = function () { return (React__default.default.createElement("div", { className: cn__default.default(styles.addon, styles.closer, closerClassName) },
|
|
120
|
-
React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
|
|
121
|
-
return (React__default.default.createElement("div", { ref: mergeRefs__default.default([ref, headerRef]), className: cn__default.default(styles.header, className, (_b = {}, _b[styles.backgroundImage] = imageUrl, _b)), "data-test-id": getDataTestId(dataTestId), style: tslib.__assign(tslib.__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
|
|
116
|
+
React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
|
|
117
|
+
return (React__default.default.createElement("div", { ref: mergeRefs__default.default([ref, headerRef]), className: cn__default.default(styles.header, className, (_b = {}, _b[styles.backgroundImage] = imageUrl, _b)), "data-test-id": coreComponentsShared.getDataTestId(dataTestId), style: tslib.__assign(tslib.__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
|
|
122
118
|
bottomContentRef.current && {
|
|
123
119
|
top: -bottomContentRef.current.scrollHeight,
|
|
124
120
|
})) },
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
|
-
var
|
|
8
|
+
var desktop = require('@alfalab/core-components-button/desktop');
|
|
9
9
|
var coreComponentsTypography = require('@alfalab/core-components-typography');
|
|
10
10
|
var ArrowLeftMediumMIcon = require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
11
11
|
var ArrowLeftMIcon = require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
@@ -15,14 +15,14 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
15
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
16
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
17
17
|
|
|
18
|
-
var styles = {"component":"navigation-
|
|
18
|
+
var styles = {"component":"navigation-bar__component_7mweo","mobileComponent":"navigation-bar__mobileComponent_7mweo","flex":"navigation-bar__flex_7mweo","iconWrapper":"navigation-bar__iconWrapper_7mweo","text":"navigation-bar__text_7mweo","mobileWrapper":"navigation-bar__mobileWrapper_7mweo"};
|
|
19
19
|
require('./index.css')
|
|
20
20
|
|
|
21
21
|
var BackArrowAddon = function (_a) {
|
|
22
22
|
var _b, _c;
|
|
23
23
|
var _d = _a.text, text = _d === void 0 ? 'Назад' : _d, onClick = _a.onClick, className = _a.className, _e = _a.textOpacity, textOpacity = _e === void 0 ? 1 : _e, view = _a.view, htmlAttributes = tslib.__rest(_a, ["text", "onClick", "className", "textOpacity", "view"]);
|
|
24
24
|
var Icon = view === 'desktop' ? ArrowLeftMediumMIcon.ArrowLeftMediumMIcon : ArrowLeftMIcon.ArrowLeftMIcon;
|
|
25
|
-
return (React__default.default.createElement(
|
|
25
|
+
return (React__default.default.createElement(desktop.ButtonDesktop, tslib.__assign({ view: 'ghost', size: view === 'mobile' ? 'xxs' : 's', onClick: onClick, "aria-label": '\u043D\u0430\u0437\u0430\u0434', className: cn__default.default(styles.component, (_b = {}, _b[styles.mobileComponent] = view === 'mobile', _b), className) }, htmlAttributes),
|
|
26
26
|
React__default.default.createElement("div", { className: styles.flex },
|
|
27
27
|
React__default.default.createElement("div", { className: cn__default.default(styles.iconWrapper, (_c = {},
|
|
28
28
|
_c[styles.mobileWrapper] = view === 'mobile',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 18a7z */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e;
|
|
@@ -24,46 +24,46 @@
|
|
|
24
24
|
--gap-s: 12px;
|
|
25
25
|
} :root {
|
|
26
26
|
} :root {
|
|
27
|
-
} .navigation-
|
|
27
|
+
} .navigation-bar__component_7mweo {
|
|
28
28
|
height: 100%;
|
|
29
29
|
background: var(--color-light-bg-primary-alpha-40);
|
|
30
30
|
-webkit-backdrop-filter: blur(10px);
|
|
31
31
|
backdrop-filter: blur(10px);
|
|
32
32
|
border-radius: var(--border-radius-pill)
|
|
33
|
-
} .navigation-
|
|
33
|
+
} .navigation-bar__component_7mweo svg > path {
|
|
34
34
|
transition: fill 0.2s ease;
|
|
35
35
|
fill: var(--color-light-graphic-primary);
|
|
36
|
-
} .navigation-
|
|
36
|
+
} .navigation-bar__component_7mweo:hover svg > path {
|
|
37
37
|
fill: var(--color-light-graphic-primary-tint-20);
|
|
38
|
-
} .navigation-
|
|
38
|
+
} .navigation-bar__component_7mweo:active svg > path {
|
|
39
39
|
fill: var(--color-light-graphic-primary-tint-30);
|
|
40
|
-
} .navigation-
|
|
40
|
+
} .navigation-bar__mobileComponent_7mweo {
|
|
41
41
|
height: 32px;
|
|
42
42
|
margin: 0 var(--gap-xs);
|
|
43
43
|
-webkit-backdrop-filter: none;
|
|
44
44
|
backdrop-filter: none;
|
|
45
45
|
background: none;
|
|
46
|
-
} .navigation-
|
|
46
|
+
} .navigation-bar__flex_7mweo {
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
|
-
} .navigation-
|
|
49
|
+
} .navigation-bar__iconWrapper_7mweo {
|
|
50
50
|
display: inline-flex;
|
|
51
51
|
align-items: center;
|
|
52
52
|
justify-content: center;
|
|
53
53
|
height: 48px;
|
|
54
54
|
margin: 0 var(--gap-xs) 0 var(--gap-s);
|
|
55
55
|
border-radius: var(--border-radius-circle)
|
|
56
|
-
} .navigation-
|
|
56
|
+
} .navigation-bar__iconWrapper_7mweo + .navigation-bar__text_7mweo {
|
|
57
57
|
margin-right: var(--gap-s);
|
|
58
|
-
} .navigation-
|
|
58
|
+
} .navigation-bar__mobileWrapper_7mweo {
|
|
59
59
|
width: 32px;
|
|
60
60
|
height: 32px;
|
|
61
61
|
background: var(--color-light-specialbg-secondary-transparent);
|
|
62
62
|
-webkit-backdrop-filter: blur(10px);
|
|
63
63
|
backdrop-filter: blur(10px);
|
|
64
64
|
margin: 0
|
|
65
|
-
} .navigation-
|
|
65
|
+
} .navigation-bar__mobileWrapper_7mweo + .navigation-bar__text_7mweo {
|
|
66
66
|
margin: 0 var(--gap-s) 0 var(--gap-xs);
|
|
67
|
-
} .navigation-
|
|
67
|
+
} .navigation-bar__mobileWrapper_7mweo svg > path {
|
|
68
68
|
fill: var(--color-light-graphic-secondary);
|
|
69
69
|
}
|
|
@@ -6,7 +6,7 @@ var components_backArrowAddon_Component = require('./Component.js');
|
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
|
9
|
-
require('@alfalab/core-components-button');
|
|
9
|
+
require('@alfalab/core-components-button/desktop');
|
|
10
10
|
require('@alfalab/core-components-typography');
|
|
11
11
|
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
12
12
|
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
@@ -14,7 +14,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
16
16
|
|
|
17
|
-
var styles = {"closer":"navigation-
|
|
17
|
+
var styles = {"closer":"navigation-bar__closer_1gqyh","button":"navigation-bar__button_1gqyh","mobile":"navigation-bar__mobile_1gqyh","sticky":"navigation-bar__sticky_1gqyh"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var Closer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: u4dxk */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} :root {
|
|
22
22
|
/* closer-mobile */
|
|
23
23
|
--navigation-bar-closer-mobile-color: var(--color-light-graphic-secondary);
|
|
24
|
-
} .navigation-
|
|
24
|
+
} .navigation-bar__closer_1gqyh {
|
|
25
25
|
flex-shrink: 0;
|
|
26
26
|
width: 48px;
|
|
27
27
|
height: 48px;
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
justify-content: center;
|
|
32
|
-
} .navigation-
|
|
32
|
+
} .navigation-bar__button_1gqyh {
|
|
33
33
|
background: var(--color-light-bg-primary-alpha-40);
|
|
34
34
|
-webkit-backdrop-filter: blur(10px);
|
|
35
35
|
backdrop-filter: blur(10px);
|
|
36
36
|
border-radius: 50px;
|
|
37
37
|
color: var(--color-light-graphic-primary)
|
|
38
|
-
} .navigation-
|
|
38
|
+
} .navigation-bar__button_1gqyh.navigation-bar__mobile_1gqyh {
|
|
39
39
|
background: var(--color-light-specialbg-secondary-transparent);
|
|
40
40
|
color: var(--navigation-bar-closer-mobile-color);
|
|
41
|
-
} .navigation-
|
|
41
|
+
} .navigation-bar__sticky_1gqyh {
|
|
42
42
|
position: sticky;
|
|
43
43
|
top: 0;
|
|
44
44
|
}
|
package/cssm/Component.js
CHANGED
|
@@ -6,11 +6,12 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
8
|
var cn = require('classnames');
|
|
9
|
+
var coreComponentsShared = require('@alfalab/core-components-shared/cssm');
|
|
9
10
|
var hooks = require('@alfalab/hooks');
|
|
10
11
|
var components_backArrowAddon_Component = require('./components/back-arrow-addon/Component.js');
|
|
11
12
|
var components_closer_Component = require('./components/closer/Component.js');
|
|
12
13
|
var styles = require('./index.module.css');
|
|
13
|
-
require('@alfalab/core-components-button/cssm');
|
|
14
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
14
15
|
require('@alfalab/core-components-typography/cssm');
|
|
15
16
|
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
16
17
|
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
@@ -27,11 +28,6 @@ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
|
27
28
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
28
29
|
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
29
30
|
|
|
30
|
-
var getDataTestId = function (dataTestId, element) {
|
|
31
|
-
var elementPart = element ? "-".concat(element.toLowerCase()) : '';
|
|
32
|
-
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
31
|
var ADDONS_HEIGHT = 48;
|
|
36
32
|
var NavigationBar = React.forwardRef(function (_a, ref) {
|
|
37
33
|
var _b, _c, _d;
|
|
@@ -103,7 +99,7 @@ var NavigationBar = React.forwardRef(function (_a, ref) {
|
|
|
103
99
|
textOpacity = 0;
|
|
104
100
|
}
|
|
105
101
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addon, backButtonClassName) },
|
|
106
|
-
React__default.default.createElement(components_backArrowAddon_Component.BackArrowAddon, { textOpacity: textOpacity, view: view, onClick: onBack, "data-test-id": getDataTestId(dataTestId, 'back-button') })));
|
|
102
|
+
React__default.default.createElement(components_backArrowAddon_Component.BackArrowAddon, { textOpacity: textOpacity, view: view, onClick: onBack, "data-test-id": coreComponentsShared.getDataTestId(dataTestId, 'back-button') })));
|
|
107
103
|
};
|
|
108
104
|
var renderContent = function (args) {
|
|
109
105
|
var _a;
|
|
@@ -114,12 +110,12 @@ var NavigationBar = React.forwardRef(function (_a, ref) {
|
|
|
114
110
|
_a[styles__default.default.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
|
|
115
111
|
_a)), "aria-hidden": hidden },
|
|
116
112
|
children && React__default.default.createElement("div", { className: styles__default.default.children }, children),
|
|
117
|
-
title && (React__default.default.createElement("div", { className: styles__default.default.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
|
|
113
|
+
title && (React__default.default.createElement("div", { className: styles__default.default.title, "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title') }, title)),
|
|
118
114
|
compactTitle && subtitle && React__default.default.createElement("div", { className: styles__default.default.subtitle }, subtitle)));
|
|
119
115
|
};
|
|
120
116
|
var renderCloser = function () { return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addon, styles__default.default.closer, closerClassName) },
|
|
121
|
-
React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
|
|
122
|
-
return (React__default.default.createElement("div", { ref: mergeRefs__default.default([ref, headerRef]), className: cn__default.default(styles__default.default.header, className, (_b = {}, _b[styles__default.default.backgroundImage] = imageUrl, _b)), "data-test-id": getDataTestId(dataTestId), style: tslib.__assign(tslib.__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
|
|
117
|
+
React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
|
|
118
|
+
return (React__default.default.createElement("div", { ref: mergeRefs__default.default([ref, headerRef]), className: cn__default.default(styles__default.default.header, className, (_b = {}, _b[styles__default.default.backgroundImage] = imageUrl, _b)), "data-test-id": coreComponentsShared.getDataTestId(dataTestId), style: tslib.__assign(tslib.__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
|
|
123
119
|
bottomContentRef.current && {
|
|
124
120
|
top: -bottomContentRef.current.scrollHeight,
|
|
125
121
|
})) },
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
|
-
var
|
|
8
|
+
var desktop = require('@alfalab/core-components-button/cssm/desktop');
|
|
9
9
|
var coreComponentsTypography = require('@alfalab/core-components-typography/cssm');
|
|
10
10
|
var ArrowLeftMediumMIcon = require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
11
11
|
var ArrowLeftMIcon = require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
@@ -21,7 +21,7 @@ var BackArrowAddon = function (_a) {
|
|
|
21
21
|
var _b, _c;
|
|
22
22
|
var _d = _a.text, text = _d === void 0 ? 'Назад' : _d, onClick = _a.onClick, className = _a.className, _e = _a.textOpacity, textOpacity = _e === void 0 ? 1 : _e, view = _a.view, htmlAttributes = tslib.__rest(_a, ["text", "onClick", "className", "textOpacity", "view"]);
|
|
23
23
|
var Icon = view === 'desktop' ? ArrowLeftMediumMIcon.ArrowLeftMediumMIcon : ArrowLeftMIcon.ArrowLeftMIcon;
|
|
24
|
-
return (React__default.default.createElement(
|
|
24
|
+
return (React__default.default.createElement(desktop.ButtonDesktop, tslib.__assign({ view: 'ghost', size: view === 'mobile' ? 'xxs' : 's', onClick: onClick, "aria-label": '\u043D\u0430\u0437\u0430\u0434', className: cn__default.default(styles__default.default.component, (_b = {}, _b[styles__default.default.mobileComponent] = view === 'mobile', _b), className) }, htmlAttributes),
|
|
25
25
|
React__default.default.createElement("div", { className: styles__default.default.flex },
|
|
26
26
|
React__default.default.createElement("div", { className: cn__default.default(styles__default.default.iconWrapper, (_c = {},
|
|
27
27
|
_c[styles__default.default.mobileWrapper] = view === 'mobile',
|
|
@@ -6,7 +6,7 @@ var components_backArrowAddon_Component = require('./Component.js');
|
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
|
9
|
-
require('@alfalab/core-components-button/cssm');
|
|
9
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
10
10
|
require('@alfalab/core-components-typography/cssm');
|
|
11
11
|
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
12
12
|
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
package/cssm/index.d.ts
CHANGED
package/cssm/index.js
CHANGED
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var Component = require('./Component.js');
|
|
6
|
-
var components_closer_Component = require('./components/closer/Component.js');
|
|
7
6
|
require('tslib');
|
|
8
7
|
require('react');
|
|
9
8
|
require('react-merge-refs');
|
|
10
9
|
require('classnames');
|
|
10
|
+
require('@alfalab/core-components-shared/cssm');
|
|
11
11
|
require('@alfalab/hooks');
|
|
12
12
|
require('./components/back-arrow-addon/Component.js');
|
|
13
|
-
require('@alfalab/core-components-button/cssm');
|
|
13
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
14
14
|
require('@alfalab/core-components-typography/cssm');
|
|
15
15
|
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
16
16
|
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
17
17
|
require('./components/back-arrow-addon/index.module.css');
|
|
18
|
-
require('./
|
|
18
|
+
require('./components/closer/Component.js');
|
|
19
19
|
require('@alfalab/core-components-icon-button/cssm');
|
|
20
20
|
require('@alfalab/icons-glyph/CrossHeavyMIcon');
|
|
21
21
|
require('@alfalab/icons-glyph/CrossMIcon');
|
|
22
22
|
require('./components/closer/index.module.css');
|
|
23
|
+
require('./index.module.css');
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
exports.NavigationBar = Component.NavigationBar;
|
|
27
|
-
exports.Closer = components_closer_Component.Closer;
|
package/cssm/shared.d.ts
ADDED
package/cssm/shared.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var components_closer_Component = require('./components/closer/Component.js');
|
|
6
|
+
var components_backArrowAddon_Component = require('./components/back-arrow-addon/Component.js');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('react');
|
|
9
|
+
require('classnames');
|
|
10
|
+
require('@alfalab/core-components-icon-button/cssm');
|
|
11
|
+
require('@alfalab/icons-glyph/CrossHeavyMIcon');
|
|
12
|
+
require('@alfalab/icons-glyph/CrossMIcon');
|
|
13
|
+
require('./components/closer/index.module.css');
|
|
14
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
15
|
+
require('@alfalab/core-components-typography/cssm');
|
|
16
|
+
require('@alfalab/icons-glyph/ArrowLeftMediumMIcon');
|
|
17
|
+
require('@alfalab/icons-glyph/ArrowLeftMIcon');
|
|
18
|
+
require('./components/back-arrow-addon/index.module.css');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.Closer = components_closer_Component.Closer;
|
|
23
|
+
exports.BackArrowAddon = components_backArrowAddon_Component.BackArrowAddon;
|
package/esm/Component.js
CHANGED
|
@@ -2,10 +2,11 @@ import { __assign } from 'tslib';
|
|
|
2
2
|
import React, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
3
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
4
|
import cn from 'classnames';
|
|
5
|
+
import { getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
5
6
|
import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
6
7
|
import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
|
|
7
8
|
import { Closer } from './components/closer/Component.js';
|
|
8
|
-
import '@alfalab/core-components-button/esm';
|
|
9
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
9
10
|
import '@alfalab/core-components-typography/esm';
|
|
10
11
|
import '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
|
|
11
12
|
import '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
@@ -13,12 +14,7 @@ import '@alfalab/core-components-icon-button/esm';
|
|
|
13
14
|
import '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
14
15
|
import '@alfalab/icons-glyph/CrossMIcon';
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
-
var elementPart = element ? "-".concat(element.toLowerCase()) : '';
|
|
18
|
-
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var styles = {"header":"navigation-bar__header_1bkig","backgroundImage":"navigation-bar__backgroundImage_1bkig","mainLine":"navigation-bar__mainLine_1bkig","mainLineSticky":"navigation-bar__mainLineSticky_1bkig","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1bkig","content":"navigation-bar__content_1bkig","withBothAddons":"navigation-bar__withBothAddons_1bkig","withCompactTitle":"navigation-bar__withCompactTitle_1bkig","children":"navigation-bar__children_1bkig","title":"navigation-bar__title_1bkig","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1bkig","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1bkig","subtitle":"navigation-bar__subtitle_1bkig","addonsWrapper":"navigation-bar__addonsWrapper_1bkig","rightAddons":"navigation-bar__rightAddons_1bkig","addon":"navigation-bar__addon_1bkig","bottomAddons":"navigation-bar__bottomAddons_1bkig","closer":"navigation-bar__closer_1bkig","left":"navigation-bar__left_1bkig","center":"navigation-bar__center_1bkig","trim":"navigation-bar__trim_1bkig"};
|
|
17
|
+
var styles = {"header":"navigation-bar__header_8a3yz","backgroundImage":"navigation-bar__backgroundImage_8a3yz","mainLine":"navigation-bar__mainLine_8a3yz","mainLineSticky":"navigation-bar__mainLineSticky_8a3yz","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_8a3yz","content":"navigation-bar__content_8a3yz","withBothAddons":"navigation-bar__withBothAddons_8a3yz","withCompactTitle":"navigation-bar__withCompactTitle_8a3yz","children":"navigation-bar__children_8a3yz","title":"navigation-bar__title_8a3yz","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_8a3yz","contentOnBotMobile":"navigation-bar__contentOnBotMobile_8a3yz","subtitle":"navigation-bar__subtitle_8a3yz","addonsWrapper":"navigation-bar__addonsWrapper_8a3yz","rightAddons":"navigation-bar__rightAddons_8a3yz","addon":"navigation-bar__addon_8a3yz","bottomAddons":"navigation-bar__bottomAddons_8a3yz","closer":"navigation-bar__closer_8a3yz","left":"navigation-bar__left_8a3yz","center":"navigation-bar__center_8a3yz","trim":"navigation-bar__trim_8a3yz"};
|
|
22
18
|
require('./index.css')
|
|
23
19
|
|
|
24
20
|
var ADDONS_HEIGHT = 48;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { ButtonDesktop } from '@alfalab/core-components-button/esm/desktop';
|
|
5
5
|
import { Typography } from '@alfalab/core-components-typography/esm';
|
|
6
6
|
import { ArrowLeftMediumMIcon } from '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
|
|
7
7
|
import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
8
8
|
|
|
9
|
-
var styles = {"component":"navigation-
|
|
9
|
+
var styles = {"component":"navigation-bar__component_7mweo","mobileComponent":"navigation-bar__mobileComponent_7mweo","flex":"navigation-bar__flex_7mweo","iconWrapper":"navigation-bar__iconWrapper_7mweo","text":"navigation-bar__text_7mweo","mobileWrapper":"navigation-bar__mobileWrapper_7mweo"};
|
|
10
10
|
require('./index.css')
|
|
11
11
|
|
|
12
12
|
var BackArrowAddon = function (_a) {
|
|
13
13
|
var _b, _c;
|
|
14
14
|
var _d = _a.text, text = _d === void 0 ? 'Назад' : _d, onClick = _a.onClick, className = _a.className, _e = _a.textOpacity, textOpacity = _e === void 0 ? 1 : _e, view = _a.view, htmlAttributes = __rest(_a, ["text", "onClick", "className", "textOpacity", "view"]);
|
|
15
15
|
var Icon = view === 'desktop' ? ArrowLeftMediumMIcon : ArrowLeftMIcon;
|
|
16
|
-
return (React.createElement(
|
|
16
|
+
return (React.createElement(ButtonDesktop, __assign({ view: 'ghost', size: view === 'mobile' ? 'xxs' : 's', onClick: onClick, "aria-label": '\u043D\u0430\u0437\u0430\u0434', className: cn(styles.component, (_b = {}, _b[styles.mobileComponent] = view === 'mobile', _b), className) }, htmlAttributes),
|
|
17
17
|
React.createElement("div", { className: styles.flex },
|
|
18
18
|
React.createElement("div", { className: cn(styles.iconWrapper, (_c = {},
|
|
19
19
|
_c[styles.mobileWrapper] = view === 'mobile',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 18a7z */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e;
|
|
@@ -24,46 +24,46 @@
|
|
|
24
24
|
--gap-s: 12px;
|
|
25
25
|
} :root {
|
|
26
26
|
} :root {
|
|
27
|
-
} .navigation-
|
|
27
|
+
} .navigation-bar__component_7mweo {
|
|
28
28
|
height: 100%;
|
|
29
29
|
background: var(--color-light-bg-primary-alpha-40);
|
|
30
30
|
-webkit-backdrop-filter: blur(10px);
|
|
31
31
|
backdrop-filter: blur(10px);
|
|
32
32
|
border-radius: var(--border-radius-pill)
|
|
33
|
-
} .navigation-
|
|
33
|
+
} .navigation-bar__component_7mweo svg > path {
|
|
34
34
|
transition: fill 0.2s ease;
|
|
35
35
|
fill: var(--color-light-graphic-primary);
|
|
36
|
-
} .navigation-
|
|
36
|
+
} .navigation-bar__component_7mweo:hover svg > path {
|
|
37
37
|
fill: var(--color-light-graphic-primary-tint-20);
|
|
38
|
-
} .navigation-
|
|
38
|
+
} .navigation-bar__component_7mweo:active svg > path {
|
|
39
39
|
fill: var(--color-light-graphic-primary-tint-30);
|
|
40
|
-
} .navigation-
|
|
40
|
+
} .navigation-bar__mobileComponent_7mweo {
|
|
41
41
|
height: 32px;
|
|
42
42
|
margin: 0 var(--gap-xs);
|
|
43
43
|
-webkit-backdrop-filter: none;
|
|
44
44
|
backdrop-filter: none;
|
|
45
45
|
background: none;
|
|
46
|
-
} .navigation-
|
|
46
|
+
} .navigation-bar__flex_7mweo {
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
|
-
} .navigation-
|
|
49
|
+
} .navigation-bar__iconWrapper_7mweo {
|
|
50
50
|
display: inline-flex;
|
|
51
51
|
align-items: center;
|
|
52
52
|
justify-content: center;
|
|
53
53
|
height: 48px;
|
|
54
54
|
margin: 0 var(--gap-xs) 0 var(--gap-s);
|
|
55
55
|
border-radius: var(--border-radius-circle)
|
|
56
|
-
} .navigation-
|
|
56
|
+
} .navigation-bar__iconWrapper_7mweo + .navigation-bar__text_7mweo {
|
|
57
57
|
margin-right: var(--gap-s);
|
|
58
|
-
} .navigation-
|
|
58
|
+
} .navigation-bar__mobileWrapper_7mweo {
|
|
59
59
|
width: 32px;
|
|
60
60
|
height: 32px;
|
|
61
61
|
background: var(--color-light-specialbg-secondary-transparent);
|
|
62
62
|
-webkit-backdrop-filter: blur(10px);
|
|
63
63
|
backdrop-filter: blur(10px);
|
|
64
64
|
margin: 0
|
|
65
|
-
} .navigation-
|
|
65
|
+
} .navigation-bar__mobileWrapper_7mweo + .navigation-bar__text_7mweo {
|
|
66
66
|
margin: 0 var(--gap-s) 0 var(--gap-xs);
|
|
67
|
-
} .navigation-
|
|
67
|
+
} .navigation-bar__mobileWrapper_7mweo svg > path {
|
|
68
68
|
fill: var(--color-light-graphic-secondary);
|
|
69
69
|
}
|
|
@@ -2,7 +2,7 @@ export { BackArrowAddon } from './Component.js';
|
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'classnames';
|
|
5
|
-
import '@alfalab/core-components-button/esm';
|
|
5
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
6
6
|
import '@alfalab/core-components-typography/esm';
|
|
7
7
|
import '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
|
|
8
8
|
import '@alfalab/icons-glyph/ArrowLeftMIcon';
|
|
@@ -5,7 +5,7 @@ import { IconButton } from '@alfalab/core-components-icon-button/esm';
|
|
|
5
5
|
import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
|
|
6
6
|
import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"closer":"navigation-
|
|
8
|
+
var styles = {"closer":"navigation-bar__closer_1gqyh","button":"navigation-bar__button_1gqyh","mobile":"navigation-bar__mobile_1gqyh","sticky":"navigation-bar__sticky_1gqyh"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var Closer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: u4dxk */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} :root {
|
|
22
22
|
/* closer-mobile */
|
|
23
23
|
--navigation-bar-closer-mobile-color: var(--color-light-graphic-secondary);
|
|
24
|
-
} .navigation-
|
|
24
|
+
} .navigation-bar__closer_1gqyh {
|
|
25
25
|
flex-shrink: 0;
|
|
26
26
|
width: 48px;
|
|
27
27
|
height: 48px;
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
justify-content: center;
|
|
32
|
-
} .navigation-
|
|
32
|
+
} .navigation-bar__button_1gqyh {
|
|
33
33
|
background: var(--color-light-bg-primary-alpha-40);
|
|
34
34
|
-webkit-backdrop-filter: blur(10px);
|
|
35
35
|
backdrop-filter: blur(10px);
|
|
36
36
|
border-radius: 50px;
|
|
37
37
|
color: var(--color-light-graphic-primary)
|
|
38
|
-
} .navigation-
|
|
38
|
+
} .navigation-bar__button_1gqyh.navigation-bar__mobile_1gqyh {
|
|
39
39
|
background: var(--color-light-specialbg-secondary-transparent);
|
|
40
40
|
color: var(--navigation-bar-closer-mobile-color);
|
|
41
|
-
} .navigation-
|
|
41
|
+
} .navigation-bar__sticky_1gqyh {
|
|
42
42
|
position: sticky;
|
|
43
43
|
top: 0;
|
|
44
44
|
}
|