@alfalab/core-components-navigation-bar 0.1.2 → 0.2.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.
Files changed (41) hide show
  1. package/Component.d.ts +3 -2
  2. package/Component.js +18 -9
  3. package/components/back-arrow-addon/Component.js +3 -1
  4. package/components/back-arrow-addon/index.css +18 -18
  5. package/components/back-arrow-addon/index.js +2 -0
  6. package/components/closer/Component.js +3 -1
  7. package/components/closer/index.css +9 -9
  8. package/components/closer/index.js +2 -0
  9. package/cssm/Component.d.ts +3 -2
  10. package/cssm/Component.js +17 -8
  11. package/cssm/components/back-arrow-addon/Component.js +2 -0
  12. package/cssm/components/back-arrow-addon/index.js +2 -0
  13. package/cssm/components/back-arrow-addon/index.module.css +6 -6
  14. package/cssm/components/closer/Component.js +2 -0
  15. package/cssm/components/closer/index.js +2 -0
  16. package/cssm/components/closer/index.module.css +4 -4
  17. package/cssm/index.js +3 -0
  18. package/cssm/index.module.css +3 -3
  19. package/cssm/types.d.ts +1 -1
  20. package/esm/Component.d.ts +3 -2
  21. package/esm/Component.js +16 -10
  22. package/esm/components/back-arrow-addon/Component.js +1 -1
  23. package/esm/components/back-arrow-addon/index.css +18 -18
  24. package/esm/components/closer/Component.js +1 -1
  25. package/esm/components/closer/index.css +9 -9
  26. package/esm/index.css +30 -30
  27. package/esm/index.js +1 -0
  28. package/esm/types.d.ts +1 -1
  29. package/index.css +30 -30
  30. package/index.js +3 -0
  31. package/modern/Component.d.ts +3 -2
  32. package/modern/Component.js +16 -10
  33. package/modern/components/back-arrow-addon/Component.js +1 -1
  34. package/modern/components/back-arrow-addon/index.css +18 -18
  35. package/modern/components/closer/Component.js +1 -1
  36. package/modern/components/closer/index.css +9 -9
  37. package/modern/index.css +30 -30
  38. package/modern/index.js +1 -0
  39. package/modern/types.d.ts +1 -1
  40. package/package.json +4 -4
  41. package/types.d.ts +1 -1
@@ -1,13 +1,13 @@
1
- /* hash: 27iuz */
1
+ /* hash: 7mmij */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-graphic-primary: #0b1f35;
5
- --color-light-graphic-secondary: #6d7986;
6
- --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05);
4
+ --color-light-graphic-primary: #0e0e0e;
5
+ --color-light-graphic-secondary: #86868a;
6
+ --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
7
  --color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
8
- --color-light-graphic-primary-tint-20: rgb(60, 76, 93);
9
- --color-light-graphic-primary-tint-30: rgb(84, 98, 114);
10
- } :root {
8
+ --color-light-graphic-primary-tint-20: rgb(62, 62, 62);
9
+ --color-light-graphic-primary-tint-30: rgb(86, 86, 86);
10
+ } :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 */
11
11
  } :root {
12
12
  } :root {
13
13
 
@@ -24,46 +24,46 @@
24
24
  --gap-s: 12px;
25
25
  } :root {
26
26
  } :root {
27
- } .navigation-bar__component_swc35 {
27
+ } .navigation-bar__component_1lkkr {
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_swc35 svg > path {
33
+ } .navigation-bar__component_1lkkr svg > path {
34
34
  transition: fill 0.2s ease;
35
35
  fill: var(--color-light-graphic-primary);
36
- } .navigation-bar__component_swc35:hover svg > path {
36
+ } .navigation-bar__component_1lkkr:hover svg > path {
37
37
  fill: var(--color-light-graphic-primary-tint-20);
38
- } .navigation-bar__component_swc35:active svg > path {
38
+ } .navigation-bar__component_1lkkr:active svg > path {
39
39
  fill: var(--color-light-graphic-primary-tint-30);
40
- } .navigation-bar__mobileComponent_swc35 {
40
+ } .navigation-bar__mobileComponent_1lkkr {
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_swc35 {
46
+ } .navigation-bar__flex_1lkkr {
47
47
  display: flex;
48
48
  align-items: center;
49
- } .navigation-bar__iconWrapper_swc35 {
49
+ } .navigation-bar__iconWrapper_1lkkr {
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_swc35 + .navigation-bar__text_swc35 {
56
+ } .navigation-bar__iconWrapper_1lkkr + .navigation-bar__text_1lkkr {
57
57
  margin-right: var(--gap-s);
58
- } .navigation-bar__mobileWrapper_swc35 {
58
+ } .navigation-bar__mobileWrapper_1lkkr {
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_swc35 + .navigation-bar__text_swc35 {
65
+ } .navigation-bar__mobileWrapper_1lkkr + .navigation-bar__text_1lkkr {
66
66
  margin: 0 var(--gap-s) 0 var(--gap-xs);
67
- } .navigation-bar__mobileWrapper_swc35 svg > path {
67
+ } .navigation-bar__mobileWrapper_1lkkr 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_kmb9l","button":"navigation-bar__button_kmb9l","mobile":"navigation-bar__mobile_kmb9l","sticky":"navigation-bar__sticky_kmb9l"};
8
+ var styles = {"closer":"navigation-bar__closer_ylt19","button":"navigation-bar__button_ylt19","mobile":"navigation-bar__mobile_ylt19","sticky":"navigation-bar__sticky_ylt19"};
9
9
  require('./index.css')
10
10
 
11
11
  var Closer = function (_a) {
@@ -1,11 +1,11 @@
1
- /* hash: 1lpkd */
1
+ /* hash: fjemv */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-graphic-primary: #0b1f35;
5
- --color-light-graphic-secondary: #6d7986;
6
- --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05);
4
+ --color-light-graphic-primary: #0e0e0e;
5
+ --color-light-graphic-secondary: #86868a;
6
+ --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
7
  --color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
8
- } :root {
8
+ } :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 */
9
9
  } :root {
10
10
  } :root {
11
11
 
@@ -18,7 +18,7 @@
18
18
  } :root {
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__closer_kmb9l {
21
+ } .navigation-bar__closer_ylt19 {
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_kmb9l {
29
+ } .navigation-bar__button_ylt19 {
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_kmb9l.navigation-bar__mobile_kmb9l {
35
+ } .navigation-bar__button_ylt19.navigation-bar__mobile_ylt19 {
36
36
  background: var(--color-light-specialbg-secondary-transparent);
37
37
  color: var(--color-light-graphic-secondary);
38
- } .navigation-bar__sticky_kmb9l {
38
+ } .navigation-bar__sticky_ylt19 {
39
39
  position: sticky;
40
40
  top: 0;
41
41
  }
package/esm/index.css CHANGED
@@ -1,9 +1,9 @@
1
- /* hash: zc64y */
1
+ /* hash: 1s74g */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-text-primary: #0b1f35;
5
- --color-light-text-secondary: rgba(11, 31, 53, 0.7);
6
- } :root {
4
+ --color-light-text-primary: #0e0e0e;
5
+ --color-light-text-secondary: rgba(60, 60, 67, 0.66); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :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 */
7
7
  } :root {
8
8
  } :root {
9
9
 
@@ -18,26 +18,26 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__header_5ow3j {
21
+ } .navigation-bar__header_1p62k {
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_5ow3j.navigation-bar__header_5ow3j.navigation-bar__backgroundImage_5ow3j {
25
+ } .navigation-bar__header_1p62k.navigation-bar__header_1p62k.navigation-bar__backgroundImage_1p62k {
26
26
  background-repeat: no-repeat;
27
27
  background-position: center;
28
28
  background-size: cover;
29
- } .navigation-bar__mainLine_5ow3j {
29
+ } .navigation-bar__mainLine_1p62k {
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_5ow3j {
35
+ } .navigation-bar__mainLineSticky_1p62k {
36
36
  position: sticky;
37
37
  top: 0;
38
- } .navigation-bar__mainLineWithImageBg_5ow3j {
38
+ } .navigation-bar__mainLineWithImageBg_1p62k {
39
39
  background-color: initial;
40
- } .navigation-bar__content_5ow3j {
40
+ } .navigation-bar__content_1p62k {
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_5ow3j.navigation-bar__withBothAddons_5ow3j,
50
- .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j {
49
+ } .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k,
50
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k {
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_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 {
57
+ } .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k > .navigation-bar__children_1p62k,
58
+ .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k > .navigation-bar__title_1p62k,
59
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k > .navigation-bar__children_1p62k,
60
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k > .navigation-bar__title_1p62k {
61
61
  -webkit-line-clamp: 1;
62
62
  word-break: break-all;
63
- } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j {
63
+ } .navigation-bar__content_1p62k.navigation-bar__contentOnBotDesktop_1p62k.navigation-bar__contentOnBotDesktop_1p62k {
64
64
  padding-top: var(--gap-s);
65
- } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotMobile_5ow3j.navigation-bar__contentOnBotMobile_5ow3j {
65
+ } .navigation-bar__content_1p62k.navigation-bar__contentOnBotMobile_1p62k.navigation-bar__contentOnBotMobile_1p62k {
66
66
  padding-top: var(--gap-s);
67
- } .navigation-bar__title_5ow3j {
67
+ } .navigation-bar__title_1p62k {
68
68
  word-break: break-word;
69
- } .navigation-bar__subtitle_5ow3j {
69
+ } .navigation-bar__subtitle_1p62k {
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_5ow3j {
80
+ } .navigation-bar__addonsWrapper_1p62k {
81
81
  display: flex;
82
- } .navigation-bar__rightAddons_5ow3j {
82
+ } .navigation-bar__rightAddons_1p62k {
83
83
  margin-left: auto;
84
- } .navigation-bar__addon_5ow3j {
84
+ } .navigation-bar__addon_1p62k {
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_5ow3j {
92
+ } .navigation-bar__bottomAddons_1p62k {
93
93
  pointer-events: all;
94
- } .navigation-bar__closer_5ow3j {
94
+ } .navigation-bar__closer_1p62k {
95
95
  margin-left: auto;
96
- } .navigation-bar__left_5ow3j {
96
+ } .navigation-bar__left_1p62k {
97
97
  text-align: left;
98
- } .navigation-bar__center_5ow3j {
98
+ } .navigation-bar__center_1p62k {
99
99
  text-align: center;
100
- } .navigation-bar__trim_5ow3j {
100
+ } .navigation-bar__trim_1p62k {
101
101
  overflow: hidden
102
- } .navigation-bar__trim_5ow3j .navigation-bar__title_5ow3j,
103
- .navigation-bar__trim_5ow3j .navigation-bar__children_5ow3j {
102
+ } .navigation-bar__trim_1p62k .navigation-bar__title_1p62k,
103
+ .navigation-bar__trim_1p62k .navigation-bar__children_1p62k {
104
104
  -webkit-line-clamp: 2;
105
105
  display: -webkit-box;
106
106
  -webkit-box-orient: vertical;
package/esm/index.js CHANGED
@@ -2,6 +2,7 @@ export { NavigationBar } from './Component.js';
2
2
  export { Closer } from './components/closer/Component.js';
3
3
  import 'tslib';
4
4
  import 'react';
5
+ import 'react-merge-refs';
5
6
  import 'classnames';
6
7
  import '@alfalab/hooks';
7
8
  import './components/back-arrow-addon/Component.js';
package/esm/types.d.ts CHANGED
@@ -106,7 +106,7 @@ type NavigationBarProps = {
106
106
  };
107
107
  type ContentParams = {
108
108
  extraClassName?: string;
109
- ref?: React.RefObject<HTMLDivElement>;
109
+ wrapperRef?: React.RefObject<HTMLDivElement>;
110
110
  style?: React.CSSProperties;
111
111
  hidden?: boolean;
112
112
  };
package/index.css CHANGED
@@ -1,9 +1,9 @@
1
- /* hash: zc64y */
1
+ /* hash: 1s74g */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-text-primary: #0b1f35;
5
- --color-light-text-secondary: rgba(11, 31, 53, 0.7);
6
- } :root {
4
+ --color-light-text-primary: #0e0e0e;
5
+ --color-light-text-secondary: rgba(60, 60, 67, 0.66); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :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 */
7
7
  } :root {
8
8
  } :root {
9
9
 
@@ -18,26 +18,26 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .navigation-bar__header_5ow3j {
21
+ } .navigation-bar__header_1p62k {
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_5ow3j.navigation-bar__header_5ow3j.navigation-bar__backgroundImage_5ow3j {
25
+ } .navigation-bar__header_1p62k.navigation-bar__header_1p62k.navigation-bar__backgroundImage_1p62k {
26
26
  background-repeat: no-repeat;
27
27
  background-position: center;
28
28
  background-size: cover;
29
- } .navigation-bar__mainLine_5ow3j {
29
+ } .navigation-bar__mainLine_1p62k {
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_5ow3j {
35
+ } .navigation-bar__mainLineSticky_1p62k {
36
36
  position: sticky;
37
37
  top: 0;
38
- } .navigation-bar__mainLineWithImageBg_5ow3j {
38
+ } .navigation-bar__mainLineWithImageBg_1p62k {
39
39
  background-color: initial;
40
- } .navigation-bar__content_5ow3j {
40
+ } .navigation-bar__content_1p62k {
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_5ow3j.navigation-bar__withBothAddons_5ow3j,
50
- .navigation-bar__content_5ow3j.navigation-bar__withCompactTitle_5ow3j {
49
+ } .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k,
50
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k {
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_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 {
57
+ } .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k > .navigation-bar__children_1p62k,
58
+ .navigation-bar__content_1p62k.navigation-bar__withBothAddons_1p62k > .navigation-bar__title_1p62k,
59
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k > .navigation-bar__children_1p62k,
60
+ .navigation-bar__content_1p62k.navigation-bar__withCompactTitle_1p62k > .navigation-bar__title_1p62k {
61
61
  -webkit-line-clamp: 1;
62
62
  word-break: break-all;
63
- } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j.navigation-bar__contentOnBotDesktop_5ow3j {
63
+ } .navigation-bar__content_1p62k.navigation-bar__contentOnBotDesktop_1p62k.navigation-bar__contentOnBotDesktop_1p62k {
64
64
  padding-top: var(--gap-s);
65
- } .navigation-bar__content_5ow3j.navigation-bar__contentOnBotMobile_5ow3j.navigation-bar__contentOnBotMobile_5ow3j {
65
+ } .navigation-bar__content_1p62k.navigation-bar__contentOnBotMobile_1p62k.navigation-bar__contentOnBotMobile_1p62k {
66
66
  padding-top: var(--gap-s);
67
- } .navigation-bar__title_5ow3j {
67
+ } .navigation-bar__title_1p62k {
68
68
  word-break: break-word;
69
- } .navigation-bar__subtitle_5ow3j {
69
+ } .navigation-bar__subtitle_1p62k {
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_5ow3j {
80
+ } .navigation-bar__addonsWrapper_1p62k {
81
81
  display: flex;
82
- } .navigation-bar__rightAddons_5ow3j {
82
+ } .navigation-bar__rightAddons_1p62k {
83
83
  margin-left: auto;
84
- } .navigation-bar__addon_5ow3j {
84
+ } .navigation-bar__addon_1p62k {
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_5ow3j {
92
+ } .navigation-bar__bottomAddons_1p62k {
93
93
  pointer-events: all;
94
- } .navigation-bar__closer_5ow3j {
94
+ } .navigation-bar__closer_1p62k {
95
95
  margin-left: auto;
96
- } .navigation-bar__left_5ow3j {
96
+ } .navigation-bar__left_1p62k {
97
97
  text-align: left;
98
- } .navigation-bar__center_5ow3j {
98
+ } .navigation-bar__center_1p62k {
99
99
  text-align: center;
100
- } .navigation-bar__trim_5ow3j {
100
+ } .navigation-bar__trim_1p62k {
101
101
  overflow: hidden
102
- } .navigation-bar__trim_5ow3j .navigation-bar__title_5ow3j,
103
- .navigation-bar__trim_5ow3j .navigation-bar__children_5ow3j {
102
+ } .navigation-bar__trim_1p62k .navigation-bar__title_1p62k,
103
+ .navigation-bar__trim_1p62k .navigation-bar__children_1p62k {
104
104
  -webkit-line-clamp: 2;
105
105
  display: -webkit-box;
106
106
  -webkit-box-orient: vertical;
package/index.js CHANGED
@@ -1,9 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var Component = require('./Component.js');
4
6
  var components_closer_Component = require('./components/closer/Component.js');
5
7
  require('tslib');
6
8
  require('react');
9
+ require('react-merge-refs');
7
10
  require('classnames');
8
11
  require('@alfalab/hooks');
9
12
  require('./components/back-arrow-addon/Component.js');
@@ -1,4 +1,5 @@
1
- import { FC } from 'react';
1
+ /// <reference types="react" />
2
+ import React from 'react';
2
3
  import { NavigationBarProps } from "./types";
3
- declare const NavigationBar: FC<NavigationBarProps>;
4
+ declare const NavigationBar: React.ForwardRefExoticComponent<NavigationBarProps & React.RefAttributes<HTMLDivElement>>;
4
5
  export { NavigationBar };
@@ -1,4 +1,5 @@
1
- import React, { useState, useRef, useEffect } from 'react';
1
+ import React, { forwardRef, useState, useRef, useEffect } from 'react';
2
+ import mergeRefs from 'react-merge-refs';
2
3
  import cn from 'classnames';
3
4
  import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
4
5
  import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
@@ -16,12 +17,12 @@ const getDataTestId = (dataTestId, element) => {
16
17
  return dataTestId ? `${dataTestId}${elementPart}` : undefined;
17
18
  };
18
19
 
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"};
20
+ const styles = {"header":"navigation-bar__header_1p62k","backgroundImage":"navigation-bar__backgroundImage_1p62k","mainLine":"navigation-bar__mainLine_1p62k","mainLineSticky":"navigation-bar__mainLineSticky_1p62k","mainLineWithImageBg":"navigation-bar__mainLineWithImageBg_1p62k","content":"navigation-bar__content_1p62k","withBothAddons":"navigation-bar__withBothAddons_1p62k","withCompactTitle":"navigation-bar__withCompactTitle_1p62k","children":"navigation-bar__children_1p62k","title":"navigation-bar__title_1p62k","contentOnBotDesktop":"navigation-bar__contentOnBotDesktop_1p62k","contentOnBotMobile":"navigation-bar__contentOnBotMobile_1p62k","subtitle":"navigation-bar__subtitle_1p62k","addonsWrapper":"navigation-bar__addonsWrapper_1p62k","rightAddons":"navigation-bar__rightAddons_1p62k","addon":"navigation-bar__addon_1p62k","bottomAddons":"navigation-bar__bottomAddons_1p62k","closer":"navigation-bar__closer_1p62k","left":"navigation-bar__left_1p62k","center":"navigation-bar__center_1p62k","trim":"navigation-bar__trim_1p62k"};
20
21
  require('./index.css')
21
22
 
22
23
  /* eslint-disable complexity */
23
24
  const ADDONS_HEIGHT = 48;
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, }) => {
25
+ const NavigationBar = forwardRef(({ 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, }, ref) => {
25
26
  const [scrollTop, setScrollTop] = useState(0);
26
27
  const [titleMargin, setTitleMargin] = useState({ left: 0, right: 0 });
27
28
  const bottomContentRef = useRef(null);
@@ -91,8 +92,8 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
91
92
  React.createElement(BackArrowAddon, { textOpacity: textOpacity, view: view, onClick: onBack, "data-test-id": getDataTestId(dataTestId, 'back-button') })));
92
93
  };
93
94
  const renderContent = (args = {}) => {
94
- const { extraClassName, ref, style, hidden } = args;
95
- return (React.createElement("div", { style: { ...style, visibility: hidden ? 'hidden' : 'visible' }, ref: ref, className: cn(styles.content, extraClassName, contentClassName, styles[align], {
95
+ const { extraClassName, wrapperRef, style, hidden } = args;
96
+ return (React.createElement("div", { style: { ...style, visibility: hidden ? 'hidden' : 'visible' }, ref: wrapperRef, className: cn(styles.content, extraClassName, contentClassName, styles[align], {
96
97
  [styles.trim]: trim,
97
98
  [styles.withCompactTitle]: view === 'mobile' && compactTitle && hasContent,
98
99
  }), "aria-hidden": hidden },
@@ -102,10 +103,12 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
102
103
  };
103
104
  const renderCloser = () => (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
104
105
  React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose })));
105
- return (React.createElement("div", { ref: headerRef, className: cn(styles.header, className, { [styles.backgroundImage]: imageUrl }), "data-test-id": getDataTestId(dataTestId), style: {
106
+ return (React.createElement("div", { ref: mergeRefs([ref, headerRef]), className: cn(styles.header, className, { [styles.backgroundImage]: imageUrl }), "data-test-id": getDataTestId(dataTestId), style: {
106
107
  ...(imageUrl && { backgroundImage: `url(${imageUrl})` }),
107
108
  ...(withAnimation &&
108
- bottomContentRef.current && { top: -bottomContentRef.current.scrollHeight }),
109
+ bottomContentRef.current && {
110
+ top: -bottomContentRef.current.scrollHeight,
111
+ }),
109
112
  } },
110
113
  React.createElement("div", { className: cn(styles.mainLine, {
111
114
  [styles.mainLineSticky]: withAnimation,
@@ -138,7 +141,10 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
138
141
  style: {
139
142
  opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
140
143
  ...(align === 'center'
141
- ? { marginLeft: titleMargin.left, marginRight: titleMargin.right }
144
+ ? {
145
+ marginLeft: titleMargin.left,
146
+ marginRight: titleMargin.right,
147
+ }
142
148
  : null),
143
149
  },
144
150
  }),
@@ -147,7 +153,7 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
147
153
  hasCloser && renderCloser()))),
148
154
  showAnimatedContentOnBot &&
149
155
  renderContent({
150
- ref: bottomContentRef,
156
+ wrapperRef: bottomContentRef,
151
157
  extraClassName: styles.underAddons,
152
158
  style: { opacity: Math.max(0, 1 - scrollTop / ADDONS_HEIGHT) },
153
159
  hidden: scrollTop / ADDONS_HEIGHT > 1,
@@ -160,6 +166,6 @@ const NavigationBar = ({ addonClassName, className, contentClassName, closerClas
160
166
  }),
161
167
  }),
162
168
  bottomAddons && (React.createElement("div", { className: cn(styles.bottomAddons, bottomAddonsClassName) }, bottomAddons))));
163
- };
169
+ });
164
170
 
165
171
  export { NavigationBar };
@@ -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_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"};
8
+ const styles = {"component":"navigation-bar__component_1lkkr","mobileComponent":"navigation-bar__mobileComponent_1lkkr","flex":"navigation-bar__flex_1lkkr","iconWrapper":"navigation-bar__iconWrapper_1lkkr","text":"navigation-bar__text_1lkkr","mobileWrapper":"navigation-bar__mobileWrapper_1lkkr"};
9
9
  require('./index.css')
10
10
 
11
11
  const BackArrowAddon = ({ text = 'Назад', onClick, className, textOpacity = 1, view, ...htmlAttributes }) => {
@@ -1,13 +1,13 @@
1
- /* hash: 27iuz */
1
+ /* hash: 7mmij */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-graphic-primary: #0b1f35;
5
- --color-light-graphic-secondary: #6d7986;
6
- --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05);
4
+ --color-light-graphic-primary: #0e0e0e;
5
+ --color-light-graphic-secondary: #86868a;
6
+ --color-light-specialbg-secondary-transparent: rgba(11, 31, 53, 0.05); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
7
  --color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
8
- --color-light-graphic-primary-tint-20: rgb(60, 76, 93);
9
- --color-light-graphic-primary-tint-30: rgb(84, 98, 114);
10
- } :root {
8
+ --color-light-graphic-primary-tint-20: rgb(62, 62, 62);
9
+ --color-light-graphic-primary-tint-30: rgb(86, 86, 86);
10
+ } :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 */
11
11
  } :root {
12
12
  } :root {
13
13
 
@@ -24,46 +24,46 @@
24
24
  --gap-s: 12px;
25
25
  } :root {
26
26
  } :root {
27
- } .navigation-bar__component_swc35 {
27
+ } .navigation-bar__component_1lkkr {
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_swc35 svg > path {
33
+ } .navigation-bar__component_1lkkr svg > path {
34
34
  transition: fill 0.2s ease;
35
35
  fill: var(--color-light-graphic-primary);
36
- } .navigation-bar__component_swc35:hover svg > path {
36
+ } .navigation-bar__component_1lkkr:hover svg > path {
37
37
  fill: var(--color-light-graphic-primary-tint-20);
38
- } .navigation-bar__component_swc35:active svg > path {
38
+ } .navigation-bar__component_1lkkr:active svg > path {
39
39
  fill: var(--color-light-graphic-primary-tint-30);
40
- } .navigation-bar__mobileComponent_swc35 {
40
+ } .navigation-bar__mobileComponent_1lkkr {
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_swc35 {
46
+ } .navigation-bar__flex_1lkkr {
47
47
  display: flex;
48
48
  align-items: center;
49
- } .navigation-bar__iconWrapper_swc35 {
49
+ } .navigation-bar__iconWrapper_1lkkr {
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_swc35 + .navigation-bar__text_swc35 {
56
+ } .navigation-bar__iconWrapper_1lkkr + .navigation-bar__text_1lkkr {
57
57
  margin-right: var(--gap-s);
58
- } .navigation-bar__mobileWrapper_swc35 {
58
+ } .navigation-bar__mobileWrapper_1lkkr {
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_swc35 + .navigation-bar__text_swc35 {
65
+ } .navigation-bar__mobileWrapper_1lkkr + .navigation-bar__text_1lkkr {
66
66
  margin: 0 var(--gap-s) 0 var(--gap-xs);
67
- } .navigation-bar__mobileWrapper_swc35 svg > path {
67
+ } .navigation-bar__mobileWrapper_1lkkr 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_kmb9l","button":"navigation-bar__button_kmb9l","mobile":"navigation-bar__mobile_kmb9l","sticky":"navigation-bar__sticky_kmb9l"};
7
+ const styles = {"closer":"navigation-bar__closer_ylt19","button":"navigation-bar__button_ylt19","mobile":"navigation-bar__mobile_ylt19","sticky":"navigation-bar__sticky_ylt19"};
8
8
  require('./index.css')
9
9
 
10
10
  const Closer = ({ view, className, sticky, icon = view === 'desktop' ? CrossHeavyMIcon : CrossMIcon, dataTestId, onClose, ...restProps }) => {