@alfalab/core-components-navigation-bar-private 0.5.8 → 0.6.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 CHANGED
@@ -17,13 +17,13 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
17
17
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
18
18
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
19
19
 
20
- var styles = {"header":"navigation-bar-private__header_9ony2","backgroundImage":"navigation-bar-private__backgroundImage_9ony2","mainLine":"navigation-bar-private__mainLine_9ony2","mainLineSticky":"navigation-bar-private__mainLineSticky_9ony2","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_9ony2","content":"navigation-bar-private__content_9ony2","withBothAddons":"navigation-bar-private__withBothAddons_9ony2","withCompactTitle":"navigation-bar-private__withCompactTitle_9ony2","children":"navigation-bar-private__children_9ony2","title":"navigation-bar-private__title_9ony2","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_9ony2","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_9ony2","subtitle":"navigation-bar-private__subtitle_9ony2","addonsWrapper":"navigation-bar-private__addonsWrapper_9ony2","rightAddons":"navigation-bar-private__rightAddons_9ony2","addon":"navigation-bar-private__addon_9ony2","bottomAddons":"navigation-bar-private__bottomAddons_9ony2","closer":"navigation-bar-private__closer_9ony2","left":"navigation-bar-private__left_9ony2","center":"navigation-bar-private__center_9ony2","trim":"navigation-bar-private__trim_9ony2"};
20
+ var styles = {"header":"navigation-bar-private__header_17jby","backgroundImage":"navigation-bar-private__backgroundImage_17jby","mainLine":"navigation-bar-private__mainLine_17jby","mainLineSticky":"navigation-bar-private__mainLineSticky_17jby","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_17jby","content":"navigation-bar-private__content_17jby","withBothAddons":"navigation-bar-private__withBothAddons_17jby","withCompactTitle":"navigation-bar-private__withCompactTitle_17jby","children":"navigation-bar-private__children_17jby","title":"navigation-bar-private__title_17jby","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_17jby","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_17jby","subtitle":"navigation-bar-private__subtitle_17jby","addonsWrapper":"navigation-bar-private__addonsWrapper_17jby","rightAddons":"navigation-bar-private__rightAddons_17jby","addon":"navigation-bar-private__addon_17jby","bottomAddons":"navigation-bar-private__bottomAddons_17jby","closer":"navigation-bar-private__closer_17jby","left":"navigation-bar-private__left_17jby","center":"navigation-bar-private__center_17jby","trim":"navigation-bar-private__trim_17jby"};
21
21
  require('./index.css')
22
22
 
23
23
  var ADDONS_HEIGHT = 48;
24
24
  var NavigationBarPrivate = React.forwardRef(function (_a, ref) {
25
25
  var _b, _c, _d;
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, backButtonProps = _a.backButtonProps, 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
+ 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, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack, dataName = _a.dataName, titleClassName = _a.titleClassName, titleRef = _a.titleRef;
27
27
  var _h = React.useState(0), scrollTop = _h[0], setScrollTop = _h[1];
28
28
  var _j = React.useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
29
29
  var bottomContentRef = React.useRef(null);
@@ -102,15 +102,15 @@ var NavigationBarPrivate = React.forwardRef(function (_a, ref) {
102
102
  _a[styles.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
103
103
  _a)), "aria-hidden": hidden },
104
104
  children && React__default.default.createElement("div", { className: styles.children }, children),
105
- title && (React__default.default.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title') }, title)),
106
- compactTitle && subtitle && React__default.default.createElement("div", { className: styles.subtitle }, subtitle)));
105
+ title && (React__default.default.createElement("div", { className: cn__default.default(styles.title, titleClassName), "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title'), ref: titleRef }, title)),
106
+ compactTitle && subtitle && (React__default.default.createElement("div", { className: styles.subtitle, "data-test-id": coreComponentsShared.getDataTestId(dataTestId, 'subtitle') }, subtitle))));
107
107
  };
108
108
  var renderCloser = function () { return (React__default.default.createElement("div", { className: cn__default.default(styles.addon, styles.closer, closerClassName) },
109
109
  React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
110
110
  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 &&
111
111
  bottomContentRef.current && {
112
112
  top: -bottomContentRef.current.scrollHeight,
113
- })) },
113
+ })), "data-name": dataName },
114
114
  React__default.default.createElement("div", { className: cn__default.default(styles.mainLine, (_c = {},
115
115
  _c[styles.mainLineSticky] = withAnimation,
116
116
  _c[styles.mainLineWithImageBg] = imageUrl,
@@ -15,7 +15,7 @@ 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-bar-private__component_o9ixg","mobileComponent":"navigation-bar-private__mobileComponent_o9ixg","flex":"navigation-bar-private__flex_o9ixg","iconWrapper":"navigation-bar-private__iconWrapper_o9ixg","text":"navigation-bar-private__text_o9ixg","mobileWrapper":"navigation-bar-private__mobileWrapper_o9ixg"};
18
+ var styles = {"component":"navigation-bar-private__component_156jy","mobileComponent":"navigation-bar-private__mobileComponent_156jy","flex":"navigation-bar-private__flex_156jy","iconWrapper":"navigation-bar-private__iconWrapper_156jy","text":"navigation-bar-private__text_156jy","mobileWrapper":"navigation-bar-private__mobileWrapper_156jy"};
19
19
  require('./index.css')
20
20
 
21
21
  var BackArrowAddon = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 19axe */
1
+ /* hash: xa4w3 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -39,48 +39,48 @@
39
39
 
40
40
  /* back-arrow */
41
41
  --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
42
- } .navigation-bar-private__component_o9ixg {
42
+ } .navigation-bar-private__component_156jy {
43
43
  height: 100%;
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  border-radius: var(--border-radius-pill);
48
48
  min-width: 48px
49
- } .navigation-bar-private__component_o9ixg svg > path {
49
+ } .navigation-bar-private__component_156jy svg > path {
50
50
  transition: fill 0.2s ease;
51
51
  fill: var(--color-light-neutral-translucent-1300);
52
- } .navigation-bar-private__component_o9ixg:hover svg > path {
52
+ } .navigation-bar-private__component_156jy:hover svg > path {
53
53
  fill: var(--color-light-neutral-translucent-1300-hover);
54
- } .navigation-bar-private__component_o9ixg:active svg > path {
54
+ } .navigation-bar-private__component_156jy:active svg > path {
55
55
  fill: var(--color-light-neutral-translucent-1300-press);
56
- } .navigation-bar-private__mobileComponent_o9ixg {
56
+ } .navigation-bar-private__mobileComponent_156jy {
57
57
  height: 32px;
58
58
  min-width: 32px;
59
59
  margin: var(--gap-0) var(--gap-8);
60
60
  -webkit-backdrop-filter: none;
61
61
  backdrop-filter: none;
62
62
  background: none;
63
- } .navigation-bar-private__flex_o9ixg {
63
+ } .navigation-bar-private__flex_156jy {
64
64
  display: flex;
65
65
  align-items: center;
66
- } .navigation-bar-private__iconWrapper_o9ixg {
66
+ } .navigation-bar-private__iconWrapper_156jy {
67
67
  display: inline-flex;
68
68
  align-items: center;
69
69
  justify-content: center;
70
70
  height: 48px;
71
71
  margin: var(--gap-0) var(--gap-8) var(--gap-0) var(--gap-12);
72
72
  border-radius: var(--border-radius-circle)
73
- } .navigation-bar-private__iconWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
73
+ } .navigation-bar-private__iconWrapper_156jy + .navigation-bar-private__text_156jy {
74
74
  margin-right: var(--gap-12);
75
- } .navigation-bar-private__mobileWrapper_o9ixg {
75
+ } .navigation-bar-private__mobileWrapper_156jy {
76
76
  width: 32px;
77
77
  height: 32px;
78
78
  background: var(--color-light-neutral-translucent-100);
79
79
  -webkit-backdrop-filter: blur(10px);
80
80
  backdrop-filter: blur(10px);
81
81
  margin: var(--gap-0)
82
- } .navigation-bar-private__mobileWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
82
+ } .navigation-bar-private__mobileWrapper_156jy + .navigation-bar-private__text_156jy {
83
83
  margin: var(--gap-0) var(--gap-12) var(--gap-0) var(--gap-8);
84
- } .navigation-bar-private__mobileWrapper_o9ixg svg > path {
84
+ } .navigation-bar-private__mobileWrapper_156jy svg > path {
85
85
  fill: var(--navigation-bar-back-arrow-mobile-fill);
86
86
  }
@@ -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-bar-private__closer_bbwgj","button":"navigation-bar-private__button_bbwgj","mobile":"navigation-bar-private__mobile_bbwgj","sticky":"navigation-bar-private__sticky_bbwgj"};
17
+ var styles = {"closer":"navigation-bar-private__closer_196kg","button":"navigation-bar-private__button_196kg","mobile":"navigation-bar-private__mobile_196kg","sticky":"navigation-bar-private__sticky_196kg"};
18
18
  require('./index.css')
19
19
 
20
20
  var Closer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: vbtjq */
1
+ /* hash: 12zho */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -32,7 +32,7 @@
32
32
  --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
33
33
 
34
34
  /* back-arrow */
35
- } .navigation-bar-private__closer_bbwgj {
35
+ } .navigation-bar-private__closer_196kg {
36
36
  flex-shrink: 0;
37
37
  width: 48px;
38
38
  height: 48px;
@@ -40,17 +40,17 @@
40
40
  display: flex;
41
41
  align-items: center;
42
42
  justify-content: center;
43
- } .navigation-bar-private__button_bbwgj {
43
+ } .navigation-bar-private__button_196kg {
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  color: var(--color-light-neutral-translucent-1300)
48
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__mobile_bbwgj {
48
+ } .navigation-bar-private__button_196kg.navigation-bar-private__mobile_196kg {
49
49
  background: var(--color-light-neutral-translucent-100);
50
50
  color: var(--navigation-bar-closer-mobile-color);
51
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__button_bbwgj {
51
+ } .navigation-bar-private__button_196kg.navigation-bar-private__button_196kg {
52
52
  border-radius: var(--border-radius-circle);
53
- } .navigation-bar-private__sticky_bbwgj {
53
+ } .navigation-bar-private__sticky_196kg {
54
54
  position: sticky;
55
55
  top: var(--gap-0);
56
56
  }
package/cssm/Component.js CHANGED
@@ -22,7 +22,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
22
22
  var ADDONS_HEIGHT = 48;
23
23
  var NavigationBarPrivate = React.forwardRef(function (_a, ref) {
24
24
  var _b, _c, _d;
25
- 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, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
25
+ 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, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack, dataName = _a.dataName, titleClassName = _a.titleClassName, titleRef = _a.titleRef;
26
26
  var _h = React.useState(0), scrollTop = _h[0], setScrollTop = _h[1];
27
27
  var _j = React.useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
28
28
  var bottomContentRef = React.useRef(null);
@@ -101,15 +101,15 @@ var NavigationBarPrivate = React.forwardRef(function (_a, ref) {
101
101
  _a[styles__default.default.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
102
102
  _a)), "aria-hidden": hidden },
103
103
  children && React__default.default.createElement("div", { className: styles__default.default.children }, children),
104
- title && (React__default.default.createElement("div", { className: styles__default.default.title, "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title') }, title)),
105
- compactTitle && subtitle && React__default.default.createElement("div", { className: styles__default.default.subtitle }, subtitle)));
104
+ title && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.title, titleClassName), "data-test-id": hidden ? undefined : coreComponentsShared.getDataTestId(dataTestId, 'title'), ref: titleRef }, title)),
105
+ compactTitle && subtitle && (React__default.default.createElement("div", { className: styles__default.default.subtitle, "data-test-id": coreComponentsShared.getDataTestId(dataTestId, 'subtitle') }, subtitle))));
106
106
  };
107
107
  var renderCloser = function () { return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.addon, styles__default.default.closer, closerClassName) },
108
108
  React__default.default.createElement(components_closer_Component.Closer, { view: view, icon: closerIcon, dataTestId: coreComponentsShared.getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
109
109
  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 &&
110
110
  bottomContentRef.current && {
111
111
  top: -bottomContentRef.current.scrollHeight,
112
- })) },
112
+ })), "data-name": dataName },
113
113
  React__default.default.createElement("div", { className: cn__default.default(styles__default.default.mainLine, (_c = {},
114
114
  _c[styles__default.default.mainLineSticky] = withAnimation,
115
115
  _c[styles__default.default.mainLineWithImageBg] = imageUrl,
package/cssm/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
5
5
  import { CloserProps } from "./components/closer/index";
6
6
  type NavigationBarPrivateProps = {
@@ -108,6 +108,18 @@ type NavigationBarPrivateProps = {
108
108
  * Ссылка на родительскую ноду overflow: auto
109
109
  */
110
110
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
111
+ /**
112
+ * Data атрибут для компонента
113
+ */
114
+ dataName?: string;
115
+ /**
116
+ * Дополнительный класс для title
117
+ */
118
+ titleClassName?: string;
119
+ /**
120
+ * Ref для title элемента
121
+ */
122
+ titleRef?: RefObject<HTMLDivElement>;
111
123
  };
112
124
  type ContentParams = {
113
125
  extraClassName?: string;
package/esm/Component.js CHANGED
@@ -7,13 +7,13 @@ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
7
7
  import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
8
8
  import { Closer } from './components/closer/Component.js';
9
9
 
10
- var styles = {"header":"navigation-bar-private__header_9ony2","backgroundImage":"navigation-bar-private__backgroundImage_9ony2","mainLine":"navigation-bar-private__mainLine_9ony2","mainLineSticky":"navigation-bar-private__mainLineSticky_9ony2","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_9ony2","content":"navigation-bar-private__content_9ony2","withBothAddons":"navigation-bar-private__withBothAddons_9ony2","withCompactTitle":"navigation-bar-private__withCompactTitle_9ony2","children":"navigation-bar-private__children_9ony2","title":"navigation-bar-private__title_9ony2","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_9ony2","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_9ony2","subtitle":"navigation-bar-private__subtitle_9ony2","addonsWrapper":"navigation-bar-private__addonsWrapper_9ony2","rightAddons":"navigation-bar-private__rightAddons_9ony2","addon":"navigation-bar-private__addon_9ony2","bottomAddons":"navigation-bar-private__bottomAddons_9ony2","closer":"navigation-bar-private__closer_9ony2","left":"navigation-bar-private__left_9ony2","center":"navigation-bar-private__center_9ony2","trim":"navigation-bar-private__trim_9ony2"};
10
+ var styles = {"header":"navigation-bar-private__header_17jby","backgroundImage":"navigation-bar-private__backgroundImage_17jby","mainLine":"navigation-bar-private__mainLine_17jby","mainLineSticky":"navigation-bar-private__mainLineSticky_17jby","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_17jby","content":"navigation-bar-private__content_17jby","withBothAddons":"navigation-bar-private__withBothAddons_17jby","withCompactTitle":"navigation-bar-private__withCompactTitle_17jby","children":"navigation-bar-private__children_17jby","title":"navigation-bar-private__title_17jby","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_17jby","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_17jby","subtitle":"navigation-bar-private__subtitle_17jby","addonsWrapper":"navigation-bar-private__addonsWrapper_17jby","rightAddons":"navigation-bar-private__rightAddons_17jby","addon":"navigation-bar-private__addon_17jby","bottomAddons":"navigation-bar-private__bottomAddons_17jby","closer":"navigation-bar-private__closer_17jby","left":"navigation-bar-private__left_17jby","center":"navigation-bar-private__center_17jby","trim":"navigation-bar-private__trim_17jby"};
11
11
  require('./index.css')
12
12
 
13
13
  var ADDONS_HEIGHT = 48;
14
14
  var NavigationBarPrivate = forwardRef(function (_a, ref) {
15
15
  var _b, _c, _d;
16
- 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, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
16
+ 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, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack, dataName = _a.dataName, titleClassName = _a.titleClassName, titleRef = _a.titleRef;
17
17
  var _h = useState(0), scrollTop = _h[0], setScrollTop = _h[1];
18
18
  var _j = useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
19
19
  var bottomContentRef = useRef(null);
@@ -92,15 +92,15 @@ var NavigationBarPrivate = forwardRef(function (_a, ref) {
92
92
  _a[styles.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
93
93
  _a)), "aria-hidden": hidden },
94
94
  children && React.createElement("div", { className: styles.children }, children),
95
- title && (React.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
96
- compactTitle && subtitle && React.createElement("div", { className: styles.subtitle }, subtitle)));
95
+ title && (React.createElement("div", { className: cn(styles.title, titleClassName), "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title'), ref: titleRef }, title)),
96
+ compactTitle && subtitle && (React.createElement("div", { className: styles.subtitle, "data-test-id": getDataTestId(dataTestId, 'subtitle') }, subtitle))));
97
97
  };
98
98
  var renderCloser = function () { return (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
99
99
  React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
100
100
  return (React.createElement("div", { ref: mergeRefs([ref, headerRef]), className: cn(styles.header, className, (_b = {}, _b[styles.backgroundImage] = imageUrl, _b)), "data-test-id": getDataTestId(dataTestId), style: __assign(__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
101
101
  bottomContentRef.current && {
102
102
  top: -bottomContentRef.current.scrollHeight,
103
- })) },
103
+ })), "data-name": dataName },
104
104
  React.createElement("div", { className: cn(styles.mainLine, (_c = {},
105
105
  _c[styles.mainLineSticky] = withAnimation,
106
106
  _c[styles.mainLineWithImageBg] = imageUrl,
@@ -6,7 +6,7 @@ import { Text } 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-private__component_o9ixg","mobileComponent":"navigation-bar-private__mobileComponent_o9ixg","flex":"navigation-bar-private__flex_o9ixg","iconWrapper":"navigation-bar-private__iconWrapper_o9ixg","text":"navigation-bar-private__text_o9ixg","mobileWrapper":"navigation-bar-private__mobileWrapper_o9ixg"};
9
+ var styles = {"component":"navigation-bar-private__component_156jy","mobileComponent":"navigation-bar-private__mobileComponent_156jy","flex":"navigation-bar-private__flex_156jy","iconWrapper":"navigation-bar-private__iconWrapper_156jy","text":"navigation-bar-private__text_156jy","mobileWrapper":"navigation-bar-private__mobileWrapper_156jy"};
10
10
  require('./index.css')
11
11
 
12
12
  var BackArrowAddon = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 19axe */
1
+ /* hash: xa4w3 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -39,48 +39,48 @@
39
39
 
40
40
  /* back-arrow */
41
41
  --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
42
- } .navigation-bar-private__component_o9ixg {
42
+ } .navigation-bar-private__component_156jy {
43
43
  height: 100%;
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  border-radius: var(--border-radius-pill);
48
48
  min-width: 48px
49
- } .navigation-bar-private__component_o9ixg svg > path {
49
+ } .navigation-bar-private__component_156jy svg > path {
50
50
  transition: fill 0.2s ease;
51
51
  fill: var(--color-light-neutral-translucent-1300);
52
- } .navigation-bar-private__component_o9ixg:hover svg > path {
52
+ } .navigation-bar-private__component_156jy:hover svg > path {
53
53
  fill: var(--color-light-neutral-translucent-1300-hover);
54
- } .navigation-bar-private__component_o9ixg:active svg > path {
54
+ } .navigation-bar-private__component_156jy:active svg > path {
55
55
  fill: var(--color-light-neutral-translucent-1300-press);
56
- } .navigation-bar-private__mobileComponent_o9ixg {
56
+ } .navigation-bar-private__mobileComponent_156jy {
57
57
  height: 32px;
58
58
  min-width: 32px;
59
59
  margin: var(--gap-0) var(--gap-8);
60
60
  -webkit-backdrop-filter: none;
61
61
  backdrop-filter: none;
62
62
  background: none;
63
- } .navigation-bar-private__flex_o9ixg {
63
+ } .navigation-bar-private__flex_156jy {
64
64
  display: flex;
65
65
  align-items: center;
66
- } .navigation-bar-private__iconWrapper_o9ixg {
66
+ } .navigation-bar-private__iconWrapper_156jy {
67
67
  display: inline-flex;
68
68
  align-items: center;
69
69
  justify-content: center;
70
70
  height: 48px;
71
71
  margin: var(--gap-0) var(--gap-8) var(--gap-0) var(--gap-12);
72
72
  border-radius: var(--border-radius-circle)
73
- } .navigation-bar-private__iconWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
73
+ } .navigation-bar-private__iconWrapper_156jy + .navigation-bar-private__text_156jy {
74
74
  margin-right: var(--gap-12);
75
- } .navigation-bar-private__mobileWrapper_o9ixg {
75
+ } .navigation-bar-private__mobileWrapper_156jy {
76
76
  width: 32px;
77
77
  height: 32px;
78
78
  background: var(--color-light-neutral-translucent-100);
79
79
  -webkit-backdrop-filter: blur(10px);
80
80
  backdrop-filter: blur(10px);
81
81
  margin: var(--gap-0)
82
- } .navigation-bar-private__mobileWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
82
+ } .navigation-bar-private__mobileWrapper_156jy + .navigation-bar-private__text_156jy {
83
83
  margin: var(--gap-0) var(--gap-12) var(--gap-0) var(--gap-8);
84
- } .navigation-bar-private__mobileWrapper_o9ixg svg > path {
84
+ } .navigation-bar-private__mobileWrapper_156jy svg > path {
85
85
  fill: var(--navigation-bar-back-arrow-mobile-fill);
86
86
  }
@@ -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-private__closer_bbwgj","button":"navigation-bar-private__button_bbwgj","mobile":"navigation-bar-private__mobile_bbwgj","sticky":"navigation-bar-private__sticky_bbwgj"};
8
+ var styles = {"closer":"navigation-bar-private__closer_196kg","button":"navigation-bar-private__button_196kg","mobile":"navigation-bar-private__mobile_196kg","sticky":"navigation-bar-private__sticky_196kg"};
9
9
  require('./index.css')
10
10
 
11
11
  var Closer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: vbtjq */
1
+ /* hash: 12zho */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -32,7 +32,7 @@
32
32
  --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
33
33
 
34
34
  /* back-arrow */
35
- } .navigation-bar-private__closer_bbwgj {
35
+ } .navigation-bar-private__closer_196kg {
36
36
  flex-shrink: 0;
37
37
  width: 48px;
38
38
  height: 48px;
@@ -40,17 +40,17 @@
40
40
  display: flex;
41
41
  align-items: center;
42
42
  justify-content: center;
43
- } .navigation-bar-private__button_bbwgj {
43
+ } .navigation-bar-private__button_196kg {
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  color: var(--color-light-neutral-translucent-1300)
48
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__mobile_bbwgj {
48
+ } .navigation-bar-private__button_196kg.navigation-bar-private__mobile_196kg {
49
49
  background: var(--color-light-neutral-translucent-100);
50
50
  color: var(--navigation-bar-closer-mobile-color);
51
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__button_bbwgj {
51
+ } .navigation-bar-private__button_196kg.navigation-bar-private__button_196kg {
52
52
  border-radius: var(--border-radius-circle);
53
- } .navigation-bar-private__sticky_bbwgj {
53
+ } .navigation-bar-private__sticky_196kg {
54
54
  position: sticky;
55
55
  top: var(--gap-0);
56
56
  }
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: mivmv */
1
+ /* hash: 6y7fm */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: rgba(3, 3, 6, 0.88);
@@ -28,26 +28,26 @@
28
28
  --gap-12: var(--gap-s);
29
29
  } :root {
30
30
  } :root {
31
- } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_9ony2 {
31
+ } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_17jby {
32
32
  width: 100%;
33
33
  box-sizing: border-box;
34
34
  transition: box-shadow 0.2s ease, background 0.2s ease
35
- } .navigation-bar-private__header_9ony2.navigation-bar-private__header_9ony2.navigation-bar-private__backgroundImage_9ony2 {
35
+ } .navigation-bar-private__header_17jby.navigation-bar-private__header_17jby.navigation-bar-private__backgroundImage_17jby {
36
36
  background-repeat: no-repeat;
37
37
  background-position: center;
38
38
  background-size: cover;
39
- } .navigation-bar-private__mainLine_9ony2 {
39
+ } .navigation-bar-private__mainLine_17jby {
40
40
  display: flex;
41
41
  align-items: stretch;
42
42
  justify-content: space-between;
43
43
  z-index: 1;
44
44
  background-color: inherit;
45
- } .navigation-bar-private__mainLineSticky_9ony2 {
45
+ } .navigation-bar-private__mainLineSticky_17jby {
46
46
  position: sticky;
47
47
  top: var(--gap-0);
48
- } .navigation-bar-private__mainLineWithImageBg_9ony2 {
48
+ } .navigation-bar-private__mainLineWithImageBg_17jby {
49
49
  background-color: initial;
50
- } .navigation-bar-private__content_9ony2 {
50
+ } .navigation-bar-private__content_17jby {
51
51
  color: var(--color-light-text-primary);
52
52
  display: flex;
53
53
  flex-flow: column nowrap;
@@ -56,27 +56,27 @@
56
56
  align-self: baseline;
57
57
  box-sizing: border-box;
58
58
  min-height: 48px
59
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2,
60
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 {
59
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby,
60
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby {
61
61
  font-size: 16px;
62
62
  line-height: 20px;
63
63
  font-weight: 500;
64
64
  align-self: center;
65
65
  padding-top: var(--gap-4);
66
66
  padding-bottom: var(--gap-4)
67
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__children_9ony2,
68
- .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__title_9ony2,
69
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__children_9ony2,
70
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__title_9ony2 {
67
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__children_17jby,
68
+ .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__title_17jby,
69
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__children_17jby,
70
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__title_17jby {
71
71
  -webkit-line-clamp: 1;
72
72
  word-break: break-all;
73
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2 {
73
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotDesktop_17jby.navigation-bar-private__contentOnBotDesktop_17jby {
74
74
  padding-top: var(--gap-12);
75
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotMobile_9ony2.navigation-bar-private__contentOnBotMobile_9ony2 {
75
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotMobile_17jby.navigation-bar-private__contentOnBotMobile_17jby {
76
76
  padding-top: var(--gap-12);
77
- } .navigation-bar-private__title_9ony2 {
77
+ } .navigation-bar-private__title_17jby {
78
78
  word-break: break-word;
79
- } .navigation-bar-private__subtitle_9ony2 {
79
+ } .navigation-bar-private__subtitle_17jby {
80
80
  font-size: 14px;
81
81
  line-height: 20px;
82
82
  font-weight: 400;
@@ -87,11 +87,11 @@
87
87
 
88
88
  color: var(--color-light-text-secondary);
89
89
  word-break: break-all;
90
- } .navigation-bar-private__addonsWrapper_9ony2 {
90
+ } .navigation-bar-private__addonsWrapper_17jby {
91
91
  display: flex;
92
- } .navigation-bar-private__rightAddons_9ony2 {
92
+ } .navigation-bar-private__rightAddons_17jby {
93
93
  margin-left: auto;
94
- } .navigation-bar-private__addon_9ony2 {
94
+ } .navigation-bar-private__addon_17jby {
95
95
  min-width: 48px;
96
96
  height: 48px;
97
97
  display: flex;
@@ -99,18 +99,18 @@
99
99
  align-items: center;
100
100
  flex-shrink: 0;
101
101
  pointer-events: all;
102
- } .navigation-bar-private__bottomAddons_9ony2 {
102
+ } .navigation-bar-private__bottomAddons_17jby {
103
103
  pointer-events: all;
104
- } .navigation-bar-private__closer_9ony2 {
104
+ } .navigation-bar-private__closer_17jby {
105
105
  margin-left: auto;
106
- } .navigation-bar-private__left_9ony2 {
106
+ } .navigation-bar-private__left_17jby {
107
107
  text-align: left;
108
- } .navigation-bar-private__center_9ony2 {
108
+ } .navigation-bar-private__center_17jby {
109
109
  text-align: center;
110
- } .navigation-bar-private__trim_9ony2 {
110
+ } .navigation-bar-private__trim_17jby {
111
111
  overflow: hidden
112
- } .navigation-bar-private__trim_9ony2 .navigation-bar-private__title_9ony2,
113
- .navigation-bar-private__trim_9ony2 .navigation-bar-private__children_9ony2 {
112
+ } .navigation-bar-private__trim_17jby .navigation-bar-private__title_17jby,
113
+ .navigation-bar-private__trim_17jby .navigation-bar-private__children_17jby {
114
114
  -webkit-line-clamp: 2;
115
115
  display: -webkit-box;
116
116
  -webkit-box-orient: vertical;
package/esm/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
5
5
  import { CloserProps } from "./components/closer/index";
6
6
  type NavigationBarPrivateProps = {
@@ -108,6 +108,18 @@ type NavigationBarPrivateProps = {
108
108
  * Ссылка на родительскую ноду overflow: auto
109
109
  */
110
110
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
111
+ /**
112
+ * Data атрибут для компонента
113
+ */
114
+ dataName?: string;
115
+ /**
116
+ * Дополнительный класс для title
117
+ */
118
+ titleClassName?: string;
119
+ /**
120
+ * Ref для title элемента
121
+ */
122
+ titleRef?: RefObject<HTMLDivElement>;
111
123
  };
112
124
  type ContentParams = {
113
125
  extraClassName?: string;
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: mivmv */
1
+ /* hash: 6y7fm */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: rgba(3, 3, 6, 0.88);
@@ -28,26 +28,26 @@
28
28
  --gap-12: var(--gap-s);
29
29
  } :root {
30
30
  } :root {
31
- } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_9ony2 {
31
+ } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_17jby {
32
32
  width: 100%;
33
33
  box-sizing: border-box;
34
34
  transition: box-shadow 0.2s ease, background 0.2s ease
35
- } .navigation-bar-private__header_9ony2.navigation-bar-private__header_9ony2.navigation-bar-private__backgroundImage_9ony2 {
35
+ } .navigation-bar-private__header_17jby.navigation-bar-private__header_17jby.navigation-bar-private__backgroundImage_17jby {
36
36
  background-repeat: no-repeat;
37
37
  background-position: center;
38
38
  background-size: cover;
39
- } .navigation-bar-private__mainLine_9ony2 {
39
+ } .navigation-bar-private__mainLine_17jby {
40
40
  display: flex;
41
41
  align-items: stretch;
42
42
  justify-content: space-between;
43
43
  z-index: 1;
44
44
  background-color: inherit;
45
- } .navigation-bar-private__mainLineSticky_9ony2 {
45
+ } .navigation-bar-private__mainLineSticky_17jby {
46
46
  position: sticky;
47
47
  top: var(--gap-0);
48
- } .navigation-bar-private__mainLineWithImageBg_9ony2 {
48
+ } .navigation-bar-private__mainLineWithImageBg_17jby {
49
49
  background-color: initial;
50
- } .navigation-bar-private__content_9ony2 {
50
+ } .navigation-bar-private__content_17jby {
51
51
  color: var(--color-light-text-primary);
52
52
  display: flex;
53
53
  flex-flow: column nowrap;
@@ -56,27 +56,27 @@
56
56
  align-self: baseline;
57
57
  box-sizing: border-box;
58
58
  min-height: 48px
59
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2,
60
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 {
59
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby,
60
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby {
61
61
  font-size: 16px;
62
62
  line-height: 20px;
63
63
  font-weight: 500;
64
64
  align-self: center;
65
65
  padding-top: var(--gap-4);
66
66
  padding-bottom: var(--gap-4)
67
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__children_9ony2,
68
- .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__title_9ony2,
69
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__children_9ony2,
70
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__title_9ony2 {
67
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__children_17jby,
68
+ .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__title_17jby,
69
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__children_17jby,
70
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__title_17jby {
71
71
  -webkit-line-clamp: 1;
72
72
  word-break: break-all;
73
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2 {
73
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotDesktop_17jby.navigation-bar-private__contentOnBotDesktop_17jby {
74
74
  padding-top: var(--gap-12);
75
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotMobile_9ony2.navigation-bar-private__contentOnBotMobile_9ony2 {
75
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotMobile_17jby.navigation-bar-private__contentOnBotMobile_17jby {
76
76
  padding-top: var(--gap-12);
77
- } .navigation-bar-private__title_9ony2 {
77
+ } .navigation-bar-private__title_17jby {
78
78
  word-break: break-word;
79
- } .navigation-bar-private__subtitle_9ony2 {
79
+ } .navigation-bar-private__subtitle_17jby {
80
80
  font-size: 14px;
81
81
  line-height: 20px;
82
82
  font-weight: 400;
@@ -87,11 +87,11 @@
87
87
 
88
88
  color: var(--color-light-text-secondary);
89
89
  word-break: break-all;
90
- } .navigation-bar-private__addonsWrapper_9ony2 {
90
+ } .navigation-bar-private__addonsWrapper_17jby {
91
91
  display: flex;
92
- } .navigation-bar-private__rightAddons_9ony2 {
92
+ } .navigation-bar-private__rightAddons_17jby {
93
93
  margin-left: auto;
94
- } .navigation-bar-private__addon_9ony2 {
94
+ } .navigation-bar-private__addon_17jby {
95
95
  min-width: 48px;
96
96
  height: 48px;
97
97
  display: flex;
@@ -99,18 +99,18 @@
99
99
  align-items: center;
100
100
  flex-shrink: 0;
101
101
  pointer-events: all;
102
- } .navigation-bar-private__bottomAddons_9ony2 {
102
+ } .navigation-bar-private__bottomAddons_17jby {
103
103
  pointer-events: all;
104
- } .navigation-bar-private__closer_9ony2 {
104
+ } .navigation-bar-private__closer_17jby {
105
105
  margin-left: auto;
106
- } .navigation-bar-private__left_9ony2 {
106
+ } .navigation-bar-private__left_17jby {
107
107
  text-align: left;
108
- } .navigation-bar-private__center_9ony2 {
108
+ } .navigation-bar-private__center_17jby {
109
109
  text-align: center;
110
- } .navigation-bar-private__trim_9ony2 {
110
+ } .navigation-bar-private__trim_17jby {
111
111
  overflow: hidden
112
- } .navigation-bar-private__trim_9ony2 .navigation-bar-private__title_9ony2,
113
- .navigation-bar-private__trim_9ony2 .navigation-bar-private__children_9ony2 {
112
+ } .navigation-bar-private__trim_17jby .navigation-bar-private__title_17jby,
113
+ .navigation-bar-private__trim_17jby .navigation-bar-private__children_17jby {
114
114
  -webkit-line-clamp: 2;
115
115
  display: -webkit-box;
116
116
  -webkit-box-orient: vertical;
@@ -6,12 +6,12 @@ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
6
6
  import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
7
7
  import { Closer } from './components/closer/Component.js';
8
8
 
9
- const styles = {"header":"navigation-bar-private__header_9ony2","backgroundImage":"navigation-bar-private__backgroundImage_9ony2","mainLine":"navigation-bar-private__mainLine_9ony2","mainLineSticky":"navigation-bar-private__mainLineSticky_9ony2","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_9ony2","content":"navigation-bar-private__content_9ony2","withBothAddons":"navigation-bar-private__withBothAddons_9ony2","withCompactTitle":"navigation-bar-private__withCompactTitle_9ony2","children":"navigation-bar-private__children_9ony2","title":"navigation-bar-private__title_9ony2","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_9ony2","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_9ony2","subtitle":"navigation-bar-private__subtitle_9ony2","addonsWrapper":"navigation-bar-private__addonsWrapper_9ony2","rightAddons":"navigation-bar-private__rightAddons_9ony2","addon":"navigation-bar-private__addon_9ony2","bottomAddons":"navigation-bar-private__bottomAddons_9ony2","closer":"navigation-bar-private__closer_9ony2","left":"navigation-bar-private__left_9ony2","center":"navigation-bar-private__center_9ony2","trim":"navigation-bar-private__trim_9ony2"};
9
+ const styles = {"header":"navigation-bar-private__header_17jby","backgroundImage":"navigation-bar-private__backgroundImage_17jby","mainLine":"navigation-bar-private__mainLine_17jby","mainLineSticky":"navigation-bar-private__mainLineSticky_17jby","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_17jby","content":"navigation-bar-private__content_17jby","withBothAddons":"navigation-bar-private__withBothAddons_17jby","withCompactTitle":"navigation-bar-private__withCompactTitle_17jby","children":"navigation-bar-private__children_17jby","title":"navigation-bar-private__title_17jby","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_17jby","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_17jby","subtitle":"navigation-bar-private__subtitle_17jby","addonsWrapper":"navigation-bar-private__addonsWrapper_17jby","rightAddons":"navigation-bar-private__rightAddons_17jby","addon":"navigation-bar-private__addon_17jby","bottomAddons":"navigation-bar-private__bottomAddons_17jby","closer":"navigation-bar-private__closer_17jby","left":"navigation-bar-private__left_17jby","center":"navigation-bar-private__center_17jby","trim":"navigation-bar-private__trim_17jby"};
10
10
  require('./index.css')
11
11
 
12
12
  /* eslint-disable complexity */
13
13
  const ADDONS_HEIGHT = 48;
14
- const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentClassName, closerClassName, leftAddons, rightAddons, bottomAddons, bottomAddonsClassName, children, align = 'left', trim = true, title, titleSize = 'default', subtitle, hasCloser, hasBackButton, backButtonClassName, backButtonProps, dataTestId, imageUrl, closerIcon, onClose, view, scrollableParentRef, sticky, onBack, }, ref) => {
14
+ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentClassName, closerClassName, leftAddons, rightAddons, bottomAddons, bottomAddonsClassName, children, align = 'left', trim = true, title, titleSize = 'default', subtitle, hasCloser, hasBackButton, backButtonClassName, backButtonProps, dataTestId, imageUrl, closerIcon, onClose, view, scrollableParentRef, sticky, onBack, dataName, titleClassName, titleRef, }, ref) => {
15
15
  const [scrollTop, setScrollTop] = useState(0);
16
16
  const [titleMargin, setTitleMargin] = useState({ left: 0, right: 0 });
17
17
  const bottomContentRef = useRef(null);
@@ -87,8 +87,8 @@ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentCla
87
87
  [styles.withCompactTitle]: view === 'mobile' && compactTitle && hasContent,
88
88
  }), "aria-hidden": hidden },
89
89
  children && React.createElement("div", { className: styles.children }, children),
90
- title && (React.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
91
- compactTitle && subtitle && React.createElement("div", { className: styles.subtitle }, subtitle)));
90
+ title && (React.createElement("div", { className: cn(styles.title, titleClassName), "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title'), ref: titleRef }, title)),
91
+ compactTitle && subtitle && (React.createElement("div", { className: styles.subtitle, "data-test-id": getDataTestId(dataTestId, 'subtitle') }, subtitle))));
92
92
  };
93
93
  const renderCloser = () => (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
94
94
  React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose })));
@@ -98,7 +98,7 @@ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentCla
98
98
  bottomContentRef.current && {
99
99
  top: -bottomContentRef.current.scrollHeight,
100
100
  }),
101
- } },
101
+ }, "data-name": dataName },
102
102
  React.createElement("div", { className: cn(styles.mainLine, {
103
103
  [styles.mainLineSticky]: withAnimation,
104
104
  [styles.mainLineWithImageBg]: imageUrl,
@@ -5,7 +5,7 @@ import { Text } 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-private__component_o9ixg","mobileComponent":"navigation-bar-private__mobileComponent_o9ixg","flex":"navigation-bar-private__flex_o9ixg","iconWrapper":"navigation-bar-private__iconWrapper_o9ixg","text":"navigation-bar-private__text_o9ixg","mobileWrapper":"navigation-bar-private__mobileWrapper_o9ixg"};
8
+ const styles = {"component":"navigation-bar-private__component_156jy","mobileComponent":"navigation-bar-private__mobileComponent_156jy","flex":"navigation-bar-private__flex_156jy","iconWrapper":"navigation-bar-private__iconWrapper_156jy","text":"navigation-bar-private__text_156jy","mobileWrapper":"navigation-bar-private__mobileWrapper_156jy"};
9
9
  require('./index.css')
10
10
 
11
11
  const BackArrowAddon = ({ text = 'Назад', onClick, className, textOpacity = 1, view, ...htmlAttributes }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 19axe */
1
+ /* hash: xa4w3 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -39,48 +39,48 @@
39
39
 
40
40
  /* back-arrow */
41
41
  --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
42
- } .navigation-bar-private__component_o9ixg {
42
+ } .navigation-bar-private__component_156jy {
43
43
  height: 100%;
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  border-radius: var(--border-radius-pill);
48
48
  min-width: 48px
49
- } .navigation-bar-private__component_o9ixg svg > path {
49
+ } .navigation-bar-private__component_156jy svg > path {
50
50
  transition: fill 0.2s ease;
51
51
  fill: var(--color-light-neutral-translucent-1300);
52
- } .navigation-bar-private__component_o9ixg:hover svg > path {
52
+ } .navigation-bar-private__component_156jy:hover svg > path {
53
53
  fill: var(--color-light-neutral-translucent-1300-hover);
54
- } .navigation-bar-private__component_o9ixg:active svg > path {
54
+ } .navigation-bar-private__component_156jy:active svg > path {
55
55
  fill: var(--color-light-neutral-translucent-1300-press);
56
- } .navigation-bar-private__mobileComponent_o9ixg {
56
+ } .navigation-bar-private__mobileComponent_156jy {
57
57
  height: 32px;
58
58
  min-width: 32px;
59
59
  margin: var(--gap-0) var(--gap-8);
60
60
  -webkit-backdrop-filter: none;
61
61
  backdrop-filter: none;
62
62
  background: none;
63
- } .navigation-bar-private__flex_o9ixg {
63
+ } .navigation-bar-private__flex_156jy {
64
64
  display: flex;
65
65
  align-items: center;
66
- } .navigation-bar-private__iconWrapper_o9ixg {
66
+ } .navigation-bar-private__iconWrapper_156jy {
67
67
  display: inline-flex;
68
68
  align-items: center;
69
69
  justify-content: center;
70
70
  height: 48px;
71
71
  margin: var(--gap-0) var(--gap-8) var(--gap-0) var(--gap-12);
72
72
  border-radius: var(--border-radius-circle)
73
- } .navigation-bar-private__iconWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
73
+ } .navigation-bar-private__iconWrapper_156jy + .navigation-bar-private__text_156jy {
74
74
  margin-right: var(--gap-12);
75
- } .navigation-bar-private__mobileWrapper_o9ixg {
75
+ } .navigation-bar-private__mobileWrapper_156jy {
76
76
  width: 32px;
77
77
  height: 32px;
78
78
  background: var(--color-light-neutral-translucent-100);
79
79
  -webkit-backdrop-filter: blur(10px);
80
80
  backdrop-filter: blur(10px);
81
81
  margin: var(--gap-0)
82
- } .navigation-bar-private__mobileWrapper_o9ixg + .navigation-bar-private__text_o9ixg {
82
+ } .navigation-bar-private__mobileWrapper_156jy + .navigation-bar-private__text_156jy {
83
83
  margin: var(--gap-0) var(--gap-12) var(--gap-0) var(--gap-8);
84
- } .navigation-bar-private__mobileWrapper_o9ixg svg > path {
84
+ } .navigation-bar-private__mobileWrapper_156jy svg > path {
85
85
  fill: var(--navigation-bar-back-arrow-mobile-fill);
86
86
  }
@@ -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-private__closer_bbwgj","button":"navigation-bar-private__button_bbwgj","mobile":"navigation-bar-private__mobile_bbwgj","sticky":"navigation-bar-private__sticky_bbwgj"};
7
+ const styles = {"closer":"navigation-bar-private__closer_196kg","button":"navigation-bar-private__button_196kg","mobile":"navigation-bar-private__mobile_196kg","sticky":"navigation-bar-private__sticky_196kg"};
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: vbtjq */
1
+ /* hash: 12zho */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
@@ -32,7 +32,7 @@
32
32
  --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
33
33
 
34
34
  /* back-arrow */
35
- } .navigation-bar-private__closer_bbwgj {
35
+ } .navigation-bar-private__closer_196kg {
36
36
  flex-shrink: 0;
37
37
  width: 48px;
38
38
  height: 48px;
@@ -40,17 +40,17 @@
40
40
  display: flex;
41
41
  align-items: center;
42
42
  justify-content: center;
43
- } .navigation-bar-private__button_bbwgj {
43
+ } .navigation-bar-private__button_196kg {
44
44
  background: var(--color-light-bg-primary-alpha-40);
45
45
  -webkit-backdrop-filter: blur(10px);
46
46
  backdrop-filter: blur(10px);
47
47
  color: var(--color-light-neutral-translucent-1300)
48
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__mobile_bbwgj {
48
+ } .navigation-bar-private__button_196kg.navigation-bar-private__mobile_196kg {
49
49
  background: var(--color-light-neutral-translucent-100);
50
50
  color: var(--navigation-bar-closer-mobile-color);
51
- } .navigation-bar-private__button_bbwgj.navigation-bar-private__button_bbwgj {
51
+ } .navigation-bar-private__button_196kg.navigation-bar-private__button_196kg {
52
52
  border-radius: var(--border-radius-circle);
53
- } .navigation-bar-private__sticky_bbwgj {
53
+ } .navigation-bar-private__sticky_196kg {
54
54
  position: sticky;
55
55
  top: var(--gap-0);
56
56
  }
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: mivmv */
1
+ /* hash: 6y7fm */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: rgba(3, 3, 6, 0.88);
@@ -28,26 +28,26 @@
28
28
  --gap-12: var(--gap-s);
29
29
  } :root {
30
30
  } :root {
31
- } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_9ony2 {
31
+ } /* сбрасывает синюю подсветку при нажатии */ .navigation-bar-private__header_17jby {
32
32
  width: 100%;
33
33
  box-sizing: border-box;
34
34
  transition: box-shadow 0.2s ease, background 0.2s ease
35
- } .navigation-bar-private__header_9ony2.navigation-bar-private__header_9ony2.navigation-bar-private__backgroundImage_9ony2 {
35
+ } .navigation-bar-private__header_17jby.navigation-bar-private__header_17jby.navigation-bar-private__backgroundImage_17jby {
36
36
  background-repeat: no-repeat;
37
37
  background-position: center;
38
38
  background-size: cover;
39
- } .navigation-bar-private__mainLine_9ony2 {
39
+ } .navigation-bar-private__mainLine_17jby {
40
40
  display: flex;
41
41
  align-items: stretch;
42
42
  justify-content: space-between;
43
43
  z-index: 1;
44
44
  background-color: inherit;
45
- } .navigation-bar-private__mainLineSticky_9ony2 {
45
+ } .navigation-bar-private__mainLineSticky_17jby {
46
46
  position: sticky;
47
47
  top: var(--gap-0);
48
- } .navigation-bar-private__mainLineWithImageBg_9ony2 {
48
+ } .navigation-bar-private__mainLineWithImageBg_17jby {
49
49
  background-color: initial;
50
- } .navigation-bar-private__content_9ony2 {
50
+ } .navigation-bar-private__content_17jby {
51
51
  color: var(--color-light-text-primary);
52
52
  display: flex;
53
53
  flex-flow: column nowrap;
@@ -56,27 +56,27 @@
56
56
  align-self: baseline;
57
57
  box-sizing: border-box;
58
58
  min-height: 48px
59
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2,
60
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 {
59
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby,
60
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby {
61
61
  font-size: 16px;
62
62
  line-height: 20px;
63
63
  font-weight: 500;
64
64
  align-self: center;
65
65
  padding-top: var(--gap-4);
66
66
  padding-bottom: var(--gap-4)
67
- } .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__children_9ony2,
68
- .navigation-bar-private__content_9ony2.navigation-bar-private__withBothAddons_9ony2 > .navigation-bar-private__title_9ony2,
69
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__children_9ony2,
70
- .navigation-bar-private__content_9ony2.navigation-bar-private__withCompactTitle_9ony2 > .navigation-bar-private__title_9ony2 {
67
+ } .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__children_17jby,
68
+ .navigation-bar-private__content_17jby.navigation-bar-private__withBothAddons_17jby > .navigation-bar-private__title_17jby,
69
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__children_17jby,
70
+ .navigation-bar-private__content_17jby.navigation-bar-private__withCompactTitle_17jby > .navigation-bar-private__title_17jby {
71
71
  -webkit-line-clamp: 1;
72
72
  word-break: break-all;
73
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2.navigation-bar-private__contentOnBotDesktop_9ony2 {
73
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotDesktop_17jby.navigation-bar-private__contentOnBotDesktop_17jby {
74
74
  padding-top: var(--gap-12);
75
- } .navigation-bar-private__content_9ony2.navigation-bar-private__contentOnBotMobile_9ony2.navigation-bar-private__contentOnBotMobile_9ony2 {
75
+ } .navigation-bar-private__content_17jby.navigation-bar-private__contentOnBotMobile_17jby.navigation-bar-private__contentOnBotMobile_17jby {
76
76
  padding-top: var(--gap-12);
77
- } .navigation-bar-private__title_9ony2 {
77
+ } .navigation-bar-private__title_17jby {
78
78
  word-break: break-word;
79
- } .navigation-bar-private__subtitle_9ony2 {
79
+ } .navigation-bar-private__subtitle_17jby {
80
80
  font-size: 14px;
81
81
  line-height: 20px;
82
82
  font-weight: 400;
@@ -87,11 +87,11 @@
87
87
 
88
88
  color: var(--color-light-text-secondary);
89
89
  word-break: break-all;
90
- } .navigation-bar-private__addonsWrapper_9ony2 {
90
+ } .navigation-bar-private__addonsWrapper_17jby {
91
91
  display: flex;
92
- } .navigation-bar-private__rightAddons_9ony2 {
92
+ } .navigation-bar-private__rightAddons_17jby {
93
93
  margin-left: auto;
94
- } .navigation-bar-private__addon_9ony2 {
94
+ } .navigation-bar-private__addon_17jby {
95
95
  min-width: 48px;
96
96
  height: 48px;
97
97
  display: flex;
@@ -99,18 +99,18 @@
99
99
  align-items: center;
100
100
  flex-shrink: 0;
101
101
  pointer-events: all;
102
- } .navigation-bar-private__bottomAddons_9ony2 {
102
+ } .navigation-bar-private__bottomAddons_17jby {
103
103
  pointer-events: all;
104
- } .navigation-bar-private__closer_9ony2 {
104
+ } .navigation-bar-private__closer_17jby {
105
105
  margin-left: auto;
106
- } .navigation-bar-private__left_9ony2 {
106
+ } .navigation-bar-private__left_17jby {
107
107
  text-align: left;
108
- } .navigation-bar-private__center_9ony2 {
108
+ } .navigation-bar-private__center_17jby {
109
109
  text-align: center;
110
- } .navigation-bar-private__trim_9ony2 {
110
+ } .navigation-bar-private__trim_17jby {
111
111
  overflow: hidden
112
- } .navigation-bar-private__trim_9ony2 .navigation-bar-private__title_9ony2,
113
- .navigation-bar-private__trim_9ony2 .navigation-bar-private__children_9ony2 {
112
+ } .navigation-bar-private__trim_17jby .navigation-bar-private__title_17jby,
113
+ .navigation-bar-private__trim_17jby .navigation-bar-private__children_17jby {
114
114
  -webkit-line-clamp: 2;
115
115
  display: -webkit-box;
116
116
  -webkit-box-orient: vertical;
package/modern/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
5
5
  import { CloserProps } from "./components/closer/index";
6
6
  type NavigationBarPrivateProps = {
@@ -108,6 +108,18 @@ type NavigationBarPrivateProps = {
108
108
  * Ссылка на родительскую ноду overflow: auto
109
109
  */
110
110
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
111
+ /**
112
+ * Data атрибут для компонента
113
+ */
114
+ dataName?: string;
115
+ /**
116
+ * Дополнительный класс для title
117
+ */
118
+ titleClassName?: string;
119
+ /**
120
+ * Ref для title элемента
121
+ */
122
+ titleRef?: RefObject<HTMLDivElement>;
111
123
  };
112
124
  type ContentParams = {
113
125
  extraClassName?: string;
@@ -9,7 +9,7 @@ import styles from './index.module.css';
9
9
 
10
10
  /* eslint-disable complexity */
11
11
  const ADDONS_HEIGHT = 48;
12
- const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentClassName, closerClassName, leftAddons, rightAddons, bottomAddons, bottomAddonsClassName, children, align = 'left', trim = true, title, titleSize = 'default', subtitle, hasCloser, hasBackButton, backButtonClassName, backButtonProps, dataTestId, imageUrl, closerIcon, onClose, view, scrollableParentRef, sticky, onBack, }, ref) => {
12
+ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentClassName, closerClassName, leftAddons, rightAddons, bottomAddons, bottomAddonsClassName, children, align = 'left', trim = true, title, titleSize = 'default', subtitle, hasCloser, hasBackButton, backButtonClassName, backButtonProps, dataTestId, imageUrl, closerIcon, onClose, view, scrollableParentRef, sticky, onBack, dataName, titleClassName, titleRef, }, ref) => {
13
13
  const [scrollTop, setScrollTop] = useState(0);
14
14
  const [titleMargin, setTitleMargin] = useState({ left: 0, right: 0 });
15
15
  const bottomContentRef = useRef(null);
@@ -85,8 +85,8 @@ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentCla
85
85
  [styles.withCompactTitle]: view === 'mobile' && compactTitle && hasContent,
86
86
  }), "aria-hidden": hidden },
87
87
  children && React.createElement("div", { className: styles.children }, children),
88
- title && (React.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
89
- compactTitle && subtitle && React.createElement("div", { className: styles.subtitle }, subtitle)));
88
+ title && (React.createElement("div", { className: cn(styles.title, titleClassName), "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title'), ref: titleRef }, title)),
89
+ compactTitle && subtitle && (React.createElement("div", { className: styles.subtitle, "data-test-id": getDataTestId(dataTestId, 'subtitle') }, subtitle))));
90
90
  };
91
91
  const renderCloser = () => (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
92
92
  React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose })));
@@ -96,7 +96,7 @@ const NavigationBarPrivate = forwardRef(({ addonClassName, className, contentCla
96
96
  bottomContentRef.current && {
97
97
  top: -bottomContentRef.current.scrollHeight,
98
98
  }),
99
- } },
99
+ }, "data-name": dataName },
100
100
  React.createElement("div", { className: cn(styles.mainLine, {
101
101
  [styles.mainLineSticky]: withAnimation,
102
102
  [styles.mainLineWithImageBg]: imageUrl,
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
5
5
  import { CloserProps } from "./components/closer/index";
6
6
  type NavigationBarPrivateProps = {
@@ -108,6 +108,18 @@ type NavigationBarPrivateProps = {
108
108
  * Ссылка на родительскую ноду overflow: auto
109
109
  */
110
110
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
111
+ /**
112
+ * Data атрибут для компонента
113
+ */
114
+ dataName?: string;
115
+ /**
116
+ * Дополнительный класс для title
117
+ */
118
+ titleClassName?: string;
119
+ /**
120
+ * Ref для title элемента
121
+ */
122
+ titleRef?: RefObject<HTMLDivElement>;
111
123
  };
112
124
  type ContentParams = {
113
125
  extraClassName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-navigation-bar-private",
3
- "version": "0.5.8",
3
+ "version": "0.6.0",
4
4
  "description": "Navigation bar private component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -12,10 +12,10 @@
12
12
  },
13
13
  "sideEffects": false,
14
14
  "dependencies": {
15
- "@alfalab/core-components-icon-button": "^6.11.7",
16
- "@alfalab/core-components-button": "^11.11.4",
15
+ "@alfalab/core-components-icon-button": "^6.11.8",
16
+ "@alfalab/core-components-button": "^11.11.5",
17
17
  "@alfalab/core-components-typography": "^4.11.4",
18
- "@alfalab/core-components-shared": "^0.15.0",
18
+ "@alfalab/core-components-shared": "^0.16.0",
19
19
  "@alfalab/hooks": "^1.13.1",
20
20
  "@alfalab/icons-glyph": "^2.210.0",
21
21
  "classnames": "^2.5.1",
@@ -25,6 +25,6 @@
25
25
  "peerDependencies": {
26
26
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
27
27
  },
28
- "themesVersion": "13.7.0",
28
+ "themesVersion": "13.7.1",
29
29
  "varsVersion": "9.18.0"
30
30
  }
package/src/Component.tsx CHANGED
@@ -43,6 +43,9 @@ export const NavigationBarPrivate = forwardRef<HTMLDivElement, NavigationBarPriv
43
43
  scrollableParentRef,
44
44
  sticky,
45
45
  onBack,
46
+ dataName,
47
+ titleClassName,
48
+ titleRef,
46
49
  },
47
50
  ref,
48
51
  ) => {
@@ -157,13 +160,21 @@ export const NavigationBarPrivate = forwardRef<HTMLDivElement, NavigationBarPriv
157
160
  {children && <div className={styles.children}>{children}</div>}
158
161
  {title && (
159
162
  <div
160
- className={styles.title}
163
+ className={cn(styles.title, titleClassName)}
161
164
  data-test-id={hidden ? undefined : getDataTestId(dataTestId, 'title')}
165
+ ref={titleRef}
162
166
  >
163
167
  {title}
164
168
  </div>
165
169
  )}
166
- {compactTitle && subtitle && <div className={styles.subtitle}>{subtitle}</div>}
170
+ {compactTitle && subtitle && (
171
+ <div
172
+ className={styles.subtitle}
173
+ data-test-id={getDataTestId(dataTestId, 'subtitle')}
174
+ >
175
+ {subtitle}
176
+ </div>
177
+ )}
167
178
  </div>
168
179
  );
169
180
  };
@@ -191,6 +202,7 @@ export const NavigationBarPrivate = forwardRef<HTMLDivElement, NavigationBarPriv
191
202
  top: -bottomContentRef.current.scrollHeight,
192
203
  }),
193
204
  }}
205
+ data-name={dataName}
194
206
  >
195
207
  <div
196
208
  className={cn(styles.mainLine, {
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React, { ReactNode, RefObject } from 'react';
2
2
 
3
3
  import { BackArrowAddonProps } from './components/back-arrow-addon';
4
4
  import type { CloserProps } from './components/closer';
@@ -133,6 +133,21 @@ export type NavigationBarPrivateProps = {
133
133
  * Ссылка на родительскую ноду overflow: auto
134
134
  */
135
135
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
136
+
137
+ /**
138
+ * Data атрибут для компонента
139
+ */
140
+ dataName?: string;
141
+
142
+ /**
143
+ * Дополнительный класс для title
144
+ */
145
+ titleClassName?: string;
146
+
147
+ /**
148
+ * Ref для title элемента
149
+ */
150
+ titleRef?: RefObject<HTMLDivElement>;
136
151
  };
137
152
 
138
153
  export type ContentParams = {
package/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
- import { ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  import { BackArrowAddonProps } from "./components/back-arrow-addon/index";
5
5
  import { CloserProps } from "./components/closer/index";
6
6
  type NavigationBarPrivateProps = {
@@ -108,6 +108,18 @@ type NavigationBarPrivateProps = {
108
108
  * Ссылка на родительскую ноду overflow: auto
109
109
  */
110
110
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
111
+ /**
112
+ * Data атрибут для компонента
113
+ */
114
+ dataName?: string;
115
+ /**
116
+ * Дополнительный класс для title
117
+ */
118
+ titleClassName?: string;
119
+ /**
120
+ * Ref для title элемента
121
+ */
122
+ titleRef?: RefObject<HTMLDivElement>;
111
123
  };
112
124
  type ContentParams = {
113
125
  extraClassName?: string;