@alfalab/core-components-navigation-bar 0.1.1 → 0.1.2

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 CHANGED
@@ -3,6 +3,7 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var cn = require('classnames');
6
+ var hooks = require('@alfalab/hooks');
6
7
  var components_backArrowAddon_Component = require('./components/back-arrow-addon/Component.js');
7
8
  var components_closer_Component = require('./components/closer/Component.js');
8
9
  require('@alfalab/core-components-button');
@@ -23,7 +24,7 @@ var getDataTestId = function (dataTestId, element) {
23
24
  return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
24
25
  };
25
26
 
26
- var styles = {"header":"navigation-bar__header_1uwdc","backgroundImage":"navigation-bar__backgroundImage_1uwdc","mainLine":"navigation-bar__mainLine_1uwdc","mainLineSticky":"navigation-bar__mainLineSticky_1uwdc","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1uwdc","content":"navigation-bar__content_1uwdc","withBothAddons":"navigation-bar__withBothAddons_1uwdc","withCompactTitle":"navigation-bar__withCompactTitle_1uwdc","children":"navigation-bar__children_1uwdc","title":"navigation-bar__title_1uwdc","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1uwdc","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1uwdc","subtitle":"navigation-bar__subtitle_1uwdc","addonsWrapper":"navigation-bar__addonsWrapper_1uwdc","rightAddons":"navigation-bar__rightAddons_1uwdc","addon":"navigation-bar__addon_1uwdc","bottomAddons":"navigation-bar__bottomAddons_1uwdc","closer":"navigation-bar__closer_1uwdc","left":"navigation-bar__left_1uwdc","center":"navigation-bar__center_1uwdc","trim":"navigation-bar__trim_1uwdc"};
27
+ var styles = {"header":"navigation-bar__header_5ow3j","backgroundImage":"navigation-bar__backgroundImage_5ow3j","mainLine":"navigation-bar__mainLine_5ow3j","mainLineSticky":"navigation-bar__mainLineSticky_5ow3j","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_5ow3j","content":"navigation-bar__content_5ow3j","withBothAddons":"navigation-bar__withBothAddons_5ow3j","withCompactTitle":"navigation-bar__withCompactTitle_5ow3j","children":"navigation-bar__children_5ow3j","title":"navigation-bar__title_5ow3j","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_5ow3j","contentOnBotMobile":"navigation-bar__contentOnBotMobile_5ow3j","subtitle":"navigation-bar__subtitle_5ow3j","addonsWrapper":"navigation-bar__addonsWrapper_5ow3j","rightAddons":"navigation-bar__rightAddons_5ow3j","addon":"navigation-bar__addon_5ow3j","bottomAddons":"navigation-bar__bottomAddons_5ow3j","closer":"navigation-bar__closer_5ow3j","left":"navigation-bar__left_5ow3j","center":"navigation-bar__center_5ow3j","trim":"navigation-bar__trim_5ow3j"};
27
28
  require('./index.css')
28
29
 
29
30
  var ADDONS_HEIGHT = 48;
@@ -31,9 +32,12 @@ var NavigationBar = function (_a) {
31
32
  var _b, _c, _d;
32
33
  var addonClassName = _a.addonClassName, className = _a.className, contentClassName = _a.contentClassName, closerClassName = _a.closerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, bottomAddonsClassName = _a.bottomAddonsClassName, children = _a.children, _e = _a.align, align = _e === void 0 ? 'left' : _e, _f = _a.trim, trim = _f === void 0 ? true : _f, title = _a.title, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, subtitle = _a.subtitle, hasCloser = _a.hasCloser, hasBackButton = _a.hasBackButton, backButtonClassName = _a.backButtonClassName, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
33
34
  var _h = React.useState(0), scrollTop = _h[0], setScrollTop = _h[1];
35
+ var _j = React.useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
34
36
  var bottomContentRef = React.useRef(null);
35
37
  var headerRef = React.useRef(null);
36
38
  var mainLinePaddingTopRef = React.useRef('0px');
39
+ var leftAddonsRef = React.useRef(null);
40
+ var rightAddonsRef = React.useRef(null);
37
41
  var compactTitle = view === 'mobile' && titleSize === 'compact';
38
42
  var hasLeftPart = Boolean(leftAddons || hasBackButton);
39
43
  var hasRightPart = Boolean(rightAddons || hasCloser);
@@ -46,6 +50,30 @@ var NavigationBar = function (_a) {
46
50
  var showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
47
51
  var showAnimatedContentOnBot = withAnimation && showContentOnBot;
48
52
  var headerPaddingTop = mainLinePaddingTopRef.current;
53
+ hooks.useLayoutEffect_SAFE_FOR_SSR(function () {
54
+ var _a, _b;
55
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
56
+ var leftAddonsWidth = ((_a = leftAddonsRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
57
+ var rightAddonsWidth = ((_b = rightAddonsRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
58
+ var marginSize_1 = Math.abs(rightAddonsWidth - leftAddonsWidth);
59
+ var shouldAddLeftMargin_1 = rightAddonsWidth - leftAddonsWidth > 0;
60
+ setTitleMargin(function (prev) {
61
+ var newState = shouldAddLeftMargin_1
62
+ ? { left: marginSize_1, right: 0 }
63
+ : { left: 0, right: marginSize_1 };
64
+ var isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
65
+ return isStateChanged ? newState : prev;
66
+ });
67
+ }
68
+ }, [
69
+ align,
70
+ showStaticContentOnTop,
71
+ showAnimatedContentOnTop,
72
+ leftAddons,
73
+ rightAddons,
74
+ hasBackButton,
75
+ hasCloser,
76
+ ]);
49
77
  React.useEffect(function () {
50
78
  var parent = scrollableParentRef === null || scrollableParentRef === void 0 ? void 0 : scrollableParentRef.current;
51
79
  var handleScroll = function (ev) {
@@ -97,18 +125,26 @@ var NavigationBar = function (_a) {
97
125
  paddingTop: headerPaddingTop,
98
126
  }
99
127
  : null)) },
100
- hasLeftPart && (React__default.default.createElement("div", { className: styles.addonsWrapper },
128
+ hasLeftPart && (React__default.default.createElement("div", { className: styles.addonsWrapper, ref: leftAddonsRef },
101
129
  hasBackButton && renderBackButton(),
102
130
  leftAddons && (React__default.default.createElement("div", { className: cn__default.default(styles.addon, addonClassName) }, leftAddons)))),
103
- showStaticContentOnTop && renderContent(),
131
+ showStaticContentOnTop &&
132
+ renderContent(tslib.__assign({}, (align === 'center'
133
+ ? {
134
+ style: {
135
+ marginLeft: titleMargin.left,
136
+ marginRight: titleMargin.right,
137
+ },
138
+ }
139
+ : null))),
104
140
  showAnimatedContentOnTop &&
105
141
  renderContent({
106
142
  extraClassName: styles.withBothAddons,
107
- style: {
108
- opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
109
- },
143
+ style: tslib.__assign({ opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT) }, (align === 'center'
144
+ ? { marginLeft: titleMargin.left, marginRight: titleMargin.right }
145
+ : null)),
110
146
  }),
111
- hasRightPart && (React__default.default.createElement("div", { className: cn__default.default(styles.addonsWrapper, styles.rightAddons) },
147
+ hasRightPart && (React__default.default.createElement("div", { className: cn__default.default(styles.addonsWrapper, styles.rightAddons), ref: rightAddonsRef },
112
148
  rightAddons && (React__default.default.createElement("div", { className: cn__default.default(styles.addon, addonClassName) }, rightAddons)),
113
149
  hasCloser && renderCloser()))),
114
150
  showAnimatedContentOnBot &&
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"component":"navigation-bar__component_1ryml","mobileComponent":"navigation-bar__mobileComponent_1ryml","flex":"navigation-bar__flex_1ryml","iconWrapper":"navigation-bar__iconWrapper_1ryml","text":"navigation-bar__text_1ryml","mobileWrapper":"navigation-bar__mobileWrapper_1ryml"};
16
+ var styles = {"component":"navigation-bar__component_swc35","mobileComponent":"navigation-bar__mobileComponent_swc35","flex":"navigation-bar__flex_swc35","iconWrapper":"navigation-bar__iconWrapper_swc35","text":"navigation-bar__text_swc35","mobileWrapper":"navigation-bar__mobileWrapper_swc35"};
17
17
  require('./index.css')
18
18
 
19
19
  var BackArrowAddon = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1dgzi */
1
+ /* hash: 27iuz */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -24,46 +24,46 @@
24
24
  --gap-s: 12px;
25
25
  } :root {
26
26
  } :root {
27
- } .navigation-bar__component_1ryml {
27
+ } .navigation-bar__component_swc35 {
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-bar__component_1ryml svg > path {
33
+ } .navigation-bar__component_swc35 svg > path {
34
34
  transition: fill 0.2s ease;
35
35
  fill: var(--color-light-graphic-primary);
36
- } .navigation-bar__component_1ryml:hover svg > path {
36
+ } .navigation-bar__component_swc35:hover svg > path {
37
37
  fill: var(--color-light-graphic-primary-tint-20);
38
- } .navigation-bar__component_1ryml:active svg > path {
38
+ } .navigation-bar__component_swc35:active svg > path {
39
39
  fill: var(--color-light-graphic-primary-tint-30);
40
- } .navigation-bar__mobileComponent_1ryml {
40
+ } .navigation-bar__mobileComponent_swc35 {
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-bar__flex_1ryml {
46
+ } .navigation-bar__flex_swc35 {
47
47
  display: flex;
48
48
  align-items: center;
49
- } .navigation-bar__iconWrapper_1ryml {
49
+ } .navigation-bar__iconWrapper_swc35 {
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-bar__iconWrapper_1ryml + .navigation-bar__text_1ryml {
56
+ } .navigation-bar__iconWrapper_swc35 + .navigation-bar__text_swc35 {
57
57
  margin-right: var(--gap-s);
58
- } .navigation-bar__mobileWrapper_1ryml {
58
+ } .navigation-bar__mobileWrapper_swc35 {
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-bar__mobileWrapper_1ryml + .navigation-bar__text_1ryml {
65
+ } .navigation-bar__mobileWrapper_swc35 + .navigation-bar__text_swc35 {
66
66
  margin: 0 var(--gap-s) 0 var(--gap-xs);
67
- } .navigation-bar__mobileWrapper_1ryml svg > path {
67
+ } .navigation-bar__mobileWrapper_swc35 svg > path {
68
68
  fill: var(--color-light-graphic-secondary);
69
69
  }
@@ -12,7 +12,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
12
12
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
13
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
14
14
 
15
- var styles = {"closer":"navigation-bar__closer_asogp","button":"navigation-bar__button_asogp","mobile":"navigation-bar__mobile_asogp","sticky":"navigation-bar__sticky_asogp"};
15
+ var styles = {"closer":"navigation-bar__closer_kmb9l","button":"navigation-bar__button_kmb9l","mobile":"navigation-bar__mobile_kmb9l","sticky":"navigation-bar__sticky_kmb9l"};
16
16
  require('./index.css')
17
17
 
18
18
  var Closer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: ol373 */
1
+ /* hash: 1lpkd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -18,7 +18,7 @@
18
18
  } :root {
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__closer_asogp {
21
+ } .navigation-bar__closer_kmb9l {
22
22
  flex-shrink: 0;
23
23
  width: 48px;
24
24
  height: 48px;
@@ -26,16 +26,16 @@
26
26
  display: flex;
27
27
  align-items: center;
28
28
  justify-content: center;
29
- } .navigation-bar__button_asogp {
29
+ } .navigation-bar__button_kmb9l {
30
30
  background: var(--color-light-bg-primary-alpha-40);
31
31
  -webkit-backdrop-filter: blur(10px);
32
32
  backdrop-filter: blur(10px);
33
33
  border-radius: 50px;
34
34
  color: var(--color-light-graphic-primary)
35
- } .navigation-bar__button_asogp.navigation-bar__mobile_asogp {
35
+ } .navigation-bar__button_kmb9l.navigation-bar__mobile_kmb9l {
36
36
  background: var(--color-light-specialbg-secondary-transparent);
37
37
  color: var(--color-light-graphic-secondary);
38
- } .navigation-bar__sticky_asogp {
38
+ } .navigation-bar__sticky_kmb9l {
39
39
  position: sticky;
40
40
  top: 0;
41
41
  }
package/cssm/Component.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var cn = require('classnames');
6
+ var hooks = require('@alfalab/hooks');
6
7
  var components_backArrowAddon_Component = require('./components/back-arrow-addon/Component.js');
7
8
  var components_closer_Component = require('./components/closer/Component.js');
8
9
  var styles = require('./index.module.css');
@@ -32,9 +33,12 @@ var NavigationBar = function (_a) {
32
33
  var _b, _c, _d;
33
34
  var addonClassName = _a.addonClassName, className = _a.className, contentClassName = _a.contentClassName, closerClassName = _a.closerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, bottomAddonsClassName = _a.bottomAddonsClassName, children = _a.children, _e = _a.align, align = _e === void 0 ? 'left' : _e, _f = _a.trim, trim = _f === void 0 ? true : _f, title = _a.title, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, subtitle = _a.subtitle, hasCloser = _a.hasCloser, hasBackButton = _a.hasBackButton, backButtonClassName = _a.backButtonClassName, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
34
35
  var _h = React.useState(0), scrollTop = _h[0], setScrollTop = _h[1];
36
+ var _j = React.useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
35
37
  var bottomContentRef = React.useRef(null);
36
38
  var headerRef = React.useRef(null);
37
39
  var mainLinePaddingTopRef = React.useRef('0px');
40
+ var leftAddonsRef = React.useRef(null);
41
+ var rightAddonsRef = React.useRef(null);
38
42
  var compactTitle = view === 'mobile' && titleSize === 'compact';
39
43
  var hasLeftPart = Boolean(leftAddons || hasBackButton);
40
44
  var hasRightPart = Boolean(rightAddons || hasCloser);
@@ -47,6 +51,30 @@ var NavigationBar = function (_a) {
47
51
  var showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
48
52
  var showAnimatedContentOnBot = withAnimation && showContentOnBot;
49
53
  var headerPaddingTop = mainLinePaddingTopRef.current;
54
+ hooks.useLayoutEffect_SAFE_FOR_SSR(function () {
55
+ var _a, _b;
56
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
57
+ var leftAddonsWidth = ((_a = leftAddonsRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
58
+ var rightAddonsWidth = ((_b = rightAddonsRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
59
+ var marginSize_1 = Math.abs(rightAddonsWidth - leftAddonsWidth);
60
+ var shouldAddLeftMargin_1 = rightAddonsWidth - leftAddonsWidth > 0;
61
+ setTitleMargin(function (prev) {
62
+ var newState = shouldAddLeftMargin_1
63
+ ? { left: marginSize_1, right: 0 }
64
+ : { left: 0, right: marginSize_1 };
65
+ var isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
66
+ return isStateChanged ? newState : prev;
67
+ });
68
+ }
69
+ }, [
70
+ align,
71
+ showStaticContentOnTop,
72
+ showAnimatedContentOnTop,
73
+ leftAddons,
74
+ rightAddons,
75
+ hasBackButton,
76
+ hasCloser,
77
+ ]);
50
78
  React.useEffect(function () {
51
79
  var parent = scrollableParentRef === null || scrollableParentRef === void 0 ? void 0 : scrollableParentRef.current;
52
80
  var handleScroll = function (ev) {
@@ -98,18 +126,26 @@ var NavigationBar = function (_a) {
98
126
  paddingTop: headerPaddingTop,
99
127
  }
100
128
  : null)) },
101
- hasLeftPart && (React__default.default.createElement("div", { className: styles__default.default.addonsWrapper },
129
+ hasLeftPart && (React__default.default.createElement("div", { className: styles__default.default.addonsWrapper, ref: leftAddonsRef },
102
130
  hasBackButton && renderBackButton(),
103
131
  leftAddons && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addon, addonClassName) }, leftAddons)))),
104
- showStaticContentOnTop && renderContent(),
132
+ showStaticContentOnTop &&
133
+ renderContent(tslib.__assign({}, (align === 'center'
134
+ ? {
135
+ style: {
136
+ marginLeft: titleMargin.left,
137
+ marginRight: titleMargin.right,
138
+ },
139
+ }
140
+ : null))),
105
141
  showAnimatedContentOnTop &&
106
142
  renderContent({
107
143
  extraClassName: styles__default.default.withBothAddons,
108
- style: {
109
- opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
110
- },
144
+ style: tslib.__assign({ opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT) }, (align === 'center'
145
+ ? { marginLeft: titleMargin.left, marginRight: titleMargin.right }
146
+ : null)),
111
147
  }),
112
- hasRightPart && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addonsWrapper, styles__default.default.rightAddons) },
148
+ hasRightPart && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addonsWrapper, styles__default.default.rightAddons), ref: rightAddonsRef },
113
149
  rightAddons && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addon, addonClassName) }, rightAddons)),
114
150
  hasCloser && renderCloser()))),
115
151
  showAnimatedContentOnBot &&
package/cssm/index.js CHANGED
@@ -5,6 +5,7 @@ var components_closer_Component = require('./components/closer/Component.js');
5
5
  require('tslib');
6
6
  require('react');
7
7
  require('classnames');
8
+ require('@alfalab/hooks');
8
9
  require('./components/back-arrow-addon/Component.js');
9
10
  require('@alfalab/core-components-button/cssm');
10
11
  require('@alfalab/core-components-typography/cssm');
package/esm/Component.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { __assign } from 'tslib';
2
2
  import React, { useState, useRef, useEffect } from 'react';
3
3
  import cn from 'classnames';
4
+ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
4
5
  import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
5
6
  import { Closer } from './components/closer/Component.js';
6
7
  import '@alfalab/core-components-button/esm';
@@ -16,7 +17,7 @@ var getDataTestId = function (dataTestId, element) {
16
17
  return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
17
18
  };
18
19
 
19
- var styles = {"header":"navigation-bar__header_1uwdc","backgroundImage":"navigation-bar__backgroundImage_1uwdc","mainLine":"navigation-bar__mainLine_1uwdc","mainLineSticky":"navigation-bar__mainLineSticky_1uwdc","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1uwdc","content":"navigation-bar__content_1uwdc","withBothAddons":"navigation-bar__withBothAddons_1uwdc","withCompactTitle":"navigation-bar__withCompactTitle_1uwdc","children":"navigation-bar__children_1uwdc","title":"navigation-bar__title_1uwdc","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1uwdc","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1uwdc","subtitle":"navigation-bar__subtitle_1uwdc","addonsWrapper":"navigation-bar__addonsWrapper_1uwdc","rightAddons":"navigation-bar__rightAddons_1uwdc","addon":"navigation-bar__addon_1uwdc","bottomAddons":"navigation-bar__bottomAddons_1uwdc","closer":"navigation-bar__closer_1uwdc","left":"navigation-bar__left_1uwdc","center":"navigation-bar__center_1uwdc","trim":"navigation-bar__trim_1uwdc"};
20
+ var styles = {"header":"navigation-bar__header_5ow3j","backgroundImage":"navigation-bar__backgroundImage_5ow3j","mainLine":"navigation-bar__mainLine_5ow3j","mainLineSticky":"navigation-bar__mainLineSticky_5ow3j","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_5ow3j","content":"navigation-bar__content_5ow3j","withBothAddons":"navigation-bar__withBothAddons_5ow3j","withCompactTitle":"navigation-bar__withCompactTitle_5ow3j","children":"navigation-bar__children_5ow3j","title":"navigation-bar__title_5ow3j","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_5ow3j","contentOnBotMobile":"navigation-bar__contentOnBotMobile_5ow3j","subtitle":"navigation-bar__subtitle_5ow3j","addonsWrapper":"navigation-bar__addonsWrapper_5ow3j","rightAddons":"navigation-bar__rightAddons_5ow3j","addon":"navigation-bar__addon_5ow3j","bottomAddons":"navigation-bar__bottomAddons_5ow3j","closer":"navigation-bar__closer_5ow3j","left":"navigation-bar__left_5ow3j","center":"navigation-bar__center_5ow3j","trim":"navigation-bar__trim_5ow3j"};
20
21
  require('./index.css')
21
22
 
22
23
  var ADDONS_HEIGHT = 48;
@@ -24,9 +25,12 @@ var NavigationBar = function (_a) {
24
25
  var _b, _c, _d;
25
26
  var addonClassName = _a.addonClassName, className = _a.className, contentClassName = _a.contentClassName, closerClassName = _a.closerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, bottomAddonsClassName = _a.bottomAddonsClassName, children = _a.children, _e = _a.align, align = _e === void 0 ? 'left' : _e, _f = _a.trim, trim = _f === void 0 ? true : _f, title = _a.title, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, subtitle = _a.subtitle, hasCloser = _a.hasCloser, hasBackButton = _a.hasBackButton, backButtonClassName = _a.backButtonClassName, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
26
27
  var _h = useState(0), scrollTop = _h[0], setScrollTop = _h[1];
28
+ var _j = useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
27
29
  var bottomContentRef = useRef(null);
28
30
  var headerRef = useRef(null);
29
31
  var mainLinePaddingTopRef = useRef('0px');
32
+ var leftAddonsRef = useRef(null);
33
+ var rightAddonsRef = useRef(null);
30
34
  var compactTitle = view === 'mobile' && titleSize === 'compact';
31
35
  var hasLeftPart = Boolean(leftAddons || hasBackButton);
32
36
  var hasRightPart = Boolean(rightAddons || hasCloser);
@@ -39,6 +43,30 @@ var NavigationBar = function (_a) {
39
43
  var showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
40
44
  var showAnimatedContentOnBot = withAnimation && showContentOnBot;
41
45
  var headerPaddingTop = mainLinePaddingTopRef.current;
46
+ useLayoutEffect_SAFE_FOR_SSR(function () {
47
+ var _a, _b;
48
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
49
+ var leftAddonsWidth = ((_a = leftAddonsRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
50
+ var rightAddonsWidth = ((_b = rightAddonsRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
51
+ var marginSize_1 = Math.abs(rightAddonsWidth - leftAddonsWidth);
52
+ var shouldAddLeftMargin_1 = rightAddonsWidth - leftAddonsWidth > 0;
53
+ setTitleMargin(function (prev) {
54
+ var newState = shouldAddLeftMargin_1
55
+ ? { left: marginSize_1, right: 0 }
56
+ : { left: 0, right: marginSize_1 };
57
+ var isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
58
+ return isStateChanged ? newState : prev;
59
+ });
60
+ }
61
+ }, [
62
+ align,
63
+ showStaticContentOnTop,
64
+ showAnimatedContentOnTop,
65
+ leftAddons,
66
+ rightAddons,
67
+ hasBackButton,
68
+ hasCloser,
69
+ ]);
42
70
  useEffect(function () {
43
71
  var parent = scrollableParentRef === null || scrollableParentRef === void 0 ? void 0 : scrollableParentRef.current;
44
72
  var handleScroll = function (ev) {
@@ -90,18 +118,26 @@ var NavigationBar = function (_a) {
90
118
  paddingTop: headerPaddingTop,
91
119
  }
92
120
  : null)) },
93
- hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper },
121
+ hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper, ref: leftAddonsRef },
94
122
  hasBackButton && renderBackButton(),
95
123
  leftAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, leftAddons)))),
96
- showStaticContentOnTop && renderContent(),
124
+ showStaticContentOnTop &&
125
+ renderContent(__assign({}, (align === 'center'
126
+ ? {
127
+ style: {
128
+ marginLeft: titleMargin.left,
129
+ marginRight: titleMargin.right,
130
+ },
131
+ }
132
+ : null))),
97
133
  showAnimatedContentOnTop &&
98
134
  renderContent({
99
135
  extraClassName: styles.withBothAddons,
100
- style: {
101
- opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
102
- },
136
+ style: __assign({ opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT) }, (align === 'center'
137
+ ? { marginLeft: titleMargin.left, marginRight: titleMargin.right }
138
+ : null)),
103
139
  }),
104
- hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons) },
140
+ hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons), ref: rightAddonsRef },
105
141
  rightAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, rightAddons)),
106
142
  hasCloser && renderCloser()))),
107
143
  showAnimatedContentOnBot &&
@@ -6,7 +6,7 @@ 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-bar__component_1ryml","mobileComponent":"navigation-bar__mobileComponent_1ryml","flex":"navigation-bar__flex_1ryml","iconWrapper":"navigation-bar__iconWrapper_1ryml","text":"navigation-bar__text_1ryml","mobileWrapper":"navigation-bar__mobileWrapper_1ryml"};
9
+ var styles = {"component":"navigation-bar__component_swc35","mobileComponent":"navigation-bar__mobileComponent_swc35","flex":"navigation-bar__flex_swc35","iconWrapper":"navigation-bar__iconWrapper_swc35","text":"navigation-bar__text_swc35","mobileWrapper":"navigation-bar__mobileWrapper_swc35"};
10
10
  require('./index.css')
11
11
 
12
12
  var BackArrowAddon = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1dgzi */
1
+ /* hash: 27iuz */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -24,46 +24,46 @@
24
24
  --gap-s: 12px;
25
25
  } :root {
26
26
  } :root {
27
- } .navigation-bar__component_1ryml {
27
+ } .navigation-bar__component_swc35 {
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-bar__component_1ryml svg > path {
33
+ } .navigation-bar__component_swc35 svg > path {
34
34
  transition: fill 0.2s ease;
35
35
  fill: var(--color-light-graphic-primary);
36
- } .navigation-bar__component_1ryml:hover svg > path {
36
+ } .navigation-bar__component_swc35:hover svg > path {
37
37
  fill: var(--color-light-graphic-primary-tint-20);
38
- } .navigation-bar__component_1ryml:active svg > path {
38
+ } .navigation-bar__component_swc35:active svg > path {
39
39
  fill: var(--color-light-graphic-primary-tint-30);
40
- } .navigation-bar__mobileComponent_1ryml {
40
+ } .navigation-bar__mobileComponent_swc35 {
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-bar__flex_1ryml {
46
+ } .navigation-bar__flex_swc35 {
47
47
  display: flex;
48
48
  align-items: center;
49
- } .navigation-bar__iconWrapper_1ryml {
49
+ } .navigation-bar__iconWrapper_swc35 {
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-bar__iconWrapper_1ryml + .navigation-bar__text_1ryml {
56
+ } .navigation-bar__iconWrapper_swc35 + .navigation-bar__text_swc35 {
57
57
  margin-right: var(--gap-s);
58
- } .navigation-bar__mobileWrapper_1ryml {
58
+ } .navigation-bar__mobileWrapper_swc35 {
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-bar__mobileWrapper_1ryml + .navigation-bar__text_1ryml {
65
+ } .navigation-bar__mobileWrapper_swc35 + .navigation-bar__text_swc35 {
66
66
  margin: 0 var(--gap-s) 0 var(--gap-xs);
67
- } .navigation-bar__mobileWrapper_1ryml svg > path {
67
+ } .navigation-bar__mobileWrapper_swc35 svg > path {
68
68
  fill: var(--color-light-graphic-secondary);
69
69
  }
@@ -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-bar__closer_asogp","button":"navigation-bar__button_asogp","mobile":"navigation-bar__mobile_asogp","sticky":"navigation-bar__sticky_asogp"};
8
+ var styles = {"closer":"navigation-bar__closer_kmb9l","button":"navigation-bar__button_kmb9l","mobile":"navigation-bar__mobile_kmb9l","sticky":"navigation-bar__sticky_kmb9l"};
9
9
  require('./index.css')
10
10
 
11
11
  var Closer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: ol373 */
1
+ /* hash: 1lpkd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -18,7 +18,7 @@
18
18
  } :root {
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__closer_asogp {
21
+ } .navigation-bar__closer_kmb9l {
22
22
  flex-shrink: 0;
23
23
  width: 48px;
24
24
  height: 48px;
@@ -26,16 +26,16 @@
26
26
  display: flex;
27
27
  align-items: center;
28
28
  justify-content: center;
29
- } .navigation-bar__button_asogp {
29
+ } .navigation-bar__button_kmb9l {
30
30
  background: var(--color-light-bg-primary-alpha-40);
31
31
  -webkit-backdrop-filter: blur(10px);
32
32
  backdrop-filter: blur(10px);
33
33
  border-radius: 50px;
34
34
  color: var(--color-light-graphic-primary)
35
- } .navigation-bar__button_asogp.navigation-bar__mobile_asogp {
35
+ } .navigation-bar__button_kmb9l.navigation-bar__mobile_kmb9l {
36
36
  background: var(--color-light-specialbg-secondary-transparent);
37
37
  color: var(--color-light-graphic-secondary);
38
- } .navigation-bar__sticky_asogp {
38
+ } .navigation-bar__sticky_kmb9l {
39
39
  position: sticky;
40
40
  top: 0;
41
41
  }
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 27oys */
1
+ /* hash: zc64y */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0b1f35;
@@ -18,26 +18,26 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__header_1uwdc {
21
+ } .navigation-bar__header_5ow3j {
22
22
  width: 100%;
23
23
  box-sizing: border-box;
24
24
  transition: box-shadow 0.2s ease, background 0.2s ease
25
- } .navigation-bar__header_1uwdc.navigation-bar__header_1uwdc.navigation-bar__backgroundImage_1uwdc {
25
+ } .navigation-bar__header_5ow3j.navigation-bar__header_5ow3j.navigation-bar__backgroundImage_5ow3j {
26
26
  background-repeat: no-repeat;
27
27
  background-position: center;
28
28
  background-size: cover;
29
- } .navigation-bar__mainLine_1uwdc {
29
+ } .navigation-bar__mainLine_5ow3j {
30
30
  display: flex;
31
31
  align-items: stretch;
32
32
  justify-content: space-between;
33
33
  z-index: 1;
34
34
  background-color: inherit;
35
- } .navigation-bar__mainLineSticky_1uwdc {
35
+ } .navigation-bar__mainLineSticky_5ow3j {
36
36
  position: sticky;
37
37
  top: 0;
38
- } .navigation-bar__mainLineWithImageBg_1uwdc {
38
+ } .navigation-bar__mainLineWithImageBg_5ow3j {
39
39
  background-color: initial;
40
- } .navigation-bar__content_1uwdc {
40
+ } .navigation-bar__content_5ow3j {
41
41
  color: var(--color-light-text-primary);
42
42
  display: flex;
43
43
  flex-flow: column nowrap;
@@ -46,27 +46,27 @@
46
46
  align-self: baseline;
47
47
  box-sizing: border-box;
48
48
  min-height: 48px
49
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc,
50
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc {
49
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j,
50
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j {
51
51
  font-size: 16px;
52
52
  line-height: 20px;
53
53
  font-weight: 500;
54
54
  align-self: center;
55
55
  padding-top: var(--gap-2xs);
56
56
  padding-bottom: var(--gap-2xs)
57
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__children_1uwdc,
58
- .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__title_1uwdc,
59
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__children_1uwdc,
60
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__title_1uwdc {
57
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__children_5ow3j,
58
+ .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__title_5ow3j,
59
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__children_5ow3j,
60
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__title_5ow3j {
61
61
  -webkit-line-clamp: 1;
62
62
  word-break: break-all;
63
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc {
63
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j {
64
64
  padding-top: var(--gap-s);
65
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotMobile_1uwdc.navigation-bar__contentOnBotMobile_1uwdc {
65
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotMobile_5ow3j.navigation-bar__contentOnBotMobile_5ow3j {
66
66
  padding-top: var(--gap-s);
67
- } .navigation-bar__title_1uwdc {
67
+ } .navigation-bar__title_5ow3j {
68
68
  word-break: break-word;
69
- } .navigation-bar__subtitle_1uwdc {
69
+ } .navigation-bar__subtitle_5ow3j {
70
70
  font-size: 14px;
71
71
  line-height: 20px;
72
72
  font-weight: 400;
@@ -77,11 +77,11 @@
77
77
 
78
78
  color: var(--color-light-text-secondary);
79
79
  word-break: break-all;
80
- } .navigation-bar__addonsWrapper_1uwdc {
80
+ } .navigation-bar__addonsWrapper_5ow3j {
81
81
  display: flex;
82
- } .navigation-bar__rightAddons_1uwdc {
82
+ } .navigation-bar__rightAddons_5ow3j {
83
83
  margin-left: auto;
84
- } .navigation-bar__addon_1uwdc {
84
+ } .navigation-bar__addon_5ow3j {
85
85
  min-width: 48px;
86
86
  height: 48px;
87
87
  display: flex;
@@ -89,18 +89,18 @@
89
89
  align-items: center;
90
90
  flex-shrink: 0;
91
91
  pointer-events: all;
92
- } .navigation-bar__bottomAddons_1uwdc {
92
+ } .navigation-bar__bottomAddons_5ow3j {
93
93
  pointer-events: all;
94
- } .navigation-bar__closer_1uwdc {
94
+ } .navigation-bar__closer_5ow3j {
95
95
  margin-left: auto;
96
- } .navigation-bar__left_1uwdc {
96
+ } .navigation-bar__left_5ow3j {
97
97
  text-align: left;
98
- } .navigation-bar__center_1uwdc {
98
+ } .navigation-bar__center_5ow3j {
99
99
  text-align: center;
100
- } .navigation-bar__trim_1uwdc {
100
+ } .navigation-bar__trim_5ow3j {
101
101
  overflow: hidden
102
- } .navigation-bar__trim_1uwdc .navigation-bar__title_1uwdc,
103
- .navigation-bar__trim_1uwdc .navigation-bar__children_1uwdc {
102
+ } .navigation-bar__trim_5ow3j .navigation-bar__title_5ow3j,
103
+ .navigation-bar__trim_5ow3j .navigation-bar__children_5ow3j {
104
104
  -webkit-line-clamp: 2;
105
105
  display: -webkit-box;
106
106
  -webkit-box-orient: vertical;
package/esm/index.js CHANGED
@@ -3,6 +3,7 @@ export { Closer } from './components/closer/Component.js';
3
3
  import 'tslib';
4
4
  import 'react';
5
5
  import 'classnames';
6
+ import '@alfalab/hooks';
6
7
  import './components/back-arrow-addon/Component.js';
7
8
  import '@alfalab/core-components-button/esm';
8
9
  import '@alfalab/core-components-typography/esm';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 27oys */
1
+ /* hash: zc64y */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0b1f35;
@@ -18,26 +18,26 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__header_1uwdc {
21
+ } .navigation-bar__header_5ow3j {
22
22
  width: 100%;
23
23
  box-sizing: border-box;
24
24
  transition: box-shadow 0.2s ease, background 0.2s ease
25
- } .navigation-bar__header_1uwdc.navigation-bar__header_1uwdc.navigation-bar__backgroundImage_1uwdc {
25
+ } .navigation-bar__header_5ow3j.navigation-bar__header_5ow3j.navigation-bar__backgroundImage_5ow3j {
26
26
  background-repeat: no-repeat;
27
27
  background-position: center;
28
28
  background-size: cover;
29
- } .navigation-bar__mainLine_1uwdc {
29
+ } .navigation-bar__mainLine_5ow3j {
30
30
  display: flex;
31
31
  align-items: stretch;
32
32
  justify-content: space-between;
33
33
  z-index: 1;
34
34
  background-color: inherit;
35
- } .navigation-bar__mainLineSticky_1uwdc {
35
+ } .navigation-bar__mainLineSticky_5ow3j {
36
36
  position: sticky;
37
37
  top: 0;
38
- } .navigation-bar__mainLineWithImageBg_1uwdc {
38
+ } .navigation-bar__mainLineWithImageBg_5ow3j {
39
39
  background-color: initial;
40
- } .navigation-bar__content_1uwdc {
40
+ } .navigation-bar__content_5ow3j {
41
41
  color: var(--color-light-text-primary);
42
42
  display: flex;
43
43
  flex-flow: column nowrap;
@@ -46,27 +46,27 @@
46
46
  align-self: baseline;
47
47
  box-sizing: border-box;
48
48
  min-height: 48px
49
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc,
50
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc {
49
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j,
50
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j {
51
51
  font-size: 16px;
52
52
  line-height: 20px;
53
53
  font-weight: 500;
54
54
  align-self: center;
55
55
  padding-top: var(--gap-2xs);
56
56
  padding-bottom: var(--gap-2xs)
57
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__children_1uwdc,
58
- .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__title_1uwdc,
59
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__children_1uwdc,
60
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__title_1uwdc {
57
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__children_5ow3j,
58
+ .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__title_5ow3j,
59
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__children_5ow3j,
60
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__title_5ow3j {
61
61
  -webkit-line-clamp: 1;
62
62
  word-break: break-all;
63
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc {
63
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j {
64
64
  padding-top: var(--gap-s);
65
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotMobile_1uwdc.navigation-bar__contentOnBotMobile_1uwdc {
65
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotMobile_5ow3j.navigation-bar__contentOnBotMobile_5ow3j {
66
66
  padding-top: var(--gap-s);
67
- } .navigation-bar__title_1uwdc {
67
+ } .navigation-bar__title_5ow3j {
68
68
  word-break: break-word;
69
- } .navigation-bar__subtitle_1uwdc {
69
+ } .navigation-bar__subtitle_5ow3j {
70
70
  font-size: 14px;
71
71
  line-height: 20px;
72
72
  font-weight: 400;
@@ -77,11 +77,11 @@
77
77
 
78
78
  color: var(--color-light-text-secondary);
79
79
  word-break: break-all;
80
- } .navigation-bar__addonsWrapper_1uwdc {
80
+ } .navigation-bar__addonsWrapper_5ow3j {
81
81
  display: flex;
82
- } .navigation-bar__rightAddons_1uwdc {
82
+ } .navigation-bar__rightAddons_5ow3j {
83
83
  margin-left: auto;
84
- } .navigation-bar__addon_1uwdc {
84
+ } .navigation-bar__addon_5ow3j {
85
85
  min-width: 48px;
86
86
  height: 48px;
87
87
  display: flex;
@@ -89,18 +89,18 @@
89
89
  align-items: center;
90
90
  flex-shrink: 0;
91
91
  pointer-events: all;
92
- } .navigation-bar__bottomAddons_1uwdc {
92
+ } .navigation-bar__bottomAddons_5ow3j {
93
93
  pointer-events: all;
94
- } .navigation-bar__closer_1uwdc {
94
+ } .navigation-bar__closer_5ow3j {
95
95
  margin-left: auto;
96
- } .navigation-bar__left_1uwdc {
96
+ } .navigation-bar__left_5ow3j {
97
97
  text-align: left;
98
- } .navigation-bar__center_1uwdc {
98
+ } .navigation-bar__center_5ow3j {
99
99
  text-align: center;
100
- } .navigation-bar__trim_1uwdc {
100
+ } .navigation-bar__trim_5ow3j {
101
101
  overflow: hidden
102
- } .navigation-bar__trim_1uwdc .navigation-bar__title_1uwdc,
103
- .navigation-bar__trim_1uwdc .navigation-bar__children_1uwdc {
102
+ } .navigation-bar__trim_5ow3j .navigation-bar__title_5ow3j,
103
+ .navigation-bar__trim_5ow3j .navigation-bar__children_5ow3j {
104
104
  -webkit-line-clamp: 2;
105
105
  display: -webkit-box;
106
106
  -webkit-box-orient: vertical;
package/index.js CHANGED
@@ -5,6 +5,7 @@ var components_closer_Component = require('./components/closer/Component.js');
5
5
  require('tslib');
6
6
  require('react');
7
7
  require('classnames');
8
+ require('@alfalab/hooks');
8
9
  require('./components/back-arrow-addon/Component.js');
9
10
  require('@alfalab/core-components-button');
10
11
  require('@alfalab/core-components-typography');
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useRef, useEffect } from 'react';
2
2
  import cn from 'classnames';
3
+ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
3
4
  import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
4
5
  import { Closer } from './components/closer/Component.js';
5
6
  import '@alfalab/core-components-button/modern';
@@ -15,16 +16,19 @@ const getDataTestId = (dataTestId, element) => {
15
16
  return dataTestId ? `${dataTestId}${elementPart}` : undefined;
16
17
  };
17
18
 
18
- const styles = {"header":"navigation-bar__header_1uwdc","backgroundImage":"navigation-bar__backgroundImage_1uwdc","mainLine":"navigation-bar__mainLine_1uwdc","mainLineSticky":"navigation-bar__mainLineSticky_1uwdc","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1uwdc","content":"navigation-bar__content_1uwdc","withBothAddons":"navigation-bar__withBothAddons_1uwdc","withCompactTitle":"navigation-bar__withCompactTitle_1uwdc","children":"navigation-bar__children_1uwdc","title":"navigation-bar__title_1uwdc","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1uwdc","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1uwdc","subtitle":"navigation-bar__subtitle_1uwdc","addonsWrapper":"navigation-bar__addonsWrapper_1uwdc","rightAddons":"navigation-bar__rightAddons_1uwdc","addon":"navigation-bar__addon_1uwdc","bottomAddons":"navigation-bar__bottomAddons_1uwdc","closer":"navigation-bar__closer_1uwdc","left":"navigation-bar__left_1uwdc","center":"navigation-bar__center_1uwdc","trim":"navigation-bar__trim_1uwdc"};
19
+ const styles = {"header":"navigation-bar__header_5ow3j","backgroundImage":"navigation-bar__backgroundImage_5ow3j","mainLine":"navigation-bar__mainLine_5ow3j","mainLineSticky":"navigation-bar__mainLineSticky_5ow3j","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_5ow3j","content":"navigation-bar__content_5ow3j","withBothAddons":"navigation-bar__withBothAddons_5ow3j","withCompactTitle":"navigation-bar__withCompactTitle_5ow3j","children":"navigation-bar__children_5ow3j","title":"navigation-bar__title_5ow3j","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_5ow3j","contentOnBotMobile":"navigation-bar__contentOnBotMobile_5ow3j","subtitle":"navigation-bar__subtitle_5ow3j","addonsWrapper":"navigation-bar__addonsWrapper_5ow3j","rightAddons":"navigation-bar__rightAddons_5ow3j","addon":"navigation-bar__addon_5ow3j","bottomAddons":"navigation-bar__bottomAddons_5ow3j","closer":"navigation-bar__closer_5ow3j","left":"navigation-bar__left_5ow3j","center":"navigation-bar__center_5ow3j","trim":"navigation-bar__trim_5ow3j"};
19
20
  require('./index.css')
20
21
 
21
22
  /* eslint-disable complexity */
22
23
  const ADDONS_HEIGHT = 48;
23
24
  const NavigationBar = ({ addonClassName, className, contentClassName, closerClassName, leftAddons, rightAddons, bottomAddons, bottomAddonsClassName, children, align = 'left', trim = true, title, titleSize = 'default', subtitle, hasCloser, hasBackButton, backButtonClassName, dataTestId, imageUrl, closerIcon, onClose, view, scrollableParentRef, sticky, onBack, }) => {
24
25
  const [scrollTop, setScrollTop] = useState(0);
26
+ const [titleMargin, setTitleMargin] = useState({ left: 0, right: 0 });
25
27
  const bottomContentRef = useRef(null);
26
28
  const headerRef = useRef(null);
27
29
  const mainLinePaddingTopRef = useRef('0px');
30
+ const leftAddonsRef = useRef(null);
31
+ const rightAddonsRef = useRef(null);
28
32
  const compactTitle = view === 'mobile' && titleSize === 'compact';
29
33
  const hasLeftPart = Boolean(leftAddons || hasBackButton);
30
34
  const hasRightPart = Boolean(rightAddons || hasCloser);
@@ -37,6 +41,29 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
37
41
  const showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
38
42
  const showAnimatedContentOnBot = withAnimation && showContentOnBot;
39
43
  const headerPaddingTop = mainLinePaddingTopRef.current;
44
+ useLayoutEffect_SAFE_FOR_SSR(() => {
45
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
46
+ const leftAddonsWidth = leftAddonsRef.current?.offsetWidth || 0;
47
+ const rightAddonsWidth = rightAddonsRef.current?.offsetWidth || 0;
48
+ const marginSize = Math.abs(rightAddonsWidth - leftAddonsWidth);
49
+ const shouldAddLeftMargin = rightAddonsWidth - leftAddonsWidth > 0;
50
+ setTitleMargin((prev) => {
51
+ const newState = shouldAddLeftMargin
52
+ ? { left: marginSize, right: 0 }
53
+ : { left: 0, right: marginSize };
54
+ const isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
55
+ return isStateChanged ? newState : prev;
56
+ });
57
+ }
58
+ }, [
59
+ align,
60
+ showStaticContentOnTop,
61
+ showAnimatedContentOnTop,
62
+ leftAddons,
63
+ rightAddons,
64
+ hasBackButton,
65
+ hasCloser,
66
+ ]);
40
67
  useEffect(() => {
41
68
  const parent = scrollableParentRef?.current;
42
69
  const handleScroll = (ev) => {
@@ -91,18 +118,31 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
91
118
  }
92
119
  : null),
93
120
  } },
94
- hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper },
121
+ hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper, ref: leftAddonsRef },
95
122
  hasBackButton && renderBackButton(),
96
123
  leftAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, leftAddons)))),
97
- showStaticContentOnTop && renderContent(),
124
+ showStaticContentOnTop &&
125
+ renderContent({
126
+ ...(align === 'center'
127
+ ? {
128
+ style: {
129
+ marginLeft: titleMargin.left,
130
+ marginRight: titleMargin.right,
131
+ },
132
+ }
133
+ : null),
134
+ }),
98
135
  showAnimatedContentOnTop &&
99
136
  renderContent({
100
137
  extraClassName: styles.withBothAddons,
101
138
  style: {
102
139
  opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
140
+ ...(align === 'center'
141
+ ? { marginLeft: titleMargin.left, marginRight: titleMargin.right }
142
+ : null),
103
143
  },
104
144
  }),
105
- hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons) },
145
+ hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons), ref: rightAddonsRef },
106
146
  rightAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, rightAddons)),
107
147
  hasCloser && renderCloser()))),
108
148
  showAnimatedContentOnBot &&
@@ -5,7 +5,7 @@ import { Typography } from '@alfalab/core-components-typography/modern';
5
5
  import { ArrowLeftMediumMIcon } from '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
6
6
  import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
7
7
 
8
- const styles = {"component":"navigation-bar__component_1ryml","mobileComponent":"navigation-bar__mobileComponent_1ryml","flex":"navigation-bar__flex_1ryml","iconWrapper":"navigation-bar__iconWrapper_1ryml","text":"navigation-bar__text_1ryml","mobileWrapper":"navigation-bar__mobileWrapper_1ryml"};
8
+ const styles = {"component":"navigation-bar__component_swc35","mobileComponent":"navigation-bar__mobileComponent_swc35","flex":"navigation-bar__flex_swc35","iconWrapper":"navigation-bar__iconWrapper_swc35","text":"navigation-bar__text_swc35","mobileWrapper":"navigation-bar__mobileWrapper_swc35"};
9
9
  require('./index.css')
10
10
 
11
11
  const BackArrowAddon = ({ text = 'Назад', onClick, className, textOpacity = 1, view, ...htmlAttributes }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1dgzi */
1
+ /* hash: 27iuz */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -24,46 +24,46 @@
24
24
  --gap-s: 12px;
25
25
  } :root {
26
26
  } :root {
27
- } .navigation-bar__component_1ryml {
27
+ } .navigation-bar__component_swc35 {
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-bar__component_1ryml svg > path {
33
+ } .navigation-bar__component_swc35 svg > path {
34
34
  transition: fill 0.2s ease;
35
35
  fill: var(--color-light-graphic-primary);
36
- } .navigation-bar__component_1ryml:hover svg > path {
36
+ } .navigation-bar__component_swc35:hover svg > path {
37
37
  fill: var(--color-light-graphic-primary-tint-20);
38
- } .navigation-bar__component_1ryml:active svg > path {
38
+ } .navigation-bar__component_swc35:active svg > path {
39
39
  fill: var(--color-light-graphic-primary-tint-30);
40
- } .navigation-bar__mobileComponent_1ryml {
40
+ } .navigation-bar__mobileComponent_swc35 {
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-bar__flex_1ryml {
46
+ } .navigation-bar__flex_swc35 {
47
47
  display: flex;
48
48
  align-items: center;
49
- } .navigation-bar__iconWrapper_1ryml {
49
+ } .navigation-bar__iconWrapper_swc35 {
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-bar__iconWrapper_1ryml + .navigation-bar__text_1ryml {
56
+ } .navigation-bar__iconWrapper_swc35 + .navigation-bar__text_swc35 {
57
57
  margin-right: var(--gap-s);
58
- } .navigation-bar__mobileWrapper_1ryml {
58
+ } .navigation-bar__mobileWrapper_swc35 {
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-bar__mobileWrapper_1ryml + .navigation-bar__text_1ryml {
65
+ } .navigation-bar__mobileWrapper_swc35 + .navigation-bar__text_swc35 {
66
66
  margin: 0 var(--gap-s) 0 var(--gap-xs);
67
- } .navigation-bar__mobileWrapper_1ryml svg > path {
67
+ } .navigation-bar__mobileWrapper_swc35 svg > path {
68
68
  fill: var(--color-light-graphic-secondary);
69
69
  }
@@ -4,7 +4,7 @@ import { IconButton } from '@alfalab/core-components-icon-button/modern';
4
4
  import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
5
5
  import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
6
6
 
7
- const styles = {"closer":"navigation-bar__closer_asogp","button":"navigation-bar__button_asogp","mobile":"navigation-bar__mobile_asogp","sticky":"navigation-bar__sticky_asogp"};
7
+ const styles = {"closer":"navigation-bar__closer_kmb9l","button":"navigation-bar__button_kmb9l","mobile":"navigation-bar__mobile_kmb9l","sticky":"navigation-bar__sticky_kmb9l"};
8
8
  require('./index.css')
9
9
 
10
10
  const Closer = ({ view, className, sticky, icon = view === 'desktop' ? CrossHeavyMIcon : CrossMIcon, dataTestId, onClose, ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: ol373 */
1
+ /* hash: 1lpkd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-primary: #0b1f35;
@@ -18,7 +18,7 @@
18
18
  } :root {
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__closer_asogp {
21
+ } .navigation-bar__closer_kmb9l {
22
22
  flex-shrink: 0;
23
23
  width: 48px;
24
24
  height: 48px;
@@ -26,16 +26,16 @@
26
26
  display: flex;
27
27
  align-items: center;
28
28
  justify-content: center;
29
- } .navigation-bar__button_asogp {
29
+ } .navigation-bar__button_kmb9l {
30
30
  background: var(--color-light-bg-primary-alpha-40);
31
31
  -webkit-backdrop-filter: blur(10px);
32
32
  backdrop-filter: blur(10px);
33
33
  border-radius: 50px;
34
34
  color: var(--color-light-graphic-primary)
35
- } .navigation-bar__button_asogp.navigation-bar__mobile_asogp {
35
+ } .navigation-bar__button_kmb9l.navigation-bar__mobile_kmb9l {
36
36
  background: var(--color-light-specialbg-secondary-transparent);
37
37
  color: var(--color-light-graphic-secondary);
38
- } .navigation-bar__sticky_asogp {
38
+ } .navigation-bar__sticky_kmb9l {
39
39
  position: sticky;
40
40
  top: 0;
41
41
  }
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 27oys */
1
+ /* hash: zc64y */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0b1f35;
@@ -18,26 +18,26 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__header_1uwdc {
21
+ } .navigation-bar__header_5ow3j {
22
22
  width: 100%;
23
23
  box-sizing: border-box;
24
24
  transition: box-shadow 0.2s ease, background 0.2s ease
25
- } .navigation-bar__header_1uwdc.navigation-bar__header_1uwdc.navigation-bar__backgroundImage_1uwdc {
25
+ } .navigation-bar__header_5ow3j.navigation-bar__header_5ow3j.navigation-bar__backgroundImage_5ow3j {
26
26
  background-repeat: no-repeat;
27
27
  background-position: center;
28
28
  background-size: cover;
29
- } .navigation-bar__mainLine_1uwdc {
29
+ } .navigation-bar__mainLine_5ow3j {
30
30
  display: flex;
31
31
  align-items: stretch;
32
32
  justify-content: space-between;
33
33
  z-index: 1;
34
34
  background-color: inherit;
35
- } .navigation-bar__mainLineSticky_1uwdc {
35
+ } .navigation-bar__mainLineSticky_5ow3j {
36
36
  position: sticky;
37
37
  top: 0;
38
- } .navigation-bar__mainLineWithImageBg_1uwdc {
38
+ } .navigation-bar__mainLineWithImageBg_5ow3j {
39
39
  background-color: initial;
40
- } .navigation-bar__content_1uwdc {
40
+ } .navigation-bar__content_5ow3j {
41
41
  color: var(--color-light-text-primary);
42
42
  display: flex;
43
43
  flex-flow: column nowrap;
@@ -46,27 +46,27 @@
46
46
  align-self: baseline;
47
47
  box-sizing: border-box;
48
48
  min-height: 48px
49
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc,
50
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc {
49
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j,
50
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j {
51
51
  font-size: 16px;
52
52
  line-height: 20px;
53
53
  font-weight: 500;
54
54
  align-self: center;
55
55
  padding-top: var(--gap-2xs);
56
56
  padding-bottom: var(--gap-2xs)
57
- } .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__children_1uwdc,
58
- .navigation-bar__content_1uwdc.navigation-bar__withBothAddons_1uwdc > .navigation-bar__title_1uwdc,
59
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__children_1uwdc,
60
- .navigation-bar__content_1uwdc.navigation-bar__withCompactTitle_1uwdc > .navigation-bar__title_1uwdc {
57
+ } .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__children_5ow3j,
58
+ .navigation-bar__content_5ow3j.navigation-bar__withBothAddons_5ow3j > .navigation-bar__title_5ow3j,
59
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__children_5ow3j,
60
+ .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j > .navigation-bar__title_5ow3j {
61
61
  -webkit-line-clamp: 1;
62
62
  word-break: break-all;
63
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc.navigation-bar__contentOnBotDesktop_1uwdc {
63
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j {
64
64
  padding-top: var(--gap-s);
65
- } .navigation-bar__content_1uwdc.navigation-bar__contentOnBotMobile_1uwdc.navigation-bar__contentOnBotMobile_1uwdc {
65
+ } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotMobile_5ow3j.navigation-bar__contentOnBotMobile_5ow3j {
66
66
  padding-top: var(--gap-s);
67
- } .navigation-bar__title_1uwdc {
67
+ } .navigation-bar__title_5ow3j {
68
68
  word-break: break-word;
69
- } .navigation-bar__subtitle_1uwdc {
69
+ } .navigation-bar__subtitle_5ow3j {
70
70
  font-size: 14px;
71
71
  line-height: 20px;
72
72
  font-weight: 400;
@@ -77,11 +77,11 @@
77
77
 
78
78
  color: var(--color-light-text-secondary);
79
79
  word-break: break-all;
80
- } .navigation-bar__addonsWrapper_1uwdc {
80
+ } .navigation-bar__addonsWrapper_5ow3j {
81
81
  display: flex;
82
- } .navigation-bar__rightAddons_1uwdc {
82
+ } .navigation-bar__rightAddons_5ow3j {
83
83
  margin-left: auto;
84
- } .navigation-bar__addon_1uwdc {
84
+ } .navigation-bar__addon_5ow3j {
85
85
  min-width: 48px;
86
86
  height: 48px;
87
87
  display: flex;
@@ -89,18 +89,18 @@
89
89
  align-items: center;
90
90
  flex-shrink: 0;
91
91
  pointer-events: all;
92
- } .navigation-bar__bottomAddons_1uwdc {
92
+ } .navigation-bar__bottomAddons_5ow3j {
93
93
  pointer-events: all;
94
- } .navigation-bar__closer_1uwdc {
94
+ } .navigation-bar__closer_5ow3j {
95
95
  margin-left: auto;
96
- } .navigation-bar__left_1uwdc {
96
+ } .navigation-bar__left_5ow3j {
97
97
  text-align: left;
98
- } .navigation-bar__center_1uwdc {
98
+ } .navigation-bar__center_5ow3j {
99
99
  text-align: center;
100
- } .navigation-bar__trim_1uwdc {
100
+ } .navigation-bar__trim_5ow3j {
101
101
  overflow: hidden
102
- } .navigation-bar__trim_1uwdc .navigation-bar__title_1uwdc,
103
- .navigation-bar__trim_1uwdc .navigation-bar__children_1uwdc {
102
+ } .navigation-bar__trim_5ow3j .navigation-bar__title_5ow3j,
103
+ .navigation-bar__trim_5ow3j .navigation-bar__children_5ow3j {
104
104
  -webkit-line-clamp: 2;
105
105
  display: -webkit-box;
106
106
  -webkit-box-orient: vertical;
package/modern/index.js CHANGED
@@ -2,6 +2,7 @@ export { NavigationBar } from './Component.js';
2
2
  export { Closer } from './components/closer/Component.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
+ import '@alfalab/hooks';
5
6
  import './components/back-arrow-addon/Component.js';
6
7
  import '@alfalab/core-components-button/modern';
7
8
  import '@alfalab/core-components-typography/modern';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-navigation-bar",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Navigation bar component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,6 +14,7 @@
14
14
  "@alfalab/core-components-icon-button": "^6.0.8",
15
15
  "@alfalab/core-components-button": "^7.1.1",
16
16
  "@alfalab/core-components-typography": "^3.2.0",
17
+ "@alfalab/hooks": "^1.13.0",
17
18
  "@alfalab/icons-glyph": "^2.89.0",
18
19
  "classnames": "^2.3.1",
19
20
  "tslib": "^2.4.0"